@opengeoweb/core 4.18.0 → 4.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@reduxjs/toolkit'), require('immer'), require('moment'), require('react'), require('lodash'), require('redux-saga/effects'), require('react-redux'), require('@opengeoweb/shared'), require('@opengeoweb/theme'), require('@mui/material'), require('@opengeoweb/webmap'), require('react-sortablejs'), require('sortablejs'), require('react-window'), require('@mui/material/Box'), require('@mui/material/Typography'), require('@mui/material/Grid'), require('@opengeoweb/form-fields'), require('react-hook-form'), require('@mui/system'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('react-draggable'), require('re-resizable'), require('axios'), require('@opengeoweb/api'), require('@redux-eggs/redux-toolkit'), require('@redux-eggs/saga-extension'), require('react-router-dom')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@reduxjs/toolkit', 'immer', 'moment', 'react', 'lodash', 'redux-saga/effects', 'react-redux', '@opengeoweb/shared', '@opengeoweb/theme', '@mui/material', '@opengeoweb/webmap', 'react-sortablejs', 'sortablejs', 'react-window', '@mui/material/Box', '@mui/material/Typography', '@mui/material/Grid', '@opengeoweb/form-fields', 'react-hook-form', '@mui/system', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'react-draggable', 're-resizable', 'axios', '@opengeoweb/api', '@redux-eggs/redux-toolkit', '@redux-eggs/saga-extension', 'react-router-dom'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.toolkit, global.produce, global.moment, global.React, global._, global.effects, global.reactRedux, global.shared, global.theme, global.material, global.webmap, global.reactSortablejs, global.Sortable, global.reactWindow, global.Box, global.Typography, global.Grid, global.formFields, global.reactHookForm, global.system, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.Draggable, global.reResizable, global.axios, global.api, global.reduxToolkit, global.sagaExtension, global.reactRouterDom));
5
- })(this, (function (exports, toolkit, produce, moment, React, _, effects, reactRedux, shared, theme, material, webmap, reactSortablejs, Sortable, reactWindow, Box, Typography, Grid, formFields, reactHookForm, system, throttleDebounce, cloneDeep, proj4, turf, Draggable, reResizable, axios, api, reduxToolkit, sagaExtension, reactRouterDom) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@reduxjs/toolkit'), require('immer'), require('moment'), require('react'), require('lodash'), require('redux-saga/effects'), require('react-redux'), require('@opengeoweb/shared'), require('@opengeoweb/theme'), require('@mui/material'), require('@opengeoweb/webmap'), require('react-sortablejs'), require('sortablejs'), require('react-window'), require('@mui/material/Box'), require('@mui/material/Typography'), require('@mui/material/Grid'), require('@opengeoweb/form-fields'), require('react-hook-form'), require('@mui/system'), require('react-resize-detector'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('react-draggable'), require('re-resizable'), require('axios'), require('@opengeoweb/api'), require('@redux-eggs/redux-toolkit'), require('@redux-eggs/saga-extension'), require('react-router-dom')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@reduxjs/toolkit', 'immer', 'moment', 'react', 'lodash', 'redux-saga/effects', 'react-redux', '@opengeoweb/shared', '@opengeoweb/theme', '@mui/material', '@opengeoweb/webmap', 'react-sortablejs', 'sortablejs', 'react-window', '@mui/material/Box', '@mui/material/Typography', '@mui/material/Grid', '@opengeoweb/form-fields', 'react-hook-form', '@mui/system', 'react-resize-detector', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'react-draggable', 're-resizable', 'axios', '@opengeoweb/api', '@redux-eggs/redux-toolkit', '@redux-eggs/saga-extension', 'react-router-dom'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.toolkit, global.produce, global.moment, global.React, global._, global.effects, global.reactRedux, global.shared, global.theme, global.material, global.webmap, global.reactSortablejs, global.Sortable, global.reactWindow, global.Box, global.Typography, global.Grid, global.formFields, global.reactHookForm, global.system, global.reactResizeDetector, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.Draggable, global.reResizable, global.axios, global.api, global.reduxToolkit, global.sagaExtension, global.reactRouterDom));
5
+ })(this, (function (exports, toolkit, produce, moment, React, _, effects, reactRedux, shared, theme, material, webmap, reactSortablejs, Sortable, reactWindow, Box, Typography, Grid, formFields, reactHookForm, system, reactResizeDetector, throttleDebounce, cloneDeep, proj4, turf, Draggable, reResizable, axios, api, reduxToolkit, sagaExtension, reactRouterDom) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -354,8 +354,10 @@
354
354
  wmjsMap.getListener().suspendEvents();
355
355
 
356
356
  try {
357
- wmjsMap.stopAnimating && wmjsMap.stopAnimating(); // eslint-disable-next-line no-empty
358
- } catch (e) {}
357
+ wmjsMap.stopAnimating && wmjsMap.stopAnimating();
358
+ } catch (e) {
359
+ console.warn(e);
360
+ }
359
361
 
360
362
  Object.keys(registeredWMLayersForReactLayerId).forEach(function (layerId) {
361
363
  var wmLayer = getWMLayerById(layerId);
@@ -811,8 +813,8 @@
811
813
  setTargetNode = _a[1]; // Check if pointer event targets current node element
812
814
 
813
815
 
814
- var pointerEventListener = React__default["default"].useCallback(function (e) {
815
- setTargetNode(nodeRef.current.canvas ? nodeRef.current.canvas.isEqualNode(e.target) : false);
816
+ var pointerEventListener = React__default["default"].useCallback(function (event) {
817
+ setTargetNode(nodeRef.current.canvas ? nodeRef.current.canvas.isEqualNode(event.target) : false);
816
818
  }, [nodeRef]);
817
819
  React__default["default"].useEffect(function () {
818
820
  document.addEventListener(eventType, pointerEventListener);
@@ -2540,6 +2542,30 @@
2540
2542
  map.autoUpdateLayerId = undefined;
2541
2543
  }
2542
2544
  },
2545
+ setAutoTimestepLayerId: function setAutoTimestepLayerId(draft, action) {
2546
+ var _a = action.payload,
2547
+ mapId = _a.mapId,
2548
+ autoTimestepLayerId = _a.autoTimestepLayerId;
2549
+ var map = draft.byId[mapId];
2550
+
2551
+ if (!map) {
2552
+ return;
2553
+ }
2554
+
2555
+ map.autoTimeStepLayerId = autoTimestepLayerId;
2556
+ },
2557
+ setAutoUpdateLayerId: function setAutoUpdateLayerId(draft, action) {
2558
+ var _a = action.payload,
2559
+ mapId = _a.mapId,
2560
+ autoUpdateLayerId = _a.autoUpdateLayerId;
2561
+ var map = draft.byId[mapId];
2562
+
2563
+ if (!map) {
2564
+ return;
2565
+ }
2566
+
2567
+ map.autoUpdateLayerId = autoUpdateLayerId;
2568
+ },
2543
2569
  setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
2544
2570
  var _a = action.payload,
2545
2571
  mapId = _a.mapId,
@@ -8041,8 +8067,7 @@
8041
8067
  _this.canvas = canvas;
8042
8068
  }
8043
8069
  }))));
8044
- }; // eslint-disable-next-line react/static-property-placement
8045
-
8070
+ };
8046
8071
 
8047
8072
  CanvasComponent.defaultProps = {
8048
8073
  onRenderCanvas: function onRenderCanvas() {
@@ -10336,10 +10361,6 @@
10336
10361
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10337
10362
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
10338
10363
  * */
10339
- var iconStyle = {
10340
- height: 24,
10341
- width: 24
10342
- };
10343
10364
  var sizeSmall = {
10344
10365
  width: 100,
10345
10366
  height: 300
@@ -10376,43 +10397,31 @@
10376
10397
  document.removeEventListener('keydown', handleKeyDown);
10377
10398
  };
10378
10399
  }, [onChangeSize, shortcutsEnabled]);
10379
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
10380
- title: "small"
10381
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
10400
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10401
+ tooltipTitle: "small",
10382
10402
  "data-testid": "collapseSmall-btn",
10383
- size: "small",
10384
10403
  onClick: function onClick() {
10385
10404
  return onChangeSize(sizeSmall);
10386
10405
  },
10387
- sx: iconStyle,
10388
10406
  className: "collapseSmall-btn"
10389
- }, /*#__PURE__*/React__namespace.createElement(theme.CollapseSmall, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
10390
- title: "medium"
10391
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
10407
+ }, /*#__PURE__*/React__namespace.createElement(theme.CollapseSmall, null)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10408
+ tooltipTitle: "medium",
10392
10409
  "data-testid": "collapseMedium-btn",
10393
- size: "small",
10394
10410
  onClick: function onClick() {
10395
10411
  return onChangeSize(sizeMedium);
10396
10412
  },
10397
- sx: iconStyle,
10398
10413
  className: "collapseMedium-btn"
10399
- }, /*#__PURE__*/React__namespace.createElement(theme.CollapseMedium, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
10400
- title: "large"
10401
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
10414
+ }, /*#__PURE__*/React__namespace.createElement(theme.CollapseMedium, null)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10415
+ tooltipTitle: "large",
10402
10416
  "data-testid": "collapseLarge-btn",
10403
- size: "small",
10404
10417
  onClick: function onClick() {
10405
10418
  return onChangeSize(sizeLarge);
10406
10419
  },
10407
- sx: iconStyle,
10408
10420
  className: "collapseLarge-btn"
