@opengeoweb/shared 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 (39) hide show
  1. package/index.esm.js +534 -200
  2. package/index.umd.js +557 -203
  3. package/lib/components/AlertBanner/AlertBanner.d.ts +1 -0
  4. package/lib/components/AlertBanner/AlertBanner.stories.d.ts +9 -1
  5. package/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +10 -2
  6. package/lib/components/CustomToggleButton/CustomToggleButton.d.ts +8 -0
  7. package/lib/components/{DraggableDialog/DraggableDialog.spec.d.ts → CustomToggleButton/CustomToggleButton.spec.d.ts} +0 -0
  8. package/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +13 -0
  9. package/lib/components/CustomToggleButton/index.d.ts +1 -0
  10. package/lib/components/Manager/EnableButton/EnableButton.d.ts +8 -0
  11. package/lib/components/Manager/EnableButton/EnableButton.spec.d.ts +1 -0
  12. package/lib/components/Manager/EnableButton/EnableButton.stories.d.ts +13 -0
  13. package/lib/components/Manager/EnableButton/index.d.ts +1 -0
  14. package/lib/components/Manager/ManagerButton/ManagerButton.d.ts +13 -0
  15. package/lib/components/Manager/ManagerButton/ManagerButton.spec.d.ts +1 -0
  16. package/lib/components/Manager/ManagerButton/ManagerButton.stories.d.ts +13 -0
  17. package/lib/components/Manager/ManagerButton/index.d.ts +1 -0
  18. package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.d.ts +8 -0
  19. package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.spec.d.ts +1 -0
  20. package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.stories.d.ts +13 -0
  21. package/lib/components/Manager/ManagerDeleteButton/index.d.ts +1 -0
  22. package/lib/components/Manager/index.d.ts +4 -0
  23. package/lib/components/Manager/styles.d.ts +5 -0
  24. package/lib/components/ToggleMenu/ToggleMenu.d.ts +17 -0
  25. package/lib/components/ToggleMenu/ToggleMenu.spec.d.ts +1 -0
  26. package/lib/components/ToggleMenu/ToggleMenu.stories.d.ts +7 -0
  27. package/lib/components/ToggleMenu/index.d.ts +1 -0
  28. package/lib/components/ToolButton/ToolButton.d.ts +11 -0
  29. package/lib/components/ToolButton/ToolButton.spec.d.ts +1 -0
  30. package/lib/components/ToolButton/ToolButton.stories.d.ts +13 -0
  31. package/lib/components/ToolButton/index.d.ts +1 -0
  32. package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +6 -0
  33. package/lib/components/ToolContainer/index.d.ts +1 -0
  34. package/lib/components/components.stories.d.ts +0 -1
  35. package/lib/components/index.d.ts +4 -1
  36. package/package.json +3 -3
  37. package/lib/components/DraggableDialog/DraggableDialog.d.ts +0 -16
  38. package/lib/components/DraggableDialog/DraggableDialog.stories.d.ts +0 -6
  39. package/lib/components/DraggableDialog/index.d.ts +0 -1
package/index.esm.js CHANGED
@@ -1,15 +1,17 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
- import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, Alert, AlertTitle, SvgIcon, Grid, useTheme, Link, Avatar, Paper, ClickAwayListener, MenuList, MenuItem, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider } from '@mui/material';
4
- import makeStyles from '@mui/styles/makeStyles';
5
- import { Close, DragIndicator } from '@mui/icons-material';
3
+ import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, Alert, AlertTitle, SvgIcon, Grid, useTheme, Link, Avatar, Paper, ClickAwayListener, MenuList, MenuItem, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Tooltip, Menu, ListItemIcon, Checkbox } from '@mui/material';
4
+ import Close from '@mui/icons-material/Close';
6
5
  import { useFormContext } from 'react-hook-form';
7
6
  import { isEmpty, errorMessages } from '@opengeoweb/form-fields';
7
+ import makeStyles from '@mui/styles/makeStyles';
8
8
  import Draggable from 'react-draggable';
9
9
  import { Resizable } from 're-resizable';
10
10
  import { useThemeContext } from '@opengeoweb/theme';
11
+ import { DragIndicator, Close as Close$1, Delete } from '@mui/icons-material';
11
12
  import { throttle } from 'lodash';
12
13
  import withStyles from '@mui/styles/withStyles';
14
+ import MoreVertIcon from '@mui/icons-material/MoreVert';
13
15
  import createStyles from '@mui/styles/createStyles';
14
16
 
15
17
  /* *
@@ -102,20 +104,6 @@ function __rest(s, e) {
102
104
  return t;
103
105
  }
104
106
 
105
- var useStyles$d = makeStyles(function () {
106
- return {
107
- dialogHeader: {
108
- zIndex: 1,
109
- padding: '8px 20px',
110
- display: 'flex',
111
- justifyContent: 'space-between',
112
- alignItems: 'center'
113
- },
114
- dialogContent: {
115
- padding: '40px 20px 0px 20px !important'
116
- }
117
- };
118
- });
119
107
  var ConfirmationDialog = function ConfirmationDialog(_a) {
120
108
  var open = _a.open,
121
109
  title = _a.title,
@@ -131,8 +119,6 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
131
119
  content = _a$content === void 0 ? null : _a$content,
132
120
  other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content"]);
133
121
 
134
- var classes = useStyles$d();
135
-
136
122
  other.catchOnCancel;
137
123
  var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
138
124
 
@@ -140,14 +126,33 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
140
126
  return /*#__PURE__*/React.createElement(Dialog, Object.assign({
141
127
  "data-testid": "confirmationDialog",
142
128
  open: open,
143
- maxWidth: "sm",
144
- fullWidth: true,
129
+ PaperProps: {
130
+ sx: {
131
+ width: '560px',
132
+ margin: 2.5
133
+ }
134
+ },
145
135
  // fix for briefly showing default options when closing dialog
146
136
  transitionDuration: 0
147
137
  }, rest), /*#__PURE__*/React.createElement(DialogTitle, {
148
- className: classes.dialogHeader
138
+ sx: {
139
+ zIndex: 1,
140
+ padding: 2,
141
+ display: 'flex',
142
+ justifyContent: 'space-between',
143
+ alignItems: 'center'
144
+ }
149
145
  }, /*#__PURE__*/React.createElement(Typography, {
150
- variant: "h5",
146
+ sx: {
147
+ fontSize: {
148
+ xs: '16px',
149
+ sm: '34px'
150
+ },
151
+ fontWeight: {
152
+ xs: 500,
153
+ sm: 400
154
+ }
155
+ },
151
156
  "data-testid": "confirmationDialog-title",
152
157
  component: "span"
153
158
  }, title), /*#__PURE__*/React.createElement(IconButton, {
@@ -158,22 +163,50 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
158
163
  },
159
164
  size: "small"
160
165
  }, /*#__PURE__*/React.createElement(Close, null))), /*#__PURE__*/React.createElement(DialogContent, {
161
- className: classes.dialogContent
166
+ sx: {
167
+ padding: '8px 16px'
168
+ }
162
169
  }, /*#__PURE__*/React.createElement(Typography, {
163
170
  variant: "body1"
164
- }, description), content), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button, {
165
- "data-testid": "conformationDialog-cancel",
166
- color: "secondary",
167
- variant: "outlined",
171
+ }, description), content), /*#__PURE__*/React.createElement(DialogActions, {
172
+ sx: {
173
+ padding: 2,
174
+ flexDirection: {
175
+ xs: 'column',
176
+ sm: 'row'
177
+ }
178
+ }
179
+ }, /*#__PURE__*/React.createElement(Button, {
180
+ "data-testid": "confirmationDialog-cancel",
181
+ variant: "tertiary",
182
+ sx: {
183
+ width: {
184
+ xs: '100%',
185
+ sm: '150px'
186
+ }
187
+ },
168
188
  onClick: function onClick() {
169
189
  return onClose('CANCELLED');
170
190
  },
171
191
  autoFocus: true,
172
192
  disableRipple: true
173
193
  }, cancelLabel), /*#__PURE__*/React.createElement(Button, {
174
- "data-testid": "conformationDialog-confirm",
175
- color: "secondary",
176
- variant: "contained",
194
+ "data-testid": "confirmationDialog-confirm",
195
+ variant: "primary",
196
+ sx: {
197
+ width: {
198
+ xs: '100%',
199
+ sm: '150px'
200
+ },
201
+ marginLeft: {
202
+ xs: '0px!important',
203
+ sm: '8px!important'
204
+ },
205
+ marginTop: {
206
+ xs: 2,
207
+ sm: 0
208
+ }
209
+ },
177
210
  onClick: onSubmit
178
211
  }, confirmLabel)));
