@opengeoweb/core 2.2.1 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/index.esm.js +1131 -1102
  2. package/index.umd.js +1147 -1108
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +1 -1
  4. package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.d.ts +2 -0
  5. package/lib/components/ConfigurableMapWithSlider/ConfigurableMapWithSliderConnect.d.ts +3 -0
  6. package/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +1 -0
  7. package/lib/components/{CustomToggleButton/CustomToggleButton.spec.d.ts → LayerManager/LayerContainerRow/LayerRow/LayerRowConnect.spec.d.ts} +0 -0
  8. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButton.d.ts +0 -2
  9. package/lib/components/LayerManager/LayerManagerUtils.d.ts +2 -2
  10. package/lib/components/LayerManager/LayerSelect/LayerList/LayerAddRemoveButton.d.ts +18 -0
  11. package/lib/components/LayerManager/{LayerContainerRow/LayerManagerButton.spec.d.ts → LayerSelect/LayerList/LayerAddRemoveButton.spec.d.ts} +0 -0
  12. package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +10 -0
  13. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListConnect.d.ts +1 -0
  14. package/lib/components/MapControls/MapControlButton.d.ts +1 -1
  15. package/lib/components/MapView/MapViewConnect.DisableMapPin.stories.d.ts +5 -0
  16. package/lib/components/MapView/MapViewConnect.stories.d.ts +1 -0
  17. package/lib/components/ReactMapView/types.d.ts +1 -0
  18. package/lib/components/SyncGroups/SyncGroupViewer.d.ts +2 -0
  19. package/lib/components/SyncGroups/SyncGroupViewerConnect.d.ts +1 -6
  20. package/lib/components/SyncGroups/selector.d.ts +4 -4
  21. package/lib/components/TimeSlider/TimeSliderButtons/PlayButton/PlayButtonConnect.d.ts +1 -0
  22. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +2 -0
  23. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendRenderFunctions.d.ts +1 -1
  24. package/lib/components/TooltipSelect/TooltipSelect.d.ts +1 -1
  25. package/lib/index.d.ts +4 -1
  26. package/lib/store/generic/selectors.d.ts +1 -0
  27. package/lib/store/generic/synchronizationGroups/actions.d.ts +2 -1
  28. package/lib/store/generic/synchronizationGroups/constants.d.ts +1 -0
  29. package/lib/store/generic/synchronizationGroups/sagas.d.ts +1 -0
  30. package/lib/store/generic/synchronizationGroups/selectors.d.ts +13 -0
  31. package/lib/store/generic/synchronizationGroups/types.d.ts +11 -2
  32. package/lib/store/mapStore/map/actions.d.ts +8 -1
  33. package/lib/store/mapStore/map/constants.d.ts +1 -0
  34. package/lib/store/mapStore/map/selectors.d.ts +52 -1
  35. package/lib/store/mapStore/map/types.d.ts +11 -2
  36. package/lib/store/ui/types.d.ts +1 -1
  37. package/lib/utils/testUtils.d.ts +2 -1
  38. package/lib/utils/types.d.ts +14 -23
  39. package/package.json +5 -5
  40. package/lib/components/CustomToggleButton/CustomToggleButton.d.ts +0 -9
  41. package/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +0 -13
  42. package/lib/components/LayerManager/LayerContainerRow/LayerManagerButton.d.ts +0 -12
  43. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.d.ts +0 -8
  44. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.spec.d.ts +0 -1
  45. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.d.ts +0 -8
  46. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.spec.d.ts +0 -1
  47. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuItemButton.d.ts +0 -8
  48. package/lib/components/LayerManager/LayerContainerRow/LayerRow/styles.d.ts +0 -4
  49. package/lib/components/ToolButton/ToolButton.d.ts +0 -12
  50. package/lib/components/ToolButton/ToolButton.spec.d.ts +0 -1
  51. package/lib/components/ToolButton/ToolButton.stories.d.ts +0 -13
  52. package/lib/components/ToolButton/index.d.ts +0 -1
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect'), require('moment'), require('lodash'), require('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('@mui/material'), require('@mui/styles/makeStyles'), require('react-redux'), require('@opengeoweb/shared'), require('@mui/icons-material'), require('react-sortablejs'), require('@mui/styles/createStyles'), require('@mui/styles/withStyles'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('redux-dynamic-modules'), require('redux-dynamic-modules-saga'), require('@opengeoweb/theme')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'moment', 'lodash', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', '@mui/material', '@mui/styles/makeStyles', 'react-redux', '@opengeoweb/shared', '@mui/icons-material', 'react-sortablejs', '@mui/styles/createStyles', '@mui/styles/withStyles', 'throttle-debounce', 'lodash.clonedeep', 'proj4', 'redux-dynamic-modules', 'redux-dynamic-modules-saga', '@opengeoweb/theme'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global.moment, global._, global.React, global.produce, global.effects, global.webmap, global.material, global.makeStyles, global.reactRedux, global.shared, global.iconsMaterial, global.reactSortablejs, global.createStyles, global.withStyles, global.throttleDebounce, global.cloneDeep, global.proj4, global.reduxDynamicModules, global.reduxDynamicModulesSaga, global.theme));
5
- })(this, (function (exports, reselect, moment, _, React, produce, effects, webmap, material, makeStyles, reactRedux, shared, iconsMaterial, reactSortablejs, createStyles, withStyles, throttleDebounce, cloneDeep, proj4, reduxDynamicModules, reduxDynamicModulesSaga, theme) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect'), require('moment'), require('lodash'), require('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('@mui/material'), require('react-redux'), require('@mui/styles/makeStyles'), require('@opengeoweb/shared'), require('@mui/icons-material'), require('react-sortablejs'), require('@mui/styles/createStyles'), require('@mui/styles/withStyles'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('redux-dynamic-modules'), require('redux-dynamic-modules-saga'), require('@opengeoweb/theme')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'moment', 'lodash', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', '@mui/material', 'react-redux', '@mui/styles/makeStyles', '@opengeoweb/shared', '@mui/icons-material', 'react-sortablejs', '@mui/styles/createStyles', '@mui/styles/withStyles', 'throttle-debounce', 'lodash.clonedeep', 'proj4', 'redux-dynamic-modules', 'redux-dynamic-modules-saga', '@opengeoweb/theme'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global.moment, global._, global.React, global.produce, global.effects, global.webmap, global.material, global.reactRedux, global.makeStyles, global.shared, global.iconsMaterial, global.reactSortablejs, global.createStyles, global.withStyles, global.throttleDebounce, global.cloneDeep, global.proj4, global.reduxDynamicModules, global.reduxDynamicModulesSaga, global.theme));
5
+ })(this, (function (exports, reselect, moment, _, React, produce, effects, webmap, material, reactRedux, makeStyles, shared, iconsMaterial, reactSortablejs, createStyles, withStyles, throttleDebounce, cloneDeep, proj4, reduxDynamicModules, reduxDynamicModulesSaga, theme) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -73,6 +73,7 @@
73
73
  var WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX = 'WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX';
74
74
  var WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX = 'WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX';
75
75
  var WEBMAP_SET_PIN = 'WEBMAP_SET_PIN';
76
+ var WEBMAP_DISABLE_PIN = 'WEBMAP_DISABLE_PIN';
76
77
 
77
78
  /* *
78
79
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -381,6 +382,19 @@
381
382
  payload: payload
382
383
  };
383
384
  };
385
+ /**
386
+ * Sets the diable map pin boolean
387
+ *
388
+ * Example: setMapPinLocation({ mapId: 'mapId1', diableMapPin: true })
389
+ * @param {object} payload object with mapId: string, diableMapPin: boolean
390
+ */
391
+
392
+ var setDisableMapPin = function setDisableMapPin(payload) {
393
+ return {
394
+ type: WEBMAP_DISABLE_PIN,
395
+ payload: payload
396
+ };
397
+ };
384
398
 
385
399
  /* *
386
400
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -757,6 +771,7 @@
757
771
  setTimeSliderSecondsPerPx: setTimeSliderSecondsPerPx,
758
772
  setTimeSliderDataScaleToSecondsPerPx: setTimeSliderDataScaleToSecondsPerPx,
759
773
  setMapPinLocation: setMapPinLocation,
774
+ setDisableMapPin: setDisableMapPin,
760
775
  setLayers: setLayers,
761
776
  setBaseLayers: setBaseLayers,
762
777
  addBaseLayer: addBaseLayer,
@@ -1292,6 +1307,103 @@
1292
1307
  return [];
1293
1308
  }, selectorMemoizationOptions);
1294
1309
 
1310
+ /* *
1311
+ * Licensed under the Apache License, Version 2.0 (the "License");
1312
+ * you may not use this file except in compliance with the License.
1313
+ * You may obtain a copy of the License at
1314
+ *
1315
+ * http://www.apache.org/licenses/LICENSE-2.0
1316
+ *
1317
+ * Unless required by applicable law or agreed to in writing, software
1318
+ * distributed under the License is distributed on an "AS IS" BASIS,
1319
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320
+ * See the License for the specific language governing permissions and
1321
+ * limitations under the License.
1322
+ *
1323
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1324
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1325
+ * */
1326
+
1327
+ /* Action constants for sources */
1328
+ var SYNCGROUPS_ADD_SOURCE = 'SYNCGROUPS_ADD_SOURCE';
1329
+ var SYNCGROUPS_REMOVE_SOURCE = 'SYNCGROUPS_REMOVE_SOURCE';
1330
+ /* Action constants for groups */
1331
+
1332
+ var SYNCGROUPS_TOGGLE_LINK_TARGET = 'SYNCGROUPS_TOGGLE_LINK_TARGET';
1333
+ var SYNCGROUPS_ADD_TARGET = 'SYNCGROUPS_ADD_TARGET';
1334
+ var SYNCGROUPS_REMOVE_TARGET = 'SYNCGROUPS_REMOVE_TARGET';
1335
+ var SYNCGROUPS_ADD_GROUP = 'SYNCGROUPS_ADD_GROUP';
1336
+ var SYNCGROUPS_REMOVE_GROUP = 'SYNCGROUPS_REMOVE_GROUP';
1337
+ var SYNCGROUPS_CLEAR = 'SYNCGROUPS_CLEAR';
1338
+ /* Type constants */
1339
+
1340
+ var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
1341
+ var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
1342
+ var SYNCGROUPS_TYPE_SETLAYERACTIONS = 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
1343
+ var SYNCGROUPS_SET_VIEW_STATE = 'SYNCGROUPS_SET_VIEW_STATE';
1344
+
1345
+ var constants$1 = /*#__PURE__*/Object.freeze({
1346
+ __proto__: null,
1347
+ SYNCGROUPS_ADD_SOURCE: SYNCGROUPS_ADD_SOURCE,
1348
+ SYNCGROUPS_REMOVE_SOURCE: SYNCGROUPS_REMOVE_SOURCE,
1349
+ SYNCGROUPS_TOGGLE_LINK_TARGET: SYNCGROUPS_TOGGLE_LINK_TARGET,
1350
+ SYNCGROUPS_ADD_TARGET: SYNCGROUPS_ADD_TARGET,
1351
+ SYNCGROUPS_REMOVE_TARGET: SYNCGROUPS_REMOVE_TARGET,
1352
+ SYNCGROUPS_ADD_GROUP: SYNCGROUPS_ADD_GROUP,
1353
+ SYNCGROUPS_REMOVE_GROUP: SYNCGROUPS_REMOVE_GROUP,
1354
+ SYNCGROUPS_CLEAR: SYNCGROUPS_CLEAR,
1355
+ SYNCGROUPS_TYPE_SETTIME: SYNCGROUPS_TYPE_SETTIME,
1356
+ SYNCGROUPS_TYPE_SETBBOX: SYNCGROUPS_TYPE_SETBBOX,
1357
+ SYNCGROUPS_TYPE_SETLAYERACTIONS: SYNCGROUPS_TYPE_SETLAYERACTIONS,
1358
+ SYNCGROUPS_SET_VIEW_STATE: SYNCGROUPS_SET_VIEW_STATE
1359
+ });
1360
+
1361
+ /* *
1362
+ * Licensed under the Apache License, Version 2.0 (the "License");
1363
+ * you may not use this file except in compliance with the License.
1364
+ * You may obtain a copy of the License at
1365
+ *
1366
+ * http://www.apache.org/licenses/LICENSE-2.0
1367
+ *
1368
+ * Unless required by applicable law or agreed to in writing, software
1369
+ * distributed under the License is distributed on an "AS IS" BASIS,
1370
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1371
+ * See the License for the specific language governing permissions and
1372
+ * limitations under the License.
1373
+ *
1374
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1375
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1376
+ * */
1377
+
1378
+ var synchronizationGroupStore = function synchronizationGroupStore(store) {
1379
+ return store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
1380
+ };
1381
+
1382
+ var getSynchronizationGroupStore = reselect.createSelector(synchronizationGroupStore, function (store) {
1383
+ return store;
1384
+ });
1385
+ /**
1386
+ * Returns the synchronization source by id
1387
+ * @param store The app store
1388
+ * @param id The source id to find
1389
+ */
1390
+
1391
+ var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
1392
+ if (state && state.sources) {
1393
+ var sources = state.sources;
1394
+
1395
+ if (sources.byId[id]) {
1396
+ return sources.byId[id];
1397
+ }
1398
+ }
1399
+
1400
+ return null;
1401
+ };
1402
+
1403
+ var getTime = reselect.createSelector(getSyncSourceBySourceId, function (store) {
1404
+ return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
1405
+ });
1406
+
1295
1407
  /*! *****************************************************************************
1296
1408
  Copyright (c) Microsoft Corporation.
1297
1409
 
@@ -2233,6 +2345,34 @@
2233
2345
  var isAnimating = reselect.createSelector(getMapById, function (store) {
2234
2346
  return store ? store.isAnimating : false;
2235
2347
  });
2348
+ /**
2349
+ * Gets if any linked map is animating
2350
+ *
2351
+ * Example: linkedMapIsAnimating = linkedMapAnimationInfo(store, 'mapid_1')
2352
+ * @param {object} store store: object - store object
2353
+ * @param {string} mapId mapId: string - Id of the map
2354
+ * @returns {object} returnType: object - object containing isAnimating boolean and id string
2355
+ */
2356
+
2357
+ var linkedMapAnimationInfo = reselect.createSelector(function (store, mapId) {
2358
+ var animationInfo = {
2359
+ isAnimating: isAnimating(store, mapId),
2360
+ id: mapId
2361
+ };
2362
+ getSynchronizationGroupStore(store).groups.allIds.forEach(function (groupId) {
2363
+ if (getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id] && getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id].linked) {
2364
+ getSynchronizationGroupStore(store).groups.byId[groupId].targets.allIds.forEach(function (id) {
2365
+ if (isAnimating(store, id) === true) {
2366
+ animationInfo.isAnimating = true;
2367
+ animationInfo.id = id;
2368
+ }
2369
+ });
2370
+ }
2371
+ });
2372
+ return animationInfo;
2373
+ }, function (animationInfo) {
2374
+ return animationInfo;
2375
+ });
2236
2376
  /**
2237
2377
  * Gets start time of animation
2238
2378
  *
@@ -2502,7 +2642,7 @@
2502
2642
  /**
2503
2643
  * Returns the mapPinLocation for the current map
2504
2644
  *
2505
- * Example getAllUniqueDimensions(store);
2645
+ * Example getPinLocation(store);
2506
2646
  * @param {object} store store: object - store object
2507
2647
  * @param {string} mapId mapId: string - Id of the map
2508
2648
  * @returns {object} returnType: latitude and longitude of pin
@@ -2511,6 +2651,18 @@
2511
2651
  var getPinLocation = reselect.createSelector(getMapById, function (store) {
2512
2652
  return store ? store.mapPinLocation : undefined;
2513
2653
  }, selectorMemoizationOptions);
2654
+ /**
2655
+ * Returns the disable map pin boolean for the current map
2656
+ *
2657
+ * Example getDisableMapPin(store);
2658
+ * @param {object} store store: object - store object
2659
+ * @param {string} mapId mapId: string - Id of the map
2660
+ * @returns {boolean} returnType: boolean or undefined
2661
+ */
2662
+
2663
+ var getDisableMapPin = reselect.createSelector(getMapById, function (store) {
2664
+ return store ? store.disableMapPin : undefined;
2665
+ });
2514
2666
 
2515
2667
  /* *
2516
2668
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -2662,7 +2814,7 @@
2662
2814
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2663
2815
  * */
2664
2816
 