10409
- }, /*#__PURE__*/React__namespace.createElement(theme.CollapseLarge, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
10410
- title: isDockedLayerManager ? 'Undock' : 'Dock'
10411
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
10421
+ }, /*#__PURE__*/React__namespace.createElement(theme.CollapseLarge, null)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10422
+ tooltipTitle: isDockedLayerManager ? 'Undock' : 'Dock',
10412
10423
  "data-testid": "dockedBtn",
10413
10424
  disableRipple: true,
10414
- size: "small",
10415
- sx: iconStyle,
10416
10425
  onClick: function onClick() {
10417
10426
  return onClickDockButton();
10418
10427
  }
@@ -10420,7 +10429,7 @@
10420
10429
  "data-testid": "dockedLayerManager-collapse"
10421
10430
  }) : /*#__PURE__*/React__namespace.createElement(theme.ExpandWindow, {
10422
10431
  "data-testid": "dockedLayerManager-uncollapse"
10423
- }))));
10432
+ })));
10424
10433
  };
10425
10434
 
10426
10435
  /* *
@@ -10627,20 +10636,24 @@
10627
10636
  * See the License for the specific language governing permissions and
10628
10637
  * limitations under the License.
10629
10638
  *
10630
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10631
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
10639
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10640
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
10632
10641
  * */
10633
10642
  var style$2 = {
10634
- width: '24px',
10635
- height: '24px',
10636
- margin: 'auto 0px auto 32px',
10637
- borderRadius: '15%'
10643
+ padding: 0,
10644
+ margin: 'auto 0px auto 32px'
10638
10645
  };
10639
10646
 
10640
10647
  var LayerSelectButtonConnect = function LayerSelectButtonConnect(_a) {
10641
10648
  var mapId = _a.mapId,
10642
10649
  _b = _a.source,
10643
- source = _b === void 0 ? 'app' : _b;
10650
+ source = _b === void 0 ? 'app' : _b,
10651
+ _c = _a.tooltipTitle,
10652
+ tooltipTitle = _c === void 0 ? 'Open the layer selector' : _c,
10653
+ _d = _a.icon,
10654
+ icon = _d === void 0 ? /*#__PURE__*/React__namespace.createElement(theme.Add, {
10655
+ "data-testid": "layerSelectButtonConnectIcon"
10656
+ }) : _d;
10644
10657
  var dispatch = reactRedux.useDispatch();
10645
10658
  var currentActiveMapId = reactRedux.useSelector(function (store) {
10646
10659
  return getDialogMapId(store, DialogTypes.LayerSelect);
@@ -10656,16 +10669,13 @@
10656
10669
  source: source
10657
10670
  }));
10658
10671
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
10659
- return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
10660
- title: "Open the layer selector"
10661
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
10672
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10662
10673
  onClick: openLayerSelectDialog,
10663
10674
  sx: style$2,
10664
10675
  id: "layerSelectButton",
10665
10676
  "data-testid": "layerSelectButton",
10666
- disableRipple: true,
10667
- size: "large"
10668
- }, /*#__PURE__*/React__namespace.createElement(theme.Add, null)));
10677
+ tooltipTitle: tooltipTitle
10678
+ }, icon);
10669
10679
  };
10670
10680
 
10671
10681
  /* *
@@ -10694,17 +10704,20 @@
10694
10704
  };
10695
10705
 
10696
10706
  var DescriptionRow = function DescriptionRow(_a) {
10707
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10708
+
10697
10709
  var mapId = _a.mapId,
10698
10710
  mapPresetsModule = _a.mapPresetsModule,
10699
- _b = _a.source,
10700
- source = _b === void 0 ? 'app' : _b;
10711
+ _m = _a.source,
10712
+ source = _m === void 0 ? 'app' : _m,
10713
+ settings = _a.settings;
10701
10714
 
10702
- var _c = __read(React__namespace.useState(mapPresetsModule ? __assign(__assign({}, mapPresetsModule), {
10715
+ var _o = __read(React__namespace.useState(mapPresetsModule ? __assign(__assign({}, mapPresetsModule), {
10703
10716
  props: __assign(__assign({}, mapPresetsModule.props), {
10704
10717
  id: 'mappresets-menubuttonInline'
10705
10718
  })
10706
10719
  }) : undefined), 1),
10707
- mapPresetsModuleInline = _c[0];
10720
+ mapPresetsModuleInline = _o[0];
10708
10721
 
10709
10722
  var hasMapPresetsModule = mapPresetsModule !== undefined;
10710
10723
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
@@ -10721,13 +10734,15 @@
10721
10734
  className: columnClasses.column1
10722
10735
  }, /*#__PURE__*/React__namespace.createElement(LayerSelectButtonConnect, {
10723
10736
  mapId: mapId,
10724
- source: source
10737
+ source: source,
10738
+ tooltipTitle: (_b = settings === null || settings === void 0 ? void 0 : settings.addLayer) === null || _b === void 0 ? void 0 : _b.tooltipTitle,
10739
+ icon: (_c = settings === null || settings === void 0 ? void 0 : settings.addLayer) === null || _c === void 0 ? void 0 : _c.icon
10725
10740
  })), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10726
10741
  className: columnClasses.column2
10727
10742
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10728
10743
  className: "header-layer " + (hasMapPresetsModule ? 'mappresetsModule-enabled' : ''),
10729
10744
  sx: styles$4.text
10730
- }, "Layer"), /*#__PURE__*/React__namespace.createElement(material.Box, {
10745
+ }, (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.layerName) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : 'Layer'), /*#__PURE__*/React__namespace.createElement(material.Box, {
10731
10746
  className: "header-mapPresets",
10732
10747
  sx: {
10733
10748
  marginRight: 4
@@ -10736,15 +10751,15 @@
10736
10751
  className: columnClasses.column3
10737
10752
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10738
10753
  sx: styles$4.text
10739
- }, "Style")), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10754
+ }, (_g = (_f = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _f === void 0 ? void 0 : _f.title) !== null && _g !== void 0 ? _g : 'Style')), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10740
10755
  className: columnClasses.column4
10741
10756
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10742
10757
  sx: styles$4.text
10743
- }, "Opacity")), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10758
+ }, (_j = (_h = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : 'Opacity')), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10744
10759
  className: columnClasses.column5
10745
10760
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10746
10761
  sx: styles$4.text
10747
- }, "Dimensions")), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10762
+ }, (_l = (_k = settings === null || settings === void 0 ? void 0 : settings.dimensions) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : 'Dimensions')), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10748
10763
  className: columnClasses.column6
10749
10764
  }));
10750
10765
  };
@@ -11370,13 +11385,22 @@
11370
11385
  return 'geowebColors.buttons.flat.disabled.color';
11371
11386
  };
11372
11387
 
11388
+ var AutoOptions;
11389
+
11390
+ (function (AutoOptions) {
11391
+ AutoOptions["BOTH"] = "Auto both";
11392
+ AutoOptions["NONE"] = "Auto none";
11393
+ AutoOptions["TIMESTEP"] = "Auto-timestep";
11394
+ AutoOptions["UPDATE"] = "Auto-update";
11395
+ })(AutoOptions || (AutoOptions = {}));
11396
+
11373
11397
  var ActivateLayer = function ActivateLayer(_a) {
11374
11398
  var _onChange = _a.onChange,
11375
- isActive = _a.isActive,
11376
- isEnabled = _a.isEnabled;
11399
+ isEnabled = _a.isEnabled,
11400
+ current = _a.current;
11377
11401
  return /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
11378
11402
  variant: "standard",
11379
- tooltip: "Auto update",
11403
+ tooltip: "Leading layer",
11380
11404
  // Don't show arrow https://stackoverflow.com/questions/69085735/how-to-remove-arrow-from-react-textfield-select
11381
11405
  inputProps: {
11382
11406
  IconComponent: function IconComponent() {
@@ -11384,7 +11408,7 @@
11384
11408
  },
11385
11409
  tabIndex: -1
11386
11410
  },
11387
- value: isActive ? 'Both' : 'None',
11411
+ value: current,
11388
11412
  sx: {
11389
11413
  '&& .MuiInput-input': {
11390
11414
  paddingRight: '2px',
@@ -11392,30 +11416,39 @@
11392
11416
  backgroundColor: 'inherit'
11393
11417
  }
11394
11418
  },
11395
- renderValue: function renderValue(optionSelected) {
11419
+ renderValue: function renderValue(current) {
11396
11420
  return /*#__PURE__*/React__namespace.createElement(AutoUpdateButton$1, {
11397
- optionSelected: optionSelected,
11398
- isActive: isActive,
11421
+ current: current,
11399
11422
  isEnabled: isEnabled
11400
11423
  });
11401
11424
  },
11402
11425
  onChange: function onChange(event) {
11403
11426
  event.stopPropagation();
11404
11427
 
11405
- _onChange(event.target.value === 'Both');
11428
+ _onChange(event.target.value);
11406
11429
  },
11407
11430
  onClose: function onClose(event) {
11408
11431
  event.stopPropagation();
11409
11432
  }
11410
11433
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
11411
11434
  disabled: true
11412
- }, "Auto-update"), /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
11413
- value: "None"
11435
+ }, "Leading layer"), /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
11436
+ value: AutoOptions.NONE
11414
11437
  }, /*#__PURE__*/React__namespace.createElement(AutoOption, {
11415
11438
  icon: /*#__PURE__*/React__namespace.createElement(theme.None, null),
11416
11439
  text: "None"
11417
11440
  })), /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