179
212
  };
@@ -650,12 +683,13 @@ var ConfirmationServiceProvider = function ConfirmationServiceProvider(_ref) {
650
683
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
651
684
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
652
685
  * */
653
- var useStyles$c = makeStyles(function () {
686
+ var useStyles$a = makeStyles(function () {
654
687
  return {
655
688
  title: {
656
689
  fontSize: '14px',
657
690
  fontWeight: 'normal',
658
- marginTop: '0px!important'
691
+ marginTop: '0px!important',
692
+ paddingTop: '0px!important'
659
693
  },
660
694
  info: {
661
695
  fontSize: '16px'
@@ -672,8 +706,7 @@ var getIcon = function getIcon(severity) {
672
706
  fill: "transparent"
673
707
  }), /*#__PURE__*/React.createElement("path", {
674
708
  d: "M12 4c4.418 0 8 3.581 8 8 0 4.418-3.582 8-8 8s-8-3.582-8-8c0-4.419 3.582-8 8-8zm1.052 6H10v1.613h.949v3.774H10V17h4v-1.613h-.948V10zM11.99 6c-.837 0-1.491.654-1.491 1.49 0 .837.654 1.51 1.49 1.51.837 0 1.51-.673 1.51-1.51 0-.836-.673-1.49-1.51-1.49z",
675
- transform: "translate(-946.000000, -368.000000) translate(930.000000, 356.000000) translate(16.000000, 12.000000)",
676
- fill: "#0062E6"
709
+ transform: "translate(-946.000000, -368.000000) translate(930.000000, 356.000000) translate(16.000000, 12.000000)"
677
710
  }));
678
711
 
679
712
  case 'success':
@@ -683,8 +716,7 @@ var getIcon = function getIcon(severity) {
683
716
  fill: "transparent"
684
717
  }), /*#__PURE__*/React.createElement("path", {
685
718
  d: "M16.51 10.034l-5.633 5.633-3.387-3.386c-.369-.37-.369-.973 0-1.343.36-.357.983-.357 1.342 0l2.045 2.046 4.292-4.291c.357-.357.983-.359 1.342 0 .368.369.368.97 0 1.341M12 4C7.582 4 4 7.582 4 12s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8",
686
- transform: "translate(-96.000000, -368.000000) translate(80.000000, 356.000000) translate(16.000000, 12.000000)",
687
- fill: "#72BB23"
719
+ transform: "translate(-96.000000, -368.000000) translate(80.000000, 356.000000) translate(16.000000, 12.000000)"
688
720
  }));
689
721
 
690
722
  case 'warning':
@@ -694,8 +726,7 @@ var getIcon = function getIcon(severity) {
694
726
  fill: "transparent"
695
727
  }), /*#__PURE__*/React.createElement("path", {
696
728
  d: "M12.862 16.72c-.22.226-.507.339-.86.339-.364 0-.662-.113-.894-.34-.232-.226-.347-.52-.347-.885 0-.32.118-.59.356-.81.236-.22.531-.331.884-.331.332 0 .613.11.845.33.232.222.347.491.347.811 0 .365-.11.66-.33.886zm.216-9.805l-.134 6.669H11.06l-.15-6.67h2.169zM12 4.5c-4.141 0-7.5 3.359-7.5 7.501s3.359 7.5 7.5 7.5c4.142 0 7.5-3.358 7.5-7.5C19.5 7.86 16.142 4.5 12 4.5z",
697
- transform: "translate(-521.000000, -368.000000) translate(505.000000, 356.000000) translate(16.000000, 12.000000)",
698
- fill: "#FFA800"
729
+ transform: "translate(-521.000000, -368.000000) translate(505.000000, 356.000000) translate(16.000000, 12.000000)"
699
730
  }));
700
731
 
701
732
  case 'error':
@@ -706,8 +737,7 @@ var getIcon = function getIcon(severity) {
706
737
  fill: "transparent"
707
738
  }), /*#__PURE__*/React.createElement("path", {
708
739
  d: "M12.862 16.72c-.22.226-.507.339-.86.339-.364 0-.662-.113-.894-.34-.232-.226-.347-.52-.347-.885 0-.32.118-.59.356-.81.236-.22.531-.331.884-.331.332 0 .613.11.845.33.232.222.347.491.347.811 0 .365-.11.66-.33.886zm.216-9.805l-.134 6.669H11.06l-.15-6.67h2.169zM12 4.5c-4.141 0-7.5 3.359-7.5 7.501s3.359 7.5 7.5 7.5c4.142 0 7.5-3.358 7.5-7.5C19.5 7.86 16.142 4.5 12 4.5z",
709
- transform: "translate(-1371.000000, -368.000000) translate(1355.000000, 356.000000) translate(16.000000, 12.000000)",
710
- fill: "#C00000"
740
+ transform: "translate(-1371.000000, -368.000000) translate(1355.000000, 356.000000) translate(16.000000, 12.000000)"
711
741
  }));
712
742
  }
713
743
  };
