@opengeoweb/shared 2.2.1 → 2.3.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 CHANGED
@@ -1,6 +1,6 @@
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 } from '@mui/material';
4
4
  import makeStyles from '@mui/styles/makeStyles';
5
5
  import { Close, DragIndicator } from '@mui/icons-material';
6
6
  import { useFormContext } from 'react-hook-form';
@@ -11,6 +11,7 @@ import { useThemeContext } from '@opengeoweb/theme';
11
11
  import { throttle } from 'lodash';
12
12
  import withStyles from '@mui/styles/withStyles';
13
13
  import createStyles from '@mui/styles/createStyles';
14
+ import MoreVertIcon from '@mui/icons-material/MoreVert';
14
15
 
15
16
  /* *
16
17
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -102,7 +103,7 @@ function __rest(s, e) {
102
103
  return t;
103
104
  }
104
105
 
105
- var useStyles$d = makeStyles(function () {
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$d();
135
+ var classes = useStyles$b();
135
136
 
136
137
  other.catchOnCancel;
137
138
  var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
@@ -650,7 +651,7 @@ 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$c = makeStyles(function () {
654
+ var useStyles$a = makeStyles(function () {
654
655
  return {
655
656
  title: {
656
657
  fontSize: '14px',
@@ -720,7 +721,7 @@ var AlertBanner = function AlertBanner(_ref) {
720
721
  info = _ref$info === void 0 ? '' : _ref$info,
721
722
  _ref$dataTestId = _ref.dataTestId,
722
723
  dataTestId = _ref$dataTestId === void 0 ? 'alert-banner' : _ref$dataTestId;
723
- var classes = useStyles$c();
724
+ var classes = useStyles$a();
724
725
  return /*#__PURE__*/React.createElement(Alert, {
725
726
  "data-testid": dataTestId,
726
727
  severity: severity,
@@ -748,7 +749,7 @@ var AlertBanner = function AlertBanner(_ref) {
748
749
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
749
750
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
750
751
  * */
751
- var useStyles$b = makeStyles(function () {
752
+ var useStyles$9 = makeStyles(function () {
752
753
  return {
753
754
  wrapper: {
754
755
  height: '100vh',
@@ -765,7 +766,7 @@ var useStyles$b = makeStyles(function () {
765
766
  var AppLayout = function AppLayout(_ref) {
766
767
  var header = _ref.header,
767
768
  children = _ref.children;
768
- var classes = useStyles$b();
769
+ var classes = useStyles$9();
769
770
  return /*#__PURE__*/React__default.createElement("div", {
770
771
  className: classes.wrapper
771
772
  }, header, /*#__PURE__*/React__default.createElement("main", {
@@ -775,7 +776,7 @@ var AppLayout = function AppLayout(_ref) {
775
776
 
776
777
  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
778
 
778
- var useStyles$a = makeStyles(function (theme) {
779
+ var useStyles$8 = makeStyles(function (theme) {
779
780
  var _header;
780
781
 
781
782
  return {
@@ -812,7 +813,7 @@ var AppHeader = function AppHeader(_ref) {
812
813
  userMenu = _ref.userMenu,
813
814
  _ref$title = _ref.title,
814
815
  title = _ref$title === void 0 ? 'GeoWeb' : _ref$title;
815
- var classes = useStyles$a();
816
+ var classes = useStyles$8();
816
817
  return /*#__PURE__*/React__default.createElement("header", {
817
818
  className: classes.header
818
819
  }, /*#__PURE__*/React__default.createElement(Grid, {
@@ -896,38 +897,29 @@ var DraggableComponent$1 = function DraggableComponent(_a) {
896
897
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
897
898
  * */
898
899
 
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
900
  var ResizeHandle = function ResizeHandle(_ref2) {
920
901
  var isRightAligned = _ref2.isRightAligned;
921
902
  var theme = useTheme();
922
- var styles = useStyles$9(isRightAligned)();
923
903
  return /*#__PURE__*/React__default.createElement(SvgIcon, {
924
- className: styles.icon,
904
+ sx: Object.assign(Object.assign({
905
+ width: 20,
906
+ height: 20,
907
+ top: -10,
908
+ position: 'relative'
909
+ }, isRightAligned ? {
910
+ left: -10
911
+ } : {
912
+ left: 10,
913
+ transform: 'rotate(90deg)'
914
+ }), {
915
+ zIndex: 1
916
+ }),
925
917
  "data-testid": "resizeHandle"
926
918
  }, /*#__PURE__*/React__default.createElement("rect", {
927
919
  fill: "#ffffff"
928
920
  }), /*#__PURE__*/React__default.createElement("path", {
929
921
  d: "M19.687 18.037v1h-6v-1h6zm3.5-3.5v1h-13v-1h13z",
930
- fill: "".concat(theme.palette.geowebColors.greys.accessible),
922
+ fill: "".concat(theme.palette.geowebColors.buttons.flat["default"].color),
931
923
  transform: "rotate(-45 16.687 16.787)"
932
924
  }));
933
925
  };
@@ -1103,7 +1095,7 @@ ErrorBoundary.defaultProps = {
1103
1095
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1104
1096
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1105
1097
  * */
1106
- var useStyles$8 = makeStyles(function (theme) {
1098
+ var useStyles$7 = makeStyles(function (theme) {
1107
1099
  return {
1108
1100
  container: {
1109
1101
  position: 'absolute',
@@ -1151,7 +1143,7 @@ var UserMenu = function UserMenu(_ref) {
1151
1143
  } : _ref$onClose,
1152
1144
  children = _ref.children,
1153
1145
  initials = _ref.initials;
1154
- var classes = useStyles$8();
1146
+ var classes = useStyles$7();
1155
1147
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
1156
1148
  "data-testid": "userButton",
1157
1149
  onClick: onToggle,
@@ -1193,7 +1185,9 @@ var MenuItemTheme = function MenuItemTheme() {
1193
1185
  isDark = _useThemeContext.isDark,
1194
1186
  toggleTheme = _useThemeContext.toggleTheme;
1195
1187
 
1196
- return /*#__PURE__*/React__default.createElement(MenuItem, null, /*#__PURE__*/React__default.createElement(Grid, {
1188
+ return /*#__PURE__*/React__default.createElement(MenuItem, {
1189
+ divider: true
1190
+ }, /*#__PURE__*/React__default.createElement(Grid, {
1197
1191
  container: true
1198
1192
  }, /*#__PURE__*/React__default.createElement(Grid, {
1199
1193
  item: true
@@ -1232,7 +1226,7 @@ var MenuItemTheme = function MenuItemTheme() {
1232
1226
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1233
1227
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1234
1228
  * */
1235
- var useStyles$7 = makeStyles(function (theme) {
1229
+ var useStyles$6 = makeStyles(function (theme) {
1236
1230
  return {
1237
1231
  footer: {
1238
1232
  boxShadow: theme.shadows[1],
@@ -1245,7 +1239,7 @@ var useStyles$7 = makeStyles(function (theme) {
1245
1239
  }); // drag handles will be handled by DraggableResizable/Resizable
1246
1240
 
1247
1241
  var ToolFooter = function ToolFooter() {
1248
- var classes = useStyles$7();
1242
+ var classes = useStyles$6();
1249
1243
  return /*#__PURE__*/React__default.createElement("footer", {
1250
1244
  className: classes.footer
1251
1245
  });
@@ -1283,7 +1277,7 @@ var getStyle = function getStyle(size) {
1283
1277
  return {
1284
1278
  fontSize: 16,
1285
1279
  fontWeight: 500,
1286
- padding: 4
1280
+ padding: '4px'
1287
1281
  };
1288
1282
  }
1289
1283
 
@@ -1292,7 +1286,7 @@ var getStyle = function getStyle(size) {
1292
1286
  return {
1293
1287
  fontSize: 20,
1294
1288
  fontWeight: 400,
1295
- padding: 8
1289
+ padding: '8px'
1296
1290
  };
1297
1291
  }
1298
1292
 
@@ -1301,7 +1295,7 @@ var getStyle = function getStyle(size) {
1301
1295
  return {
1302
1296
  fontSize: 16,
1303
1297
  fontWeight: 500,
1304
- padding: 12
1298
+ padding: '12px'
1305
1299
  };
1306
1300
  }
1307
1301
 
@@ -1312,45 +1306,13 @@ var getStyle = function getStyle(size) {
1312
1306
  }
1313
1307
  };
1314
1308
 
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
- });
1309
+ var iconStyle = {
1310
+ color: 'geowebColors.greys.accessible',
1311
+ padding: 0,
1312
+ '&:hover': {
1313
+ background: 'action.hover'
1314
+ }
1315
+ };
1354
1316
 
1355
1317
  var ToolHeader = function ToolHeader(_ref) {
1356
1318
  var size = _ref.size,
@@ -1362,17 +1324,21 @@ var ToolHeader = function ToolHeader(_ref) {
1362
1324
  _ref$className = _ref.className,
1363
1325
  className = _ref$className === void 0 ? '' : _ref$className;
1364
1326
  var styles = getStyle(size);
1365
- var classes = useStyles$6({
1366
- styles: styles,
1367
- isDraggable: isDraggable
1368
- });
1369
1327
 
1370
1328
  var onClickClose = function onClickClose() {
1371
1329
  return onClose();
1372
1330
  };
1373
1331
 
1374
- return /*#__PURE__*/React__default.createElement("header", {
1375
- className: "".concat(classes.header, " ").concat(className)
1332
+ return /*#__PURE__*/React__default.createElement(Box, {
1333
+ component: "header",
1334
+ className: className,
1335
+ sx: {
1336
+ boxShadow: 1,
1337
+ backgroundColor: 'geowebColors.background.surface',
1338
+ padding: styles.padding,
1339
+ zIndex: 1,
1340
+ cursor: isDraggable ? 'move' : null
1341
+ }
1376
1342
  }, /*#__PURE__*/React__default.createElement(Grid, {
1377
1343
  container: true,
1378
1344
  alignItems: "center"
@@ -1384,9 +1350,11 @@ var ToolHeader = function ToolHeader(_ref) {
1384
1350
  justifyContent: "flex-start"
1385
1351
  }, isDraggable && size !== 'xxs' && /*#__PURE__*/React__default.createElement(IconButton, {
1386
1352
  "data-testid": "dragBtn",
1387
- className: classes.iconDrag,
1388
1353
  disableRipple: true,
1389
- size: "large"
1354
+ size: "large",
1355
+ sx: Object.assign(Object.assign({}, iconStyle), {
1356
+ pointerEvents: 'none'
1357
+ })
1390
1358
  }, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
1391
1359
  item: true,
1392
1360
  xs: 10
@@ -1396,12 +1364,19 @@ var ToolHeader = function ToolHeader(_ref) {
1396
1364
  alignItems: "center"
1397
1365
  }, title && /*#__PURE__*/React__default.createElement(Typography, {
1398
1366
  variant: "h2",
1399
- className: classes.title
1367
+ sx: {
1368
+ fontSize: styles.fontSize,
1369
+ fontWeight: styles.fontWeight
1370
+ }
1400
1371
  }, title), size === 'xxs' && /*#__PURE__*/React__default.createElement(IconButton, {
1401
1372
  "data-testid": "dragBtn-xxs",
1402
- className: classes.iconDragHorizontal,
1403
1373
  disableRipple: true,
1404
- size: "small"
1374
+ size: "small",
1375
+ sx: Object.assign(Object.assign({}, iconStyle), {
1376
+ pointerEvents: 'none',
1377
+ transform: 'rotate(90deg)',
1378
+ height: 12
1379
+ })
1405
1380
  }, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
1406
1381
  item: true,
1407
1382
  xs: 1,
@@ -1409,9 +1384,9 @@ var ToolHeader = function ToolHeader(_ref) {
1409
1384
  justifyContent: "flex-end"
1410
1385
  }, onClose && /*#__PURE__*/React__default.createElement(IconButton, {
1411
1386
  "data-testid": "closeBtn",
1412
- className: classes.iconClose,
1413
1387
  onClick: onClickClose,
1414
- size: "large"
1388
+ size: "large",
1389
+ sx: iconStyle
1415
1390
  }, /*#__PURE__*/React__default.createElement(Close, null)))));
1416
1391
  };
1417
1392
 
@@ -2023,6 +1998,14 @@ var shortcuts = [{
2023
1998
  }, "+"), /*#__PURE__*/React__default.createElement(ShortCutSegment, {
2024
1999
  type: "icon"
2025
2000
  }, /*#__PURE__*/React__default.createElement(ArrowLeftIcon, null)))
2001
+ }, {
2002
+ title: 'Change layer manager values by scrolling',
2003
+ description: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ShortCutSegment, {
2004
+ type: "icon"
2005
+ }, "Ctrl"), /*#__PURE__*/React__default.createElement(ShortCutSegment, null, " + Mouse scroll")),
2006
+ descriptionMac: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ShortCutSegment, {
2007
+ type: "icon"
2008
+ }, /*#__PURE__*/React__default.createElement(CommandIcon, null)), /*#__PURE__*/React__default.createElement(ShortCutSegment, null, " + Mouse scroll"))
2026
2009
  }];
2027
2010
  var getShortcutList = function getShortcutList(shortcutList) {
2028
2011
  var platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'windows';
@@ -2165,7 +2148,8 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
2165
2148
 
2166
2149
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MenuItem, {
2167
2150
  "data-testid": "cheatsheet-btn",
2168
- onClick: onOpen
2151
+ onClick: onOpen,
2152
+ divider: true
2169
2153
  }, /*#__PURE__*/React__default.createElement(Grid, {
2170
2154
  container: true
2171
2155
  }, /*#__PURE__*/React__default.createElement(Grid, {
@@ -2387,7 +2371,7 @@ var useStyles = makeStyles(function (theme) {
2387
2371
  alignItems: 'center',
2388
2372
  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
2373
  width: '100%',
2390
- backgroundColor: '#ffffff',
2374
+ backgroundColor: theme.palette.geowebColors.background.surface,
2391
2375
  zIndex: props.zIndex + 10
2392
2376
  };
2393
2377
  },
@@ -2436,6 +2420,177 @@ var DraggableDialog = function DraggableDialog(_ref) {
2436
2420
  }, children)));
2437
2421
  };
2438
2422
 
2423
+ /* *
2424
+ * Licensed under the Apache License, Version 2.0 (the "License");
2425
+ * you may not use this file except in compliance with the License.
2426
+ * You may obtain a copy of the License at
2427
+ *
2428
+ * http://www.apache.org/licenses/LICENSE-2.0
2429
+ *
2430
+ * Unless required by applicable law or agreed to in writing, software
2431
+ * distributed under the License is distributed on an "AS IS" BASIS,
2432
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2433
+ * See the License for the specific language governing permissions and
2434
+ * limitations under the License.
2435
+ *
2436
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2437
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2438
+ * */
2439
+
2440
+ var CustomToggleButton = function CustomToggleButton(_a) {
2441
+ var _a$variant = _a.variant,
2442
+ variant = _a$variant === void 0 ? 'primary' : _a$variant,
2443
+ _a$value = _a.value,
2444
+ value = _a$value === void 0 ? 0 : _a$value,
2445
+ props = __rest(_a, ["variant", "value"]);
2446
+
2447
+ return /*#__PURE__*/React.createElement(ToggleButton, Object.assign({
2448
+ className: variant,
2449
+ value: value
2450
+ }, props));
2451
+ };
2452
+
2453
+ /* *
2454
+ * Licensed under the Apache License, Version 2.0 (the "License");
2455
+ * you may not use this file except in compliance with the License.
2456
+ * You may obtain a copy of the License at
2457
+ *
2458
+ * http://www.apache.org/licenses/LICENSE-2.0
2459
+ *
2460
+ * Unless required by applicable law or agreed to in writing, software
2461
+ * distributed under the License is distributed on an "AS IS" BASIS,
2462
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2463
+ * See the License for the specific language governing permissions and
2464
+ * limitations under the License.
2465
+ *
2466
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2467
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2468
+ * */
2469
+ var ToolButton = function ToolButton(_a) {
2470
+ var active = _a.active,
2471
+ _a$width = _a.width,
2472
+ width = _a$width === void 0 ? '24px' : _a$width,
2473
+ _a$height = _a.height,
2474
+ height = _a$height === void 0 ? '24px' : _a$height,
2475
+ children = _a.children,
2476
+ _a$value = _a.value,
2477
+ value = _a$value === void 0 ? 0 : _a$value,
2478
+ _a$sx = _a.sx,
2479
+ sx = _a$sx === void 0 ? {} : _a$sx,
2480
+ props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
2481
+
2482
+ return /*#__PURE__*/React.createElement(CustomToggleButton, Object.assign({
2483
+ variant: "tool",
2484
+ disableRipple: true,
2485
+ selected: active,
2486
+ value: value,
2487
+ sx: Object.assign({
2488
+ width: "".concat(width, "!important"),
2489
+ height: "".concat(height, "!important"),
2490
+ textTransform: 'none!important',
2491
+ padding: '11px!important'
2492
+ }, sx)
2493
+ }, props), children);
2494
+ };
2495
+
2496
+ var getPosition = function getPosition(menuPosition) {
2497
+ switch (menuPosition) {
2498
+ case 'bottom':
2499
+ return {
2500
+ anchorOrigin: {
2501
+ vertical: 'bottom',
2502
+ horizontal: 'center'
2503
+ },
2504
+ transformOrigin: {
2505
+ vertical: 'top',
2506
+ horizontal: 'center'
2507
+ }
2508
+ };
2509
+
2510
+ default:
2511
+ case 'left':
2512
+ return {
2513
+ anchorOrigin: {
2514
+ vertical: 'center',
2515
+ horizontal: 'left'
2516
+ },
2517
+ transformOrigin: {
2518
+ vertical: 'center',
2519
+ horizontal: 'right'
2520
+ }
2521
+ };
2522
+ }
2523
+ };
2524
+
2525
+ var ToggleMenu = function ToggleMenu(_ref) {
2526
+ var _ref$buttonTestId = _ref.buttonTestId,
2527
+ buttonTestId = _ref$buttonTestId === void 0 ? 'toggleMenuButton' : _ref$buttonTestId,
2528
+ _ref$menuPosition = _ref.menuPosition,
2529
+ menuPosition = _ref$menuPosition === void 0 ? 'left' : _ref$menuPosition,
2530
+ menuItems = _ref.menuItems,
2531
+ children = _ref.children,
2532
+ buttonSx = _ref.buttonSx,
2533
+ _ref$tooltipTitle = _ref.tooltipTitle,
2534
+ tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle;
2535
+
2536
+ var _React$useState = React.useState(null),
2537
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2538
+ anchorEl = _React$useState2[0],
2539
+ setAnchorEl = _React$useState2[1];
2540
+
2541
+ var isOpen = Boolean(anchorEl);
2542
+
2543
+ var _getPosition = getPosition(menuPosition),
2544
+ anchorOrigin = _getPosition.anchorOrigin,
2545
+ transformOrigin = _getPosition.transformOrigin;
2546
+
2547
+ var handleClick = function handleClick(event) {
2548
+ setAnchorEl(event.currentTarget);
2549
+ };
2550
+
2551
+ var handleClose = function handleClose() {
2552
+ setAnchorEl(null);
2553
+ };
2554
+
2555
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToolButton, {
2556
+ active: isOpen,
2557
+ sx: buttonSx,
2558
+ onClick: handleClick,
2559
+ "data-testid": buttonTestId
2560
+ }, /*#__PURE__*/React.createElement(Tooltip, {
2561
+ placement: "top",
2562
+ title: tooltipTitle
2563
+ }, /*#__PURE__*/React.createElement(MoreVertIcon, null))), /*#__PURE__*/React.createElement(Menu, {
2564
+ anchorEl: anchorEl,
2565
+ open: isOpen,
2566
+ onClose: handleClose,
2567
+ anchorOrigin: anchorOrigin,
2568
+ transformOrigin: transformOrigin,
2569
+ BackdropProps: {
2570
+ style: {
2571
+ opacity: 0,
2572
+ transition: 'none'
2573
+ }
2574
+ },
2575
+ MenuListProps: children && {
2576
+ style: {
2577
+ padding: '0px'
2578
+ }
2579
+ }
2580
+ }, menuItems && menuItems.map(function (menuItem) {
2581
+ var text = menuItem.text,
2582
+ icon = menuItem.icon,
2583
+ action = menuItem.action;
2584
+ return /*#__PURE__*/React.createElement(MenuItem, {
2585
+ key: text,
2586
+ onClick: function onClick() {
2587
+ action();
2588
+ handleClose();
2589
+ }
2590
+ }, icon && /*#__PURE__*/React.createElement(ListItemIcon, null, icon), /*#__PURE__*/React.createElement(Typography, null, text));
2591
+ }), children));
2592
+ };
2593
+
2439
2594
  /* *
2440
2595
  * Licensed under the Apache License, Version 2.0 (the "License");
2441
2596
  * you may not use this file except in compliance with the License.
@@ -2470,4 +2625,4 @@ var getAxiosErrorMessage = function getAxiosErrorMessage(error) {
2470
2625
  return 'An error has occurred';
2471
2626
  };
2472
2627
 
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 };
2628
+ export { AlertBanner, AppHeader, AppLayout, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, CustomToggleButton, DraggableComponent$1 as Draggable, DraggableDialog, ErrorBoundary, HIDDEN_INPUT_HELPER_IS_DRAFT, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, 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 };
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@mui/styles/makeStyles'), require('@mui/icons-material'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('react-draggable'), require('re-resizable'), require('@opengeoweb/theme'), require('lodash'), require('@mui/styles/withStyles'), require('@mui/styles/createStyles')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@mui/styles/makeStyles', '@mui/icons-material', 'react-hook-form', '@opengeoweb/form-fields', 'react-draggable', 're-resizable', '@opengeoweb/theme', 'lodash', '@mui/styles/withStyles', '@mui/styles/createStyles'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.makeStyles, global.iconsMaterial, global.reactHookForm, global.formFields, global.Draggable, global.reResizable, global.theme, global.lodash, global.withStyles, global.createStyles));
5
- })(this, (function (exports, React, material, makeStyles, iconsMaterial, reactHookForm, formFields, Draggable, reResizable, theme, lodash, withStyles, createStyles) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@mui/styles/makeStyles'), require('@mui/icons-material'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('react-draggable'), require('re-resizable'), require('@opengeoweb/theme'), require('lodash'), require('@mui/styles/withStyles'), require('@mui/styles/createStyles'), require('@mui/icons-material/MoreVert')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@mui/styles/makeStyles', '@mui/icons-material', 'react-hook-form', '@opengeoweb/form-fields', 'react-draggable', 're-resizable', '@opengeoweb/theme', 'lodash', '@mui/styles/withStyles', '@mui/styles/createStyles', '@mui/icons-material/MoreVert'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.makeStyles, global.iconsMaterial, global.reactHookForm, global.formFields, global.Draggable, global.reResizable, global.theme, global.lodash, global.withStyles, global.createStyles, global.MoreVertIcon));
5
+ })(this, (function (exports, React, material, makeStyles, iconsMaterial, reactHookForm, formFields, Draggable, reResizable, theme, lodash, withStyles, createStyles, MoreVertIcon) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -30,6 +30,7 @@
30
30
  var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
31
31
  var withStyles__default = /*#__PURE__*/_interopDefaultLegacy(withStyles);
32
32
  var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
33
+ var MoreVertIcon__default = /*#__PURE__*/_interopDefaultLegacy(MoreVertIcon);
33
34
 
34
35
  /*! *****************************************************************************
35
36
  Copyright (c) Microsoft Corporation.
@@ -159,7 +160,7 @@
159
160
  }, content));
160
161
  };
161
162
 
162
- var useStyles$d = makeStyles__default["default"](function () {
163
+ var useStyles$b = makeStyles__default["default"](function () {
163
164
  return {
164
165
  dialogHeader: {
165
166
  zIndex: 1,
@@ -188,7 +189,7 @@
188
189
  content = _e === void 0 ? null : _e,
189
190
  other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content"]);
190
191
 
191
- var classes = useStyles$d();
192
+ var classes = useStyles$b();
192
193
 
193
194
  other.catchOnCancel;
194
195
  var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
@@ -501,7 +502,7 @@
501
502
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
502
503
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
503
504
  * */
504
- var useStyles$c = makeStyles__default["default"](function () {
505
+ var useStyles$a = makeStyles__default["default"](function () {
505
506
  return {
506
507
  title: {
507
508
  fontSize: '14px',
@@ -571,7 +572,7 @@
571
572
  info = _c === void 0 ? '' : _c,
572
573
  _d = _a.dataTestId,
573
574
  dataTestId = _d === void 0 ? 'alert-banner' : _d;
574
- var classes = useStyles$c();
575
+ var classes = useStyles$a();
575
576
  return /*#__PURE__*/React__namespace.createElement(material.Alert, {
576
577
  "data-testid": dataTestId,
577
578
  severity: severity,
@@ -599,7 +600,7 @@
599
600
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
600
601
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
601
602
  * */
602
- var useStyles$b = makeStyles__default["default"](function () {
603
+ var useStyles$9 = makeStyles__default["default"](function () {
603
604
  return {
604
605
  wrapper: {
605
606
  height: '100vh',
@@ -616,7 +617,7 @@
616
617
  var AppLayout = function AppLayout(_a) {
617
618
  var header = _a.header,
618
619
  children = _a.children;
619
- var classes = useStyles$b();
620
+ var classes = useStyles$9();
620
621
  return /*#__PURE__*/React__default["default"].createElement("div", {
621
622
  className: classes.wrapper
622
623
  }, header, /*#__PURE__*/React__default["default"].createElement("main", {
@@ -642,7 +643,7 @@
642
643
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
643
644
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
644
645
  * */
645
- var useStyles$a = makeStyles__default["default"](function (theme) {
646
+ var useStyles$8 = makeStyles__default["default"](function (theme) {
646
647
  var _a;
647
648
 
648
649
  return {
@@ -679,7 +680,7 @@
679
680
  userMenu = _a.userMenu,
680
681
  _b = _a.title,
681
682
  title = _b === void 0 ? 'GeoWeb' : _b;
682
- var classes = useStyles$a();
683
+ var classes = useStyles$8();
683
684
  return /*#__PURE__*/React__default["default"].createElement("header", {
684
685
  className: classes.header
685
686
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
@@ -763,38 +764,29 @@
763
764
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
764
765
  * */
765
766
 
766
- var useStyles$9 = function useStyles(isRightAligned) {
767
- return makeStyles__default["default"](function () {
768
- return {
769
- icon: __assign(__assign({
770
- width: 20,
771
- height: 20,
772
- top: -10,
773
- position: 'relative'
774
- }, isRightAligned ? {
775
- left: -10
776
- } : {
777
- left: 10,
778
- transform: 'rotate(90deg)'
779
- }), {
780
- zIndex: 1
781
- })
782
- };
783
- });
784
- };
785
-
786
767
  var ResizeHandle = function ResizeHandle(_a) {
787
768
  var isRightAligned = _a.isRightAligned;
788
769
  var theme = material.useTheme();
789
- var styles = useStyles$9(isRightAligned)();
790
770
  return /*#__PURE__*/React__default["default"].createElement(material.SvgIcon, {
791
- className: styles.icon,
771
+ sx: __assign(__assign({
772
+ width: 20,
773
+ height: 20,
774
+ top: -10,
775
+ position: 'relative'
776
+ }, isRightAligned ? {
777
+ left: -10
778
+ } : {
779
+ left: 10,
780
+ transform: 'rotate(90deg)'
781
+ }), {
782
+ zIndex: 1
783
+ }),
792
784
  "data-testid": "resizeHandle"
793
785
  }, /*#__PURE__*/React__default["default"].createElement("rect", {
794
786
  fill: "#ffffff"
795
787
  }), /*#__PURE__*/React__default["default"].createElement("path", {
796
788
  d: "M19.687 18.037v1h-6v-1h6zm3.5-3.5v1h-13v-1h13z",
797
- fill: "" + theme.palette.geowebColors.greys.accessible,
789
+ fill: "" + theme.palette.geowebColors.buttons.flat["default"].color,
798
790
  transform: "rotate(-45 16.687 16.787)"
799
791
  }));
800
792
  };
@@ -962,7 +954,7 @@
962
954
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
963
955
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
964
956
  * */
965
- var useStyles$8 = makeStyles__default["default"](function (theme) {
957
+ var useStyles$7 = makeStyles__default["default"](function (theme) {
966
958
  return {
967
959
  container: {
968
960
  position: 'absolute',
@@ -1010,7 +1002,7 @@
1010
1002
  } : _d,
1011
1003
  children = _a.children,
1012
1004
  initials = _a.initials;
1013
- var classes = useStyles$8();
1005
+ var classes = useStyles$7();
1014
1006
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1015
1007
  "data-testid": "userButton",
1016
1008
  onClick: onToggle,
@@ -1052,7 +1044,9 @@
1052
1044
  isDark = _a.isDark,
1053
1045
  toggleTheme = _a.toggleTheme;
1054
1046
 
1055
- return /*#__PURE__*/React__default["default"].createElement(material.MenuItem, null, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1047
+ return /*#__PURE__*/React__default["default"].createElement(material.MenuItem, {
1048
+ divider: true
1049
+ }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1056
1050
  container: true
1057
1051
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1058
1052
  item: true
@@ -1091,7 +1085,7 @@
1091
1085
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1092
1086
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1093
1087
  * */
1094
- var useStyles$7 = makeStyles__default["default"](function (theme) {
1088
+ var useStyles$6 = makeStyles__default["default"](function (theme) {
1095
1089
  return {
1096
1090
  footer: {
1097
1091
  boxShadow: theme.shadows[1],
@@ -1104,7 +1098,7 @@
1104
1098
  }); // drag handles will be handled by DraggableResizable/Resizable
1105
1099
 
1106
1100
  var ToolFooter = function ToolFooter() {
1107
- var classes = useStyles$7();
1101
+ var classes = useStyles$6();
1108
1102
  return /*#__PURE__*/React__default["default"].createElement("footer", {
1109
1103
  className: classes.footer
1110
1104
  });
@@ -1142,7 +1136,7 @@
1142
1136
  return {
1143
1137
  fontSize: 16,
1144
1138
  fontWeight: 500,
1145
- padding: 4
1139
+ padding: '4px'
1146
1140
  };
1147
1141
  }
1148
1142
 
@@ -1151,7 +1145,7 @@
1151
1145
  return {
1152
1146
  fontSize: 20,
1153
1147
  fontWeight: 400,
1154
- padding: 8
1148
+ padding: '8px'
1155
1149
  };
1156
1150
  }
1157
1151
 
@@ -1160,7 +1154,7 @@
1160
1154
  return {
1161
1155
  fontSize: 16,
1162
1156
  fontWeight: 500,
1163
- padding: 12
1157
+ padding: '12px'
1164
1158
  };
1165
1159
  }
1166
1160
 
@@ -1171,45 +1165,13 @@
1171
1165
  }
1172
1166
  };
1173
1167
 
1174
- var useStyles$6 = makeStyles__default["default"](function (theme) {
1175
- return {
1176
- header: {
1177
- boxShadow: theme.shadows[1],
1178
- background: theme.palette.geowebColors.background.surface,
1179
- padding: function padding(props) {
1180
- return props.styles.padding;
1181
- },
1182
- zIndex: 1,
1183
- cursor: function cursor(props) {
1184
- return props.isDraggable ? 'move' : null;
1185
- }
1186
- },
1187
- title: {
1188
- fontSize: function fontSize(props) {
1189
- return props.styles.fontSize;
1190
- },
1191
- fontWeight: function fontWeight(props) {
1192
- return props.styles.fontWeight;
1193
- }
1194
- },
1195
- iconClose: {
1196
- color: theme.palette.geowebColors.greys.accessible,
1197
- padding: 0
1198
- },
1199
- iconDrag: {
1200
- color: theme.palette.geowebColors.greys.accessible,
1201
- padding: 0,
1202
- pointerEvents: 'none'
1203
- },
1204
- iconDragHorizontal: {
1205
- color: theme.palette.geowebColors.greys.accessible,
1206
- padding: 0,
1207
- pointerEvents: 'none',
1208
- transform: 'rotate(90deg)',
1209
- height: 12
1210
- }
1211
- };
1212
- });
1168
+ var iconStyle = {
1169
+ color: 'geowebColors.greys.accessible',
1170
+ padding: 0,
1171
+ '&:hover': {
1172
+ background: 'action.hover'
1173
+ }
1174
+ };
1213
1175
 
1214
1176
  var ToolHeader = function ToolHeader(_a) {
1215
1177
  var size = _a.size,
@@ -1221,17 +1183,21 @@
1221
1183
  _d = _a.className,
1222
1184
  className = _d === void 0 ? '' : _d;
1223
1185
  var styles = getStyle(size);
1224
- var classes = useStyles$6({
1225
- styles: styles,
1226
- isDraggable: isDraggable
1227
- });
1228
1186
 
1229
1187
  var onClickClose = function onClickClose() {
1230
1188
  return onClose();
1231
1189
  };
1232
1190
 
1233
- return /*#__PURE__*/React__default["default"].createElement("header", {
1234
- className: classes.header + " " + className
1191
+ return /*#__PURE__*/React__default["default"].createElement(material.Box, {
1192
+ component: "header",
1193
+ className: className,
1194
+ sx: {
1195
+ boxShadow: 1,
1196
+ backgroundColor: 'geowebColors.background.surface',
1197
+ padding: styles.padding,
1198
+ zIndex: 1,
1199
+ cursor: isDraggable ? 'move' : null
1200
+ }
1235
1201
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1236
1202
  container: true,
1237
1203
  alignItems: "center"
@@ -1243,9 +1209,11 @@
1243
1209
  justifyContent: "flex-start"
1244
1210
  }, isDraggable && size !== 'xxs' && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1245
1211
  "data-testid": "dragBtn",
1246
- className: classes.iconDrag,
1247
1212
  disableRipple: true,
1248
- size: "large"
1213
+ size: "large",
1214
+ sx: __assign(__assign({}, iconStyle), {
1215
+ pointerEvents: 'none'
1216
+ })
1249
1217
  }, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null)))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1250
1218
  item: true,
1251
1219
  xs: 10
@@ -1255,12 +1223,19 @@
1255
1223
  alignItems: "center"
1256
1224
  }, title && /*#__PURE__*/React__default["default"].createElement(material.Typography, {
1257
1225
  variant: "h2",
1258
- className: classes.title
1226
+ sx: {
1227
+ fontSize: styles.fontSize,
1228
+ fontWeight: styles.fontWeight
1229
+ }
1259
1230
  }, title), size === 'xxs' && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1260
1231
  "data-testid": "dragBtn-xxs",
1261
- className: classes.iconDragHorizontal,
1262
1232
  disableRipple: true,
1263
- size: "small"
1233
+ size: "small",
1234
+ sx: __assign(__assign({}, iconStyle), {
1235
+ pointerEvents: 'none',
1236
+ transform: 'rotate(90deg)',
1237
+ height: 12
1238
+ })
1264
1239
  }, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null)))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1265
1240
  item: true,
1266
1241
  xs: 1,
@@ -1268,9 +1243,9 @@
1268
1243
  justifyContent: "flex-end"
1269
1244
  }, onClose && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1270
1245
  "data-testid": "closeBtn",
1271
- className: classes.iconClose,
1272
1246
  onClick: onClickClose,
1273
- size: "large"
1247
+ size: "large",
1248
+ sx: iconStyle
1274
1249
  }, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.Close, null)))));
1275
1250
  };
1276
1251
 
@@ -1881,6 +1856,14 @@
1881
1856
  }, "+"), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1882
1857
  type: "icon"
1883
1858
  }, /*#__PURE__*/React__default["default"].createElement(ArrowLeftIcon, null)))
1859
+ }, {
1860
+ title: 'Change layer manager values by scrolling',
1861
+ description: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1862
+ type: "icon"
1863
+ }, "Ctrl"), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, null, " + Mouse scroll")),
1864
+ descriptionMac: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1865
+ type: "icon"
1866
+ }, /*#__PURE__*/React__default["default"].createElement(CommandIcon, null)), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, null, " + Mouse scroll"))
1884
1867
  }];
1885
1868
  var getShortcutList = function getShortcutList(shortcutList, platform) {
1886
1869
  if (platform === void 0) {
@@ -2024,7 +2007,8 @@
2024
2007
 
2025
2008
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.MenuItem, {
2026
2009
  "data-testid": "cheatsheet-btn",
2027
- onClick: onOpen
2010
+ onClick: onOpen,
2011
+ divider: true
2028
2012
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
2029
2013
  container: true
2030
2014
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
@@ -2262,7 +2246,7 @@
2262
2246
  alignItems: 'center',
2263
2247
  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)',
2264
2248
  width: '100%',
2265
- backgroundColor: '#ffffff',
2249
+ backgroundColor: theme.palette.geowebColors.background.surface,
2266
2250
  zIndex: props.zIndex + 10
2267
2251
  };
2268
2252
  },
@@ -2311,6 +2295,176 @@
2311
2295
  }, children)));
2312
2296
  };
2313
2297
 
2298
+ /* *
2299
+ * Licensed under the Apache License, Version 2.0 (the "License");
2300
+ * you may not use this file except in compliance with the License.
2301
+ * You may obtain a copy of the License at
2302
+ *
2303
+ * http://www.apache.org/licenses/LICENSE-2.0
2304
+ *
2305
+ * Unless required by applicable law or agreed to in writing, software
2306
+ * distributed under the License is distributed on an "AS IS" BASIS,
2307
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2308
+ * See the License for the specific language governing permissions and
2309
+ * limitations under the License.
2310
+ *
2311
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2312
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2313
+ * */
2314
+
2315
+ var CustomToggleButton = function CustomToggleButton(_a) {
2316
+ var _b = _a.variant,
2317
+ variant = _b === void 0 ? 'primary' : _b,
2318
+ _c = _a.value,
2319
+ value = _c === void 0 ? 0 : _c,
2320
+ props = __rest(_a, ["variant", "value"]);
2321
+
2322
+ return /*#__PURE__*/React__namespace.createElement(material.ToggleButton, __assign({
2323
+ className: variant,
2324
+ value: value
2325
+ }, props));
2326
+ };
2327
+
2328
+ /* *
2329
+ * Licensed under the Apache License, Version 2.0 (the "License");
2330
+ * you may not use this file except in compliance with the License.
2331
+ * You may obtain a copy of the License at
2332
+ *
2333
+ * http://www.apache.org/licenses/LICENSE-2.0
2334
+ *
2335
+ * Unless required by applicable law or agreed to in writing, software
2336
+ * distributed under the License is distributed on an "AS IS" BASIS,
2337
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2338
+ * See the License for the specific language governing permissions and
2339
+ * limitations under the License.
2340
+ *
2341
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2342
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2343
+ * */
2344
+ var ToolButton = function ToolButton(_a) {
2345
+ var active = _a.active,
2346
+ _b = _a.width,
2347
+ width = _b === void 0 ? '24px' : _b,
2348
+ _c = _a.height,
2349
+ height = _c === void 0 ? '24px' : _c,
2350
+ children = _a.children,
2351
+ _d = _a.value,
2352
+ value = _d === void 0 ? 0 : _d,
2353
+ _e = _a.sx,
2354
+ sx = _e === void 0 ? {} : _e,
2355
+ props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
2356
+
2357
+ return /*#__PURE__*/React__namespace.createElement(CustomToggleButton, __assign({
2358
+ variant: "tool",
2359
+ disableRipple: true,
2360
+ selected: active,
2361
+ value: value,
2362
+ sx: __assign({
2363
+ width: width + "!important",
2364
+ height: height + "!important",
2365
+ textTransform: 'none!important',
2366
+ padding: '11px!important'
2367
+ }, sx)
2368
+ }, props), children);
2369
+ };
2370
+
2371
+ var getPosition = function getPosition(menuPosition) {
2372
+ switch (menuPosition) {
2373
+ case 'bottom':
2374
+ return {
2375
+ anchorOrigin: {
2376
+ vertical: 'bottom',
2377
+ horizontal: 'center'
2378
+ },
2379
+ transformOrigin: {
2380
+ vertical: 'top',
2381
+ horizontal: 'center'
2382
+ }
2383
+ };
2384
+
2385
+ default:
2386
+ case 'left':
2387
+ return {
2388
+ anchorOrigin: {
2389
+ vertical: 'center',
2390
+ horizontal: 'left'
2391
+ },
2392
+ transformOrigin: {
2393
+ vertical: 'center',
2394
+ horizontal: 'right'
2395
+ }
2396
+ };
2397
+ }
2398
+ };
2399
+
2400
+ var ToggleMenu = function ToggleMenu(_a) {
2401
+ var _b = _a.buttonTestId,
2402
+ buttonTestId = _b === void 0 ? 'toggleMenuButton' : _b,
2403
+ _c = _a.menuPosition,
2404
+ menuPosition = _c === void 0 ? 'left' : _c,
2405
+ menuItems = _a.menuItems,
2406
+ children = _a.children,
2407
+ buttonSx = _a.buttonSx,
2408
+ _d = _a.tooltipTitle,
2409
+ tooltipTitle = _d === void 0 ? '' : _d;
2410
+
2411
+ var _e = __read(React__namespace.useState(null), 2),
2412
+ anchorEl = _e[0],
2413
+ setAnchorEl = _e[1];
2414
+
2415
+ var isOpen = Boolean(anchorEl);
2416
+
2417
+ var _f = getPosition(menuPosition),
2418
+ anchorOrigin = _f.anchorOrigin,
2419
+ transformOrigin = _f.transformOrigin;
2420
+
2421
+ var handleClick = function handleClick(event) {
2422
+ setAnchorEl(event.currentTarget);
2423
+ };
2424
+
2425
+ var handleClose = function handleClose() {
2426
+ setAnchorEl(null);
2427
+ };
2428
+
2429
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
2430
+ active: isOpen,
2431
+ sx: buttonSx,
2432
+ onClick: handleClick,
2433
+ "data-testid": buttonTestId
2434
+ }, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
2435
+ placement: "top",
2436
+ title: tooltipTitle
2437
+ }, /*#__PURE__*/React__namespace.createElement(MoreVertIcon__default["default"], null))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
2438
+ anchorEl: anchorEl,
2439
+ open: isOpen,
2440
+ onClose: handleClose,
2441
+ anchorOrigin: anchorOrigin,
2442
+ transformOrigin: transformOrigin,
2443
+ BackdropProps: {
2444
+ style: {
2445
+ opacity: 0,
2446
+ transition: 'none'
2447
+ }
2448
+ },
2449
+ MenuListProps: children && {
2450
+ style: {
2451
+ padding: '0px'
2452
+ }
2453
+ }
2454
+ }, menuItems && menuItems.map(function (menuItem) {
2455
+ var text = menuItem.text,
2456
+ icon = menuItem.icon,
2457
+ action = menuItem.action;
2458
+ return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
2459
+ key: text,
2460
+ onClick: function onClick() {
2461
+ action();
2462
+ handleClose();
2463
+ }
2464
+ }, icon && /*#__PURE__*/React__namespace.createElement(material.ListItemIcon, null, icon), /*#__PURE__*/React__namespace.createElement(material.Typography, null, text));
2465
+ }), children));
2466
+ };
2467
+
2314
2468
  /* *
2315
2469
  * Licensed under the Apache License, Version 2.0 (the "License");
2316
2470
  * you may not use this file except in compliance with the License.
@@ -2351,12 +2505,15 @@
2351
2505
  exports.ConfirmationDialog = ConfirmationDialog;
2352
2506
  exports.ConfirmationServiceProvider = ConfirmationServiceProvider;
2353
2507
  exports.CustomSlider = CustomSlider;
2508
+ exports.CustomToggleButton = CustomToggleButton;
2354
2509
  exports.Draggable = DraggableComponent$1;
2355
2510
  exports.DraggableDialog = DraggableDialog;
2356
2511
  exports.ErrorBoundary = ErrorBoundary;
2357
2512
  exports.HIDDEN_INPUT_HELPER_IS_DRAFT = HIDDEN_INPUT_HELPER_IS_DRAFT;
2358
2513
  exports.Resizable = ResizeComponent;
2359
2514
  exports.StatusTag = StatusTag;
2515
+ exports.ToggleMenu = ToggleMenu;
2516
+ exports.ToolButton = ToolButton;
2360
2517
  exports.ToolContainer = ToolContainer;
2361
2518
  exports.ToolContainerDraggable = DraggableComponent;
2362
2519
  exports.ToolFooter = ToolFooter;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { ToggleButtonProps } from '@mui/material';
3
+ import { ButtonVariant } from '@opengeoweb/theme';
4
+ export interface CustomToggleButtonProps extends Omit<ToggleButtonProps, 'value'> {
5
+ variant?: ButtonVariant;
6
+ value?: unknown;
7
+ }
8
+ export declare const CustomToggleButton: React.FC<CustomToggleButtonProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const CustomToggleButtonLight: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const CustomToggleButtonDark: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
@@ -0,0 +1 @@
1
+ export * from './CustomToggleButton';
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material';
3
+ declare type MenuItemType = {
4
+ text: string;
5
+ action: () => void;
6
+ icon?: React.ReactNode;
7
+ };
8
+ interface ToggleMenuProps {
9
+ buttonTestId?: string;
10
+ menuPosition?: 'left' | 'bottom';
11
+ menuItems?: MenuItemType[];
12
+ children?: React.ReactNode;
13
+ buttonSx?: SxProps<Theme>;
14
+ tooltipTitle?: string;
15
+ }
16
+ export declare const ToggleMenu: React.FC<ToggleMenuProps>;
17
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const ToggleMenuLight: () => React.ReactElement;
7
+ export declare const ToggleMenuDark: () => React.ReactElement;
@@ -0,0 +1 @@
1
+ export * from './ToggleMenu';
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { Theme, SxProps } from '@mui/material';
3
+ import { CustomToggleButtonProps } from '../CustomToggleButton';
4
+ export interface ToolButtonProps extends CustomToggleButtonProps {
5
+ active?: boolean;
6
+ width?: string;
7
+ height?: string;
8
+ value?: unknown;
9
+ sx?: SxProps<Theme>;
10
+ }
11
+ export declare const ToolButton: React.FC<ToolButtonProps>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const ToolButtonLight: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const ToolButtonDark: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
@@ -0,0 +1 @@
1
+ export * from './ToolButton';
@@ -9,3 +9,6 @@ export * from './UserMenu';
9
9
  export * from './ToolContainer';
10
10
  export * from './CustomSlider';
11
11
  export * from './DraggableDialog';
12
+ export * from './CustomToggleButton';
13
+ export * from './ToolButton';
14
+ export * from './ToggleMenu';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,13 +14,13 @@
14
14
  "peerDependencies": {
15
15
  "react": "^17.0.2",
16
16
  "@mui/material": "^5.2.8",
17
- "@opengeoweb/theme": "2.2.1",
17
+ "@opengeoweb/theme": "2.3.0",
18
18
  "@mui/styles": "^5.2.3",
19
19
  "@mui/icons-material": "^5.2.5",
20
20
  "react-draggable": "^4.4.3",
21
21
  "re-resizable": "^6.9.0",
22
22
  "lodash": "^4.17.20",
23
- "@opengeoweb/form-fields": "2.2.1",
23
+ "@opengeoweb/form-fields": "2.3.0",
24
24
  "react-hook-form": "^6.12.1",
25
25
  "moment": "^2.29.0",
26
26
  "moment-timezone": "^0.5.31",