2665
- var selectors = /*#__PURE__*/Object.freeze({
2817
+ var selectors$1 = /*#__PURE__*/Object.freeze({
2666
2818
  __proto__: null,
2667
2819
  getMapById: getMapById,
2668
2820
  getAllMapIds: getAllMapIds,
@@ -2680,6 +2832,7 @@
2680
2832
  getSrs: getSrs,
2681
2833
  getBbox: getBbox,
2682
2834
  isAnimating: isAnimating,
2835
+ linkedMapAnimationInfo: linkedMapAnimationInfo,
2683
2836
  getAnimationStartTime: getAnimationStartTime,
2684
2837
  getAnimationEndTime: getAnimationEndTime,
2685
2838
  isAutoUpdating: isAutoUpdating,
@@ -2700,6 +2853,7 @@
2700
2853
  getLayerByLayerIndex: getLayerByLayerIndex,
2701
2854
  getAllUniqueDimensions: getAllUniqueDimensions,
2702
2855
  getPinLocation: getPinLocation,
2856
+ getDisableMapPin: getDisableMapPin,
2703
2857
  getLayerById: getLayerById,
2704
2858
  getLayersById: getLayersById,
2705
2859
  getLayersIds: getLayersIds,
@@ -2744,7 +2898,7 @@
2744
2898
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2745
2899
  * */
2746
2900
 
2747
- var constants$1 = /*#__PURE__*/Object.freeze({
2901
+ var constants = /*#__PURE__*/Object.freeze({
2748
2902
  __proto__: null,
2749
2903
  WEBMAP_REGISTER_MAP: WEBMAP_REGISTER_MAP,
2750
2904
  WEBMAP_UNREGISTER_MAP: WEBMAP_UNREGISTER_MAP,
@@ -2768,6 +2922,7 @@
2768
2922
  WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX,
2769
2923
  WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX,
2770
2924
  WEBMAP_SET_PIN: WEBMAP_SET_PIN,
2925
+ WEBMAP_DISABLE_PIN: WEBMAP_DISABLE_PIN,
2771
2926
  WEBMAP_LAYER_CHANGE_OPACITY: WEBMAP_LAYER_CHANGE_OPACITY,
2772
2927
  WEBMAP_LAYER_CHANGE_NAME: WEBMAP_LAYER_CHANGE_NAME,
2773
2928
  WEBMAP_LAYER_CHANGE_STYLE: WEBMAP_LAYER_CHANGE_STYLE,
@@ -2901,6 +3056,130 @@
2901
3056
  orderDialog: orderDialog
2902
3057
  });
2903
3058
 
3059
+ /* *
3060
+ * Licensed under the Apache License, Version 2.0 (the "License");
3061
+ * you may not use this file except in compliance with the License.
3062
+ * You may obtain a copy of the License at
3063
+ *
3064
+ * http://www.apache.org/licenses/LICENSE-2.0
3065
+ *
3066
+ * Unless required by applicable law or agreed to in writing, software
3067
+ * distributed under the License is distributed on an "AS IS" BASIS,
3068
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3069
+ * See the License for the specific language governing permissions and
3070
+ * limitations under the License.
3071
+ *
3072
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3073
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
3074
+ * */
3075
+ /**
3076
+ * Gets the active map Id and wether a dialog is open or closed
3077
+ *
3078
+ * Example: getDialogDetailsByType(store, 'legend')
3079
+ * @param {object} store store object from which the ui state wll be extracted
3080
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3081
+ * @returns {array} [string, boolean] first element gives the active map id, second element whether the dialog is open
3082
+ */
3083
+
3084
+ var getDialogDetailsByType = function getDialogDetailsByType(store, dialogType) {
3085
+ if (store && store.ui && store.ui.dialogs && store.ui.dialogs[dialogType]) {
3086
+ return store.ui.dialogs[dialogType];
3087
+ }
3088
+
3089
+ return null;
3090
+ };
3091
+ /**
3092
+ * For a given ui component: gets wether the dialog is open or closed
3093
+ *
3094
+ * @param {object} store store object from which the ui state wll be extracted
3095
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3096
+ * @returns {boolean} returnType: boolean
3097
+ */
3098
+
3099
+ var getisDialogOpen = reselect.createSelector(getDialogDetailsByType, function (details) {
3100
+ if (details) {
3101
+ return details.isOpen;
3102
+ }
3103
+
3104
+ return false;
3105
+ });
3106
+ /**
3107
+ *For a given ui component: gets the active map Id
3108
+ *
3109
+ * @param {object} store store object from which the ui state wll be extracted
3110
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3111
+ * @returns {string} returnType: string - the active map id
3112
+ */
3113
+
3114
+ var getDialogMapId = reselect.createSelector(getDialogDetailsByType, function (details) {
3115
+ if (details) {
3116
+ return details.activeMapId;
3117
+ }
3118
+
3119
+ return '';
3120
+ });
3121
+ /**
3122
+ *For a given ui component: gets the order of visible dialog
3123
+ *
3124
+ * @param {object} store store object from which the ui state wll be extracted
3125
+ * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
3126
+ * @returns {number} the higher the order number the higher the zIndex
3127
+ */
3128
+
3129
+ var getDialogOrder = reselect.createSelector(function (store, dialogType) {
3130
+ if (store && store.ui && store.ui.order) {
3131
+ var order = store.ui.order;
3132
+ var visibleOrder = order.filter(function (orderedDialogType) {
3133
+ return store.ui.dialogs[orderedDialogType].isOpen;
3134
+ });
3135
+
3136
+ if (!visibleOrder.includes(dialogType)) {
3137
+ return 0;
3138
+ }
3139
+
3140
+ return visibleOrder.length - visibleOrder.indexOf(dialogType);
3141
+ }
3142
+
3143
+ return 0;
3144
+ }, function (order) {
3145
+ return order;
3146
+ });
3147
+ /**
3148
+ *For a given ui component: returns if ordered on top
3149
+ *
3150
+ * @param {object} store store object from which the ui state wll be extracted
3151
+ * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
3152
+ * @returns {boolean}
3153
+ */
3154
+
3155
+ var getDialogIsOrderedOnTop = reselect.createSelector(function (store, dialogType) {
3156
+ if (store && store.ui && store.ui.order) {
3157
+ var order = store.ui.order;
3158
+ return order.includes(dialogType) && order.indexOf(dialogType) === 0;
3159
+ }
3160
+
3161
+ return false;
3162
+ }, function (isOrderedOnTop) {
3163
+ return isOrderedOnTop;
3164
+ });
3165
+ var getDialogSource = reselect.createSelector(getDialogDetailsByType, function (details) {
3166
+ if (details && details.source) {
3167
+ return details.source;
3168
+ }
3169
+
3170
+ return 'app';
3171
+ });
3172
+
3173
+ var selectors = /*#__PURE__*/Object.freeze({
3174
+ __proto__: null,
3175
+ getDialogDetailsByType: getDialogDetailsByType,
3176
+ getisDialogOpen: getisDialogOpen,
3177
+ getDialogMapId: getDialogMapId,
3178
+ getDialogOrder: getDialogOrder,
3179
+ getDialogIsOrderedOnTop: getDialogIsOrderedOnTop,
3180
+ getDialogSource: getDialogSource
3181
+ });
3182
+
2904
3183
  /* *
2905
3184
  * Licensed under the Apache License, Version 2.0 (the "License");
2906
3185
  * you may not use this file except in compliance with the License.
@@ -2957,56 +3236,7 @@
2957
3236
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2958
3237
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2959
3238
  * */
2960
-
2961
- /* Action constants for sources */
2962
- var SYNCGROUPS_ADD_SOURCE = 'SYNCGROUPS_ADD_SOURCE';
2963
- var SYNCGROUPS_REMOVE_SOURCE = 'SYNCGROUPS_REMOVE_SOURCE';
2964
- /* Action constants for groups */
2965
-
2966
- var SYNCGROUPS_TOGGLE_LINK_TARGET = 'SYNCGROUPS_TOGGLE_LINK_TARGET';
2967
- var SYNCGROUPS_ADD_TARGET = 'SYNCGROUPS_ADD_TARGET';
2968
- var SYNCGROUPS_REMOVE_TARGET = 'SYNCGROUPS_REMOVE_TARGET';
2969
- var SYNCGROUPS_ADD_GROUP = 'SYNCGROUPS_ADD_GROUP';
2970
- var SYNCGROUPS_REMOVE_GROUP = 'SYNCGROUPS_REMOVE_GROUP';
2971
- var SYNCGROUPS_CLEAR = 'SYNCGROUPS_CLEAR';
2972
- /* Type constants */
2973
-
2974
- var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
2975
- var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
2976
- var SYNCGROUPS_TYPE_SETLAYERACTIONS = 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
2977
-
2978
- var constants = /*#__PURE__*/Object.freeze({
2979
- __proto__: null,
2980
- SYNCGROUPS_ADD_SOURCE: SYNCGROUPS_ADD_SOURCE,
2981
- SYNCGROUPS_REMOVE_SOURCE: SYNCGROUPS_REMOVE_SOURCE,
2982
- SYNCGROUPS_TOGGLE_LINK_TARGET: SYNCGROUPS_TOGGLE_LINK_TARGET,
2983
- SYNCGROUPS_ADD_TARGET: SYNCGROUPS_ADD_TARGET,
2984
- SYNCGROUPS_REMOVE_TARGET: SYNCGROUPS_REMOVE_TARGET,
2985
- SYNCGROUPS_ADD_GROUP: SYNCGROUPS_ADD_GROUP,
2986
- SYNCGROUPS_REMOVE_GROUP: SYNCGROUPS_REMOVE_GROUP,
2987
- SYNCGROUPS_CLEAR: SYNCGROUPS_CLEAR,
2988
- SYNCGROUPS_TYPE_SETTIME: SYNCGROUPS_TYPE_SETTIME,
2989
- SYNCGROUPS_TYPE_SETBBOX: SYNCGROUPS_TYPE_SETBBOX,
2990
- SYNCGROUPS_TYPE_SETLAYERACTIONS: SYNCGROUPS_TYPE_SETLAYERACTIONS
2991
- });
2992
-
2993
- /* *
2994
- * Licensed under the Apache License, Version 2.0 (the "License");
2995
- * you may not use this file except in compliance with the License.
2996
- * You may obtain a copy of the License at
2997
- *
2998
- * http://www.apache.org/licenses/LICENSE-2.0
2999
- *
3000
- * Unless required by applicable law or agreed to in writing, software
3001
- * distributed under the License is distributed on an "AS IS" BASIS,
3002
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3003
- * See the License for the specific language governing permissions and
3004
- * limitations under the License.
3005
- *
3006
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3007
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
3008
- * */
3009
- /* Actions for sources */
3239
+ /* Actions for sources */
3010
3240
 
3011
3241
  /**
3012
3242
  * Add a source component to the sources list.
@@ -3135,6 +3365,12 @@
3135
3365
  type: SYNCGROUPS_CLEAR
3136
3366
  };
3137
3367
  };
3368
+ var syncGroupSetViewState = function syncGroupSetViewState(payload) {
3369
+ return {
3370
+ type: SYNCGROUPS_SET_VIEW_STATE,
3371
+ payload: payload
3372
+ };
3373
+ };
3138
3374
 
3139
3375
  var actions$1 = /*#__PURE__*/Object.freeze({
3140
3376
  __proto__: null,
@@ -3145,7 +3381,8 @@
3145
3381
  syncGroupLinkTarget: syncGroupLinkTarget,
3146
3382
  syncGroupAddGroup: syncGroupAddGroup,
3147
3383
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3148
- syncGroupClear: syncGroupClear
3384
+ syncGroupClear: syncGroupClear,
3385
+ syncGroupSetViewState: syncGroupSetViewState
3149
3386
  });
3150
3387
 
3151
3388
  /* *
@@ -3215,7 +3452,8 @@
3215
3452
  syncGroupLinkTarget: syncGroupLinkTarget,
3216
3453
  syncGroupAddGroup: syncGroupAddGroup,
3217
3454
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3218
- syncGroupClear: syncGroupClear
3455
+ syncGroupClear: syncGroupClear,
3456
+ syncGroupSetViewState: syncGroupSetViewState
3219
3457
  });
3220
3458
 
3221
3459
  /* *
@@ -3831,6 +4069,20 @@
3831
4069
  groups: {
3832
4070
  byId: {},
3833
4071
  allIds: []
4072
+ },
4073
+ viewState: {
4074
+ timeslider: {
4075
+ groups: [],
4076
+ sourcesById: []
4077
+ },
4078
+ zoompane: {
4079
+ groups: [],
4080
+ sourcesById: []
4081
+ },
4082
+ level: {
4083
+ groups: [],
4084
+ sourcesById: []
4085
+ }
3834
4086
  }
3835
4087
  };
3836
4088
  var reducer$4 = function reducer(state, action) {
@@ -4051,6 +4303,12 @@
4051
4303
  case SYNCGROUPS_CLEAR:
4052
4304
  return initialState$4;
4053
4305
 
4306
+ case SYNCGROUPS_SET_VIEW_STATE:
4307
+ return produce__default["default"](state, function (draft) {
4308
+ var viewState = action.payload.viewState;
4309
+ draft.viewState = viewState;
4310
+ });
4311
+
4054
4312
  default:
4055
4313
  return state;
4056
4314
  }
@@ -4164,6 +4422,9 @@
4164
4422
  }, []);
4165
4423
  return groups;
4166
4424
  };
4425
+ var syncGroupGetViewState = reselect.createSelector(syncGroupStore, function (store) {
4426
+ return store.viewState;
4427
+ });
4167
4428
 
4168
4429
  /* *
4169
4430
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -4928,6 +5189,105 @@
4928
5189
  });
4929
5190
  }
4930
5191
 
5192
+ /* *
5193
+ * Licensed under the Apache License, Version 2.0 (the "License");
5194
+ * you may not use this file except in compliance with the License.
5195
+ * You may obtain a copy of the License at
5196
+ *
5197
+ * http://www.apache.org/licenses/LICENSE-2.0
5198
+ *
5199
+ * Unless required by applicable law or agreed to in writing, software
5200
+ * distributed under the License is distributed on an "AS IS" BASIS,
5201
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5202
+ * See the License for the specific language governing permissions and
5203
+ * limitations under the License.
5204
+ *
5205
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5206
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
5207
+ * */
5208
+ var emptyState = {
5209
+ timeslider: {
5210
+ groups: [],
5211
+ sourcesById: []
5212
+ },
5213
+ zoompane: {
5214
+ groups: [],
5215
+ sourcesById: []
5216
+ },
5217
+ level: {
5218
+ groups: [],
5219
+ sourcesById: []
5220
+ }
5221
+ };
5222
+ var groupTypes = [{
5223
+ title: 'Timeslider',
5224
+ syncType: 'SYNCGROUPS_TYPE_SETTIME',
5225
+ groupType: 'timeslider'
5226
+ }, {
5227
+ title: 'Zoompane',
5228
+ syncType: 'SYNCGROUPS_TYPE_SETBBOX',
5229
+ groupType: 'zoompane'
5230
+ }];
5231
+ /*
5232
+ _____ Creates viewState _____
5233
+ - Runs Each time viewState is created:
5234
+ - Fill arrays inside initialState with objects containing new values from Redux
5235
+ */
5236
+
5237
+ var createSyncGroupViewState = function createSyncGroupViewState(groups, sources) {
5238
+ var initialState = produce__default["default"](emptyState, function (draft) {
5239
+ /*
5240
+ _____ 1. Fill groups _____
5241
+ 1. Goes through all groups by ID
5242
+ 2. Collects original timeslider or zoompane values into an array
5243
+ 3. Sorts and adds selected sources to ViewState based on ID type
5244
+ */
5245
+ Object.keys(groups.byId).forEach(function (id) {
5246
+ var _a;
5247
+
5248
+ var groupType = (_a = groupTypes.find(function (object) {
5249
+ return object.syncType === groups.byId[id].type;
5250
+ })) === null || _a === void 0 ? void 0 : _a.groupType;
5251
+
5252
+ if (groupType) {
5253
+ draft[groupType].groups.push({
5254
+ id: id,
5255
+ selected: groups.byId[id].targets.allIds
5256
+ });
5257
+ }
5258
+ });
5259
+ /*
5260
+ _____ 2. Fill sourcesById _____
5261
+ 1. Loop though sources and add source to each group type
5262
+ */
5263
+
5264
+ Object.keys(sources.byId).forEach(function (id) {
5265
+ groupTypes.forEach(function (_a) {
5266
+ var syncType = _a.syncType,
5267
+ groupType = _a.groupType;
5268
+
5269
+ if (sources.byId[id].types.includes(syncType)) {
5270
+ draft[groupType].sourcesById.push({
5271
+ id: id,
5272
+ name: id
5273
+ });
5274
+ }
5275
+ });
5276
+ });
5277
+ });
5278
+ return initialState;
5279
+ };
5280
+
5281
+ var groups = function groups(store) {
5282
+ return store.syncronizationGroupStore.groups;
5283
+ };
5284
+
5285
+ var sources = function sources(store) {
5286
+ return store.syncronizationGroupStore.sources;
5287
+ };
5288
+
5289
+ var createSyncGroupViewStateSelector = reselect.createSelector(groups, sources, createSyncGroupViewState);
5290
+
4931
5291
  /* *
4932
5292
  * Licensed under the Apache License, Version 2.0 (the "License");
4933
5293
  * you may not use this file except in compliance with the License.
@@ -5077,6 +5437,32 @@
5077
5437
  }
5078
5438
  });
5079
5439
  }
5440
+ function updateViewStateSaga() {
5441
+ var viewState;
5442
+ return __generator(this, function (_a) {
5443
+ switch (_a.label) {
5444
+ case 0:
5445
+ return [4
5446
+ /*yield*/
5447
+ , effects.select(createSyncGroupViewStateSelector)];
5448
+
5449
+ case 1:
5450
+ viewState = _a.sent();
5451
+ return [4
5452
+ /*yield*/
5453
+ , effects.put(syncGroupSetViewState({
5454
+ viewState: viewState
5455
+ }))];
5456
+
5457
+ case 2:
5458
+ _a.sent();
5459
+
5460
+ return [2
5461
+ /*return*/
5462
+ ];
5463
+ }
5464
+ });
5465
+ }
5080
5466
 
5081
5467
  function rootSaga$3() {
5082
5468
  return __generator(this, function (_a) {
@@ -5096,6 +5482,55 @@
5096
5482
  case 2:
5097
5483
  _a.sent();
5098
5484
 
5485
+ return [4
5486
+ /*yield*/
5487
+ , effects.takeLatest(SYNCGROUPS_ADD_GROUP, updateViewStateSaga)];
5488
+
5489
+ case 3:
5490
+ _a.sent();
5491
+
5492
+ return [4
5493
+ /*yield*/
5494
+ , effects.takeLatest(SYNCGROUPS_REMOVE_GROUP, updateViewStateSaga)];
5495
+
5496
+ case 4:
5497
+ _a.sent();
5498
+
5499
+ return [4
5500
+ /*yield*/
5501
+ , effects.takeLatest(SYNCGROUPS_ADD_SOURCE, updateViewStateSaga)];
5502
+
5503
+ case 5:
5504
+ _a.sent();
5505
+
5506
+ return [4
5507
+ /*yield*/
5508
+ , effects.takeLatest(SYNCGROUPS_REMOVE_SOURCE, updateViewStateSaga)];
5509
+
5510
+ case 6:
5511
+ _a.sent();
5512
+
5513
+ return [4
5514
+ /*yield*/
5515
+ , effects.takeLatest(SYNCGROUPS_ADD_TARGET, updateViewStateSaga)];
5516
+
5517
+ case 7:
5518
+ _a.sent();
5519
+
5520
+ return [4
5521
+ /*yield*/
5522
+ , effects.takeLatest(SYNCGROUPS_REMOVE_TARGET, updateViewStateSaga)];
5523
+
5524
+ case 8:
5525
+ _a.sent();
5526
+
5527
+ return [4
5528
+ /*yield*/
5529
+ , effects.takeLatest(SYNCGROUPS_TOGGLE_LINK_TARGET, updateViewStateSaga)];
5530
+
5531
+ case 9:
5532
+ _a.sent();
5533
+
5099
5534
  return [2
5100
5535
  /*return*/
5101
5536
  ];
@@ -5143,40 +5578,6 @@
5143
5578
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5144
5579
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
5145
5580
  * */
5146
- var useStyles$I = makeStyles__default["default"](function (theme) {
5147
- return {
5148
- select: {
5149
- '& ul': {
5150
- backgroundColor: theme.palette.geowebColors.background.surface
5151
- },
5152
- '& li': {
5153
- fontSize: 16,
5154
- padding: 12,
5155
- '&:hover': {
5156
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
5157
- },
5158
- '&.Mui-selected': {
5159
- color: theme.palette.common.white,
5160
- backgroundColor: theme.palette.geowebColors.buttons.primary.active.fill,
5161
- boxShadow: "none",
5162
- '&:hover': {
5163
- color: theme.palette.common.white,
5164
- backgroundColor: theme.palette.geowebColors.buttons.primary.mouseOver.fill
5165
- }
5166
- },
5167
- '&:after': {
5168
- background: 'none!important'
5169
- },
5170
- // (optional) header
5171
- '&.Mui-disabled': {
5172
- fontSize: 12,
5173
- opacity: 0.67,
5174
- padding: '0 12px'
5175
- }
5176
- }
5177
- }
5178
- };
5179
- });
5180
5581
 
5181
5582
  var TooltipSelect = function TooltipSelect(_a) {
5182
5583
  var tooltip = _a.tooltip,
@@ -5186,20 +5587,20 @@
5186
5587
  currentIndex = _c === void 0 ? -1 : _c,
5187
5588
  _d = _a.onChangeMouseWheel,
5188
5589
  onChangeMouseWheel = _d === void 0 ? function () {} : _d,
5189
- props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel"]);
5590
+ _e = _a.requiresCtrlToChange,
5591
+ requiresCtrlToChange = _e === void 0 ? false : _e,
5592
+ props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange"]);
5190
5593
 
5191
5594
  props.disableUnderline;
5192
5595
  var otherProps = __rest(props, ["disableUnderline"]);
5193
5596
 
5194
- var _e = __read(React__namespace.useState(false), 2),
5195
- selectOpen = _e[0],
5196
- setSelectOpen = _e[1];
5197
-
5198
5597
  var _f = __read(React__namespace.useState(false), 2),
5199
- tooltipOpen = _f[0],
5200
- setTooltipOpen = _f[1];
5598
+ selectOpen = _f[0],
5599
+ setSelectOpen = _f[1];
5201
5600
 
5202
- var classes = useStyles$I();
5601
+ var _g = __read(React__namespace.useState(false), 2),
5602
+ tooltipOpen = _g[0],
5603
+ setTooltipOpen = _g[1];
5203
5604
 
5204
5605
  var preventDefault = function preventDefault(event) {
5205
5606
  event.preventDefault();
@@ -5215,11 +5616,14 @@
5215
5616
  });
5216
5617
  }, []);
5217
5618
  var onWheel = React__namespace.useCallback(function (event) {
5218
- if (selectOpen) return;
5219
- var direction = event.deltaY < 0 ? 1 : -1;
5220
- var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
5221
- onChangeMouseWheel(newValue);
5222
- }, [selectOpen, currentIndex, list, onChangeMouseWheel]);
5619
+ if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
5620
+ disableScroll();
5621
+ if (selectOpen) return;
5622
+ var direction = event.deltaY < 0 ? 1 : -1;
5623
+ var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
5624
+ onChangeMouseWheel(newValue);
5625
+ } else enableScroll();
5626
+ }, [selectOpen, currentIndex, list, onChangeMouseWheel, enableScroll, disableScroll, requiresCtrlToChange]);
5223
5627
  var onOpen = React__namespace.useCallback(function () {
5224
5628
  setSelectOpen(true);
5225
5629
  setTooltipOpen(false);
@@ -5228,17 +5632,23 @@
5228
5632
  setSelectOpen(false);
5229
5633
  }, []);
