@opengeoweb/shared 2.2.0 → 2.4.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.esm.js +474 -172
- package/index.umd.js +498 -176
- package/lib/components/AlertBanner/AlertBanner.d.ts +1 -0
- package/lib/components/AlertBanner/AlertBanner.stories.d.ts +9 -1
- package/lib/components/CustomToggleButton/CustomToggleButton.d.ts +8 -0
- package/lib/components/{DraggableDialog/DraggableDialog.spec.d.ts → CustomToggleButton/CustomToggleButton.spec.d.ts} +0 -0
- package/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +13 -0
- package/lib/components/CustomToggleButton/index.d.ts +1 -0
- package/lib/components/Manager/EnableButton/EnableButton.d.ts +8 -0
- package/lib/components/Manager/EnableButton/EnableButton.spec.d.ts +1 -0
- package/lib/components/Manager/EnableButton/EnableButton.stories.d.ts +13 -0
- package/lib/components/Manager/EnableButton/index.d.ts +1 -0
- package/lib/components/Manager/ManagerButton/ManagerButton.d.ts +13 -0
- package/lib/components/Manager/ManagerButton/ManagerButton.spec.d.ts +1 -0
- package/lib/components/Manager/ManagerButton/ManagerButton.stories.d.ts +13 -0
- package/lib/components/Manager/ManagerButton/index.d.ts +1 -0
- package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.d.ts +8 -0
- package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.spec.d.ts +1 -0
- package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.stories.d.ts +13 -0
- package/lib/components/Manager/ManagerDeleteButton/index.d.ts +1 -0
- package/lib/components/Manager/index.d.ts +4 -0
- package/lib/components/Manager/styles.d.ts +5 -0
- package/lib/components/ToggleMenu/ToggleMenu.d.ts +17 -0
- package/lib/components/ToggleMenu/ToggleMenu.spec.d.ts +1 -0
- package/lib/components/ToggleMenu/ToggleMenu.stories.d.ts +7 -0
- package/lib/components/ToggleMenu/index.d.ts +1 -0
- package/lib/components/ToolButton/ToolButton.d.ts +11 -0
- package/lib/components/ToolButton/ToolButton.spec.d.ts +1 -0
- package/lib/components/ToolButton/ToolButton.stories.d.ts +13 -0
- package/lib/components/ToolButton/index.d.ts +1 -0
- package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +6 -0
- package/lib/components/ToolContainer/index.d.ts +1 -0
- package/lib/components/index.d.ts +4 -1
- package/package.json +3 -3
- package/lib/components/DraggableDialog/DraggableDialog.d.ts +0 -16
- package/lib/components/DraggableDialog/DraggableDialog.stories.d.ts +0 -6
- package/lib/components/DraggableDialog/index.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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';
|
|
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
4
|
import makeStyles from '@mui/styles/makeStyles';
|
|
5
|
-
import { Close, DragIndicator } from '@mui/icons-material';
|
|
5
|
+
import { Close, DragIndicator, Delete } from '@mui/icons-material';
|
|
6
6
|
import { useFormContext } from 'react-hook-form';
|
|
7
7
|
import { isEmpty, errorMessages } from '@opengeoweb/form-fields';
|
|
8
8
|
import Draggable from 'react-draggable';
|
|
@@ -10,6 +10,7 @@ import { Resizable } from 're-resizable';
|
|
|
10
10
|
import { useThemeContext } from '@opengeoweb/theme';
|
|
11
11
|
import { throttle } from 'lodash';
|
|
12
12
|
import withStyles from '@mui/styles/withStyles';
|
|
13
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
13
14
|
import createStyles from '@mui/styles/createStyles';
|
|
14
15
|
|
|
15
16
|
/* *
|
|
@@ -102,7 +103,7 @@ function __rest(s, e) {
|
|
|
102
103
|
return t;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
var useStyles$
|
|
106
|
+
var useStyles$b = makeStyles(function () {
|
|
106
107
|
return {
|
|
107
108
|
dialogHeader: {
|
|
108
109
|
zIndex: 1,
|
|
@@ -131,7 +132,7 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
|
131
132
|
content = _a$content === void 0 ? null : _a$content,
|
|
132
133
|
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content"]);
|
|
133
134
|
|
|
134
|
-
var classes = useStyles$
|
|
135
|
+
var classes = useStyles$b();
|
|
135
136
|
|
|
136
137
|
other.catchOnCancel;
|
|
137
138
|
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
@@ -650,12 +651,13 @@ var ConfirmationServiceProvider = function ConfirmationServiceProvider(_ref) {
|
|
|
650
651
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
651
652
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
652
653
|
* */
|
|
653
|
-
var useStyles$
|
|
654
|
+
var useStyles$a = makeStyles(function () {
|
|
654
655
|
return {
|
|
655
656
|
title: {
|
|
656
657
|
fontSize: '14px',
|
|
657
658
|
fontWeight: 'normal',
|
|
658
|
-
marginTop: '0px!important'
|
|
659
|
+
marginTop: '0px!important',
|
|
660
|
+
paddingTop: '0px!important'
|
|
659
661
|
},
|
|
660
662
|
info: {
|
|
661
663
|
fontSize: '16px'
|
|
@@ -672,8 +674,7 @@ var getIcon = function getIcon(severity) {
|
|
|
672
674
|
fill: "transparent"
|
|
673
675
|
}), /*#__PURE__*/React.createElement("path", {
|
|
674
676
|
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"
|
|
677
|
+
transform: "translate(-946.000000, -368.000000) translate(930.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
677
678
|
}));
|
|
678
679
|
|
|
679
680
|
case 'success':
|
|
@@ -683,8 +684,7 @@ var getIcon = function getIcon(severity) {
|
|
|
683
684
|
fill: "transparent"
|
|
684
685
|
}), /*#__PURE__*/React.createElement("path", {
|
|
685
686
|
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"
|
|
687
|
+
transform: "translate(-96.000000, -368.000000) translate(80.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
688
688
|
}));
|
|
689
689
|
|
|
690
690
|
case 'warning':
|
|
@@ -694,8 +694,7 @@ var getIcon = function getIcon(severity) {
|
|
|
694
694
|
fill: "transparent"
|
|
695
695
|
}), /*#__PURE__*/React.createElement("path", {
|
|
696
696
|
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"
|
|
697
|
+
transform: "translate(-521.000000, -368.000000) translate(505.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
699
698
|
}));
|
|
700
699
|
|
|
701
700
|
case 'error':
|
|
@@ -706,8 +705,7 @@ var getIcon = function getIcon(severity) {
|
|
|
706
705
|
fill: "transparent"
|
|
707
706
|
}), /*#__PURE__*/React.createElement("path", {
|
|
708
707
|
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"
|
|
708
|
+
transform: "translate(-1371.000000, -368.000000) translate(1355.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
711
709
|
}));
|
|
712
710
|
}
|
|
713
711
|
};
|
|
@@ -719,12 +717,31 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
719
717
|
_ref$info = _ref.info,
|
|
720
718
|
info = _ref$info === void 0 ? '' : _ref$info,
|
|
721
719
|
_ref$dataTestId = _ref.dataTestId,
|
|
722
|
-
dataTestId = _ref$dataTestId === void 0 ? 'alert-banner' : _ref$dataTestId
|
|
723
|
-
|
|
720
|
+
dataTestId = _ref$dataTestId === void 0 ? 'alert-banner' : _ref$dataTestId,
|
|
721
|
+
_ref$isCompact = _ref.isCompact,
|
|
722
|
+
isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact;
|
|
723
|
+
var classes = useStyles$a();
|
|
724
724
|
return /*#__PURE__*/React.createElement(Alert, {
|
|
725
725
|
"data-testid": dataTestId,
|
|
726
726
|
severity: severity,
|
|
727
|
-
icon: getIcon(severity)
|
|
727
|
+
icon: getIcon(severity),
|
|
728
|
+
sx: isCompact ? {
|
|
729
|
+
height: '32px',
|
|
730
|
+
boxSizing: 'border-box',
|
|
731
|
+
'& .MuiAlert-message': {
|
|
732
|
+
padding: '0px',
|
|
733
|
+
whiteSpace: 'nowrap',
|
|
734
|
+
overflow: 'hidden',
|
|
735
|
+
textOverflow: 'ellipsis',
|
|
736
|
+
'& .MuiTypography-root': {
|
|
737
|
+
display: 'inline'
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
'& .MuiAlert-icon': {
|
|
741
|
+
margin: '-3px 10px 0px 0px',
|
|
742
|
+
padding: '0px'
|
|
743
|
+
}
|
|
744
|
+
} : {}
|
|
728
745
|
}, /*#__PURE__*/React.createElement(AlertTitle, {
|
|
729
746
|
className: classes.title
|
|
730
747
|
}, title), info && /*#__PURE__*/React.createElement("div", {
|
|
@@ -748,7 +765,7 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
748
765
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
749
766
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
750
767
|
* */
|
|
751
|
-
var useStyles$
|
|
768
|
+
var useStyles$9 = makeStyles(function () {
|
|
752
769
|
return {
|
|
753
770
|
wrapper: {
|
|
754
771
|
height: '100vh',
|
|
@@ -765,7 +782,7 @@ var useStyles$b = makeStyles(function () {
|
|
|
765
782
|
var AppLayout = function AppLayout(_ref) {
|
|
766
783
|
var header = _ref.header,
|
|
767
784
|
children = _ref.children;
|
|
768
|
-
var classes = useStyles$
|
|
785
|
+
var classes = useStyles$9();
|
|
769
786
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
770
787
|
className: classes.wrapper
|
|
771
788
|
}, header, /*#__PURE__*/React__default.createElement("main", {
|
|
@@ -775,7 +792,7 @@ var AppLayout = function AppLayout(_ref) {
|
|
|
775
792
|
|
|
776
793
|
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
794
|
|
|
778
|
-
var useStyles$
|
|
795
|
+
var useStyles$8 = makeStyles(function (theme) {
|
|
779
796
|
var _header;
|
|
780
797
|
|
|
781
798
|
return {
|
|
@@ -812,7 +829,7 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
812
829
|
userMenu = _ref.userMenu,
|
|
813
830
|
_ref$title = _ref.title,
|
|
814
831
|
title = _ref$title === void 0 ? 'GeoWeb' : _ref$title;
|
|
815
|
-
var classes = useStyles$
|
|
832
|
+
var classes = useStyles$8();
|
|
816
833
|
return /*#__PURE__*/React__default.createElement("header", {
|
|
817
834
|
className: classes.header
|
|
818
835
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -896,38 +913,29 @@ var DraggableComponent$1 = function DraggableComponent(_a) {
|
|
|
896
913
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
897
914
|
* */
|
|
898
915
|
|
|
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
916
|
var ResizeHandle = function ResizeHandle(_ref2) {
|
|
920
917
|
var isRightAligned = _ref2.isRightAligned;
|
|
921
918
|
var theme = useTheme();
|
|
922
|
-
var styles = useStyles$9(isRightAligned)();
|
|
923
919
|
return /*#__PURE__*/React__default.createElement(SvgIcon, {
|
|
924
|
-
|
|
920
|
+
sx: Object.assign(Object.assign({
|
|
921
|
+
width: 20,
|
|
922
|
+
height: 20,
|
|
923
|
+
top: -10,
|
|
924
|
+
position: 'relative'
|
|
925
|
+
}, isRightAligned ? {
|
|
926
|
+
left: -10
|
|
927
|
+
} : {
|
|
928
|
+
left: 10,
|
|
929
|
+
transform: 'rotate(90deg)'
|
|
930
|
+
}), {
|
|
931
|
+
zIndex: 1
|
|
932
|
+
}),
|
|
925
933
|
"data-testid": "resizeHandle"
|
|
926
934
|
}, /*#__PURE__*/React__default.createElement("rect", {
|
|
927
935
|
fill: "#ffffff"
|
|
928
936
|
}), /*#__PURE__*/React__default.createElement("path", {
|
|
929
937
|
d: "M19.687 18.037v1h-6v-1h6zm3.5-3.5v1h-13v-1h13z",
|
|
930
|
-
fill: "".concat(theme.palette.geowebColors.
|
|
938
|
+
fill: "".concat(theme.palette.geowebColors.buttons.flat["default"].color),
|
|
931
939
|
transform: "rotate(-45 16.687 16.787)"
|
|
932
940
|
}));
|
|
933
941
|
};
|
|
@@ -1103,7 +1111,7 @@ ErrorBoundary.defaultProps = {
|
|
|
1103
1111
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1104
1112
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1105
1113
|
* */
|
|
1106
|
-
var useStyles$
|
|
1114
|
+
var useStyles$7 = makeStyles(function (theme) {
|
|
1107
1115
|
return {
|
|
1108
1116
|
container: {
|
|
1109
1117
|
position: 'absolute',
|
|
@@ -1151,7 +1159,7 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
1151
1159
|
} : _ref$onClose,
|
|
1152
1160
|
children = _ref.children,
|
|
1153
1161
|
initials = _ref.initials;
|
|
1154
|
-
var classes = useStyles$
|
|
1162
|
+
var classes = useStyles$7();
|
|
1155
1163
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1156
1164
|
"data-testid": "userButton",
|
|
1157
1165
|
onClick: onToggle,
|
|
@@ -1193,7 +1201,9 @@ var MenuItemTheme = function MenuItemTheme() {
|
|
|
1193
1201
|
isDark = _useThemeContext.isDark,
|
|
1194
1202
|
toggleTheme = _useThemeContext.toggleTheme;
|
|
1195
1203
|
|
|
1196
|
-
return /*#__PURE__*/React__default.createElement(MenuItem,
|
|
1204
|
+
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
1205
|
+
divider: true
|
|
1206
|
+
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1197
1207
|
container: true
|
|
1198
1208
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1199
1209
|
item: true
|
|
@@ -1232,7 +1242,7 @@ var MenuItemTheme = function MenuItemTheme() {
|
|
|
1232
1242
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1233
1243
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1234
1244
|
* */
|
|
1235
|
-
var useStyles$
|
|
1245
|
+
var useStyles$6 = makeStyles(function (theme) {
|
|
1236
1246
|
return {
|
|
1237
1247
|
footer: {
|
|
1238
1248
|
boxShadow: theme.shadows[1],
|
|
@@ -1245,7 +1255,7 @@ var useStyles$7 = makeStyles(function (theme) {
|
|
|
1245
1255
|
}); // drag handles will be handled by DraggableResizable/Resizable
|
|
1246
1256
|
|
|
1247
1257
|
var ToolFooter = function ToolFooter() {
|
|
1248
|
-
var classes = useStyles$
|
|
1258
|
+
var classes = useStyles$6();
|
|
1249
1259
|
return /*#__PURE__*/React__default.createElement("footer", {
|
|
1250
1260
|
className: classes.footer
|
|
1251
1261
|
});
|
|
@@ -1283,7 +1293,7 @@ var getStyle = function getStyle(size) {
|
|
|
1283
1293
|
return {
|
|
1284
1294
|
fontSize: 16,
|
|
1285
1295
|
fontWeight: 500,
|
|
1286
|
-
padding:
|
|
1296
|
+
padding: '4px'
|
|
1287
1297
|
};
|
|
1288
1298
|
}
|
|
1289
1299
|
|
|
@@ -1292,7 +1302,7 @@ var getStyle = function getStyle(size) {
|
|
|
1292
1302
|
return {
|
|
1293
1303
|
fontSize: 20,
|
|
1294
1304
|
fontWeight: 400,
|
|
1295
|
-
padding:
|
|
1305
|
+
padding: '8px'
|
|
1296
1306
|
};
|
|
1297
1307
|
}
|
|
1298
1308
|
|
|
@@ -1301,7 +1311,7 @@ var getStyle = function getStyle(size) {
|
|
|
1301
1311
|
return {
|
|
1302
1312
|
fontSize: 16,
|
|
1303
1313
|
fontWeight: 500,
|
|
1304
|
-
padding:
|
|
1314
|
+
padding: '12px'
|
|
1305
1315
|
};
|
|
1306
1316
|
}
|
|
1307
1317
|
|
|
@@ -1312,45 +1322,13 @@ var getStyle = function getStyle(size) {
|
|
|
1312
1322
|
}
|
|
1313
1323
|
};
|
|
1314
1324
|
|
|
1315
|
-
var
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
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
|
-
});
|
|
1325
|
+
var iconStyle = {
|
|
1326
|
+
color: 'geowebColors.greys.accessible',
|
|
1327
|
+
padding: 0,
|
|
1328
|
+
'&:hover': {
|
|
1329
|
+
background: 'action.hover'
|
|
1330
|
+
}
|
|
1331
|
+
};
|
|
1354
1332
|
|
|
1355
1333
|
var ToolHeader = function ToolHeader(_ref) {
|
|
1356
1334
|
var size = _ref.size,
|
|
@@ -1362,17 +1340,21 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1362
1340
|
_ref$className = _ref.className,
|
|
1363
1341
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
1364
1342
|
var styles = getStyle(size);
|
|
1365
|
-
var classes = useStyles$6({
|
|
1366
|
-
styles: styles,
|
|
1367
|
-
isDraggable: isDraggable
|
|
1368
|
-
});
|
|
1369
1343
|
|
|
1370
1344
|
var onClickClose = function onClickClose() {
|
|
1371
1345
|
return onClose();
|
|
1372
1346
|
};
|
|
1373
1347
|
|
|
1374
|
-
return /*#__PURE__*/React__default.createElement(
|
|
1375
|
-
|
|
1348
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
1349
|
+
component: "header",
|
|
1350
|
+
className: className,
|
|
1351
|
+
sx: {
|
|
1352
|
+
boxShadow: 1,
|
|
1353
|
+
backgroundColor: 'geowebColors.background.surface',
|
|
1354
|
+
padding: styles.padding,
|
|
1355
|
+
zIndex: 2,
|
|
1356
|
+
cursor: isDraggable ? 'move' : null
|
|
1357
|
+
}
|
|
1376
1358
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1377
1359
|
container: true,
|
|
1378
1360
|
alignItems: "center"
|
|
@@ -1384,9 +1366,11 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1384
1366
|
justifyContent: "flex-start"
|
|
1385
1367
|
}, isDraggable && size !== 'xxs' && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1386
1368
|
"data-testid": "dragBtn",
|
|
1387
|
-
className: classes.iconDrag,
|
|
1388
1369
|
disableRipple: true,
|
|
1389
|
-
size: "large"
|
|
1370
|
+
size: "large",
|
|
1371
|
+
sx: Object.assign(Object.assign({}, iconStyle), {
|
|
1372
|
+
pointerEvents: 'none'
|
|
1373
|
+
})
|
|
1390
1374
|
}, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1391
1375
|
item: true,
|
|
1392
1376
|
xs: 10
|
|
@@ -1396,12 +1380,19 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1396
1380
|
alignItems: "center"
|
|
1397
1381
|
}, title && /*#__PURE__*/React__default.createElement(Typography, {
|
|
1398
1382
|
variant: "h2",
|
|
1399
|
-
|
|
1383
|
+
sx: {
|
|
1384
|
+
fontSize: styles.fontSize,
|
|
1385
|
+
fontWeight: styles.fontWeight
|
|
1386
|
+
}
|
|
1400
1387
|
}, title), size === 'xxs' && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1401
1388
|
"data-testid": "dragBtn-xxs",
|
|
1402
|
-
className: classes.iconDragHorizontal,
|
|
1403
1389
|
disableRipple: true,
|
|
1404
|
-
size: "small"
|
|
1390
|
+
size: "small",
|
|
1391
|
+
sx: Object.assign(Object.assign({}, iconStyle), {
|
|
1392
|
+
pointerEvents: 'none',
|
|
1393
|
+
transform: 'rotate(90deg)',
|
|
1394
|
+
height: 12
|
|
1395
|
+
})
|
|
1405
1396
|
}, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1406
1397
|
item: true,
|
|
1407
1398
|
xs: 1,
|
|
@@ -1409,9 +1400,9 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1409
1400
|
justifyContent: "flex-end"
|
|
1410
1401
|
}, onClose && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1411
1402
|
"data-testid": "closeBtn",
|
|
1412
|
-
className: classes.iconClose,
|
|
1413
1403
|
onClick: onClickClose,
|
|
1414
|
-
size: "large"
|
|
1404
|
+
size: "large",
|
|
1405
|
+
sx: iconStyle
|
|
1415
1406
|
}, /*#__PURE__*/React__default.createElement(Close, null)))));
|
|
1416
1407
|
};
|
|
1417
1408
|
|
|
@@ -1443,7 +1434,6 @@ var useStyles$5 = makeStyles(function () {
|
|
|
1443
1434
|
content: {
|
|
1444
1435
|
flex: 1,
|
|
1445
1436
|
overflowY: 'auto',
|
|
1446
|
-
zIndex: 2,
|
|
1447
1437
|
position: 'relative'
|
|
1448
1438
|
}
|
|
1449
1439
|
};
|
|
@@ -1487,6 +1477,18 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
1487
1477
|
}, children), isResizable && /*#__PURE__*/React__default.createElement(ToolFooter, null));
|
|
1488
1478
|
};
|
|
1489
1479
|
|
|
1480
|
+
var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
|
|
1481
|
+
var width = window.innerWidth * 0.85;
|
|
1482
|
+
var height = window.innerHeight * 0.85;
|
|
1483
|
+
var top = window.innerHeight * 0.15 / 2;
|
|
1484
|
+
var left = window.innerWidth * 0.15 / 2;
|
|
1485
|
+
return {
|
|
1486
|
+
width: width,
|
|
1487
|
+
height: height,
|
|
1488
|
+
top: top,
|
|
1489
|
+
left: left
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1490
1492
|
var BASE_Z_INDEX = 100;
|
|
1491
1493
|
|
|
1492
1494
|
var DraggableComponent = function DraggableComponent(_a) {
|
|
@@ -1621,6 +1623,7 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1621
1623
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1622
1624
|
style: Object.assign({
|
|
1623
1625
|
position: 'absolute',
|
|
1626
|
+
pointerEvents: 'all',
|
|
1624
1627
|
zIndex: zIndex
|
|
1625
1628
|
}, startPosition),
|
|
1626
1629
|
ref: nodeRef
|
|
@@ -2023,6 +2026,14 @@ var shortcuts = [{
|
|
|
2023
2026
|
}, "+"), /*#__PURE__*/React__default.createElement(ShortCutSegment, {
|
|
2024
2027
|
type: "icon"
|
|
2025
2028
|
}, /*#__PURE__*/React__default.createElement(ArrowLeftIcon, null)))
|
|
2029
|
+
}, {
|
|
2030
|
+
title: 'Change layer manager values by scrolling',
|
|
2031
|
+
description: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ShortCutSegment, {
|
|
2032
|
+
type: "icon"
|
|
2033
|
+
}, "Ctrl"), /*#__PURE__*/React__default.createElement(ShortCutSegment, null, " + Mouse scroll")),
|
|
2034
|
+
descriptionMac: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ShortCutSegment, {
|
|
2035
|
+
type: "icon"
|
|
2036
|
+
}, /*#__PURE__*/React__default.createElement(CommandIcon, null)), /*#__PURE__*/React__default.createElement(ShortCutSegment, null, " + Mouse scroll"))
|
|
2026
2037
|
}];
|
|
2027
2038
|
var getShortcutList = function getShortcutList(shortcutList) {
|
|
2028
2039
|
var platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'windows';
|
|
@@ -2165,7 +2176,8 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
|
2165
2176
|
|
|
2166
2177
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
2167
2178
|
"data-testid": "cheatsheet-btn",
|
|
2168
|
-
onClick: onOpen
|
|
2179
|
+
onClick: onOpen,
|
|
2180
|
+
divider: true
|
|
2169
2181
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2170
2182
|
container: true
|
|
2171
2183
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -2357,83 +2369,373 @@ var CustomSlider = function CustomSlider(_a) {
|
|
|
2357
2369
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2358
2370
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2359
2371
|
* */
|
|
2360
|
-
|
|
2361
|
-
var
|
|
2362
|
-
var
|
|
2363
|
-
|
|
2364
|
-
|
|
2372
|
+
|
|
2373
|
+
var CustomToggleButton = function CustomToggleButton(_a) {
|
|
2374
|
+
var _a$variant = _a.variant,
|
|
2375
|
+
variant = _a$variant === void 0 ? 'primary' : _a$variant,
|
|
2376
|
+
_a$value = _a.value,
|
|
2377
|
+
value = _a$value === void 0 ? 0 : _a$value,
|
|
2378
|
+
props = __rest(_a, ["variant", "value"]);
|
|
2379
|
+
|
|
2380
|
+
return /*#__PURE__*/React.createElement(ToggleButton, Object.assign({
|
|
2381
|
+
className: variant,
|
|
2382
|
+
value: value
|
|
2383
|
+
}, props));
|
|
2384
|
+
};
|
|
2385
|
+
|
|
2386
|
+
/* *
|
|
2387
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2388
|
+
* you may not use this file except in compliance with the License.
|
|
2389
|
+
* You may obtain a copy of the License at
|
|
2390
|
+
*
|
|
2391
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2392
|
+
*
|
|
2393
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2394
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2395
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2396
|
+
* See the License for the specific language governing permissions and
|
|
2397
|
+
* limitations under the License.
|
|
2398
|
+
*
|
|
2399
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2400
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2401
|
+
* */
|
|
2402
|
+
var ToolButton = function ToolButton(_a) {
|
|
2403
|
+
var active = _a.active,
|
|
2404
|
+
_a$width = _a.width,
|
|
2405
|
+
width = _a$width === void 0 ? '24px' : _a$width,
|
|
2406
|
+
_a$height = _a.height,
|
|
2407
|
+
height = _a$height === void 0 ? '24px' : _a$height,
|
|
2408
|
+
children = _a.children,
|
|
2409
|
+
_a$value = _a.value,
|
|
2410
|
+
value = _a$value === void 0 ? 0 : _a$value,
|
|
2411
|
+
_a$sx = _a.sx,
|
|
2412
|
+
sx = _a$sx === void 0 ? {} : _a$sx,
|
|
2413
|
+
props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
|
|
2414
|
+
|
|
2415
|
+
return /*#__PURE__*/React.createElement(CustomToggleButton, Object.assign({
|
|
2416
|
+
variant: "tool",
|
|
2417
|
+
disableRipple: true,
|
|
2418
|
+
selected: active,
|
|
2419
|
+
value: value,
|
|
2420
|
+
sx: Object.assign({
|
|
2421
|
+
width: "".concat(width, "!important"),
|
|
2422
|
+
height: "".concat(height, "!important"),
|
|
2423
|
+
textTransform: 'none!important',
|
|
2424
|
+
padding: '11px!important'
|
|
2425
|
+
}, sx)
|
|
2426
|
+
}, props), children);
|
|
2427
|
+
};
|
|
2428
|
+
|
|
2429
|
+
var getPosition = function getPosition(menuPosition) {
|
|
2430
|
+
switch (menuPosition) {
|
|
2431
|
+
case 'bottom':
|
|
2365
2432
|
return {
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
overflow: 'hidden',
|
|
2375
|
-
zIndex: props.zIndex
|
|
2433
|
+
anchorOrigin: {
|
|
2434
|
+
vertical: 'bottom',
|
|
2435
|
+
horizontal: 'center'
|
|
2436
|
+
},
|
|
2437
|
+
transformOrigin: {
|
|
2438
|
+
vertical: 'top',
|
|
2439
|
+
horizontal: 'center'
|
|
2440
|
+
}
|
|
2376
2441
|
};
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
overflowY: 'scroll'
|
|
2381
|
-
},
|
|
2382
|
-
dialogHeader: function dialogHeader(props) {
|
|
2442
|
+
|
|
2443
|
+
default:
|
|
2444
|
+
case 'left':
|
|
2383
2445
|
return {
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2446
|
+
anchorOrigin: {
|
|
2447
|
+
vertical: 'center',
|
|
2448
|
+
horizontal: 'left'
|
|
2449
|
+
},
|
|
2450
|
+
transformOrigin: {
|
|
2451
|
+
vertical: 'center',
|
|
2452
|
+
horizontal: 'right'
|
|
2453
|
+
}
|
|
2392
2454
|
};
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
|
|
2458
|
+
var ToggleMenu = function ToggleMenu(_ref) {
|
|
2459
|
+
var _ref$buttonTestId = _ref.buttonTestId,
|
|
2460
|
+
buttonTestId = _ref$buttonTestId === void 0 ? 'toggleMenuButton' : _ref$buttonTestId,
|
|
2461
|
+
_ref$menuPosition = _ref.menuPosition,
|
|
2462
|
+
menuPosition = _ref$menuPosition === void 0 ? 'left' : _ref$menuPosition,
|
|
2463
|
+
menuItems = _ref.menuItems,
|
|
2464
|
+
children = _ref.children,
|
|
2465
|
+
buttonSx = _ref.buttonSx,
|
|
2466
|
+
_ref$tooltipTitle = _ref.tooltipTitle,
|
|
2467
|
+
tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle;
|
|
2468
|
+
|
|
2469
|
+
var _React$useState = React.useState(null),
|
|
2470
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2471
|
+
anchorEl = _React$useState2[0],
|
|
2472
|
+
setAnchorEl = _React$useState2[1];
|
|
2473
|
+
|
|
2474
|
+
var isOpen = Boolean(anchorEl);
|
|
2475
|
+
|
|
2476
|
+
var _getPosition = getPosition(menuPosition),
|
|
2477
|
+
anchorOrigin = _getPosition.anchorOrigin,
|
|
2478
|
+
transformOrigin = _getPosition.transformOrigin;
|
|
2479
|
+
|
|
2480
|
+
var handleClick = function handleClick(event) {
|
|
2481
|
+
setAnchorEl(event.currentTarget);
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2484
|
+
var handleClose = function handleClose() {
|
|
2485
|
+
setAnchorEl(null);
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToolButton, {
|
|
2489
|
+
active: isOpen,
|
|
2490
|
+
sx: buttonSx,
|
|
2491
|
+
onClick: handleClick,
|
|
2492
|
+
"data-testid": buttonTestId
|
|
2493
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
2494
|
+
placement: "top",
|
|
2495
|
+
title: tooltipTitle
|
|
2496
|
+
}, /*#__PURE__*/React.createElement(MoreVertIcon, null))), /*#__PURE__*/React.createElement(Menu, {
|
|
2497
|
+
anchorEl: anchorEl,
|
|
2498
|
+
open: isOpen,
|
|
2499
|
+
onClose: handleClose,
|
|
2500
|
+
anchorOrigin: anchorOrigin,
|
|
2501
|
+
transformOrigin: transformOrigin,
|
|
2502
|
+
BackdropProps: {
|
|
2503
|
+
style: {
|
|
2504
|
+
opacity: 0,
|
|
2505
|
+
transition: 'none'
|
|
2506
|
+
}
|
|
2393
2507
|
},
|
|
2394
|
-
|
|
2395
|
-
|
|
2508
|
+
MenuListProps: children && {
|
|
2509
|
+
style: {
|
|
2510
|
+
padding: '0px'
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
}, menuItems && menuItems.map(function (menuItem) {
|
|
2514
|
+
var text = menuItem.text,
|
|
2515
|
+
icon = menuItem.icon,
|
|
2516
|
+
action = menuItem.action;
|
|
2517
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
2518
|
+
key: text,
|
|
2519
|
+
onClick: function onClick() {
|
|
2520
|
+
action();
|
|
2521
|
+
handleClose();
|
|
2522
|
+
}
|
|
2523
|
+
}, icon && /*#__PURE__*/React.createElement(ListItemIcon, null, icon), /*#__PURE__*/React.createElement(Typography, null, text));
|
|
2524
|
+
}), children));
|
|
2525
|
+
};
|
|
2526
|
+
|
|
2527
|
+
/* *
|
|
2528
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2529
|
+
* you may not use this file except in compliance with the License.
|
|
2530
|
+
* You may obtain a copy of the License at
|
|
2531
|
+
*
|
|
2532
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2533
|
+
*
|
|
2534
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2535
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2536
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2537
|
+
* See the License for the specific language governing permissions and
|
|
2538
|
+
* limitations under the License.
|
|
2539
|
+
*
|
|
2540
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2541
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2542
|
+
* */
|
|
2543
|
+
var useStyles = makeStyles(function (theme) {
|
|
2544
|
+
return createStyles({
|
|
2545
|
+
button: {
|
|
2546
|
+
height: 28,
|
|
2547
|
+
width: 28,
|
|
2548
|
+
borderRadius: 5,
|
|
2549
|
+
marginTop: 2,
|
|
2550
|
+
color: function color(_ref) {
|
|
2551
|
+
var isActive = _ref.isActive,
|
|
2552
|
+
isAccessible = _ref.isAccessible,
|
|
2553
|
+
isEnabled = _ref.isEnabled;
|
|
2554
|
+
|
|
2555
|
+
if (!isEnabled) {
|
|
2556
|
+
return theme.palette.geowebColors.buttons.flat.disabled.color;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
if (isAccessible) {
|
|
2560
|
+
return theme.palette.geowebColors.greys.accessible;
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
if (isActive) {
|
|
2564
|
+
return theme.palette.common.white;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
return theme.palette.geowebColors.buttons.flat["default"].color;
|
|
2568
|
+
},
|
|
2569
|
+
backgroundColor: function backgroundColor(_ref2) {
|
|
2570
|
+
var isActive = _ref2.isActive;
|
|
2571
|
+
return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
|
|
2572
|
+
},
|
|
2573
|
+
'&:focus': {
|
|
2574
|
+
backgroundColor: function backgroundColor(_ref3) {
|
|
2575
|
+
var isActive = _ref3.isActive;
|
|
2576
|
+
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2577
|
+
},
|
|
2578
|
+
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
2579
|
+
borderRadius: 0
|
|
2580
|
+
},
|
|
2581
|
+
'&:hover': {
|
|
2582
|
+
backgroundColor: function backgroundColor(_ref4) {
|
|
2583
|
+
var isActive = _ref4.isActive;
|
|
2584
|
+
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2396
2587
|
},
|
|
2397
|
-
|
|
2398
|
-
|
|
2588
|
+
popper: {
|
|
2589
|
+
pointerEvents: 'none'
|
|
2399
2590
|
}
|
|
2400
2591
|
});
|
|
2401
2592
|
});
|
|
2593
|
+
var ManagerButton = function ManagerButton(_a) {
|
|
2594
|
+
var _a$tooltipTitle = _a.tooltipTitle,
|
|
2595
|
+
tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
|
|
2596
|
+
_a$onClick = _a.onClick,
|
|
2597
|
+
onClick = _a$onClick === void 0 ? function () {} : _a$onClick,
|
|
2598
|
+
_a$isActive = _a.isActive,
|
|
2599
|
+
isActive = _a$isActive === void 0 ? false : _a$isActive,
|
|
2600
|
+
_a$isEnabled = _a.isEnabled,
|
|
2601
|
+
isEnabled = _a$isEnabled === void 0 ? true : _a$isEnabled,
|
|
2602
|
+
icon = _a.icon,
|
|
2603
|
+
testId = _a.testId,
|
|
2604
|
+
_a$isAccessible = _a.isAccessible,
|
|
2605
|
+
isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
|
|
2606
|
+
className = _a.className,
|
|
2607
|
+
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
|
|
2608
|
+
|
|
2609
|
+
var classes = useStyles({
|
|
2610
|
+
isActive: isActive,
|
|
2611
|
+
isEnabled: isEnabled,
|
|
2612
|
+
isAccessible: isAccessible
|
|
2613
|
+
});
|
|
2614
|
+
|
|
2615
|
+
var handleClick = function handleClick(event) {
|
|
2616
|
+
onClick(event);
|
|
2617
|
+
};
|
|
2618
|
+
|
|
2619
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
2620
|
+
title: tooltipTitle,
|
|
2621
|
+
placement: "top",
|
|
2622
|
+
classes: {
|
|
2623
|
+
popper: classes.popper
|
|
2624
|
+
}
|
|
2625
|
+
}, /*#__PURE__*/React.createElement(IconButton, Object.assign({
|
|
2626
|
+
size: "small",
|
|
2627
|
+
onClick: handleClick,
|
|
2628
|
+
"data-testid": testId,
|
|
2629
|
+
className: "".concat(classes.button, " ").concat(className),
|
|
2630
|
+
disableFocusRipple: true
|
|
2631
|
+
}, props), icon));
|
|
2632
|
+
};
|
|
2402
2633
|
|
|
2403
|
-
|
|
2404
|
-
|
|
2634
|
+
/* *
|
|
2635
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2636
|
+
* you may not use this file except in compliance with the License.
|
|
2637
|
+
* You may obtain a copy of the License at
|
|
2638
|
+
*
|
|
2639
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2640
|
+
*
|
|
2641
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2642
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2643
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2644
|
+
* See the License for the specific language governing permissions and
|
|
2645
|
+
* limitations under the License.
|
|
2646
|
+
*
|
|
2647
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2648
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2649
|
+
* */
|
|
2650
|
+
var ManagerDeleteButton = function ManagerDeleteButton(_ref) {
|
|
2651
|
+
var tooltipTitle = _ref.tooltipTitle,
|
|
2652
|
+
onClickDelete = _ref.onClickDelete,
|
|
2653
|
+
_ref$isEnabled = _ref.isEnabled,
|
|
2654
|
+
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
2655
|
+
return /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2656
|
+
tooltipTitle: tooltipTitle,
|
|
2657
|
+
onClick: onClickDelete,
|
|
2658
|
+
icon: /*#__PURE__*/React.createElement(Delete, {
|
|
2659
|
+
sx: {
|
|
2660
|
+
width: 20,
|
|
2661
|
+
height: 20
|
|
2662
|
+
}
|
|
2663
|
+
}),
|
|
2664
|
+
testId: "deleteButton",
|
|
2665
|
+
isEnabled: isEnabled
|
|
2666
|
+
});
|
|
2667
|
+
};
|
|
2668
|
+
|
|
2669
|
+
/* *
|
|
2670
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2671
|
+
* you may not use this file except in compliance with the License.
|
|
2672
|
+
* You may obtain a copy of the License at
|
|
2673
|
+
*
|
|
2674
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2675
|
+
*
|
|
2676
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2677
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2678
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2679
|
+
* See the License for the specific language governing permissions and
|
|
2680
|
+
* limitations under the License.
|
|
2681
|
+
*
|
|
2682
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2683
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2684
|
+
* */
|
|
2685
|
+
var EnableButton = function EnableButton(_ref) {
|
|
2686
|
+
var isEnabled = _ref.isEnabled,
|
|
2405
2687
|
title = _ref.title,
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2688
|
+
onChangeEnableLayer = _ref.onChangeEnableLayer;
|
|
2689
|
+
|
|
2690
|
+
var onClick = function onClick() {
|
|
2691
|
+
onChangeEnableLayer(!isEnabled);
|
|
2692
|
+
};
|
|
2693
|
+
|
|
2694
|
+
var visibilityIcon = /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("rect", {
|
|
2695
|
+
width: 24,
|
|
2696
|
+
height: 24,
|
|
2697
|
+
fill: "transparent"
|
|
2698
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2699
|
+
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
2700
|
}));
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2701
|
+
var visibilityOffIcon = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
2702
|
+
style: {
|
|
2703
|
+
marginTop: 2
|
|
2704
|
+
}
|
|
2705
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
2706
|
+
width: 24,
|
|
2707
|
+
height: 24,
|
|
2708
|
+
fill: "transparent"
|
|
2709
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2710
|
+
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"
|
|
2711
|
+
}));
|
|
2712
|
+
return /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2713
|
+
tooltipTitle: title,
|
|
2714
|
+
onClick: onClick,
|
|
2715
|
+
icon: /*#__PURE__*/React.createElement(Checkbox, {
|
|
2716
|
+
sx: {
|
|
2717
|
+
color: 'inherit',
|
|
2718
|
+
padding: 0.5,
|
|
2719
|
+
borderRadius: 1.25,
|
|
2720
|
+
'&.Mui-focusVisible': {
|
|
2721
|
+
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2722
|
+
},
|
|
2723
|
+
'&:hover': {
|
|
2724
|
+
backgroundColor: 'transparent!important'
|
|
2725
|
+
},
|
|
2726
|
+
'&.Mui-checked': {
|
|
2727
|
+
color: 'inherit'
|
|
2728
|
+
}
|
|
2729
|
+
},
|
|
2730
|
+
icon: visibilityOffIcon,
|
|
2731
|
+
checkedIcon: visibilityIcon,
|
|
2732
|
+
checked: isEnabled,
|
|
2733
|
+
disableFocusRipple: true,
|
|
2734
|
+
tabIndex: -1
|
|
2735
|
+
}),
|
|
2736
|
+
testId: "enableLayer",
|
|
2737
|
+
isEnabled: isEnabled
|
|
2738
|
+
});
|
|
2437
2739
|
};
|
|
2438
2740
|
|
|
2439
2741
|
/* *
|
|
@@ -2470,4 +2772,4 @@ var getAxiosErrorMessage = function getAxiosErrorMessage(error) {
|
|
|
2470
2772
|
return 'An error has occurred';
|
|
2471
2773
|
};
|
|
2472
2774
|
|
|
2473
|
-
export { AlertBanner, AppHeader, AppLayout, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, DraggableComponent$1 as Draggable,
|
|
2775
|
+
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 };
|