11418
- value: "Both"
11441
+ value: AutoOptions.TIMESTEP
11442
+ }, /*#__PURE__*/React__namespace.createElement(AutoOption, {
11443
+ icon: /*#__PURE__*/React__namespace.createElement(theme.FastForward, null),
11444
+ text: "Auto-timestep"
11445
+ })), /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
11446
+ value: AutoOptions.UPDATE
11447
+ }, /*#__PURE__*/React__namespace.createElement(AutoOption, {
11448
+ icon: /*#__PURE__*/React__namespace.createElement(theme.AutoUpdateActive, null),
11449
+ text: "Auto-update"
11450
+ })), /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
11451
+ value: AutoOptions.BOTH
11419
11452
  }, /*#__PURE__*/React__namespace.createElement(AutoOption, {
11420
11453
  icon: /*#__PURE__*/React__namespace.createElement(theme.Both, null),
11421
11454
  text: "Both"
@@ -11423,20 +11456,13 @@
11423
11456
  };
11424
11457
 
11425
11458
  var AutoUpdateButton$1 = function AutoUpdateButton(_a) {
11426
- var optionSelected = _a.optionSelected,
11427
- isActive = _a.isActive,
11459
+ var current = _a.current,
11428
11460
  isEnabled = _a.isEnabled;
11429
- var style = {
11430
- color: getIconColor(isActive, isEnabled)
11431
- };
11432
- var Icon = isActive ? /*#__PURE__*/React__namespace.createElement(theme.Both, {
11433
- sx: style
11434
- }) : /*#__PURE__*/React__namespace.createElement(theme.None, {
11435
- sx: style
11436
- });
11461
+ var isActive = current !== AutoOptions.NONE;
11462
+ var Icon = getIcon(isActive, isEnabled, current);
11437
11463
  return /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
11464
+ "aria-label": current,
11438
11465
  "data-testid": "activateLayer-btn",
11439
- "aria-label": "Auto update " + optionSelected,
11440
11466
  sx: {
11441
11467
  '&.MuiButtonBase-root': {
11442
11468
  backgroundColor: 'inherit'
@@ -11461,6 +11487,34 @@
11461
11487
  }, text), /*#__PURE__*/React__namespace.createElement(material.ListItemIcon, null, icon));
11462
11488
  };
11463
11489
 
11490
+ function getIcon(isActive, isEnabled, current) {
11491
+ var style = {
11492
+ color: getIconColor(isActive, isEnabled)
11493
+ };
11494
+
11495
+ if (current === AutoOptions.BOTH) {
11496
+ return /*#__PURE__*/React__namespace.createElement(theme.Both, {
11497
+ sx: style
11498
+ });
11499
+ }
11500
+
11501
+ if (current === AutoOptions.TIMESTEP) {
11502
+ return /*#__PURE__*/React__namespace.createElement(theme.FastForward, {
11503
+ sx: style
11504
+ });
11505
+ }
11506
+
11507
+ if (current === AutoOptions.UPDATE) {
11508
+ return /*#__PURE__*/React__namespace.createElement(theme.AutoUpdateActive, {
11509
+ sx: style
11510
+ });
11511
+ }
11512
+
11513
+ return /*#__PURE__*/React__namespace.createElement(theme.None, {
11514
+ sx: style
11515
+ });
11516
+ }
11517
+
11464
11518
  /* *
11465
11519
  * Licensed under the Apache License, Version 2.0 (the "License");
11466
11520
  * you may not use this file except in compliance with the License.
@@ -11474,8 +11528,8 @@
11474
11528
  * See the License for the specific language governing permissions and
11475
11529
  * limitations under the License.
11476
11530
  *
11477
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11478
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
11531
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11532
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
11479
11533
  * */
11480
11534
 
11481
11535
  var LayerRow = function LayerRow(_a) {
@@ -11529,9 +11583,9 @@
11529
11583
  },
11530
11584
  '&.sortable-ghost': {
11531
11585
  opacity: 0.5
11532
- },
11533
- alignItems: 'center'
11534
- }
11586
+ }
11587
+ },
11588
+ alignItems: "center"
11535
11589
  }, /*#__PURE__*/React__default["default"].createElement(shared.CustomAccordion, {
11536
11590
  className: "medium-layermanager",
11537
11591
  defaultExpanded: false,
@@ -11546,8 +11600,8 @@
11546
11600
  padding: 0
11547
11601
  }
11548
11602
  },
11549
- title: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
11550
- isEnabled: layer.enabled,
11603
+ title: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
11604
+ shouldShowAsDisabled: !layer.enabled,
11551
11605
  tooltipTitle: layer.name,
11552
11606
  onClick: function onClick(event) {
11553
11607
  event.stopPropagation();
@@ -11556,11 +11610,10 @@
11556
11610
  enabled: !layer.enabled
11557
11611
  });
11558
11612
  },
11559
- "data-testid": "enableButton-medium",
11560
- icon: isEnabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)
11561
- }), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11613
+ "data-testid": "enableButton-medium"
11614
+ }, isEnabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11615
+ current: AutoOptions.BOTH,
11562
11616
  onChange: onClickRow,
11563
- isActive: false,
11564
11617
  isEnabled: true
11565
11618
  }), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
11566
11619
  sx: {
@@ -11619,7 +11672,7 @@
11619
11672
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11620
11673
  item: true,
11621
11674
  sx: {}
11622
- }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
11675
+ }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
11623
11676
  tooltipTitle: "Delete",
11624
11677
  onClick: function onClick() {
11625
11678
  onLayerDelete({
@@ -11627,13 +11680,13 @@
11627
11680
  layerId: layerId
11628
11681
  });
11629
11682
  },
11630
- icon: /*#__PURE__*/React__default["default"].createElement(theme.Delete, null),
11631
11683
  "data-testid": "deleteButton"
11632
- }))))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11684
+ }, /*#__PURE__*/React__default["default"].createElement(theme.Delete, null)))))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11633
11685
  item: true,
11634
- className: columnClasses.column1
11635
- }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
11636
- isEnabled: layer.enabled,
11686
+ className: columnClasses.column1,
11687
+ alignItems: "center"
11688
+ }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
11689
+ shouldShowAsDisabled: !layer.enabled,
11637
11690
  tooltipTitle: layer.name,
11638
11691
  onClick: function onClick(event) {
11639
11692
  event.stopPropagation();
@@ -11642,11 +11695,10 @@
11642
11695
  enabled: !layer.enabled
11643
11696
  });
11644
11697
  },
11645
- icon: layer.enabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null),
11646
11698
  "data-testid": "enableButton"
11647
- }), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11699
+ }, layer.enabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11648
11700
  onChange: onClickRow,
11649
- isActive: false,
11701
+ current: AutoOptions.BOTH,
11650
11702
  isEnabled: true
11651
11703
  })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11652
11704
  item: true,
@@ -11709,8 +11761,9 @@
11709
11761
  }
11710
11762
  }))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11711
11763
  item: true,
11712
- className: columnClasses.column6
11713
- }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
11764
+ className: columnClasses.column6,
11765
+ alignItems: "center"
11766
+ }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
11714
11767
  tooltipTitle: "Delete",
11715
11768
  onClick: function onClick() {
11716
11769
  onLayerDelete({
@@ -11718,9 +11771,8 @@
11718
11771
  layerId: layerId
11719
11772
  });
11720
11773
  },
11721
- icon: /*#__PURE__*/React__default["default"].createElement(theme.Delete, null),
11722
11774
  "data-testid": "deleteButton"
11723
- }), layerMenuLayout || /*#__PURE__*/React__default["default"].createElement(LayerManagerMenuButton, {
11775
+ }, /*#__PURE__*/React__default["default"].createElement(theme.Delete, null)), layerMenuLayout || /*#__PURE__*/React__default["default"].createElement(LayerManagerMenuButton, {
11724
11776
  mapId: mapId,
11725
11777
  layerId: layerId,
11726
11778
  onLayerDuplicate: onLayerDuplicate
@@ -11740,8 +11792,8 @@
11740
11792
  * See the License for the specific language governing permissions and
11741
11793
  * limitations under the License.
11742
11794
  *
11743
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11744
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11795
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11796
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
11745
11797
  * */
11746
11798
 
11747
11799
  var DeleteLayerConnect = function DeleteLayerConnect(_a) {
@@ -11763,7 +11815,7 @@
11763
11815
  var isLayerEnabled = reactRedux.useSelector(function (store) {
11764
11816
  return getLayerEnabled(store, layerId);
11765
11817
  });
11766
- return /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
11818
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
11767
11819
  tooltipTitle: "Delete",
11768
11820
  onClick: function onClick() {
11769
11821
  layerDelete({
@@ -11772,10 +11824,9 @@
11772
11824
  layerIndex: layerIndex
11773
11825
  });
11774
11826
  },
11775
- isEnabled: isLayerEnabled,
11776
- icon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null),
11827
+ shouldShowAsDisabled: !isLayerEnabled,
11777
11828
  "data-testid": "deleteButton"
11778
- });
11829
+ }, /*#__PURE__*/React__namespace.createElement(theme.Delete, null));
11779
11830
  };
11780
11831
 
11781
11832
  /* *
@@ -11791,8 +11842,8 @@
11791
11842
  * See the License for the specific language governing permissions and
11792
11843
  * limitations under the License.
11793
11844
  *
11794
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11795
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11845
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11846
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
11796
11847
  * */
11797
11848
 
11798
11849
  var EnableLayerConnect = function EnableLayerConnect(_a) {
@@ -11813,8 +11864,8 @@
11813
11864
  origin: LayerActionOrigin.layerManager
11814
11865
  }));