5230
5634
  var onMouseEnter = React__namespace.useCallback(function () {
5231
- disableScroll();
5635
+ if (!requiresCtrlToChange) {
5636
+ disableScroll();
5637
+ }
5638
+
5232
5639
  if (!selectOpen) setTooltipOpen(true);
5233
- }, [selectOpen, disableScroll]);
5640
+ }, [selectOpen, disableScroll, requiresCtrlToChange]);
5234
5641
  var onMouseLeave = React__namespace.useCallback(function () {
5235
5642
  enableScroll();
5236
5643
  setTooltipOpen(false);
5237
5644
  }, [enableScroll]);
5238
5645
  var onFocus = React__namespace.useCallback(function () {
5239
- disableScroll();
5646
+ if (!requiresCtrlToChange) {
5647
+ disableScroll();
5648
+ }
5649
+
5240
5650
  setTooltipOpen(true);
5241
- }, [disableScroll]);
5651
+ }, [disableScroll, requiresCtrlToChange]);
5242
5652
  var onBlur = React__namespace.useCallback(function () {
5243
5653
  enableScroll();
5244
5654
  setTooltipOpen(false);
@@ -5256,8 +5666,46 @@
5256
5666
  onBlur: onBlur,
5257
5667
  onWheel: onWheel,
5258
5668
  MenuProps: {
5259
- classes: {
5260
- paper: classes.select
5669
+ BackdropProps: {
5670
+ sx: {
5671
+ '&.MuiBackdrop-root': {
5672
+ backgroundColor: 'transparent'
5673
+ }
5674
+ }
5675
+ },
5676
+ sx: {
5677
+ '& ul': {
5678
+ backgroundColor: 'geowebColors.background.surface'
5679
+ },
5680
+ '& li': {
5681
+ fontSize: '16px',
5682
+ padding: '12px',
5683
+ '&:hover': {
5684
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
5685
+ },
5686
+ '&.Mui-selected': {
5687
+ color: 'geowebColors.buttons.tool.active.color',
5688
+ backgroundColor: 'geowebColors.buttons.tool.active.fill',
5689
+ boxShadow: "none",
5690
+ '&:hover': {
5691
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5692
+ },
5693
+ '&:focus': {
5694
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5695
+ }
5696
+ },
5697
+ '&:after': {
5698
+ background: 'none!important'
5699
+ },
5700
+ '&.Mui-disabled': {
5701
+ fontSize: '12px',
5702
+ opacity: 0.67,
5703
+ padding: '0px 12px',
5704
+ '&.MuiMenuItem-root': {
5705
+ minHeight: '30px!important'
5706
+ }
5707
+ }
5708
+ }
5261
5709
  }
5262
5710
  }
5263
5711
  }, otherProps)));
@@ -5306,7 +5754,7 @@
5306
5754
  var index = /*#__PURE__*/Object.freeze({
5307
5755
  __proto__: null,
5308
5756
  actions: actions$1,
5309
- constants: constants,
5757
+ constants: constants$1,
5310
5758
  types: types,
5311
5759
  initialState: initialState$4
5312
5760
  });
@@ -5431,138 +5879,24 @@
5431
5879
  return produce.produce(state, function (draft) {
5432
5880
  draft.dialogs[type_4].isOpen = setOpen_2;
5433
5881
 
5434
- if (setOpen_2) {
5435
- draft.order = moveToTop(state.order, type_4);
5436
- }
5437
- });
5438
- }
5439
-
5440
- case UI_ORDER_DIALOG:
5441
- {
5442
- var type_5 = action.payload.type;
5443
- return produce.produce(state, function (draft) {
5444
- draft.order = moveToTop(state.order, type_5);
5445
- });
5446
- }
5447
-
5448
- default:
5449
- return state;
5450
- }
5451
- };
5452
-
5453
- /* *
5454
- * Licensed under the Apache License, Version 2.0 (the "License");
5455
- * you may not use this file except in compliance with the License.
5456
- * You may obtain a copy of the License at
5457
- *
5458
- * http://www.apache.org/licenses/LICENSE-2.0
5459
- *
5460
- * Unless required by applicable law or agreed to in writing, software
5461
- * distributed under the License is distributed on an "AS IS" BASIS,
5462
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5463
- * See the License for the specific language governing permissions and
5464
- * limitations under the License.
5465
- *
5466
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5467
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
5468
- * */
5469
- /**
5470
- * Gets the active map Id and wether a dialog is open or closed
5471
- *
5472
- * Example: getDialogDetailsByType(store, 'legend')
5473
- * @param {object} store store object from which the ui state wll be extracted
5474
- * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
5475
- * @returns {array} [string, boolean] first element gives the active map id, second element whether the dialog is open
5476
- */
5477
-
5478
- var getDialogDetailsByType = function getDialogDetailsByType(store, dialogType) {
5479
- if (store && store.ui && store.ui.dialogs && store.ui.dialogs[dialogType]) {
5480
- return store.ui.dialogs[dialogType];
5481
- }
5482
-
5483
- return null;
5484
- };
5485
- /**
5486
- * For a given ui component: gets wether the dialog is open or closed
5487
- *
5488
- * @param {object} store store object from which the ui state wll be extracted
5489
- * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
5490
- * @returns {boolean} returnType: boolean
5491
- */
5492
-
5493
- var getisDialogOpen = reselect.createSelector(getDialogDetailsByType, function (details) {
5494
- if (details) {
5495
- return details.isOpen;
5496
- }
5497
-
5498
- return false;
5499
- });
5500
- /**
5501
- *For a given ui component: gets the active map Id
5502
- *
5503
- * @param {object} store store object from which the ui state wll be extracted
5504
- * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
5505
- * @returns {string} returnType: string - the active map id
5506
- */
5507
-
5508
- var getDialogMapId = reselect.createSelector(getDialogDetailsByType, function (details) {
5509
- if (details) {
5510
- return details.activeMapId;
5511
- }
5512
-
5513
- return '';
5514
- });
5515
- /**
5516
- *For a given ui component: gets the order of visible dialog
5517
- *
5518
- * @param {object} store store object from which the ui state wll be extracted
5519
- * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
5520
- * @returns {number} the higher the order number the higher the zIndex
5521
- */
5522
-
5523
- var getDialogOrder = reselect.createSelector(function (store, dialogType) {
5524
- if (store && store.ui && store.ui.order) {
5525
- var order = store.ui.order;
5526
- var visibleOrder = order.filter(function (orderedDialogType) {
5527
- return store.ui.dialogs[orderedDialogType].isOpen;
5528
- });
5529
-
5530
- if (!visibleOrder.includes(dialogType)) {
5531
- return 0;
5532
- }
5533
-
5534
- return visibleOrder.length - visibleOrder.indexOf(dialogType);
5535
- }
5536
-
5537
- return 0;
5538
- }, function (order) {
5539
- return order;
5540
- });
5541
- /**
5542
- *For a given ui component: returns if ordered on top
5543
- *
5544
- * @param {object} store store object from which the ui state wll be extracted
5545
- * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
5546
- * @returns {boolean}
5547
- */
5882
+ if (setOpen_2) {
5883
+ draft.order = moveToTop(state.order, type_4);
5884
+ }
5885
+ });
5886
+ }
5548
5887
 
5549
- var getDialogIsOrderedOnTop = reselect.createSelector(function (store, dialogType) {
5550
- if (store && store.ui && store.ui.order) {
5551
- var order = store.ui.order;
5552
- return order.includes(dialogType) && order.indexOf(dialogType) === 0;
5553
- }
5888
+ case UI_ORDER_DIALOG:
5889
+ {
5890
+ var type_5 = action.payload.type;
5891
+ return produce.produce(state, function (draft) {
5892
+ draft.order = moveToTop(state.order, type_5);
5893
+ });
5894
+ }
5554
5895
 
5555
- return false;
5556
- }, function (isOrderedOnTop) {
5557
- return isOrderedOnTop;
5558
- });
5559
- var getDialogSource = reselect.createSelector(getDialogDetailsByType, function (details) {
5560
- if (details && details.source) {
5561
- return details.source;
5896
+ default:
5897
+ return state;
5562
5898
  }
5563
-
5564
- return 'app';
5565
- });
5899
+ };
5566
5900
 
5567
5901
  /* *
5568
5902
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -6373,6 +6707,21 @@
6373
6707
  });
6374
6708
  }
6375
6709
 
6710
+ case WEBMAP_DISABLE_PIN:
6711
+ {
6712
+ var _1 = action.payload,
6713
+ mapId_29 = _1.mapId,
6714
+ disableMapPin_1 = _1.disableMapPin;
6715
+
6716
+ if (!state.byId[mapId_29]) {
6717
+ return state;
6718
+ }
6719
+
6720
+ return produce.produce(state, function (draft) {
6721
+ draft.byId[mapId_29].disableMapPin = disableMapPin_1;
6722
+ });
6723
+ }
6724
+
6376
6725
  case GENERIC_SYNC_SETLAYERACTIONS:
6377
6726
  {
6378
6727
  /*
@@ -6381,9 +6730,9 @@
6381
6730
  * These targets can be used as payloads in new Layer actions.
6382
6731
  * These actions are here handled via the layer reducer, as it is the same logic
6383
6732
  */
