@opengeoweb/shared 3.0.0 → 4.1.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 +169 -217
- package/index.umd.js +173 -235
- package/lib/components/AppHeader/AppHeader.stories.d.ts +12 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +18 -2
- package/lib/components/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -1
- package/lib/components/ManagerButton/ManagerButton.d.ts +1 -7
- package/lib/components/ToolContainer/ToolContainer.stories.d.ts +18 -2
- package/lib/components/ToolContainer/ToolHeader.stories.d.ts +18 -5
- package/lib/components/UserMenu/CheatSheet/CheatSheet.stories.d.ts +18 -2
- package/package.json +3 -4
package/index.esm.js
CHANGED
|
@@ -4,11 +4,9 @@ import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, Dialog
|
|
|
4
4
|
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, Delete, VisibilityOff, Visibility } from '@opengeoweb/theme';
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
6
|
import { isEmpty, errorMessages } from '@opengeoweb/form-fields';
|
|
7
|
-
import makeStyles from '@mui/styles/makeStyles';
|
|
8
7
|
import Draggable from 'react-draggable';
|
|
9
8
|
import { Resizable } from 're-resizable';
|
|
10
9
|
import { throttle } from 'lodash';
|
|
11
|
-
import createStyles from '@mui/styles/createStyles';
|
|
12
10
|
|
|
13
11
|
/* *
|
|
14
12
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -811,7 +809,7 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
811
809
|
}
|
|
812
810
|
},
|
|
813
811
|
'& .MuiAlert-icon': {
|
|
814
|
-
|
|
812
|
+
marginTop: '-3px',
|
|
815
813
|
padding: '0px'
|
|
816
814
|
}
|
|
817
815
|
} : {
|
|
@@ -832,13 +830,15 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
832
830
|
fontWeight: 'normal',
|
|
833
831
|
marginTop: '0px!important',
|
|
834
832
|
paddingTop: '0px!important',
|
|
835
|
-
marginBottom: '0px!important'
|
|
833
|
+
marginBottom: '0px!important',
|
|
834
|
+
lineHeight: isCompact ? '18px' : '24px'
|
|
836
835
|
}
|
|
837
836
|
}, title), info && /*#__PURE__*/React.createElement(Box, {
|
|
838
837
|
sx: {
|
|
839
838
|
fontSize: '16px',
|
|
840
839
|
marginTop: 1,
|
|
841
|
-
wordBreak: 'break-word'
|
|
840
|
+
wordBreak: 'break-word',
|
|
841
|
+
lineHeight: '22px'
|
|
842
842
|
}
|
|
843
843
|
}, info), actionButtonProps && /*#__PURE__*/React.createElement(Button, {
|
|
844
844
|
variant: "flat",
|
|
@@ -869,55 +869,51 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
869
869
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
870
870
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
871
871
|
* */
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
872
|
+
|
|
873
|
+
var AppLayout = function AppLayout(_ref) {
|
|
874
|
+
var header = _ref.header,
|
|
875
|
+
children = _ref.children;
|
|
876
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
877
|
+
sx: {
|
|
875
878
|
height: '100vh',
|
|
876
879
|
display: 'flex',
|
|
877
880
|
flexDirection: 'column'
|
|
878
881
|
},
|
|
879
|
-
|
|
882
|
+
"data-testid": "appLayout"
|
|
883
|
+
}, header, /*#__PURE__*/React__default.createElement(Box, {
|
|
884
|
+
component: "main",
|
|
885
|
+
sx: {
|
|
880
886
|
flex: 1,
|
|
881
887
|
position: 'relative'
|
|
882
888
|
}
|
|
883
|
-
};
|
|
884
|
-
});
|
|
885
|
-
|
|
886
|
-
var AppLayout = function AppLayout(_ref) {
|
|
887
|
-
var header = _ref.header,
|
|
888
|
-
children = _ref.children;
|
|
889
|
-
var classes = useStyles$5();
|
|
890
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
891
|
-
className: classes.wrapper
|
|
892
|
-
}, header, /*#__PURE__*/React__default.createElement("main", {
|
|
893
|
-
className: classes.main
|
|
894
889
|
}, children));
|
|
895
890
|
};
|
|
896
891
|
|
|
897
|
-
var styles$
|
|
892
|
+
var styles$5 = {
|
|
898
893
|
header: function header(theme) {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
return _ref = {
|
|
894
|
+
return _defineProperty({
|
|
902
895
|
height: 40,
|
|
903
896
|
backgroundColor: theme.palette.geowebColors.brand.brand,
|
|
904
897
|
color: theme.palette.common.white,
|
|
905
898
|
boxShadow: theme.shadows[1],
|
|
906
|
-
zIndex: 1000
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
}), _defineProperty(_ref, theme.breakpoints.up('sm'), {
|
|
899
|
+
zIndex: 1000,
|
|
900
|
+
padding: '0 16px'
|
|
901
|
+
}, theme.breakpoints.up('md'), {
|
|
910
902
|
padding: '0 24px'
|
|
911
|
-
})
|
|
903
|
+
});
|
|
912
904
|
},
|
|
913
905
|
title: {
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
906
|
+
fontSize: '20px',
|
|
907
|
+
fontWeight: 500,
|
|
908
|
+
fontStretch: 'normal',
|
|
909
|
+
fontStyle: 'normal',
|
|
910
|
+
lineHeight: 'normal',
|
|
911
|
+
letterSpacing: '0.15px',
|
|
917
912
|
overflow: 'hidden',
|
|
918
913
|
whiteSpace: 'nowrap',
|
|
919
914
|
textOverflow: 'ellipsis',
|
|
920
|
-
|
|
915
|
+
color: 'geowebColors.typographyAndIcons.text',
|
|
916
|
+
marginLeft: 1
|
|
921
917
|
},
|
|
922
918
|
container: {
|
|
923
919
|
height: '100%'
|
|
@@ -931,34 +927,42 @@ var AppHeader = function AppHeader(_ref2) {
|
|
|
931
927
|
title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title;
|
|
932
928
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
933
929
|
component: "header",
|
|
934
|
-
sx: styles$
|
|
930
|
+
sx: styles$5.header
|
|
935
931
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
936
|
-
sx: styles$
|
|
932
|
+
sx: styles$5.container,
|
|
937
933
|
container: true,
|
|
938
934
|
alignItems: "center"
|
|
939
935
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
940
936
|
item: true,
|
|
941
|
-
xs:
|
|
942
|
-
sm: 3
|
|
943
|
-
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
944
|
-
container: true,
|
|
945
|
-
justifyContent: "flex-start"
|
|
946
|
-
}, menu)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
947
|
-
item: true,
|
|
948
|
-
xs: 10,
|
|
937
|
+
xs: 6,
|
|
949
938
|
sm: 6
|
|
950
939
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
951
940
|
container: true,
|
|
952
|
-
justifyContent: "center",
|
|
953
941
|
alignItems: "center",
|
|
954
|
-
wrap: "nowrap"
|
|
955
|
-
|
|
942
|
+
wrap: "nowrap",
|
|
943
|
+
sx: {
|
|
944
|
+
button: {
|
|
945
|
+
marginLeft: 4,
|
|
946
|
+
color: 'geowebColors.typographyAndIcons.text'
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
950
|
+
sx: {
|
|
951
|
+
display: 'flex'
|
|
952
|
+
}
|
|
953
|
+
}, /*#__PURE__*/React__default.createElement(GeoWebLogo, {
|
|
954
|
+
style: {
|
|
955
|
+
position: 'relative',
|
|
956
|
+
top: '-1px',
|
|
957
|
+
right: '-1px'
|
|
958
|
+
}
|
|
959
|
+
})), /*#__PURE__*/React__default.createElement(Typography, {
|
|
956
960
|
variant: "h1",
|
|
957
|
-
sx: styles$
|
|
958
|
-
}, title))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
961
|
+
sx: styles$5.title
|
|
962
|
+
}, title), menu)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
959
963
|
item: true,
|
|
960
|
-
xs:
|
|
961
|
-
sm:
|
|
964
|
+
xs: 6,
|
|
965
|
+
sm: 6,
|
|
962
966
|
container: true,
|
|
963
967
|
justifyContent: "flex-end"
|
|
964
968
|
}, userMenu)));
|
|
@@ -1191,17 +1195,13 @@ ErrorBoundary.defaultProps = {
|
|
|
1191
1195
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1192
1196
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
1193
1197
|
* */
|
|
1194
|
-
var styles$
|
|
1198
|
+
var styles$4 = {
|
|
1195
1199
|
small: {
|
|
1196
1200
|
height: 16,
|
|
1197
1201
|
width: 16,
|
|
1198
1202
|
fontSize: '0.5rem'
|
|
1199
1203
|
},
|
|
1200
|
-
large: {
|
|
1201
|
-
height: 32,
|
|
1202
|
-
width: 32,
|
|
1203
|
-
fontSize: '0.938rem'
|
|
1204
|
-
}
|
|
1204
|
+
large: {}
|
|
1205
1205
|
};
|
|
1206
1206
|
|
|
1207
1207
|
var Avatar = function Avatar(_ref) {
|
|
@@ -1210,13 +1210,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
1210
1210
|
size = _ref$size === void 0 ? 'large' : _ref$size;
|
|
1211
1211
|
return /*#__PURE__*/React.createElement(Avatar$1, {
|
|
1212
1212
|
"data-testid": "avatar",
|
|
1213
|
-
sx: Object.assign(
|
|
1214
|
-
fontWeight: 500,
|
|
1215
|
-
color: 'geowebColors.brand.brand',
|
|
1216
|
-
backgroundColor: 'common.white',
|
|
1217
|
-
border: '0.1px solid',
|
|
1218
|
-
borderColor: 'geowebColors.brand.brand'
|
|
1219
|
-
})
|
|
1213
|
+
sx: Object.assign({}, styles$4[size])
|
|
1220
1214
|
}, children);
|
|
1221
1215
|
};
|
|
1222
1216
|
|
|
@@ -1236,7 +1230,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
1236
1230
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1237
1231
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1238
1232
|
* */
|
|
1239
|
-
var styles$
|
|
1233
|
+
var styles$3 = {
|
|
1240
1234
|
container: {
|
|
1241
1235
|
position: 'absolute',
|
|
1242
1236
|
top: 38,
|
|
@@ -1256,8 +1250,13 @@ var styles$2 = {
|
|
|
1256
1250
|
}
|
|
1257
1251
|
},
|
|
1258
1252
|
button: {
|
|
1259
|
-
|
|
1260
|
-
|
|
1253
|
+
padding: 0,
|
|
1254
|
+
border: 'none',
|
|
1255
|
+
background: 'transparent',
|
|
1256
|
+
'&:hover': {
|
|
1257
|
+
border: 'none',
|
|
1258
|
+
background: 'transparent'
|
|
1259
|
+
}
|
|
1261
1260
|
}
|
|
1262
1261
|
};
|
|
1263
1262
|
|
|
@@ -1277,16 +1276,16 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
1277
1276
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1278
1277
|
"data-testid": "userButton",
|
|
1279
1278
|
onClick: onToggle,
|
|
1280
|
-
sx: styles$
|
|
1279
|
+
sx: styles$3.button,
|
|
1281
1280
|
size: "large"
|
|
1282
1281
|
}, /*#__PURE__*/React__default.createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default.createElement(Paper, {
|
|
1283
|
-
sx: styles$
|
|
1282
|
+
sx: styles$3.container,
|
|
1284
1283
|
"data-testid": "userMenu"
|
|
1285
1284
|
}, /*#__PURE__*/React__default.createElement(ClickAwayListener, {
|
|
1286
1285
|
onClickAway: onClose,
|
|
1287
1286
|
mouseEvent: "onMouseDown"
|
|
1288
1287
|
}, /*#__PURE__*/React__default.createElement(MenuList, {
|
|
1289
|
-
sx: styles$
|
|
1288
|
+
sx: styles$3.userMenu,
|
|
1290
1289
|
variant: "menu"
|
|
1291
1290
|
}, children))));
|
|
1292
1291
|
};
|
|
@@ -1354,22 +1353,17 @@ var MenuItemTheme = function MenuItemTheme() {
|
|
|
1354
1353
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1355
1354
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1356
1355
|
* */
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1356
|
+
|
|
1357
|
+
var ToolFooter = function ToolFooter() {
|
|
1358
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
1359
|
+
component: "footer",
|
|
1360
|
+
sx: {
|
|
1361
|
+
boxShadow: 1,
|
|
1362
|
+
backgroundColor: 'geowebColors.background.surface',
|
|
1362
1363
|
textAlign: 'right',
|
|
1363
1364
|
height: 18,
|
|
1364
1365
|
zIndex: 1
|
|
1365
1366
|
}
|
|
1366
|
-
};
|
|
1367
|
-
}); // drag handles will be handled by DraggableResizable/Resizable
|
|
1368
|
-
|
|
1369
|
-
var ToolFooter = function ToolFooter() {
|
|
1370
|
-
var classes = useStyles$4();
|
|
1371
|
-
return /*#__PURE__*/React__default.createElement("footer", {
|
|
1372
|
-
className: classes.footer
|
|
1373
1367
|
});
|
|
1374
1368
|
};
|
|
1375
1369
|
|
|
@@ -1386,8 +1380,8 @@ var ToolFooter = function ToolFooter() {
|
|
|
1386
1380
|
* See the License for the specific language governing permissions and
|
|
1387
1381
|
* limitations under the License.
|
|
1388
1382
|
*
|
|
1389
|
-
* Copyright
|
|
1390
|
-
* Copyright
|
|
1383
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1384
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
1391
1385
|
* */
|
|
1392
1386
|
|
|
1393
1387
|
var getStyle = function getStyle(size) {
|
|
@@ -1546,7 +1540,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1546
1540
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1547
1541
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1548
1542
|
* */
|
|
1549
|
-
var styles$
|
|
1543
|
+
var styles$2 = {
|
|
1550
1544
|
container: {
|
|
1551
1545
|
overflow: 'hidden',
|
|
1552
1546
|
borderRadius: 0,
|
|
@@ -1585,7 +1579,7 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
1585
1579
|
|
|
1586
1580
|
return /*#__PURE__*/React__default.createElement(Paper, Object.assign({
|
|
1587
1581
|
elevation: elevation,
|
|
1588
|
-
sx: styles$
|
|
1582
|
+
sx: styles$2.container
|
|
1589
1583
|
}, props), /*#__PURE__*/React__default.createElement(ErrorBoundary, null, /*#__PURE__*/React__default.createElement(ToolHeader, {
|
|
1590
1584
|
title: title,
|
|
1591
1585
|
size: size,
|
|
@@ -1594,7 +1588,7 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
1594
1588
|
className: headerClassName,
|
|
1595
1589
|
leftComponent: leftComponent
|
|
1596
1590
|
})), /*#__PURE__*/React__default.createElement(Box, {
|
|
1597
|
-
sx: styles$
|
|
1591
|
+
sx: styles$2.content,
|
|
1598
1592
|
style: {
|
|
1599
1593
|
maxHeight: maxHeight
|
|
1600
1594
|
}
|
|
@@ -1788,75 +1782,63 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1788
1782
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1789
1783
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1790
1784
|
* */
|
|
1791
|
-
var
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
},
|
|
1817
|
-
connect: {
|
|
1818
|
-
fontSize: 18
|
|
1819
|
-
},
|
|
1820
|
-
divider: {
|
|
1821
|
-
margin: '0 6px',
|
|
1822
|
-
fontSize: 18
|
|
1823
|
-
}
|
|
1824
|
-
};
|
|
1825
|
-
});
|
|
1785
|
+
var segmentStyle = {
|
|
1786
|
+
margin: '0 2px',
|
|
1787
|
+
verticalAlign: 'middle',
|
|
1788
|
+
fontSize: 14,
|
|
1789
|
+
fontWeight: 500,
|
|
1790
|
+
letterSpacing: 0.25,
|
|
1791
|
+
justifyContent: 'center'
|
|
1792
|
+
};
|
|
1793
|
+
var styles$1 = {
|
|
1794
|
+
icon: Object.assign(Object.assign({}, segmentStyle), {
|
|
1795
|
+
backgroundColor: 'geowebColors.textInputField.default.rgba',
|
|
1796
|
+
width: 40,
|
|
1797
|
+
height: 40,
|
|
1798
|
+
display: 'inline-flex',
|
|
1799
|
+
alignItems: 'center',
|
|
1800
|
+
borderRadius: 1
|
|
1801
|
+
}),
|
|
1802
|
+
connect: Object.assign(Object.assign({}, segmentStyle), {
|
|
1803
|
+
fontSize: 18
|
|
1804
|
+
}),
|
|
1805
|
+
divider: Object.assign(Object.assign({}, segmentStyle), {
|
|
1806
|
+
margin: '0 6px',
|
|
1807
|
+
fontSize: 18
|
|
1808
|
+
})
|
|
1809
|
+
};
|
|
1826
1810
|
|
|
1827
1811
|
var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
1828
1812
|
var _ref$type = _ref.type,
|
|
1829
1813
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1830
1814
|
children = _ref.children;
|
|
1831
|
-
var classes = useStyles$3();
|
|
1832
1815
|
|
|
1833
1816
|
if (type === 'divider') {
|
|
1834
1817
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1818
|
+
sx: styles$1.divider,
|
|
1835
1819
|
"data-testid": "segment-divider",
|
|
1836
|
-
className: "".concat(classes.segment, " ").concat(classes.divider),
|
|
1837
1820
|
component: "span"
|
|
1838
1821
|
}, children);
|
|
1839
1822
|
}
|
|
1840
1823
|
|
|
1841
1824
|
if (type === 'icon') {
|
|
1842
|
-
return /*#__PURE__*/React__default.createElement(
|
|
1825
|
+
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1826
|
+
sx: styles$1.icon,
|
|
1843
1827
|
"data-testid": "segment-icon",
|
|
1844
|
-
className: "".concat(classes.segment, " ").concat(classes.icon)
|
|
1845
|
-
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
1846
1828
|
component: "span"
|
|
1847
|
-
}, children)
|
|
1829
|
+
}, children);
|
|
1848
1830
|
}
|
|
1849
1831
|
|
|
1850
1832
|
if (type === 'connect') {
|
|
1851
1833
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1852
|
-
|
|
1834
|
+
sx: styles$1.connect,
|
|
1853
1835
|
"data-testid": "segment-connect",
|
|
1854
1836
|
component: "span"
|
|
1855
1837
|
}, children);
|
|
1856
1838
|
}
|
|
1857
1839
|
|
|
1858
1840
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1859
|
-
|
|
1841
|
+
sx: segmentStyle,
|
|
1860
1842
|
"data-testid": "segment-text",
|
|
1861
1843
|
component: "span"
|
|
1862
1844
|
}, children);
|
|
@@ -2013,33 +1995,18 @@ var getShortcutList = function getShortcutList(shortcutList) {
|
|
|
2013
1995
|
});
|
|
2014
1996
|
});
|
|
2015
1997
|
};
|
|
2016
|
-
var useStyles$2 = makeStyles(function () {
|
|
2017
|
-
return {
|
|
2018
|
-
row: {
|
|
2019
|
-
minHeight: 56
|
|
2020
|
-
},
|
|
2021
|
-
title: {
|
|
2022
|
-
fontSize: 12,
|
|
2023
|
-
fontWeight: 300,
|
|
2024
|
-
letterSpacing: 0.4,
|
|
2025
|
-
opacity: 0.67
|
|
2026
|
-
},
|
|
2027
|
-
description: {
|
|
2028
|
-
alignItems: 'center'
|
|
2029
|
-
}
|
|
2030
|
-
};
|
|
2031
|
-
});
|
|
2032
1998
|
|
|
2033
1999
|
var ShortcutList = function ShortcutList(_ref2) {
|
|
2034
2000
|
var _ref2$platform = _ref2.platform,
|
|
2035
2001
|
platform = _ref2$platform === void 0 ? 'windows' : _ref2$platform;
|
|
2036
|
-
var classes = useStyles$2();
|
|
2037
2002
|
var rows = getShortcutList(shortcuts, platform);
|
|
2038
2003
|
return /*#__PURE__*/React__default.createElement(List, {
|
|
2039
2004
|
"data-testid": "list-".concat(platform)
|
|
2040
2005
|
}, rows.map(function (row, index) {
|
|
2041
2006
|
return /*#__PURE__*/React__default.createElement(ListItem, {
|
|
2042
|
-
|
|
2007
|
+
sx: {
|
|
2008
|
+
minHeight: 56
|
|
2009
|
+
},
|
|
2043
2010
|
divider: index !== rows.length - 1,
|
|
2044
2011
|
key: row.title
|
|
2045
2012
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -2049,11 +2016,18 @@ var ShortcutList = function ShortcutList(_ref2) {
|
|
|
2049
2016
|
alignItems: "center"
|
|
2050
2017
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2051
2018
|
item: true,
|
|
2052
|
-
|
|
2019
|
+
sx: {
|
|
2020
|
+
fontSize: 12,
|
|
2021
|
+
fontWeight: 300,
|
|
2022
|
+
letterSpacing: 0.4,
|
|
2023
|
+
opacity: 0.67
|
|
2024
|
+
}
|
|
2053
2025
|
}, row.title), /*#__PURE__*/React__default.createElement(Grid, {
|
|
2054
2026
|
item: true
|
|
2055
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
2056
|
-
|
|
2027
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
2028
|
+
sx: {
|
|
2029
|
+
alignItems: 'center'
|
|
2030
|
+
}
|
|
2057
2031
|
}, row.description))));
|
|
2058
2032
|
}));
|
|
2059
2033
|
};
|
|
@@ -2112,17 +2086,7 @@ var CheatSheet = function CheatSheet() {
|
|
|
2112
2086
|
})));
|
|
2113
2087
|
};
|
|
2114
2088
|
|
|
2115
|
-
var useStyles$1 = makeStyles(function () {
|
|
2116
|
-
return {
|
|
2117
|
-
backdrop: {
|
|
2118
|
-
zIndex: 1
|
|
2119
|
-
}
|
|
2120
|
-
};
|
|
2121
|
-
});
|
|
2122
|
-
|
|
2123
2089
|
var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
2124
|
-
var classes = useStyles$1();
|
|
2125
|
-
|
|
2126
2090
|
var _React$useState = React__default.useState(false),
|
|
2127
2091
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2128
2092
|
open = _React$useState2[0],
|
|
@@ -2147,7 +2111,9 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
|
2147
2111
|
}, "Cheat sheet"))), /*#__PURE__*/React__default.createElement(Backdrop, {
|
|
2148
2112
|
"data-testid": "cheatsheet-content",
|
|
2149
2113
|
open: open,
|
|
2150
|
-
|
|
2114
|
+
sx: {
|
|
2115
|
+
zIndex: 1
|
|
2116
|
+
}
|
|
2151
2117
|
}, /*#__PURE__*/React__default.createElement(DraggableComponent, {
|
|
2152
2118
|
startSize: {
|
|
2153
2119
|
width: 700
|
|
@@ -2471,14 +2437,14 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2471
2437
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
2472
2438
|
placement: "top",
|
|
2473
2439
|
title: tooltipTitle
|
|
2474
|
-
}, /*#__PURE__*/React.createElement(
|
|
2440
|
+
}, /*#__PURE__*/React.createElement(ToolButton, {
|
|
2475
2441
|
active: isOpen,
|
|
2476
2442
|
sx: buttonSx,
|
|
2477
2443
|
onClick: handleClick,
|
|
2478
2444
|
"data-testid": buttonTestId,
|
|
2479
2445
|
variant: variant,
|
|
2480
2446
|
id: buttonTestId
|
|
2481
|
-
}, /*#__PURE__*/React.createElement(Options, null)))
|
|
2447
|
+
}, /*#__PURE__*/React.createElement(Options, null))), /*#__PURE__*/React.createElement(Menu, {
|
|
2482
2448
|
anchorEl: anchorEl,
|
|
2483
2449
|
open: isOpen,
|
|
2484
2450
|
onClose: handleClose,
|
|
@@ -2525,56 +2491,46 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2525
2491
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2526
2492
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2527
2493
|
* */
|
|
2528
|
-
var useStyles = makeStyles(function (theme) {
|
|
2529
|
-
return createStyles({
|
|
2530
|
-
button: {
|
|
2531
|
-
height: 24,
|
|
2532
|
-
width: 24,
|
|
2533
|
-
borderRadius: 5,
|
|
2534
|
-
marginTop: 4,
|
|
2535
|
-
color: function color(_ref) {
|
|
2536
|
-
var isActive = _ref.isActive,
|
|
2537
|
-
isAccessible = _ref.isAccessible,
|
|
2538
|
-
isEnabled = _ref.isEnabled;
|
|
2539
|
-
|
|
2540
|
-
if (!isEnabled) {
|
|
2541
|
-
return theme.palette.geowebColors.buttons.flat.disabled.color;
|
|
2542
|
-
}
|
|
2543
2494
|
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2495
|
+
var makeButtonStyles = function makeButtonStyles(isActive, isEnabled, isAccessible) {
|
|
2496
|
+
return {
|
|
2497
|
+
height: '24px',
|
|
2498
|
+
width: '24px',
|
|
2499
|
+
borderRadius: '5px',
|
|
2500
|
+
marginTop: '4px',
|
|
2501
|
+
color: function color() {
|
|
2502
|
+
if (!isEnabled) {
|
|
2503
|
+
return 'geowebColors.buttons.flat.disabled.color';
|
|
2504
|
+
}
|
|
2547
2505
|
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2506
|
+
if (isAccessible) {
|
|
2507
|
+
return 'geowebColors.greys.accessible';
|
|
2508
|
+
}
|
|
2551
2509
|
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
backgroundColor: function backgroundColor(_ref2) {
|
|
2555
|
-
var isActive = _ref2.isActive;
|
|
2556
|
-
return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
|
|
2557
|
-
},
|
|
2558
|
-
'&:focus': {
|
|
2559
|
-
backgroundColor: function backgroundColor(_ref3) {
|
|
2560
|
-
var isActive = _ref3.isActive;
|
|
2561
|
-
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2562
|
-
},
|
|
2563
|
-
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
2564
|
-
borderRadius: 0
|
|
2565
|
-
},
|
|
2566
|
-
'&:hover': {
|
|
2567
|
-
backgroundColor: function backgroundColor(_ref4) {
|
|
2568
|
-
var isActive = _ref4.isActive;
|
|
2569
|
-
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2570
|
-
}
|
|
2510
|
+
if (isActive) {
|
|
2511
|
+
return 'common.white';
|
|
2571
2512
|
}
|
|
2513
|
+
|
|
2514
|
+
return 'geowebColors.buttons.flat.default.color';
|
|
2572
2515
|
},
|
|
2573
|
-
|
|
2574
|
-
|
|
2516
|
+
backgroundColor: function backgroundColor() {
|
|
2517
|
+
return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
|
|
2518
|
+
},
|
|
2519
|
+
'&:focus': {
|
|
2520
|
+
backgroundColor: function backgroundColor() {
|
|
2521
|
+
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2522
|
+
},
|
|
2523
|
+
outline: 'geowebColors.buttons.focusDefault.outline',
|
|
2524
|
+
borderRadius: 0
|
|
2525
|
+
},
|
|
2526
|
+
'&:hover': {
|
|
2527
|
+
backgroundColor: function backgroundColor() {
|
|
2528
|
+
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2529
|
+
}
|
|
2575
2530
|
}
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2531
|
+
};
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2578
2534
|
var ManagerButton = function ManagerButton(_a) {
|
|
2579
2535
|
var _a$tooltipTitle = _a.tooltipTitle,
|
|
2580
2536
|
tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
|
|
@@ -2588,14 +2544,10 @@ var ManagerButton = function ManagerButton(_a) {
|
|
|
2588
2544
|
testId = _a.testId,
|
|
2589
2545
|
_a$isAccessible = _a.isAccessible,
|
|
2590
2546
|
isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
|
|
2591
|
-
|
|
2592
|
-
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "
|
|
2547
|
+
sx = _a.sx,
|
|
2548
|
+
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "sx"]);
|
|
2593
2549
|
|
|
2594
|
-
var
|
|
2595
|
-
isActive: isActive,
|
|
2596
|
-
isEnabled: isEnabled,
|
|
2597
|
-
isAccessible: isAccessible
|
|
2598
|
-
});
|
|
2550
|
+
var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
|
|
2599
2551
|
|
|
2600
2552
|
var handleClick = function handleClick(event) {
|
|
2601
2553
|
onClick(event);
|
|
@@ -2604,14 +2556,14 @@ var ManagerButton = function ManagerButton(_a) {
|
|
|
2604
2556
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
2605
2557
|
title: tooltipTitle,
|
|
2606
2558
|
placement: "top",
|
|
2607
|
-
|
|
2608
|
-
|
|
2559
|
+
sx: {
|
|
2560
|
+
pointerEvents: 'none'
|
|
2609
2561
|
}
|
|
2610
2562
|
}, /*#__PURE__*/React.createElement(IconButton, Object.assign({
|
|
2611
2563
|
size: "small",
|
|
2612
2564
|
onClick: handleClick,
|
|
2613
2565
|
"data-testid": testId,
|
|
2614
|
-
|
|
2566
|
+
sx: Object.assign(Object.assign({}, buttonStyles), sx),
|
|
2615
2567
|
disableFocusRipple: true
|
|
2616
2568
|
}, props), icon));
|
|
2617
2569
|
};
|