11815
11866
  }, [dispatch, mapId]);
11816
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
11817
- isEnabled: isEnabled,
11867
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
11868
+ shouldShowAsDisabled: !isEnabled,
11818
11869
  tooltipTitle: "Toggle visibility",
11819
11870
  onClick: function onClick(event) {
11820
11871
  event.stopPropagation();
@@ -11824,10 +11875,12 @@
11824
11875
  });
11825
11876
  },
11826
11877
  className: "enable-btn",
11827
- icon: isEnabled ? /*#__PURE__*/React__namespace.createElement(theme.Visibility, null) : /*#__PURE__*/React__namespace.createElement(theme.VisibilityOff, null),
11828
- "data-testid": "enableButton"
11829
- }), /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
11830
- isEnabled: isEnabled,
11878
+ "data-testid": "enableButton",
11879
+ sx: {
11880
+ margin: 'auto 0px'
11881
+ }
11882
+ }, isEnabled ? /*#__PURE__*/React__namespace.createElement(theme.Visibility, null) : /*#__PURE__*/React__namespace.createElement(theme.VisibilityOff, null)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
11883
+ shouldShowAsDisabled: !isEnabled,
11831
11884
  tooltipTitle: layerName,
11832
11885
  onClick: function onClick(event) {
11833
11886
  event.stopPropagation();
@@ -11837,9 +11890,11 @@
11837
11890
  });
11838
11891
  },
11839
11892
  className: "enable-btn-mini",
11840
- icon: isEnabled ? /*#__PURE__*/React__namespace.createElement(theme.Visibility, null) : /*#__PURE__*/React__namespace.createElement(theme.VisibilityOff, null),
11841
- "data-testid": "enableButton"
11842
- }));
11893
+ "data-testid": "enableButton",
11894
+ sx: {
11895
+ margin: 'auto 0px'
11896
+ }
11897
+ }, isEnabled ? /*#__PURE__*/React__namespace.createElement(theme.Visibility, null) : /*#__PURE__*/React__namespace.createElement(theme.VisibilityOff, null)));
11843
11898
  };
11844
11899
 
11845
11900
  /* *
@@ -12168,49 +12223,127 @@
12168
12223
  var layerId = _a.layerId,
12169
12224
  mapId = _a.mapId;
12170
12225
  var dispatch = reactRedux.useDispatch();
12171
- var activeLayerId = reactRedux.useSelector(function (store) {
12172
- return getActiveLayerId(store, mapId);
12226
+ var autoUpdateLayerId = reactRedux.useSelector(function (store) {
12227
+ return getAutoUpdateLayerId(store, mapId);
12228
+ });
12229
+ var autoTimestepLayerId = reactRedux.useSelector(function (store) {
12230
+ return getAutoTimeStepLayerId(store, mapId);
12173
12231
  });
12174
12232
  var isLayerEnabled = reactRedux.useSelector(function (store) {
12175
12233
  return getLayerEnabled(store, layerId);
12176
12234
  });
12177
- var setActiveLayerId = React__namespace.useCallback(function (_a) {
12178
- var layerId = _a.layerId,
12179
- mapId = _a.mapId;
12180
- return dispatch(mapActions$1.setAutoLayerId({
12235
+ var isAutoUpdating$1 = reactRedux.useSelector(function (store) {
12236
+ return isAutoUpdating(store, mapId);
12237
+ });
12238
+
12239
+ var goToLastAvailableTimeForLayerIfAutoUpdateIsOn = function goToLastAvailableTimeForLayerIfAutoUpdateIsOn() {
12240
+ if (isAutoUpdating$1) {
12241
+ dispatch(mapActions$1.toggleAutoUpdate({
12242
+ mapId: mapId,
12243
+ shouldAutoUpdate: true
12244
+ }));
12245
+ }
12246
+ };
12247
+
12248
+ var thisLayerHasAutoUpdate = layerId === autoUpdateLayerId;
12249
+ var thisLayerHasAutoTimestep = layerId === autoTimestepLayerId;
12250
+ var thisLayerHasBoth = thisLayerHasAutoTimestep && thisLayerHasAutoUpdate;
12251
+
12252
+ function handleNoneClick() {
12253
+ if (thisLayerHasBoth) {
12254
+ dispatch(mapActions$1.setAutoLayerId({
12255
+ autoTimeStepLayerId: undefined,
12256
+ autoUpdateLayerId: undefined,
12257
+ mapId: mapId,
12258
+ origin: LayerActionOrigin.layerManager
12259
+ }));
12260
+ } else if (thisLayerHasAutoTimestep) {
12261
+ dispatch(mapActions$1.setAutoTimestepLayerId({
12262
+ mapId: mapId,
12263
+ autoTimestepLayerId: undefined
12264
+ }));
12265
+ } else if (thisLayerHasAutoUpdate) {
12266
+ dispatch(mapActions$1.setAutoUpdateLayerId({
12267
+ mapId: mapId,
12268
+ autoUpdateLayerId: undefined
12269
+ }));
12270
+ }
12271
+ }
12272
+
12273
+ function handleBothClick() {
12274
+ dispatch(mapActions$1.setAutoLayerId({
12181
12275
  autoTimeStepLayerId: layerId,
12182
12276
  autoUpdateLayerId: layerId,
12183
12277
  mapId: mapId,
12184
12278
  origin: LayerActionOrigin.layerManager
12185
12279
  }));
12186
- }, [dispatch]);
12187
- var isAutoUpdating$1 = reactRedux.useSelector(function (store) {
12188
- return isAutoUpdating(store, mapId);
12189
- });
12190
- var setAutoUpdateOn = React__namespace.useCallback(function (mapId) {
12191
- return dispatch(mapActions$1.toggleAutoUpdate({
12280
+ goToLastAvailableTimeForLayerIfAutoUpdateIsOn();
12281
+ }
12282
+
12283
+ function handleAutoUpdateClick() {
12284
+ dispatch(mapActions$1.setAutoUpdateLayerId({
12192
12285
  mapId: mapId,
12193
- shouldAutoUpdate: true
12286
+ autoUpdateLayerId: layerId
12194
12287
  }));
12195
- }, [dispatch]);
12196
- var isActive = activeLayerId === layerId;
12197
- return /*#__PURE__*/React__namespace.createElement(ActivateLayer, {
12198
- onChange: function onChange(isActive) {
12199
- setActiveLayerId({
12288
+
12289
+ if (thisLayerHasAutoTimestep) {
12290
+ dispatch(mapActions$1.setAutoTimestepLayerId({
12200
12291
  mapId: mapId,
12201
- layerId: isActive ? layerId : undefined
12202
- });
12292
+ autoTimestepLayerId: undefined
12293
+ }));
12294
+ }
12203
12295
 
12204
- if (isAutoUpdating$1) {
12205
- // Layer is now set active *and* autoupdate is currently on => autoupdate is desired to be set on.
12206
- setAutoUpdateOn(mapId);
12296
+ goToLastAvailableTimeForLayerIfAutoUpdateIsOn();
12297
+ }
12298
+
12299
+ function handleAutoTimestepClick() {
12300
+ dispatch(mapActions$1.setAutoTimestepLayerId({
12301
+ mapId: mapId,
12302
+ autoTimestepLayerId: layerId
12303
+ }));
12304
+
12305
+ if (thisLayerHasAutoUpdate) {
12306
+ dispatch(mapActions$1.setAutoUpdateLayerId({
12307
+ mapId: mapId,
12308
+ autoUpdateLayerId: undefined
12309
+ }));
12310
+ }
12311
+ }
12312
+
12313
+ var current = getCurrentOptionForLayer(thisLayerHasBoth, thisLayerHasAutoTimestep, thisLayerHasAutoUpdate);
12314
+ return /*#__PURE__*/React__namespace.createElement(ActivateLayer, {
12315
+ current: current,
12316
+ onChange: function onChange(autoOption) {
12317
+ if (autoOption === AutoOptions.BOTH) {
12318
+ handleBothClick();
12319
+ } else if (autoOption === AutoOptions.NONE) {
12320
+ handleNoneClick();
12321
+ } else if (autoOption === AutoOptions.TIMESTEP) {
12322
+ handleAutoTimestepClick();
12323
+ } else if (autoOption === AutoOptions.UPDATE) {
12324
+ handleAutoUpdateClick();
12207
12325
  }
12208
12326
  },
12209
- isActive: isActive,
12210
12327
  isEnabled: isLayerEnabled
12211
12328
  });
12212
12329
  };
12213
12330
 
12331
+ function getCurrentOptionForLayer(thisLayerHasBoth, thisLayerHasAutoTimestep, thisLayerHasAutoUpdate) {
12332
+ if (thisLayerHasBoth) {
12333
+ return AutoOptions.BOTH;
12334
+ }
12335
+
12336
+ if (thisLayerHasAutoTimestep) {
12337
+ return AutoOptions.TIMESTEP;
12338
+ }
12339
+
12340
+ if (thisLayerHasAutoUpdate) {
12341
+ return AutoOptions.UPDATE;
12342
+ }
12343
+
12344
+ return AutoOptions.NONE;
12345
+ }
12346
+
12214
12347
  /* *
12215
12348
  * Licensed under the Apache License, Version 2.0 (the "License");
12216
12349
  * you may not use this file except in compliance with the License.
@@ -12311,8 +12444,8 @@
12311
12444
  * See the License for the specific language governing permissions and
12312
12445
  * limitations under the License.
12313
12446
  *
12314
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12315
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
12447
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12448
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
12316
12449
  * */
12317
12450
  var TOOLTIP_TITLE = 'Drag';
12318
12451
 
@@ -12322,20 +12455,17 @@
12322
12455
  _c = _a.index,
12323
12456
  index = _c === void 0 ? undefined : _c,
12324
12457
  _d = _a.hideTooltip,
12325
- hideTooltip = _d === void 0 ? false : _d,
12458
+ hideTooltip = _d === void 0 ? true : _d,
12326
12459
  _e = _a.isSorting,
12327
12460
  isSorting = _e === void 0 ? false : _e;
12328
12461
  var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
12329
- return /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
12462
+ return /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
12330
12463
  tooltipTitle: tooltipTitle,
12331
- icon: /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null),
12332
12464
  "data-testid": "dragHandle" + (index !== undefined ? "-" + index : ''),
12333
12465
  className: "handle",
12334
12466
  tabIndex: -1,
12335
- isEnabled: !isDisabled,
12336
12467
  disableTouchRipple: true,
12337
12468
  disabled: isDisabled,
12338
- isAccessible: true,
12339
12469
  sx: {
12340
12470
  cursor: isSorting ? 'grabbing' : 'grab',
12341
12471
  '&:hover': {
@@ -12344,9 +12474,12 @@
12344
12474
  marginLeft: '3px',
12345
12475
  marginRight: '3px',
12346
12476
  marginTop: 'auto',
12347
- marginBottom: 'auto'
12477
+ marginBottom: 'auto',
12478
+ '&.MuiIconButton-root': {
12479
+ color: 'geowebColors.greys.accessible'
12480
+ }
12348
12481
  }
12349
- });
12482
+ }, /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null));
12350
12483
  };