6384
- var _1 = action.payload,
6385
- targets = _1.targets,
6386
- source_1 = _1.source;
6733
+ var _2 = action.payload,
6734
+ targets = _2.targets,
6735
+ source_1 = _2.source;
6387
6736
  return targets.reduce(function (prevState, target) {
6388
6737
  var action = {
6389
6738
  payload: target,
@@ -8071,7 +8420,7 @@
8071
8420
  },
8072
8421
  {
8073
8422
  name: "ECMWF",
8074
- url: "https://apps.ecmwf.int/wms/?token=public",
8423
+ url: "https://eccharts.ecmwf.int/wms/?token=public",
8075
8424
  id: "ecmwf"
8076
8425
  },
8077
8426
  {
@@ -8190,7 +8539,7 @@
8190
8539
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8191
8540
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8192
8541
  * */
8193
- var useStyles$H = makeStyles__default["default"]({
8542
+ var useStyles$w = makeStyles__default["default"]({
8194
8543
  buttonDiv: {
8195
8544
  position: 'relative'
8196
8545
  },
@@ -8226,7 +8575,7 @@
8226
8575
  handleClose = _a.handleClose,
8227
8576
  _e = _a.layerType,
8228
8577
  layerType = _e === void 0 ? LayerType.mapLayer : _e;
8229
- var classes = useStyles$H();
8578
+ var classes = useStyles$w();
8230
8579
 
8231
8580
  var _f = __read(React__namespace.useState(''), 2),
8232
8581
  serviceURL = _f[0],
@@ -8341,7 +8690,6 @@
8341
8690
  }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
8342
8691
  "data-testid": "add-service",
8343
8692
  onClick: handleAddServiceURL,
8344
- color: "primary",
8345
8693
  disabled: loading,
8346
8694
  size: "large"
8347
8695
  }, /*#__PURE__*/React__namespace.createElement(iconsMaterial.Add, null)), loading && /*#__PURE__*/React__namespace.createElement(material.CircularProgress, {
@@ -8391,26 +8739,23 @@
8391
8739
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8392
8740
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8393
8741
  * */
8394
- var useStyles$G = makeStyles__default["default"](function (theme) {
8395
- return {
8396
- buttonDiv: {
8397
- position: 'relative'
8398
- },
8399
- loadingButton: {
8400
- position: 'absolute',
8401
- top: 7,
8402
- left: 7,
8403
- zIndex: 1
8404
- },
8405
- button: {
8406
- width: '24px',
8407
- height: '24px',
8408
- margin: '6px 0px 0px 10px',
8409
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
8410
- borderRadius: '15%'
8411
- }
8412
- };
8413
- });
8742
+ var styles$1 = {
8743
+ buttonDiv: {
8744
+ position: 'relative'
8745
+ },
8746
+ loadingButton: {
8747
+ position: 'absolute',
8748
+ top: 7,
8749
+ left: 7,
8750
+ zIndex: 1
8751
+ },
8752
+ button: {
8753
+ width: '24px',
8754
+ height: '24px',
8755
+ margin: '6px 0px 0px 10px',
8756
+ borderRadius: '15%'
8757
+ }
8758
+ };
8414
8759
 
8415
8760
  var AddLayersButton = function AddLayersButton(_a) {
8416
8761
  var onClickService = _a.onClickService,
@@ -8426,7 +8771,6 @@
8426
8771
  _f = _a.shouldFocus,
8427
8772
  shouldFocus = _f === void 0 ? false : _f;
8428
8773
  var ref = React__namespace.useRef(null);
8429
- var classes = useStyles$G();
8430
8774
 
8431
8775
  var _g = __read(React__namespace.useState(false), 2),
8432
8776
  open = _g[0],
@@ -8446,7 +8790,7 @@
8446
8790
  title: tooltip
8447
8791
  }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
8448
8792
  onClick: handleClose,
8449
- className: classes.button,
8793
+ sx: styles$1.button,
8450
8794
  disableRipple: true,
8451
8795
  "data-testid": "addLayersButton",
8452
8796
  ref: ref,
@@ -8500,6 +8844,9 @@
8500
8844
  column6: {
8501
8845
  width: iconButtonSize * 2,
8502
8846
  display: 'inline-flex'
8847
+ },
8848
+ columns35: {
8849
+ width: "calc((100% - " + iconButtonSize * totalButtons + "px) * 0.75)"
8503
8850
  }
8504
8851
  });
8505
8852
  var LayerManagerColumnsSmall = makeStyles__default["default"]({
@@ -8521,6 +8868,9 @@
8521
8868
  column6: {
8522
8869
  width: iconButtonSize * 2,
8523
8870
  display: 'inline-flex'
8871
+ },
8872
+ columns35: {
8873
+ display: 'none'
8524
8874
  }
8525
8875
  });
8526
8876
  var LayerManagerWidth;
@@ -8551,24 +8901,18 @@
8551
8901
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8552
8902
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8553
8903
  * */
8554
- var useStyles$F = makeStyles__default["default"](function (theme) {
8555
- return {
8556
- button: {
8557
- width: '24px',
8558
- height: '24px',
8559
- margin: '6px 0px 0px 10px',
8560
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
8561
- borderRadius: '15%'
8562
- }
8563
- };
8564
- });
8904
+ var style$2 = {
8905
+ width: '24px',
8906
+ height: '24px',
8907
+ margin: '6px 0px 0px 10px',
8908
+ borderRadius: '15%'
8909
+ };
8565
8910
 
8566
8911
  var LayerSelectButtonConnect = function LayerSelectButtonConnect(_a) {
8567
8912
  var mapId = _a.mapId,
8568
8913
  _b = _a.source,
8569
8914
  source = _b === void 0 ? 'app' : _b;
8570
8915
  var dispatch = reactRedux.useDispatch();
8571
- var classes = useStyles$F();
8572
8916
  var currentActiveMapId = reactRedux.useSelector(function (store) {
8573
8917
  return getDialogMapId(store, 'layerSelect');
8574
8918
  });
@@ -8587,7 +8931,7 @@
8587
8931
  title: "Layer Select"
8588
8932
  }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
8589
8933
  onClick: openLayerSelectDialog,
8590
- className: classes.button,
8934
+ sx: style$2,
8591
8935
  id: "layerSelectButton",
8592
8936
  "data-testid": "layerSelectButton",
8593
8937
  disableRipple: true,
@@ -8611,7 +8955,7 @@
8611
8955
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8612
8956
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8613
8957
  * */
8614
- var useStyles$E = makeStyles__default["default"]({
8958
+ var useStyles$v = makeStyles__default["default"]({
8615
8959
  row: {
8616
8960
  height: '32px'
8617
8961
  },
@@ -8635,7 +8979,7 @@
8635
8979
  layerManagerWidth = _a.layerManagerWidth,
8636
8980
  _e = _a.layerSelect,
8637
8981
  layerSelect = _e === void 0 ? false : _e;
8638
- var classes = useStyles$E();
8982
+ var classes = useStyles$v();
8639
8983
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
8640
8984
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
8641
8985
  container: true,
@@ -8712,23 +9056,23 @@
8712
9056
  borderColor: 'transparent!important'
8713
9057
  },
8714
9058
  '&:hover .MuiSelect-select': {
8715
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9059
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8716
9060
  },
8717
9061
  '&.Mui-focused .MuiSelect-select': {
8718
9062
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8719
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9063
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8720
9064
  },
8721
9065
  '&:hover&.MuiButton-root': {
8722
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9066
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8723
9067
  },
8724
9068
  '&:focus&.MuiButton-root': {
8725
9069
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8726
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9070
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8727
9071
  },
8728
9072
  '& .MuiSvgIcon-root': {
8729
9073
  transition: 'none',
8730
9074
  fill: function fill(isEnabled) {
8731
- return isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultIcon.rgba : theme.palette.geowebColors.layerManager.tableRowDisabledIcon.rgba;
9075
+ return isEnabled ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color;
8732
9076
  }
8733
9077
  },
8734
9078
  '&>div': {
@@ -8859,7 +9203,7 @@
8859
9203
  }
8860
9204
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8861
9205
  disabled: true
8862
- }, "Select dimension"), layerDimensions.map(function (dimension) {
9206
+ }, "Dimension"), layerDimensions.map(function (dimension) {
8863
9207
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8864
9208
  key: dimension.name,
8865
9209
  value: dimension.name
@@ -8885,7 +9229,7 @@
8885
9229
  }
8886
9230
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8887
9231
  disabled: true
8888
- }, "Select dimension value. (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
9232
+ }, "Dimension value (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
8889
9233
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8890
9234
  key: dimValue,
8891
9235
  value: dimValue
@@ -8909,188 +9253,7 @@
8909
9253
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8910
9254
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8911
9255
  * */
8912
- var useStyles$D = makeStyles__default["default"](function (theme) {
8913
- return createStyles__default["default"]({
8914
- button: {
8915
- height: 28,
8916
- width: 28,
8917
- borderRadius: 5,
8918
- marginTop: 2,
8919
- color: function color(_a) {
8920
- var isActive = _a.isActive,
8921
- isEnabled = _a.isEnabled;
8922
- var _b = theme.palette.geowebColors.layerManager,
8923
- tableRowDefaultIcon = _b.tableRowDefaultIcon,
8924
- tableRowDisabledIcon = _b.tableRowDisabledIcon;
8925
-
8926
- if (!isEnabled) {
8927
- return tableRowDisabledIcon.fill;
8928
- }
8929
-
8930
- if (isActive) {
8931
- return theme.palette.common.white;
8932
- }
8933
-
8934
- return tableRowDefaultIcon.rgba;
8935
- },
8936
- backgroundColor: function backgroundColor(_a) {
8937
- var isActive = _a.isActive;
8938
- return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
8939
- },
8940
- '&:focus': {
8941
- backgroundColor: function backgroundColor(_a) {
8942
- var isActive = _a.isActive;
8943
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.layerManager.tableRowMouseover.rgba;
8944
- },
8945
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8946
- borderRadius: 0
8947
- },
8948
- '&:hover': {
8949
- backgroundColor: function backgroundColor(_a) {
8950
- var isActive = _a.isActive;
8951
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.layerManager.tableRowMouseover.rgba;
8952
- }
8953
- }
8954
- },
8955
- popper: {
8956
- pointerEvents: 'none'
8957
- }
8958
- });
8959
- });
8960
-
8961
- var LayerManagerButton = function LayerManagerButton(_a) {
8962
- var _b = _a.tooltipTitle,
8963
- tooltipTitle = _b === void 0 ? '' : _b,
8964
- _c = _a.onClick,
8965
- onClick = _c === void 0 ? function () {} : _c,
8966
- _d = _a.isActive,
8967
- isActive = _d === void 0 ? false : _d,
8968
- _e = _a.isEnabled,
8969
- isEnabled = _e === void 0 ? true : _e,
8970
- icon = _a.icon,
8971
- testId = _a.testId,
8972
- props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
8973
-
8974
- var classes = useStyles$D({
8975
- isActive: isActive,
8976
- isEnabled: isEnabled
8977
- });
8978
-
8979
- var handleClick = function handleClick(event) {
8980
- onClick(event);
8981
- };
8982
-
8983
- return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
8984
- title: tooltipTitle,
8985
- placement: "top",
8986
- classes: {
8987
- popper: classes.popper
8988
- }
8989
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
8990
- size: "small",
8991
- onClick: handleClick,
8992
- "data-testid": testId,
8993
- className: classes.button,
8994
- disableFocusRipple: true
8995
- }, props), icon));
8996
- };
8997
-
8998
- /* *
8999
- * Licensed under the Apache License, Version 2.0 (the "License");
9000
- * you may not use this file except in compliance with the License.
9001
- * You may obtain a copy of the License at
9002
- *
9003
- * http://www.apache.org/licenses/LICENSE-2.0
9004
- *
9005
- * Unless required by applicable law or agreed to in writing, software
9006
- * distributed under the License is distributed on an "AS IS" BASIS,
9007
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9008
- * See the License for the specific language governing permissions and
9009
- * limitations under the License.
9010
- *
9011
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9012
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9013
- * */
9014
- var useStyles$C = makeStyles__default["default"](function (theme) {
9015
- return createStyles__default["default"]({
9016
- checkbox: {
9017
- color: 'inherit',
9018
- padding: 4,
9019
- borderRadius: 5,
9020
- '&.Mui-focusVisible': {
9021
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9022
- },
9023
- '&:hover': {
9024
- backgroundColor: 'transparent!important'
9025
- },
9026
- '&.Mui-checked': {
9027
- color: 'inherit'
9028
- }
9029
- }
9030
- });
9031
- });
9032
-
9033
- var EnableLayer = function EnableLayer(_a) {
9034
- var isEnabled = _a.isEnabled,
9035
- title = _a.title,
9036
- onChangeEnableLayer = _a.onChangeEnableLayer;
9037
- var classes = useStyles$C(isEnabled);
9038
-
9039
- var onClick = function onClick() {
9040
- onChangeEnableLayer(!isEnabled);
9041
- };
9042
-
9043
- var visibilityIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
9044
- width: 24,
9045
- height: 24,
9046
- fill: "transparent"
9047
- }), /*#__PURE__*/React__namespace.createElement("path", {
9048
- d: "M14.4980749,15.8618431 C15.8661433,15.0851043 16.779689,13.6936347 16.779689,12.1014551 C16.779689,10.5092755 15.8661433,9.11870594 14.4980749,8.34106705 C17.6257313,9.18620931 19.3529176,11.4300215 19.8092405,12.1014551 C19.3529176,12.7719886 17.6266313,15.0167008 14.4980749,15.8618431 L14.4980749,15.8618431 Z M4.18985949,12.1014551 C4.64618231,11.4300215 6.37336867,9.18710936 9.49922496,8.3419671 C8.13295665,9.11870594 7.21851093,10.5101755 7.21851093,12.1014551 C7.21851093,13.6936347 8.13295665,15.0842042 9.49922496,15.8618431 C6.37336867,15.0167008 4.64618231,12.7728886 4.18985949,12.1014551 L4.18985949,12.1014551 Z M11.99955,13.8583429 C10.9950998,13.8583429 10.180559,13.0717036 10.180559,12.1014551 C10.180559,11.1312066 10.9950998,10.3445672 11.99955,10.3445672 C13.0031002,10.3445672 13.8176409,11.1312066 13.8176409,12.1014551 C13.8176409,13.0717036 13.0031002,13.8583429 11.99955,13.8583429 L11.99955,13.8583429 Z M20.7983899,11.7666383 C20.6813841,11.5713286 17.8696435,7 11.99955,7 C6.12945647,7 3.31681584,11.5713286 3.19980999,11.7666383 L3,12.1014551 L3.19980999,12.4362718 C3.31681584,12.6306815 6.12945647,17.2020101 11.99955,17.2020101 C17.8696435,17.2020101 20.6813841,12.6306815 20.7983899,12.4362718 L21,12.1014551 L20.7983899,11.7666383 Z"
9049
- }));
9050
- var visibilityOffIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
9051
- style: {
9052
- marginTop: 2
9053
- }
9054
- }, /*#__PURE__*/React__namespace.createElement("rect", {
9055
- width: 24,
9056
- height: 24,
9057
- fill: "transparent"
9058
- }), /*#__PURE__*/React__namespace.createElement("path", {
9059
- d: "M12 15.309c-.755 0-1.45-.088-2.092-.236l.798-.797c.41.124.844.192 1.294.192 2.453 0 4.442-1.988 4.442-4.44 0-.495-.085-.907-.234-1.255l.03-.03c1.72.906 2.781 2.167 3.218 2.766-.724.992-3.151 3.8-7.456 3.8zm-7.456-3.8c.442-.607 1.522-1.89 3.276-2.796-.166.36-.261.79-.261 1.315 0 1.228.499 2.34 1.305 3.144l-1.102 1.104c-1.72-.906-2.78-2.169-3.218-2.767zm5.646-3.524c.818 0 1.482.665 1.482 1.483 0 .818-.664 1.481-1.482 1.481s-1.482-.663-1.482-1.481c0-.818.664-1.483 1.482-1.483zm10.608 3.19c-.073-.125-1.245-2.026-3.603-3.388l2.009-2.01c.406-.406.406-1.065 0-1.473-.407-.405-1.066-.405-1.473 0l-2.58 2.582c-.93-.295-1.98-.478-3.151-.478-5.87 0-8.681 4.57-8.798 4.766L3 11.51l.202.335c.073.124 1.244 2.025 3.603 3.387l-2.009 2.01c-.406.406-.406 1.065 0 1.472.204.203.47.305.737.305.266 0 .532-.102.736-.305l2.58-2.58c.93.293 1.98.476 3.151.476 5.87 0 8.681-4.57 8.798-4.765l.202-.335-.202-.335z"
9060
- }));
9061
- return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9062
- tooltipTitle: title,
9063
- onClick: onClick,
9064
- icon: /*#__PURE__*/React__namespace.createElement(material.Checkbox, {
9065
- className: classes.checkbox,
9066
- icon: visibilityOffIcon,
9067
- checkedIcon: visibilityIcon,
9068
- checked: isEnabled,
9069
- disableFocusRipple: true,
9070
- tabIndex: -1
9071
- }),
9072
- testId: "enableLayer",
9073
- isEnabled: isEnabled
9074
- });
9075
- };
9076
-
9077
- /* *
9078
- * Licensed under the Apache License, Version 2.0 (the "License");
9079
- * you may not use this file except in compliance with the License.
9080
- * You may obtain a copy of the License at
9081
- *
9082
- * http://www.apache.org/licenses/LICENSE-2.0
9083
- *
9084
- * Unless required by applicable law or agreed to in writing, software
9085
- * distributed under the License is distributed on an "AS IS" BASIS,
9086
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9087
- * See the License for the specific language governing permissions and
9088
- * limitations under the License.
9089
- *
9090
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9091
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9092
- * */
9093
- var useStyles$B = makeStyles__default["default"](function (theme) {
9256
+ var useStyles$u = makeStyles__default["default"](function (theme) {
9094
9257
  return createStyles__default["default"]({
9095
9258
  dropdownEmpty: {
9096
9259
  paddingLeft: 8,
@@ -9106,6 +9269,33 @@
9106
9269
  });
9107
9270
  });
9108
9271
 
9272
+ var getRenderLayersValues = function getRenderLayersValues(layerName, layers) {
9273
+ var serviceLayer = layers.find(function (l) {
9274
+ return l.name === layerName;
9275
+ });
9276
+
9277
+ if (!serviceLayer && layerName) {
9278
+ return {
9279
+ currentValue: layerName,
9280
+ currentIndex: layers.length,
9281
+ extendedLayers: __spreadArray(__spreadArray([], __read(layers)), [{
9282
+ name: layerName,
9283
+ text: layerName,
9284
+ leaf: true,
9285
+ path: []
9286
+ }])
9287
+ };
9288
+ }
9289
+
9290
+ return {
9291
+ currentValue: (serviceLayer === null || serviceLayer === void 0 ? void 0 : serviceLayer.name) || '',
9292
+ currentIndex: layers.findIndex(function (l) {
9293
+ return l.name === (serviceLayer === null || serviceLayer === void 0 ? void 0 : serviceLayer.name);
9294
+ }),
9295
+ extendedLayers: layers
9296
+ };
9297
+ };
9298
+
9109
9299
  var RenderLayers = function RenderLayers(_a) {
9110
9300
  var onChangeLayerName = _a.onChangeLayerName,
9111
9301
  layerName = _a.layerName,
@@ -9113,7 +9303,7 @@
9113
9303
  layers = _b === void 0 ? [] : _b,
9114
9304
  _c = _a.isEnabled,
9115
9305
  isEnabled = _c === void 0 ? true : _c;
9116
- var classes = useStyles$B();
9306
+ var classes = useStyles$u();
9117
9307
  var containerClass = useTooltipContainerStyles(isEnabled);
9118
9308
 
9119
9309
  if (!layers || !layers.length) {
@@ -9125,24 +9315,21 @@
9125
9315
  }, "No service available"));
9126
9316
  }
9127
9317
 
9128
- var filteredLayers = layers.filter(function (l) {
9129
- return l.name === layerName;
9130
- });
9131
- var currentValue = filteredLayers.length === 1 && filteredLayers[0].name ? filteredLayers[0].name : '';
9132
-
9133
9318
  var selectLayer = function selectLayer(event) {
9134
9319
  event.stopPropagation();
9135
9320
  onChangeLayerName(event.target.value);
9136
9321
  };
9137
9322
 
9138
- var list = layers.map(function (layer) {
9323
+ var _d = getRenderLayersValues(layerName, layers),
9324
+ currentIndex = _d.currentIndex,
9325
+ currentValue = _d.currentValue,
9326
+ extendedLayers = _d.extendedLayers;
9327
+
9328
+ var list = extendedLayers.map(function (layer) {
9139
9329
  return {
9140
9330
  value: layer.name
9141
9331
  };
9142
9332
  });
9143
- var currentIndex = layers.findIndex(function (layer) {
9144
- return currentValue === layer.name;
9145
- });
9146
9333
  return /*#__PURE__*/React__namespace.createElement(TooltipSelect, {
9147
9334
  disableUnderline: true,
9148
9335
  tooltip: "Select a layer",
@@ -9158,10 +9345,11 @@
9158
9345
  onChange: selectLayer,
9159
9346
  onChangeMouseWheel: function onChangeMouseWheel(e) {
9160
9347
  return onChangeLayerName(e.value);
9161
- }
9348
+ },
9349
+ requiresCtrlToChange: true
9162
9350
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9163
9351
  disabled: true
9164
- }, "Select layer"), layers.map(function (layerFromServiceLayers) {
9352
+ }, "Layer"), extendedLayers.map(function (layerFromServiceLayers) {
9165
9353
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9166
9354
  key: layerFromServiceLayers.name,
9167
9355
  value: layerFromServiceLayers.name,
@@ -9186,7 +9374,7 @@
9186
9374
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9187
9375
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9188
9376
  * */
9189
- var useStyles$A = makeStyles__default["default"](function (theme) {
9377
+ var useStyles$t = makeStyles__default["default"](function (theme) {
9190
9378
  return {
9191
9379
  opacityDiv: {
9192
9380
  height: 'calc(100% - 5px)',
@@ -9209,7 +9397,7 @@
9209
9397
  position: 'fixed',
9210
9398
  top: '-5px',
9211
9399
  boxSizing: 'initial',
9212
- zIndex: 1,
9400
+ zIndex: 2,
9213
9401
  boxShadow: theme.shadows[8]
9214
9402
  }
9215
9403
  };
@@ -9247,7 +9435,7 @@
9247
9435
  onLayerChangeOpacity = _a.onLayerChangeOpacity,
9248
9436
  _b = _a.isEnabled,
9249
9437
  isEnabled = _b === void 0 ? true : _b;
9250
- var classes = useStyles$A();
9438
+ var classes = useStyles$t();
9251
9439
  var sliderClasses = shared.sliderStyles();
9252
9440
  var containerClass = useTooltipContainerStyles(isEnabled);
9253
9441
 
@@ -9273,11 +9461,17 @@
9273
9461
  });
9274
9462
  }, []);
9275
9463
  var onWheel = React__namespace.useCallback(function (event) {
9276
- var multiplier = event.altKey ? 10 : 1;
9277
- var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
9278
- var newValue = Math.min(Math.max(currentOpacity - direction, 0), 1);
9279
- onLayerChangeOpacity(newValue);
9280
- }, [currentOpacity, onLayerChangeOpacity]);
9464
+ if (event.ctrlKey || event.metaKey) {
9465
+ disableScroll();
9466
+ var multiplier = event.altKey ? 10 : 1;
9467
+ var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
9468
+ var newValue_1 = Math.min(Math.max(currentOpacity - direction, 0), 1); // Kind of "one frame debouncer", meant to dampen too fast slider movement
9469
+
9470
+ window.requestAnimationFrame(function () {
9471
+ onLayerChangeOpacity(newValue_1);
9472
+ });
9473
+ } else enableScroll();
9474
+ }, [currentOpacity, onLayerChangeOpacity, disableScroll, enableScroll]);
9281
9475
  var onClickButton = React__namespace.useCallback(function () {
9282
9476
  setOpen(!open);
9283
9477
  }, [open]);
@@ -9287,17 +9481,15 @@
9287
9481
  }
9288
9482
  }, [open]);
9289
9483
  var onMouseEnter = React__namespace.useCallback(function () {
9290
- disableScroll();
9291
9484
  if (!open) setTooltipOpen(true);
9292
- }, [open, disableScroll]);
9485
+ }, [open]);
9293
9486
  var onMouseLeave = React__namespace.useCallback(function () {
9294
9487
  enableScroll();
9295
9488
  setTooltipOpen(false);
9296
9489
  }, [enableScroll]);
9297
9490
  var onFocus = React__namespace.useCallback(function () {
9298
- disableScroll();
9299
9491
  setTooltipOpen(true);
9300
- }, [disableScroll]);
9492
+ }, []);
9301
9493
  var onBlur = React__namespace.useCallback(function () {
9302
9494
  enableScroll();
9303
9495
  setTooltipOpen(false);
@@ -9352,120 +9544,44 @@
9352
9544
  * distributed under the License is distributed on an "AS IS" BASIS,
9353
9545
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9354
9546
  * See the License for the specific language governing permissions and
9355
- * limitations under the License.
9356
- *
9357
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9358
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9359
- * */
9360
- var useStyles$z = makeStyles__default["default"](function (theme) {
9361
- return createStyles__default["default"]({
9362
- icon: {
9363
- minWidth: 32,
9364
- color: theme.palette.geowebColors.layerManager.tableRowDefaultIcon.rgba
9365
- },
9366
- text: {
9367
- fontSize: 16,
9368
- color: theme.palette.geowebColors.layerManager.tableRowDefaultText.rgba
9369
- }
9370
- });
9371
- });
9372
-
9373
- var MenuItemButton = function MenuItemButton(_a) {
9374
- var title = _a.title,
9375
- tooltipTitle = _a.tooltipTitle,
9376
- icon = _a.icon;
9377
- var classes = useStyles$z();
9378
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(material.ListItemIcon, {
9379
- className: classes.icon + " icon"
9380
- }, icon), /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
9381
- title: tooltipTitle,
9382
- placement: "top"
9383
- }, /*#__PURE__*/React__namespace.createElement(material.Typography, {
9384
- className: classes.text,
9385
- variant: "inherit"
9386
- }, title)));
9387
- };
9388
-
9389
- /* *
9390
- * Licensed under the Apache License, Version 2.0 (the "License");
9391
- * you may not use this file except in compliance with the License.
9392
- * You may obtain a copy of the License at
9393
- *
9394
- * http://www.apache.org/licenses/LICENSE-2.0
9395
- *
9396
- * Unless required by applicable law or agreed to in writing, software
9397
- * distributed under the License is distributed on an "AS IS" BASIS,
9398
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9399
- * See the License for the specific language governing permissions and
9400
- * limitations under the License.
9401
- *
9402
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9403
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9404
- * */
9405
- var useStyles$y = makeStyles__default["default"](function (theme) {
9406
- return {
9407
- menu: {
9408
- backgroundColor: theme.palette.geowebColors.background.surface,
9409
- '& li:hover': {
9410
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9411
- }
9412
- }
9413
- };
9414
- });
9547
+ * limitations under the License.
9548
+ *
9549
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9550
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
9551
+ * */
9552
+ var CopyIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("path", {
9553
+ d: "M8 7v2H6a1 1 0 0 0-.993.883L5 10v9a1 1 0 0 0 .883.993L6 20h6a1 1 0 0 0 .993-.883L13 19h2v1.6a1.4 1.4 0 0 1-1.263 1.394l-.135.006H4.399a1.4 1.4 0 0 1-1.393-1.265L3 20.6V8.4a1.4 1.4 0 0 1 1.264-1.394L4.4 7H8zm7.584-5v2H12a1 1 0 0 0-.993.883L11 5v9a1 1 0 0 0 .883.993L12 15h6a1 1 0 0 0 .993-.883L19 14V7.42h2v8.18a1.4 1.4 0 0 1-1.263 1.394l-.135.006h-9.203a1.4 1.4 0 0 1-1.393-1.265L9 15.6V3.4a1.4 1.4 0 0 1 1.264-1.394L10.4 2h5.185zM17 2l4 4h-2.5c-.777 0-1.42-.598-1.493-1.357L17 4.499V2z"
9554
+ }));
9415
9555
 
9416
9556
  var LayerManagerMenuButton = function LayerManagerMenuButton(_a) {
9417
- var tooltipTitle = _a.tooltipTitle,
9418
- mapId = _a.mapId,
9557
+ var mapId = _a.mapId,
9419
9558
  layerId = _a.layerId,
9420
- onLayerDuplicate = _a.onLayerDuplicate,
9421
- _b = _a.isEnabled,
9422
- isEnabled = _b === void 0 ? true : _b;
9423
- var classes = useStyles$y();
9424
-
9425
- var _c = __read(React__namespace.useState(null), 2),
9426
- anchorEl = _c[0],
9427
- setAnchorEl = _c[1];
9428
-
9429
- var handleClick = function handleClick(event) {
9430
- setAnchorEl(event.currentTarget);
9431
- };
9432
-
9433
- var handleClose = function handleClose() {
9434
- setAnchorEl(null);
9435
- };
9559
+ onLayerDuplicate = _a.onLayerDuplicate;
9436
9560
 
9437
9561
  var onClickDuplicate = function onClickDuplicate() {
9438
9562
  onLayerDuplicate({
9439
9563
  mapId: mapId,
9440
9564
  layerId: layerId
9441
9565
  });
9442
- handleClose();
9443
9566
  };
9444
9567
 
9445
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9446
- tooltipTitle: tooltipTitle,
9447
- onClick: handleClick,
9448
- icon: /*#__PURE__*/React__namespace.createElement(iconsMaterial.MoreVert, null),
9449
- testId: "openMenuButton",
9450
- isEnabled: isEnabled
9451
- }), /*#__PURE__*/React__namespace.createElement(material.Menu, {
9452
- anchorEl: anchorEl,
9453
- keepMounted: true,
9454
- open: Boolean(anchorEl),
9455
- onClose: handleClose,
9456
- PaperProps: {
9457
- className: classes.menu
9458
- }
9459
- }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9460
- "data-testid": "duplicateLayerButton",
9461
- onClick: onClickDuplicate
9462
- }, /*#__PURE__*/React__namespace.createElement(MenuItemButton, {
9463
- title: "Duplicate layer",
9464
- tooltipTitle: "Duplicate layer",
9465
- icon: /*#__PURE__*/React__namespace.createElement(iconsMaterial.FileCopy, {
9466
- fontSize: "small"
9467
- })
9468
- }))));
9568
+ return /*#__PURE__*/React__namespace.createElement(shared.ToggleMenu, {
9569
+ buttonTestId: "openMenuButton",
9570
+ buttonSx: {
9571
+ margin: '4px 2px',
9572
+ '&.MuiButtonBase-root': {
9573
+ backgroundColor: 'transparent',
9574
+ color: 'geowebColors.greys.accessible'
9575
+ }
9576
+ },
9577
+ menuPosition: "bottom",
9578
+ menuItems: [{
9579
+ text: 'Duplicate layer',
9580
+ action: onClickDuplicate,
9581
+ icon: CopyIcon
9582
+ }],
9583
+ tooltipTitle: "Open menu"
9584
+ });
9469
9585
  };
