@opengeoweb/core 3.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/index.esm.js +1286 -1232
  2. package/index.umd.js +1315 -1211
  3. package/lib/components/LayerManager/LayerManager.stories.d.ts +12 -0
  4. package/lib/components/LayerManager/LayerManagerConnect.stories.d.ts +18 -2
  5. package/lib/components/LayerManager/LayerManagerUtils.d.ts +49 -2
  6. package/lib/components/LayerManager/LayerSelect/LayerSelect.stories.d.ts +12 -0
  7. package/lib/components/LayerManager/LayerSelect/LayerSelectUtils.d.ts +3 -3
  8. package/lib/components/MapView/useKeyboardZoomAndPan.d.ts +1 -0
  9. package/lib/components/MapView/useKeyboardZoomAndPan.spec.d.ts +1 -0
  10. package/lib/components/MapView/useTouchZoomPan.d.ts +1 -0
  11. package/lib/components/MapView/useTouchZoomPan.spec.d.ts +1 -0
  12. package/lib/components/MapWarning/MapWarningProperties.d.ts +1 -0
  13. package/lib/components/MultiMapView/MultiMapViewConnect.d.ts +0 -1
  14. package/lib/components/ReactMapView/AdagucMapDraw.d.ts +12 -0
  15. package/lib/components/Snackbar/SnackbarWrapper.d.ts +9 -0
  16. package/lib/components/Snackbar/SnackbarWrapper.spec.d.ts +1 -0
  17. package/lib/components/Snackbar/SnackbarWrapper.stories.d.ts +7 -0
  18. package/lib/components/Snackbar/SnackbarWrapperConnect.d.ts +3 -0
  19. package/lib/components/Snackbar/SnackbarWrapperConnect.spec.d.ts +1 -0
  20. package/lib/components/Snackbar/index.d.ts +1 -0
  21. package/lib/components/TimeSlider/TimeSliderButtons/AutoUpdateButton/AutoUpdateButton.d.ts +2 -0
  22. package/lib/components/TimeSlider/TimeSliderButtons/SpeedButton/SpeedButton.d.ts +1 -0
  23. package/lib/components/TimeSlider/TimeSliderButtons/TimeSliderButtons.d.ts +0 -3
  24. package/lib/components/TimeSlider/TimeSliderButtons/TimeStepButton/TimeStepButton.d.ts +5 -3
  25. package/lib/components/TimeSlider/TimeSliderButtons/TimeStepButton/TimeStepButton.stories.d.ts +9 -0
  26. package/lib/components/TimeSlider/TimeSliderConnect.stories.d.ts +6 -0
  27. package/lib/index.d.ts +4 -3
  28. package/lib/store/coreModuleConfig.d.ts +1 -1
  29. package/lib/store/index.d.ts +1 -0
  30. package/lib/store/snackbar/config.d.ts +4 -0
  31. package/lib/store/snackbar/index.d.ts +2 -0
  32. package/lib/store/snackbar/reducer.d.ts +11 -0
  33. package/lib/store/snackbar/reducer.spec.d.ts +1 -0
  34. package/lib/store/snackbar/sagas.d.ts +5 -0
  35. package/lib/store/snackbar/sagas.spec.d.ts +1 -0
  36. package/lib/store/snackbar/selectors.d.ts +10 -0
  37. package/lib/store/snackbar/selectors.spec.d.ts +1 -0
  38. package/lib/store/snackbar/types.d.ts +15 -0
  39. package/lib/storybookUtils/HelperComponents.d.ts +0 -1
  40. package/lib/storybookUtils/storyComponents/MapDrawGeoJSON.d.ts +34 -7
  41. package/lib/utils/jsonPresetFilter.d.ts +11 -12
  42. package/lib/utils/types.d.ts +2 -1
  43. package/package.json +5 -6
  44. package/lib/storybookUtils/storyComponents/MapDrawGeoJSONStyles.d.ts +0 -4
package/index.esm.js CHANGED
@@ -1,20 +1,17 @@
1
- import { createAction, createSlice, createSelector } from '@reduxjs/toolkit';
1
+ import { createAction, createSlice, createSelector, createEntityAdapter } from '@reduxjs/toolkit';
2
2
  import produce$1, { current, produce } from 'immer';
3
3
  import moment from 'moment';
4
4
  import * as React from 'react';
5
5
  import React__default, { Component, useRef, useState, useEffect } from 'react';
6
6
  import _, { isEqual, debounce, throttle, range } from 'lodash';
7
- import { takeLatest, put, select, call, all, takeEvery } from 'redux-saga/effects';
7
+ import { takeLatest, put, select, call, all, takeEvery, delay } from 'redux-saga/effects';
8
8
  import { connect, useDispatch, useSelector, Provider } from 'react-redux';
9
- import { Tooltip, Paper, Typography, Grid, InputLabel, IconButton, Box, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, MenuItem, FormControl, LinearProgress, InputAdornment, ListItemSecondaryAction, ListItemIcon, Checkbox, Switch, Slider, FormControlLabel, Popover, useMediaQuery, useTheme, SliderThumb } from '@mui/material';
9
+ import { Tooltip, Paper, Box, Typography, Grid, InputLabel, IconButton, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, MenuItem, FormControl, LinearProgress, InputAdornment, ListItemSecondaryAction, ListItemIcon, Checkbox, Switch, styled, Slider, Menu, Popover, useTheme, SliderThumb, Snackbar } from '@mui/material';
10
10
  import { ToolButton, ToolContainerDraggable, TooltipSelect, AlertIcon, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, ManagerButton, EnableButton, AlertBanner, ManagerDeleteButton, CustomToggleButton, useIsMounted } from '@opengeoweb/shared';
11
11
  import { Pause, Play, Cached, Add, Copy, Flag, DragHandle as DragHandle$1, Filter, Close, Search, Clear, ChevronLeft, ChevronRight, Edit, Delete, Home, Minus, Layers, Equalizer, Sort, Link, LinkOff, AutoUpdateActive, AutoUpdateInActive, TextIcon, FastForward, Options, SliderThumb as SliderThumb$1, List as List$1, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
12
- import makeStyles from '@mui/styles/makeStyles';
13
12
  import { legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, WMGetServiceFromStore, LayerType as LayerType$1, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer } from '@opengeoweb/webmap';
14
13
  import { Sortable, ReactSortable } from 'react-sortablejs';
15
- import createStyles from '@mui/styles/createStyles';
16
14
  import { FixedSizeList } from 'react-window';
17
- import withStyles from '@mui/styles/withStyles';
18
15
  import { debounce as debounce$1 } from 'throttle-debounce';
19
16
  import cloneDeep from 'lodash.clonedeep';
20
17
  import proj4 from 'proj4';
@@ -1440,7 +1437,7 @@ var createLayer = function createLayer(_a) {
1440
1437
  status: status
1441
1438
  });
1442
1439
  };
1443
- var initialState$5 = {
1440
+ var initialState$6 = {
1444
1441
  byId: {},
1445
1442
  allIds: [],
1446
1443
  availableBaseLayers: {
@@ -1448,8 +1445,8 @@ var initialState$5 = {
1448
1445
  allIds: []
1449
1446
  }
1450
1447
  };
1451
- var slice$5 = createSlice({
1452
- initialState: initialState$5,
1448
+ var slice$6 = createSlice({
1449
+ initialState: initialState$6,
1453
1450
  name: 'layerReducer',
1454
1451
  reducers: {
1455
1452
  addLayer: function addLayer(draft, action) {
@@ -1683,9 +1680,9 @@ var slice$5 = createSlice({
1683
1680
  layerDimensions = _action$payload11.layerDimensions;
1684
1681
  var layerStyleAction = layerActions.layerChangeStyle(layerStyle);
1685
1682
  var state = current(draft);
1686
- var intermediateState = layerStyle === null ? state : reducer$5(state, layerStyleAction);
1683
+ var intermediateState = layerStyle === null ? state : reducer$6(state, layerStyleAction);
1687
1684
  var dimensionsAction = layerActions.layerSetDimensions(layerDimensions);
1688
- var newState = layerDimensions === null ? intermediateState : reducer$5(intermediateState, dimensionsAction);
1685
+ var newState = layerDimensions === null ? intermediateState : reducer$6(intermediateState, dimensionsAction);
1689
1686
  return newState;
1690
1687
  }
1691
1688
  },
@@ -1730,7 +1727,7 @@ var slice$5 = createSlice({
1730
1727
  };
1731
1728
  /* Handle the Layer action with the same logic, using the same reducer */
1732
1729
 
1733
- return reducer$5(prevState, action);
1730
+ return reducer$6(prevState, action);
1734
1731
  }, state);
1735
1732
  }).addCase(setMapPreset, function (draft, action) {
1736
1733
  var mapId = action.payload.mapId;
@@ -1750,8 +1747,8 @@ var slice$5 = createSlice({
1750
1747
  });
1751
1748
  }
1752
1749
  });
1753
- var reducer$5 = slice$5.reducer;
1754
- var layerActions = slice$5.actions;
1750
+ var reducer$6 = slice$6.reducer;
1751
+ var layerActions = slice$6.actions;
1755
1752
 
1756
1753
  /* *
1757
1754
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1769,12 +1766,12 @@ var layerActions = slice$5.actions;
1769
1766
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1770
1767
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
1771
1768
  * */
1772
- var initialState$4 = {
1769
+ var initialState$5 = {
1773
1770
  byId: {},
1774
1771
  allIds: []
1775
1772
  };
1776
- var slice$4 = createSlice({
1777
- initialState: initialState$4,
1773
+ var slice$5 = createSlice({
1774
+ initialState: initialState$5,
1778
1775
  name: 'serviceReducer',
1779
1776
  reducers: {
1780
1777
  serviceSetLayers: function serviceSetLayers(draft, action) {
@@ -1801,13 +1798,13 @@ var slice$4 = createSlice({
1801
1798
  var serviceLayers = action.payload.serviceLayers;
1802
1799
  if (serviceLayers === null) return draft;
1803
1800
  var mapAction = serviceActions.serviceSetLayers(serviceLayers);
1804
- var newState = reducer$4(draft, mapAction);
1801
+ var newState = reducer$5(draft, mapAction);
1805
1802
  return newState;
1806
1803
  });
1807
1804
  }
1808
1805
  });
1809
- var reducer$4 = slice$4.reducer;
1810
- var serviceActions = slice$4.actions;
1806
+ var reducer$5 = slice$5.reducer;
1807
+ var serviceActions = slice$5.actions;
1811
1808
 
1812
1809
  /* *
1813
1810
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1992,13 +1989,13 @@ var createUIDialogElement = function createUIDialogElement(_ref) {
1992
1989
  source: source
1993
1990
  };
1994
1991
  };
1995
- var initialState$3 = {
1992
+ var initialState$4 = {
1996
1993
  order: [],
1997
1994
  dialogs: {},
1998
1995
  activeWindowId: undefined
1999
1996
  };
2000
- var slice$3 = createSlice({
2001
- initialState: initialState$3,
1997
+ var slice$4 = createSlice({
1998
+ initialState: initialState$4,
2002
1999
  name: 'uiReducer',
2003
2000
  reducers: {
2004
2001
  registerDialog: function registerDialog(draft, action) {
@@ -2075,8 +2072,8 @@ var slice$3 = createSlice({
2075
2072
  }
2076
2073
  }
2077
2074
  });
2078
- var reducer$3 = slice$3.reducer;
2079
- var uiActions = slice$3.actions;
2075
+ var reducer$4 = slice$4.reducer;
2076
+ var uiActions = slice$4.actions;
2080
2077
 
2081
2078
  var addBaseLayer = layerActions.addBaseLayer,
2082
2079
  addLayer$1 = layerActions.addLayer,
@@ -2127,12 +2124,12 @@ var createLayersWithIds = function createLayersWithIds(state, layers) {
2127
2124
  });
2128
2125
  };
2129
2126
 
2130
- var initialState$2 = {
2127
+ var initialState$3 = {
2131
2128
  byId: {},
2132
2129
  allIds: []
2133
2130
  };
2134
- var slice$2 = createSlice({
2135
- initialState: initialState$2,
2131
+ var slice$3 = createSlice({
2132
+ initialState: initialState$3,
2136
2133
  name: 'mapReducer',
2137
2134
  reducers: {
2138
2135
  registerMap: function registerMap(draft, action) {
@@ -2698,13 +2695,13 @@ var slice$2 = createSlice({
2698
2695
  };
2699
2696
  /* Handle the Layer action with the same logic, using the same reducer */
2700
2697
 
2701
- return reducer$2(prevState, action);
2698
+ return reducer$3(prevState, action);
2702
2699
  }, draft);
2703
2700
  }).addCase(onUpdateLayerInformation, function (draft, action) {
2704
2701
  var mapDimensions = action.payload.mapDimensions;
2705
2702
  if (mapDimensions === null) return draft;
2706
2703
  var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
2707
- return reducer$2(draft, mapAction);
2704
+ return reducer$3(draft, mapAction);
2708
2705
  }).addCase(mapChangeDimension, function (draft, action) {
2709
2706
  var _action$payload36 = action.payload,
2710
2707
  mapId = _action$payload36.mapId,
@@ -2743,11 +2740,11 @@ var slice$2 = createSlice({
2743
2740
  });
2744
2741
  }
2745
2742
  });
2746
- var mapActions$1 = Object.assign(Object.assign({}, slice$2.actions), {
2743
+ var mapActions$1 = Object.assign(Object.assign({}, slice$3.actions), {
2747
2744
  setMapPreset: setMapPreset,
2748
2745
  mapChangeDimension: mapChangeDimension
2749
2746
  });
2750
- var reducer$2 = slice$2.reducer;
2747
+ var reducer$3 = slice$3.reducer;
2751
2748
 
2752
2749
  /* *
2753
2750
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -3244,7 +3241,7 @@ var removeInPlace = function removeInPlace(inDraftArray, condition) {
3244
3241
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3245
3242
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
3246
3243
  * */
3247
- var initialState$1 = {
3244
+ var initialState$2 = {
3248
3245
  sources: {
3249
3246
  byId: {},
3250
3247
  allIds: []
@@ -3268,8 +3265,8 @@ var initialState$1 = {
3268
3265
  }
3269
3266
  }
3270
3267
  };
3271
- var slice$1 = createSlice({
3272
- initialState: initialState$1,
3268
+ var slice$2 = createSlice({
3269
+ initialState: initialState$2,
3273
3270
  name: 'synchronizationGroupsReducer',
3274
3271
  reducers: {
3275
3272
  syncGroupAddSource: function syncGroupAddSource(draft, action) {
@@ -3413,7 +3410,7 @@ var slice$1 = createSlice({
3413
3410
  });
3414
3411
  },
3415
3412
  syncGroupClear: function syncGroupClear() {
3416
- return initialState$1;
3413
+ return initialState$2;
3417
3414
  },
3418
3415
  syncGroupSetViewState: function syncGroupSetViewState(draft, action) {
3419
3416
  var viewState = action.payload.viewState;
@@ -3485,7 +3482,7 @@ var setBboxOrTimeSync = function setBboxOrTimeSync(state, action) {
3485
3482
  });
3486
3483
  };
3487
3484
 
3488
- var _slice$actions = slice$1.actions,
3485
+ var _slice$actions = slice$2.actions,
3489
3486
  syncGroupAddGroup = _slice$actions.syncGroupAddGroup,
3490
3487
  syncGroupAddSource = _slice$actions.syncGroupAddSource,
3491
3488
  syncGroupAddTarget = _slice$actions.syncGroupAddTarget;
@@ -3495,8 +3492,8 @@ var _slice$actions = slice$1.actions,
3495
3492
  syncGroupRemoveSource = _slice$actions.syncGroupRemoveSource,
3496
3493
  syncGroupRemoveTarget = _slice$actions.syncGroupRemoveTarget,
3497
3494
  syncGroupSetViewState = _slice$actions.syncGroupSetViewState;
3498
- var actions = slice$1.actions,
3499
- reducer$1 = slice$1.reducer;
3495
+ var actions = slice$2.actions,
3496
+ reducer$2 = slice$2.reducer;
3500
3497
 
3501
3498
  /* *
3502
3499
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -3553,7 +3550,7 @@ var index = /*#__PURE__*/Object.freeze({
3553
3550
  actions: actions,
3554
3551
  constants: constants,
3555
3552
  types: types$1,
3556
- initialState: initialState$1
3553
+ initialState: initialState$2
3557
3554
  });
3558
3555
 
3559
3556
  /* *
@@ -4359,7 +4356,7 @@ var selectors = /*#__PURE__*/Object.freeze({
4359
4356
  getMapPresetError: getMapPresetError
4360
4357
  });
4361
4358
 
4362
- var initialState = {
4359
+ var initialState$1 = {
4363
4360
  filters: {
4364
4361
  searchFilter: '',
4365
4362
  activeServices: {
@@ -4372,8 +4369,8 @@ var initialState = {
4372
4369
  }
4373
4370
  }
4374
4371
  };
4375
- var slice = createSlice({
4376
- initialState: initialState,
4372
+ var slice$1 = createSlice({
4373
+ initialState: initialState$1,
4377
4374
  name: 'layerSelect',
4378
4375
  reducers: {
4379
4376
  setSearchFilter: function setSearchFilter(draft, action) {
@@ -4532,8 +4529,8 @@ var slice = createSlice({
4532
4529
  }
4533
4530
  }
4534
4531
  });
4535
- var reducer = slice.reducer;
4536
- var layerSelectActions = slice.actions;
4532
+ var reducer$1 = slice$1.reducer;
4533
+ var layerSelectActions = slice$1.actions;
4537
4534
 
4538
4535
  /* *
4539
4536
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -4665,6 +4662,80 @@ var getKeywordObjectById = function getKeywordObjectById(store, keywordId) {
4665
4662
  return (_d = (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.keywords) === null || _c === void 0 ? void 0 : _c.byId[keywordId]) !== null && _d !== void 0 ? _d : {};
4666
4663
  };
4667
4664
 
4665
+ /* *
4666
+ * Licensed under the Apache License, Version 2.0 (the "License");
4667
+ * you may not use this file except in compliance with the License.
4668
+ * You may obtain a copy of the License at
4669
+ *
4670
+ * http://www.apache.org/licenses/LICENSE-2.0
4671
+ *
4672
+ * Unless required by applicable law or agreed to in writing, software
4673
+ * distributed under the License is distributed on an "AS IS" BASIS,
4674
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4675
+ * See the License for the specific language governing permissions and
4676
+ * limitations under the License.
4677
+ *
4678
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4679
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
4680
+ * */
4681
+ var snackbarAdapter = createEntityAdapter();
4682
+ var initialState = snackbarAdapter.getInitialState();
4683
+ var slice = createSlice({
4684
+ initialState: initialState,
4685
+ name: 'snackbar',
4686
+ reducers: {
4687
+ // To open the snackbar call this action
4688
+ // eslint-disable-next-line no-unused-vars
4689
+ openSnackbar: function openSnackbar(draft, action) {},
4690
+ // triggerOpenSnackbarBySaga is triggered by the saga to open the snackbar after the current snackbars have all been closed
4691
+ // DO NOT CALL THIS ACTION DIRECTLY!
4692
+ triggerOpenSnackbarBySaga: function triggerOpenSnackbarBySaga(draft, action) {
4693
+ var snackbarContent = action.payload.snackbarContent; // Ensure we have an id before proceeding
4694
+
4695
+ if (snackbarContent.id === undefined) {
4696
+ return;
4697
+ }
4698
+
4699
+ snackbarAdapter.setOne(draft, snackbarContent);
4700
+ },
4701
+ closeSnackbar: function closeSnackbar(draft) {
4702
+ snackbarAdapter.removeAll(draft);
4703
+ }
4704
+ }
4705
+ });
4706
+ var reducer = slice.reducer;
4707
+ var snackbarActions = slice.actions;
4708
+
4709
+ /* *
4710
+ * Licensed under the Apache License, Version 2.0 (the "License");
4711
+ * you may not use this file except in compliance with the License.
4712
+ * You may obtain a copy of the License at
4713
+ *
4714
+ * http://www.apache.org/licenses/LICENSE-2.0
4715
+ *
4716
+ * Unless required by applicable law or agreed to in writing, software
4717
+ * distributed under the License is distributed on an "AS IS" BASIS,
4718
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4719
+ * See the License for the specific language governing permissions and
4720
+ * limitations under the License.
4721
+ *
4722
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4723
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
4724
+ * */
4725
+
4726
+ var _snackbarAdapter$getS = snackbarAdapter.getSelectors(function (state) {
4727
+ var _a;
4728
+
4729
+ return (_a = state === null || state === void 0 ? void 0 : state.snackbar) !== null && _a !== void 0 ? _a : {
4730
+ entities: {},
4731
+ ids: []
4732
+ };
4733
+ }),
4734
+ getCurrentSnackbarMessages = _snackbarAdapter$getS.selectAll;
4735
+ var getFirstSnackbarMessage = createSelector(getCurrentSnackbarMessages, function (currentMessages) {
4736
+ return currentMessages.length > 0 ? currentMessages[0] : undefined;
4737
+ });
4738
+
4668
4739
  var types = /*#__PURE__*/Object.freeze({
4669
4740
  __proto__: null
4670
4741
  });
@@ -4996,15 +5067,15 @@ var getMapBaseLayerActionsTargets = function getMapBaseLayerActionsTargets(state
4996
5067
  });
4997
5068
  };
4998
5069
 
4999
- var _marked$4 = /*#__PURE__*/regeneratorRuntime.mark(setTimeSaga),
5000
- _marked2$4 = /*#__PURE__*/regeneratorRuntime.mark(setBBoxSaga),
5070
+ var _marked$5 = /*#__PURE__*/regeneratorRuntime.mark(setTimeSaga),
5071
+ _marked2$5 = /*#__PURE__*/regeneratorRuntime.mark(setBBoxSaga),
5001
5072
  _marked3$4 = /*#__PURE__*/regeneratorRuntime.mark(layerActionsSaga),
5002
5073
  _marked4$2 = /*#__PURE__*/regeneratorRuntime.mark(addLayerActionsSaga),
5003
5074
  _marked5$2 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
5004
5075
  _marked6$1 = /*#__PURE__*/regeneratorRuntime.mark(moveLayerActionsSaga),
5005
5076
  _marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(setActiveLayerIdActionsSaga),
5006
5077
  _marked8$1 = /*#__PURE__*/regeneratorRuntime.mark(mapBaseLayerActionsSaga),
5007
- _marked9$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$4);
5078
+ _marked9$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$5);
5008
5079
  var setBaseLayers = layerActions.setBaseLayers,
5009
5080
  addLayer = layerActions.addLayer,
5010
5081
  layerChangeDimension = layerActions.layerChangeDimension,
@@ -5052,7 +5123,7 @@ function setTimeSaga(_ref) {
5052
5123
  return _context.stop();
5053
5124
  }
5054
5125
  }
5055
- }, _marked$4);
5126
+ }, _marked$5);
5056
5127
  }
5057
5128
  function setBBoxSaga(_ref2) {
5058
5129
  var payload, targets, groups;
@@ -5079,7 +5150,7 @@ function setBBoxSaga(_ref2) {
5079
5150
  return _context2.stop();
5080
5151
  }
5081
5152
  }
5082
- }, _marked2$4);
5153
+ }, _marked2$5);
5083
5154
  }
5084
5155
  function layerActionsSaga(_ref3) {
5085
5156
  var payload, type, targets;
@@ -5294,7 +5365,7 @@ function mapBaseLayerActionsSaga(_ref8) {
5294
5365
  }
5295
5366
  }, _marked8$1);