12351
12484
 
12352
12485
  /* *
@@ -12526,7 +12659,10 @@
12526
12659
 
12527
12660
  var selectedBaseLayers = _a.selectedBaseLayers,
12528
12661
  availableBaseLayers = _a.availableBaseLayers,
12529
- onChangeBaseLayers = _a.onChangeBaseLayers;
12662
+ onChangeBaseLayers = _a.onChangeBaseLayers,
12663
+ icon = _a.icon,
12664
+ _c = _a.tooltipPrefix,
12665
+ tooltipPrefix = _c === void 0 ? 'Layer: ' : _c;
12530
12666
 
12531
12667
  if (!availableBaseLayers || !availableBaseLayers.length) {
12532
12668
  return /*#__PURE__*/React__namespace.createElement("div", null, "No service available");
@@ -12547,7 +12683,7 @@
12547
12683
  }
12548
12684
  }, /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
12549
12685
  disableUnderline: true,
12550
- tooltip: "Base layer: " + ((_b = availableBaseLayers[currentIndex]) === null || _b === void 0 ? void 0 : _b.name),
12686
+ tooltip: "" + tooltipPrefix + ((_b = availableBaseLayers[currentIndex]) === null || _b === void 0 ? void 0 : _b.name),
12551
12687
  inputProps: {
12552
12688
  SelectDisplayProps: {
12553
12689
  'data-testid': 'selectBaseLayer'
@@ -12565,7 +12701,8 @@
12565
12701
  },
12566
12702
  onChangeMouseWheel: function onChangeMouseWheel(e) {
12567
12703
  return onChangeBaseLayers(e.value);
12568
- }
12704
+ },
12705
+ IconComponent: icon
12569
12706
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
12570
12707
  disabled: true
12571
12708
  }, "Base layer"), availableBaseLayers.map(function (baseLayer) {
@@ -12637,7 +12774,9 @@
12637
12774
 
12638
12775
  var BaseLayersConnect = function BaseLayersConnect(_a) {
12639
12776
  var mapId = _a.mapId,
12640
- preloadedAvailableBaseLayers = _a.preloadedAvailableBaseLayers;
12777
+ preloadedAvailableBaseLayers = _a.preloadedAvailableBaseLayers,
12778
+ tooltipPrefix = _a.tooltipPrefix,
12779
+ icon = _a.icon;
12641
12780
  var dispatch = reactRedux.useDispatch();
12642
12781
  var selectedBaseLayers = reactRedux.useSelector(function (store) {
12643
12782
  return getMapBaseLayers(store, mapId);
@@ -12672,7 +12811,9 @@
12672
12811
  return /*#__PURE__*/React__namespace.createElement(BaseLayers, {
12673
12812
  selectedBaseLayers: selectedBaseLayers,
12674
12813
  availableBaseLayers: currentAvailableBaseLayers,
12675
- onChangeBaseLayers: onChangeBaseLayers
12814
+ onChangeBaseLayers: onChangeBaseLayers,
12815
+ tooltipPrefix: tooltipPrefix,
12816
+ icon: icon
12676
12817
  });
12677
12818
  };
12678
12819
 
@@ -12726,11 +12867,10 @@
12726
12867
  }, /*#__PURE__*/React__namespace.createElement(material.List, {
12727
12868
  dense: true
12728
12869
  }, sortedServices.map(function (service) {
12729
- return /*#__PURE__*/React__namespace.createElement(material.ListItem, {
12870
+ return /*#__PURE__*/React__namespace.createElement(material.ListItemButton, {
12730
12871
  "data-testid": "service-item",
12731
12872
  key: service.url,
12732
12873
  selected: service === activeService,
12733
- button: true,
12734
12874
  onClick: function onClick(event) {
12735
12875
  handleListItemClick(event, service);
12736
12876
  }
@@ -12753,8 +12893,8 @@
12753
12893
  * See the License for the specific language governing permissions and
12754
12894
  * limitations under the License.
12755
12895
  *
12756
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12757
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
12896
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12897
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
12758
12898
  * */
12759
12899
 
12760
12900
  var WMSLayerTreeHeader = function WMSLayerTreeHeader(_a) {
@@ -12772,18 +12912,11 @@
12772
12912
  htmlFor: "select-multiple-native"
12773
12913
  }, "Available layers for ", serviceName)), onClickReload && /*#__PURE__*/React__namespace.createElement(material.Grid, {
12774
12914
  item: true
12775
- }, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
12776
- title: "Reload layers from service",
12777
- placement: "top"
12778
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
12915
+ }, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
12916
+ tooltipTitle: "Reload layers from service",
12779
12917
  "data-testid": "reloadLayers",
12780
- color: "primary",
12781
- style: {
12782
- padding: 3
12783
- },
12784
- onClick: onClickReload,
12785
- size: "large"
12786
- }, /*#__PURE__*/React__namespace.createElement(theme.Cached, null)))));
12918
+ onClick: onClickReload
12919
+ }, /*#__PURE__*/React__namespace.createElement(theme.Cached, null))));
12787
12920
  };
12788
12921
 