9470
9586
 
9471
9587
  var RenderStyles = function RenderStyles(_a) {
@@ -9517,10 +9633,11 @@
9517
9633
  onChange: selectStyle,
9518
9634
  onChangeMouseWheel: function onChangeMouseWheel(e) {
9519
9635
  return onChangeLayerStyle(e.value);
9520
- }
9636
+ },
9637
+ requiresCtrlToChange: true
9521
9638
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9522
9639
  disabled: true
9523
- }, "Select style"), styles.map(function (styleFromlayer) {
9640
+ }, "Style"), styles.map(function (styleFromlayer) {
9524
9641
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9525
9642
  key: styleFromlayer.name,
9526
9643
  value: styleFromlayer.name
@@ -9544,72 +9661,22 @@
9544
9661
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9545
9662
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9546
9663
  * */
9547
- var useStyles$x = makeStyles__default["default"](function () {
9664
+ var useStyles$s = makeStyles__default["default"](function (theme) {
9548
9665
  return createStyles__default["default"]({
9549
- icon: {
9550
- width: 20,
9551
- height: 20
9552
- }
9553
- });
9554
- });
9555
-
9556
- var DeleteButton = function DeleteButton(_a) {
9557
- var tooltipTitle = _a.tooltipTitle,
9558
- onClickDelete = _a.onClickDelete,
9559
- _b = _a.isEnabled,
9560
- isEnabled = _b === void 0 ? true : _b;
9561
- var classes = useStyles$x();
9562
- return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9563
- tooltipTitle: tooltipTitle,
9564
- onClick: onClickDelete,
9565
- icon: /*#__PURE__*/React__namespace.createElement(iconsMaterial.Delete, {
9566
- className: classes.icon
9567
- }),
9568
- testId: "deleteButton",
9569
- isEnabled: isEnabled
9570
- });
9571
- };
9572
-
9573
- /* *
9574
- * Licensed under the Apache License, Version 2.0 (the "License");
9575
- * you may not use this file except in compliance with the License.
9576
- * You may obtain a copy of the License at
9577
- *
9578
- * http://www.apache.org/licenses/LICENSE-2.0
9579
- *
9580
- * Unless required by applicable law or agreed to in writing, software
9581
- * distributed under the License is distributed on an "AS IS" BASIS,
9582
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9583
- * See the License for the specific language governing permissions and
9584
- * limitations under the License.
9585
- *
9586
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9587
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9588
- * */
9589
- var useStyles$w = makeStyles__default["default"](function (theme) {
9590
- return createStyles__default["default"]({
9591
- icon: {
9592
- width: 18,
9593
- height: 18,
9594
- marginTop: 4
9595
- },
9596
9666
  svgIcon: {
9597
9667
  fill: function fill(_a) {
9598
9668
  var isActive = _a.isActive,
9599
9669
  isEnabled = _a.isEnabled;
9600
- var _b = theme.palette.geowebColors.layerManager,
9601
- tableRowDefaultIcon = _b.tableRowDefaultIcon,
9602
- tableRowDisabledIcon = _b.tableRowDisabledIcon;
9603
9670
 
9604
9671
  if (isActive) {
9605
9672
  return theme.palette.common.white;
9606
9673
  }
9607
9674
 
9608
- if (!isEnabled) {
9609
- return tableRowDisabledIcon.fill;
9675
+ if (isEnabled) {
9676
+ return theme.palette.geowebColors.buttons.flat["default"].color;
9610
9677
  }
9611
9678
 
9612
- return tableRowDefaultIcon.rgba;
9679
+ return theme.palette.geowebColors.buttons.flat.disabled.color;
9613
9680
  }
9614
9681
  }
9615
9682
  });
@@ -9623,14 +9690,18 @@
9623
9690
  isActive = _c === void 0 ? false : _c,
9624
9691
  _d = _a.isEnabled,
9625
9692
  isEnabled = _d === void 0 ? true : _d;
9626
- var classes = useStyles$w({
9693
+ var classes = useStyles$s({
9627
9694
  isActive: isActive,
9628
9695
  isEnabled: isEnabled
9629
9696
  });
9630
9697
 
9631
9698
  var Icon = function Icon() {
9632
9699
  return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
9633
- className: classes.icon
9700
+ sx: {
9701
+ width: '18px',
9702
+ height: '18px',
9703
+ marginTop: '4px'
9704
+ }
9634
9705
  }, /*#__PURE__*/React__namespace.createElement("g", {
9635
9706
  id: "Concept-3",
9636
9707
  stroke: "none",
@@ -9647,7 +9718,7 @@
9647
9718
  }))));
9648
9719
  };
9649
9720
 
9650
- return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9721
+ return /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
9651
9722
  tooltipTitle: tooltipTitle,
9652
9723
  onClick: onClickActivate,
9653
9724
  icon: /*#__PURE__*/React__namespace.createElement(Icon, null),
@@ -9672,7 +9743,7 @@
9672
9743
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9673
9744
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9674
9745
  * */
9675
- var useStyles$v = makeStyles__default["default"](function (theme) {
9746
+ var useStyles$r = makeStyles__default["default"](function (theme) {
9676
9747
  return createStyles__default["default"]({
9677
9748
  row: {
9678
9749
  background: function background(isEnabled) {
@@ -9706,6 +9777,8 @@
9706
9777
  } : _b,
9707
9778
  _c = _a.isEnabled,
9708
9779
  isEnabled = _c === void 0 ? true : _c,
9780
+ _d = _a.isLayerMissing,
9781
+ isLayerMissing = _d === void 0 ? false : _d,
9709
9782
  onLayerEnable = _a.onLayerEnable,
9710
9783
  onLayerChangeName = _a.onLayerChangeName,
9711
9784
  onLayerChangeStyle = _a.onLayerChangeStyle,
@@ -9724,7 +9797,7 @@
9724
9797
  layerActiveLayout = _a.layerActiveLayout,
9725
9798
  layerManagerWidth = _a.layerManagerWidth,
9726
9799
  dragHandle = _a.dragHandle;
9727
- var classes = useStyles$v(isEnabled);
9800
+ var classes = useStyles$r(isEnabled);
9728
9801
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9729
9802
 
9730
9803
  var onClickRow = function onClickRow() {
@@ -9739,7 +9812,7 @@
9739
9812
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9740
9813
  item: true,
9741
9814
  className: columnSizes.column1
9742
- }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(EnableLayer, {
9815
+ }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.EnableButton, {
9743
9816
  isEnabled: layer.enabled,
9744
9817
  title: layer.name,
9745
9818
  onChangeEnableLayer: function onChangeEnableLayer() {
@@ -9762,7 +9835,13 @@
9762
9835
  name: name
9763
9836
  });
9764
9837
  }
9765
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9838
+ })), isLayerMissing ? /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9839
+ item: true,
9840
+ className: "" + columnSizes.columns35
9841
+ }, /*#__PURE__*/React__default["default"].createElement(shared.AlertBanner, {
9842
+ title: "This layer could not be loaded: does not exist on the server.",
9843
+ isCompact: true
9844
+ })) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9766
9845
  item: true,
9767
9846
  className: "" + columnSizes.column3
9768
9847
  }, layerStylesLayout || /*#__PURE__*/React__default["default"].createElement(RenderStyles, {
@@ -9805,10 +9884,10 @@
9805
9884
  dimension: dimension
9806
9885
  });
9807
9886
  }
9808
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9887
+ }))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9809
9888
  item: true,
9810
9889
  className: columnSizes.column6
9811
- }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(DeleteButton, {
9890
+ }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerDeleteButton, {
9812
9891
  tooltipTitle: "Remove layer",
9813
9892
  onClickDelete: function onClickDelete() {
9814
9893
  onLayerDelete({
@@ -9817,7 +9896,6 @@
9817
9896
  });
9818
9897
  }
9819
9898
  }), layerMenuLayout || /*#__PURE__*/React__default["default"].createElement(LayerManagerMenuButton, {
9820
- tooltipTitle: "Open Menu",
9821
9899
  mapId: mapId,
9822
9900
  layerId: layerId,
9823
9901
  onLayerDuplicate: onLayerDuplicate
@@ -9859,7 +9937,7 @@
9859
9937
  var isLayerEnabled = reactRedux.useSelector(function (store) {
9860
9938
  return getLayerEnabled(store, layerId);
9861
9939
  });
9862
- return /*#__PURE__*/React__namespace.createElement(DeleteButton, {
9940
+ return /*#__PURE__*/React__namespace.createElement(shared.ManagerDeleteButton, {
9863
9941
  tooltipTitle: "Remove layer",
9864
9942
  onClickDelete: function onClickDelete() {
9865
9943
  layerDelete$1({
@@ -9903,7 +9981,7 @@
9903
9981
  enabled: enabled
9904
9982
  }));
9905
9983
  }, [dispatch]);
9906
- return /*#__PURE__*/React__namespace.createElement(EnableLayer, {
9984
+ return /*#__PURE__*/React__namespace.createElement(shared.EnableButton, {
9907
9985
  isEnabled: isEnabled,
9908
9986
  title: "Toggle this layer's visibility",
9909
9987
  onChangeEnableLayer: function onChangeEnableLayer(enable) {
@@ -10145,11 +10223,7 @@
10145
10223
  origin: 'MenuButtonConnect'
10146
10224
  }));
10147
10225
  }, [dispatch]);
10148
- var isLayerEnabled = reactRedux.useSelector(function (store) {
10149
- return getLayerEnabled(store, layerId);
10150
- });
10151
10226
  return /*#__PURE__*/React__namespace.createElement(LayerManagerMenuButton, {
10152
- tooltipTitle: "Open Menu",
10153
10227
  layerId: layerId,
10154
10228
  mapId: mapId,
10155
10229
  onLayerDuplicate: function onLayerDuplicate() {
@@ -10158,8 +10232,7 @@
10158
10232
  mapId: mapId,
10159
10233
  layer: layer
10160
10234
  });
10161
- },
10162
- isEnabled: isLayerEnabled
10235
+ }
10163
10236
  });
10164
10237
  };
10165
10238
 
@@ -10252,10 +10325,23 @@
10252
10325
  var isEnabled = reactRedux.useSelector(function (store) {
10253
10326
  return getLayerEnabled(store, layerId);
10254
10327
  });