@@ -719,12 +749,31 @@ var AlertBanner = function AlertBanner(_ref) {
719
749
  _ref$info = _ref.info,
720
750
  info = _ref$info === void 0 ? '' : _ref$info,
721
751
  _ref$dataTestId = _ref.dataTestId,
722
- dataTestId = _ref$dataTestId === void 0 ? 'alert-banner' : _ref$dataTestId;
723
- var classes = useStyles$c();
752
+ dataTestId = _ref$dataTestId === void 0 ? 'alert-banner' : _ref$dataTestId,
753
+ _ref$isCompact = _ref.isCompact,
754
+ isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact;
755
+ var classes = useStyles$a();
724
756
  return /*#__PURE__*/React.createElement(Alert, {
725
757
  "data-testid": dataTestId,
726
758
  severity: severity,
727
- icon: getIcon(severity)
759
+ icon: getIcon(severity),
760
+ sx: isCompact ? {
761
+ height: '32px',
762
+ boxSizing: 'border-box',
763
+ '& .MuiAlert-message': {
764
+ padding: '0px',
765
+ whiteSpace: 'nowrap',
766
+ overflow: 'hidden',
767
+ textOverflow: 'ellipsis',
768
+ '& .MuiTypography-root': {
769
+ display: 'inline'
770
+ }
771
+ },
772
+ '& .MuiAlert-icon': {
773
+ margin: '-3px 10px 0px 0px',
774
+ padding: '0px'
775
+ }
776
+ } : {}
728
777
  }, /*#__PURE__*/React.createElement(AlertTitle, {
729
778
  className: classes.title
730
779
  }, title), info && /*#__PURE__*/React.createElement("div", {
@@ -748,7 +797,7 @@ var AlertBanner = function AlertBanner(_ref) {
748
797
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
749
798
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
750
799
  * */
751
- var useStyles$b = makeStyles(function () {
800
+ var useStyles$9 = makeStyles(function () {
752
801
  return {
753
802
  wrapper: {
754
803
  height: '100vh',
@@ -765,7 +814,7 @@ var useStyles$b = makeStyles(function () {
765
814
  var AppLayout = function AppLayout(_ref) {
766
815
  var header = _ref.header,
767
816
  children = _ref.children;
768
- var classes = useStyles$b();
817
+ var classes = useStyles$9();
769
818
  return /*#__PURE__*/React__default.createElement("div", {
770
819
  className: classes.wrapper
771
820
  }, header, /*#__PURE__*/React__default.createElement("main", {
@@ -775,7 +824,7 @@ var AppLayout = function AppLayout(_ref) {
775
824
 
776
825
  var img = "data:image/svg+xml,%3c!--Licensed under the Apache License%2c Version 2.0 (the 'License')%3byou may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing%2c softwaredistributed under the License is distributed on an 'AS IS' BASIS%2cWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND%2c either express or implied.See the License for the specific language governing permissions andlimitations under the License.Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)Copyright 2021 - Finnish Meteorological Institute (FMI)--%3e%3csvg id='svg4550' xmlnsRdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns='http://www.w3.org/2000/svg' height='55.156mm' viewBox='0 0 289.84072 195.43326' width='81.799mm' version='1.1' xmlnsCc='http://creativecommons.org/ns%23' xmlnsXlink='http://www.w3.org/1999/xlink' xmlnsDc='http://purl.org/dc/elements/1.1/'%3e %3cdefs id='defs14'%3e %3clinearGradient id='linearGradient4263' y2='113.1' gradientUnits='userSpaceOnUse' y1='76.066' gradientTransform='translate(0 -.0012816)' x2='199.26' x1='160.9'%3e %3cstop id='stop4259' stop-color='white' stop-opacity='.33333' offset='0'/%3e %3cstop id='stop4261' stop-color='white' stop-opacity='0' offset='1'/%3e %3c/linearGradient%3e %3clinearGradient id='linearGradient4240' y2='79.833' gradientUnits='userSpaceOnUse' x2='120.82' y1='120.77' x1='128.56'%3e %3cstop id='stop4236' stop-color='white' stop-opacity='0' offset='0'/%3e %3cstop id='stop4238' stop-color='white' stop-opacity='.33333' offset='1'/%3e %3c/linearGradient%3e %3c/defs%3e %3cg id='layer1' transform='translate(353.49 -626.07)'%3e %3cg id='g4'%3e %3cpath id='path4220' d='m-207 679.86c-7.6546-3.9726-16.149-6.0541-24.773-6.0703-24.585 0.0315-46.045 16.665-52.207 40.465-2.23-0.35755-4.4838-0.54689-6.7422-0.56642-24.881-0.00043-45.051 20.17-45.051 45.051-0.00043 24.881 20.17 45.051 45.051 45.051 36.152-0.20272 72.845-0.0898 109.18-0.0898 8.9834 0 22.962 0.009 36.879 0.0165 9.7409 0.38215 35.645-0.43398 53.537-23.548 17.892-23.115 7.1203-72.79-0.31513-94.017s-30.566-42.361-53.247-42.361c-26.664 0-50.367 14.562-62.311 36.07z' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='%230b9ee5'/%3e %3cpath id='path4220-7' opacity='.98' d='m-335.78 758.74c-0.00043 24.881 20.17 45.051 45.051 45.051 36.152-0.20272 72.845-0.0898 109.18-0.0898 10.101 0 27.126 0.009 42.523 0.0156 11.975-0.4199 32.775-4.017 47.893-23.547 4.439-5.7347 7.1108-13.107 8.5098-21.271-35.448-0.0105-239.67-0.15823-253.16-0.15823z' fill='%2360bce9'/%3e %3c/g%3e %3cpath id='path4220-2' d='m-144.69 643.79c-19.529 0-37.464 7.8167-50.359 20.447-4.6476 4.6419-8.6513 9.9041-11.953 15.623 0 40.944 0.0195 77.914 0.0195 123.83 8.4824 0.007 16.983 0.0137 25.438 0.0137 10.101 0 27.126 0.009 42.523 0.0156 11.975-0.4199 32.775-4.017 47.893-23.547 17.892-23.115 7.1209-72.791-0.31446-94.018s-30.565-42.361-53.246-42.361z' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='white' fill-opacity='.31373'/%3e %3c/g%3e %3cg id='g4244' transform='translate(2.926 -1.3827)'%3e %3cpath id='path4329' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='%23003232' d='m211.54 98.88c11.484 8.7901 14.857 8.43 22.486 19.238 3.6519 5.1733 5.5602 11.69 5.5645 18.164-0.00018 17.949-14.551 32.499-32.5 32.498-17.948-0.00018-32.498-14.55-32.498-32.498 0.006-0.50098 0.0236-1.0018 0.0527-1.502-3.4629-1.1175-6.9173-1.9297-9.6543-1.9297-2.7565 0-6.2409 0.82134-9.7285 1.9512 0.036 0.49286 0.0607 0.98649 0.0742 1.4805-0.00018 17.948-14.55 32.498-32.498 32.498-17.948-0.00019-32.498-14.55-32.498-32.498 0.006-3.5239 0.71774-6.9687 1.8781-10.26 5.474-20.521 8.7944-44.229 27.665-46.855 8.2552-1.1488 15.952 8.848 25.107 8.848 9.1558-0.00028 9.318-14.58 23.088-14.836 16.828-0.3123 31.185 16.304 43.462 25.701zm-4.7539 13.92c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-84.125 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z'/%3e %3cpath id='path4329-2' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='url(%23linearGradient4263)' d='m157.24 77.869c-2.1199 2.1753-3.6401 4.4832-5.4018 6.5241-0.53185 0.61614-1.2448 1.3191-1.8477 1.7949-1.2058 0.9517-2.5477 1.6107-4.168 1.7793-0.27005 0.0281-0.54787 0.04296-0.83398 0.04297 5.0928 13.298 11.821 26.014 20 44.834 2.737 0 6.1914 0.8122 9.6543 1.9297-0.0291 0.5002-0.0467 1.001-0.0527 1.502 0 8.4131 3.196 16.08 8.4414 21.852 0.34969 0.38474 0.70861 0.75939 1.0762 1.127 5.881 5.8809 14.007 9.5194 22.98 9.5195 0.5609 0.00004 1.118-0.0149 1.6719-0.043 3.3236-0.16829 6.5154-0.83435 9.502-1.9277 0.99554-0.36446 1.9688-0.77802 2.916-1.2344 1.4208-0.68453 2.7833-1.4677 4.0801-2.3438 8.645-5.84 14.33-15.731 14.33-26.949-0.004-6.474-2.0849-12.873-5.5645-18.164-7.0668-10.745-14.684-12.763-22.486-19.238-11.815-9.8048-26.968-25.716-42.627-25.716-6.2104 0-9.3385 2.3185-11.67 4.7112zm49.543 34.924c4.9706 0 9.5876 1.5119 13.418 4.0996 0.6384 0.43129 1.255 0.89176 1.8476 1.3809 0.59266 0.4891 1.1622 1.0059 1.7051 1.5488 4.3431 4.3431 7.0293 10.343 7.0293 16.971 0 12.841-10.085 23.326-22.766 23.969-0.40906 0.0207-0.82015 0.0312-1.2344 0.0312-4.97 0-9.5878-1.5105-13.418-4.0976-0.00044-0.0003-0.002 0.00029-0.002 0-6.384-4.3129-10.58-11.618-10.58-19.902 0-6.6275 2.6862-12.628 7.0293-16.971 0.54288-0.54289 1.1124-1.0597 1.7051-1.5488 0.59266-0.4891 1.2073-0.94957 1.8457-1.3809 3.8304-2.5878 8.4493-4.0996 13.42-4.0996z'/%3e %3cpath id='path4329-7' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' d='m121.43 79.077c-0.51208-0.01011-1.027 0.01805-1.543 0.08985-18.871 2.626-22.19 26.335-27.664 46.856-1.1604 3.2913-1.8729 6.7359-1.8789 10.26 0 17.948 14.55 32.498 32.498 32.498s32.498-14.55 32.498-32.498c-0.0135-0.49402-0.0382-0.98762-0.0742-1.4805 3.5012-1.0071 5.7853-1.8693 9.6893-1.9248-4.8944-11.377-14.29-31.914-19.961-44.863-8.5828 0.000001-15.883-8.7859-23.565-8.9376zm1.2344 33.723c13.255 0 24 10.745 24 24s-10.745 24-24 24-24-10.745-24-24 10.745-24 24-24z' fill='url(%23linearGradient4240)'/%3e %3c/g%3e%3c/svg%3e";
777
826
 
778
- var useStyles$a = makeStyles(function (theme) {
827
+ var useStyles$8 = makeStyles(function (theme) {
779
828
  var _header;
780
829
 
781
830
  return {
@@ -812,7 +861,7 @@ var AppHeader = function AppHeader(_ref) {
812
861
  userMenu = _ref.userMenu,
813
862
  _ref$title = _ref.title,
814
863
  title = _ref$title === void 0 ? 'GeoWeb' : _ref$title;
815
- var classes = useStyles$a();
864
+ var classes = useStyles$8();
816
865
  return /*#__PURE__*/React__default.createElement("header", {
817
866
  className: classes.header
818
867
  }, /*#__PURE__*/React__default.createElement(Grid, {
@@ -896,38 +945,29 @@ var DraggableComponent$1 = function DraggableComponent(_a) {
896
945
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
897
946
  * */
898
947
 
899
- var useStyles$9 = function useStyles(isRightAligned) {
900
- return makeStyles(function () {
901
- return {
902
- icon: Object.assign(Object.assign({
903
- width: 20,
904
- height: 20,
905
- top: -10,
906
- position: 'relative'
907
- }, isRightAligned ? {
908
- left: -10
909
- } : {
910
- left: 10,
911
- transform: 'rotate(90deg)'
912
- }), {
913
- zIndex: 1
914
- })
915
- };
916
- });
917
- };
918
-
919
948
  var ResizeHandle = function ResizeHandle(_ref2) {
920
949
  var isRightAligned = _ref2.isRightAligned;
921
950
  var theme = useTheme();
922
- var styles = useStyles$9(isRightAligned)();
923
951
  return /*#__PURE__*/React__default.createElement(SvgIcon, {
924
- className: styles.icon,
952
+ sx: Object.assign(Object.assign({
953
+ width: 20,
954
+ height: 20,
955
+ top: -10,
956
+ position: 'relative'
957
+ }, isRightAligned ? {
958
+ left: -10
959
+ } : {
960
+ left: 10,
961
+ transform: 'rotate(90deg)'
962
+ }), {
963
+ zIndex: 1
964
+ }),
925
965
  "data-testid": "resizeHandle"
926
966
  }, /*#__PURE__*/React__default.createElement("rect", {
927
967
  fill: "#ffffff"
928
968
  }), /*#__PURE__*/React__default.createElement("path", {
929
969
  d: "M19.687 18.037v1h-6v-1h6zm3.5-3.5v1h-13v-1h13z",
930
- fill: "".concat(theme.palette.geowebColors.greys.accessible),
970
+ fill: "".concat(theme.palette.geowebColors.buttons.flat["default"].color),
931
971
  transform: "rotate(-45 16.687 16.787)"
932
972
  }));
933
973
  };
@@ -1103,7 +1143,7 @@ ErrorBoundary.defaultProps = {
1103
1143
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1104
1144
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1105
1145
  * */
1106
- var useStyles$8 = makeStyles(function (theme) {
1146
+ var useStyles$7 = makeStyles(function (theme) {
1107
1147
  return {
1108
1148
  container: {
1109
1149
  position: 'absolute',
@@ -1151,7 +1191,7 @@ var UserMenu = function UserMenu(_ref) {
1151
1191
  } : _ref$onClose,
1152
1192
  children = _ref.children,
1153
1193
  initials = _ref.initials;
1154
- var classes = useStyles$8();
1194
+ var classes = useStyles$7();
1155
1195
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
1156
1196
  "data-testid": "userButton",
1157
1197
  onClick: onToggle,
@@ -1193,7 +1233,9 @@ var MenuItemTheme = function MenuItemTheme() {
1193
1233
  isDark = _useThemeContext.isDark,
1194
1234
  toggleTheme = _useThemeContext.toggleTheme;
1195
1235
 
1196
- return /*#__PURE__*/React__default.createElement(MenuItem, null, /*#__PURE__*/React__default.createElement(Grid, {
1236
+ return /*#__PURE__*/React__default.createElement(MenuItem, {
1237
+ divider: true
1238
+ }, /*#__PURE__*/React__default.createElement(Grid, {
1197
1239
  container: true
1198
1240
  }, /*#__PURE__*/React__default.createElement(Grid, {
1199
1241
  item: true
@@ -1232,7 +1274,7 @@ var MenuItemTheme = function MenuItemTheme() {
1232
1274
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1233
1275
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1234
1276
  * */
1235
- var useStyles$7 = makeStyles(function (theme) {
1277
+ var useStyles$6 = makeStyles(function (theme) {
1236
1278
  return {
1237
1279
  footer: {
1238
1280
  boxShadow: theme.shadows[1],
@@ -1245,7 +1287,7 @@ var useStyles$7 = makeStyles(function (theme) {
1245
1287
  }); // drag handles will be handled by DraggableResizable/Resizable
1246
1288
 
1247
1289
  var ToolFooter = function ToolFooter() {
1248
- var classes = useStyles$7();
1290
+ var classes = useStyles$6();
1249
1291
  return /*#__PURE__*/React__default.createElement("footer", {
1250
1292
  className: classes.footer
1251
1293
  });
@@ -1283,7 +1325,7 @@ var getStyle = function getStyle(size) {
1283
1325
  return {
1284
1326
  fontSize: 16,
1285
1327
  fontWeight: 500,
1286
- padding: 4
1328
+ padding: '4px'
1287
1329
  };
1288
1330
  }
1289
1331
 
@@ -1292,7 +1334,7 @@ var getStyle = function getStyle(size) {
1292
1334
  return {
1293
1335
  fontSize: 20,
1294
1336
  fontWeight: 400,
1295
- padding: 8
1337
+ padding: '8px'
1296
1338
  };
1297
1339
  }
1298
1340
 
@@ -1301,7 +1343,7 @@ var getStyle = function getStyle(size) {
1301
1343
  return {
1302
1344
  fontSize: 16,
1303
1345
  fontWeight: 500,
1304
- padding: 12
1346
+ padding: '12px'
1305
1347
  };
1306
1348
  }
1307
1349
 
@@ -1312,45 +1354,13 @@ var getStyle = function getStyle(size) {
1312
1354
  }
1313
1355
  };
1314
1356
 
1315
- var useStyles$6 = makeStyles(function (theme) {
1316
- return {
1317
- header: {
1318
- boxShadow: theme.shadows[1],
1319
- background: theme.palette.geowebColors.background.surface,
1320
- padding: function padding(props) {
1321
- return props.styles.padding;
1322
- },
1323
- zIndex: 1,
1324
- cursor: function cursor(props) {
1325
- return props.isDraggable ? 'move' : null;
1326
- }
1327
- },
1328
- title: {
1329
- fontSize: function fontSize(props) {
1330
- return props.styles.fontSize;
1331
- },
1332
- fontWeight: function fontWeight(props) {
1333
- return props.styles.fontWeight;
1334
- }
1335
- },
1336
- iconClose: {
1337
- color: theme.palette.geowebColors.greys.accessible,
1338
- padding: 0
1339
- },
1340
- iconDrag: {
1341
- color: theme.palette.geowebColors.greys.accessible,
1342
- padding: 0,
1343
- pointerEvents: 'none'
1344
- },
1345
- iconDragHorizontal: {
1346
- color: theme.palette.geowebColors.greys.accessible,
1347
- padding: 0,
1348
- pointerEvents: 'none',
1349
- transform: 'rotate(90deg)',
1350
- height: 12
1351
- }
1352
- };
1353
- });
1357
+ var iconStyle = {
1358
+ color: 'geowebColors.greys.accessible',
1359
+ padding: 0,
1360
+ '&:hover': {
1361
+ background: 'action.hover'
1362
+ }
1363
+ };
1354
1364
 
1355
1365
  var ToolHeader = function ToolHeader(_ref) {
1356
1366
  var size = _ref.size,
@@ -1362,17 +1372,21 @@ var ToolHeader = function ToolHeader(_ref) {
1362
1372
  _ref$className = _ref.className,
1363
1373
  className = _ref$className === void 0 ? '' : _ref$className;
1364
1374
  var styles = getStyle(size);
1365
- var classes = useStyles$6({
1366
- styles: styles,
1367
- isDraggable: isDraggable
1368
- });
1369
1375
 
1370
1376
  var onClickClose = function onClickClose() {
1371
1377
  return onClose();
1372
1378
  };
1373
1379
 
1374
- return /*#__PURE__*/React__default.createElement("header", {
1375
- className: "".concat(classes.header, " ").concat(className)
1380
+ return /*#__PURE__*/React__default.createElement(Box, {
1381
+ component: "header",
1382
+ className: className,
1383
+ sx: {
1384
+ boxShadow: 1,
1385
+ backgroundColor: 'geowebColors.background.surface',
1386
+ padding: styles.padding,
1387
+ zIndex: 2,
1388
+ cursor: isDraggable ? 'move' : null
1389
+ }
1376
1390
  }, /*#__PURE__*/React__default.createElement(Grid, {
1377
1391
  container: true,
1378
1392
  alignItems: "center"
@@ -1384,9 +1398,11 @@ var ToolHeader = function ToolHeader(_ref) {
1384
1398
  justifyContent: "flex-start"
1385
1399
  }, isDraggable && size !== 'xxs' && /*#__PURE__*/React__default.createElement(IconButton, {
1386
1400
  "data-testid": "dragBtn",
1387
- className: classes.iconDrag,
1388
1401
  disableRipple: true,
1389
- size: "large"
1402
+ size: "large",
1403
+ sx: Object.assign(Object.assign({}, iconStyle), {
1404
+ pointerEvents: 'none'
1405
+ })
1390
1406
  }, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
1391
1407
  item: true,
1392
1408
  xs: 10
@@ -1396,12 +1412,19 @@ var ToolHeader = function ToolHeader(_ref) {
1396
1412
  alignItems: "center"
1397
1413
  }, title && /*#__PURE__*/React__default.createElement(Typography, {
1398
1414
  variant: "h2",
1399
- className: classes.title
1415
+ sx: {
1416
+ fontSize: styles.fontSize,
1417
+ fontWeight: styles.fontWeight
1418
+ }
1400
1419
  }, title), size === 'xxs' && /*#__PURE__*/React__default.createElement(IconButton, {
1401
1420
  "data-testid": "dragBtn-xxs",
1402
- className: classes.iconDragHorizontal,
1403
1421
  disableRipple: true,
1404
- size: "small"
1422
+ size: "small",
1423
+ sx: Object.assign(Object.assign({}, iconStyle), {
1424
+ pointerEvents: 'none',
1425
+ transform: 'rotate(90deg)',
1426
+ height: 12
1427
+ })
1405
1428
  }, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
1406
1429
  item: true,
1407
1430
  xs: 1,
@@ -1409,10 +1432,10 @@ var ToolHeader = function ToolHeader(_ref) {
1409
1432
  justifyContent: "flex-end"
1410
1433
  }, onClose && /*#__PURE__*/React__default.createElement(IconButton, {
1411
1434
  "data-testid": "closeBtn",
1412
- className: classes.iconClose,
1413
1435
  onClick: onClickClose,
1414
- size: "large"
1415
- }, /*#__PURE__*/React__default.createElement(Close, null)))));
1436
+ size: "large",
1437
+ sx: iconStyle
1438
+ }, /*#__PURE__*/React__default.createElement(Close$1, null)))));
1416
1439
  };
1417
1440
 
1418
1441
  /* *
@@ -1443,7 +1466,6 @@ var useStyles$5 = makeStyles(function () {
1443
1466
  content: {
1444
1467
  flex: 1,
1445
1468
  overflowY: 'auto',
1446
- zIndex: 2,
1447
1469
  position: 'relative'
1448
1470
  }
1449
1471
  };
@@ -1487,6 +1509,18 @@ var ToolContainer = function ToolContainer(_a) {
1487
1509
  }, children), isResizable && /*#__PURE__*/React__default.createElement(ToolFooter, null));
1488
1510
  };
1489
1511
 
1512
+ var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
1513
+ var width = window.innerWidth * 0.85;
1514
+ var height = window.innerHeight * 0.85;
1515
+ var top = window.innerHeight * 0.15 / 2;
1516
+ var left = window.innerWidth * 0.15 / 2;
1517
+ return {
1518
+ width: width,
1519
+ height: height,
1520
+ top: top,
1521
+ left: left
1522
+ };
1523
+ };
1490
1524
  var BASE_Z_INDEX = 100;
1491
1525
 
1492
1526
  var DraggableComponent = function DraggableComponent(_a) {
@@ -1621,6 +1655,7 @@ var DraggableComponent = function DraggableComponent(_a) {
1621
1655
  }, /*#__PURE__*/React__default.createElement("div", {
1622
1656
  style: Object.assign({
1623
1657
  position: 'absolute',
1658
+ pointerEvents: 'all',
1624
1659
  zIndex: zIndex
1625
1660
  }, startPosition),
1626
1661
  ref: nodeRef
@@ -2023,6 +2058,14 @@ var shortcuts = [{
2023
2058
  }, "+"), /*#__PURE__*/React__default.createElement(ShortCutSegment, {
2024
2059
  type: "icon"
2025
2060
  }, /*#__PURE__*/React__default.createElement(ArrowLeftIcon, null)))
2061
+ }, {
2062
+ title: 'Change layer manager values by scrolling',
2063
+ description: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ShortCutSegment, {
2064
+ type: "icon"
2065
+ }, "Ctrl"), /*#__PURE__*/React__default.createElement(ShortCutSegment, null, " + Mouse scroll")),
2066
+ descriptionMac: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ShortCutSegment, {
2067
+ type: "icon"
2068
+ }, /*#__PURE__*/React__default.createElement(CommandIcon, null)), /*#__PURE__*/React__default.createElement(ShortCutSegment, null, " + Mouse scroll"))
2026
2069
  }];
2027
2070
  var getShortcutList = function getShortcutList(shortcutList) {
2028
2071
  var platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'windows';
@@ -2165,7 +2208,8 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
2165
2208
 
2166
2209
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MenuItem, {
2167
2210
  "data-testid": "cheatsheet-btn",
2168
- onClick: onOpen
2211
+ onClick: onOpen,
2212
+ divider: true
2169
2213
  }, /*#__PURE__*/React__default.createElement(Grid, {
2170
2214
  container: true
2171
2215
  }, /*#__PURE__*/React__default.createElement(Grid, {
@@ -2357,83 +2401,373 @@ var CustomSlider = function CustomSlider(_a) {
2357
2401
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2358
2402
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
2359
2403
  * */
2360
- var Z_INDEX_TOP = 600;
2361
- var Z_INDEX_BOTTOM = 550;
2362
- var useStyles = makeStyles(function (theme) {
2363
- return createStyles({
2364
- draggableDialog: function draggableDialog(props) {
2404
+
2405
+ var CustomToggleButton = function CustomToggleButton(_a) {
2406
+ var _a$variant = _a.variant,
2407
+ variant = _a$variant === void 0 ? 'primary' : _a$variant,
2408
+ _a$value = _a.value,
2409
+ value = _a$value === void 0 ? 0 : _a$value,
2410
+ props = __rest(_a, ["variant", "value"]);
2411
+
2412
+ return /*#__PURE__*/React.createElement(ToggleButton, Object.assign({
2413
+ className: variant,
2414
+ value: value
2415
+ }, props));
2416
+ };
2417
+
2418
+ /* *
2419
+ * Licensed under the Apache License, Version 2.0 (the "License");
2420
+ * you may not use this file except in compliance with the License.
2421
+ * You may obtain a copy of the License at
2422
+ *
2423
+ * http://www.apache.org/licenses/LICENSE-2.0
2424
+ *
2425
+ * Unless required by applicable law or agreed to in writing, software
2426
+ * distributed under the License is distributed on an "AS IS" BASIS,
2427
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2428
+ * See the License for the specific language governing permissions and
2429
+ * limitations under the License.
2430
+ *
2431
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2432
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2433
+ * */
2434
+ var ToolButton = function ToolButton(_a) {
2435
+ var active = _a.active,
2436
+ _a$width = _a.width,
2437
+ width = _a$width === void 0 ? '24px' : _a$width,
2438
+ _a$height = _a.height,
2439
+ height = _a$height === void 0 ? '24px' : _a$height,
2440
+ children = _a.children,
2441
+ _a$value = _a.value,
2442
+ value = _a$value === void 0 ? 0 : _a$value,
2443
+ _a$sx = _a.sx,
2444
+ sx = _a$sx === void 0 ? {} : _a$sx,
2445
+ props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
2446
+
2447
+ return /*#__PURE__*/React.createElement(CustomToggleButton, Object.assign({
2448
+ variant: "tool",
2449
+ disableRipple: true,
2450
+ selected: active,
2451
+ value: value,
2452
+ sx: Object.assign({
2453
+ width: "".concat(width, "!important"),
2454
+ height: "".concat(height, "!important"),
2455
+ textTransform: 'none!important',
2456
+ padding: '11px!important'
2457
+ }, sx)
2458
+ }, props), children);
2459
+ };
2460
+
2461
+ var getPosition = function getPosition(menuPosition) {
2462
+ switch (menuPosition) {
2463
+ case 'bottom':
2365
2464
  return {
2366
- width: props.dialogWidth ? props.dialogWidth : '90%',
2367
- position: 'absolute',
2368
- top: props.dialogTop ? props.dialogTop : '2%',
2369
- left: '5%',
2370
- maxWidth: '90%',
2371
- maxHeight: props.dialogMaxHeight ? props.dialogMaxHeight : '95%',
2372
- display: 'flex',
2373
- flexDirection: 'column',
2374
- overflow: 'hidden',
2375
- zIndex: props.zIndex
2465
+ anchorOrigin: {
2466
+ vertical: 'bottom',
2467
+ horizontal: 'center'
2468
+ },
2469
+ transformOrigin: {
2470
+ vertical: 'top',
2471
+ horizontal: 'center'
2472
+ }
2376
2473
  };
2377
- },
2378
- dialogContent: {
2379
- marginTop: '40px',
2380
- overflowY: 'scroll'
2381
- },
2382
- dialogHeader: function dialogHeader(props) {
2474
+
2475
+ default:
2476
+ case 'left':
2383
2477
  return {
2384
- position: 'absolute',
2385
- display: 'flex',
2386
- justifyContent: 'space-between',
2387
- alignItems: 'center',
2388
- boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)',
2389
- width: '100%',
2390
- backgroundColor: '#ffffff',
2391
- zIndex: props.zIndex + 10
2478
+ anchorOrigin: {
2479
+ vertical: 'center',
2480
+ horizontal: 'left'
2481
+ },
2482
+ transformOrigin: {
2483
+ vertical: 'center',
2484
+ horizontal: 'right'
2485
+ }
2392
2486
  };
2487
+ }
2488
+ };
2489
+
2490
+ var ToggleMenu = function ToggleMenu(_ref) {
2491
+ var _ref$buttonTestId = _ref.buttonTestId,
2492
+ buttonTestId = _ref$buttonTestId === void 0 ? 'toggleMenuButton' : _ref$buttonTestId,
2493
+ _ref$menuPosition = _ref.menuPosition,
2494
+ menuPosition = _ref$menuPosition === void 0 ? 'left' : _ref$menuPosition,
2495
+ menuItems = _ref.menuItems,
2496
+ children = _ref.children,
2497
+ buttonSx = _ref.buttonSx,
2498
+ _ref$tooltipTitle = _ref.tooltipTitle,
2499
+ tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle;
2500
+
2501
+ var _React$useState = React.useState(null),
2502
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2503
+ anchorEl = _React$useState2[0],
2504
+ setAnchorEl = _React$useState2[1];
2505
+
2506
+ var isOpen = Boolean(anchorEl);
2507
+
2508
+ var _getPosition = getPosition(menuPosition),
2509
+ anchorOrigin = _getPosition.anchorOrigin,
2510
+ transformOrigin = _getPosition.transformOrigin;
2511
+
2512
+ var handleClick = function handleClick(event) {
2513
+ setAnchorEl(event.currentTarget);
2514
+ };
2515
+
2516
+ var handleClose = function handleClose() {
2517
+ setAnchorEl(null);
2518
+ };
2519
+
2520
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToolButton, {
2521
+ active: isOpen,
2522
+ sx: buttonSx,
2523
+ onClick: handleClick,
2524
+ "data-testid": buttonTestId
2525
+ }, /*#__PURE__*/React.createElement(Tooltip, {
2526
+ placement: "top",
2527
+ title: tooltipTitle
2528
+ }, /*#__PURE__*/React.createElement(MoreVertIcon, null))), /*#__PURE__*/React.createElement(Menu, {
2529
+ anchorEl: anchorEl,
2530
+ open: isOpen,
2531
+ onClose: handleClose,
2532
+ anchorOrigin: anchorOrigin,
2533
+ transformOrigin: transformOrigin,
2534
+ BackdropProps: {
2535
+ style: {
2536
+ opacity: 0,
2537
+ transition: 'none'
2538
+ }
2393
2539
  },
2394
- iconClose: {
2395
- padding: theme.spacing(1)
2540
+ MenuListProps: children && {
2541
+ style: {
2542
+ padding: '0px'
2543
+ }
2544
+ }
2545
+ }, menuItems && menuItems.map(function (menuItem) {
2546
+ var text = menuItem.text,
2547
+ icon = menuItem.icon,
2548
+ action = menuItem.action;
2549
+ return /*#__PURE__*/React.createElement(MenuItem, {
2550
+ key: text,
2551
+ onClick: function onClick() {
2552
+ action();
2553
+ handleClose();
2554
+ }
2555
+ }, icon && /*#__PURE__*/React.createElement(ListItemIcon, null, icon), /*#__PURE__*/React.createElement(Typography, null, text));
2556
+ }), children));
2557
+ };
2558
+
2559
+ /* *
2560
+ * Licensed under the Apache License, Version 2.0 (the "License");
2561
+ * you may not use this file except in compliance with the License.
2562
+ * You may obtain a copy of the License at
2563
+ *
2564
+ * http://www.apache.org/licenses/LICENSE-2.0
2565
+ *
2566
+ * Unless required by applicable law or agreed to in writing, software
2567
+ * distributed under the License is distributed on an "AS IS" BASIS,
2568
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2569
+ * See the License for the specific language governing permissions and
2570
+ * limitations under the License.
2571
+ *
2572
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2573
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
2574
+ * */
2575
+ var useStyles = makeStyles(function (theme) {
2576
+ return createStyles({
2577
+ button: {
2578
+ height: 28,
2579
+ width: 28,
2580
+ borderRadius: 5,
2581
+ marginTop: 2,
2582
+ color: function color(_ref) {
2583
+ var isActive = _ref.isActive,
2584
+ isAccessible = _ref.isAccessible,
2585
+ isEnabled = _ref.isEnabled;
2586
+
2587
+ if (!isEnabled) {
2588
+ return theme.palette.geowebColors.buttons.flat.disabled.color;
2589
+ }
2590
+
2591
+ if (isAccessible) {
2592
+ return theme.palette.geowebColors.greys.accessible;
2593
+ }
2594
+
2595
+ if (isActive) {
2596
+ return theme.palette.common.white;
2597
+ }
2598
+
2599
+ return theme.palette.geowebColors.buttons.flat["default"].color;
2600
+ },
2601
+ backgroundColor: function backgroundColor(_ref2) {
2602
+ var isActive = _ref2.isActive;
2603
+ return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
2604
+ },
2605
+ '&:focus': {
2606
+ backgroundColor: function backgroundColor(_ref3) {
2607
+ var isActive = _ref3.isActive;
2608
+ return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
2609
+ },
2610
+ outline: theme.palette.geowebColors.buttons.focusDefault.outline,
2611
+ borderRadius: 0
2612
+ },
2613
+ '&:hover': {
2614
+ backgroundColor: function backgroundColor(_ref4) {
2615
+ var isActive = _ref4.isActive;
2616
+ return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
2617
+ }
2618
+ }
2396
2619
  },
2397
- iconDrag: {
2398
- padding: theme.spacing(1)
2620
+ popper: {
2621
+ pointerEvents: 'none'
2399
2622
  }
2400
2623
  });
2401
2624
  });
2625
+ var ManagerButton = function ManagerButton(_a) {
2626
+ var _a$tooltipTitle = _a.tooltipTitle,
2627
+ tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
2628
+ _a$onClick = _a.onClick,
2629
+ onClick = _a$onClick === void 0 ? function () {} : _a$onClick,
2630
+ _a$isActive = _a.isActive,
2631
+ isActive = _a$isActive === void 0 ? false : _a$isActive,
2632
+ _a$isEnabled = _a.isEnabled,
2633
+ isEnabled = _a$isEnabled === void 0 ? true : _a$isEnabled,
2634
+ icon = _a.icon,
2635
+ testId = _a.testId,
2636
+ _a$isAccessible = _a.isAccessible,
2637
+ isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
2638
+ className = _a.className,
2639
+ props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
2640
+
2641
+ var classes = useStyles({
2642
+ isActive: isActive,
2643
+ isEnabled: isEnabled,
2644
+ isAccessible: isAccessible
2645
+ });
2646
+
2647
+ var handleClick = function handleClick(event) {
2648
+ onClick(event);
2649
+ };
2650
+
2651
+ return /*#__PURE__*/React.createElement(Tooltip, {
2652
+ title: tooltipTitle,
2653
+ placement: "top",
2654
+ classes: {
2655
+ popper: classes.popper
2656
+ }
2657
+ }, /*#__PURE__*/React.createElement(IconButton, Object.assign({
2658
+ size: "small",
2659
+ onClick: handleClick,
2660
+ "data-testid": testId,
2661
+ className: "".concat(classes.button, " ").concat(className),
2662
+ disableFocusRipple: true
2663
+ }, props), icon));
2664
+ };
2665
+
2666
+ /* *
2667
+ * Licensed under the Apache License, Version 2.0 (the "License");
2668
+ * you may not use this file except in compliance with the License.
2669
+ * You may obtain a copy of the License at
2670
+ *
2671
+ * http://www.apache.org/licenses/LICENSE-2.0
2672
+ *
2673
+ * Unless required by applicable law or agreed to in writing, software
2674
+ * distributed under the License is distributed on an "AS IS" BASIS,
2675
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2676
+ * See the License for the specific language governing permissions and
2677
+ * limitations under the License.
2678
+ *
2679
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2680
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2681
+ * */
2682
+ var ManagerDeleteButton = function ManagerDeleteButton(_ref) {
2683
+ var tooltipTitle = _ref.tooltipTitle,
2684
+ onClickDelete = _ref.onClickDelete,
2685
+ _ref$isEnabled = _ref.isEnabled,
2686
+ isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
2687
+ return /*#__PURE__*/React.createElement(ManagerButton, {
2688
+ tooltipTitle: tooltipTitle,
2689
+ onClick: onClickDelete,
2690
+ icon: /*#__PURE__*/React.createElement(Delete, {
2691
+ sx: {
2692
+ width: 20,
2693
+ height: 20
2694
+ }
2695
+ }),
2696
+ testId: "deleteButton",
2697
+ isEnabled: isEnabled
2698
+ });
2699
+ };
2402
2700
 
2403
- var DraggableDialog = function DraggableDialog(_ref) {
2404
- var handleClose = _ref.handleClose,
2701
+ /* *
2702
+ * Licensed under the Apache License, Version 2.0 (the "License");
2703
+ * you may not use this file except in compliance with the License.
2704
+ * You may obtain a copy of the License at
2705
+ *
2706
+ * http://www.apache.org/licenses/LICENSE-2.0
2707
+ *
2708
+ * Unless required by applicable law or agreed to in writing, software
2709
+ * distributed under the License is distributed on an "AS IS" BASIS,
2710
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2711
+ * See the License for the specific language governing permissions and
2712
+ * limitations under the License.
2713
+ *
2714
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2715
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2716
+ * */
2717
+ var EnableButton = function EnableButton(_ref) {
2718
+ var isEnabled = _ref.isEnabled,
2405
2719
  title = _ref.title,
2406
- children = _ref.children,
2407
- _ref$dialogStyling = _ref.dialogStyling,
2408
- dialogStyling = _ref$dialogStyling === void 0 ? {} : _ref$dialogStyling,
2409
- _ref$zIndex = _ref.zIndex,
2410
- zIndex = _ref$zIndex === void 0 ? Z_INDEX_TOP : _ref$zIndex;
2411
- var classes = useStyles(Object.assign(Object.assign({}, dialogStyling), {
2412
- zIndex: zIndex
2720
+ onChangeEnableLayer = _ref.onChangeEnableLayer;
2721
+
2722
+ var onClick = function onClick() {
2723
+ onChangeEnableLayer(!isEnabled);
2724
+ };
2725
+
2726
+ var visibilityIcon = /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("rect", {
2727
+ width: 24,
2728
+ height: 24,
2729
+ fill: "transparent"
2730
+ }), /*#__PURE__*/React.createElement("path", {
2731
+ 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"
2413
2732
  }));
2414
- return /*#__PURE__*/React.createElement(Draggable, {
2415
- handle: "strong",
2416
- bounds: "body"
2417
- }, /*#__PURE__*/React.createElement(Paper, {
2418
- "data-testid": title,
2419
- className: classes.draggableDialog,
2420
- elevation: 24
2421
- }, /*#__PURE__*/React.createElement("div", {
2422
- className: classes.dialogHeader
2423
- }, /*#__PURE__*/React.createElement("strong", null, /*#__PURE__*/React.createElement(IconButton, {
2424
- "data-testid": "dragDialog",
2425
- size: "small",
2426
- className: classes.iconDrag
2427
- }, /*#__PURE__*/React.createElement(DragIndicator, null))), /*#__PURE__*/React.createElement(Typography, {
2428
- variant: "subtitle1"
2429
- }, title), /*#__PURE__*/React.createElement(IconButton, {
2430
- "data-testid": "closeDialog",
2431
- size: "small",
2432
- onClick: handleClose,
2433
- className: classes.iconClose
2434
- }, /*#__PURE__*/React.createElement(Close, null))), /*#__PURE__*/React.createElement("div", {
2435
- className: classes.dialogContent
2436
- }, children)));
2733
+ var visibilityOffIcon = /*#__PURE__*/React.createElement(SvgIcon, {
2734
+ style: {
2735
+ marginTop: 2
2736
+ }
2737
+ }, /*#__PURE__*/React.createElement("rect", {
2738
+ width: 24,
2739
+ height: 24,
2740
+ fill: "transparent"
2741
+ }), /*#__PURE__*/React.createElement("path", {
2742
+ 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"
2743
+ }));
2744
+ return /*#__PURE__*/React.createElement(ManagerButton, {
2745
+ tooltipTitle: title,
2746
+ onClick: onClick,
2747
+ icon: /*#__PURE__*/React.createElement(Checkbox, {
2748
+ sx: {
2749
+ color: 'inherit',
2750
+ padding: 0.5,
2751
+ borderRadius: 1.25,
2752
+ '&.Mui-focusVisible': {
2753
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
2754
+ },
2755
+ '&:hover': {
2756
+ backgroundColor: 'transparent!important'
2757
+ },
2758
+ '&.Mui-checked': {
2759
+ color: 'inherit'
2760
+ }
2761
+ },
2762
+ icon: visibilityOffIcon,
2763
+ checkedIcon: visibilityIcon,
2764
+ checked: isEnabled,
2765
+ disableFocusRipple: true,
2766
+ tabIndex: -1
2767
+ }),
2768
+ testId: "enableButton",
2769
+ isEnabled: isEnabled
2770
+ });
2437
2771
  };
2438
2772
 
2439
2773
  /* *
@@ -2470,4 +2804,4 @@ var getAxiosErrorMessage = function getAxiosErrorMessage(error) {
2470
2804
  return 'An error has occurred';
2471
2805
  };
2472
2806
 
2473
- export { AlertBanner, AppHeader, AppLayout, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, DraggableComponent$1 as Draggable, DraggableDialog, ErrorBoundary, HIDDEN_INPUT_HELPER_IS_DRAFT, ResizeComponent as Resizable, StatusTag, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, Z_INDEX_BOTTOM, Z_INDEX_TOP, getAxiosErrorMessage, getInitials, isAxiosError, showPrompt, sliderStyles, useConfirmationDialog, useDialogActions, useDraftFormHelpers, useIsMounted, usePoller, usePreventBrowserClose, usePrevious, useUserMenu };
2807
+ export { AlertBanner, AppHeader, AppLayout, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, CustomToggleButton, DraggableComponent$1 as Draggable, EnableButton, ErrorBoundary, HIDDEN_INPUT_HELPER_IS_DRAFT, ManagerButton, ManagerDeleteButton, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, calculateDialogSizeAndPosition, getAxiosErrorMessage, getInitials, isAxiosError, showPrompt, sliderStyles, useConfirmationDialog, useDialogActions, useDraftFormHelpers, useIsMounted, usePoller, usePreventBrowserClose, usePrevious, useUserMenu };