12789
12922
  /* *
@@ -12932,10 +13065,9 @@
12932
13065
  textOverflow: 'ellipsis'
12933
13066
  }
12934
13067
  }, category)), layerMap[category].map(function (layer) {
12935
- return layer.leaf ? /*#__PURE__*/React__namespace.createElement(material.ListItem, {
13068
+ return layer.leaf ? /*#__PURE__*/React__namespace.createElement(material.ListItemButton, {
12936
13069
  "data-testid": "selectableLayer",
12937
13070
  key: layer.name,
12938
- button: true,
12939
13071
  selected: processedOK.indexOf(layer.name) !== -1 || layerExists(layer, highlightedLayers),
12940
13072
  onClick: function onClick() {
12941
13073
  return handleInternalSelect(layer.name);
@@ -13170,8 +13302,8 @@
13170
13302
  * See the License for the specific language governing permissions and
13171
13303
  * limitations under the License.
13172
13304
  *
13173
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13174
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
13305
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13306
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13175
13307
  * */
13176
13308
 
13177
13309
  var validateServiceUrl$1 = function validateServiceUrl(url) {
@@ -13287,7 +13419,7 @@
13287
13419
  alignItems: "center"
13288
13420
  }, /*#__PURE__*/React__namespace.createElement(material.Grid, {
13289
13421
  item: true,
13290
- xs: 10
13422
+ xs: 12
13291
13423
  }, /*#__PURE__*/React__namespace.createElement(material.TextField, {
13292
13424
  margin: "dense",
13293
13425
  id: "serviceurl",
@@ -13309,25 +13441,21 @@
13309
13441
  disabled: loading,
13310
13442
  error: urlError !== '',
13311
13443
  helperText: urlError,
13312
- variant: "standard"
13313
- })), /*#__PURE__*/React__namespace.createElement(material.Grid, {
13314
- item: true,
13315
- xs: 2,
13316
- sx: {
13317
- position: 'relative'
13318
- }
13319
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
13320
- "data-testid": "add-service",
13321
- onClick: handleAddServiceURL,
13322
- disabled: loading,
13323
- size: "large"
13324
- }, /*#__PURE__*/React__namespace.createElement(theme.Add, null)), loading && /*#__PURE__*/React__namespace.createElement(material.CircularProgress, {
13325
- size: 35,
13326
- sx: {
13327
- position: 'absolute',
13328
- top: '7px',
13329
- left: '7px',
13330
- zIndex: 1
13444
+ variant: "filled",
13445
+ InputProps: {
13446
+ endAdornment: /*#__PURE__*/React__namespace.createElement(material.InputAdornment, {
13447
+ position: "end"
13448
+ }, loading ? /*#__PURE__*/React__namespace.createElement(material.CircularProgress, {
13449
+ size: 24,
13450
+ sx: {
13451
+ zIndex: 1
13452
+ }
13453
+ }) : /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
13454
+ "data-testid": "add-service",
13455
+ onClick: handleAddServiceURL,
13456
+ disabled: loading,
13457
+ size: "large"
13458
+ }, /*#__PURE__*/React__namespace.createElement(theme.Add, null)))
13331
13459
  }
13332
13460
  })))), /*#__PURE__*/React__namespace.createElement(material.Box, {
13333
13461
  m: 2
@@ -13369,8 +13497,8 @@
13369
13497
  * See the License for the specific language governing permissions and
13370
13498
  * limitations under the License.
13371
13499
  *
13372
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13373
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
13500
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13501
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13374
13502
  * */
13375
13503
  var styles$3 = {
13376
13504
  buttonDiv: {
@@ -13383,10 +13511,7 @@
13383
13511
  zIndex: 1
13384
13512
  },
13385
13513
  button: {
13386
- width: '24px',
13387
- height: '24px',
13388
- margin: 'auto 0px auto 32px',
13389
- borderRadius: '15%'
13514
+ margin: 'auto 0px auto 32px'
13390
13515
  }
13391
13516
  };
13392
13517
 
@@ -13406,39 +13531,24 @@
13406
13531
  open = _f[0],
13407
13532
  setOpen = _f[1];
13408
13533
 
13409
- var _g = __read(React__namespace.useState(shouldFocus), 2),
13410
- isTooltipDisabled = _g[0],
13411
- setTooltipDisabled = _g[1];
13412
-
13413
13534
  var handleClose = function handleClose() {
13414
13535
  setOpen(!open);
13415
13536
  };
13416
13537
 
13417
- var onBlurTooltip = function onBlurTooltip(event) {
13418
- // enable tooltip again after user blurs
13419
- if (event.relatedTarget) {
13420
- setTooltipDisabled(false);
13421
- }
13422
- };
13423
-
13424
13538
  React__namespace.useEffect(function () {
13425
13539
  if (shouldFocus && ref.current) {
13426
13540
  ref.current.focus();
13427
13541
  } // eslint-disable-next-line react-hooks/exhaustive-deps
13428
13542
 
13429
13543
  }, []);
13430
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
13431
- title: tooltip,
13432
- disableFocusListener: isTooltipDisabled,
13433
- onBlur: onBlurTooltip
13434
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
13544
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
13435
13545
  onClick: handleClose,
13436
13546
  sx: styles$3.button,
13437
13547
  disableRipple: true,
13438
13548
  "data-testid": "addLayersButton",
13439
13549
  ref: ref,
13440
- size: "large"
13441
- }, /*#__PURE__*/React__namespace.createElement(theme.Add, null))), /*#__PURE__*/React__namespace.createElement(AddLayersPopup, {
13550
+ tooltipTitle: tooltip
13551
+ }, /*#__PURE__*/React__namespace.createElement(theme.Add, null)), /*#__PURE__*/React__namespace.createElement(AddLayersPopup, {
13442
13552
  open: open,
13443
13553
  handleClose: handleClose,
13444
13554
  onRenderTree: onRenderTree,
@@ -13465,13 +13575,16 @@
13465
13575
  * */
13466
13576
 
13467
13577
  var BaseLayerRow = function BaseLayerRow(_a) {
13578
+ var _b, _c, _d;
13579
+
13468
13580
  var mapId = _a.mapId,
13469
- _b = _a.preloadedAvailableBaseLayers,
13470
- preloadedAvailableBaseLayers = _b === void 0 ? availableDefaultBaseLayers : _b,
13471
- _c = _a.preloadedServices,
13472
- preloadedServices = _c === void 0 ? preloadedDefaultBaseServices : _c,
13473
- _d = _a.tooltip,
13474
- tooltip = _d === void 0 ? '' : _d;
13581
+ _e = _a.preloadedAvailableBaseLayers,
13582
+ preloadedAvailableBaseLayers = _e === void 0 ? availableDefaultBaseLayers : _e,
13583
+ _f = _a.preloadedServices,
13584
+ preloadedServices = _f === void 0 ? preloadedDefaultBaseServices : _f,
13585
+ _g = _a.tooltip,
13586
+ tooltip = _g === void 0 ? '' : _g,
13587
+ settings = _a.settings;
13475
13588
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
13476
13589
  container: true,
13477
13590
  item: true,
@@ -13497,12 +13610,14 @@
13497
13610
  layerType: LayerType.baseLayer
13498
13611
  });
13499
13612
  }
13500
- })), /*#__PURE__*/React__namespace.createElement(material.Grid, {
13613
+ })), (_b = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _b === void 0 ? void 0 : _b.title, /*#__PURE__*/React__namespace.createElement(material.Grid, {
13501
13614
  item: true,
13502
13615
  className: columnClasses.column2
13503
13616
  }, /*#__PURE__*/React__namespace.createElement(BaseLayersConnect, {
13504
13617
  mapId: mapId,
13505
- preloadedAvailableBaseLayers: preloadedAvailableBaseLayers
13618
+ preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
13619
+ tooltipPrefix: (_c = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _c === void 0 ? void 0 : _c.tooltipPrefix,
13620
+ icon: (_d = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _d === void 0 ? void 0 : _d.icon
13506
13621
  })));
13507
13622
  };
13508
13623
 
@@ -13627,7 +13742,8 @@
13627
13742
  left: 50
13628
13743
  } : _k,
13629
13744
  _l = _a.setFocused,
13630
- setFocused = _l === void 0 ? function () {} : _l;
13745
+ setFocused = _l === void 0 ? function () {} : _l,
13746
+ settings = _a.settings;
13631
13747
  var minSize = {
13632
13748
  width: 100,
13633
13749
  height: 126
@@ -13718,14 +13834,16 @@
13718
13834
  }, /*#__PURE__*/React__namespace.createElement(DescriptionRow, {
13719
13835
  mapPresetsModule: leftHeaderComponent,
13720
13836
  mapId: mapId,
13721
- source: source
13837
+ source: source,
13838
+ settings: settings === null || settings === void 0 ? void 0 : settings.header
13722
13839
  }), /*#__PURE__*/React__namespace.createElement(LayerContainerRow, {
13723
13840
  mapId: mapId
13724
13841
  }), /*#__PURE__*/React__namespace.createElement(BaseLayerRow, {
13725
13842
  mapId: mapId,
13726
13843
  tooltip: "Add base layers",
13727
13844
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
13728
- preloadedServices: preloadedBaseServices
13845
+ preloadedServices: preloadedBaseServices,
13846
+ settings: settings === null || settings === void 0 ? void 0 : settings.footer
13729
13847
  })))));
13730
13848
  };
13731
13849
 
@@ -14123,12 +14241,19 @@
14123
14241
  * See the License for the specific language governing permissions and
14124
14242
  * limitations under the License.
14125
14243
  *
14126
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14127
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
14244
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14245
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
14128
14246
  * */
14129
14247
  var isURL = function isURL(string) {
14130
14248
  return /^https?:\/\//.test(string);
14131
14249
  };
14250
+ var buttonStyle = {
14251
+ '&.MuiButtonBase-root.MuiIconButton-root': {
14252
+ width: 48,
14253
+ height: 48,
14254
+ marginRight: '-12px'
14255
+ }
14256
+ };
14132
14257
 
14133
14258
  var SearchFieldButtonContainer = function SearchFieldButtonContainer(_a) {
14134
14259
  var localSearchString = _a.localSearchString,
@@ -14136,16 +14261,13 @@
14136
14261
  setPopupIsOpen = _a.setPopupIsOpen;
14137
14262
 
14138
14263
  var ClearButton = function ClearButton() {
14139
- return /*#__PURE__*/React__default["default"].createElement(shared.CustomTooltip, {
14140
- title: "Clear",
14141
- placement: "top"
14142
- }, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
14143
- edge: "end",
14264
+ return /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
14265
+ tooltipTitle: "Clear",
14266
+ sx: buttonStyle,
14144
14267
  onClick: function onClick() {
14145
14268
  onClickClear();
14146
- },
14147
- size: "large"
14148
- }, /*#__PURE__*/React__default["default"].createElement(theme.Clear, null)));
14269
+ }
14270
+ }, /*#__PURE__*/React__default["default"].createElement(theme.Clear, null));
14149
14271
  };
14150
14272
 
14151
14273
  if (isURL(localSearchString)) {
@@ -14165,13 +14287,10 @@
14165
14287
  return /*#__PURE__*/React__default["default"].createElement(ClearButton, null);
14166
14288
  }
14167
14289
 
14168
- return /*#__PURE__*/React__default["default"].createElement(shared.CustomTooltip, {
14169
- title: "Search",
14170
- placement: "top"
14171
- }, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
14172
- edge: "end",
14173
- size: "large"
14174
- }, /*#__PURE__*/React__default["default"].createElement(theme.Search, null)));
14290
+ return /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
14291
+ tooltipTitle: "Search",
14292
+ sx: buttonStyle
14293
+ }, /*#__PURE__*/React__default["default"].createElement(theme.Search, null));
14175
14294
  };
14176
14295
 
14177
14296
  /* *
@@ -15382,7 +15501,7 @@
15382
15501
  }));
15383
15502
  };
15384
15503
 
15385
- var hasSelectedStyle = !isAllSelected && isSelected || isAllSelected && service === 'all';
15504
+ var hasSelectedStyle = !isAllSelected && isSelected || isAllSelected && (service === null || service === void 0 ? void 0 : service.serviceName) === 'all';
15386
15505
 
15387
15506
  var toggleChip = function toggleChip(service) {
15388
15507
  if (service === 'all') {
@@ -15572,8 +15691,8 @@
15572
15691
  * See the License for the specific language governing permissions and
15573
15692
  * limitations under the License.
15574
15693
  *
15575
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15576
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
15694
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15695
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
15577
15696
  * */