10328
+ var layerName = reactRedux.useSelector(function (store) {
10329
+ return getLayerName(store, layerId);
10330
+ });
10331
+ var layerService = reactRedux.useSelector(function (store) {
10332
+ return getLayerService(store, layerId);
10333
+ });
10334
+ var layers = reactRedux.useSelector(function (store) {
10335
+ return getLayersFromService$1(store, layerService);
10336
+ });
10337
+ var isLayerMissing = layers && layers.length > 0 && !layers.some(function (l) {
10338
+ return l.name === layerName;
10339
+ });
10255
10340
  return /*#__PURE__*/React__namespace.createElement(LayerRow, {
10256
10341
  isEnabled: isEnabled,
10257
10342
  mapId: mapId,
10258
10343
  layerId: layerId,
10344
+ isLayerMissing: isLayerMissing,
10259
10345
  layerEnableLayout: /*#__PURE__*/React__namespace.createElement(EnableLayerConnect, {
10260
10346
  layerId: layerId
10261
10347
  }),
@@ -10306,22 +10392,6 @@
10306
10392
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10307
10393
  * */
10308
10394
  var TOOLTIP_TITLE = 'Drag a layer up or down';
10309
- var useStyles$u = makeStyles__default["default"](function (theme) {
10310
- return {
10311
- dragHandle: {
10312
- cursor: 'grab',
10313
- backgroundColor: 'inherit',
10314
- '&:hover': {
10315
- backgroundColor: 'inherit'
10316
- },
10317
- height: 32,
10318
- color: function color(_a) {
10319
- var isDisabled = _a.isDisabled;
10320
- return isDisabled ? theme.palette.geowebColors.layerManager.tableRowDefaultIcon.rgba : theme.palette.geowebColors.layerManager.tableRowDisabledIcon.fill;
10321
- }
10322
- }
10323
- };
10324
- });
10325
10395
 
10326
10396
  var DragHandle = function DragHandle(_a) {
10327
10397
  var _b = _a.isDisabled,
@@ -10330,20 +10400,26 @@
10330
10400
  index = _c === void 0 ? undefined : _c,
10331
10401
  _d = _a.hideTooltip,
10332
10402
  hideTooltip = _d === void 0 ? false : _d;
10333
- var classes = useStyles$u({
10334
- isDisabled: isDisabled
10335
- });
10336
10403
  var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
10337
- return /*#__PURE__*/React__default["default"].createElement(LayerManagerButton, {
10404
+ return /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
10338
10405
  tooltipTitle: tooltipTitle,
10339
10406
  icon: /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null),
10340
10407
  testId: "dragHandle" + (index !== undefined ? "-" + index : ''),
10341
- className: classes.dragHandle + " handle",
10408
+ className: "handle",
10342
10409
  tabIndex: -1,
10343
10410
  isEnabled: !isDisabled,
10344
10411
  disableFocusRipple: true,
10345
10412
  disableTouchRipple: true,
10346
- disabled: isDisabled
10413
+ disabled: isDisabled,
10414
+ isAccessible: true,
10415
+ sx: {
10416
+ cursor: 'grab',
10417
+ '&:hover': {
10418
+ backgroundColor: 'inherit!important'
10419
+ },
10420
+ marginLeft: '3px',
10421
+ marginRight: '3px'
10422
+ }
10347
10423
  });
10348
10424
  };
10349
10425
 
@@ -10363,7 +10439,7 @@
10363
10439
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10364
10440
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10365
10441
  * */
10366
- var useStyles$t = makeStyles__default["default"](function () {
10442
+ var useStyles$q = makeStyles__default["default"](function () {
10367
10443
  return {
10368
10444
  layerRows: {
10369
10445
  width: '100%',
@@ -10429,7 +10505,7 @@
10429
10505
 
10430
10506
  var isSorting = activeDragIndex !== null;
10431
10507
  var isDragDisabled = layerIds.length === 1;
10432
- var classes = useStyles$t(isSorting);
10508
+ var classes = useStyles$q(isSorting);
10433
10509
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
10434
10510
  container: true,
10435
10511
  item: true,
@@ -10527,7 +10603,7 @@
10527
10603
  }
10528
10604
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
10529
10605
  disabled: true
10530
- }, "Select base layer"), availableBaseLayers.map(function (baseLayer) {
10606
+ }, "Base layer"), availableBaseLayers.map(function (baseLayer) {
10531
10607
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
10532
10608
  key: baseLayer.id,
10533
10609
  value: baseLayer.id
@@ -10639,7 +10715,7 @@
10639
10715
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10640
10716
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10641
10717
  * */
10642
- var useStyles$s = makeStyles__default["default"]({
10718
+ var useStyles$p = makeStyles__default["default"]({
10643
10719
  layerRow: {
10644
10720
  width: '100%',
10645
10721
  height: '36px'
@@ -10662,7 +10738,7 @@
10662
10738
  layerManagerWidth = _a.layerManagerWidth,
10663
10739
  _d = _a.tooltip,
10664
10740
  tooltip = _d === void 0 ? '' : _d;
10665
- var classes = useStyles$s();
10741
+ var classes = useStyles$p();
10666
10742
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
10667
10743
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
10668
10744
  container: true,
@@ -10707,7 +10783,7 @@
10707
10783
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10708
10784
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10709
10785
  * */
10710
- var useStyles$r = makeStyles__default["default"]({
10786
+ var useStyles$o = makeStyles__default["default"]({
10711
10787
  layerRowContainer: {
10712
10788
  position: 'relative',
10713
10789
  width: '100%',
@@ -10742,7 +10818,7 @@
10742
10818
  layerSelect = _e === void 0 ? false : _e,
10743
10819
  _f = _a.showAddLayersTooltip,
10744
10820
  showAddLayersTooltip = _f === void 0 ? true : _f;
10745
- var classes = useStyles$r();
10821
+ var classes = useStyles$o();
10746
10822
 
10747
10823
  var _g = __read(React__namespace.useState(LayerManagerWidth.lg), 2),
10748
10824
  layerManagerWidth = _g[0],
@@ -10798,80 +10874,6 @@
10798
10874
  }))));
10799
10875
  };
10800
10876
 
10801
- /* *
10802
- * Licensed under the Apache License, Version 2.0 (the "License");
10803
- * you may not use this file except in compliance with the License.
10804
- * You may obtain a copy of the License at
10805
- *
10806
- * http://www.apache.org/licenses/LICENSE-2.0
10807
- *
10808
- * Unless required by applicable law or agreed to in writing, software
10809
- * distributed under the License is distributed on an "AS IS" BASIS,
10810
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10811
- * See the License for the specific language governing permissions and
10812
- * limitations under the License.
10813
- *
10814
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10815
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
10816
- * */
10817
-
10818
- var CustomToggleButton = function CustomToggleButton(_a) {
10819
- var _b = _a.variant,
10820
- variant = _b === void 0 ? 'primary' : _b,
10821
- _c = _a.value,
10822
- value = _c === void 0 ? 0 : _c,
10823
- props = __rest(_a, ["variant", "value"]);
10824
-
10825
- return /*#__PURE__*/React__namespace.createElement(material.ToggleButton, __assign({
10826
- className: variant,
10827
- value: value
10828
- }, props));
10829
- };
10830
-
10831
- /* *
10832
- * Licensed under the Apache License, Version 2.0 (the "License");
10833
- * you may not use this file except in compliance with the License.
10834
- * You may obtain a copy of the License at
10835
- *
10836
- * http://www.apache.org/licenses/LICENSE-2.0
10837
- *
10838
- * Unless required by applicable law or agreed to in writing, software
10839
- * distributed under the License is distributed on an "AS IS" BASIS,
10840
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10841
- * See the License for the specific language governing permissions and
10842
- * limitations under the License.
10843
- *
10844
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10845
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
10846
- * */
10847
-
10848
- var ToolButton = function ToolButton(_a) {
10849
- var active = _a.active,
10850
- _b = _a.width,
10851
- width = _b === void 0 ? '24px' : _b,
10852
- _c = _a.height,
10853
- height = _c === void 0 ? '24px' : _c,
10854
- children = _a.children,
10855
- _d = _a.value,
10856
- value = _d === void 0 ? 0 : _d,
10857
- _e = _a.sx,
10858
- sx = _e === void 0 ? {} : _e,
10859
- props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
10860
-
10861
- return /*#__PURE__*/React__namespace.createElement(CustomToggleButton, __assign({
10862
- variant: "tool",
10863
- disableRipple: true,
10864
- selected: active,
10865
- value: value,
10866
- sx: __assign({
10867
- width: width + "!important",
10868
- height: height + "!important",
10869
- textTransform: 'none!important',
10870
- padding: '11px!important'
10871
- }, sx)
10872
- }, props), children);
10873
- };
10874
-
10875
10877
  /* *
10876
10878
  * Licensed under the Apache License, Version 2.0 (the "License");
10877
10879
  * you may not use this file except in compliance with the License.
@@ -10908,7 +10910,7 @@
10908
10910
  source: source
10909
10911
  }));
10910
10912
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
10911
- return /*#__PURE__*/React__namespace.createElement(ToolButton, {
10913
+ return /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
10912
10914
  onClick: openFilterResultsDialog,
10913
10915
  active: isOpenInStore,
10914
10916
  id: "keywordFilterButton",
@@ -11487,13 +11489,6 @@
11487
11489
  var isURL = function isURL(string) {
11488
11490
  return /^https?:\/\//.test(string);
11489
11491
  };
11490
- var useStyles$q = makeStyles__default["default"](function (theme) {
11491
- return {
11492
- iconButton: {
11493
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
11494
- }
11495
- };
11496
- });
11497
11492
  var clearIconPath = 'M12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M15.44426,7.26697571 L12.0002861,10.7110482 L8.55573996,7.26697571 C8.19978253,6.9110081 7.62292549,6.9110081 7.26696807,7.26697571 C6.91101064,7.62294331 6.91101064,8.19981687 7.26696807,8.55578447 L10.7115142,11.9998569 L7.26696807,15.4445017 C6.91101064,15.8004693 6.91101064,16.3767705 7.26696807,16.7333104 C7.44494678,16.910722 7.67843653,17 7.91192629,17 C8.14484377,17 8.37776125,16.910722 8.55573996,16.7333104 L12.0002861,13.289238 L15.44426,16.7333104 C15.6222388,16.910722 15.8551562,17 16.088646,17 C16.3221357,17 16.5550532,16.910722 16.7330319,16.7333104 C17.0889894,16.3767705 17.0889894,15.8004693 16.7330319,15.4445017 L13.289058,11.9998569 L16.7330319,8.55578447 C17.0889894,8.19981687 17.0889894,7.62294331 16.7330319,7.26697571 C16.3770745,6.9110081 15.8002175,6.9110081 15.44426,7.26697571 Z';
11498
11493
  var clearIcon = /*#__PURE__*/React__default["default"].createElement(material.SvgIcon, {
11499
11494
  style: {
@@ -11525,7 +11520,6 @@
11525
11520
  isPopupOpen = _b[0],
11526
11521
  setPopupOpen = _b[1];
11527
11522
 
11528
- var classes = useStyles$q();
11529
11523
  React__default["default"].useEffect(function () {
11530
11524
  if (isPopupOpen === false) {
11531
11525
  onClickClear();
@@ -11536,7 +11530,6 @@
11536
11530
  title: "Clear",
11537
11531
  placement: "top"
11538
11532
  }, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
11539
- className: classes.iconButton,
11540
11533
  edge: "end",
11541
11534
  onClick: function onClick() {
11542
11535
  onClickClear();
@@ -11565,7 +11558,6 @@
11565
11558
  title: "Search",
11566
11559
  placement: "top"
11567
11560
  }, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
11568
- className: classes.iconButton,
11569
11561
  edge: "end",
11570
11562
  size: "large"
11571
11563
  }, searchIcon));
@@ -11664,6 +11656,50 @@
11664
11656
  });
11665
11657
  };
11666
11658
 
11659
+ /* *
11660
+ * Licensed under the Apache License, Version 2.0 (the "License");
11661
+ * you may not use this file except in compliance with the License.
11662
+ * You may obtain a copy of the License at
11663
+ *
11664
+ * http://www.apache.org/licenses/LICENSE-2.0
11665
+ *
11666
+ * Unless required by applicable law or agreed to in writing, software
11667
+ * distributed under the License is distributed on an "AS IS" BASIS,
11668
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11669
+ * See the License for the specific language governing permissions and
11670
+ * limitations under the License.
11671
+ *
11672
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11673
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
11674
+ * */
11675
+
11676
+ var LayerAddRemoveButton = function LayerAddRemoveButton(_a) {
11677
+ var layer = _a.layer,
11678
+ layerIndex = _a.layerIndex,
11679
+ serviceId = _a.serviceId,
11680
+ addLayer = _a.addLayer,
11681
+ deleteLayer = _a.deleteLayer,
11682
+ mapLayers = _a.mapLayers;
11683
+ var foundLayer = mapLayers.find(function (lr) {
11684
+ return lr.name === layer.name && lr.service === serviceId;
11685
+ });
11686
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomToggleButton, {
11687
+ "data-testid": "layerAddRemoveButton-" + layer.name,
11688
+ onClick: function onClick() {
11689
+ !foundLayer ? addLayer({
11690
+ serviceURL: serviceId,
11691
+ layerName: layer.name
11692
+ }) : deleteLayer({
11693
+ layerId: foundLayer.id,
11694
+ layerIndex: layerIndex
11695
+ });
11696
+ },
11697
+ selected: !!foundLayer,
11698
+ variant: "tool",
11699
+ fullWidth: true
11700
+ }, !foundLayer ? 'Add' : 'Remove');
11701
+ };
11702
+
11667
11703
  /* *
11668
11704
  * Licensed under the Apache License, Version 2.0 (the "License");
11669
11705
  * you may not use this file except in compliance with the License.
@@ -11718,35 +11754,35 @@
11718
11754
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11719
11755
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
11720
11756
  * */
11721
- var useStyles$p = makeStyles__default["default"](function (theme) {
11757
+ var useStyles$n = makeStyles__default["default"](function (theme) {
11722
11758
  return {
11723
11759
  layerRow: {
11724
- background: theme.palette.geowebColors.background.surface,
11760
+ background: theme.palette.geowebColors.cards.cardContainer,
11725
11761
  padding: '8px 0px 8px 12px',
11726
11762
  marginBottom: '4px',
11727
11763
  height: '64px',
11728
- border: "solid 1px " + theme.palette.geowebColors.cards.cardContainerBorder
11764
+ border: "solid 1px " + theme.palette.geowebColors.cards.cardContainerBorder,
11765
+ display: 'grid',
11766
+ gridTemplateColumns: '1fr 0.1fr',
11767
+ gridGap: '20px'
11729
11768
  },
11730
11769
  layerText: {
11731
11770
  fontSize: '12px',
11732
11771
  fontWeight: 500,
11733
11772
  overflow: 'clip',
11734
11773
  height: '20px',
11735
- textOverflow: 'ellipsis',
11736
- whiteSpace: 'nowrap'
11774
+ textOverflow: 'ellipsis'
11737
11775
  },
11738
11776
  layerName: {
11739
11777
  fontSize: '12px',
11740
11778
  height: '24px',
11741
- maxWidth: '100%',
11742
11779
  overflow: 'clip',
11743
11780
  "float": 'left',
11744
11781
  paddingTop: '6px',
11745
- textOverflow: 'ellipsis',
11746
11782
  whiteSpace: 'nowrap'
11747
11783
  },
11748
11784
  layerNameMaxWidth: {
11749
- maxWidth: '196px'
11785
+ maxWidth: '270px'
11750
11786
  },
11751
11787
  layerAbstract: {
11752
11788
  fontSize: '10px',
@@ -11757,6 +11793,11 @@
11757
11793
  resultCount: {
11758
11794
  marginBottom: '4px',
11759
11795
  fontSize: '12px'
11796
+ },
11797
+ layerButton: {
11798
+ marginRight: '8px',
11799
+ marginTop: '4px',
11800
+ width: '80px'
11760
11801
  }
11761
11802
  };
11762
11803
  });
@@ -11765,10 +11806,13 @@
11765
11806
  var services = _a.services,
11766
11807
  serviceIds = _a.serviceIds,
11767
11808
  layerSelectHeight = _a.layerSelectHeight,
11809
+ addLayer = _a.addLayer,
11810
+ deleteLayer = _a.deleteLayer,
11768
11811
  searchString = _a.searchString,
11812
+ mapLayers = _a.mapLayers,
11769
11813
  keywordIds = _a.keywordIds,
11770
11814
  allKeywordsActive = _a.allKeywordsActive;
11771
- var classes = useStyles$p();
11815
+ var classes = useStyles$n();
11772
11816
 
11773
11817
  var _b = __read(React__namespace.useState(0), 2),
11774
11818
  numberOfLayers = _b[0],
@@ -11789,12 +11833,14 @@
11789
11833
  overflow: 'auto'
11790
11834
  }
11791
11835
  }, serviceIds.map(function (serviceId) {
11792
- return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer) {
11836
+ return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer, layerIndex) {
11793
11837
  return /*#__PURE__*/React__namespace.createElement("div", {
11838
+ key: serviceId + "-" + layer.name + "-" + layer.text
11839
+ }, /*#__PURE__*/React__namespace.createElement("div", {
11794
11840
  key: serviceId + "-" + layer.name,
11795
11841
  className: classes.layerRow,
11796
11842
  "data-testid": "layerListLayerRow"
11797
- }, /*#__PURE__*/React__namespace.createElement("div", {
11843
+ }, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
11798
11844
  className: classes.layerText
11799
11845
  }, layer.text), /*#__PURE__*/React__namespace.createElement("div", null, layer["abstract"] ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", {
11800
11846
  className: classes.layerName + " " + classes.layerNameMaxWidth
@@ -11803,7 +11849,16 @@
11803
11849
  "data-testid": "layerAbstract"
11804
11850
  }, layer["abstract"])) : /*#__PURE__*/React__namespace.createElement("div", {
11805
11851
  className: classes.layerName
11806
- }, layer.name)));
11852
+ }, layer.name))), /*#__PURE__*/React__namespace.createElement("div", {
11853
+ className: classes.layerButton
11854
+ }, /*#__PURE__*/React__namespace.createElement(LayerAddRemoveButton, {
11855
+ layer: layer,
11856
+ layerIndex: layerIndex,
11857
+ serviceId: serviceId,
11858
+ addLayer: addLayer,
11859
+ deleteLayer: deleteLayer,
11860
+ mapLayers: mapLayers
11861
+ }))));
11807
11862
  });
11808
11863
  })));
11809
11864
  };
@@ -11826,13 +11881,57 @@
11826
11881
  * */
11827
11882
 
11828
11883
  var LayerListConnect = function LayerListConnect(_a) {
11829
- var layerSelectHeight = _a.layerSelectHeight;
11884
+ var mapId = _a.mapId,
11885
+ layerSelectHeight = _a.layerSelectHeight;
11830
11886
  var services = reactRedux.useSelector(function (store) {
11831
11887
  return getServices(store);
11832
11888
  });
11889
+ var dispatch = reactRedux.useDispatch();
11833
11890
  var enabledServiceIds = reactRedux.useSelector(function (store) {
11834
11891
  return getEnabledServiceIds(store);
11835
11892
  });
11893
+ var mapLayers = reactRedux.useSelector(function (store) {
11894
+ return getMapLayers(store, mapId);
11895
+ });
11896
+
11897
+ var addLayer$1 = function addLayer(_a) {
11898
+ var serviceURL = _a.serviceURL,
11899
+ layerName = _a.layerName;
11900
+ var layer = {
11901
+ service: serviceURL,
11902
+ name: layerName,
11903
+ id: generateLayerId(),
11904
+ layerType: webmap.LayerType.mapLayer
11905
+ };
11906
+ addMapLayer({
11907
+ mapId: mapId,
11908
+ layerId: layer.id,
11909
+ layer: layer,
11910
+ origin: 'LayerListConnect'
11911
+ });
11912
+ };
11913
+
11914
+ var addMapLayer = React__namespace.useCallback(function (_a) {
11915
+ var layerId = _a.layerId,
11916
+ layer = _a.layer,
11917
+ origin = _a.origin;
11918
+ return dispatch(addLayer({
11919
+ mapId: mapId,
11920
+ layerId: layerId,
11921
+ layer: layer,
11922
+ origin: origin
11923
+ }));
11924
+ }, [dispatch, mapId]);
11925
+ var deleteLayer = React__namespace.useCallback(function (_a) {
11926
+ var layerId = _a.layerId,
11927
+ layerIndex = _a.layerIndex;
11928
+ return dispatch(layerDelete({
11929
+ mapId: mapId,
11930
+ layerId: layerId,
11931
+ layerIndex: layerIndex,
11932
+ origin: 'LayerListConnect'
11933
+ }));
11934
+ }, [dispatch, mapId]);
11836
11935
  var checkedKeywordIds = reactRedux.useSelector(function (store) {
11837
11936
  return getCheckedKeywordIds(store);
11838
11937
  });
@@ -11846,9 +11945,12 @@
11846
11945
  services: services,
11847
11946
  serviceIds: enabledServiceIds,
11848
11947
  layerSelectHeight: layerSelectHeight,
11948
+ addLayer: addLayer$1,
11949
+ deleteLayer: deleteLayer,
11849
11950
  keywordIds: checkedKeywordIds,
11850
11951
  allKeywordsActive: allKeywordsActive,
11851
- searchString: searchString
11952
+ searchString: searchString,
11953
+ mapLayers: mapLayers
11852
11954
  });
11853
11955
  };
11854
11956
 
@@ -11884,7 +11986,7 @@
11884
11986
  service = _a.service,
11885
11987
  isEnabled = _a.isEnabled,
11886
11988
  toggleChip = _a.toggleChip;
11887
- return /*#__PURE__*/React__namespace.createElement(CustomToggleButton, {
11989
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomToggleButton, {
11888
11990
  variant: "boxed",
11889
11991
  selected: isEnabled,
11890
11992
  tabIndex: 0,
@@ -11980,7 +12082,7 @@
11980
12082
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11981
12083
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
11982
12084
  * */
11983
- var useStyles$o = makeStyles__default["default"](function (theme) {
12085
+ var useStyles$m = makeStyles__default["default"](function (theme) {
11984
12086
  return createStyles__default["default"]({
11985
12087
  serviceChips: {
11986
12088
  width: '100%',
@@ -12004,7 +12106,7 @@
12004
12106
  fontSize: '0.875rem'
12005
12107
  },
12006
12108
  scrollArrowLeft: {
12007
- width: '120px',
12109
+ width: '100px',
12008
12110
  marginBottom: '-12px',
12009
12111
  height: '34px',
12010
12112
  backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), " + theme.palette.geowebColors.background.surfaceApp + " 51%)",
@@ -12012,7 +12114,10 @@
12012
12114
  marginRight: '-120px',
12013
12115
  "float": 'left',
12014
12116
  zIndex: 1,
12015
- position: 'relative'
12117
+ position: 'relative',
12118
+ '&:hover': {
12119
+ color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
12120
+ }
12016
12121
  },
12017
12122
  serviceList: {
12018
12123
  height: '32px',
@@ -12021,13 +12126,16 @@
12021
12126
  overflow: 'hidden'
12022
12127
  },
12023
12128
  scrollArrowRight: {
12024
- width: '120px',
12129
+ width: '100px',
12025
12130
  marginBottom: '-12px',
12026
12131
  height: '34px',
12027
12132
  backgroundImage: "linear-gradient(to right, rgba(0, 0, 0, 0), " + theme.palette.geowebColors.background.surfaceApp + " 51%)",
12028
12133
  right: '0px',
12029
12134
  position: 'fixed',
12030
- cursor: 'pointer'
12135
+ cursor: 'pointer',
12136
+ '&:hover': {
12137
+ color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
12138
+ }
12031
12139
  }
12032
12140
  });
12033
12141
  });
@@ -12052,7 +12160,7 @@
12052
12160
  var ref = React__namespace.useRef(null);
12053
12161
  var scrollSpeed = 5;
12054
12162
  var maxWidthValue = ref && ref.current && ref.current.scrollWidth && ref.current.scrollWidth >= layerSelectWidth - margin && ref.current.scrollWidth || layerSelectWidth - 50;
12055
- var classes = useStyles$o({
12163
+ var classes = useStyles$m({
12056
12164
  margin: margin,
12057
12165
  maxWidthValue: maxWidthValue
12058
12166
  });
@@ -12179,66 +12287,52 @@
12179
12287
  * See the License for the specific language governing permissions and
12180
12288
  * limitations under the License.
12181
12289
  *
12182
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12183
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
12184
- * */
12185
- var useStyles$n = makeStyles__default["default"](function (theme) {
12186
- return createStyles__default["default"]({
12187
- servicesContainer: {
12188
- width: '300px',
12189
- maxHeight: '380px',
12190
- top: '140px',
12191
- backgroundColor: theme.palette.geowebColors.background.surface,
12192
- boxShadow: theme.shadows[6],
12193
- overflow: 'auto'
12194
- },
12195
- header: {
12196
- position: 'sticky',
12197
- top: 0,
12198
- fontSize: theme.typography.fontSize,
12199
- padding: '12px',
12200
- backgroundColor: theme.palette.geowebColors.background.surface,
12201
- zIndex: 100
12202
- },
12203
- footer: {
12204
- display: 'flex',
12205
- justifyContent: 'center',
12206
- alignItems: 'center',
12207
- position: 'sticky',
12208
- bottom: 0,
12209
- backgroundColor: theme.palette.geowebColors.background.surface,
12210
- zIndex: 100
12211
- },
12212
- iconFill: {
12213
- color: theme.palette.geowebColors.typographyAndIcons.icon
12214
- },
12215
- button: {
12216
- margin: '16px',
12217
- width: '80%',
12218
- fontSize: '12px',
12219
- textTransform: 'none'
12220
- },
12221
- text: {
12222
- paddingTop: '3px',
12223
- fontSize: '12px',
12224
- fontFamily: theme.typography.fontFamily,
12225
- fontWeight: theme.typography.fontWeightRegular,
12226
- textTransform: 'none',
12227
- color: '#575f7a'
12228
- },
12229
- icon: {
12230
- width: '24px',
12231
- height: '24px'
12232
- }
12233
- });
12234
- });
12290
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12291
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
12292
+ * */
12293
+ var styles = {
12294
+ servicesContainer: {
12295
+ width: '300px',
12296
+ maxHeight: '380px',
12297
+ top: '140px',
12298
+ backgroundColor: 'geowebColors.background.surface',
12299
+ boxShadow: 6,
12300
+ overflow: 'auto'
12301
+ },
12302
+ header: {
12303
+ position: 'sticky',
12304
+ top: 0,
12305
+ fontSize: 'default',
12306
+ padding: '12px',
12307
+ backgroundColor: 'geowebColors.background.surface',
12308
+ zIndex: 100
12309
+ },
12310
+ footer: {
12311
+ display: 'flex',
12312
+ justifyContent: 'center',
12313
+ alignItems: 'center',
12314
+ position: 'sticky',
12315
+ bottom: 0,
12316
+ backgroundColor: 'geowebColors.background.surface',
12317
+ zIndex: 100
12318
+ },
12319
+ button: {
12320
+ margin: '16px',
12321
+ width: '80%',
12322
+ fontSize: '12px',
12323
+ textTransform: 'none'
12324
+ },
12325
+ icon: {
12326
+ width: '24px',
12327
+ height: '24px'
12328
+ }
12329
+ };
12235
12330
 
12236
12331
  var ServiceOptionsDialog = function ServiceOptionsDialog(_a) {
12237
12332
  var services = _a.services,
12238
12333
  mapStoreRemoveService = _a.mapStoreRemoveService,
12239
12334
  _b = _a.layers,
12240
12335
  layers = _b === void 0 ? [] : _b;
12241
- var classes = useStyles$n();
12242
12336
 
12243
12337
  var _c = __read(React__namespace.useState(false), 2),
12244
12338
  addServiceisOpen = _c[0],
@@ -12255,15 +12349,17 @@
12255
12349
  var isDisabled = function isDisabled(service) {
12256
12350
  return layers.some(function (layer) {
12257
12351
  return layer.service && layer.service.includes(service);
12352
+ }) || preloadedDefaultMapServices.some(function (defaultMapService) {
12353
+ return defaultMapService.url && defaultMapService.url.includes(service);
12258
12354
  });
12259
12355
  };
12260
12356
 
12261
12357
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(material.Box, {
12262
- className: classes.servicesContainer,
12358
+ sx: styles.servicesContainer,
12263
12359
  "data-testid": "ServiceDialog"
12264
- }, /*#__PURE__*/React__namespace.createElement("div", {
12265
- className: classes.header
12266
- }, " Services"), /*#__PURE__*/React__namespace.createElement(material.List, {
12360
+ }, /*#__PURE__*/React__namespace.createElement(material.Box, {
12361
+ sx: styles.header
12362
+ }, "Services"), /*#__PURE__*/React__namespace.createElement(material.List, {
12267
12363
  disablePadding: true
12268
12364
  }, services.map(function (service) {
12269
12365
  return /*#__PURE__*/React__namespace.createElement(material.ListItem, {
@@ -12284,14 +12380,14 @@
12284
12380
  }
12285
12381
  }, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
12286
12382
  title: "Edit Service"
12287
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
12383
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
12384
+ disabled: isDisabled(service.service),
12288
12385
  "data-testid": "openEditServiceButton",
12289
12386
  size: "large"
12290
12387
  }, /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
12291
12388
  d: "m8.332 17.09-.005.001-2.652.604.956-2.542.001-.001.001-.001.857-.744 1.69 1.945-.848.738zm.71.815L20.932 7.577 17.823 4 5.933 14.329l-.01.008.005.005L4.173 19l4.857-1.09-.004-.02.019.02-.002-.005z",
12292
- fill: classes.iconFill,
12293
12389
  fillRule: "evenodd"
12294
- }))))), /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
12390
+ })))))), /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
12295
12391
  title: "Delete Service"