5296
5367
  }
5297
- function rootSaga$4() {
5368
+ function rootSaga$5() {
5298
5369
  return regeneratorRuntime.wrap(function rootSaga$(_context9) {
5299
5370
  while (1) {
5300
5371
  switch (_context9.prev = _context9.next) {
@@ -5453,11 +5524,11 @@ var sources = function sources(store) {
5453
5524
 
5454
5525
  var createSyncGroupViewStateSelector = createSelector(groups, sources, createSyncGroupViewState);
5455
5526
 
5456
- var _marked$3 = /*#__PURE__*/regeneratorRuntime.mark(updateSourceValueWhenLinkingComponentToGroupSaga),
5457
- _marked2$3 = /*#__PURE__*/regeneratorRuntime.mark(addGroupTargetSaga),
5527
+ var _marked$4 = /*#__PURE__*/regeneratorRuntime.mark(updateSourceValueWhenLinkingComponentToGroupSaga),
5528
+ _marked2$4 = /*#__PURE__*/regeneratorRuntime.mark(addGroupTargetSaga),
5458
5529
  _marked3$3 = /*#__PURE__*/regeneratorRuntime.mark(linkGroupTargetSaga),
5459
5530
  _marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(updateViewStateSaga),
5460
- _marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
5531
+ _marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$4);
5461
5532
  function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
5462
5533
  var group;
5463
5534
  return regeneratorRuntime.wrap(function updateSourceValueWhenLinkingComponentToGroupSaga$(_context) {
@@ -5524,7 +5595,7 @@ function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdat
5524
5595
  return _context.stop();
5525
5596
  }
5526
5597
  }
5527
- }, _marked$3);
5598
+ }, _marked$4);
5528
5599
  }
5529
5600
  function addGroupTargetSaga(_ref) {
5530
5601
  var payload, groupId, linked, targetToUpdate;
@@ -5548,7 +5619,7 @@ function addGroupTargetSaga(_ref) {
5548
5619
  return _context2.stop();
5549
5620
  }
5550
5621
  }
5551
- }, _marked2$3);
5622
+ }, _marked2$4);
5552
5623
  }
5553
5624
  function linkGroupTargetSaga(_ref2) {
5554
5625
  var payload, groupId, linked, targetToUpdate;
@@ -5598,7 +5669,7 @@ function updateViewStateSaga() {
5598
5669
  }, _marked4$1);
5599
5670
  }
5600
5671
 
5601
- function rootSaga$3() {
5672
+ function rootSaga$4() {
5602
5673
  return regeneratorRuntime.wrap(function rootSaga$(_context5) {
5603
5674
  while (1) {
5604
5675
  switch (_context5.prev = _context5.next) {
@@ -5665,14 +5736,14 @@ function rootSaga$3() {
5665
5736
  var synchronizationGroupConfig = {
5666
5737
  id: 'syncronizationGroupStore-module',
5667
5738
  reducerMap: {
5668
- syncronizationGroupStore: reducer$1
5739
+ syncronizationGroupStore: reducer$2
5669
5740
  },
5670
- sagas: [rootSaga$4, rootSaga$3]
5741
+ sagas: [rootSaga$5, rootSaga$4]
5671
5742
  };
5672
5743
 
5673
- var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
5674
- _marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
5675
- _marked3$2 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
5744
+ var _marked$3 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
5745
+ _marked2$3 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
5746
+ _marked3$2 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
5676
5747
  function registerMapUISaga() {
5677
5748
  var fields, source;
5678
5749
  return regeneratorRuntime.wrap(function registerMapUISaga$(_context) {
@@ -5708,7 +5779,7 @@ function registerMapUISaga() {
5708
5779
  return _context.stop();
5709
5780
  }
5710
5781
  }
5711
- }, _marked$2);
5782
+ }, _marked$3);
5712
5783
  }
5713
5784
  function unregisterUIMapSaga() {
5714
5785
  var fields, activeUI;
@@ -5760,9 +5831,9 @@ function unregisterUIMapSaga() {
5760
5831
  return _context2.stop();
5761
5832
  }
5762
5833
  }
5763
- }, _marked2$2);
5834
+ }, _marked2$3);
5764
5835
  }