15578
15697
  var styles$1 = {
15579
15698
  servicesContainer: {
@@ -15739,39 +15858,35 @@
15739
15858
  paddingRight: '70px'
15740
15859
  }
15741
15860
  }, serviceName)), /*#__PURE__*/React__namespace.createElement(material.ListItemSecondaryAction, {
15742
- style: {
15861
+ sx: {
15743
15862
  marginRight: '0px',
15744
- width: 100
15863
+ width: 96,
15864
+ button: {
15865
+ marginLeft: 1
15866
+ }
15745
15867
  }
15746
15868
  }, /*#__PURE__*/React__namespace.createElement(material.Grid, {
15747
- container: true
15748
- }, /*#__PURE__*/React__namespace.createElement(material.Grid, {
15749
- item: true,
15750
- xs: 4
15869
+ container: true,
15870
+ justifyContent: "left"
15751
15871
  }, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
15752
15872
  "data-testid": "updateServiceTooltip",
15753
15873
  title: updateServiceTitle,
15754
15874
  placement: tooltipPlacement(),
15755
15875
  PopperProps: tooltipPopperProps
15756
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
15876
+ }, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
15757
15877
  "data-testid": "updateServiceButton",
15758
15878
  "aria-label": "Update layers from WMS service",
15759
- size: "large",
15760
15879
  onKeyDown: stopTabPropagation,
15761
15880
  onClick: function onClick() {
15762
15881
  layerSelectReloadService(serviceUrl);
15763
15882
  }
15764
- }, /*#__PURE__*/React__namespace.createElement(theme.Cached, null)))), /*#__PURE__*/React__namespace.createElement(material.Grid, {
15765
- item: true,
15766
- xs: 4
15767
- }, userAddedService ? /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
15883
+ }, /*#__PURE__*/React__namespace.createElement(theme.Cached, null))), userAddedService ? /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
15768
15884
  title: editServiceTitle,
15769
15885
  placement: tooltipPlacement(),
15770
15886
  PopperProps: tooltipPopperProps
15771
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
15887
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
15772
15888
  "aria-label": "edit service",
15773
15889
  "data-testid": "openEditServiceButton",
15774
- size: "large",
15775
15890
  onKeyDown: stopTabPropagation,
15776
15891
  onClick: function onClick() {
15777
15892
  setServicePopupInfo({
@@ -15785,10 +15900,9 @@
15785
15900
  title: showServiceTitle,
15786
15901
  placement: tooltipPlacement(),
15787
15902
  PopperProps: tooltipPopperProps
15788
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
15903
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
15789
15904
  "aria-label": "show service",
15790
15905
  "data-testid": "openShowServiceButton",
15791
- size: "large",
15792
15906
  onKeyDown: stopTabPropagation,
15793
15907
  onClick: function onClick() {
15794
15908
  setServicePopupInfo({
@@ -15798,24 +15912,20 @@
15798
15912
  variant: 'show'
15799
15913
  });
15800
15914
  }
15801
- }, /*#__PURE__*/React__namespace.createElement(theme.Visibility, null))))), /*#__PURE__*/React__namespace.createElement(material.Grid, {
15802
- item: true,
15803
- xs: 4
15804
- }, userAddedService && /*#__PURE__*/React__namespace.createElement(material.Box, null, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
15915
+ }, /*#__PURE__*/React__namespace.createElement(theme.Visibility, null)))), userAddedService && /*#__PURE__*/React__namespace.createElement(material.Box, null, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
15805
15916
  title: deleteServiceTitle(serviceHasActiveLayers),
15806
15917
  PopperProps: tooltipPopperProps,
15807
15918
  placement: tooltipPlacement(),
15808
15919
  "data-testid": "removeServiceTooltip"
15809
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
15920
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
15810
15921
  "data-testid": "removeServiceButton",
15811
15922
  "aria-label": "delete service",
15812
- size: "large",
15813
15923
  disabled: serviceHasActiveLayers,
15814
15924
  onKeyDown: stopTabPropagation,
15815
15925
  onClick: function onClick() {
15816
15926
  return layerSelectRemoveService(serviceId, serviceUrl, serviceName);
15817
15927
  }
15818
- }, /*#__PURE__*/React__namespace.createElement(theme.Delete, null)))))))));
15928
+ }, /*#__PURE__*/React__namespace.createElement(theme.Delete, null))))))));
15819
15929
  }));
15820
15930
  };
15821
15931
 
@@ -16240,8 +16350,8 @@
16240
16350
  * See the License for the specific language governing permissions and
16241
16351
  * limitations under the License.
16242
16352
  *
16243
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16244
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
16353
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16354
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
16245
16355
  * */
16246
16356
 
16247
16357
  var FilterListItem = function FilterListItem(_a) {
@@ -16332,12 +16442,12 @@
16332
16442
  whiteSpace: 'nowrap',
16333
16443
  overflow: 'hidden'
16334
16444
  }
16335
- }, filter.name, " (", filter.amountVisible, ")"), isHovering ? /*#__PURE__*/React__namespace.createElement(material.ListItemSecondaryAction, null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
16445
+ }, filter.name, " (", filter.amountVisible, ")"), isHovering ? /*#__PURE__*/React__namespace.createElement(material.ListItemSecondaryAction, null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
16336
16446
  style: {
16337
- backgroundColor: 'transparent'
16447
+ backgroundColor: 'transparent',
16448
+ width: 'auto'
16338
16449
  },
16339
16450
  edge: "end",
16340
- size: "small",
16341
16451
  onClick: function onClick() {
16342
16452
  return selectOnlyOne(filter.id);
16343
16453
  },
@@ -16654,8 +16764,8 @@
16654
16764
  * See the License for the specific language governing permissions and
16655
16765
  * limitations under the License.
16656
16766
  *
16657
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16658
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
16767
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16768
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
16659
16769
  * */
16660
16770
  var style = {
16661
16771
  textField: {
@@ -16932,15 +17042,16 @@
16932
17042
  }, /*#__PURE__*/React__namespace.createElement(material.Typography, {
16933
17043
  variant: "h5",
16934
17044
  component: "span"
16935
- }, getTitleForVariant(servicePopupVariant)), /*#__PURE__*/React__namespace.createElement(material.IconButton, {
17045
+ }, getTitleForVariant(servicePopupVariant)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
16936
17046
  "aria-label": "close",
16937
- size: "small",
16938
17047
  onClick: closePopup,
16939
17048
  "data-testid": "closePopupButtonCross",
16940
17049
  sx: {
16941
- color: 'geowebColors.captions.captionDisabled.color',
16942
17050
  marginTop: 'auto',
16943
- marginBottom: 'auto'
17051
+ marginBottom: 'auto',
17052
+ '&.MuiButtonBase-root': {
17053
+ color: 'geowebColors.greys.accessible'
17054
+ }
16944
17055
  }
16945
17056
  }, /*#__PURE__*/React__namespace.createElement(theme.Close, null))), isLoading && /*#__PURE__*/React__namespace.createElement(material.Box, {
16946
17057
  sx: {
@@ -16978,11 +17089,14 @@
16978
17089
  disableUnderline: isShowPopup,
16979
17090
  endAdornment: isShowPopup && /*#__PURE__*/React__namespace.createElement(material.InputAdornment, {
16980
17091
  position: "end"
16981
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
17092
+ }, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
16982
17093
  "aria-label": "copy url",
16983
17094
  onClick: function onClick() {
16984
17095
  navigator.clipboard.writeText(serviceUrl);
16985
17096
  showSnackbar(COPY_URL_MESSAGE);
17097
+ },
17098
+ sx: {
17099
+ marginTop: 0.5
16986
17100
  }
16987
17101
  }, /*#__PURE__*/React__namespace.createElement(theme.Copy, null)))
16988
17102
  },
@@ -17689,8 +17803,8 @@
17689
17803
  * See the License for the specific language governing permissions and
17690
17804
  * limitations under the License.
17691
17805
  *
17692
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17693
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17806
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17807
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17694
17808
  * */
17695
17809
 
17696
17810
  var DimensionSelectSliderConnect = function DimensionSelectSliderConnect(_a) {
@@ -17731,16 +17845,16 @@
17731
17845
  key: layerId,
17732
17846
  item: true,
17733
17847
  xs: "auto"
17734
- }, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
17735
- title: tooltipTitle,
17736
- placement: "top"
17737
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
17848
+ }, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
17849
+ tooltipTitle: tooltipTitle,
17738
17850
  "data-testid": "syncButton",
17739
- size: "small",
17740
17851
  onClick: function onClick() {
17741
17852
  return handleSyncChanged(layerId, dimensionName, layerDimension.currentValue, !layerDimension.synced);
17853
+ },
17854
+ sx: {
17855
+ margin: '5px'
17742
17856
  }
17743
- }, /*#__PURE__*/React__namespace.createElement(Icon, null))), /*#__PURE__*/React__namespace.createElement(DimensionSelectSlider, {
17857
+ }, /*#__PURE__*/React__namespace.createElement(Icon, null)), /*#__PURE__*/React__namespace.createElement(DimensionSelectSlider, {
17744
17858
  marks: marks,
17745
17859
  layerTitle: layerTitle,
17746
17860
  reverse: dimConfig ? dimConfig.reversed : false,
@@ -22098,7 +22212,6 @@
22098
22212
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
22099
22213
  * */
22100
22214
  /* Function which calculates the distance between two points */
22101
- // eslint-disable-next-line class-methods-use-this
22102
22215
 
22103
22216
  var distance = function distance(a, b) {
22104
22217
  return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
@@ -22177,9 +22290,10 @@
22177
22290
  return {
22178
22291
  coordinateIndexInFeature: polygonIndex
22179
22292
  };
22180
- } // eslint-disable-next-line no-empty
22181
-
22182
- } catch (e) {}
22293
+ }
22294
+ } catch (e) {
22295
+ console.warn(e);
22296
+ }
22183
22297
  }