12296
12392
  }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
12297
12393
  size: "large",
@@ -12302,18 +12398,17 @@
12302
12398
  "data-testid": "removeServiceButton"
12303
12399
  }, /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
12304
12400
  d: "M17.504 8.228c.588 0 1.027.48.973 1.066l-.876 9.64A1.197 1.197 0 0 1 16.434 20H8.41c-.59 0-1.115-.48-1.167-1.066l-.877-9.64a.962.962 0 0 1 .973-1.066zm-2.115 1.228a.82.82 0 0 0-.819.82v7.674a.818.818 0 0 0 1.638 0v-7.675a.819.819 0 0 0-.819-.819zm-2.968 0a.819.819 0 0 0-.819.82v7.674a.818.818 0 1 0 1.638 0v-7.675a.82.82 0 0 0-.82-.819zm-2.968 0a.819.819 0 0 0-.818.82v7.674a.818.818 0 1 0 1.637 0v-7.675a.82.82 0 0 0-.82-.819zM13.432 4c.21 0 .404.168.436.376l.107.758 3.256-.01a1.606 1.606 0 0 1 1.61 1.6l.001.535-12.841.038L6 6.76a1.605 1.605 0 0 1 1.6-1.61l3.262-.008.103-.758a.454.454 0 0 1 .434-.38z",
12305
- fill: classes.iconFill,
12306
12401
  fillRule: "evenodd"
12307
12402
  }))))))));
12308
- })), /*#__PURE__*/React__namespace.createElement("div", {
12309
- className: classes.footer
12403
+ })), /*#__PURE__*/React__namespace.createElement(material.Box, {
12404
+ sx: styles.footer
12310
12405
  }, /*#__PURE__*/React__namespace.createElement(material.Button, {
12311
12406
  onClick: openAddService,
12312
12407
  "data-testid": "openAddServiceButton",
12313
- className: classes.button,
12408
+ sx: styles.button,
12314
12409
  variant: "tertiary",
12315
12410
  startIcon: /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
12316
- className: classes.icon
12411
+ sx: styles.icon
12317
12412
  }, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
12318
12413
  d: "M13.647 13.647h6.82a1.276 1.276 0 1 0 0-2.552h-6.82v-6.82a1.276 1.276 0 1 0-2.552 0v6.82h-6.82a1.276 1.276 0 1 0 0 2.552h6.82v6.82a1.274 1.274 0 0 0 1.276 1.275c.705 0 1.276-.571 1.276-1.276v-6.82z",
12319
12414
  fillRule: "evenodd"
@@ -12378,48 +12473,12 @@
12378
12473
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12379
12474
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
12380
12475
  * */
12381
- var useStyles$m = makeStyles__default["default"](function (theme) {
12382
- return createStyles__default["default"]({
12383
- servicesContainer: {
12384
- position: 'fixed',
12385
- top: '140px',
12386
- right: '-72px',
12387
- backgroundColor: theme.palette.geowebColors.background.surface,
12388
- boxShadow: theme.shadows[6]
12389
- },
12390
- servicesText: {
12391
- paddingTop: '12px',
12392
- paddingLeft: '12px'
12393
- }
12394
- });
12395
- });
12396
12476
 
12397
12477
  var ServiceOptionsButton = function ServiceOptionsButton() {
12398
- var classes = useStyles$m();
12399
-
12400
- var _a = __read(React__namespace.useState(false), 2),
12401
- containerOpen = _a[0],
12402
- setContainerOpen = _a[1];
12403
-
12404
- var toggleContainer = function toggleContainer() {
12405
- setContainerOpen(!containerOpen);
12406
- };
12407
-
12408
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
12409
- onClick: toggleContainer,
12410
- active: containerOpen,
12411
- "data-testid": "serviceOptionsButton",
12412
- variant: "tool"
12413
- }, /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
12414
- viewBox: "0 0 24 24",
12415
- xmlns: "http://www.w3.org/2000/svg"
12416
- }, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
12417
- d: "M12 16c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0-2c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm0-6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",
12418
- fillRule: "evenodd"
12419
- })))), containerOpen ? /*#__PURE__*/React__namespace.createElement(material.Box, {
12420
- className: classes.servicesContainer,
12421
- "data-testid": "ServiceOptionsDialogContainer"
12422
- }, /*#__PURE__*/React__namespace.createElement(ServiceOptionsDialogConnect, null)) : null);
12478
+ return /*#__PURE__*/React__namespace.createElement(shared.ToggleMenu, {
12479
+ buttonTestId: "serviceOptionsButton",
12480
+ menuPosition: "bottom"
12481
+ }, /*#__PURE__*/React__namespace.createElement(ServiceOptionsDialogConnect, null));
12423
12482
  };
12424
12483
 
12425
12484
  /* *
@@ -12526,6 +12585,7 @@
12526
12585
  })), /*#__PURE__*/React__namespace.createElement("div", {
12527
12586
  className: classes.layerSelectContainer
12528
12587
  }, /*#__PURE__*/React__namespace.createElement(LayerListConnect, {
12588
+ mapId: mapId,
12529
12589
  layerSelectHeight: height
12530
12590
  })));
12531
12591
  };
@@ -13209,7 +13269,7 @@
13209
13269
  isActive = _c === void 0 ? false : _c,
13210
13270
  props = __rest(_a, ["onClick", "children", "title", "placement", "isActive"]);
13211
13271
 
13212
- return /*#__PURE__*/React__namespace.createElement(ToolButton, __assign({
13272
+ return /*#__PURE__*/React__namespace.createElement(shared.ToolButton, __assign({
13213
13273
  onClick: onClick,
13214
13274
  active: isActive
13215
13275
  }, props), /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
@@ -14120,7 +14180,7 @@
14120
14180
  title: autoUpdateButton.title
14121
14181
  }, /*#__PURE__*/React__namespace.createElement("span", {
14122
14182
  "data-testid": "autoUpdateButtonTooltip"
14123
- }, /*#__PURE__*/React__namespace.createElement(ToolButton, {
14183
+ }, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14124
14184
  active: isAutoUpdating,
14125
14185
  disabled: disabled,
14126
14186
  onClick: function onClick() {
@@ -14184,7 +14244,7 @@
14184
14244
  var loopButtonPath = isLooping ? svgLoopOffPath : svgLoopPath;
14185
14245
  return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
14186
14246
  title: loopButtonPath.title
14187
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
14247
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14188
14248
  onClick: function onClick() {
14189
14249
  return onToggleLoop();
14190
14250
  },
@@ -14296,7 +14356,7 @@
14296
14356
  className: classes.speedButtonDiv
14297
14357
  }, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
14298
14358
  title: "Speed"
14299
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
14359
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14300
14360
  onClick: onClickButton,
14301
14361
  active: true,
14302
14362
  "data-testid": "speedButton"
@@ -14588,7 +14648,7 @@
14588
14648
  className: classes.timeStepDiv
14589
14649
  }, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
14590
14650
  title: "Time step"
14591
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
14651
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14592
14652
  active: true,
14593
14653
  onClick: onClickButton,
14594
14654
  "data-testid": "timeStepButton",
@@ -14694,7 +14754,7 @@
14694
14754
  var id = open ? 'simple-popover' : undefined;
14695
14755
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
14696
14756
  title: "Options"
14697
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
14757
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14698
14758
  onClick: onClickButton,
14699
14759
  "data-testid": "optionsMenuButton",
14700
14760
  active: open
@@ -14783,7 +14843,7 @@
14783
14843
  var playButtonPath = isAnimating ? pausePath : playPath;
14784
14844
  return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
14785
14845
  title: playButtonPath.title
14786
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
14846
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14787
14847
  onClick: onTogglePlay,
14788
14848
  disabled: isDisabled,
14789
14849
  "data-testid": "playButton",
@@ -15439,13 +15499,15 @@
15439
15499
  }
15440
15500
  };
15441
15501
 
15442
- var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale) {
15502
+ var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale) {
15443
15503
  var ctx = context;
15444
15504
  var _a = theme.palette.geowebColors.timeSlider,
15445
15505
  timelineTimelineSurface = _a.timelineTimelineSurface,
15446
15506
  timelineNightTime = _a.timelineNightTime;
15447
15507
  ctx.fillStyle = timelineTimelineSurface.fill;
15448
15508
  ctx.fillRect(0, 0, canvasWidth, height);
15509
+ ctx.fillStyle = theme.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
15510
+ ctx.fillRect(animationStartPx, 0, Math.max(animationEndPx - animationStartPx, 0), height);
15449
15511
  var colorChangeUnit = getColorChangeTimestepUnit(scale);
15450
15512
 
15451
15513
  var _b = __read(getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, colorChangeUnit), 2),
@@ -15539,7 +15601,7 @@
15539
15601
  drawLeftSideDateText(ctx, theme, dateText, height);
15540
15602
  };
15541
15603
 
15542
- var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix) {
15604
+ var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix, animationStartTime, animationEndTime) {
15543
15605
  var ctx = context;
15544
15606
 
15545
15607
  var _a = __read([0, canvasWidth].map(function (px) {
@@ -15548,7 +15610,13 @@
15548
15610
  visibleTimeStart = _a[0],
15549
15611
  visibleTimeEnd = _a[1];
15550
15612
 
15551
- drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale);
15613
+ var _b = __read([animationStartTime, animationEndTime].map(function (time) {
15614
+ return timestampToPixel(time, centerTime, canvasWidth, secondsPerPx);
15615
+ }), 2),
15616
+ animationStartPx = _b[0],
15617
+ animationEndPx = _b[1];
15618
+
15619
+ drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale);
15552
15620
  drawTimeScale(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale, dataScaleToSecondsPerPx);
15553
15621
  drawNeedle(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, selectedTimeUnix);
15554
15622
  drawCurrentTime(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, currentTimeUnix);
@@ -15961,6 +16029,12 @@
15961
16029
 
15962
16030
  var NEEDLE_HANDLE_WIDTH = 10;
15963
16031
  var LEFT_MOUSE_BTN = 1;
16032
+ var THROTTLE_WAIT_TIME = 500; // [ms]
16033
+
16034
+ var THROTTLE_OPTIONS = {
16035
+ trailing: false // Invoke function when called, but not more than once every <THROTTLE_WAIT_TIME>.
16036
+
16037
+ };
15964
16038
 
15965
16039
  var TimeSliderLegend = function TimeSliderLegend(_a) {
15966
16040
  var centerTime = _a.centerTime,
@@ -15973,6 +16047,8 @@
15973
16047
  currentTime = _a.currentTime,
15974
16048
  dataStartTime = _a.dataStartTime,
15975
16049
  dataEndTime = _a.dataEndTime,
16050
+ animationStartTime = _a.animationStartTime,
16051
+ animationEndTime = _a.animationEndTime,
15976
16052
  isTimeSliderHoverOn = _a.isTimeSliderHoverOn,
15977
16053
  timeStep = _a.timeStep,
15978
16054
  onSetNewDate = _a.onSetNewDate,
@@ -15996,6 +16072,18 @@
15996
16072
  isNewSelectionTimeRequested = _g[0],
15997
16073
  setNewSelectionTimeRequested = _g[1];
15998
16074
 
16075
+ var _h = __read(React__namespace.useState(animationStartTime && moment__default["default"].utc(animationStartTime).unix()), 2),
16076
+ localAnimationStartTime = _h[0],
16077
+ setLocalAnimationStartTime = _h[1];
16078
+
16079
+ var _j = __read(React__namespace.useState(animationEndTime && moment__default["default"].utc(animationEndTime).unix()), 2),
16080
+ localAnimationEndTime = _j[0],
16081
+ setLocalAnimationEndTime = _j[1];
16082
+
16083
+ React__namespace.useEffect(function () {
16084
+ setLocalAnimationStartTime(animationStartTime && moment__default["default"].utc(animationStartTime).unix());
16085
+ setLocalAnimationEndTime(animationEndTime && moment__default["default"].utc(animationEndTime).unix());
16086
+ }, [animationStartTime, animationEndTime]);
15999
16087
  React__namespace.useEffect(function () {
16000
16088
  var handleKeyDown = function handleKeyDown(event) {
16001
16089
  if (event.key === 'Home') {
@@ -16025,7 +16113,21 @@
16025
16113
  setNewRoundedTime(x, centerTime, width, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
16026
16114
  };
16027
16115
 
16028
- var theme = material.useTheme();
16116
+ var theme = material.useTheme(); // eslint-disable-next-line react-hooks/exhaustive-deps
16117
+
16118
+ var throttledZoom = React__namespace.useCallback(_.throttle(function (newSecondsPerPx, newCenterTime) {
16119
+ onZoom(newSecondsPerPx, newCenterTime);
16120
+ }, THROTTLE_WAIT_TIME, THROTTLE_OPTIONS), []);
16121
+
16122
+ var zoom = function zoom(deltaY, deltaX, canvasWidth, mouseX) {
16123
+ if (!onZoom) return;
16124
+ var direction = deltaY || deltaX;
16125
+ var newSecondsPerPx = getNextSecondsPerPxValue(Math.sign(direction), secondsPerPx, dataScaleToSecondsPerPx);
16126
+ var mouseTime = pixelToTimestamp(mouseX, centerTime, canvasWidth, secondsPerPx);
16127
+ var newCenterTime = getNewCenterOfFixedPointZoom(mouseTime, secondsPerPx, newSecondsPerPx, centerTime);
16128
+ throttledZoom(newSecondsPerPx, newCenterTime);
16129
+ };
16130
+
16029
16131
  return /*#__PURE__*/React__namespace.createElement("div", {
16030
16132
  className: classes.timeSliderLegend,
16031
16133
  "data-testid": "timeSliderLegend"
@@ -16057,12 +16159,7 @@
16057
16159
  deltaX = _a.deltaX,
16058
16160
  canvasWidth = _a.canvasWidth,
16059
16161
  mouseX = _a.mouseX;
16060
- if (!onZoom) return;
16061
- var direction = deltaY || deltaX;
16062
- var newSecondsPerPx = getNextSecondsPerPxValue(Math.sign(direction), secondsPerPx, dataScaleToSecondsPerPx);
16063
- var mouseTime = pixelToTimestamp(mouseX, centerTime, canvasWidth, secondsPerPx);
16064
- var newCenterTime = getNewCenterOfFixedPointZoom(mouseTime, secondsPerPx, newSecondsPerPx, centerTime);
16065
- onZoom(newSecondsPerPx, newCenterTime);
16162
+ zoom(deltaY, deltaX, canvasWidth, mouseX);
16066
16163
  },
16067
16164
  onMouseDown: function onMouseDown(x, y, width) {
16068
16165
  setDragged(false);
@@ -16084,7 +16181,7 @@
16084
16181
  }
16085
16182
  },
16086
16183
  onRenderCanvas: function onRenderCanvas(ctx, width, height) {
16087
- renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime);
16184
+ renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime, localAnimationStartTime, localAnimationEndTime);
16088
16185
  }
16089
16186
  }));
16090
16187
  };
@@ -16376,6 +16473,9 @@
16376
16473
  var svgIconPath = new Path2D('M8.843 1.029c-.56 0-.814.362-.814.699 0 .179.065.36.19.54l3.06 4.34c.065.093.14.171.221.234v8.373c-.082.064-.156.142-.22.234L8.219 19.79c-.125.18-.19.361-.19.54 0 .337.255.699.814.699h6.373c.56 0 .813-.361.813-.7 0-.178-.064-.36-.19-.538l-3.06-4.343c-.08-.112-.174-.204-.278-.273V6.883c.104-.069.199-.16.278-.273l3.06-4.343c.126-.179.19-.36.19-.539 0-.338-.254-.7-.813-.7z');
16377
16474
  ctx.fillStyle = playerTimeMarkers.fill;
16378
16475
  ctx.fill(svgIconPath);
16476
+ ctx.strokeStyle = theme.palette.geowebColors.timeSlider.playerNeedlePlayer.rgba;
16477
+ ctx.lineWidth = 1;
16478
+ ctx.stroke(svgIconPath);
16379
16479
  ctx.restore();
16380
16480
  };
16381
16481
 
@@ -17170,10 +17270,10 @@
17170
17270
  var animationIntervalDefault = 5;
17171
17271
  var connectRedux$3 = reactRedux.connect(function (store, props) {
17172
17272
  return {
17173
- isAnimating: isAnimating(store, props.mapId),
17174
17273
  animationStartTime: getAnimationStartTime(store, props.mapId),
17175
17274
  animationEndTime: getAnimationEndTime(store, props.mapId),
17176
- timeStep: getMapTimeStep(store, props.mapId)
17275
+ timeStep: getMapTimeStep(store, props.mapId),
17276
+ linkedMapAnimationInfo: linkedMapAnimationInfo(store, props.mapId)
17177
17277
  };
17178
17278
  }, {
17179
17279
  mapStartAnimation: mapStartAnimation,
@@ -17181,19 +17281,19 @@
17181
17281
  });