5765
- function rootSaga$2() {
5836
+ function rootSaga$3() {
5766
5837
  return regeneratorRuntime.wrap(function rootSaga$(_context3) {
5767
5838
  while (1) {
5768
5839
  switch (_context3.prev = _context3.next) {
@@ -5801,9 +5872,9 @@ function rootSaga$2() {
5801
5872
  var uiModuleConfig = {
5802
5873
  id: 'ui-module',
5803
5874
  reducerMap: {
5804
- ui: reducer$3
5875
+ ui: reducer$4
5805
5876
  },
5806
- sagas: [rootSaga$2]
5877
+ sagas: [rootSaga$3]
5807
5878
  };
5808
5879
 
5809
5880
  /* *
@@ -5971,100 +6042,51 @@ var PlayButtonConnect = connectRedux$6(function (_ref) {
5971
6042
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
5972
6043
  * */
5973
6044
 
5974
- var parseBoolean = function parseBoolean(value) {
5975
- return ['true', 'false', true, false].includes(value) && JSON.parse(value);
5976
- };
5977
-
5978
- var isBaseLayer = function isBaseLayer(layer) {
5979
- return ['baseLayer'].includes(layer.layerType);
5980
- };
5981
-
5982
- var isMapLayer = function isMapLayer(layer) {
5983
- return ['mapLayer'].includes(layer.layerType);
5984
- };
5985
-
5986
- var isOverLayer = function isOverLayer(layer) {
5987
- return ['overLayer'].includes(layer.layerType);
5988
- };
5989
-
5990
6045
  var isValidService = function isValidService(service) {
5991
6046
  return Object.prototype.hasOwnProperty.call(service, 'url');
5992
6047
  };
5993
6048
 
5994
- var parseLayerType = function parseLayerType(layer, defaultValue) {
5995
- if (isBaseLayer(layer)) {
5996
- return LayerType.baseLayer;
5997
- }
5998
-
5999
- if (isMapLayer(layer)) {
6000
- return LayerType.mapLayer;
6001
- }
6002
-
6003
- if (isOverLayer(layer)) {
6004
- return LayerType.overLayer;
6005
- }
6006
-
6007
- return defaultValue;
6049
+ var parseBoolean = function parseBoolean(value) {
6050
+ return typeof value === 'boolean' ? value : value === 'true';
6008
6051
  };
6009
-
6010
6052
  var parseLayer = function parseLayer(layer) {
6011
- var lr = JSON.parse(JSON.stringify(layer)); // Cloning used here to achieve object immutability
6012
-
6013
- if (!lr.id) {
6014
- lr.id = generateLayerId();
6015
- }
6016
-
6017
- if (lr.layerType) {
6018
- lr.layerType = parseLayerType(lr, null);
6019
- }
6020
-
6021
- if (lr.enabled) {
6022
- lr.enabled = parseBoolean(lr.enabled);
6023
- }
6024
-
6025
- return lr;
6053
+ return Object.assign(Object.assign(Object.assign({}, layer), !layer.id && {
6054
+ id: generateLayerId()
6055
+ }), layer.enabled && {
6056
+ enabled: parseBoolean(layer.enabled)
6057
+ });
6026
6058
  };
6027
6059
 
6028
- var filterBaseLayers = function filterBaseLayers(presetArray) {
6029
- var hasLayers = presetArray && Array.isArray(presetArray) && presetArray.length > 0;
6030
- var filteredBaseLayers = hasLayers ? presetArray.filter(function (preset) {
6031
- return isBaseLayer(preset);
6032
- }).map(function (filteredPresetLayer) {
6033
- return parseLayer(filteredPresetLayer);
6034
- }) : null;
6035
- var hasBaseLayers = filteredBaseLayers && filteredBaseLayers.length > 0;
6036
- var baseLayers = hasBaseLayers ? filteredBaseLayers : undefined;
6037
- return baseLayers;
6038
- };
6039
- var filterMapLayers = function filterMapLayers(presetArray) {
6040
- var hasLayers = presetArray && Array.isArray(presetArray) && presetArray.length > 0;
6041
- var filteredMapLayers = hasLayers ? presetArray.filter(function (preset) {
6042
- return isMapLayer(preset);
6043
- }).map(function (filteredPresetLayer) {
6044
- return parseLayer(filteredPresetLayer);
6045
- }) : null;
6046
- var hasMapLayers = filteredMapLayers && filteredMapLayers.length > 0;
6047
- var mapLayers = hasMapLayers ? filteredMapLayers : undefined;
6048
- return mapLayers;
6060
+ var createEmtpyFilteredList = function createEmtpyFilteredList(existingList) {
6061
+ return {
6062
+ mapLayers: existingList,
6063
+ baseLayers: existingList,
6064
+ overLayers: existingList
6065
+ };
6049
6066
  };
6067
+
6050
6068
  var filterLayers = function filterLayers() {
6051
6069
  var layers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6070
+ var layerParser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (layer) {
6071
+ return layer;
6072
+ };
6052
6073
  return layers.reduce(function (layers, layer) {
6053
6074
  var mapLayers = layers.mapLayers,
6054
6075
  baseLayers = layers.baseLayers,
6055
6076
  overLayers = layers.overLayers;
6077
+ var parsedLayer = layerParser(layer);
6056
6078
 
6057
6079
  if (layer.layerType === LayerType.baseLayer) {
6058
6080
  return {
6059
6081
  mapLayers: mapLayers,
6060
- baseLayers: baseLayers.concat(layer),
6082
+ baseLayers: baseLayers.concat(parsedLayer),
6061
6083
  overLayers: overLayers
6062
6084
  };
6063
6085
  }
6064
6086
 
6065
6087
  if (layer.layerType === LayerType.mapLayer) {
6066
6088
  return {
6067
- mapLayers: mapLayers.concat(layer),
6089
+ mapLayers: mapLayers.concat(parsedLayer),
6068
6090
  baseLayers: baseLayers,
6069
6091
  overLayers: overLayers
6070
6092
  };
@@ -6074,16 +6096,12 @@ var filterLayers = function filterLayers() {
6074
6096
  return {
6075
6097
  mapLayers: mapLayers,
6076
6098
  baseLayers: baseLayers,
6077
- overLayers: overLayers.concat(layer)
6099
+ overLayers: overLayers.concat(parsedLayer)
6078
6100
  };
6079
6101
  }
6080
6102
 
6081
6103
  return layers;
6082
- }, {
6083
- mapLayers: [],
6084
- baseLayers: [],
6085
- overLayers: []
6086
- });
6104
+ }, createEmtpyFilteredList([]));
6087
6105
  };
6088
6106
  var filterServices = function filterServices(presetArray) {
6089
6107
  var hasServices = presetArray && Array.isArray(presetArray) && presetArray.length > 0;
@@ -6094,21 +6112,28 @@ var filterServices = function filterServices(presetArray) {
6094
6112
  var services = hasValidServices ? validServices : undefined;
6095
6113
  return services;
6096
6114
  };
6097
- var filterMapPresets = function filterMapPresets(presets) {
6098
- var preset = presets && presets.preset;
6099
- var filterredServices = preset && preset.services ? filterServices(preset.services) : undefined;
6100
- var baseServices = preset && preset.baseServices ? filterServices(preset.baseServices) : undefined;
6101
- var filteredBaseLayers = preset && preset.layers ? filterBaseLayers(preset.layers) : undefined;
6102
- var filteredMapLayers = preset && preset.layers ? filterMapLayers(preset.layers) : undefined;
6115
+ var filterMapPresets = function filterMapPresets(initialAppPreset) {
6116
+ var preset = initialAppPreset && initialAppPreset.preset || {};
6117
+ var layers = preset.layers,
6118
+ services = preset.services,
6119
+ baseServices = preset.baseServices;
6120
+
6121
+ var _ref = layers ? filterLayers(layers, parseLayer) : createEmtpyFilteredList(undefined),
6122
+ baseLayers = _ref.baseLayers,
6123
+ mapLayers = _ref.mapLayers;
6124
+
6125
+ var filterredServices = services ? filterServices(services) : undefined;
6126
+ var filteredBaseServices = baseServices ? filterServices(baseServices) : undefined;
6103
6127
  var filteredPreset = {
6104
6128
  services: filterredServices,
6105
- baseServices: baseServices,
6106
- baseLayers: filteredBaseLayers,
6107
- mapLayers: filteredMapLayers
6129
+ baseServices: filteredBaseServices,
6130
+ baseLayers: baseLayers,
6131
+ mapLayers: mapLayers
6108
6132
  };
6109
6133
  return filteredPreset;
6110
- };
6111
- var getInitialPresets = function getInitialPresets(mapPreset, defaultInitialPresets) {
6134
+ }; // loads the initialPresets.json
6135
+
6136
+ var getInitialAppPresets = function getInitialAppPresets(mapPreset, defaultInitialPresets) {
6112
6137
  var filteredPresets = mapPreset ? filterMapPresets(mapPreset) : null;
6113
6138
  var initialPresets = filteredPresets || filterMapPresets(defaultInitialPresets);
6114
6139
  return initialPresets;
@@ -7035,43 +7060,7 @@ CanvasComponent.defaultProps = {
7035
7060
  };
7036
7061
 
7037
7062
  var defaultCanvasWidth = 150;
7038
- var defaultCanvasHeight = 30; // TODO: remove fontFamily styles after theming is fully implemented
7039
-
7040
- var useStyles$s = makeStyles(function (theme) {
7041
- return {
7042
- legendCanvas: {
7043
- margin: '10px 0px 10px 0px'
7044
- },
7045
- noLegendTitle: {
7046
- fontSize: '12px',
7047
- fontFamily: 'Roboto, Helvetica, Arial',
7048
- color: 'red'
7049
- },
7050
- legendComponent: {
7051
- padding: 10,
7052
- border: '1px solid grey',
7053
- display: 'inline-block',
7054
- backgroundColor: '#FFF',
7055
- overflow: 'hidden',
7056
- marginBottom: 4
7057
- },
7058
- legendTitle: {
7059
- fontFamily: 'Roboto, Helvetica, Arial',
7060
- fontSize: '10px',
7061
- minWidth: defaultCanvasWidth,
7062
- wordWrap: 'break-word',
7063
- color: theme.palette.common.black
7064
- },
7065
- legendInfo: {
7066
- fontFamily: 'Roboto, Helvetica, Arial',
7067
- fontSize: 10,
7068
- color: theme.palette.common.black,
7069
- overflowX: 'hidden',
7070
- minWidth: defaultCanvasWidth,
7071
- wordWrap: 'break-word'
7072
- }
7073
- };
7074
- });
7063
+ var defaultCanvasHeight = 30;
7075
7064
  /**
7076
7065
  * Renders a legendgraphic image based on a WMImage.
7077
7066
  *
@@ -7105,9 +7094,8 @@ var renderLegendGraphic = function renderLegendGraphic(wmImage, ctx, width, heig
7105
7094
 
7106
7095
  var Legend = function Legend(_ref) {
7107
7096
  var layer = _ref.layer;
7108
- var classes = useStyles$s();
7109
- /* Variable to remember the previous image */
7110
7097
 
7098
+ /* Variable to remember the previous image */
7111
7099
  var previousLegendImage = useRef(null);
7112
7100
  /* Function to force rerender of this component when legend image loads */
7113
7101
 
@@ -7154,23 +7142,36 @@ var Legend = function Legend(_ref) {
7154
7142
  var wmLayer = getWMLayerById(layer.id);
7155
7143
  return /*#__PURE__*/React__default.createElement(Paper, {
7156
7144
  "data-testid": "legend",
7157
- className: classes.legendComponent
7158
- }, /*#__PURE__*/React__default.createElement("div", {
7145
+ sx: {
7146
+ padding: '10px',
7147
+ border: '1px solid grey',
7148
+ display: 'inline-block',
7149
+ backgroundColor: '#FFF',
7150
+ overflow: 'hidden',
7151
+ marginBottom: 0.5
7152
+ }
7153
+ }, /*#__PURE__*/React__default.createElement(Box, {
7159
7154
  "data-testid": "legend-title",
7160
7155
  style: {
7161
7156
  maxWidth: canvasContainerWidth
7162
7157
  }
7163
7158
  }, /*#__PURE__*/React__default.createElement(Typography, {
7164
- className: classes.legendTitle,
7159
+ sx: {
7160
+ fontFamily: 'Roboto, Helvetica, Arial',
7161
+ fontSize: '10px',
7162
+ minWidth: "".concat(defaultCanvasWidth, "px"),
7163
+ wordWrap: 'break-word',
7164
+ color: 'common.black'
7165
+ },
7165
7166
  variant: "h3"
7166
7167
  }, wmLayer && wmLayer.title)), /*#__PURE__*/React__default.createElement(Tooltip, {
7167
7168
  title: wmLayer && wmLayer.title || 'loading',
7168
7169
  placement: "top"
7169
- }, /*#__PURE__*/React__default.createElement("div", {
7170
- className: classes.legendCanvas,
7171
- style: {
7172
- height: canvasContainerHeight,
7173
- width: canvasContainerWidth
7170
+ }, /*#__PURE__*/React__default.createElement(Box, {
7171
+ sx: {
7172
+ margin: '10px 0px 10px 0px',
7173
+ height: "".concat(canvasContainerHeight, "px"),
7174
+ width: "".concat(canvasContainerWidth, "px")
7174
7175
  }
7175
7176
  }, /*#__PURE__*/React__default.createElement(CanvasComponent, {
7176
7177
  redrawInterval: 500,
@@ -7227,16 +7228,21 @@ var Legend = function Legend(_ref) {
7227
7228
  renderLegendGraphic(previousLegendImage.current, ctx, imageWidth, imageHeight);
7228
7229
  }
7229
7230
  }
7230
- }))), /*#__PURE__*/React__default.createElement("div", {
7231
+ }))), /*#__PURE__*/React__default.createElement(Box, {
7231
7232
  "data-testid": "legend-info",
7232
- className: classes.legendInfo,
7233
- style: {
7234
- maxWidth: canvasContainerWidth
7233
+ sx: {
7234
+ fontFamily: 'Roboto, Helvetica, Arial',
7235
+ fontSize: 10,
7236
+ color: 'common.black',
7237
+ overflowX: 'hidden',
7238
+ minWidth: "".concat(defaultCanvasWidth, "px"),
7239
+ wordWrap: 'break-word',
7240
+ maxWidth: "".concat(canvasContainerWidth, "px")
7235
7241
  }
7236
7242
  }, layer.dimensions && layer.dimensions.map(function (dim) {
7237
- return /*#__PURE__*/React__default.createElement("div", {
7243
+ return /*#__PURE__*/React__default.createElement(Box, {
7238
7244
  key: layer.name + dim.name
7239
- }, dim.name === 'time' ? "".concat(dim.currentValue) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7245
+ }, dim.name === 'time' ? "".concat(dim.currentValue) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
7240
7246
  style: {
7241
7247
  fontWeight: 500
7242
7248
  }
@@ -7257,23 +7263,9 @@ var Legend = function Legend(_ref) {
7257
7263
  * See the License for the specific language governing permissions and
7258
7264
  * limitations under the License.
7259
7265
  *
7260
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7261
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
7266
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7267
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
7262
7268
  * */
7263
- var useStyles$r = makeStyles(function () {
7264
- return {
7265
- legendList: {
7266
- display: 'flex',
7267
- flexDirection: 'column',
7268
- '&>div:last-child': {
7269
- marginBottom: 0
7270
- }
7271
- },
7272
- legendContainer: {
7273
- padding: 4
7274
- }
7275
- };
7276
- });
7277
7269
 
7278
7270
  var LegendDialog = function LegendDialog(_ref) {
7279
7271
  var layers = _ref.layers,
@@ -7288,7 +7280,6 @@ var LegendDialog = function LegendDialog(_ref) {
7288
7280
  order = _ref$order === void 0 ? 0 : _ref$order,
7289
7281
  _ref$source = _ref.source,
7290
7282
  source = _ref$source === void 0 ? 'app' : _ref$source;
7291
- var classes = useStyles$r();
7292
7283
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
7293
7284
  startPosition: {
7294
7285
  right: 20,
@@ -7305,11 +7296,19 @@ var LegendDialog = function LegendDialog(_ref) {
7305
7296
  onMouseDown: onMouseDown,
7306
7297
  order: order,
7307
7298
  source: source
7308
- }, /*#__PURE__*/React.createElement("div", {
7309
- className: classes.legendContainer
7310
- }, layers && layers.length > 0 ? /*#__PURE__*/React.createElement("div", {
7299
+ }, /*#__PURE__*/React.createElement(Box, {
7300
+ sx: {
7301
+ padding: 0.5
7302
+ }
7303
+ }, layers && layers.length > 0 ? /*#__PURE__*/React.createElement(Box, {
7311
7304
  "data-testid": "LegendList",
7312
- className: classes.legendList
7305
+ sx: {
7306
+ display: 'flex',
7307
+ flexDirection: 'column',
7308
+ '&>div:last-child': {
7309
+ marginBottom: 0
7310
+ }
7311
+ }
7313
7312
  }, layers.map(function (layer) {
7314
7313
  return /*#__PURE__*/React.createElement(Legend, {
7315
7314
  key: layer.id,
@@ -7436,8 +7435,8 @@ var LegendConnect = function LegendConnect(_a) {
7436
7435
  }, props));
7437
7436
  };
7438
7437
 
7439
- var _marked$1 = /*#__PURE__*/regeneratorRuntime.mark(startAnimationSaga),
7440
- _marked2$1 = /*#__PURE__*/regeneratorRuntime.mark(stopAnimationSaga),
7438
+ var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(startAnimationSaga),
7439
+ _marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(stopAnimationSaga),
7441
7440
  _marked3$1 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerSaga),
7442
7441
  _marked4 = /*#__PURE__*/regeneratorRuntime.mark(updateAnimation),
7443
7442
  _marked5 = /*#__PURE__*/regeneratorRuntime.mark(setLayerDimensionsSaga),
@@ -7445,7 +7444,7 @@ var _marked$1 = /*#__PURE__*/regeneratorRuntime.mark(startAnimationSaga),
7445
7444
  _marked7 = /*#__PURE__*/regeneratorRuntime.mark(handleBaseLayersSaga),
7446
7445
  _marked8 = /*#__PURE__*/regeneratorRuntime.mark(setMapPresetSaga),
7447
7446
  _marked9 = /*#__PURE__*/regeneratorRuntime.mark(checkMapPresetForChangesSaga),
7448
- _marked10 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$1);
7447
+ _marked10 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
7449
7448
 
7450
7449
  var generateTimeList = function generateTimeList(start, end, interval) {
7451
7450
  var timeList = [];
@@ -7495,7 +7494,7 @@ function startAnimationSaga(_ref) {
7495
7494
  return _context.stop();
7496
7495
  }
7497
7496
  }
7498
- }, _marked$1);
7497
+ }, _marked$2);
7499
7498
  }
7500
7499
  function stopAnimationSaga(_ref2) {
7501
7500
  var payload, mapId;
@@ -7513,7 +7512,7 @@ function stopAnimationSaga(_ref2) {
7513
7512
  return _context2.stop();
7514
7513
  }
7515
7514
  }
7516
- }, _marked2$1);
7515
+ }, _marked2$2);
7517
7516
  }
7518
7517
  function deleteLayerSaga(_ref3) {
7519
7518
  var payload, mapId, layers;
@@ -8121,7 +8120,7 @@ function checkMapPresetForChangesSaga(action) {
8121
8120
  }
8122
8121
  }, _marked9);
8123
8122
  }
8124
- function rootSaga$1() {
8123
+ function rootSaga$2() {
8125
8124
  return regeneratorRuntime.wrap(function rootSaga$(_context10) {
8126
8125
  while (1) {
8127
8126
  switch (_context10.prev = _context10.next) {
@@ -8182,11 +8181,11 @@ function rootSaga$1() {
8182
8181
  var moduleConfig = {
8183
8182
  id: 'webmap-module',
8184
8183
  reducerMap: {
8185
- webmap: reducer$2,
8186
- services: reducer$4,
8187
- layers: reducer$5
8184
+ webmap: reducer$3,
8185
+ services: reducer$5,
8186
+ layers: reducer$6
8188
8187
  },
8189
- sagas: [rootSaga$1]
8188
+ sagas: [rootSaga$2]
8190
8189
  };
8191
8190
 
8192
8191
  /* *
@@ -8206,13 +8205,13 @@ var moduleConfig = {
8206
8205
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
8207
8206
  * */
8208
8207
  var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
8209
- return Object.values(Object.assign(Object.assign({}, presets.reduce(function (byId, preset) {
8210
- return Object.assign(Object.assign({}, byId), _defineProperty({}, preset.id, preset));
8208
+ return Object.values(Object.assign(Object.assign({}, presets.reduce(function (byUrl, preset) {
8209
+ return Object.assign(Object.assign({}, byUrl), _defineProperty({}, preset.url, preset));
8211
8210
  }, {})), userAddedServices));
8212
8211
  };
8213
- var isService = function isService(param) {
8212
+ var isNoIdService = function isNoIdService(param) {
8214
8213
  var serviceParam = param;
8215
- return !!((serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.id) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.name) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.url), serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.isUserAddedService);
8214
+ return !!((serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.name) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.url));
8216
8215
  };
8217
8216
 
8218
8217
  var getUserAddedServices = function getUserAddedServices() {
@@ -8221,19 +8220,14 @@ var getUserAddedServices = function getUserAddedServices() {
8221
8220
  var parsedData = JSON.parse(storedString);
8222
8221
 
8223
8222
  if (parsedData && _typeof(parsedData) === 'object') {
8224
- Object.values(parsedData).forEach(function (value) {
8225
- // eslint-disable-next-line no-prototype-builtins
8226
- if (value.hasOwnProperty('url') && value.hasOwnProperty('id')) {
8227
- var service = value;
8228
- service.isUserAddedService = true;
8229
- }
8230
- });
8231
8223
  return Object.entries(parsedData).reduce(function (userServices, _ref) {
8232
8224
  var _ref2 = _slicedToArray(_ref, 2),
8233
8225
  serviceUrl = _ref2[0],
8234
8226
  service = _ref2[1];
8235
8227
 
8236
- return Object.assign(Object.assign({}, userServices), isService(service) ? _defineProperty({}, serviceUrl, service) : {});
8228
+ return Object.assign(Object.assign({}, userServices), isNoIdService(service) ? _defineProperty({}, serviceUrl, Object.assign(Object.assign({}, service), {
8229
+ isUserAddedService: true
8230
+ })) : {});
8237
8231
  }, {});
8238
8232
  }
8239
8233
  } catch (e) {
@@ -8250,9 +8244,9 @@ var setUserAddedServices = function setUserAddedServices(services) {
8250
8244
  }
8251
8245
  };
8252
8246
 
8253
- var _marked = /*#__PURE__*/regeneratorRuntime.mark(newServiceAddedSaga),
8254
- _marked2 = /*#__PURE__*/regeneratorRuntime.mark(layerSelectServiceRemovedSaga),
8255
- _marked3 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga);
8247
+ var _marked$1 = /*#__PURE__*/regeneratorRuntime.mark(newServiceAddedSaga),
8248
+ _marked2$1 = /*#__PURE__*/regeneratorRuntime.mark(layerSelectServiceRemovedSaga),
8249
+ _marked3 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$1);
8256
8250
  function newServiceAddedSaga(capturedAction) {
8257
8251
  var addedService, id, serviceUrl, name, isUserAddedService, keywords;
8258
8252
  return regeneratorRuntime.wrap(function newServiceAddedSaga$(_context) {
@@ -8278,7 +8272,7 @@ function newServiceAddedSaga(capturedAction) {
8278
8272
  return _context.stop();
8279
8273
  }
8280
8274
  }
8281
- }, _marked);
8275
+ }, _marked$1);
8282
8276
  }
8283
8277
  function layerSelectServiceRemovedSaga(capturedAction) {
8284
8278
  var removedService, serviceId;
@@ -8298,7 +8292,7 @@ function layerSelectServiceRemovedSaga(capturedAction) {
8298
8292
  return _context2.stop();
8299
8293
  }
8300
8294
  }
8301
- }, _marked2);
8295
+ }, _marked2$1);
8302
8296
  }
8303
8297
  function addServiceToLocalStorageSaga(_ref) {
8304
8298
  var payload = _ref.payload;
@@ -8308,7 +8302,6 @@ function addServiceToLocalStorageSaga(_ref) {
8308
8302
  if (!isUserAddedService) return;
8309
8303
  var localStorageServices = getUserAddedServices();
8310
8304
  setUserAddedServices(Object.assign(Object.assign({}, localStorageServices), _defineProperty({}, serviceUrl, {
8311
- id: serviceUrl,
8312
8305
  name: name,
8313
8306
  url: serviceUrl
8314
8307
  })));
@@ -8322,7 +8315,7 @@ function removeServiceFromLocalStorageSaga(_ref2) {
8322
8315
  delete updatedServices[serviceUrl];
8323
8316
  setUserAddedServices(updatedServices);
8324
8317
  }
8325
- function rootSaga() {
8318
+ function rootSaga$1() {
8326
8319
  return regeneratorRuntime.wrap(function rootSaga$(_context3) {
8327
8320
  while (1) {
8328
8321
  switch (_context3.prev = _context3.next) {
@@ -8369,28 +8362,129 @@ function rootSaga() {
8369
8362
  var layerSelectConfig = {
8370
8363
  id: 'layerSelect-module',
8371
8364
  reducerMap: {
8372
- layerSelect: reducer
8365
+ layerSelect: reducer$1
8373
8366
  },
8374
- sagas: [rootSaga]
8367
+ sagas: [rootSaga$1]
8375
8368
  };
8376
8369
 
8377
- /* *
8378
- * Licensed under the Apache License, Version 2.0 (the "License");
8379
- * you may not use this file except in compliance with the License.
8380
- * You may obtain a copy of the License at
8381
- *
8382
- * http://www.apache.org/licenses/LICENSE-2.0
8383
- *
8384
- * Unless required by applicable law or agreed to in writing, software
8385
- * distributed under the License is distributed on an "AS IS" BASIS,
8386
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8387
- * See the License for the specific language governing permissions and
8388
- * limitations under the License.
8389
- *
8390
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8391
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8392
- * */
8393
- var coreModuleConfig = [moduleConfig, synchronizationGroupConfig, uiModuleConfig, layerSelectConfig];
8370
+ var _marked = /*#__PURE__*/regeneratorRuntime.mark(openSnackbarSaga),
8371
+ _marked2 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga);
8372
+ var hideTime = 4000;
8373
+ function openSnackbarSaga(capturedAction) {
8374
+ var snackbarMessage, currentSnackbarMessages, id, currentSnackbarMessagesOpen;
8375
+ return regeneratorRuntime.wrap(function openSnackbarSaga$(_context) {
8376
+ while (1) {
8377
+ switch (_context.prev = _context.next) {
8378
+ case 0:
8379
+ snackbarMessage = capturedAction.payload.message;
8380
+ _context.next = 3;
8381
+ return select(getCurrentSnackbarMessages);
8382
+
8383
+ case 3:
8384
+ currentSnackbarMessages = _context.sent;
8385
+
8386
+ if (!currentSnackbarMessages.length) {
8387
+ _context.next = 7;
8388
+ break;
8389
+ }
8390
+
8391
+ _context.next = 7;
8392
+ return put(snackbarActions.closeSnackbar());
8393
+
8394
+ case 7:
8395
+ // Generate a unique id
8396
+ id = "snackbar".concat(Date.now().toString());
8397
+ _context.next = 10;
8398
+ return put(snackbarActions.triggerOpenSnackbarBySaga({
8399
+ snackbarContent: {
8400
+ message: snackbarMessage,
8401
+ id: id
8402
+ }
8403
+ }));
8404
+
8405
+ case 10:
8406
+ _context.next = 12;
8407
+ return delay(hideTime);
8408
+
8409
+ case 12:
8410
+ _context.next = 14;
8411
+ return select(getCurrentSnackbarMessages);
8412
+
8413
+ case 14:
8414
+ currentSnackbarMessagesOpen = _context.sent;
8415
+
8416
+ if (!currentSnackbarMessagesOpen.length) {
8417
+ _context.next = 18;
8418
+ break;
8419
+ }
8420
+
8421
+ _context.next = 18;
8422
+ return put(snackbarActions.closeSnackbar());
8423
+
8424
+ case 18:
8425
+ case "end":
8426
+ return _context.stop();
8427
+ }
8428
+ }
8429
+ }, _marked);
8430
+ }
8431
+ function rootSaga() {
8432
+ return regeneratorRuntime.wrap(function rootSaga$(_context2) {
8433
+ while (1) {
8434
+ switch (_context2.prev = _context2.next) {
8435
+ case 0:
8436
+ _context2.next = 2;
8437
+ return takeLatest(snackbarActions.openSnackbar.type, openSnackbarSaga);
8438
+
8439
+ case 2:
8440
+ case "end":
8441
+ return _context2.stop();
8442
+ }
8443
+ }
8444
+ }, _marked2);
8445
+ }
8446
+
8447
+ /* *
8448
+ * Licensed under the Apache License, Version 2.0 (the "License");
8449
+ * you may not use this file except in compliance with the License.
8450
+ * You may obtain a copy of the License at
8451
+ *
8452
+ * http://www.apache.org/licenses/LICENSE-2.0
8453
+ *
8454
+ * Unless required by applicable law or agreed to in writing, software
8455
+ * distributed under the License is distributed on an "AS IS" BASIS,
8456
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8457
+ * See the License for the specific language governing permissions and
8458
+ * limitations under the License.
8459
+ *
8460
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8461
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
8462
+ * */
8463
+ var snackbarModuleConfig = {
8464
+ id: 'snackbar-module',
8465
+ reducerMap: {
8466
+ snackbar: reducer
8467
+ },
8468
+ sagas: [rootSaga]
8469
+ };
8470
+
8471
+ /* *
8472
+ * Licensed under the Apache License, Version 2.0 (the "License");
8473
+ * you may not use this file except in compliance with the License.
8474
+ * You may obtain a copy of the License at
8475
+ *
8476
+ * http://www.apache.org/licenses/LICENSE-2.0
8477
+ *
8478
+ * Unless required by applicable law or agreed to in writing, software
8479
+ * distributed under the License is distributed on an "AS IS" BASIS,
8480
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8481
+ * See the License for the specific language governing permissions and
8482
+ * limitations under the License.
8483
+ *
8484
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8485
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
8486
+ * */
8487
+ var coreModuleConfig = [moduleConfig, synchronizationGroupConfig, uiModuleConfig, layerSelectConfig, snackbarModuleConfig];
8394
8488
 
8395
8489
  /* *
8396
8490
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -8918,23 +9012,6 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
8918
9012
  preloadedDefaultMapServices: preloadedDefaultMapServices
8919
9013
  });
8920
9014
 
8921
- var useStyles$q = makeStyles({
8922
- buttonDiv: {
8923
- position: 'relative'
8924
- },
8925
- loadingButton: {
8926
- position: 'absolute',
8927
- top: 7,
8928
- left: 7,
8929
- zIndex: 1
8930
- },
8931
- button: {
8932
- width: '24px',
8933
- height: '24px',
8934
- margin: '6px 0px 0px 10px'
8935
- }
8936
- });
8937
-
8938
9015
  var validateServiceUrl = function validateServiceUrl(url) {
8939
9016
  if (url === '' || url === null || typeof url === 'undefined') return false;
8940
9017
  var matcher = /^(?:\w+:)?\/\/([^\s.]+\.\S{2}|[0-9a-zA-Z]+[:?\d]*)\S*$/;
@@ -8951,7 +9028,6 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8951
9028
  handleClose = _ref.handleClose,
8952
9029
  _ref$layerType = _ref.layerType,
8953
9030
  layerType = _ref$layerType === void 0 ? LayerType.mapLayer : _ref$layerType;
8954
- var classes = useStyles$q();
8955
9031
 
8956
9032
  var _React$useState = React.useState(''),
8957
9033
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -9073,7 +9149,9 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
9073
9149
  })), /*#__PURE__*/React.createElement(Grid, {
9074
9150
  item: true,
9075
9151
  xs: 2,
9076
- className: classes.buttonDiv
9152
+ sx: {
9153
+ position: 'relative'
9154
+ }
9077
9155
  }, /*#__PURE__*/React.createElement(IconButton, {
9078
9156
  "data-testid": "add-service",
9079
9157
  onClick: handleAddServiceURL,
@@ -9081,7 +9159,12 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
9081
9159
  size: "large"
9082
9160
  }, /*#__PURE__*/React.createElement(Add, null)), loading && /*#__PURE__*/React.createElement(CircularProgress, {
9083
9161
  size: 35,
9084
- className: classes.loadingButton
9162
+ sx: {
9163
+ position: 'absolute',
9164
+ top: '7px',
9165
+ left: '7px',
9166
+ zIndex: 1
9167
+ }
9085
9168
  })))), /*#__PURE__*/React.createElement(Box, {
9086
9169
  m: 2
9087
9170
  }, /*#__PURE__*/React.createElement(Grid, {
@@ -9109,7 +9192,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
9109
9192
  }, "Close")));
9110
9193
  };
9111
9194
 
9112
- var styles$2 = {
9195
+ var styles$4 = {
9113
9196
  buttonDiv: {
9114
9197
  position: 'relative'
9115
9198
  },
@@ -9172,7 +9255,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
9172
9255
  onBlur: onBlurTooltip
9173
9256
  }, /*#__PURE__*/React.createElement(IconButton, {
9174
9257
  onClick: handleClose,
9175
- sx: styles$2.button,
9258
+ sx: styles$4.button,
9176
9259
  disableRipple: true,
9177
9260
  "data-testid": "addLayersButton",
9178
9261
  ref: ref,
@@ -9199,12 +9282,12 @@ var AddLayersButton = function AddLayersButton(_ref) {
9199
9282
  * See the License for the specific language governing permissions and
9200
9283
  * limitations under the License.
9201
9284
  *
9202
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9203
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9285
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9286
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
9204
9287
  * */
9205
9288
  var iconButtonSize = 30;
9206
9289
  var totalButtons = 5;
9207
- var LayerManagerColumnsLarge = makeStyles({
9290
+ var LayerManagerColumnsLarge = {
9208
9291
  column1: {
9209
9292
  width: iconButtonSize * 3,
9210
9293
  display: 'flex'
@@ -9228,8 +9311,8 @@ var LayerManagerColumnsLarge = makeStyles({
9228
9311
  columns35: {
9229
9312
  width: "calc((100% - ".concat(iconButtonSize * totalButtons, "px) * 0.75)")
9230
9313
  }
9231
- });
9232
- var LayerManagerColumnsSmall = makeStyles({
9314
+ };
9315
+ var LayerManagerColumnsSmall = {
9233
9316
  column1: {
9234
9317
  width: iconButtonSize * 3
9235
9318
  },
@@ -9252,7 +9335,7 @@ var LayerManagerColumnsSmall = makeStyles({
9252
9335
  columns35: {
9253
9336
  display: 'none'
9254
9337
  }
9255
- });
9338
+ };
9256
9339
  var LayerManagerWidth;
9257
9340
 
9258
9341
  (function (LayerManagerWidth) {
@@ -9332,10 +9415,10 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
9332
9415
  * See the License for the specific language governing permissions and
9333
9416
  * limitations under the License.
9334
9417
  *
9335
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9336
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9418
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9419
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
9337
9420
  * */
9338
- var useStyles$p = makeStyles({
9421
+ var styles$3 = {
9339
9422
  row: {
9340
9423
  height: '32px'
9341
9424
  },
@@ -9346,7 +9429,7 @@ var useStyles$p = makeStyles({
9346
9429
  fontFamily: 'Roboto',
9347
9430
  opacity: 0.67
9348
9431
  }
9349
- });
9432
+ };
9350
9433
 
9351
9434
  var DescriptionRow = function DescriptionRow(_ref) {
9352
9435
  var mapId = _ref.mapId,
@@ -9359,16 +9442,15 @@ var DescriptionRow = function DescriptionRow(_ref) {
9359
9442
  layerManagerWidth = _ref.layerManagerWidth,
9360
9443
  _ref$layerSelect = _ref.layerSelect,
9361
9444
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
9362
- var classes = useStyles$p();
9363
- var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9445
+ var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall : LayerManagerColumnsLarge;
9364
9446
  return /*#__PURE__*/React.createElement(Grid, {
9365
9447
  container: true,
9366
9448
  item: true,
9367
9449
  "data-testid": "descriptionRow",
9368
- className: classes.row
9450
+ sx: styles$3.row
9369
9451
  }, /*#__PURE__*/React.createElement(Grid, {
9370
9452
  item: true,
9371
- className: columnSizes.column1
9453
+ sx: columnSizes.column1
9372
9454
  }, /*#__PURE__*/React.createElement(AddLayersButton, {
9373
9455
  preloadedServices: preloadedServices,
9374
9456
  tooltip: tooltip,
@@ -9383,23 +9465,23 @@ var DescriptionRow = function DescriptionRow(_ref) {
9383
9465
  }), layerSelect && /*#__PURE__*/React.createElement(LayerSelectButtonConnect, {
9384
9466
  mapId: mapId
9385
9467
  })), /*#__PURE__*/React.createElement(Grid, {
9386
- className: columnSizes.column2
9387
- }, /*#__PURE__*/React.createElement("div", {
9388
- className: classes.text
9468
+ sx: columnSizes.column2
9469
+ }, /*#__PURE__*/React.createElement(Box, {
9470
+ sx: styles$3.text
9389
9471
  }, "Layer")), /*#__PURE__*/React.createElement(Grid, {
9390
- className: columnSizes.column3
9391
- }, /*#__PURE__*/React.createElement("div", {
9392
- className: classes.text
9472
+ sx: columnSizes.column3
9473
+ }, /*#__PURE__*/React.createElement(Box, {
9474
+ sx: styles$3.text
9393
9475
  }, "Style")), /*#__PURE__*/React.createElement(Grid, {
9394
- className: columnSizes.column4
9395
- }, /*#__PURE__*/React.createElement("div", {
9396
- className: classes.text
9476
+ sx: columnSizes.column4
9477
+ }, /*#__PURE__*/React.createElement(Box, {
9478
+ sx: styles$3.text
9397
9479
  }, "Opacity")), /*#__PURE__*/React.createElement(Grid, {
9398
- className: columnSizes.column5
9399
- }, /*#__PURE__*/React.createElement("div", {
9400
- className: classes.text
9480
+ sx: columnSizes.column5
9481
+ }, /*#__PURE__*/React.createElement(Box, {
9482
+ sx: styles$3.text
9401
9483
  }, "Dimensions")), /*#__PURE__*/React.createElement(Grid, {
9402
- className: columnSizes.column6
9484
+ sx: columnSizes.column6
9403
9485
  }));
9404
9486
  };
9405
9487
 
@@ -9551,22 +9633,6 @@ var DimensionSelect = function DimensionSelect(_ref) {
9551
9633
  }))));
9552
9634
  };
9553
9635
 
9554
- var useStyles$o = makeStyles(function (theme) {
9555
- return createStyles({
9556
- dropdownEmpty: {
9557
- paddingLeft: 8,
9558
- height: 32,
9559
- display: 'inline-flex',
9560
- alignItems: 'center'
9561
- },
9562
- emptyText: {
9563
- fontSize: theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize,
9564
- color: theme.palette.geowebColors.layerManager.tableRowDefaultText.rgba,
9565
- fontWeight: 500
9566
- }
9567
- });
9568
- });
9569
-
9570
9636
  var getRenderLayersValues = function getRenderLayersValues(layerName, layers) {
9571
9637
  var serviceLayer = layers.find(function (l) {
9572
9638
  return l.name === layerName;
@@ -9604,14 +9670,21 @@ var RenderLayers = function RenderLayers(_ref) {
9604
9670
 
9605
9671
  var _a;
9606
9672
 
9607
- var classes = useStyles$o();
9608
-
9609
9673
  if (!layers || !layers.length) {
9610
- return /*#__PURE__*/React.createElement("div", {
9611
- className: classes.dropdownEmpty
9674
+ return /*#__PURE__*/React.createElement(Box, {
9675
+ sx: {
9676
+ paddingLeft: 1,
9677
+ height: '32px',
9678
+ display: 'inline-flex',
9679
+ alignItems: 'center'
9680
+ }
9612
9681
  }, /*#__PURE__*/React.createElement(Typography, {
9613
9682
  variant: "body1",
9614
- className: classes.emptyText
9683
+ sx: {
9684
+ fontSize: 'geowebColors.layerManager.tableRowDefaultText.fontSize',
9685
+ color: 'geowebColors.layerManager.tableRowDefaultText.rgba',
9686
+ fontWeight: 500
9687
+ }
9615
9688
  }, "No service available"));
9616
9689
  }
9617
9690
 
@@ -9670,34 +9743,6 @@ var RenderLayers = function RenderLayers(_ref) {
9670
9743
  }));
9671
9744
  };
9672
9745
 
9673
- var useStyles$n = makeStyles(function (theme) {
9674
- return {
9675
- opacityDiv: {
9676
- height: 'calc(100% - 5px)',
9677
- width: '100%',
9678
- position: 'relative',
9679
- top: '2px'
9680
- },
9681
- opacityButton: {
9682
- height: '100%',
9683
- width: '100%',
9684
- borderRadius: '0',
9685
- minWidth: '49px'
9686
- },
9687
- sliderBackground: {
9688
- padding: '0 0 60px 0',
9689
- marginLeft: '60px',
9690
- backgroundColor: theme.palette.geowebColors.background.surface,
9691
- width: '82px',
9692
- height: '248px',
9693
- position: 'fixed',
9694
- top: '-5px',
9695
- boxSizing: 'initial',
9696
- zIndex: 2,
9697
- boxShadow: theme.shadows[8]
9698
- }
9699
- };
9700
- });
9701
9746
  var marks$1 = [{
9702
9747
  value: 0,
9703
9748
  label: '0 %'
@@ -9730,7 +9775,6 @@ var OpacitySelect = function OpacitySelect(_ref) {
9730
9775
  onLayerChangeOpacity = _ref.onLayerChangeOpacity,
9731
9776
  _ref$isEnabled = _ref.isEnabled,
9732
9777
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9733
- var classes = useStyles$n();
9734
9778
 
9735
9779
  var _React$useState = React.useState(false),
9736
9780
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -9775,10 +9819,15 @@ var OpacitySelect = function OpacitySelect(_ref) {
9775
9819
  setTooltipOpen(false);
9776
9820
  }, []);
9777
9821
  var currentOpacityText = "".concat(Math.round(currentOpacity * 100), " %");
9778
- return /*#__PURE__*/React.createElement("div", {
9779
- className: classes.opacityDiv,
9822
+ return /*#__PURE__*/React.createElement(Box, {
9780
9823
  onWheel: onWheel,
9781
- "data-testid": "scrollOpacity"
9824
+ "data-testid": "scrollOpacity",
9825
+ sx: {
9826
+ height: 'calc(100% - 5px)',
9827
+ width: '100%',
9828
+ position: 'relative',
9829
+ top: '2px'
9830
+ }
9782
9831
  }, /*#__PURE__*/React.createElement(Tooltip, {
9783
9832
  title: "Opacity: ".concat(currentOpacityText),
9784
9833
  sx: tooltipContainerStyles(isEnabled),
@@ -9786,16 +9835,32 @@ var OpacitySelect = function OpacitySelect(_ref) {
9786
9835
  open: tooltipOpen
9787
9836
  }, /*#__PURE__*/React.createElement(Button, {
9788
9837
  tabIndex: 0,
9789
- className: classes.opacityButton,
9790
9838
  onClick: onClickButton,
9791
9839
  "data-testid": "selectOpacity",
9792
9840
  disableRipple: true,
9793
9841
  onMouseEnter: onMouseEnter,
9794
9842
  onMouseLeave: onMouseLeave,
9795
9843
  onFocus: onFocus,
9796
- onBlur: onBlur
9797
- }, currentOpacityText)), open ? /*#__PURE__*/React.createElement("div", {
9798
- className: classes.sliderBackground
9844
+ onBlur: onBlur,
9845
+ style: {
9846
+ height: '100%',
9847
+ width: '100%',
9848
+ borderRadius: '0',
9849
+ minWidth: '49px'
9850
+ }
9851
+ }, currentOpacityText)), open ? /*#__PURE__*/React.createElement(Box, {
9852
+ sx: {
9853
+ padding: '0 0 60px 0',
9854
+ marginLeft: '60px',
9855
+ backgroundColor: 'geowebColors.background.surface',
9856
+ width: '82px',
9857
+ height: '248px',
9858
+ position: 'fixed',
9859
+ top: '-5px',
9860
+ boxSizing: 'initial',
9861
+ zIndex: 2,
9862
+ boxShadow: 8
9863
+ }
9799
9864
  }, /*#__PURE__*/React.createElement(Box, {
9800
9865
  sx: sliderHeaderStyle
9801
9866
  }, "Opacity"), /*#__PURE__*/React.createElement(CustomSlider, {
@@ -9946,44 +10011,37 @@ var RenderStyles = function RenderStyles(_ref) {
9946
10011
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9947
10012
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9948
10013
  * */
9949
- var useStyles$m = makeStyles(function (theme) {
9950
- return createStyles({
9951
- svgIcon: {
9952
- fill: function fill(_ref) {
9953
- var isActive = _ref.isActive,
9954
- isEnabled = _ref.isEnabled;
9955
-
9956
- if (isActive) {
9957
- return theme.palette.common.white;
9958
- }
9959
10014
 
9960
- if (isEnabled) {
9961
- return theme.palette.geowebColors.buttons.flat["default"].color;
9962
- }
10015
+ var makeIconStyle = function makeIconStyle(isActive, isEnabled) {
10016
+ return {
10017
+ color: function color() {
10018
+ if (isActive) {
10019
+ return 'common.white';
10020
+ }
9963
10021
 
9964
- return theme.palette.geowebColors.buttons.flat.disabled.color;
10022
+ if (isEnabled) {
10023
+ return 'geowebColors.buttons.flat.default.color';
9965
10024
  }
10025
+
10026
+ return 'geowebColors.buttons.flat.disabled.color';
9966
10027
  }
9967
- });
9968
- });
10028
+ };
10029
+ };
9969
10030
 
9970
- var ActivateLayer = function ActivateLayer(_ref2) {
9971
- var _ref2$tooltipTitle = _ref2.tooltipTitle,
9972
- tooltipTitle = _ref2$tooltipTitle === void 0 ? 'Leading layer' : _ref2$tooltipTitle,
9973
- onClickActivate = _ref2.onClickActivate,
9974
- _ref2$isActive = _ref2.isActive,
9975
- isActive = _ref2$isActive === void 0 ? false : _ref2$isActive,
9976
- _ref2$isEnabled = _ref2.isEnabled,
9977
- isEnabled = _ref2$isEnabled === void 0 ? true : _ref2$isEnabled;
9978
- var classes = useStyles$m({
9979
- isActive: isActive,
9980
- isEnabled: isEnabled
9981
- });
10031
+ var ActivateLayer = function ActivateLayer(_ref) {
10032
+ var _ref$tooltipTitle = _ref.tooltipTitle,
10033
+ tooltipTitle = _ref$tooltipTitle === void 0 ? 'Leading layer' : _ref$tooltipTitle,
10034
+ onClickActivate = _ref.onClickActivate,
10035
+ _ref$isActive = _ref.isActive,
10036
+ isActive = _ref$isActive === void 0 ? false : _ref$isActive,
10037
+ _ref$isEnabled = _ref.isEnabled,
10038
+ isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
10039
+ var iconStyle = makeIconStyle(isActive, isEnabled);
9982
10040
  return /*#__PURE__*/React.createElement(ManagerButton, {
9983
10041
  tooltipTitle: tooltipTitle,
9984
10042
  onClick: onClickActivate,
9985
10043
  icon: /*#__PURE__*/React.createElement(Flag, {
9986
- className: classes.svgIcon
10044
+ sx: iconStyle
9987
10045
  }),
9988
10046
  testId: "activateLayerButton",
9989
10047
  isActive: isActive
@@ -10003,31 +10061,9 @@ var ActivateLayer = function ActivateLayer(_ref2) {
10003
10061
  * See the License for the specific language governing permissions and
10004
10062
  * limitations under the License.
10005
10063
  *
10006
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10007
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
10064
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10065
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
10008
10066
  * */
10009
- var useStyles$l = makeStyles(function (theme) {
10010
- return createStyles({
10011
- row: {
10012
- background: function background(isEnabled) {
10013
- return isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultCardContainer.fill : theme.palette.geowebColors.layerManager.tableRowDisabledCardContainer.fill;
10014
- },
10015
- border: function border(isEnabled) {
10016
- return isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultCardContainer.border : theme.palette.geowebColors.layerManager.tableRowDisabledCardContainer.border;
10017
- },
10018
- borderRadius: theme.shape.borderRadius,
10019
- marginBottom: 4,
10020
- height: 34,
10021
- '&.sortable-drag': {
10022
- boxShadow: theme.shadows[4] // elevation_06
10023
-
10024
- },
10025
- '&.sortable-ghost': {
10026
- opacity: 0.5
10027
- }
10028
- }
10029
- });
10030
- });
10031
10067
 
10032
10068
  var LayerRow = function LayerRow(_ref) {
10033
10069
  var layerId = _ref.layerId,
@@ -10059,21 +10095,33 @@ var LayerRow = function LayerRow(_ref) {
10059
10095
  layerActiveLayout = _ref.layerActiveLayout,
10060
10096
  layerManagerWidth = _ref.layerManagerWidth,
10061
10097
  dragHandle = _ref.dragHandle;
10062
- var classes = useStyles$l(isEnabled);
10063
- var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
10098
+ var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall : LayerManagerColumnsLarge;
10064
10099
 
10065
10100
  var onClickRow = function onClickRow() {
10066
10101
  return onLayerRowClick(layerId);
10067
10102
  };
10068
10103
 
10069
10104
  return /*#__PURE__*/React__default.createElement(Grid, {
10070
- className: classes.row,
10071
10105
  item: true,
10072
10106
  container: true,
10073
- "data-testid": "layerRow-".concat(layerId)
10107
+ "data-testid": "layerRow-".concat(layerId),
10108
+ sx: {
10109
+ backgroundColor: isEnabled ? 'geowebColors.layerManager.tableRowDefaultCardContainer.fill' : 'geowebColors.layerManager.tableRowDisabledCardContainer.fill',
10110
+ border: 1,
10111
+ borderColor: isEnabled ? 'geowebColors.layerManager.tableRowDefaultCardContainer.borderColor' : 'geowebColors.layerManager.tableRowDisabledCardContainer.borderColor',
10112
+ borderRadius: 1,
10113
+ marginBottom: 0.5,
10114
+ height: '34px',
10115
+ '&.sortable-drag': {
10116
+ boxShadow: 4
10117
+ },
10118
+ '&.sortable-ghost': {
10119
+ opacity: 0.5
10120
+ }
10121
+ }
10074
10122
  }, /*#__PURE__*/React__default.createElement(Grid, {
10075
10123
  item: true,
10076
- className: columnSizes.column1
10124
+ sx: columnSizes.column1
10077
10125
  }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(EnableButton, {
10078
10126
  isEnabled: layer.enabled,
10079
10127
  title: layer.name,
@@ -10087,7 +10135,7 @@ var LayerRow = function LayerRow(_ref) {
10087
10135
  onClickActivate: onClickRow
10088
10136
  })), /*#__PURE__*/React__default.createElement(Grid, {
10089
10137
  item: true,
10090
- className: "".concat(columnSizes.column2)
10138
+ sx: columnSizes.column2
10091
10139
  }, layerServicesLayout || /*#__PURE__*/React__default.createElement(RenderLayers, {
10092
10140
  layerName: layer.name,
10093
10141
  layers: services && layer.service && services[layer.service] && services[layer.service].layers || [],
@@ -10099,13 +10147,13 @@ var LayerRow = function LayerRow(_ref) {
10099
10147
  }
10100
10148
  })), isLayerMissing ? /*#__PURE__*/React__default.createElement(Grid, {
10101
10149
  item: true,
10102
- className: "".concat(columnSizes.columns35)
10150
+ sx: columnSizes.columns35
10103
10151
  }, /*#__PURE__*/React__default.createElement(AlertBanner, {
10104
10152
  title: "This layer could not be loaded: does not exist on the server.",
10105
10153
  isCompact: true
10106
10154
  })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
10107
10155
  item: true,
10108
- className: "".concat(columnSizes.column3)
10156
+ sx: columnSizes.column3
10109
10157
  }, layerStylesLayout || /*#__PURE__*/React__default.createElement(RenderStyles, {
10110
10158
  layerStyles: layer.styles,
10111
10159
  currentLayerStyle: layer.style,
@@ -10117,7 +10165,7 @@ var LayerRow = function LayerRow(_ref) {
10117
10165
  }
10118
10166
  })), /*#__PURE__*/React__default.createElement(Grid, {
10119
10167
  item: true,
10120
- className: "".concat(columnSizes.column4)
10168
+ sx: columnSizes.column4
10121
10169
  }, layerOpacityLayout || /*#__PURE__*/React__default.createElement(OpacitySelect, {
10122
10170
  currentOpacity: layer.opacity,
10123
10171
  onLayerChangeOpacity: function onLayerChangeOpacity(_opacity) {
@@ -10128,7 +10176,7 @@ var LayerRow = function LayerRow(_ref) {
10128
10176
  }
10129
10177
  })), /*#__PURE__*/React__default.createElement(Grid, {
10130
10178
  item: true,
10131
- className: "".concat(columnSizes.column5)
10179
+ sx: columnSizes.column5
10132
10180
  }, layerDimensionLayout || /*#__PURE__*/React__default.createElement(DimensionSelect, {
10133
10181
  layerId: layerId,
10134
10182
  layerDimensions: filterNonTimeDimensions(layer.dimensions),
@@ -10146,7 +10194,7 @@ var LayerRow = function LayerRow(_ref) {
10146
10194
  }
10147
10195
  }))), /*#__PURE__*/React__default.createElement(Grid, {
10148
10196
  item: true,
10149
- className: columnSizes.column6
10197
+ sx: columnSizes.column6
10150
10198
  }, layerDeleteLayout || /*#__PURE__*/React__default.createElement(ManagerDeleteButton, {
10151
10199
  tooltipTitle: "Delete",
10152
10200
  onClickDelete: function onClickDelete() {
@@ -10701,22 +10749,6 @@ var DragHandle = function DragHandle(_ref) {
10701
10749
  });
10702
10750
  };
10703
10751
 
10704
- var useStyles$k = makeStyles(function () {
10705
- return {
10706
- layerRows: {
10707
- width: '100%',
10708
- maxHeight: 'calc(100% - 10px)',
10709
- overflow: 'auto'
10710
- },
10711
- sortableRow: {
10712
- width: '100%',
10713
- cursor: function cursor(isSorting) {
10714
- return isSorting ? 'grabbing' : 'inherit';
10715
- }
10716
- }
10717
- };
10718
- });
10719
-
10720
10752
  var LayerContainerRow = function LayerContainerRow(_ref) {
10721
10753
  var mapId = _ref.mapId,
10722
10754
  layerManagerWidth = _ref.layerManagerWidth;
@@ -10774,7 +10806,6 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10774
10806
 
10775
10807
  var isSorting = activeDragIndex !== null;
10776
10808
  var isDragDisabled = layerIds.length === 1;
10777
- var classes = useStyles$k(isSorting);
10778
10809
 
10779
10810
  var keyPressedTrue = function keyPressedTrue(event) {
10780
10811
  if (event.ctrlKey || event.metaKey) {
@@ -10814,8 +10845,12 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10814
10845
  return /*#__PURE__*/React.createElement(Grid, {
10815
10846
  container: true,
10816
10847
  item: true,
10817
- className: classes.layerRows,
10818
- "data-testid": "layerContainerRow"
10848
+ "data-testid": "layerContainerRow",
10849
+ sx: {
10850
+ width: '100%',
10851
+ maxHeight: 'calc(100% - 10px)',
10852
+ overflow: 'auto'
10853
+ }
10819
10854
  }, /*#__PURE__*/React.createElement(ReactSortable, {
10820
10855
  tag: "div",
10821
10856
  list: layerIds.map(function (layerId) {
@@ -10830,9 +10865,12 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10830
10865
  direction: "vertical",
10831
10866
  // hover props
10832
10867
  forceFallback: true,
10833
- className: classes.sortableRow,
10834
10868
  onStart: onStart,
10835
- onEnd: onEnd
10869
+ onEnd: onEnd,
10870
+ style: {
10871
+ width: '100%',
10872
+ cursor: isSorting ? 'grabbing' : 'inherit'
10873
+ }
10836
10874
  }, layerIds.map(function (layerId, index) {
10837
10875
  return /*#__PURE__*/React.createElement(LayerRowConnect, {
10838
10876
  mapId: mapId,
@@ -11034,22 +11072,9 @@ var BaseLayersConnect = function BaseLayersConnect(_ref) {
11034
11072
  * See the License for the specific language governing permissions and
11035
11073
  * limitations under the License.
11036
11074
  *
11037
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11038
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11075
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11076
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
11039
11077
  * */
11040
- var useStyles$j = makeStyles({
11041
- layerRow: {
11042
- width: '100%',
11043
- height: '36px'
11044
- },
11045
- icon: {
11046
- width: '24px',
11047
- height: '24px'
11048
- },
11049
- addBaseLayers: {
11050
- marginTop: '-2px'
11051
- }
11052
- });
11053
11078
 
11054
11079
  var BaseLayerRow = function BaseLayerRow(_ref) {
11055
11080
  var mapId = _ref.mapId,
@@ -11060,16 +11085,20 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
11060
11085
  layerManagerWidth = _ref.layerManagerWidth,
11061
11086
  _ref$tooltip = _ref.tooltip,
11062
11087
  tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
11063
- var classes = useStyles$j();
11064
- var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
11088
+ var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall : LayerManagerColumnsLarge;
11065
11089
  return /*#__PURE__*/React.createElement(Grid, {
11066
11090
  container: true,
11067
11091
  item: true,
11068
- className: classes.layerRow,
11069
- "data-testid": "baseLayerRow"
11092
+ "data-testid": "baseLayerRow",
11093
+ sx: {
11094
+ width: '100%',
11095
+ height: '36px'
11096
+ }
11070
11097
  }, /*#__PURE__*/React.createElement(Grid, {
11071
11098
  item: true,
11072
- className: "".concat(columnSizes.column1, " ").concat(classes.addBaseLayers)
11099
+ sx: Object.assign(Object.assign({}, columnSizes.column1), {
11100
+ marginTop: '-2px'
11101
+ })
11073
11102
  }, /*#__PURE__*/React.createElement(AddLayersButton, {
11074
11103
  preloadedServices: preloadedServices,
11075
11104
  tooltip: tooltip,
@@ -11082,14 +11111,14 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
11082
11111
  }
11083
11112
  })), /*#__PURE__*/React.createElement(Grid, {
11084
11113
  item: true,
11085
- className: "".concat(columnSizes.column2)
11114
+ sx: columnSizes.column2
11086
11115
  }, /*#__PURE__*/React.createElement(BaseLayersConnect, {
11087
11116
  mapId: mapId,
11088
11117
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers
11089
11118
  })));
11090
11119
  };
11091
11120
 
11092
- var styles$1 = {
11121
+ var styles$2 = {
11093
11122
  layerRowContainer: {
11094
11123
  position: 'relative',
11095
11124
  width: '100%',
@@ -11162,7 +11191,7 @@ var LayerManager = function LayerManager(_ref) {
11162
11191
  source: source,
11163
11192
  leftComponent: leftComponent
11164
11193
  }, /*#__PURE__*/React.createElement(Box, {
11165
- sx: styles$1.layerManagerContainer
11194
+ sx: styles$2.layerManagerContainer
11166
11195
  }, isLoading && /*#__PURE__*/React.createElement(LinearProgress, {
11167
11196
  "data-testid": "loading-bar",
11168
11197
  color: "secondary",
@@ -11180,7 +11209,7 @@ var LayerManager = function LayerManager(_ref) {
11180
11209
  }), /*#__PURE__*/React.createElement(Grid, {
11181
11210
  container: true,
11182
11211
  "data-testid": "layerManagerRowContainer",
11183
- sx: styles$1.layerRowContainer
11212
+ sx: styles$2.layerRowContainer
11184
11213
  }, /*#__PURE__*/React.createElement(DescriptionRow, {
11185
11214
  mapId: mapId,
11186
11215
  tooltip: showAddLayersTooltip ? 'Add layers' : '',
@@ -12256,73 +12285,9 @@ var ServiceChipConnect = function ServiceChipConnect(_ref) {
12256
12285
  });
12257
12286
  };
12258
12287
 
12259
- var useStyles$i = makeStyles(function (theme) {
12260
- return createStyles({
12261
- serviceChips: {
12262
- width: '100%',
12263
- display: 'inline-flex',
12264
- alignItems: 'center',
12265
- overflowX: 'visible',
12266
- "float": 'left',
12267
- paddingLeft: '40px',
12268
- marginRight: function marginRight(_ref) {
12269
- var margin = _ref.margin;
12270
- return margin;
12271
- },
12272
- marginLeft: function marginLeft(_ref2) {
12273
- var margin = _ref2.margin;
12274
- return -margin;
12275
- },
12276
- maxWidth: function maxWidth(_ref3) {
12277
- var maxWidthValue = _ref3.maxWidthValue;
12278
- return maxWidthValue;
12279
- },
12280
- fontSize: '0.875rem'
12281
- },
12282
- scrollArrowLeft: {
12283
- width: '100px',
12284
- marginBottom: '-12px',
12285
- height: '34px',
12286
- backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
12287
- cursor: 'pointer',
12288
- marginRight: '-120px',
12289
- paddingTop: '6px',
12290
- paddingBottom: '6px',
12291
- "float": 'left',
12292
- zIndex: 1,
12293
- position: 'relative',
12294
- color: theme.palette.geowebColors.buttons.tertiary["default"].color,
12295
- '&:hover': {
12296
- color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
12297
- }
12298
- },
12299
- serviceList: {
12300
- height: '32px',
12301
- marginTop: '8px',
12302
- width: '100%',
12303
- overflow: 'hidden'
12304
- },
12305
- scrollArrowRight: {
12306
- width: '100px',
12307
- marginBottom: '-12px',
12308
- height: '34px',
12309
- paddingTop: '6px',
12310
- paddingBottom: '6px',
12311
- backgroundImage: "linear-gradient(to right, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
12312
- right: '0px',
12313
- position: 'fixed',
12314
- cursor: 'pointer',
12315
- color: theme.palette.geowebColors.buttons.tertiary["default"].color,
12316
- '&:hover': {
12317
- color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
12318
- }
12319
- }
12320
- });
12321
- });
12322
-
12323
- var ServiceList = function ServiceList(_ref4) {
12324
- var layerSelectWidth = _ref4.layerSelectWidth,
12325
- activeServices = _ref4.activeServices;
12288
+ var ServiceList = function ServiceList(_ref) {
12289
+ var layerSelectWidth = _ref.layerSelectWidth,
12290
+ activeServices = _ref.activeServices;
12326
12291
 
12327
12292
  var _React$useState = React.useState(0),
12328
12293
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -12342,10 +12307,6 @@ var ServiceList = function ServiceList(_ref4) {
12342
12307
  var ref = React.useRef(null);
12343
12308
  var scrollSpeed = 5;
12344
12309
  var maxWidthValue = ref && ref.current && ref.current.scrollWidth && ref.current.scrollWidth >= layerSelectWidth - margin && ref.current.scrollWidth || layerSelectWidth - 50;
12345
- var classes = useStyles$i({
12346
- margin: margin,
12347
- maxWidthValue: maxWidthValue
12348
- });
12349
12310
 
12350
12311
  var onMouseWheelScroll = function onMouseWheelScroll(e) {
12351
12312
  var delta = e.deltaY;
@@ -12392,17 +12353,52 @@ var ServiceList = function ServiceList(_ref4) {
12392
12353
  var isAllSelected = Object.values(activeServices).every(function (activeService) {
12393
12354
  return activeService.enabled;
12394
12355
  });
12395
- return /*#__PURE__*/React.createElement("div", {
12396
- className: classes.serviceList,
12356
+ return /*#__PURE__*/React.createElement(Box, {
12357
+ sx: {
12358
+ height: '32px',
12359
+ marginTop: '8px',
12360
+ width: '100%',
12361
+ overflow: 'hidden'
12362
+ },
12397
12363
  "data-testid": "serviceList",
12398
12364
  onWheel: onMouseWheelScroll
12399
12365
  }, margin !== 0 && /*#__PURE__*/React.createElement(ChevronLeft, {
12400
- className: classes.scrollArrowLeft,
12401
12366
  onMouseDown: onLeftChevronPressed,
12402
12367
  onMouseUp: onChevronMouseUp,
12403
- "data-testid": "leftScrollArrow"
12404
- }), /*#__PURE__*/React.createElement("div", {
12405
- className: classes.serviceChips,
12368
+ "data-testid": "leftScrollArrow",
12369
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12370
+ sx: function sx(theme) {
12371
+ return {
12372
+ width: '100px',
12373
+ marginBottom: '-12px',
12374
+ height: '34px',
12375
+ backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
12376
+ cursor: 'pointer',
12377
+ marginRight: '-120px',
12378
+ paddingTop: '6px',
12379
+ paddingBottom: '6px',
12380
+ "float": 'left',
12381
+ zIndex: 1,
12382
+ position: 'relative',
12383
+ color: 'geowebColors.buttons.tertiary.default.color',
12384
+ '&:hover': {
12385
+ color: 'geowebColors.buttons.tertiary.activeMouseOver.color'
12386
+ }
12387
+ };
12388
+ }
12389
+ }), /*#__PURE__*/React.createElement(Box, {
12390
+ sx: {
12391
+ width: '100%',
12392
+ display: 'inline-flex',
12393
+ alignItems: 'center',
12394
+ overflowX: 'visible',
12395
+ "float": 'left',
12396
+ paddingLeft: '40px',
12397
+ marginRight: "".concat(margin, "px"),
12398
+ marginLeft: "".concat(-margin, "px"),
12399
+ maxWidth: maxWidthValue,
12400
+ fontSize: '0.875rem'
12401
+ },
12406
12402
  ref: ref
12407
12403
  }, activeServices && Object.keys(activeServices) && Object.keys(activeServices).length > 0 && /*#__PURE__*/React.createElement(ServiceChipConnect, {
12408
12404
  key: "All",
@@ -12419,8 +12415,26 @@ var ServiceList = function ServiceList(_ref4) {
12419
12415
  isSelected: (_a = activeServices[serviceId]) === null || _a === void 0 ? void 0 : _a.enabled,
12420
12416
  isDisabled: activeServices[serviceId] === undefined
12421
12417
  });
12422
- })), layerSelectWidth + margin < width && /*#__PURE__*/React.createElement(ChevronRight, {
12423
- className: classes.scrollArrowRight,
12418
+ })), layerSelectWidth + margin < width && /*#__PURE__*/React.createElement(ChevronRight // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12419
+ , {
12420
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12421
+ sx: function sx(theme) {
12422
+ return {
12423
+ width: '100px',
12424
+ marginBottom: '-12px',
12425
+ height: '34px',
12426
+ paddingTop: '6px',
12427
+ paddingBottom: '6px',
12428
+ backgroundImage: "linear-gradient(to right, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
12429
+ right: '0px',
12430
+ position: 'fixed',
12431
+ cursor: 'pointer',
12432
+ color: 'geowebColors.buttons.tertiary.default.color',
12433
+ '&:hover': {
12434
+ color: 'geowebColors.buttons.tertiary.activeMouseOver.color'
12435
+ }
12436
+ };
12437
+ },
12424
12438
  onMouseDown: onRightChevronPressed,
12425
12439
  onMouseUp: onChevronMouseUp,
12426
12440
  "data-testid": "rightScrollArrow"
@@ -12455,7 +12469,7 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
12455
12469
  });
12456
12470
  };
12457
12471
 
12458
- var styles = {
12472
+ var styles$1 = {
12459
12473
  servicesContainer: {
12460
12474
  width: '300px',
12461
12475
  maxHeight: '380px',
@@ -12521,10 +12535,10 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
12521
12535
  };
12522
12536
 
12523
12537
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
12524
- sx: styles.servicesContainer,
12538
+ sx: styles$1.servicesContainer,
12525
12539
  "data-testid": "ServiceDialog"
12526
12540
  }, /*#__PURE__*/React.createElement(Box, {
12527
- sx: styles.header
12541
+ sx: styles$1.header
12528
12542
  }, "Services"), /*#__PURE__*/React.createElement(List, {
12529
12543
  disablePadding: true
12530
12544
  }, Object.keys(services).map(function (serviceId) {
@@ -12570,11 +12584,11 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
12570
12584
  "data-testid": "removeServiceButton"
12571
12585
  }, /*#__PURE__*/React.createElement(Delete, null))))));
12572
12586
  })), /*#__PURE__*/React.createElement(Box, {
12573
- sx: styles.footer
12587
+ sx: styles$1.footer
12574
12588
  }, /*#__PURE__*/React.createElement(Button, {
12575
12589
  onClick: openAddService,
12576
12590
  "data-testid": "openAddServiceButton",
12577
- sx: styles.button,
12591
+ sx: styles$1.button,
12578
12592
  variant: "tertiary",
12579
12593
  startIcon: /*#__PURE__*/React.createElement(Add, null)
12580
12594
  }, "Add a new service"))), addServiceIsOpen && /*#__PURE__*/React.createElement(ServicePopupConnect, {
@@ -12648,26 +12662,6 @@ var ServiceOptionsButton = function ServiceOptionsButton() {
12648
12662
  }, /*#__PURE__*/React.createElement(ServiceOptionsDialogConnect, null));
12649
12663
  };
12650
12664
 
12651
- var useStyles$h = makeStyles({
12652
- serviceList: {
12653
- height: '48px'
12654
- },
12655
- keywordFilterButton: {
12656
- "float": 'left',
12657
- position: 'absolute',
12658
- margin: '12px 0 0 8px',
12659
- zIndex: 2
12660
- },
12661
- serviceOptionsButton: {
12662
- position: 'absolute',
12663
- margin: '12px 0 0 calc(100% - 36px)',
12664
- zIndex: 2
12665
- },
12666
- layerSelectContainer: {
12667
- padding: '0 8px'
12668
- }
12669
- });
12670
-
12671
12665
  var LayerSelect = function LayerSelect(_ref) {
12672
12666
  var mapId = _ref.mapId,
12673
12667
  bounds = _ref.bounds,
@@ -12681,7 +12675,6 @@ var LayerSelect = function LayerSelect(_ref) {
12681
12675
  order = _ref$order === void 0 ? 0 : _ref$order,
12682
12676
  _ref$source = _ref.source,
12683
12677
  source = _ref$source === void 0 ? 'module' : _ref$source;
12684
- var classes = useStyles$h();
12685
12678
 
12686
12679
  var _React$useState = React.useState(500),
12687
12680
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -12721,66 +12714,45 @@ var LayerSelect = function LayerSelect(_ref) {
12721
12714
  onMouseDown: onMouseDown,
12722
12715
  order: order,
12723
12716
  source: source
12724
- }, /*#__PURE__*/React.createElement("div", {
12725
- style: {
12717
+ }, /*#__PURE__*/React.createElement(Box, {
12718
+ sx: {
12726
12719
  padding: '6px'
12727
12720
  }
12728
- }, /*#__PURE__*/React.createElement(SearchFieldConnect, null)), /*#__PURE__*/React.createElement("div", {
12729
- className: classes.keywordFilterButton
12721
+ }, /*#__PURE__*/React.createElement(SearchFieldConnect, null)), /*#__PURE__*/React.createElement(Box, {
12722
+ sx: {
12723
+ "float": 'left',
12724
+ position: 'absolute',
12725
+ margin: '12px 0 0 8px',
12726
+ zIndex: 2
12727
+ }
12730
12728
  }, /*#__PURE__*/React.createElement(KeywordFilterButtonConnect, {
12731
12729
  mapId: mapId
12732
- })), /*#__PURE__*/React.createElement("div", {
12733
- className: classes.serviceOptionsButton
12734
- }, /*#__PURE__*/React.createElement(ServiceOptionsButton, null)), /*#__PURE__*/React.createElement("div", {
12735
- className: classes.serviceList
12730
+ })), /*#__PURE__*/React.createElement(Box, {
12731
+ sx: {
12732
+ position: 'absolute',
12733
+ margin: '12px 0 0 calc(100% - 36px)',
12734
+ zIndex: 2
12735
+ }
12736
+ }, /*#__PURE__*/React.createElement(ServiceOptionsButton, null)), /*#__PURE__*/React.createElement(Box, {
12737
+ sx: {
12738
+ height: '48px'
12739
+ }
12736
12740
  }, /*#__PURE__*/React.createElement(ServiceListConnect, {
12737
12741
  layerSelectWidth: width
12738
- })), /*#__PURE__*/React.createElement("div", {
12739
- className: classes.layerSelectContainer
12742
+ })), /*#__PURE__*/React.createElement(Box, {
12743
+ sx: {
12744
+ padding: '0 8px'
12745
+ }
12740
12746
  }, /*#__PURE__*/React.createElement(LayerListConnect, {
12741
12747
  mapId: mapId,
12742
12748
  layerSelectHeight: height
12743
12749
  })));
12744
12750
  };
12745
12751
 
12746
- var useStyles$g = makeStyles(function (theme) {
12747
- return createStyles({
12748
- listItem: {
12749
- width: '100%',
12750
- minWidth: '300px',
12751
- padding: '0px',
12752
- paddingLeft: '10px',
12753
- paddingRight: '50px',
12754
- fontSize: '12px'
12755
- },
12756
- onlyByttonText: {
12757
- color: theme.palette.geowebColors.buttons.primary["default"].fill,
12758
- fontSize: '14px',
12759
- fontWeight: 500
12760
- },
12761
- checkbox: {
12762
- paddingTop: '6px',
12763
- paddingBottom: '7px',
12764
- '&&:hover': {
12765
- backgroundColor: 'transparent'
12766
- }
12767
- },
12768
- listItemIcon: {
12769
- minWidth: '42px'
12770
- },
12771
- listItemText: {
12772
- textOverflow: 'ellipsis',
12773
- whiteSpace: 'nowrap',
12774
- overflow: 'hidden'
12775
- }
12776
- });
12777
- });
12778
-
12779
12752
  var FilterListItem = function FilterListItem(_ref) {
12780
12753
  var keyword = _ref.keyword,
12781
12754
  toggleKeywords = _ref.toggleKeywords,
12782
12755
  enableOnlyOneKeyword = _ref.enableOnlyOneKeyword;
12783
- var classes = useStyles$g();
12784
12756
 
12785
12757
  var _React$useState = React.useState(false),
12786
12758
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -12810,19 +12782,38 @@ var FilterListItem = function FilterListItem(_ref) {
12810
12782
  onBlur: handleMouseLeave,
12811
12783
  "data-testid": "filterResultListItem"
12812
12784
  }, /*#__PURE__*/React.createElement(ListItem, {
12813
- className: classes.listItem
12785
+ sx: {
12786
+ width: '100%',
12787
+ minWidth: '300px',
12788
+ padding: '0px',
12789
+ paddingLeft: '10px',
12790
+ paddingRight: '50px',
12791
+ fontSize: '12px'
12792
+ }
12814
12793
  }, /*#__PURE__*/React.createElement(ListItemIcon, {
12815
- className: classes.listItemIcon
12794
+ sx: {
12795
+ minWidth: '42px'
12796
+ }
12816
12797
  }, /*#__PURE__*/React.createElement(Checkbox, {
12817
12798
  color: "secondary",
12818
12799
  checked: keyword.checked,
12819
12800
  onChange: function onChange() {
12820
12801
  return toggleCheckbox(keyword.id);
12821
12802
  },
12822
- className: classes.checkbox
12803
+ sx: {
12804
+ paddingTop: '6px',
12805
+ paddingBottom: '7px',
12806
+ '&&:hover': {
12807
+ backgroundColor: 'transparent'
12808
+ }
12809
+ }
12823
12810
  })), /*#__PURE__*/React.createElement(Typography, {
12824
12811
  variant: "body2",
12825
- className: classes.listItemText
12812
+ sx: {
12813
+ textOverflow: 'ellipsis',
12814
+ whiteSpace: 'nowrap',
12815
+ overflow: 'hidden'
12816
+ }
12826
12817
  }, keyword.id), hovering ? /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(IconButton, {
12827
12818
  style: {
12828
12819
  backgroundColor: 'transparent'
@@ -12834,7 +12825,11 @@ var FilterListItem = function FilterListItem(_ref) {
12834
12825
  },
12835
12826
  "data-testid": "onlyButton"
12836
12827
  }, /*#__PURE__*/React.createElement(Typography, {
12837
- className: classes.onlyByttonText
12828
+ sx: {
12829
+ color: 'geowebColors.buttons.primary.default.fill',
12830
+ fontSize: '14px',
12831
+ fontWeight: 500
12832
+ }
12838
12833
  }, "ONLY"))) : null));
12839
12834
  }
12840
12835
 
@@ -12937,26 +12932,9 @@ var KeywordFilterSelectAllSwitchConnect = function KeywordFilterSelectAllSwitchC
12937
12932
  * See the License for the specific language governing permissions and
12938
12933
  * limitations under the License.
12939
12934
  *
12940
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12941
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
12935
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12936
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
12942
12937
  * */
12943
- var useStyles$f = makeStyles(function (theme) {
12944
- return createStyles({
12945
- selectAll: {
12946
- padding: '15px',
12947
- paddingLeft: '20px'
12948
- },
12949
- "switch": {
12950
- padding: '15px'
12951
- },
12952
- selectAllContainer: {
12953
- backgroundColor: theme.palette.background.paper,
12954
- position: 'sticky',
12955
- top: 0,
12956
- zIndex: 100
12957
- }
12958
- });
12959
- });
12960
12938
 
12961
12939
  var KeywordFilterResults = function KeywordFilterResults(_ref) {
12962
12940
  var allKeywordIds = _ref.allKeywordIds,
@@ -12972,7 +12950,6 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
12972
12950
  order = _ref$order === void 0 ? 0 : _ref$order,
12973
12951
  _ref$source = _ref.source,
12974
12952
  source = _ref$source === void 0 ? 'module' : _ref$source;
12975
- var classes = useStyles$f();
12976
12953
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
12977
12954
  title: showTitle ? "Filter Results ".concat(mapId) : 'Filter Results',
12978
12955
  "data-testid": "keywordFilterResults",
@@ -12995,21 +12972,31 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
12995
12972
  xs: 12,
12996
12973
  justifyContent: "space-between",
12997
12974
  alignItems: "center",
12998
- className: classes.selectAllContainer
12975
+ sx: {
12976
+ backgroundColor: 'background.paper',
12977
+ position: 'sticky',
12978
+ top: 0,
12979
+ zIndex: 100
12980
+ }
12999
12981
  }, /*#__PURE__*/React.createElement(Grid, {
13000
12982
  container: true,
13001
12983
  item: true,
13002
12984
  xs: 6,
13003
12985
  justifyContent: "flex-start",
13004
12986
  alignItems: "center",
13005
- className: classes.selectAll
12987
+ sx: {
12988
+ padding: '15px',
12989
+ paddingLeft: '20px'
12990
+ }
13006
12991
  }, "Select all"), /*#__PURE__*/React.createElement(Grid, {
13007
12992
  container: true,
13008
12993
  item: true,
13009
12994
  xs: 6,
13010
12995
  justifyContent: "flex-end",
13011
12996
  alignContent: "center",
13012
- className: classes["switch"]
12997
+ sx: {
12998
+ padding: '15px'
12999
+ }
13013
13000
  }, /*#__PURE__*/React.createElement(KeywordFilterSelectAllSwitchConnect, null))), /*#__PURE__*/React.createElement(List, {
13014
13001
  dense: true,
13015
13002
  style: {
@@ -13399,15 +13386,10 @@ var MapControlButton = function MapControlButton(_a) {
13399
13386
  return /*#__PURE__*/React.createElement(Tooltip, {
13400
13387
  placement: placement,
13401
13388
  title: title
13402
- }, /*#__PURE__*/React.createElement(Box, {
13403
- component: "span",
13404
- sx: {
13405
- marginBottom: '8px'
13406
- }
13407
13389
  }, /*#__PURE__*/React.createElement(ToolButton, Object.assign({
13408
13390
  onClick: onClick,
13409
13391
  active: isActive
13410
- }, props), children)));
13392
+ }, props), children));
13411
13393
  };
13412
13394
 
13413
13395
  /* *
@@ -13509,37 +13491,30 @@ var ZoomControlConnect = function ZoomControlConnect(_ref) {
13509
13491
  * See the License for the specific language governing permissions and
13510
13492
  * limitations under the License.
13511
13493
  *
13512
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13513
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
13494
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13495
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
13514
13496
  * */
13515
- var useStyles$e = makeStyles(function () {
13516
- return {
13517
- container: {
13518
- '& > button': {
13519
- marginBottom: 8
13520
- }
13521
- },
13522
- wrapper: {
13497
+
13498
+ var MapControls = function MapControls(_a) {
13499
+ var children = _a.children,
13500
+ props = __rest(_a, ["children"]);
13501
+
13502
+ return /*#__PURE__*/React.createElement(Box, Object.assign({
13503
+ sx: {
13523
13504
  position: 'absolute',
13524
13505
  overflow: 'visible',
13525
13506
  display: 'block',
13526
13507
  left: 0,
13527
- margin: 8,
13508
+ margin: 1,
13528
13509
  zIndex: 50,
13529
- top: 96
13510
+ top: '96px'
13530
13511
  }
13531
- };
13532
- });
13533
-
13534
- var MapControls = function MapControls(_a) {
13535
- var children = _a.children,
13536
- props = __rest(_a, ["children"]);
13537
-
13538
- var classes = useStyles$e();
13539
- return /*#__PURE__*/React.createElement("div", Object.assign({
13540
- className: classes.wrapper
13541
13512
  }, props), /*#__PURE__*/React.createElement(Grid, {
13542
- className: classes.container,
13513
+ sx: {
13514
+ '& > button': {
13515
+ marginBottom: 1
13516
+ }
13517
+ },
13543
13518
  container: true,
13544
13519
  direction: "column"
13545
13520
  }, children));
@@ -13658,28 +13633,13 @@ var DimensionSelectButton = function DimensionSelectButton(_ref) {
13658
13633
  }, /*#__PURE__*/React.createElement(Icon, null));
13659
13634
  };
13660
13635
 
13661
- var useStyles$d = makeStyles(function () {
13636
+ var SmallFontSlider = styled(Slider)(function () {
13662
13637
  return {
13663
- verticalLevelDimensionSelectContainer: {
13664
- height: '320px',
13665
- margin: '10px',
13666
- marginLeft: '-5px',
13667
- minWidth: 120,
13668
- fontSize: '90%'
13669
- },
13670
- layerName: {
13671
- paddingLeft: '10px',
13672
- maxWidth: 130,
13673
- overflow: 'hidden',
13674
- textOverflow: 'ellipsis'
13638
+ '& .MuiSlider-markLabel': {
13639
+ fontSize: '80%'
13675
13640
  }
13676
13641
  };
13677
13642
  });
13678
- var SmallFontSlider = withStyles({
13679
- markLabel: {
13680
- fontSize: '80%'
13681
- }
13682
- })(Slider);
13683
13643
 
13684
13644
  var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
13685
13645
  var marks = _ref.marks,
@@ -13695,7 +13655,6 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
13695
13655
  _ref$alertColor = _ref.alertColor,
13696
13656
  alertColor = _ref$alertColor === void 0 ? 'red' : _ref$alertColor,
13697
13657
  onChangeDimensionValue = _ref.onChangeDimensionValue;
13698
- var classes = useStyles$d();
13699
13658
 
13700
13659
  var _useState = useState(0),
13701
13660
  _useState2 = _slicedToArray(_useState, 2),
@@ -13724,9 +13683,15 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
13724
13683
  var sliderValue = managedValue !== null ? values.findIndex(function (v) {
13725
13684
  return v === managedValue;
13726
13685
  }) : currentIndex;
13727
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
13728
- className: classes.verticalLevelDimensionSelectContainer,
13729
- "data-testid": "slider-dimensionSelect"
13686
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
13687
+ "data-testid": "slider-dimensionSelect",
13688
+ sx: {
13689
+ height: '320px',
13690
+ margin: '10px',
13691
+ marginLeft: '-5px',
13692
+ minWidth: 120,
13693
+ fontSize: '90%'
13694
+ }
13730
13695
  }, /*#__PURE__*/React.createElement(Box, {
13731
13696
  component: "span",
13732
13697
  m: 1
@@ -13751,7 +13716,12 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
13751
13716
  title: layerName
13752
13717
  }, /*#__PURE__*/React.createElement(Typography, {
13753
13718
  variant: "body2",
13754
- className: classes.layerName
13719
+ sx: {
13720
+ paddingLeft: '10px',
13721
+ maxWidth: 130,
13722
+ overflow: 'hidden',
13723
+ textOverflow: 'ellipsis'
13724
+ }
13755
13725
  }, layerName)));
13756
13726
  };
13757
13727
 
@@ -14226,6 +14196,8 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
14226
14196
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14227
14197
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
14228
14198
  * */
14199
+ var titleOn = 'Auto update on';
14200
+ var titleOff = 'Auto update off';
14229
14201
 
14230
14202
  var AutoUpdateButton = function AutoUpdateButton(_ref) {
14231
14203
  var _ref$toggleAutoUpdate = _ref.toggleAutoUpdate,
@@ -14237,10 +14209,9 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
14237
14209
  _ref$disabled = _ref.disabled,
14238
14210
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
14239
14211
  return /*#__PURE__*/React.createElement(Tooltip, {
14240
- title: isAutoUpdating ? 'Auto update on' : 'Auto update off'
14241
- }, /*#__PURE__*/React.createElement("span", {
14212
+ title: isAutoUpdating ? titleOn : titleOff,
14242
14213
  "data-testid": "autoUpdateButtonTooltip"
14243
- }, /*#__PURE__*/React.createElement(ToolButton, {
14214
+ }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
14244
14215
  active: isAutoUpdating,
14245
14216
  disabled: disabled,
14246
14217
  onClick: function onClick() {
@@ -14254,29 +14225,11 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
14254
14225
  }))));
14255
14226
  };
14256
14227
 
14257
- var useStyles$c = makeStyles(function (theme) {
14258
- return {
14259
- speedButtonDiv: {
14260
- height: '24px',
14261
- width: '24px',
14262
- position: 'relative'
14263
- },
14264
- sliderBackground: {
14265
- padding: '0 0 60px 0',
14266
- backgroundColor: theme.palette.geowebColors.background.surface,
14267
- width: '95px',
14268
- height: '150px',
14269
- position: 'absolute',
14270
- bottom: '34px',
14271
- left: '-18px'
14272
- }
14273
- };
14274
- });
14228
+ var speedTooltipTitle = 'Speed';
14275
14229
 
14276
14230
  var SpeedButton = function SpeedButton(_ref) {
14277
14231
  var animationDelay = _ref.animationDelay,
14278
14232
  setMapAnimationDelay = _ref.setMapAnimationDelay;
14279
- var classes = useStyles$c();
14280
14233
 
14281
14234
  var _React$useState = React.useState(false),
14282
14235
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -14329,18 +14282,29 @@ var SpeedButton = function SpeedButton(_ref) {
14329
14282
  };
14330
14283
 
14331
14284
  var text = marks[currentValue].text;
14332
- return /*#__PURE__*/React.createElement("div", {
14333
- className: classes.speedButtonDiv
14285
+ return /*#__PURE__*/React.createElement(Box, {
14286
+ sx: {
14287
+ height: '24px',
14288
+ width: '24px',
14289
+ position: 'relative'
14290
+ }
14334
14291
  }, /*#__PURE__*/React.createElement(Tooltip, {
14335
- title: "Speed"
14336
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
14292
+ title: speedTooltipTitle
14293
+ }, /*#__PURE__*/React.createElement(ToolButton, {
14337
14294
  onClick: onClickButton,
14338
14295
  active: true,
14339
14296
  "data-testid": "speedButton"
14340
14297
  }, /*#__PURE__*/React.createElement(TextIcon, {
14341
14298
  text: text
14342
- })))), open ? /*#__PURE__*/React.createElement("div", {
14343
- className: classes.sliderBackground
14299
+ }))), open ? /*#__PURE__*/React.createElement(Box, {
14300
+ sx: {
14301
+ padding: '0 0 60px 0',
14302
+ backgroundColor: 'geowebColors.background.surface',
14303
+ width: '95px',
14304
+ height: '150px',
14305
+ position: 'absolute',
14306
+ bottom: '35px'
14307
+ }
14344
14308
  }, /*#__PURE__*/React.createElement(Box, {
14345
14309
  sx: sliderHeaderStyle
14346
14310
  }, "Speed"), /*#__PURE__*/React.createElement(CustomSlider, {
@@ -14363,12 +14327,6 @@ var SpeedButton = function SpeedButton(_ref) {
14363
14327
  })) : null);
14364
14328
  };
14365
14329
 
14366
- var timestepAutoSwitchActive = {
14367
- title: 'Timestep Auto on'
14368
- };
14369
- var timestepAutoSwitchInactive = {
14370
- title: 'Timestep Auto off'
14371
- };
14372
14330
  var timeStepMarks = [{
14373
14331
  value: 1,
14374
14332
  label: '1 min',
@@ -14475,34 +14433,7 @@ var timeStepMarks = [{
14475
14433
  timeStepValue: 5256000,
14476
14434
  text: '10y'
14477
14435
  }];
14478
- var useStyles$b = makeStyles(function (theme) {
14479
- return {
14480
- timeStepDiv: {
14481
- width: '58px',
14482
- height: '24px',
14483
- position: 'relative'
14484
- },
14485
- sliderBackground: {
14486
- backgroundColor: theme.palette.geowebColors.background.surface,
14487
- width: '110px',
14488
- height: '350px',
14489
- padding: '0 0 83px 0',
14490
- position: 'absolute',
14491
- bottom: '34px'
14492
- },
14493
- timestepAutoText: {
14494
- fontFamily: 'Roboto-Black, Roboto',
14495
- fontSize: 12,
14496
- color: theme.palette.geowebColors.typographyAndIcons.text
14497
- },
14498
- timestepAutoTextOff: {
14499
- fontFamily: 'Roboto-Black, Roboto',
14500
- fontSize: 12,
14501
- color: theme.palette.geowebColors.typographyAndIcons.text
14502
- },
14503
- disabled: {}
14504
- };
14505
- });
14436
+ var timeStepTitle = 'Time step';
14506
14437
 
14507
14438
  var TimeStepButton = function TimeStepButton(_ref) {
14508
14439
  var timeStep = _ref.timeStep,
@@ -14515,131 +14446,109 @@ var TimeStepButton = function TimeStepButton(_ref) {
14515
14446
  _ref$onToggleTimestep = _ref.onToggleTimestepAuto,
14516
14447
  onToggleTimestepAuto = _ref$onToggleTimestep === void 0 ? function () {
14517
14448
  return null;
14518
- } : _ref$onToggleTimestep;
14519
- var classes = useStyles$b();
14520
-
14521
- var _React$useState = React.useState(false),
14522
- _React$useState2 = _slicedToArray(_React$useState, 2),
14523
- open = _React$useState2[0],
14524
- setOpen = _React$useState2[1];
14525
-
14526
- var onClickButton = function onClickButton() {
14527
- setOpen(!open);
14528
- };
14529
-
14530
- var timestepAutoSwitch = !isTimestepAuto ? timestepAutoSwitchInactive : timestepAutoSwitchActive;
14531
- var timestepAutoTextStyle = !isTimestepAuto ? classes.timestepAutoText : classes.timestepAutoTextOff;
14532
- var disabledSlider = disabled || isTimestepAuto;
14449
+ } : _ref$onToggleTimestep,
14450
+ _ref$isOpenByDefault = _ref.isOpenByDefault,
14451
+ isOpenByDefault = _ref$isOpenByDefault === void 0 ? false : _ref$isOpenByDefault;
14533
14452
  var timeStepFromLayer = getActiveLayerTimeStep(timeDimension) || timeStep;
14534
14453
  var currentMark = timeStepMarks.find(function (mark) {
14535
14454
  return mark.timeStepValue === timeStep;
14536
14455
  });
14537
- var value = currentMark && currentMark.value ? currentMark.value : 0;
14538
- var min = timeStepMarks[0].value;
14539
- var max = timeStepMarks[timeStepMarks.length - 1].value;
14456
+ React__default.useEffect(function () {
14457
+ if (isTimestepAuto) {
14458
+ onChangeTimeStep(timeStepFromLayer);
14459
+ }
14460
+ }, [timeStepFromLayer, isTimestepAuto, onChangeTimeStep]);
14540
14461
 
14541
- var getTimeStepValue = function getTimeStepValue(value) {
14542
- return timeStepMarks[Math.round(value - 1)].timeStepValue;
14543
- };
14544
-
14545
- var onChangeSlider = function onChangeSlider(event, value) {
14546
- var newValue = getTimeStepValue(value);
14547
-
14548
- if (event.type !== 'keydown') {
14549
- onChangeTimeStep(newValue, MapActionOrigin.map);
14550
- }
14551
- };
14552
-
14553
- var onKeyDown = function onKeyDown(event) {
14554
- // disable default Slider behavior
14555
- event.stopPropagation();
14556
- event.preventDefault(); // custom logic
14557
-
14558
- if (event.key === 'Tab') {
14559
- setOpen(!open);
14560
- }
14462
+ var _React$useState = React__default.useState(null),
14463
+ _React$useState2 = _slicedToArray(_React$useState, 2),
14464
+ anchorRef = _React$useState2[0],
14465
+ setAnchorRef = _React$useState2[1];
14561
14466
 
14562
- var newValue = getValueFromKeyboardEvent(event, value, min, max);
14467
+ var _React$useState3 = React__default.useState(false),
14468
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
14469
+ open = _React$useState4[0],
14470
+ setOpen = _React$useState4[1];
14563
14471
 
14564
- if (newValue !== null) {
14565
- onChangeTimeStep(getTimeStepValue(newValue), MapActionOrigin.map);
14472
+ React__default.useEffect(function () {
14473
+ if (anchorRef && isOpenByDefault) {
14474
+ setOpen(true);
14566
14475
  }
14567
- };
14568
-
14569
- React.useEffect(function () {
14570
- if (isTimestepAuto) {
14571
- onChangeTimeStep(timeStepFromLayer);
14476
+ }, [anchorRef, isOpenByDefault]);
14477
+ return /*#__PURE__*/React__default.createElement(Box, {
14478
+ onKeyDown: function onKeyDown(event) {
14479
+ event.stopPropagation();
14572
14480
  }
14573
- }, [timeStepFromLayer, isTimestepAuto, onChangeTimeStep]);
14574
- return /*#__PURE__*/React.createElement("div", {
14575
- className: classes.timeStepDiv
14576
- }, /*#__PURE__*/React.createElement(Tooltip, {
14577
- title: "Time step"
14578
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
14481
+ }, /*#__PURE__*/React__default.createElement(Tooltip, {
14482
+ title: timeStepTitle
14483
+ }, /*#__PURE__*/React__default.createElement(ToolButton, {
14484
+ onClick: function onClick() {
14485
+ setOpen(true);
14486
+ },
14487
+ ref: setAnchorRef,
14579
14488
  active: true,
14580
- onClick: onClickButton,
14581
- "data-testid": "timeStepButton",
14582
14489
  width: "58px"
14583
- }, /*#__PURE__*/React.createElement(FastForward, null), /*#__PURE__*/React.createElement(TextIcon, {
14584
- text: currentMark && currentMark.text || '',
14585
- "data-testid": "timeStepButtonText"
14586
- })))), open ? /*#__PURE__*/React.createElement("div", {
14587
- className: classes.sliderBackground
14588
- }, /*#__PURE__*/React.createElement(Box, {
14589
- sx: sliderHeaderStyle
14590
- }, "Time step"), /*#__PURE__*/React.createElement(CustomSlider, {
14591
- "data-testid": "timeStepButtonSlider",
14592
- orientation: "vertical",
14593
- value: value,
14594
- step: null,
14595
- min: min,
14596
- max: max,
14597
- marks: timeStepMarks,
14598
- disabled: disabledSlider,
14599
- onChange: onChangeSlider,
14600
- onKeyDown: onKeyDown,
14601
- shouldAutoFocus: true
14602
- }), /*#__PURE__*/React.createElement(Tooltip, {
14603
- title: timestepAutoSwitch.title
14604
- }, /*#__PURE__*/React.createElement("span", {
14605
- "data-testid": "timestepAutoSwitchTooltip"
14606
- }, /*#__PURE__*/React.createElement(FormControlLabel, {
14607
- control: /*#__PURE__*/React.createElement(Switch, {
14608
- checked: isTimestepAuto,
14609
- onChange: function onChange() {
14610
- return onToggleTimestepAuto();
14611
- },
14612
- disabled: disabled,
14613
- id: "timestepAutoSwitch",
14614
- disableRipple: true,
14490
+ }, /*#__PURE__*/React__default.createElement(FastForward, null), /*#__PURE__*/React__default.createElement(TextIcon, {
14491
+ text: currentMark === null || currentMark === void 0 ? void 0 : currentMark.text
14492
+ }))), /*#__PURE__*/React__default.createElement(Menu, {
14493
+ anchorEl: anchorRef,
14494
+ open: open,
14495
+ onClose: function onClose() {
14496
+ return setOpen(false);
14497
+ },
14498
+ BackdropProps: {
14615
14499
  sx: {
14616
- marginLeft: '18px'
14500
+ backgroundColor: 'transparent'
14617
14501
  }
14618
- }),
14619
- label: "Auto",
14620
- labelPlacement: "end",
14621
- classes: {
14622
- label: timestepAutoTextStyle
14502
+ },
14503
+ anchorOrigin: {
14504
+ vertical: 'top',
14505
+ horizontal: 'center'
14506
+ },
14507
+ transformOrigin: {
14508
+ vertical: 'bottom',
14509
+ horizontal: 'center'
14623
14510
  }
14624
- })))) : null);
14511
+ }, timeStepMarks.sort(function (a, b) {
14512
+ return b.timeStepValue - a.timeStepValue;
14513
+ }).map(function (time) {
14514
+ return /*#__PURE__*/React__default.createElement(MenuItem, {
14515
+ onClick: function onClick() {
14516
+ if (isTimestepAuto) {
14517
+ onToggleTimestepAuto();
14518
+ }
14519
+
14520
+ onChangeTimeStep(time.timeStepValue, MapActionOrigin.map);
14521
+ setOpen(false);
14522
+ },
14523
+ key: time.timeStepValue,
14524
+ selected: (currentMark === null || currentMark === void 0 ? void 0 : currentMark.timeStepValue) === time.timeStepValue,
14525
+ disabled: disabled
14526
+ }, time.label);
14527
+ }), /*#__PURE__*/React__default.createElement(MenuItem, {
14528
+ onClick: function onClick() {
14529
+ onToggleTimestepAuto();
14530
+ setOpen(false);
14531
+ },
14532
+ selected: isTimestepAuto,
14533
+ disabled: disabled
14534
+ }, "Auto")));
14625
14535
  };
14626
14536
 
14627
- var OptionsPopOver = withStyles(function (theme) {
14537
+ var OptionsPopOver = styled(Popover)(function (_ref) {
14538
+ var theme = _ref.theme;
14628
14539
  return {
14629
- paper: {
14630
- height: '24px',
14631
- padding: '8px',
14632
- borderRadius: '0',
14540
+ '& .MuiPaper-root': {
14541
+ padding: '5px',
14633
14542
  overflow: 'visible',
14634
14543
  backgroundColor: theme.palette.geowebColors.background.surface
14635
14544
  }
14636
14545
  };
14637
- })(Popover);
14546
+ });
14638
14547
 
14639
- var OptionsMenuButton = function OptionsMenuButton(_ref) {
14640
- var autoUpdateBtn = _ref.autoUpdateBtn,
14641
- speedBtn = _ref.speedBtn,
14642
- timeStepBtn = _ref.timeStepBtn;
14548
+ var OptionsMenuButton = function OptionsMenuButton(_ref2) {
14549
+ var autoUpdateBtn = _ref2.autoUpdateBtn,
14550
+ speedBtn = _ref2.speedBtn,
14551
+ timeStepBtn = _ref2.timeStepBtn;
14643
14552
 
14644
14553
  var _React$useState = React.useState(null),
14645
14554
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -14657,7 +14566,8 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
14657
14566
  var open = Boolean(anchorEl);
14658
14567
  var id = open ? 'simple-popover' : undefined;
14659
14568
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
14660
- title: "Options"
14569
+ title: "Animation options",
14570
+ placement: "bottom"
14661
14571
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
14662
14572
  onClick: onClickButton,
14663
14573
  "data-testid": "optionsMenuButton",
@@ -14671,7 +14581,7 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
14671
14581
  anchorEl: anchorEl,
14672
14582
  onClose: handleClose,
14673
14583
  anchorOrigin: {
14674
- vertical: 'top',
14584
+ vertical: -5,
14675
14585
  horizontal: 'left'
14676
14586
  },
14677
14587
  transformOrigin: {
@@ -14719,53 +14629,18 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
14719
14629
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14720
14630
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
14721
14631
  * */
14722
- var useStyles$a = makeStyles({
14723
- buttonContainerBig: {
14724
- padding: '20px 0px 0px 12px',
14725
- width: '210px'
14726
- },
14727
- buttonContainerSmall: {
14728
- padding: '20px 0px 0px 12px',
14729
- width: '80px'
14730
- }
14731
- });
14732
14632
 
14733
14633
  var TimeSliderButtons = function TimeSliderButtons(_ref) {
14734
- var autoUpdateBtn = _ref.autoUpdateBtn,
14735
- optionsMenuBtn = _ref.optionsMenuBtn,
14736
- playBtn = _ref.playBtn,
14737
- speedBtn = _ref.speedBtn,
14738
- timeStepBtn = _ref.timeStepBtn;
14739
- var classes = useStyles$a();
14740
- var matches = useMediaQuery('(min-width:600px)');
14634
+ var optionsMenuBtn = _ref.optionsMenuBtn,
14635
+ playBtn = _ref.playBtn;
14741
14636
  return /*#__PURE__*/React.createElement("div", {
14742
14637
  "data-testid": "timeSliderButtons"
14743
- }, matches ? /*#__PURE__*/React.createElement(Grid, {
14638
+ }, /*#__PURE__*/React.createElement(Grid, {
14744
14639
  container: true,
14745
14640
  spacing: 2,
14746
- className: classes.buttonContainerBig
14747
- }, /*#__PURE__*/React.createElement(Grid, {
14748
- item: true
14749
- }, timeStepBtn || /*#__PURE__*/React.createElement(TimeStepButton, {
14750
- timeStep: 5,
14751
- onChangeTimeStep: function onChangeTimeStep() {
14752
- return null;
14753
- }
14754
- })), /*#__PURE__*/React.createElement(Grid, {
14755
- item: true
14756
- }, speedBtn || /*#__PURE__*/React.createElement(SpeedButton, {
14757
- animationDelay: defaultAnimationDelayAtStart,
14758
- setMapAnimationDelay: function setMapAnimationDelay() {
14759
- return null;
14641
+ sx: {
14642
+ padding: '20px 0px 0px 16px'
14760
14643
  }
14761
- })), /*#__PURE__*/React.createElement(Grid, {
14762
- item: true
14763
- }, autoUpdateBtn || /*#__PURE__*/React.createElement(AutoUpdateButton, null)), /*#__PURE__*/React.createElement(Grid, {
14764
- item: true
14765
- }, playBtn || /*#__PURE__*/React.createElement(PlayButton, null))) : /*#__PURE__*/React.createElement(Grid, {
14766
- container: true,
14767
- spacing: 1,
14768
- className: classes.buttonContainerSmall
14769
14644
  }, /*#__PURE__*/React.createElement(Grid, {
14770
14645
  item: true
14771
14646
  }, optionsMenuBtn || /*#__PURE__*/React.createElement(OptionsMenuButton, null)), /*#__PURE__*/React.createElement(Grid, {
@@ -15448,12 +15323,6 @@ var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, can
15448
15323
  drawCurrentTime(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, currentTimeUnix);
15449
15324
  };
15450
15325
 
15451
- var useStyles$9 = makeStyles({
15452
- timeSliderLegend: {
15453
- height: '50px'
15454
- }
15455
- });
15456
-
15457
15326
  var getNextSecondsPerPxValue = function getNextSecondsPerPxValue(direction, oldSecondsPerPx, dataScaleToSecondsPerPx) {
15458
15327
  var fullSecondsPerPxValues = secondsPerPxValues(dataScaleToSecondsPerPx);
15459
15328
  var ind = fullSecondsPerPxValues.indexOf(oldSecondsPerPx);
@@ -15491,7 +15360,6 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15491
15360
  onSetNewDate = _ref.onSetNewDate,
15492
15361
  onSetCenterTime = _ref.onSetCenterTime,
15493
15362
  onZoom = _ref.onZoom;
15494
- var classes = useStyles$9();
15495
15363
 
15496
15364
  var _useCanvasTarget = useCanvasTarget('mousedown'),
15497
15365
  _useCanvasTarget2 = _slicedToArray(_useCanvasTarget, 2),
@@ -15571,9 +15439,11 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15571
15439
  throttledZoom(newSecondsPerPx, newCenterTime);
15572
15440
  };
15573
15441
 
15574
- return /*#__PURE__*/React.createElement("div", {
15575
- className: classes.timeSliderLegend,
15576
- "data-testid": "timeSliderLegend"
15442
+ return /*#__PURE__*/React.createElement(Box, {
15443
+ "data-testid": "timeSliderLegend",
15444
+ sx: {
15445
+ height: '50px'
15446
+ }
15577
15447
  }, /*#__PURE__*/React.createElement(CanvasComponent, {
15578
15448
  ref: node,
15579
15449
  onMouseMove: function onMouseMove(x, y, event, width) {
@@ -15642,31 +15512,12 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15642
15512
  * See the License for the specific language governing permissions and
15643
15513
  * limitations under the License.
15644
15514
  *
15645
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15646
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
15515
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15516
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
15647
15517
  * */
15648
15518
  var scaleSliderOtherSettings = {
15649
15519
  LEFT_PADDING: '10%'
15650
15520
  };
15651
- var useStyles$8 = makeStyles(function (theme) {
15652
- return {
15653
- Background: {
15654
- backgroundColor: theme.palette.geowebColors.background.surface,
15655
- width: '229px',
15656
- height: '40px',
15657
- paddingTop: '4px',
15658
- paddingBottom: '7px',
15659
- boxSizing: 'content-box'
15660
- },
15661
- ScaleText: {
15662
- width: '67px',
15663
- height: '15px',
15664
- padding: '0px 10px 0 8px',
15665
- color: theme.palette.geowebColors.typographyAndIcons.text,
15666
- font: "".concat(theme.palette.geowebColors.timeSlider.timeScaleText.fontSize, "px Roboto")
15667
- }
15668
- };
15669
- });
15670
15521
 
15671
15522
  var thumbComponent = function thumbComponent(props) {
15672
15523
  var children = props.children,
@@ -15721,14 +15572,15 @@ var valueLabelFormat = function valueLabelFormat(value) {
15721
15572
  return valueNew;
15722
15573
  };
15723
15574
 
15724
- var GeoWebScaleSlider = withStyles(function (theme) {
15575
+ var GeoWebScaleSlider = styled(Slider)(function (_ref) {
15576
+ var theme = _ref.theme;
15725
15577
  return {
15726
- root: {
15578
+ '&.MuiSlider-root': {
15727
15579
  height: 4,
15728
15580
  width: 167,
15729
15581
  margin: "0 0 18px ".concat(scaleSliderOtherSettings.LEFT_PADDING)
15730
15582
  },
15731
- thumb: {
15583
+ '& .MuiSlider-thumb': {
15732
15584
  backgroundColor: 'rgba(0,0,0,0)',
15733
15585
  marginTop: 0,
15734
15586
  width: 12,
@@ -15741,57 +15593,56 @@ var GeoWebScaleSlider = withStyles(function (theme) {
15741
15593
  display: 'none'
15742
15594
  }
15743
15595
  },
15744
- valueLabel: {
15596
+ '& .MuiSlider-valueLabel': {
15745
15597
  left: '20px'
15746
15598
  },
15747
- rail: {
15599
+ '& .MuiSlider-rail': {
15748
15600
  color: theme.palette.geowebColors.timeSlider.timeScaleHorizontalScale.fill,
15749
15601
  height: 4,
15750
15602
  width: 170,
15751
15603
  borderRadius: 4.5,
15752
15604
  opacity: theme.palette.geowebColors.timeSlider.timeScaleHorizontalScale.opacity
15753
15605
  },
15754
- mark: {
15606
+ '& .MuiSlider-mark': {
15755
15607
  backgroundColor: theme.palette.geowebColors.timeSlider.timeScaleTimeIndicators.fill,
15756
15608
  height: 6,
15757
15609
  width: 2,
15758
- marginTop: -9
15759
- },
15760
- markActive: {
15761
- backgroundColor: theme.palette.geowebColors.timeSlider.timeScaleTimeIndicatorsActive.fill,
15762
- height: 6,
15763
- width: 2,
15764
- marginTop: -9
15610
+ marginTop: -9,
15611
+ '&.MuiSlider-markActive': {
15612
+ backgroundColor: theme.palette.geowebColors.timeSlider.timeScaleTimeIndicatorsActive.fill,
15613
+ height: 6,
15614
+ width: 2,
15615
+ marginTop: -9
15616
+ }
15765
15617
  },
15766
15618
  '@media (max-width: 585px)': {
15767
- root: {
15619
+ '&.MuiSlider-root': {
15768
15620
  width: 110
15769
15621
  },
15770
- rail: {
15622
+ '& .MuiSlider-rail': {
15771
15623
  width: 110
15772
15624
  }
15773
15625
  },
15774
15626
  '@media (max-width: 395px)': {
15775
- root: {
15627
+ '&.MuiSlider-root': {
15776
15628
  width: 60
15777
15629
  },
15778
- rail: {
15630
+ '& .MuiSlider-rail': {
15779
15631
  width: 60
15780
15632
  }
15781
15633
  }
15782
15634
  };
15783
- })(Slider);
15635
+ });
15784
15636
  var RAIL_GUTTER_OFFSET = 0.4;
15785
15637
 
15786
- var TimeSliderScaleSlider = function TimeSliderScaleSlider(_ref) {
15787
- var layers = _ref.layers,
15788
- _ref$timeSliderScale = _ref.timeSliderScale,
15789
- timeSliderScale = _ref$timeSliderScale === void 0 ? Scale.Hour : _ref$timeSliderScale,
15790
- centerTime = _ref.centerTime,
15791
- secondsPerPx = _ref.secondsPerPx,
15792
- selectedTime = _ref.selectedTime,
15793
- onChangeTimeSliderScale = _ref.onChangeTimeSliderScale;
15794
- var classes = useStyles$8();
15638
+ var TimeSliderScaleSlider = function TimeSliderScaleSlider(_ref2) {
15639
+ var layers = _ref2.layers,
15640
+ _ref2$timeSliderScale = _ref2.timeSliderScale,
15641
+ timeSliderScale = _ref2$timeSliderScale === void 0 ? Scale.Hour : _ref2$timeSliderScale,
15642
+ centerTime = _ref2.centerTime,
15643
+ secondsPerPx = _ref2.secondsPerPx,
15644
+ selectedTime = _ref2.selectedTime,
15645
+ onChangeTimeSliderScale = _ref2.onChangeTimeSliderScale;
15795
15646
  var min = 0;
15796
15647
  var max = marks.length - 1;
15797
15648
  var value = marks.findIndex(function (mark) {
@@ -15835,12 +15686,25 @@ var TimeSliderScaleSlider = function TimeSliderScaleSlider(_ref) {
15835
15686
  var scaleTextPadding = {
15836
15687
  paddingLeft: paddingLeft
15837
15688
  };
15838
- return /*#__PURE__*/React.createElement("div", {
15839
- className: classes.Background,
15840
- "data-testid": "scaleSlider"
15841
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
15689
+ return /*#__PURE__*/React.createElement(Box, {
15690
+ "data-testid": "scaleSlider",
15691
+ sx: {
15692
+ backgroundColor: 'geowebColors.background.surface',
15693
+ width: '229px',
15694
+ height: '40px',
15695
+ paddingTop: '4px',
15696
+ paddingBottom: '7px',
15697
+ boxSizing: 'content-box'
15698
+ }
15699
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Box, {
15842
15700
  "data-testid": "scaleSliderText",
15843
- className: classes.ScaleText,
15701
+ sx: {
15702
+ width: '67px',
15703
+ height: '15px',
15704
+ padding: '0px 10px 0 8px',
15705
+ color: 'geowebColors.typographyAndIcons.text',
15706
+ font: '12px Roboto'
15707
+ },
15844
15708
  style: scaleTextPadding
15845
15709
  }, text)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(GeoWebScaleSlider, {
15846
15710
  "data-testid": "scaleSliderSlider",
@@ -16051,18 +15915,6 @@ var renderTimeSliderRailWithNeedle = function renderTimeSliderRailWithNeedle(ctx
16051
15915
  drawNewNeedleLabel(ctx, selected, selectedPx, animationStartPx, animationEndPx, scale, theme);
16052
15916
  };
16053
15917
 
16054
- var useStyles$7 = makeStyles({
16055
- timeSliderRail: {
16056
- '& div': {
16057
- outline: 'none'
16058
- },
16059
- height: '45px',
16060
- '& canvas': {
16061
- display: 'block'
16062
- }
16063
- }
16064
- });
16065
-
16066
15918
  var setPreviousTimeStep = function setPreviousTimeStep(timeStep, curTime, dataStartTime, onSetNewDate) {
16067
15919
  var prevTimeStep = moment.utc(curTime).subtract(timeStep, 'm').toISOString();
16068
15920
  if (!prevTimeStep) return;
@@ -16100,7 +15952,6 @@ var TimeSliderRail = function TimeSliderRail(_ref) {
16100
15952
  onSetAnimationEndTime = _ref.onSetAnimationEndTime,
16101
15953
  onSetNewDate = _ref.onSetNewDate,
16102
15954
  onSetCenterTime = _ref.onSetCenterTime;
16103
- var classes = useStyles$7();
16104
15955
  var ZOOM_RATIO = 1.1;
16105
15956
 
16106
15957
  var zoomOut = function zoomOut(relativeX) {
@@ -16319,12 +16170,20 @@ var TimeSliderRail = function TimeSliderRail(_ref) {
16319
16170
 
16320
16171
  }, [selectedTimeUnix]);
16321
16172
  var theme = useTheme();
16322
- return /*#__PURE__*/React.createElement("div", {
16323
- className: classes.timeSliderRail,
16173
+ return /*#__PURE__*/React.createElement(Box, {
16324
16174
  style: {
16325
16175
  cursor: cursorStyle
16326
16176
  },
16327
- "data-testid": "timeSliderRail"
16177
+ "data-testid": "timeSliderRail",
16178
+ sx: {
16179
+ '& div': {
16180
+ outline: 'none'
16181
+ },
16182
+ height: '45px',
16183
+ '& canvas': {
16184
+ display: 'block'
16185
+ }
16186
+ }
16328
16187
  }, /*#__PURE__*/React.createElement(CanvasComponent, {
16329
16188
  ref: node,
16330
16189
  onMouseDown: onMouseDown,
@@ -16382,19 +16241,9 @@ var TimeSliderRail = function TimeSliderRail(_ref) {
16382
16241
  * See the License for the specific language governing permissions and
16383
16242
  * limitations under the License.
16384
16243
  *
16385
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16386
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16244
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16245
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
16387
16246
  * */
16388
- var useStyles$6 = makeStyles({
16389
- container: {
16390
- display: 'grid',
16391
- gridTemplateColumns: 'minmax(100px, 210px) minmax(66%, 1fr)',
16392
- gridTemplateRows: '50px'
16393
- },
16394
- scaleSlider: {
16395
- height: '50px'
16396
- }
16397
- });
16398
16247
 
16399
16248
  var useTimeSliderKeyBoardControl = function useTimeSliderKeyBoardControl(mapIsActive, isVisible, onToggleTimeSlider) {
16400
16249
  React.useEffect(function () {
@@ -16431,12 +16280,15 @@ var TimeSlider = function TimeSlider(_ref) {
16431
16280
  isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible,
16432
16281
  _ref$onToggleTimeSlid = _ref.onToggleTimeSlider,
16433
16282
  onToggleTimeSlider = _ref$onToggleTimeSlid === void 0 ? function () {} : _ref$onToggleTimeSlid;
16434
- var styles = useStyles$6();
16435
16283
  useTimeSliderKeyBoardControl(mapIsActive, isVisible, onToggleTimeSlider);
16436
16284
  return isVisible ? /*#__PURE__*/React.createElement(Grid, {
16437
16285
  container: true,
16438
- className: styles.container,
16439
- "data-testid": "timeSlider"
16286
+ "data-testid": "timeSlider",
16287
+ sx: {
16288
+ display: 'grid',
16289
+ gridTemplateColumns: 'minmax(100px, 210px) minmax(66%, 1fr)',
16290
+ gridTemplateRows: '50px'
16291
+ }
16440
16292
  }, /*#__PURE__*/React.createElement(Grid, {
16441
16293
  item: true
16442
16294
  }, " ", buttons || /*#__PURE__*/React.createElement(TimeSliderButtons, null), " "), /*#__PURE__*/React.createElement(Grid, {
@@ -16446,7 +16298,9 @@ var TimeSlider = function TimeSlider(_ref) {
16446
16298
  mapIsActive: mapIsActive
16447
16299
  })), ' '), /*#__PURE__*/React.createElement(Grid, {
16448
16300
  item: true,
16449
- className: styles.scaleSlider
16301
+ sx: {
16302
+ height: '50px'
16303
+ }
16450
16304
  }, scaleSlider || /*#__PURE__*/React.createElement(TimeSliderScaleSlider, Object.assign({}, defaultProps, {
16451
16305
  selectedTime: defaultProps.selectedTime.unix(),
16452
16306
  timeSliderScale: Scale.Hour,
@@ -16675,20 +16529,11 @@ var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_ref) {
16675
16529
  var TimeSliderButtonsConnect = function TimeSliderButtonsConnect(_ref) {
16676
16530
  var mapId = _ref.mapId;
16677
16531
  return /*#__PURE__*/React.createElement(TimeSliderButtons, {
16678
- autoUpdateBtn: /*#__PURE__*/React.createElement(AutoUpdateButtonConnect, {
16679
- mapId: mapId
16680
- }),
16681
16532
  optionsMenuBtn: /*#__PURE__*/React.createElement(OptionsMenuButtonConnect, {
16682
16533
  mapId: mapId
16683
16534
  }),
16684
16535
  playBtn: /*#__PURE__*/React.createElement(PlayButtonConnect, {
16685
16536
  mapId: mapId
16686
- }),
16687
- speedBtn: /*#__PURE__*/React.createElement(SpeedButtonConnect, {
16688
- mapId: mapId
16689
- }),
16690
- timeStepBtn: /*#__PURE__*/React.createElement(TimeStepButtonComponent, {
16691
- mapId: mapId
16692
16537
  })
16693
16538
  });
16694
16539
  };
@@ -17131,29 +16976,25 @@ var TimeSliderConnect = connectRedux(ConnectedTimeSlider);
17131
16976
  * See the License for the specific language governing permissions and
17132
16977
  * limitations under the License.
17133
16978
  *
17134
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17135
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16979
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16980
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
17136
16981
  * */
17137
- var useStyles$5 = makeStyles({
17138
- MapViewLayer: {
17139
- width: '100%',
17140
- padding: '2px',
17141
- margin: 0,
17142
- wordWrap: 'break-word',
17143
- border: '1px solid rgba(0, 0, 0, 0.5)',
17144
- lineHeight: '14px',
17145
- fontSize: '10px',
17146
- background: 'rgba(255, 255, 255, 0.5)',
17147
- display: 'none'
17148
- }
17149
- });
17150
16982
 
17151
16983
  var MapViewLayer = function MapViewLayer(props) {
17152
16984
  var id = props.id;
17153
- var classes = useStyles$5();
17154
- return /*#__PURE__*/React.createElement("div", {
16985
+ return /*#__PURE__*/React.createElement(Box, {
17155
16986
  "data-testid": "mapViewLayer",
17156
- className: classes.MapViewLayer
16987
+ sx: {
16988
+ width: '100%',
16989
+ padding: '2px',
16990
+ margin: 0,
16991
+ wordWrap: 'break-word',
16992
+ border: '1px solid rgba(0, 0, 0, 0.5)',
16993
+ lineHeight: '14px',
16994
+ fontSize: '10px',
16995
+ background: 'rgba(255, 255, 255, 0.5)',
16996
+ display: 'none'
16997
+ }
17157
16998
  }, /*#__PURE__*/React.createElement("div", null, id), /*#__PURE__*/React.createElement("div", {
17158
16999
  // eslint-disable-next-line react/no-danger
17159
17000
  dangerouslySetInnerHTML: {
@@ -18451,12 +18292,12 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
18451
18292
 
18452
18293
  if (onHoverFeature) {
18453
18294
  var handleMouseStoppedTimer = function handleMouseStoppedTimer() {
18454
- var result = checkHoverFeatures(_this2.geojson, mouseX, mouseY, function (coordinates) {
18295
+ var result = checkHoverFeatures(_this2.geojson, _this2.mouseX, _this2.mouseY, function (coordinates) {
18455
18296
  return _this2.convertGeoCoordsToScreenCoords(coordinates);
18456
18297
  });
18457
18298
 
18458
18299
  if (result) {
18459
- var featureEvent = {
18300
+ _this2.featureEvent = {
18460
18301
  coordinateIndexInFeature: result.coordinateIndexInFeature,
18461
18302
  featureIndex: result.featureIndex,
18462
18303
  mouseX: mouseX,
@@ -18464,8 +18305,13 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
18464
18305
  isInEditMode: isInEditMode,
18465
18306
  feature: result.feature
18466
18307
  };
18467
- onHoverFeature(featureEvent);
18308
+ onHoverFeature(_this2.featureEvent);
18309
+ } else {
18310
+ _this2.featureEvent = undefined;
18468
18311
  }
18312
+
18313
+ var webmapjs = _this2.props.webmapjs;
18314
+ webmapjs && webmapjs.draw('AdagucMapDraw::onHoverFeature');
18469
18315
  };
18470
18316
 
18471
18317
  window.clearTimeout(this.mouseStoppedTimer);
@@ -19614,6 +19460,7 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
19614
19460
  var drawMarkerByDefault = !featureProperties || !featureProperties.imageURL || !featureProperties.drawFunction;
19615
19461
 
19616
19462
  if (featureProperties.drawFunction) {
19463
+ var isHovered = this.featureEvent && this.featureEvent.feature === feature;
19617
19464
  featureProperties.drawFunction({
19618
19465
  context: ctx,
19619
19466
  featureIndex: featureIndex,
@@ -19623,7 +19470,8 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
19623
19470
  isInEditMode: isInEditMode,
19624
19471
  feature: feature,
19625
19472
  mouseX: this.mouseX,
19626
- mouseY: this.mouseY
19473
+ mouseY: this.mouseY,
19474
+ isHovered: isHovered
19627
19475
  });
19628
19476
  } else if (drawStyledMarker || drawMarkerByDefault) {
19629
19477
  this.drawMarker(ctx, _coord, selected, middle, isInEditMode, featureProperties);
@@ -20934,22 +20782,9 @@ ReactMapView.defaultProps = {
20934
20782
  * See the License for the specific language governing permissions and
20935
20783
  * limitations under the License.
20936
20784
  *
20937
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20938
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
20785
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20786
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
20939
20787
  * */
20940
- var useStyles$4 = makeStyles(function () {
20941
- return {
20942
- mapTimeContainer: {
20943
- zIndex: 10,
20944
- justifySelf: 'center',
20945
- bottom: 12,
20946
- position: 'absolute'
20947
- },
20948
- mapTimeText: {
20949
- fontWeight: 500
20950
- }
20951
- };
20952
- });
20953
20788
  var getTimeDimension = function getTimeDimension(dimensions) {
20954
20789
  return dimensions.find(function (dimension) {
20955
20790
  return dimension.name === 'time' && dimension.currentValue !== undefined;
@@ -20964,7 +20799,6 @@ var MapTime = function MapTime(_ref) {
20964
20799
  var dimensions = _ref.dimensions,
20965
20800
  _ref$timeFormat = _ref.timeFormat,
20966
20801
  timeFormat = _ref$timeFormat === void 0 ? defaultTimeFormat : _ref$timeFormat;
20967
- var classes = useStyles$4();
20968
20802
  var timeDimension = getTimeDimension(dimensions);
20969
20803
 
20970
20804
  if (!timeDimension) {
@@ -20972,12 +20806,19 @@ var MapTime = function MapTime(_ref) {
20972
20806
  }
20973
20807
 
20974
20808
  var mapTime = formatTime(timeDimension.currentValue, timeFormat);
20975
- return /*#__PURE__*/React.createElement("div", {
20809
+ return /*#__PURE__*/React.createElement(Box, {
20976
20810
  "data-testid": "map-time",
20977
- className: classes.mapTimeContainer
20811
+ sx: {
20812
+ zIndex: 10,
20813
+ justifySelf: 'center',
20814
+ bottom: '12px',
20815
+ position: 'absolute'
20816
+ }
20978
20817
  }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Typography, {
20979
20818
  variant: "caption",
20980
- className: classes.mapTimeText
20819
+ sx: {
20820
+ fontWeight: 500
20821
+ }
20981
20822
  }, mapTime)));
20982
20823
  };
20983
20824
 
@@ -20994,24 +20835,9 @@ var MapTime = function MapTime(_ref) {
20994
20835
  * See the License for the specific language governing permissions and
20995
20836
  * limitations under the License.
20996
20837
  *
20997
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20998
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
20838
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20839
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
20999
20840
  * */
21000
- var useStyles$3 = makeStyles(function () {
21001
- return {
21002
- mapViewContainer: {
21003
- display: 'grid',
21004
- width: '100%',
21005
- height: '100%',
21006
- position: 'relative',
21007
- overflow: 'hidden'
21008
- },
21009
- mapView: {
21010
- gridColumnStart: 1,
21011
- gridRowStart: 1
21012
- }
21013
- };
21014
- });
21015
20841
 
21016
20842
  var MapView = function MapView(_a) {
21017
20843
  var children = _a.children,
@@ -21023,11 +20849,16 @@ var MapView = function MapView(_a) {
21023
20849
  displayTimeInMap = _a$displayTimeInMap === void 0 ? true : _a$displayTimeInMap,
21024
20850
  props = __rest(_a, ["children", "controls", "displayTimeInMap"]);
21025
20851
 
21026
- var classes = useStyles$3();
21027
20852
  var dimensions = props.dimensions;
21028
20853
  var adagucRef = React.useRef(null);
21029
- return /*#__PURE__*/React.createElement("div", {
21030
- className: classes.mapViewContainer
20854
+ return /*#__PURE__*/React.createElement(Box, {
20855
+ sx: {
20856
+ display: 'grid',
20857
+ width: '100%',
20858
+ height: '100%',
20859
+ position: 'relative',
20860
+ overflow: 'hidden'
20861
+ }
21031
20862
  }, controls && controls.zoomControls && /*#__PURE__*/React.createElement(MapControls, {
21032
20863
  style: {
21033
20864
  top: 0,
@@ -21043,8 +20874,11 @@ var MapView = function MapView(_a) {
21043
20874
  onZoomReset: function onZoomReset() {
21044
20875
  return adagucRef.current.zoomToLayer(adagucRef.current.getActiveLayer());
21045
20876
  }
21046
- })), /*#__PURE__*/React.createElement("div", {
21047
- className: classes.mapView
20877
+ })), /*#__PURE__*/React.createElement(Box, {
20878
+ sx: {
20879
+ gridColumnStart: 1,
20880
+ gridRowStart: 1
20881
+ }
21048
20882
  }, /*#__PURE__*/React.createElement(ReactMapView, Object.assign({}, props, {
21049
20883
  onRegisterAdaguc: function onRegisterAdaguc(adaguc) {
21050
20884
  adagucRef.current = adaguc;
@@ -21056,13 +20890,214 @@ var MapView = function MapView(_a) {
21056
20890
  }));
21057
20891
  };
21058
20892
 
21059
- /* *
21060
- * Licensed under the Apache License, Version 2.0 (the "License");
21061
- * you may not use this file except in compliance with the License.
21062
- * You may obtain a copy of the License at
21063
- *
21064
- * http://www.apache.org/licenses/LICENSE-2.0
21065
- *
20893
+ var useTouchZoomPan = function useTouchZoomPan(mapIsActive, mapId) {
20894
+ var _React$useState = React.useState(0),
20895
+ _React$useState2 = _slicedToArray(_React$useState, 2),
20896
+ firstTouchX = _React$useState2[0],
20897
+ setFirstTouchX = _React$useState2[1];
20898
+
20899
+ var _React$useState3 = React.useState(0),
20900
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
20901
+ firstTouchY = _React$useState4[0],
20902
+ setFirstTouchY = _React$useState4[1];
20903
+
20904
+ var _React$useState5 = React.useState(0),
20905
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
20906
+ secondTouchX = _React$useState6[0],
20907
+ setSecondTouchX = _React$useState6[1];
20908
+
20909
+ var _React$useState7 = React.useState(0),
20910
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
20911
+ secondTouchY = _React$useState8[0],
20912
+ setSecondTouchY = _React$useState8[1];
20913
+
20914
+ var _React$useState9 = React.useState(0),
20915
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
20916
+ prevDist = _React$useState10[0],
20917
+ setPrevDist = _React$useState10[1];
20918
+
20919
+ var isPanning = function isPanning(touches) {
20920
+ return (touches === null || touches === void 0 ? void 0 : touches.length) === 1;
20921
+ };
20922
+
20923
+ var isZooming = function isZooming(touches) {
20924
+ return (touches === null || touches === void 0 ? void 0 : touches.length) === 2;
20925
+ };
20926
+
20927
+ var isValidMap = React.useCallback(function (map, event) {
20928
+ var target = event.target;
20929
+ return map && target.tagName !== 'INPUT' && mapIsActive;
20930
+ }, [mapIsActive]);
20931
+
20932
+ var distance = function distance(x1, y1, x2, y2) {
20933
+ var dx = x1 - x2;
20934
+ var dy = y1 - y2;
20935
+ return Math.sqrt(dx * dx + dy * dy);
20936
+ };
20937
+
20938
+ var handleStart = React.useCallback(function (event) {
20939
+ var map = getWMJSMapById(mapId);
20940
+ if (!isValidMap(map, event)) return;
20941
+ var targetTouches = event.targetTouches;
20942
+ var firstTouch = targetTouches === null || targetTouches === void 0 ? void 0 : targetTouches.item(0);
20943
+ setFirstTouchX(firstTouch === null || firstTouch === void 0 ? void 0 : firstTouch.clientX);
20944
+ setFirstTouchY(firstTouch === null || firstTouch === void 0 ? void 0 : firstTouch.clientY);
20945
+
20946
+ if (isZooming(targetTouches)) {
20947
+ var secondTouch = targetTouches === null || targetTouches === void 0 ? void 0 : targetTouches.item(1);
20948
+ setSecondTouchX(secondTouch === null || secondTouch === void 0 ? void 0 : secondTouch.clientX);
20949
+ setSecondTouchY(secondTouch === null || secondTouch === void 0 ? void 0 : secondTouch.clientY);
20950
+ }
20951
+ }, [isValidMap, mapId]);
20952
+ var handleMove = React.useCallback(function (event) {
20953
+ var map = getWMJSMapById(mapId);
20954
+ if (!isValidMap(map, event)) return;
20955
+ event.preventDefault();
20956
+ var targetTouches = event.targetTouches;
20957
+ var firstTouch = targetTouches === null || targetTouches === void 0 ? void 0 : targetTouches.item(0);
20958
+ var firstX = firstTouch === null || firstTouch === void 0 ? void 0 : firstTouch.clientX;
20959
+ var firstY = firstTouch === null || firstTouch === void 0 ? void 0 : firstTouch.clientY;
20960
+ var elemWidth = firstTouch.target.clientWidth;
20961
+ var elemHeight = firstTouch.target.clientHeight;
20962
+ var distanceEps = TOUCH_PAN_STEP_PERCENTAGE * Math.min(elemWidth, elemHeight);
20963
+
20964
+ if (isPanning(targetTouches)) {
20965
+ // Pan with a one-point touch
20966
+ var dist = distance(firstTouchX, firstTouchY, firstX, firstY);
20967
+
20968
+ if (dist > distanceEps) {
20969
+ var distX = firstX - firstTouchX;
20970
+ var distY = firstY - firstTouchY;
20971
+ var unitDirX = distX / dist;
20972
+ var unitDirY = -distY / dist;
20973
+ setFirstTouchX(firstX);
20974
+ setFirstTouchY(firstY);
20975
+ map.mapPanPercentage(unitDirX * TOUCH_PAN_STEP_PERCENTAGE, unitDirY * TOUCH_PAN_STEP_PERCENTAGE);
20976
+ }
20977
+ } else if (isZooming(targetTouches)) {
20978
+ // Zoom with a two-point "pinch" touch
20979
+ setFirstTouchX(firstX);
20980
+ setFirstTouchY(firstY);
20981
+ var secondTouch = targetTouches === null || targetTouches === void 0 ? void 0 : targetTouches.item(1);
20982
+ setSecondTouchX(secondTouch === null || secondTouch === void 0 ? void 0 : secondTouch.clientX);
20983
+ setSecondTouchY(secondTouch === null || secondTouch === void 0 ? void 0 : secondTouch.clientY);
20984
+
20985
+ var _dist = distance(firstTouchX, firstTouchY, secondTouchX, secondTouchY);
20986
+
20987
+ if (Math.abs(_dist - prevDist) > distanceEps) {
20988
+ if (_dist < prevDist) {
20989
+ map.zoomOut();
20990
+ } else if (_dist > prevDist) {
20991
+ map.zoomIn(1);
20992
+ }
20993
+
20994
+ setPrevDist(_dist);
20995
+ }
20996
+ }
20997
+ }, [firstTouchX, firstTouchY, isValidMap, mapId, prevDist, secondTouchX, secondTouchY]);
20998
+ var handleEnd = React.useCallback(function () {}, []);
20999
+ React.useEffect(function () {
21000
+ document.addEventListener('touchstart', handleStart, {
21001
+ passive: false
21002
+ });
21003
+ document.addEventListener('touchmove', handleMove, {
21004
+ passive: false
21005
+ });
21006
+ document.addEventListener('touchend', handleEnd, {
21007
+ passive: false
21008
+ });
21009
+ return function () {
21010
+ document.removeEventListener('touchstart', handleStart);
21011
+ document.removeEventListener('touchmove', handleMove);
21012
+ document.removeEventListener('touchend', handleEnd);
21013
+ };
21014
+ }, [firstTouchX, firstTouchY, secondTouchX, secondTouchY, mapId, mapIsActive, prevDist, handleStart, handleMove, handleEnd]);
21015
+ };
21016
+ var TOUCH_PAN_STEP_PERCENTAGE = 0.02;
21017
+
21018
+ /* *
21019
+ * Licensed under the Apache License, Version 2.0 (the "License");
21020
+ * you may not use this file except in compliance with the License.
21021
+ * You may obtain a copy of the License at
21022
+ *
21023
+ * http://www.apache.org/licenses/LICENSE-2.0
21024
+ *
21025
+ * Unless required by applicable law or agreed to in writing, software
21026
+ * distributed under the License is distributed on an "AS IS" BASIS,
21027
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21028
+ * See the License for the specific language governing permissions and
21029
+ * limitations under the License.
21030
+ *
21031
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21032
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
21033
+ * */
21034
+ var useKeyboardZoomAndPan = function useKeyboardZoomAndPan(mapIsActive, mapId) {
21035
+ React.useEffect(function () {
21036
+ var keysPressedDown = {};
21037
+
21038
+ var handleKeyPress = function handleKeyPress(event) {
21039
+ var target = event.target;
21040
+ var map = getWMJSMapById(mapId);
21041
+
21042
+ if (map && target.tagName !== 'INPUT' && mapIsActive) {
21043
+ var key = event.key,
21044
+ type = event.type;
21045
+ keysPressedDown[key] = type === 'keydown';
21046
+
21047
+ if (keysPressedDown['+']) {
21048
+ map.zoomIn(1);
21049
+ } else if (keysPressedDown['-']) {
21050
+ map.zoomOut();
21051
+ }
21052
+
21053
+ var arrowRight = keysPressedDown['ArrowRight'];
21054
+ var arrowLeft = keysPressedDown['ArrowLeft'];
21055
+ var arrowUp = keysPressedDown['ArrowUp'];
21056
+ var arrowDown = keysPressedDown['ArrowDown'];
21057
+ var control = keysPressedDown['Control'];
21058
+
21059
+ if (!control && (arrowRight || arrowLeft || arrowUp || arrowDown)) {
21060
+ var x = 0;
21061
+ var y = 0;
21062
+
21063
+ if (arrowRight) {
21064
+ x -= PAN_STEP_PERCENTAGE;
21065
+ }
21066
+
21067
+ if (arrowLeft) {
21068
+ x += PAN_STEP_PERCENTAGE;
21069
+ }
21070
+
21071
+ if (arrowUp) {
21072
+ y -= PAN_STEP_PERCENTAGE;
21073
+ }
21074
+
21075
+ if (arrowDown) {
21076
+ y += PAN_STEP_PERCENTAGE;
21077
+ }
21078
+
21079
+ map.mapPanPercentage(x, y);
21080
+ }
21081
+ }
21082
+ };
21083
+
21084
+ document.addEventListener('keydown', handleKeyPress);
21085
+ document.addEventListener('keyup', handleKeyPress);
21086
+ return function () {
21087
+ document.removeEventListener('keydown', handleKeyPress);
21088
+ document.removeEventListener('keyup', handleKeyPress);
21089
+ };
21090
+ }, [mapIsActive, mapId]);
21091
+ };
21092
+ var PAN_STEP_PERCENTAGE = 0.02;
21093
+
21094
+ /* *
21095
+ * Licensed under the Apache License, Version 2.0 (the "License");
21096
+ * you may not use this file except in compliance with the License.
21097
+ * You may obtain a copy of the License at
21098
+ *
21099
+ * http://www.apache.org/licenses/LICENSE-2.0
21100
+ *
21066
21101
  * Unless required by applicable law or agreed to in writing, software
21067
21102
  * distributed under the License is distributed on an "AS IS" BASIS,
21068
21103
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21172,7 +21207,14 @@ var MapViewConnect = function MapViewConnect(_a) {
21172
21207
  var setSelectedFeature = React.useCallback(function (payload) {
21173
21208
  dispatch(mapActions$1.setSelectedFeature(payload));
21174
21209
  }, [dispatch]);
21175
- useKeyboardZoomAndPan(mapId);
21210
+ var activeWindowId = useSelector(getActiveWindowId);
21211
+
21212
+ var isActiveWindowId = function isActiveWindowId() {
21213
+ return activeWindowId === mapId;
21214
+ };
21215
+
21216
+ useKeyboardZoomAndPan(isActiveWindowId(), mapId);
21217
+ useTouchZoomPan(isActiveWindowId(), mapId);
21176
21218
  return /*#__PURE__*/React.createElement("div", {
21177
21219
  style: {
21178
21220
  height: '100%'
@@ -21268,69 +21310,6 @@ var MapViewConnect = function MapViewConnect(_a) {
21268
21310
  }), children));
21269
21311
  };
21270
21312
 
21271
- var useKeyboardZoomAndPan = function useKeyboardZoomAndPan(mapId) {
21272
- var activeWindowId = useSelector(getActiveWindowId);
21273
- var mapIsActive = activeWindowId === mapId;
21274
- React.useEffect(function () {
21275
- var keysPressedDown = {};
21276
-
21277
- var handleKeyPress = function handleKeyPress(event) {
21278
- var target = event.target;
21279
- var map = getWMJSMapById(mapId);
21280
-
21281
- if (map && target.tagName !== 'INPUT' && mapIsActive) {
21282
- var key = event.key,
21283
- type = event.type;
21284
- keysPressedDown[key] = type === 'keydown';
21285
-
21286
- if (keysPressedDown['+']) {
21287
- map.zoomIn(1);
21288
- } else if (keysPressedDown['-']) {
21289
- map.zoomOut();
21290
- }
21291
-
21292
- var arrowRight = keysPressedDown['ArrowRight'];
21293
- var arrowLeft = keysPressedDown['ArrowLeft'];
21294
- var arrowUp = keysPressedDown['ArrowUp'];
21295
- var arrowDown = keysPressedDown['ArrowDown'];
21296
- var control = keysPressedDown['Control'];
21297
-
21298
- if (!control && (arrowRight || arrowLeft || arrowUp || arrowDown)) {
21299
- var x = 0;
21300
- var y = 0;
21301
-
21302
- if (arrowRight) {
21303
- x -= PAN_STEP_PERCENTAGE;
21304
- }
21305
-
21306
- if (arrowLeft) {
21307
- x += PAN_STEP_PERCENTAGE;
21308
- }
21309
-
21310
- if (arrowUp) {
21311
- y -= PAN_STEP_PERCENTAGE;
21312
- }
21313
-
21314
- if (arrowDown) {
21315
- y += PAN_STEP_PERCENTAGE;
21316
- }
21317
-
21318
- map.mapPanPercentage(x, y);
21319
- }
21320
- }
21321
- };
21322
-
21323
- document.addEventListener('keydown', handleKeyPress);
21324
- document.addEventListener('keyup', handleKeyPress);
21325
- return function () {
21326
- document.removeEventListener('keydown', handleKeyPress);
21327
- document.removeEventListener('keyup', handleKeyPress);
21328
- };
21329
- }, [mapIsActive, mapId]);
21330
- };
21331
-
21332
- var PAN_STEP_PERCENTAGE = 0.02;
21333
-
21334
21313
  /* *
21335
21314
  * Licensed under the Apache License, Version 2.0 (the "License");
21336
21315
  * you may not use this file except in compliance with the License.
@@ -21531,20 +21510,20 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
21531
21510
  * See the License for the specific language governing permissions and
21532
21511
  * limitations under the License.
21533
21512
  *
21534
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21535
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
21513
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21514
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
21536
21515
  * */
21537
- var useStyles$2 = makeStyles(function (theme) {
21516
+
21517
+ var mapBoxStyle = function mapBoxStyle(theme) {
21538
21518
  return {
21539
- box: {
21540
- boxSizing: 'border-box',
21541
- "float": 'left',
21542
- '& .MapViewComponent': {
21543
- border: "1px solid ".concat(theme.palette.geowebColors.typographyAndIcons.iconLinkDisabled)
21544
- }
21519
+ boxSizing: 'border-box',
21520
+ "float": 'left',
21521
+ '& .MapViewComponent': {
21522
+ border: "1px solid ".concat(theme.palette.geowebColors.typographyAndIcons.iconLinkDisabled)
21545
21523
  }
21546
21524
  };
21547
- });
21525
+ };
21526
+
21548
21527
  var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
21549
21528
  var maps = _ref.maps,
21550
21529
  rows = _ref.rows,
@@ -21555,7 +21534,6 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
21555
21534
  showZoomControls = _ref$showZoomControls === void 0 ? true : _ref$showZoomControls,
21556
21535
  _ref$multiLegend = _ref.multiLegend,
21557
21536
  multiLegend = _ref$multiLegend === void 0 ? false : _ref$multiLegend;
21558
- var classes = useStyles$2();
21559
21537
  var dispatch = useDispatch();
21560
21538
  var syncGroupAddTarget = React__default.useCallback(function (payload) {
21561
21539
  dispatch(genericActions.syncGroupAddTarget(payload));
@@ -21600,10 +21578,10 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
21600
21578
  multiLegend: multiLegend
21601
21579
  }), maps.map(function (map, mapIndex) {
21602
21580
  var mapId = map.id;
21603
- return /*#__PURE__*/React__default.createElement("div", {
21604
- className: classes.box,
21581
+ return /*#__PURE__*/React__default.createElement(Box, {
21605
21582
  key: mapId,
21606
- style: mapStyle
21583
+ style: mapStyle,
21584
+ sx: mapBoxStyle
21607
21585
  }, /*#__PURE__*/React__default.createElement(ConfigurableMapConnect, {
21608
21586
  title: map.title,
21609
21587
  id: mapId,
@@ -21892,18 +21870,32 @@ var componentsLookUp = function componentsLookUp(_ref) {
21892
21870
  * See the License for the specific language governing permissions and
21893
21871
  * limitations under the License.
21894
21872
  *
21895
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21896
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
21873
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21874
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
21897
21875
  * */
21876
+ var styles = {
21877
+ listItem: {
21878
+ width: '80%',
21879
+ borderRadius: '5px'
21880
+ },
21881
+ isActive: {
21882
+ color: 'geowebColors.typographyAndIcons.icon'
21883
+ },
21884
+ checkboxIsActive: {
21885
+ color: 'geowebColors.typographyAndIcons.iconLinkActive'
21886
+ },
21887
+ isDisabled: {
21888
+ color: 'geowebColors.typographyAndIcons.iconLinkDisabled'
21889
+ }
21890
+ };
21898
21891
  var SyncGroupListItem = function SyncGroupListItem(_ref) {
21899
21892
  var viewStateData = _ref.viewStateData,
21900
21893
  groupId = _ref.groupId,
21901
21894
  selected = _ref.selected,
21902
21895
  sourcesById = _ref.sourcesById,
21903
21896
  handleToggle = _ref.handleToggle;
21904
- var classes = useStyles$1();
21905
- return /*#__PURE__*/React.createElement("div", {
21906
- className: classes.listItem
21897
+ return /*#__PURE__*/React.createElement(Box, {
21898
+ sx: styles.listItem
21907
21899
  }, sourcesById.map(function (source) {
21908
21900
  var isChecked = selected.includes(source.id); // Check if checkbox is checked in another group
21909
21901
 
@@ -21917,7 +21909,7 @@ var SyncGroupListItem = function SyncGroupListItem(_ref) {
21917
21909
  onClick: function onClick() {
21918
21910
  return handleToggle(source.id);
21919
21911
  },
21920
- className: classes.listItem
21912
+ sx: styles.listItem
21921
21913
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Checkbox, {
21922
21914
  edge: "start",
21923
21915
  checked: isChecked,
@@ -21926,30 +21918,13 @@ var SyncGroupListItem = function SyncGroupListItem(_ref) {
21926
21918
  inputProps: {
21927
21919
  'aria-labelledby': source.name
21928
21920
  },
21929
- className: isNotCheckedElseWhere ? classes.checkboxIsActive : classes.isDisabled,
21921
+ sx: isNotCheckedElseWhere ? styles.checkboxIsActive : styles.isDisabled,
21930
21922
  color: "default"
21931
21923
  })), /*#__PURE__*/React.createElement(Typography, {
21932
- className: isNotCheckedElseWhere ? classes.isActive : classes.isDisabled
21924
+ sx: isNotCheckedElseWhere ? styles.isActive : styles.isDisabled
21933
21925
  }, source.name));
21934
21926
  }));
21935
21927
  };
21936
- var useStyles$1 = makeStyles(function (theme) {
21937
- return createStyles({
21938
- listItem: {
21939
- width: '80%',
21940
- borderRadius: '5px'
21941
- },
21942
- isActive: {
21943
- color: theme.palette.geowebColors.typographyAndIcons.icon
21944
- },
21945
- checkboxIsActive: {
21946
- color: theme.palette.geowebColors.typographyAndIcons.iconLinkActive
21947
- },
21948
- isDisabled: {
21949
- color: theme.palette.geowebColors.typographyAndIcons.iconLinkDisabled
21950
- }
21951
- });
21952
- });
21953
21928
 
21954
21929
  /* *
21955
21930
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21964,8 +21939,8 @@ var useStyles$1 = makeStyles(function (theme) {
21964
21939
  * See the License for the specific language governing permissions and
21965
21940
  * limitations under the License.
21966
21941
  *
21967
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21968
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
21942
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21943
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
21969
21944
  * */
21970
21945
  var SyncGroupList = function SyncGroupList(_ref) {
21971
21946
  var viewStateData = _ref.viewStateData,
@@ -21973,15 +21948,26 @@ var SyncGroupList = function SyncGroupList(_ref) {
21973
21948
  _handleToggle = _ref.handleToggle,
21974
21949
  addNewGroup = _ref.addNewGroup,
21975
21950
  removeGroup = _ref.removeGroup;
21976
- var classes = useStyles();
21977
21951
  return /*#__PURE__*/React.createElement(List, {
21978
21952
  disablePadding: true
21979
21953
  }, viewStateData.groups.map(function (groupObject, index) {
21980
21954
  return /*#__PURE__*/React.createElement(Box, {
21981
21955
  key: groupObject.id,
21982
- className: index === 0 ? null : classes.childListItem
21983
- }, /*#__PURE__*/React.createElement("div", {
21984
- className: classes.syncGroupHeader
21956
+ sx: Object.assign({}, index !== 0 && {
21957
+ backgroundColor: 'geowebColors.syncGroups.drawerOpen.fill',
21958
+ boxShadow: 'inset 0px 7px 7px -7px, inset 0px -7px 7px -7px',
21959
+ color: '#000000'
21960
+ })
21961
+ }, /*#__PURE__*/React.createElement(Box, {
21962
+ sx: {
21963
+ display: 'flex',
21964
+ flexDirection: 'row',
21965
+ justifyContent: 'space-between',
21966
+ alignItems: 'center',
21967
+ color: 'geowebColors.typographyAndIcons.text',
21968
+ paddingLeft: '15px',
21969
+ paddingTop: '10px'
21970
+ }
21985
21971
  }, /*#__PURE__*/React.createElement(Typography, null, title), /*#__PURE__*/React.createElement(Tooltip, {
21986
21972
  title: index === 0 ? 'Add new group to list' : 'Remove group from list'
21987
21973
  }, /*#__PURE__*/React.createElement(IconButton, {
@@ -22006,24 +21992,6 @@ var SyncGroupList = function SyncGroupList(_ref) {
22006
21992
  }));
22007
21993
  }));
22008
21994
  };
22009
- var useStyles = makeStyles(function (theme) {
22010
- return createStyles({
22011
- syncGroupHeader: {
22012
- display: 'flex',
22013
- flexDirection: 'row',
22014
- justifyContent: 'space-between',
22015
- alignItems: 'center',
22016
- color: theme.palette.geowebColors.typographyAndIcons.text,
22017
- paddingLeft: '15px',
22018
- paddingTop: '10px'
22019
- },
22020
- childListItem: {
22021
- backgroundColor: theme.palette.geowebColors.syncGroups.drawerOpen.fill,
22022
- boxShadow: 'inset 0px 7px 7px -7px, inset 0px -7px 7px -7px',
22023
- color: '#000000'
22024
- }
22025
- });
22026
- });
22027
21995
 
22028
21996
  var SyncGroupViewer = function SyncGroupViewer(_ref) {
22029
21997
  var onClose = _ref.onClose,
@@ -22452,6 +22420,90 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref2) {
22452
22420
  }, children)));
22453
22421
  };
22454
22422
 
22423
+ /* *
22424
+ * Licensed under the Apache License, Version 2.0 (the "License");
22425
+ * you may not use this file except in compliance with the License.
22426
+ * You may obtain a copy of the License at
22427
+ *
22428
+ * http://www.apache.org/licenses/LICENSE-2.0
22429
+ *
22430
+ * Unless required by applicable law or agreed to in writing, software
22431
+ * distributed under the License is distributed on an "AS IS" BASIS,
22432
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22433
+ * See the License for the specific language governing permissions and
22434
+ * limitations under the License.
22435
+ *
22436
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22437
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
22438
+ * */
22439
+ var SnackbarWrapper = function SnackbarWrapper(_a) {
22440
+ var children = _a.children,
22441
+ isOpen = _a.isOpen,
22442
+ onCloseSnackbar = _a.onCloseSnackbar,
22443
+ id = _a.id,
22444
+ props = __rest(_a, ["children", "isOpen", "onCloseSnackbar", "id"]);
22445
+
22446
+ return /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(Snackbar, Object.assign({
22447
+ "data-testid": "snackbarComponent",
22448
+ open: isOpen,
22449
+ onClose: onCloseSnackbar,
22450
+ autoHideDuration: null,
22451
+ key: id,
22452
+ ClickAwayListenerProps: {
22453
+ mouseEvent: false
22454
+ },
22455
+ action: /*#__PURE__*/React.createElement(IconButton, {
22456
+ "aria-label": "close",
22457
+ "data-testid": "snackbarCloseButton",
22458
+ onClick: onCloseSnackbar,
22459
+ sx: {
22460
+ color: 'geowebColors.snackbar.action',
22461
+ '&:hover': {
22462
+ backgroundColor: 'geowebColors.snackbar.actionHover.rgba'
22463
+ }
22464
+ }
22465
+ }, /*#__PURE__*/React.createElement(Close, null))
22466
+ }, props)));
22467
+ };
22468
+
22469
+ /* *
22470
+ * Licensed under the Apache License, Version 2.0 (the "License");
22471
+ * you may not use this file except in compliance with the License.
22472
+ * You may obtain a copy of the License at
22473
+ *
22474
+ * http://www.apache.org/licenses/LICENSE-2.0
22475
+ *
22476
+ * Unless required by applicable law or agreed to in writing, software
22477
+ * distributed under the License is distributed on an "AS IS" BASIS,
22478
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22479
+ * See the License for the specific language governing permissions and
22480
+ * limitations under the License.
22481
+ *
22482
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22483
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
22484
+ * */
22485
+ var SnackbarWrapperConnect = function SnackbarWrapperConnect(_a) {
22486
+ var props = __rest(_a, []);
22487
+
22488
+ var dispatch = useDispatch();
22489
+
22490
+ var onCloseSnackbar = function onCloseSnackbar() {
22491
+ dispatch(snackbarActions.closeSnackbar());
22492
+ };
22493
+
22494
+ var currentSnackbarMessage = useSelector(function (store) {
22495
+ return getFirstSnackbarMessage(store);
22496
+ });
22497
+ return /*#__PURE__*/React.createElement(DynamicModuleLoader, {
22498
+ modules: [snackbarModuleConfig]
22499
+ }, /*#__PURE__*/React.createElement(SnackbarWrapper, Object.assign({
22500
+ isOpen: !!currentSnackbarMessage,
22501
+ onCloseSnackbar: onCloseSnackbar,
22502
+ message: currentSnackbarMessage ? currentSnackbarMessage.message : '',
22503
+ id: currentSnackbarMessage ? currentSnackbarMessage.id : ''
22504
+ }, props)));
22505
+ };
22506
+
22455
22507
  /* *
22456
22508
  * Licensed under the Apache License, Version 2.0 (the "License");
22457
22509
  * you may not use this file except in compliance with the License.
@@ -22469,7 +22521,9 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref2) {
22469
22521
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
22470
22522
  * */
22471
22523
  var MapWarningProperties = function MapWarningProperties(_ref) {
22472
- var selectedFeatureProperties = _ref.selectedFeatureProperties;
22524
+ var selectedFeatureProperties = _ref.selectedFeatureProperties,
22525
+ languageIndex = _ref.languageIndex;
22526
+ var language = languageIndex || 0;
22473
22527
  return /*#__PURE__*/React__default.createElement("div", {
22474
22528
  "data-testid": "map-warning-properties",
22475
22529
  style: {
@@ -22488,13 +22542,13 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
22488
22542
  "data-testid": "map-warning-properties-title"
22489
22543
  }, selectedFeatureProperties.areaDesc), selectedFeatureProperties.areaDesc && /*#__PURE__*/React__default.createElement("pre", {
22490
22544
  "data-testid": "map-warning-properties-row"
22491
- }, "event: ", selectedFeatureProperties.languages[2].event), selectedFeatureProperties.onset && /*#__PURE__*/React__default.createElement("pre", {
22545
+ }, "event: ", selectedFeatureProperties.languages[language].event), selectedFeatureProperties.onset && /*#__PURE__*/React__default.createElement("pre", {
22492
22546
  "data-testid": "map-warning-properties-row"
22493
22547
  }, "Sent:", ' ', moment.utc(selectedFeatureProperties.onset).format('DD MMM YYYY, HH:mm'), ' ', "UTC"), selectedFeatureProperties.expires && /*#__PURE__*/React__default.createElement("pre", {
22494
22548
  "data-testid": "map-warning-properties-row"
22495
- }, "Expires:", ' ', moment.utc(selectedFeatureProperties.expires).format('DD MMM YYYY, HH:mm'), ' ', "UTC"), selectedFeatureProperties.languages[2].senderName && /*#__PURE__*/React__default.createElement("pre", {
22549
+ }, "Expires:", ' ', moment.utc(selectedFeatureProperties.expires).format('DD MMM YYYY, HH:mm'), ' ', "UTC"), selectedFeatureProperties.languages[language].senderName && /*#__PURE__*/React__default.createElement("pre", {
22496
22550
  "data-testid": "map-warning-properties-row"
22497
- }, "Sender: ", selectedFeatureProperties.languages[2].senderName), selectedFeatureProperties.identifier && /*#__PURE__*/React__default.createElement("pre", {
22551
+ }, "Sender: ", selectedFeatureProperties.languages[language].senderName), selectedFeatureProperties.identifier && /*#__PURE__*/React__default.createElement("pre", {
22498
22552
  "data-testid": "map-warning-properties-row"
22499
22553
  }, "Identifier: ", selectedFeatureProperties.identifier));
22500
22554
  };
@@ -22517,4 +22571,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
22517
22571
  * */
22518
22572
  var mapActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions$1), serviceActions);
22519
22573
 
22520
- export { ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterBaseLayers, filterLayers, filterMapLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, getFirstTimeStepForLayerId, getInitialPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$5 as layerReducer, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, publicLayers, publicServices, registerWMJSMap, registerWMLayer, store, genericActions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, uiActions, uiModuleConfig, selectors$1 as uiSelectors, types as uiTypes, useStyles$2 as useStyles };
22574
+ export { ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SnackbarWrapperConnect, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$6 as layerReducer, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerWMJSMap, registerWMLayer, snackbarActions, store, genericActions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, uiActions, uiModuleConfig, selectors$1 as uiSelectors, types as uiTypes };