22184
22298
  }
22185
22299
 
@@ -22205,9 +22319,10 @@
22205
22319
  return {
22206
22320
  coordinateIndexInFeature: polygonIndex
22207
22321
  };
22208
- } // eslint-disable-next-line no-empty
22209
-
22210
- } catch (e) {}
22322
+ }
22323
+ } catch (e) {
22324
+ console.warn(e);
22325
+ }
22211
22326
  }
22212
22327
  }
22213
22328
 
@@ -22435,7 +22550,7 @@
22435
22550
  if (feature.geometry) {
22436
22551
  var coordinates = feature.geometry.coordinates;
22437
22552
 
22438
- if (_this.snappedPolygonIndex > coordinates.length - 1) {
22553
+ if (Number(_this.snappedPolygonIndex) > coordinates.length - 1) {
22439
22554
  _this.snappedPolygonIndex = coordinates.length - 1;
22440
22555
  }
22441
22556
  }
@@ -25578,7 +25693,26 @@
25578
25693
 
25579
25694
  var dimensions = props.dimensions,
25580
25695
  mapId = props.mapId;
25696
+ var wmjsMapRef = React__namespace.useRef(null);
25697
+
25698
+ var _d = reactResizeDetector.useResizeDetector(),
25699
+ ref = _d.ref,
25700
+ height = _d.height,
25701
+ width = _d.width;
25702
+
25703
+ React__namespace.useEffect(function () {
25704
+ if (wmjsMapRef.current && !!width && !!height) {
25705
+ var _a = wmjsMapRef.current.getSize(),
25706
+ mapHeight = _a.height,
25707
+ mapWidth = _a.width;
25708
+
25709
+ if (width !== mapWidth || height !== mapHeight) {
25710
+ wmjsMapRef.current.setSize(Math.ceil(width), Math.ceil(height));
25711
+ }
25712
+ }
25713
+ }, [width, height]);
25581
25714
  return /*#__PURE__*/React__namespace.createElement(material.Box, {
25715
+ ref: ref,
25582
25716
  sx: {
25583
25717
  display: 'grid',
25584
25718
  width: '100%',
@@ -25611,7 +25745,10 @@
25611
25745
  }
25612
25746
  }, /*#__PURE__*/React__namespace.createElement(ReactMapView, __assign({}, props, {
25613
25747
  showLegend: false,
25614
- displayTimeInMap: false
25748
+ displayTimeInMap: false,
25749
+ onWMJSMount: function onWMJSMount(id) {
25750
+ wmjsMapRef.current = getWMJSMapById(id);
25751
+ }
25615
25752
  }), children)), displayTimeInMap && dimensions && /*#__PURE__*/React__namespace.createElement(MapTime, {
25616
25753
  dimensions: dimensions
25617
25754
  }));
@@ -26725,8 +26862,8 @@
26725
26862
  * See the License for the specific language governing permissions and
26726
26863
  * limitations under the License.
26727
26864
  *
26728
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26729
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
26865
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26866
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
26730
26867
  * */
26731
26868
 
26732
26869
  var GetFeatureInfoDialog = function GetFeatureInfoDialog(_a) {
@@ -26896,11 +27033,10 @@
26896
27033
  }
26897
27034
  }, /*#__PURE__*/React__default["default"].createElement(material.Typography, {
26898
27035
  variant: "subtitle1"
26899
- }, title, "\xA0", /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
27036
+ }, title, "\xA0", /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
26900
27037
  sx: {
26901
27038
  "float": 'right'
26902
27039
  },
26903
- size: "small",
26904
27040
  "aria-label": "Open layer featureinfo in another page",
26905
27041
  onClick: function onClick() {
26906
27042
  window.open(url);
@@ -27300,8 +27436,7 @@
27300
27436
  syncGroupAddTarget({
27301
27437
  groupId: syncGroupsId,
27302
27438
  targetId: map.id,
27303
- linked: true,
27304
- origin: 'system'
27439
+ linked: true
27305
27440
  });
27306
27441
  });
27307
27442
  });
@@ -27744,10 +27879,9 @@
27744
27879
  var isNotCheckedElseWhere = viewStateData.groups.every(function (group) {
27745
27880
  return !(group.id !== groupId && group.selected.includes(source.id));
27746
27881
  });
27747
- return /*#__PURE__*/React__namespace.createElement(material.ListItem, {
27882
+ return /*#__PURE__*/React__namespace.createElement(material.ListItemButton, {
27748
27883
  key: source.id,
27749
27884
  dense: true,
27750
- button: true,
27751
27885
  onClick: function onClick() {
27752
27886
  return handleToggle(source.id);
27753
27887
  },
@@ -27781,8 +27915,8 @@
27781
27915
  * See the License for the specific language governing permissions and
27782
27916
  * limitations under the License.
27783
27917
  *
27784
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27785
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
27918
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27919
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27786
27920
  * */
27787
27921
  var SyncGroupList = function SyncGroupList(_a) {
27788
27922
  var viewStateData = _a.viewStateData,
@@ -27810,9 +27944,8 @@
27810
27944
  paddingLeft: '15px',
27811
27945
  paddingTop: '10px'
27812
27946
  }
27813
- }, /*#__PURE__*/React__namespace.createElement(material.Typography, null, title), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
27814
- title: index === 0 ? 'Add new group to list' : 'Remove group from list'
27815
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
27947
+ }, /*#__PURE__*/React__namespace.createElement(material.Typography, null, title), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
27948
+ tooltipTitle: index === 0 ? 'Add new group to list' : 'Remove group from list',
27816
27949
  style: {
27817
27950
  right: '10px'
27818
27951
  },
@@ -27821,9 +27954,8 @@
27821
27954
  return addNewGroup(groupObject.id);
27822
27955
  } : function () {
27823
27956
  return removeGroup(groupObject.id);
27824
- },
27825
- size: "large"
27826
- }, index === 0 ? /*#__PURE__*/React__namespace.createElement(theme.Add, null) : /*#__PURE__*/React__namespace.createElement(theme.Delete, null)))), /*#__PURE__*/React__namespace.createElement(SyncGroupListItem, {
27957
+ }
27958
+ }, index === 0 ? /*#__PURE__*/React__namespace.createElement(theme.Add, null) : /*#__PURE__*/React__namespace.createElement(theme.Delete, null))), /*#__PURE__*/React__namespace.createElement(SyncGroupListItem, {
27827
27959
  viewStateData: viewStateData,
27828
27960
  groupId: groupObject.id,
27829
27961
  selected: groupObject.selected,
@@ -27933,7 +28065,8 @@
27933
28065
  syncGroupAddGroup({
27934
28066
  groupId: String(groupId + Math.floor(Math.random() * 1000)),
27935
28067
  title: title,
27936
- type: syncType
28068
+ type: syncType,
28069
+ origin: 'user'
27937
28070
  });
27938
28071
  }
27939
28072
  });
@@ -28211,8 +28344,8 @@
28211
28344
  * See the License for the specific language governing permissions and
28212
28345
  * limitations under the License.
28213
28346
  *
28214
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28215
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
28347
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28348
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28216
28349
  * */
28217
28350
  var SnackbarWrapper = function SnackbarWrapper(_a) {
28218
28351
  var children = _a.children,
@@ -28230,14 +28363,19 @@
28230
28363
  ClickAwayListenerProps: {
28231
28364
  mouseEvent: false
28232
28365
  },
28233
- action: /*#__PURE__*/React__namespace.createElement(material.IconButton, {
28366
+ action: /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
28234
28367
  "aria-label": "close",
28235
28368
  "data-testid": "snackbarCloseButton",
28236
28369
  onClick: onCloseSnackbar,
28370
+ size: "large",
28237
28371
  sx: {
28238
- color: 'geowebColors.snackbar.action',
28239
- '&:hover': {
28240
- backgroundColor: 'geowebColors.snackbar.actionHover.rgba'
28372
+ '&.MuiButtonBase-root': {
28373
+ borderRadius: 20,
28374
+ color: 'geowebColors.snackbar.action',
28375
+ '&:hover': {
28376
+ color: 'geowebColors.snackbar.action',
28377
+ backgroundColor: 'geowebColors.snackbar.actionHover.rgba'
28378
+ }
28241
28379
  }
28242
28380
  }
28243
28381
  }, /*#__PURE__*/React__namespace.createElement(theme.Close, null))
@@ -28352,6 +28490,7 @@
28352
28490
  * */
28353
28491
  // stores navigate hook method to object, so it can be used outside components
28354
28492
  var historyDict = {
28493
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28355
28494
  navigate: null
28356
28495
  };
28357
28496
 
@@ -28450,8 +28589,6 @@
28450
28589
  * */
28451
28590
  var NavigateSetter = function NavigateSetter() {
28452
28591
  // stores navigate hook method to historyDict, so it can be used outside components
28453
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
28454
- // @ts-ignore
28455
28592
  historyDict.navigate = reactRouterDom.useNavigate();
28456
28593
  return null;
28457
28594
  };