17182
17282
  var PlayButtonConnect = connectRedux$3(function (_a) {
17183
17283
  var mapId = _a.mapId,
17184
- isAnimating = _a.isAnimating,
17185
17284
  animationStartTime = _a.animationStartTime,
17186
17285
  animationEndTime = _a.animationEndTime,
17187
17286
  isDisabled = _a.isDisabled,
17188
17287
  timeStep = _a.timeStep,
17288
+ linkedMapAnimationInfo = _a.linkedMapAnimationInfo,
17189
17289
  mapStartAnimation = _a.mapStartAnimation,
17190
17290
  mapStopAnimation = _a.mapStopAnimation;
17191
17291
  var animationInterval = timeStep || animationIntervalDefault;
17192
17292
 
17193
17293
  var onTogglePlay = function onTogglePlay() {
17194
- if (isAnimating) {
17294
+ if (linkedMapAnimationInfo.isAnimating) {
17195
17295
  mapStopAnimation({
17196
- mapId: mapId
17296
+ mapId: linkedMapAnimationInfo.id
17197
17297
  });
17198
17298
  } else {
17199
17299
  mapStartAnimation({
@@ -17206,7 +17306,7 @@
17206
17306
  };
17207
17307
 
17208
17308
  return /*#__PURE__*/React__default["default"].createElement(PlayButton, {
17209
- isAnimating: isAnimating,
17309
+ isAnimating: linkedMapAnimationInfo.isAnimating,
17210
17310
  isDisabled: isDisabled,
17211
17311
  onTogglePlayButton: function onTogglePlayButton() {
17212
17312
  onTogglePlay();
@@ -17263,52 +17363,6 @@
17263
17363
  });
17264
17364
  };
17265
17365
 
17266
- /* *
17267
- * Licensed under the Apache License, Version 2.0 (the "License");
17268
- * you may not use this file except in compliance with the License.
17269
- * You may obtain a copy of the License at
17270
- *
17271
- * http://www.apache.org/licenses/LICENSE-2.0
17272
- *
17273
- * Unless required by applicable law or agreed to in writing, software
17274
- * distributed under the License is distributed on an "AS IS" BASIS,
17275
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17276
- * See the License for the specific language governing permissions and
17277
- * limitations under the License.
17278
- *
17279
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17280
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17281
- * */
17282
-
17283
- var synchronizationGroupStore = function synchronizationGroupStore(store) {
17284
- return store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
17285
- };
17286
-
17287
- var getSynchronizationGroupStore = reselect.createSelector(synchronizationGroupStore, function (store) {
17288
- return store;
17289
- });
17290
- /**
17291
- * Returns the synchronization source by id
17292
- * @param store The app store
17293
- * @param id The source id to find
17294
- */
17295
-
17296
- var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
17297
- if (state && state.sources) {
17298
- var sources = state.sources;
17299
-
17300
- if (sources.byId[id]) {
17301
- return sources.byId[id];
17302
- }
17303
- }
17304
-
17305
- return null;
17306
- };
17307
-
17308
- var getTime = reselect.createSelector(getSyncSourceBySourceId, function (store) {
17309
- return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
17310
- });
17311
-
17312
17366
  /* *
17313
17367
  * Licensed under the Apache License, Version 2.0 (the "License");
17314
17368
  * you may not use this file except in compliance with the License.
@@ -17336,7 +17390,9 @@
17336
17390
  isAnimating: isAnimating(store, props.mapId),
17337
17391
  timeStep: getMapTimeStep(store, props.mapId),
17338
17392
  isTimeSliderHoverOn: isTimeSliderHoverOn(store, props.mapId),
17339
- timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId)
17393
+ timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId),
17394
+ animationStartTime: getAnimationStartTime(store, props.mapId),
17395
+ animationEndTime: getAnimationEndTime(store, props.mapId)
17340
17396
  };
17341
17397
  }, {
17342
17398
  stopMapAnimation: mapStopAnimation,
@@ -17359,6 +17415,8 @@
17359
17415
  isAnimating = _a.isAnimating,
17360
17416
  timeStep = _a.timeStep,
17361
17417
  isTimeSliderHoverOn = _a.isTimeSliderHoverOn,
17418
+ animationStartTime = _a.animationStartTime,
17419
+ animationEndTime = _a.animationEndTime,
17362
17420
  stopMapAnimation = _a.stopMapAnimation,
17363
17421
  setTime = _a.setTime,
17364
17422
  syncGroupAddSource = _a.syncGroupAddSource,
@@ -17393,6 +17451,8 @@
17393
17451
  isTimeSliderHoverOn: isTimeSliderHoverOn,
17394
17452
  dataStartTime: dataStartTime,
17395
17453
  dataEndTime: dataEndTime,
17454
+ animationStartTime: animationStartTime,
17455
+ animationEndTime: animationEndTime,
17396
17456
  timeStep: timeStep,
17397
17457
  onSetNewDate: function onSetNewDate(newDate) {
17398
17458
  if (isAnimating) {
@@ -17826,7 +17886,7 @@
17826
17886
  };
17827
17887
  var ECMWFPublicService = {
17828
17888
  name: 'ECMWF',
17829
- url: 'https://apps.ecmwf.int/wms/?token=public',
17889
+ url: 'https://eccharts.ecmwf.int/wms/?token=public',
17830
17890
  id: 'ecmwf'
17831
17891
  };
17832
17892
  var MeteoCanada = {
@@ -21214,6 +21274,14 @@
21214
21274
  });
21215
21275
  }
21216
21276
  }
21277
+ /* Set disable map pin */
21278
+
21279
+
21280
+ if (!prevProps || prevProps.disableMapPin !== props.disableMapPin) {
21281
+ if (!(props.disableMapPin === undefined)) {
21282
+ this.adaguc.webMapJS.getMapPin().toggleDisableMapPin();
21283
+ }
21284
+ }
21217
21285
  /* Change the animation delay */
21218
21286
 
21219
21287
 
@@ -21857,6 +21925,9 @@
21857
21925
  var mapPinLocation = reactRedux.useSelector(function (store) {
21858
21926
  return getPinLocation(store, mapId);
21859
21927
  });
21928
+ var disableMapPin = reactRedux.useSelector(function (store) {
21929
+ return getDisableMapPin(store, mapId);
21930
+ });
21860
21931
  var dispatch = reactRedux.useDispatch();
21861
21932
  var map = getWMJSMapById(mapId);
21862
21933
  var mapChangeDimension$1 = React__namespace.useCallback(function (mapDimensionPayload) {
@@ -21928,6 +21999,7 @@
21928
21999
  activeLayerId: activeLayerId,
21929
22000
  animationDelay: animationDelay,
21930
22001
  displayMapPin: displayMapPin,
22002
+ disableMapPin: disableMapPin,
21931
22003
  onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
21932
22004
  if (mapDimensionPayload && mapDimensionPayload.dimension && mapDimensionPayload.dimension.name && mapDimensionPayload.dimension.name === 'time') {
21933
22005
  setTime$1({
@@ -22562,7 +22634,9 @@
22562
22634
  _k = _a.shouldShowZoomControls,
22563
22635
  shouldShowZoomControls = _k === void 0 ? false : _k,
22564
22636
  _l = _a.displayMapPin,
22565
- displayMapPin = _l === void 0 ? false : _l;
22637
+ displayMapPin = _l === void 0 ? false : _l,
22638
+ toggleTimestepAuto$1 = _a.toggleTimestepAuto,
22639
+ setTimestep = _a.setTimestep;
22566
22640
  var classes = useStyles$4();
22567
22641
  var dispatch = reactRedux.useDispatch();
22568
22642
  var mapId = React__default["default"].useRef(id || generateMapId()).current;
@@ -22633,6 +22707,22 @@
22633
22707
  timestepAuto: false
22634
22708
  }));
22635
22709
  }
22710
+ } // Set timestep auto based on preset
22711
+
22712
+
22713
+ if (toggleTimestepAuto$1 !== undefined && shouldAnimate !== true) {
22714
+ dispatch(toggleTimestepAuto({
22715
+ mapId: mapId,
22716
+ timestepAuto: toggleTimestepAuto$1
22717
+ }));
22718
+ } // Set timestep value based on preset
22719
+
22720
+
22721
+ if (setTimestep !== undefined && shouldAnimate !== true) {
22722
+ dispatch(setTimeStep({
22723
+ mapId: mapId,
22724
+ timeStep: setTimestep
22725
+ }));
22636
22726
  } // eslint-disable-next-line react-hooks/exhaustive-deps
22637
22727
 
22638
22728
  }, []);
@@ -23011,7 +23101,11 @@
23011
23101
  _h = _a.animationPayload,
23012
23102
  animationPayload = _h === void 0 ? undefined : _h,
23013
23103
  _j = _a.displayMapPin,
23014
- displayMapPin = _j === void 0 ? false : _j;
23104
+ displayMapPin = _j === void 0 ? false : _j,
23105
+ _k = _a.showTimeSlider,
23106
+ showTimeSlider = _k === void 0 ? true : _k,
23107
+ toggleTimestepAuto = _a.toggleTimestepAuto,
23108
+ setTimestep = _a.setTimestep;
23015
23109
  var classes = useStyles$2();
23016
23110
  return /*#__PURE__*/React__default["default"].createElement("div", {
23017
23111
  className: classes.mapSliderConnect,
@@ -23020,7 +23114,7 @@
23020
23114
  className: classes.zoomControls
23021
23115
  }, /*#__PURE__*/React__default["default"].createElement(ZoomControlConnect, {
23022
23116
  mapId: id
23023
- })), /*#__PURE__*/React__default["default"].createElement("div", {
23117
+ })), showTimeSlider && /*#__PURE__*/React__default["default"].createElement("div", {
23024
23118
  className: classes.timeSlider
23025
23119
  }, /*#__PURE__*/React__default["default"].createElement(TimeSliderConnect, {
23026
23120
  mapId: id,
@@ -23038,7 +23132,9 @@
23038
23132
  shouldAnimate: shouldAnimate,
23039
23133
  animationPayload: animationPayload,
23040
23134
  shouldShowZoomControls: shouldShowZoomControls,
23041
- displayMapPin: displayMapPin
23135
+ displayMapPin: displayMapPin,
23136
+ toggleTimestepAuto: toggleTimestepAuto,
23137
+ setTimestep: setTimestep
23042
23138
  }));
23043
23139
  };
23044
23140
 
@@ -23260,11 +23356,7 @@
23260
23356
  return removeGroup(groupObject.id);
23261
23357
  },
23262
23358
  size: "large"
23263
- }, index === 0 ? /*#__PURE__*/React__namespace.createElement(iconsMaterial.Add, {
23264
- className: classes.iconColor
23265
- }) : /*#__PURE__*/React__namespace.createElement(iconsMaterial.DeleteForever, {
23266
- className: classes.iconColor
23267
- })))), /*#__PURE__*/React__namespace.createElement(SyncGroupListItem, {
23359
+ }, index === 0 ? /*#__PURE__*/React__namespace.createElement(iconsMaterial.Add, null) : /*#__PURE__*/React__namespace.createElement(iconsMaterial.DeleteForever, null)))), /*#__PURE__*/React__namespace.createElement(SyncGroupListItem, {
23268
23360
  viewStateData: viewStateData,
23269
23361
  groupId: groupObject.id,
23270
23362
  selected: groupObject.selected,
@@ -23290,110 +23382,10 @@
23290
23382
  backgroundColor: theme.palette.geowebColors.syncGroups.drawerOpen.fill,
23291
23383
  boxShadow: 'inset 0px 7px 7px -7px, inset 0px -7px 7px -7px',
23292
23384
  color: '#000000'
23293
- },
23294
- iconColor: {
23295
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
23296
23385
  }
23297
23386
  });
23298
23387
  });
23299
23388
 
23300
- /* *
23301
- * Licensed under the Apache License, Version 2.0 (the "License");
23302
- * you may not use this file except in compliance with the License.
23303
- * You may obtain a copy of the License at
23304
- *
23305
- * http://www.apache.org/licenses/LICENSE-2.0
23306
- *
23307
- * Unless required by applicable law or agreed to in writing, software
23308
- * distributed under the License is distributed on an "AS IS" BASIS,
23309
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23310
- * See the License for the specific language governing permissions and
23311
- * limitations under the License.
23312
- *
23313
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23314
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
23315
- * */
23316
- var emptyState = {
23317
- timeslider: {
23318
- groups: [],
23319
- sourcesById: []
23320
- },
23321
- zoompane: {
23322
- groups: [],
23323
- sourcesById: []
23324
- },
23325
- level: {
23326
- groups: [],
23327
- sourcesById: []
23328
- }
23329
- };
23330
- var groupTypes = [{
23331
- title: 'Timeslider',
23332
- syncType: 'SYNCGROUPS_TYPE_SETTIME',
23333
- groupType: 'timeslider'
23334
- }, {
23335
- title: 'Zoompane',
23336
- syncType: 'SYNCGROUPS_TYPE_SETBBOX',
23337
- groupType: 'zoompane'
23338
- }];
23339
- /*
23340
- _____ Creates viewState _____
23341
- - Runs Each time viewState is created:
23342
- - Fill arrays inside initialState with objects containing new values from Redux
23343
- */
23344
-
23345
- var createSyncGroupViewState = function createSyncGroupViewState(syncState) {
23346
- var initialState = produce__default["default"](emptyState, function (draft) {
23347
- /*
23348
- _____ 1. Fill groups _____
23349
- 1. Goes through all groups by ID
23350
- 2. Collects original timeslider or zoompane values into an array
23351
- 3. Sorts and adds selected sources to ViewState based on ID type
23352
- */
23353
- Object.keys(syncState.groups.byId).forEach(function (id) {
23354
- var _a;
23355
-
23356
- var groupType = (_a = groupTypes.find(function (object) {
23357
- return object.syncType === syncState.groups.byId[id].type;
23358
- })) === null || _a === void 0 ? void 0 : _a.groupType;
23359
-
23360
- if (groupType) {
23361
- draft[groupType].groups.push({
23362
- id: id,
23363
- selected: syncState.groups.byId[id].targets.allIds
23364
- });
23365
- }
23366
- });
23367
- /*
23368
- _____ 2. Fill sourcesById _____
23369
- 1. Loop though sources and add source to each group type
23370
- */
23371
-
23372
- Object.keys(syncState.sources.byId).forEach(function (id) {
23373
- groupTypes.forEach(function (_a) {
23374
- var syncType = _a.syncType,
23375
- groupType = _a.groupType;
23376
-
23377
- if (syncState.sources.byId[id].types.includes(syncType)) {
23378
- draft[groupType].sourcesById.push({
23379
- id: id,
23380
- name: id
23381
- });
23382
- }
23383
- });
23384
- });
23385
- });
23386
- return initialState;
23387
- }; // TODO
23388
- // Improve selector to reduce unnecessary re-rendering
23389
- // https://gitlab.com/opengeoweb/opengeoweb/-/issues/1333
23390
-
23391
- var syncState = function syncState(store) {
23392
- return store.syncronizationGroupStore;
23393
- };
23394
-
23395
- var createSyncGroupViewStateSelector = reselect.createSelector(syncState, createSyncGroupViewState);
23396
-
23397
23389
  /* *
23398
23390
  * Licensed under the Apache License, Version 2.0 (the "License");
23399
23391
  * you may not use this file except in compliance with the License.
@@ -23417,7 +23409,10 @@
23417
23409
  syncGroupAddTarget = _a.syncGroupAddTarget,
23418
23410
  syncGroupRemoveTarget = _a.syncGroupRemoveTarget,
23419
23411
  syncGroupAddGroup = _a.syncGroupAddGroup,
23420
- syncGroupRemoveGroup = _a.syncGroupRemoveGroup;
23412
+ syncGroupRemoveGroup = _a.syncGroupRemoveGroup,
23413
+ onMouseDown = _a.onMouseDown,
23414
+ _b = _a.order,
23415
+ order = _b === void 0 ? 0 : _b;
23421
23416
  /*
23422
23417
  _____ Handle Toggle _____
23423
23418
  - Handles checking, unchecking and toggling between in groups
@@ -23522,7 +23517,9 @@
23522
23517
  headerSize: "medium",
23523
23518
  isOpen: isOpen,
23524
23519
  onClose: onClose,
23525
- "data-testid": "syncGroupViewer"
23520
+ "data-testid": "syncGroupViewer",
23521
+ onMouseDown: onMouseDown,
23522
+ order: order
23526
23523
  }, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(SyncGroupList, {
23527
23524
  viewStateData: syncGroupViewState.zoompane,
23528
23525
  title: "ZoomPane",
@@ -23578,14 +23575,12 @@
23578
23575
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23579
23576
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
23580
23577
  * */
23581
- var SyncGroupViewerConnect = function SyncGroupViewerConnect(_a) {
23582
- var onClose = _a.onClose,
23583
- isOpen = _a.isOpen;
23578
+ var SyncGroupViewerConnect = function SyncGroupViewerConnect() {
23584
23579
  var dispatch = reactRedux.useDispatch(); // TODO
23585
23580
  // Improve the selector to prevent re-renders
23586
23581
  // For example dusting anination syncgroups should not re-render
23587
23582
 
23588
- var viewState = reactRedux.useSelector(createSyncGroupViewStateSelector);
23583
+ var viewState = reactRedux.useSelector(syncGroupGetViewState);
23589
23584
  var syncGroupAddGroup$1 = React__namespace.useCallback(function (payload) {
23590
23585
  return dispatch(syncGroupAddGroup(payload));
23591
23586
  }, [dispatch]);
@@ -23598,14 +23593,55 @@
23598
23593
  var syncGroupRemoveTarget$1 = React__namespace.useCallback(function (payload) {
23599
23594
  return dispatch(syncGroupRemoveTarget(payload));
23600
23595
  }, [dispatch]);
23596
+ var isOpenInStore = reactRedux.useSelector(function (store) {
23597
+ return getisDialogOpen(store, 'syncGroups');
23598
+ });
23599
+ var onClose = React__namespace.useCallback(function () {
23600
+ return dispatch(setToggleOpenDialog({
23601
+ type: 'syncGroups',
23602
+ setOpen: false
23603
+ }));
23604
+ }, [dispatch]);
23605
+ var uiOrder = reactRedux.useSelector(function (store) {
23606
+ return getDialogOrder(store, 'syncGroups');
23607
+ });
23608
+ var uiIsOrderedOnTop = reactRedux.useSelector(function (store) {
23609
+ return getDialogIsOrderedOnTop(store, 'syncGroups');
23610
+ });
23611
+ var registerDialog$1 = React__namespace.useCallback(function () {
23612
+ return dispatch(registerDialog({
23613
+ type: 'syncGroups',
23614
+ setOpen: false
23615
+ }));
23616
+ }, [dispatch]);
23617
+ var unregisterDialog$1 = React__namespace.useCallback(function () {
23618
+ return dispatch(unregisterDialog({
23619
+ type: 'syncGroups'
23620
+ }));
23621
+ }, [dispatch]);
23622
+ var onOrderDialog = React__namespace.useCallback(function () {
23623
+ if (!uiIsOrderedOnTop) {
23624
+ dispatch(orderDialog({
23625
+ type: 'syncGroups'
23626
+ }));
23627
+ }
23628
+ }, [dispatch, uiIsOrderedOnTop]);
23629
+ React__namespace.useEffect(function () {
23630
+ registerDialog$1();
23631
+ return function () {
23632
+ unregisterDialog$1();
23633
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
23634
+ }, []);
23601
23635
  return /*#__PURE__*/React__namespace.createElement(SyncGroupViewer, {
23602
23636
  onClose: onClose,
23603
- isOpen: isOpen,
23637
+ isOpen: isOpenInStore,
23604
23638
  syncGroupViewState: viewState,
23605
23639
  syncGroupAddTarget: syncGroupAddTarget$1,
23606
23640
  syncGroupRemoveTarget: syncGroupRemoveTarget$1,
23607
23641
  syncGroupAddGroup: syncGroupAddGroup$1,
23608
- syncGroupRemoveGroup: syncGroupRemoveGroup$1
23642
+ syncGroupRemoveGroup: syncGroupRemoveGroup$1,
23643
+ order: uiOrder,
23644
+ onMouseDown: onOrderDialog
23609
23645
  });
23610
23646
  };
23611
23647
 
@@ -23850,8 +23886,9 @@
23850
23886
  exports.layerReducer = reducer$6;
23851
23887
  exports.makeMapPreset = makeMapPreset;
23852
23888
  exports.mapActions = actions$3;
23853
- exports.mapConstants = constants$1;
23854
- exports.mapSelectors = selectors;
23889
+ exports.mapConstants = constants;
23890
+ exports.mapModuleConfig = moduleConfig;
23891
+ exports.mapSelectors = selectors$1;
23855
23892
  exports.mapTypes = types$2;
23856
23893
  exports.mapUtils = utils;
23857
23894
  exports.publicLayers = publicLayers;
@@ -23863,6 +23900,8 @@
23863
23900
  exports.synchronizationGroupModuleConfig = synchronizationGroupConfig;
23864
23901
  exports.testLayers = testLayers;
23865
23902
  exports.uiActions = actions$2;
23903
+ exports.uiModuleConfig = uiModuleConfig;
23904
+ exports.uiSelectors = selectors;
23866
23905
  exports.uiTypes = types$1;
23867
23906
  exports.useStyles = useStyles$3;
23868
23907