@opengeoweb/shared 3.0.0 → 4.0.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
|
@@ -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,32 +869,27 @@ 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
894
|
var _ref;
|
|
900
895
|
|
|
@@ -931,9 +926,9 @@ var AppHeader = function AppHeader(_ref2) {
|
|
|
931
926
|
title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title;
|
|
932
927
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
933
928
|
component: "header",
|
|
934
|
-
sx: styles$
|
|
929
|
+
sx: styles$5.header
|
|
935
930
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
936
|
-
sx: styles$
|
|
931
|
+
sx: styles$5.container,
|
|
937
932
|
container: true,
|
|
938
933
|
alignItems: "center"
|
|
939
934
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -954,7 +949,7 @@ var AppHeader = function AppHeader(_ref2) {
|
|
|
954
949
|
wrap: "nowrap"
|
|
955
950
|
}, /*#__PURE__*/React__default.createElement(GeoWebLogo, null), /*#__PURE__*/React__default.createElement(Typography, {
|
|
956
951
|
variant: "h1",
|
|
957
|
-
sx: styles$
|
|
952
|
+
sx: styles$5.title
|
|
958
953
|
}, title))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
959
954
|
item: true,
|
|
960
955
|
xs: 1,
|
|
@@ -1191,7 +1186,7 @@ ErrorBoundary.defaultProps = {
|
|
|
1191
1186
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1192
1187
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
1193
1188
|
* */
|
|
1194
|
-
var styles$
|
|
1189
|
+
var styles$4 = {
|
|
1195
1190
|
small: {
|
|
1196
1191
|
height: 16,
|
|
1197
1192
|
width: 16,
|
|
@@ -1210,7 +1205,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
1210
1205
|
size = _ref$size === void 0 ? 'large' : _ref$size;
|
|
1211
1206
|
return /*#__PURE__*/React.createElement(Avatar$1, {
|
|
1212
1207
|
"data-testid": "avatar",
|
|
1213
|
-
sx: Object.assign(Object.assign({}, styles$
|
|
1208
|
+
sx: Object.assign(Object.assign({}, styles$4[size]), {
|
|
1214
1209
|
fontWeight: 500,
|
|
1215
1210
|
color: 'geowebColors.brand.brand',
|
|
1216
1211
|
backgroundColor: 'common.white',
|
|
@@ -1236,7 +1231,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
1236
1231
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1237
1232
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1238
1233
|
* */
|
|
1239
|
-
var styles$
|
|
1234
|
+
var styles$3 = {
|
|
1240
1235
|
container: {
|
|
1241
1236
|
position: 'absolute',
|
|
1242
1237
|
top: 38,
|
|
@@ -1277,16 +1272,16 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
1277
1272
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1278
1273
|
"data-testid": "userButton",
|
|
1279
1274
|
onClick: onToggle,
|
|
1280
|
-
sx: styles$
|
|
1275
|
+
sx: styles$3.button,
|
|
1281
1276
|
size: "large"
|
|
1282
1277
|
}, /*#__PURE__*/React__default.createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default.createElement(Paper, {
|
|
1283
|
-
sx: styles$
|
|
1278
|
+
sx: styles$3.container,
|
|
1284
1279
|
"data-testid": "userMenu"
|
|
1285
1280
|
}, /*#__PURE__*/React__default.createElement(ClickAwayListener, {
|
|
1286
1281
|
onClickAway: onClose,
|
|
1287
1282
|
mouseEvent: "onMouseDown"
|
|
1288
1283
|
}, /*#__PURE__*/React__default.createElement(MenuList, {
|
|
1289
|
-
sx: styles$
|
|
1284
|
+
sx: styles$3.userMenu,
|
|
1290
1285
|
variant: "menu"
|
|
1291
1286
|
}, children))));
|
|
1292
1287
|
};
|
|
@@ -1354,22 +1349,17 @@ var MenuItemTheme = function MenuItemTheme() {
|
|
|
1354
1349
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1355
1350
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1356
1351
|
* */
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1352
|
+
|
|
1353
|
+
var ToolFooter = function ToolFooter() {
|
|
1354
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
1355
|
+
component: "footer",
|
|
1356
|
+
sx: {
|
|
1357
|
+
boxShadow: 1,
|
|
1358
|
+
backgroundColor: 'geowebColors.background.surface',
|
|
1362
1359
|
textAlign: 'right',
|
|
1363
1360
|
height: 18,
|
|
1364
1361
|
zIndex: 1
|
|
1365
1362
|
}
|
|
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
1363
|
});
|
|
1374
1364
|
};
|
|
1375
1365
|
|
|
@@ -1546,7 +1536,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1546
1536
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1547
1537
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1548
1538
|
* */
|
|
1549
|
-
var styles$
|
|
1539
|
+
var styles$2 = {
|
|
1550
1540
|
container: {
|
|
1551
1541
|
overflow: 'hidden',
|
|
1552
1542
|
borderRadius: 0,
|
|
@@ -1585,7 +1575,7 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
1585
1575
|
|
|
1586
1576
|
return /*#__PURE__*/React__default.createElement(Paper, Object.assign({
|
|
1587
1577
|
elevation: elevation,
|
|
1588
|
-
sx: styles$
|
|
1578
|
+
sx: styles$2.container
|
|
1589
1579
|
}, props), /*#__PURE__*/React__default.createElement(ErrorBoundary, null, /*#__PURE__*/React__default.createElement(ToolHeader, {
|
|
1590
1580
|
title: title,
|
|
1591
1581
|
size: size,
|
|
@@ -1594,7 +1584,7 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
1594
1584
|
className: headerClassName,
|
|
1595
1585
|
leftComponent: leftComponent
|
|
1596
1586
|
})), /*#__PURE__*/React__default.createElement(Box, {
|
|
1597
|
-
sx: styles$
|
|
1587
|
+
sx: styles$2.content,
|
|
1598
1588
|
style: {
|
|
1599
1589
|
maxHeight: maxHeight
|
|
1600
1590
|
}
|
|
@@ -1788,75 +1778,63 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1788
1778
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1789
1779
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1790
1780
|
* */
|
|
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
|
-
});
|
|
1781
|
+
var segmentStyle = {
|
|
1782
|
+
margin: '0 2px',
|
|
1783
|
+
verticalAlign: 'middle',
|
|
1784
|
+
fontSize: 14,
|
|
1785
|
+
fontWeight: 500,
|
|
1786
|
+
letterSpacing: 0.25,
|
|
1787
|
+
justifyContent: 'center'
|
|
1788
|
+
};
|
|
1789
|
+
var styles$1 = {
|
|
1790
|
+
icon: Object.assign(Object.assign({}, segmentStyle), {
|
|
1791
|
+
backgroundColor: 'geowebColors.textInputField.default.rgba',
|
|
1792
|
+
width: 40,
|
|
1793
|
+
height: 40,
|
|
1794
|
+
display: 'inline-flex',
|
|
1795
|
+
alignItems: 'center',
|
|
1796
|
+
borderRadius: 1
|
|
1797
|
+
}),
|
|
1798
|
+
connect: Object.assign(Object.assign({}, segmentStyle), {
|
|
1799
|
+
fontSize: 18
|
|
1800
|
+
}),
|
|
1801
|
+
divider: Object.assign(Object.assign({}, segmentStyle), {
|
|
1802
|
+
margin: '0 6px',
|
|
1803
|
+
fontSize: 18
|
|
1804
|
+
})
|
|
1805
|
+
};
|
|
1826
1806
|
|
|
1827
1807
|
var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
1828
1808
|
var _ref$type = _ref.type,
|
|
1829
1809
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1830
1810
|
children = _ref.children;
|
|
1831
|
-
var classes = useStyles$3();
|
|
1832
1811
|
|
|
1833
1812
|
if (type === 'divider') {
|
|
1834
1813
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1814
|
+
sx: styles$1.divider,
|
|
1835
1815
|
"data-testid": "segment-divider",
|
|
1836
|
-
className: "".concat(classes.segment, " ").concat(classes.divider),
|
|
1837
1816
|
component: "span"
|
|
1838
1817
|
}, children);
|
|
1839
1818
|
}
|
|
1840
1819
|
|
|
1841
1820
|
if (type === 'icon') {
|
|
1842
|
-
return /*#__PURE__*/React__default.createElement(
|
|
1821
|
+
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1822
|
+
sx: styles$1.icon,
|
|
1843
1823
|
"data-testid": "segment-icon",
|
|
1844
|
-
className: "".concat(classes.segment, " ").concat(classes.icon)
|
|
1845
|
-
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
1846
1824
|
component: "span"
|
|
1847
|
-
}, children)
|
|
1825
|
+
}, children);
|
|
1848
1826
|
}
|
|
1849
1827
|
|
|
1850
1828
|
if (type === 'connect') {
|
|
1851
1829
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1852
|
-
|
|
1830
|
+
sx: styles$1.connect,
|
|
1853
1831
|
"data-testid": "segment-connect",
|
|
1854
1832
|
component: "span"
|
|
1855
1833
|
}, children);
|
|
1856
1834
|
}
|
|
1857
1835
|
|
|
1858
1836
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
1859
|
-
|
|
1837
|
+
sx: segmentStyle,
|
|
1860
1838
|
"data-testid": "segment-text",
|
|
1861
1839
|
component: "span"
|
|
1862
1840
|
}, children);
|
|
@@ -2013,33 +1991,18 @@ var getShortcutList = function getShortcutList(shortcutList) {
|
|
|
2013
1991
|
});
|
|
2014
1992
|
});
|
|
2015
1993
|
};
|
|
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
1994
|
|
|
2033
1995
|
var ShortcutList = function ShortcutList(_ref2) {
|
|
2034
1996
|
var _ref2$platform = _ref2.platform,
|
|
2035
1997
|
platform = _ref2$platform === void 0 ? 'windows' : _ref2$platform;
|
|
2036
|
-
var classes = useStyles$2();
|
|
2037
1998
|
var rows = getShortcutList(shortcuts, platform);
|
|
2038
1999
|
return /*#__PURE__*/React__default.createElement(List, {
|
|
2039
2000
|
"data-testid": "list-".concat(platform)
|
|
2040
2001
|
}, rows.map(function (row, index) {
|
|
2041
2002
|
return /*#__PURE__*/React__default.createElement(ListItem, {
|
|
2042
|
-
|
|
2003
|
+
sx: {
|
|
2004
|
+
minHeight: 56
|
|
2005
|
+
},
|
|
2043
2006
|
divider: index !== rows.length - 1,
|
|
2044
2007
|
key: row.title
|
|
2045
2008
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -2049,11 +2012,18 @@ var ShortcutList = function ShortcutList(_ref2) {
|
|
|
2049
2012
|
alignItems: "center"
|
|
2050
2013
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2051
2014
|
item: true,
|
|
2052
|
-
|
|
2015
|
+
sx: {
|
|
2016
|
+
fontSize: 12,
|
|
2017
|
+
fontWeight: 300,
|
|
2018
|
+
letterSpacing: 0.4,
|
|
2019
|
+
opacity: 0.67
|
|
2020
|
+
}
|
|
2053
2021
|
}, row.title), /*#__PURE__*/React__default.createElement(Grid, {
|
|
2054
2022
|
item: true
|
|
2055
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
2056
|
-
|
|
2023
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
2024
|
+
sx: {
|
|
2025
|
+
alignItems: 'center'
|
|
2026
|
+
}
|
|
2057
2027
|
}, row.description))));
|
|
2058
2028
|
}));
|
|
2059
2029
|
};
|
|
@@ -2112,17 +2082,7 @@ var CheatSheet = function CheatSheet() {
|
|
|
2112
2082
|
})));
|
|
2113
2083
|
};
|
|
2114
2084
|
|
|
2115
|
-
var useStyles$1 = makeStyles(function () {
|
|
2116
|
-
return {
|
|
2117
|
-
backdrop: {
|
|
2118
|
-
zIndex: 1
|
|
2119
|
-
}
|
|
2120
|
-
};
|
|
2121
|
-
});
|
|
2122
|
-
|
|
2123
2085
|
var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
2124
|
-
var classes = useStyles$1();
|
|
2125
|
-
|
|
2126
2086
|
var _React$useState = React__default.useState(false),
|
|
2127
2087
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2128
2088
|
open = _React$useState2[0],
|
|
@@ -2147,7 +2107,9 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
|
2147
2107
|
}, "Cheat sheet"))), /*#__PURE__*/React__default.createElement(Backdrop, {
|
|
2148
2108
|
"data-testid": "cheatsheet-content",
|
|
2149
2109
|
open: open,
|
|
2150
|
-
|
|
2110
|
+
sx: {
|
|
2111
|
+
zIndex: 1
|
|
2112
|
+
}
|
|
2151
2113
|
}, /*#__PURE__*/React__default.createElement(DraggableComponent, {
|
|
2152
2114
|
startSize: {
|
|
2153
2115
|
width: 700
|
|
@@ -2471,14 +2433,14 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2471
2433
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
2472
2434
|
placement: "top",
|
|
2473
2435
|
title: tooltipTitle
|
|
2474
|
-
}, /*#__PURE__*/React.createElement(
|
|
2436
|
+
}, /*#__PURE__*/React.createElement(ToolButton, {
|
|
2475
2437
|
active: isOpen,
|
|
2476
2438
|
sx: buttonSx,
|
|
2477
2439
|
onClick: handleClick,
|
|
2478
2440
|
"data-testid": buttonTestId,
|
|
2479
2441
|
variant: variant,
|
|
2480
2442
|
id: buttonTestId
|
|
2481
|
-
}, /*#__PURE__*/React.createElement(Options, null)))
|
|
2443
|
+
}, /*#__PURE__*/React.createElement(Options, null))), /*#__PURE__*/React.createElement(Menu, {
|
|
2482
2444
|
anchorEl: anchorEl,
|
|
2483
2445
|
open: isOpen,
|
|
2484
2446
|
onClose: handleClose,
|
|
@@ -2525,56 +2487,46 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2525
2487
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2526
2488
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2527
2489
|
* */
|
|
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
2490
|
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2491
|
+
var makeButtonStyles = function makeButtonStyles(isActive, isEnabled, isAccessible) {
|
|
2492
|
+
return {
|
|
2493
|
+
height: '24px',
|
|
2494
|
+
width: '24px',
|
|
2495
|
+
borderRadius: '5px',
|
|
2496
|
+
marginTop: '4px',
|
|
2497
|
+
color: function color() {
|
|
2498
|
+
if (!isEnabled) {
|
|
2499
|
+
return 'geowebColors.buttons.flat.disabled.color';
|
|
2500
|
+
}
|
|
2547
2501
|
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2502
|
+
if (isAccessible) {
|
|
2503
|
+
return 'geowebColors.greys.accessible';
|
|
2504
|
+
}
|
|
2551
2505
|
|
|
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
|
-
}
|
|
2506
|
+
if (isActive) {
|
|
2507
|
+
return 'common.white';
|
|
2571
2508
|
}
|
|
2509
|
+
|
|
2510
|
+
return 'geowebColors.buttons.flat.default.color';
|
|
2572
2511
|
},
|
|
2573
|
-
|
|
2574
|
-
|
|
2512
|
+
backgroundColor: function backgroundColor() {
|
|
2513
|
+
return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
|
|
2514
|
+
},
|
|
2515
|
+
'&:focus': {
|
|
2516
|
+
backgroundColor: function backgroundColor() {
|
|
2517
|
+
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2518
|
+
},
|
|
2519
|
+
outline: 'geowebColors.buttons.focusDefault.outline',
|
|
2520
|
+
borderRadius: 0
|
|
2521
|
+
},
|
|
2522
|
+
'&:hover': {
|
|
2523
|
+
backgroundColor: function backgroundColor() {
|
|
2524
|
+
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2525
|
+
}
|
|
2575
2526
|
}
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2527
|
+
};
|
|
2528
|
+
};
|
|
2529
|
+
|
|
2578
2530
|
var ManagerButton = function ManagerButton(_a) {
|
|
2579
2531
|
var _a$tooltipTitle = _a.tooltipTitle,
|
|
2580
2532
|
tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
|
|
@@ -2588,14 +2540,10 @@ var ManagerButton = function ManagerButton(_a) {
|
|
|
2588
2540
|
testId = _a.testId,
|
|
2589
2541
|
_a$isAccessible = _a.isAccessible,
|
|
2590
2542
|
isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
|
|
2591
|
-
|
|
2592
|
-
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "
|
|
2543
|
+
sx = _a.sx,
|
|
2544
|
+
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "sx"]);
|
|
2593
2545
|
|
|
2594
|
-
var
|
|
2595
|
-
isActive: isActive,
|
|
2596
|
-
isEnabled: isEnabled,
|
|
2597
|
-
isAccessible: isAccessible
|
|
2598
|
-
});
|
|
2546
|
+
var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
|
|
2599
2547
|
|
|
2600
2548
|
var handleClick = function handleClick(event) {
|
|
2601
2549
|
onClick(event);
|
|
@@ -2604,14 +2552,14 @@ var ManagerButton = function ManagerButton(_a) {
|
|
|
2604
2552
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
2605
2553
|
title: tooltipTitle,
|
|
2606
2554
|
placement: "top",
|
|
2607
|
-
|
|
2608
|
-
|
|
2555
|
+
sx: {
|
|
2556
|
+
pointerEvents: 'none'
|
|
2609
2557
|
}
|
|
2610
2558
|
}, /*#__PURE__*/React.createElement(IconButton, Object.assign({
|
|
2611
2559
|
size: "small",
|
|
2612
2560
|
onClick: handleClick,
|
|
2613
2561
|
"data-testid": testId,
|
|
2614
|
-
|
|
2562
|
+
sx: Object.assign(Object.assign({}, buttonStyles), sx),
|
|
2615
2563
|
disableFocusRipple: true
|
|
2616
2564
|
}, props), icon));
|
|
2617
2565
|
};
|
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('@opengeoweb/theme'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@opengeoweb/theme', 'react-hook-form', '@opengeoweb/form-fields', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.theme, global.reactHookForm, global.formFields, global.
|
|
5
|
-
})(this, (function (exports, React, material, theme, reactHookForm, formFields,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@opengeoweb/theme'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('react-draggable'), require('re-resizable'), require('lodash')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@opengeoweb/theme', 'react-hook-form', '@opengeoweb/form-fields', 'react-draggable', 're-resizable', 'lodash'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.theme, global.reactHookForm, global.formFields, global.Draggable, global.reResizable, global.lodash));
|
|
5
|
+
})(this, (function (exports, React, material, theme, reactHookForm, formFields, Draggable, reResizable, lodash) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -26,9 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
-
var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
|
|
30
29
|
var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
|
|
31
|
-
var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
|
|
32
30
|
|
|
33
31
|
/*! *****************************************************************************
|
|
34
32
|
Copyright (c) Microsoft Corporation.
|
|
@@ -664,7 +662,7 @@
|
|
|
664
662
|
}
|
|
665
663
|
},
|
|
666
664
|
'& .MuiAlert-icon': {
|
|
667
|
-
|
|
665
|
+
marginTop: '-3px',
|
|
668
666
|
padding: '0px'
|
|
669
667
|
}
|
|
670
668
|
} : {
|
|
@@ -685,13 +683,15 @@
|
|
|
685
683
|
fontWeight: 'normal',
|
|
686
684
|
marginTop: '0px!important',
|
|
687
685
|
paddingTop: '0px!important',
|
|
688
|
-
marginBottom: '0px!important'
|
|
686
|
+
marginBottom: '0px!important',
|
|
687
|
+
lineHeight: isCompact ? '18px' : '24px'
|
|
689
688
|
}
|
|
690
689
|
}, title), info && /*#__PURE__*/React__namespace.createElement(material.Box, {
|
|
691
690
|
sx: {
|
|
692
691
|
fontSize: '16px',
|
|
693
692
|
marginTop: 1,
|
|
694
|
-
wordBreak: 'break-word'
|
|
693
|
+
wordBreak: 'break-word',
|
|
694
|
+
lineHeight: '22px'
|
|
695
695
|
}
|
|
696
696
|
}, info), actionButtonProps && /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
697
697
|
variant: "flat",
|
|
@@ -722,28 +722,23 @@
|
|
|
722
722
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
723
723
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
724
724
|
* */
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
725
|
+
|
|
726
|
+
var AppLayout = function AppLayout(_a) {
|
|
727
|
+
var header = _a.header,
|
|
728
|
+
children = _a.children;
|
|
729
|
+
return /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
730
|
+
sx: {
|
|
728
731
|
height: '100vh',
|
|
729
732
|
display: 'flex',
|
|
730
733
|
flexDirection: 'column'
|
|
731
734
|
},
|
|
732
|
-
|
|
735
|
+
"data-testid": "appLayout"
|
|
736
|
+
}, header, /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
737
|
+
component: "main",
|
|
738
|
+
sx: {
|
|
733
739
|
flex: 1,
|
|
734
740
|
position: 'relative'
|
|
735
741
|
}
|
|
736
|
-
};
|
|
737
|
-
});
|
|
738
|
-
|
|
739
|
-
var AppLayout = function AppLayout(_a) {
|
|
740
|
-
var header = _a.header,
|
|
741
|
-
children = _a.children;
|
|
742
|
-
var classes = useStyles$5();
|
|
743
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
744
|
-
className: classes.wrapper
|
|
745
|
-
}, header, /*#__PURE__*/React__default["default"].createElement("main", {
|
|
746
|
-
className: classes.main
|
|
747
742
|
}, children));
|
|
748
743
|
};
|
|
749
744
|
|
|
@@ -763,7 +758,7 @@
|
|
|
763
758
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
764
759
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
765
760
|
* */
|
|
766
|
-
var styles$
|
|
761
|
+
var styles$5 = {
|
|
767
762
|
header: function header(theme) {
|
|
768
763
|
var _a;
|
|
769
764
|
|
|
@@ -800,9 +795,9 @@
|
|
|
800
795
|
title = _b === void 0 ? 'GeoWeb' : _b;
|
|
801
796
|
return /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
802
797
|
component: "header",
|
|
803
|
-
sx: styles$
|
|
798
|
+
sx: styles$5.header
|
|
804
799
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
805
|
-
sx: styles$
|
|
800
|
+
sx: styles$5.container,
|
|
806
801
|
container: true,
|
|
807
802
|
alignItems: "center"
|
|
808
803
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
@@ -823,7 +818,7 @@
|
|
|
823
818
|
wrap: "nowrap"
|
|
824
819
|
}, /*#__PURE__*/React__default["default"].createElement(theme.GeoWebLogo, null), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
825
820
|
variant: "h1",
|
|
826
|
-
sx: styles$
|
|
821
|
+
sx: styles$5.title
|
|
827
822
|
}, title))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
828
823
|
item: true,
|
|
829
824
|
xs: 1,
|
|
@@ -1036,7 +1031,7 @@
|
|
|
1036
1031
|
return ErrorBoundary;
|
|
1037
1032
|
}(React__namespace.Component);
|
|
1038
1033
|
|
|
1039
|
-
var styles$
|
|
1034
|
+
var styles$4 = {
|
|
1040
1035
|
small: {
|
|
1041
1036
|
height: 16,
|
|
1042
1037
|
width: 16,
|
|
@@ -1055,7 +1050,7 @@
|
|
|
1055
1050
|
size = _b === void 0 ? 'large' : _b;
|
|
1056
1051
|
return /*#__PURE__*/React__namespace.createElement(material.Avatar, {
|
|
1057
1052
|
"data-testid": "avatar",
|
|
1058
|
-
sx: __assign(__assign({}, styles$
|
|
1053
|
+
sx: __assign(__assign({}, styles$4[size]), {
|
|
1059
1054
|
fontWeight: 500,
|
|
1060
1055
|
color: 'geowebColors.brand.brand',
|
|
1061
1056
|
backgroundColor: 'common.white',
|
|
@@ -1081,7 +1076,7 @@
|
|
|
1081
1076
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1082
1077
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1083
1078
|
* */
|
|
1084
|
-
var styles$
|
|
1079
|
+
var styles$3 = {
|
|
1085
1080
|
container: {
|
|
1086
1081
|
position: 'absolute',
|
|
1087
1082
|
top: 38,
|
|
@@ -1122,16 +1117,16 @@
|
|
|
1122
1117
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
|
|
1123
1118
|
"data-testid": "userButton",
|
|
1124
1119
|
onClick: onToggle,
|
|
1125
|
-
sx: styles$
|
|
1120
|
+
sx: styles$3.button,
|
|
1126
1121
|
size: "large"
|
|
1127
1122
|
}, /*#__PURE__*/React__default["default"].createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default["default"].createElement(material.Paper, {
|
|
1128
|
-
sx: styles$
|
|
1123
|
+
sx: styles$3.container,
|
|
1129
1124
|
"data-testid": "userMenu"
|
|
1130
1125
|
}, /*#__PURE__*/React__default["default"].createElement(material.ClickAwayListener, {
|
|
1131
1126
|
onClickAway: onClose,
|
|
1132
1127
|
mouseEvent: "onMouseDown"
|
|
1133
1128
|
}, /*#__PURE__*/React__default["default"].createElement(material.MenuList, {
|
|
1134
|
-
sx: styles$
|
|
1129
|
+
sx: styles$3.userMenu,
|
|
1135
1130
|
variant: "menu"
|
|
1136
1131
|
}, children))));
|
|
1137
1132
|
};
|
|
@@ -1199,22 +1194,17 @@
|
|
|
1199
1194
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1200
1195
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1201
1196
|
* */
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1197
|
+
|
|
1198
|
+
var ToolFooter = function ToolFooter() {
|
|
1199
|
+
return /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
1200
|
+
component: "footer",
|
|
1201
|
+
sx: {
|
|
1202
|
+
boxShadow: 1,
|
|
1203
|
+
backgroundColor: 'geowebColors.background.surface',
|
|
1207
1204
|
textAlign: 'right',
|
|
1208
1205
|
height: 18,
|
|
1209
1206
|
zIndex: 1
|
|
1210
1207
|
}
|
|
1211
|
-
};
|
|
1212
|
-
}); // drag handles will be handled by DraggableResizable/Resizable
|
|
1213
|
-
|
|
1214
|
-
var ToolFooter = function ToolFooter() {
|
|
1215
|
-
var classes = useStyles$4();
|
|
1216
|
-
return /*#__PURE__*/React__default["default"].createElement("footer", {
|
|
1217
|
-
className: classes.footer
|
|
1218
1208
|
});
|
|
1219
1209
|
};
|
|
1220
1210
|
|
|
@@ -1391,7 +1381,7 @@
|
|
|
1391
1381
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1392
1382
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1393
1383
|
* */
|
|
1394
|
-
var styles$
|
|
1384
|
+
var styles$2 = {
|
|
1395
1385
|
container: {
|
|
1396
1386
|
overflow: 'hidden',
|
|
1397
1387
|
borderRadius: 0,
|
|
@@ -1432,7 +1422,7 @@
|
|
|
1432
1422
|
|
|
1433
1423
|
return /*#__PURE__*/React__default["default"].createElement(material.Paper, __assign({
|
|
1434
1424
|
elevation: elevation,
|
|
1435
|
-
sx: styles$
|
|
1425
|
+
sx: styles$2.container
|
|
1436
1426
|
}, props), /*#__PURE__*/React__default["default"].createElement(ErrorBoundary, null, /*#__PURE__*/React__default["default"].createElement(ToolHeader, {
|
|
1437
1427
|
title: title,
|
|
1438
1428
|
size: size,
|
|
@@ -1441,7 +1431,7 @@
|
|
|
1441
1431
|
className: headerClassName,
|
|
1442
1432
|
leftComponent: leftComponent
|
|
1443
1433
|
})), /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
1444
|
-
sx: styles$
|
|
1434
|
+
sx: styles$2.content,
|
|
1445
1435
|
style: {
|
|
1446
1436
|
maxHeight: maxHeight
|
|
1447
1437
|
}
|
|
@@ -1633,91 +1623,63 @@
|
|
|
1633
1623
|
}, children)))) : null;
|
|
1634
1624
|
};
|
|
1635
1625
|
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
borderRadius: theme.shape.borderRadius,
|
|
1662
|
-
'&>span': {
|
|
1663
|
-
textAlign: 'center',
|
|
1664
|
-
fontSize: 14,
|
|
1665
|
-
fontWeight: 500,
|
|
1666
|
-
display: 'flex',
|
|
1667
|
-
margin: 'auto',
|
|
1668
|
-
letterSpacing: 0.25
|
|
1669
|
-
}
|
|
1670
|
-
},
|
|
1671
|
-
segment: {
|
|
1672
|
-
margin: '0 2px',
|
|
1673
|
-
verticalAlign: 'middle',
|
|
1674
|
-
fontSize: 14,
|
|
1675
|
-
fontWeight: 500,
|
|
1676
|
-
letterSpacing: 0.25
|
|
1677
|
-
},
|
|
1678
|
-
connect: {
|
|
1679
|
-
fontSize: 18
|
|
1680
|
-
},
|
|
1681
|
-
divider: {
|
|
1682
|
-
margin: '0 6px',
|
|
1683
|
-
fontSize: 18
|
|
1684
|
-
}
|
|
1685
|
-
};
|
|
1686
|
-
});
|
|
1626
|
+
var segmentStyle = {
|
|
1627
|
+
margin: '0 2px',
|
|
1628
|
+
verticalAlign: 'middle',
|
|
1629
|
+
fontSize: 14,
|
|
1630
|
+
fontWeight: 500,
|
|
1631
|
+
letterSpacing: 0.25,
|
|
1632
|
+
justifyContent: 'center'
|
|
1633
|
+
};
|
|
1634
|
+
var styles$1 = {
|
|
1635
|
+
icon: __assign(__assign({}, segmentStyle), {
|
|
1636
|
+
backgroundColor: 'geowebColors.textInputField.default.rgba',
|
|
1637
|
+
width: 40,
|
|
1638
|
+
height: 40,
|
|
1639
|
+
display: 'inline-flex',
|
|
1640
|
+
alignItems: 'center',
|
|
1641
|
+
borderRadius: 1
|
|
1642
|
+
}),
|
|
1643
|
+
connect: __assign(__assign({}, segmentStyle), {
|
|
1644
|
+
fontSize: 18
|
|
1645
|
+
}),
|
|
1646
|
+
divider: __assign(__assign({}, segmentStyle), {
|
|
1647
|
+
margin: '0 6px',
|
|
1648
|
+
fontSize: 18
|
|
1649
|
+
})
|
|
1650
|
+
};
|
|
1687
1651
|
|
|
1688
1652
|
var ShortCutSegment = function ShortCutSegment(_a) {
|
|
1689
1653
|
var _b = _a.type,
|
|
1690
1654
|
type = _b === void 0 ? 'text' : _b,
|
|
1691
1655
|
children = _a.children;
|
|
1692
|
-
var classes = useStyles$3();
|
|
1693
1656
|
|
|
1694
1657
|
if (type === 'divider') {
|
|
1695
1658
|
return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
1659
|
+
sx: styles$1.divider,
|
|
1696
1660
|
"data-testid": "segment-divider",
|
|
1697
|
-
className: classes.segment + " " + classes.divider,
|
|
1698
1661
|
component: "span"
|
|
1699
1662
|
}, children);
|
|
1700
1663
|
}
|
|
1701
1664
|
|
|
1702
1665
|
if (type === 'icon') {
|
|
1703
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
1666
|
+
return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
1667
|
+
sx: styles$1.icon,
|
|
1704
1668
|
"data-testid": "segment-icon",
|
|
1705
|
-
className: classes.segment + " " + classes.icon
|
|
1706
|
-
}, /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
1707
1669
|
component: "span"
|
|
1708
|
-
}, children)
|
|
1670
|
+
}, children);
|
|
1709
1671
|
}
|
|
1710
1672
|
|
|
1711
1673
|
if (type === 'connect') {
|
|
1712
1674
|
return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
1713
|
-
|
|
1675
|
+
sx: styles$1.connect,
|
|
1714
1676
|
"data-testid": "segment-connect",
|
|
1715
1677
|
component: "span"
|
|
1716
1678
|
}, children);
|
|
1717
1679
|
}
|
|
1718
1680
|
|
|
1719
1681
|
return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
1720
|
-
|
|
1682
|
+
sx: segmentStyle,
|
|
1721
1683
|
"data-testid": "segment-text",
|
|
1722
1684
|
component: "span"
|
|
1723
1685
|
}, children);
|
|
@@ -1861,33 +1823,18 @@
|
|
|
1861
1823
|
});
|
|
1862
1824
|
});
|
|
1863
1825
|
};
|
|
1864
|
-
var useStyles$2 = makeStyles__default["default"](function () {
|
|
1865
|
-
return {
|
|
1866
|
-
row: {
|
|
1867
|
-
minHeight: 56
|
|
1868
|
-
},
|
|
1869
|
-
title: {
|
|
1870
|
-
fontSize: 12,
|
|
1871
|
-
fontWeight: 300,
|
|
1872
|
-
letterSpacing: 0.4,
|
|
1873
|
-
opacity: 0.67
|
|
1874
|
-
},
|
|
1875
|
-
description: {
|
|
1876
|
-
alignItems: 'center'
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1879
|
-
});
|
|
1880
1826
|
|
|
1881
1827
|
var ShortcutList = function ShortcutList(_a) {
|
|
1882
1828
|
var _b = _a.platform,
|
|
1883
1829
|
platform = _b === void 0 ? 'windows' : _b;
|
|
1884
|
-
var classes = useStyles$2();
|
|
1885
1830
|
var rows = getShortcutList(shortcuts, platform);
|
|
1886
1831
|
return /*#__PURE__*/React__default["default"].createElement(material.List, {
|
|
1887
1832
|
"data-testid": "list-" + platform
|
|
1888
1833
|
}, rows.map(function (row, index) {
|
|
1889
1834
|
return /*#__PURE__*/React__default["default"].createElement(material.ListItem, {
|
|
1890
|
-
|
|
1835
|
+
sx: {
|
|
1836
|
+
minHeight: 56
|
|
1837
|
+
},
|
|
1891
1838
|
divider: index !== rows.length - 1,
|
|
1892
1839
|
key: row.title
|
|
1893
1840
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
@@ -1897,11 +1844,18 @@
|
|
|
1897
1844
|
alignItems: "center"
|
|
1898
1845
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1899
1846
|
item: true,
|
|
1900
|
-
|
|
1847
|
+
sx: {
|
|
1848
|
+
fontSize: 12,
|
|
1849
|
+
fontWeight: 300,
|
|
1850
|
+
letterSpacing: 0.4,
|
|
1851
|
+
opacity: 0.67
|
|
1852
|
+
}
|
|
1901
1853
|
}, row.title), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1902
1854
|
item: true
|
|
1903
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
1904
|
-
|
|
1855
|
+
}, /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
1856
|
+
sx: {
|
|
1857
|
+
alignItems: 'center'
|
|
1858
|
+
}
|
|
1905
1859
|
}, row.description))));
|
|
1906
1860
|
}));
|
|
1907
1861
|
};
|
|
@@ -1959,17 +1913,7 @@
|
|
|
1959
1913
|
})));
|
|
1960
1914
|
};
|
|
1961
1915
|
|
|
1962
|
-
var useStyles$1 = makeStyles__default["default"](function () {
|
|
1963
|
-
return {
|
|
1964
|
-
backdrop: {
|
|
1965
|
-
zIndex: 1
|
|
1966
|
-
}
|
|
1967
|
-
};
|
|
1968
|
-
});
|
|
1969
|
-
|
|
1970
1916
|
var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
1971
|
-
var classes = useStyles$1();
|
|
1972
|
-
|
|
1973
1917
|
var _a = __read(React__default["default"].useState(false), 2),
|
|
1974
1918
|
open = _a[0],
|
|
1975
1919
|
setOpen = _a[1];
|
|
@@ -1993,7 +1937,9 @@
|
|
|
1993
1937
|
}, "Cheat sheet"))), /*#__PURE__*/React__default["default"].createElement(material.Backdrop, {
|
|
1994
1938
|
"data-testid": "cheatsheet-content",
|
|
1995
1939
|
open: open,
|
|
1996
|
-
|
|
1940
|
+
sx: {
|
|
1941
|
+
zIndex: 1
|
|
1942
|
+
}
|
|
1997
1943
|
}, /*#__PURE__*/React__default["default"].createElement(DraggableComponent, {
|
|
1998
1944
|
startSize: {
|
|
1999
1945
|
width: 700
|
|
@@ -2348,14 +2294,14 @@
|
|
|
2348
2294
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
|
|
2349
2295
|
placement: "top",
|
|
2350
2296
|
title: tooltipTitle
|
|
2351
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
2297
|
+
}, /*#__PURE__*/React__namespace.createElement(ToolButton, {
|
|
2352
2298
|
active: isOpen,
|
|
2353
2299
|
sx: buttonSx,
|
|
2354
2300
|
onClick: handleClick,
|
|
2355
2301
|
"data-testid": buttonTestId,
|
|
2356
2302
|
variant: variant,
|
|
2357
2303
|
id: buttonTestId
|
|
2358
|
-
}, /*#__PURE__*/React__namespace.createElement(theme.Options, null)))
|
|
2304
|
+
}, /*#__PURE__*/React__namespace.createElement(theme.Options, null))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
|
|
2359
2305
|
anchorEl: anchorEl,
|
|
2360
2306
|
open: isOpen,
|
|
2361
2307
|
onClose: handleClose,
|
|
@@ -2402,56 +2348,46 @@
|
|
|
2402
2348
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2403
2349
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2404
2350
|
* */
|
|
2405
|
-
var useStyles = makeStyles__default["default"](function (theme) {
|
|
2406
|
-
return createStyles__default["default"]({
|
|
2407
|
-
button: {
|
|
2408
|
-
height: 24,
|
|
2409
|
-
width: 24,
|
|
2410
|
-
borderRadius: 5,
|
|
2411
|
-
marginTop: 4,
|
|
2412
|
-
color: function color(_a) {
|
|
2413
|
-
var isActive = _a.isActive,
|
|
2414
|
-
isAccessible = _a.isAccessible,
|
|
2415
|
-
isEnabled = _a.isEnabled;
|
|
2416
|
-
|
|
2417
|
-
if (!isEnabled) {
|
|
2418
|
-
return theme.palette.geowebColors.buttons.flat.disabled.color;
|
|
2419
|
-
}
|
|
2420
2351
|
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2352
|
+
var makeButtonStyles = function makeButtonStyles(isActive, isEnabled, isAccessible) {
|
|
2353
|
+
return {
|
|
2354
|
+
height: '24px',
|
|
2355
|
+
width: '24px',
|
|
2356
|
+
borderRadius: '5px',
|
|
2357
|
+
marginTop: '4px',
|
|
2358
|
+
color: function color() {
|
|
2359
|
+
if (!isEnabled) {
|
|
2360
|
+
return 'geowebColors.buttons.flat.disabled.color';
|
|
2361
|
+
}
|
|
2424
2362
|
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2363
|
+
if (isAccessible) {
|
|
2364
|
+
return 'geowebColors.greys.accessible';
|
|
2365
|
+
}
|
|
2428
2366
|
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
backgroundColor: function backgroundColor(_a) {
|
|
2432
|
-
var isActive = _a.isActive;
|
|
2433
|
-
return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
|
|
2434
|
-
},
|
|
2435
|
-
'&:focus': {
|
|
2436
|
-
backgroundColor: function backgroundColor(_a) {
|
|
2437
|
-
var isActive = _a.isActive;
|
|
2438
|
-
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2439
|
-
},
|
|
2440
|
-
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
2441
|
-
borderRadius: 0
|
|
2442
|
-
},
|
|
2443
|
-
'&:hover': {
|
|
2444
|
-
backgroundColor: function backgroundColor(_a) {
|
|
2445
|
-
var isActive = _a.isActive;
|
|
2446
|
-
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2447
|
-
}
|
|
2367
|
+
if (isActive) {
|
|
2368
|
+
return 'common.white';
|
|
2448
2369
|
}
|
|
2370
|
+
|
|
2371
|
+
return 'geowebColors.buttons.flat.default.color';
|
|
2449
2372
|
},
|
|
2450
|
-
|
|
2451
|
-
|
|
2373
|
+
backgroundColor: function backgroundColor() {
|
|
2374
|
+
return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
|
|
2375
|
+
},
|
|
2376
|
+
'&:focus': {
|
|
2377
|
+
backgroundColor: function backgroundColor() {
|
|
2378
|
+
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2379
|
+
},
|
|
2380
|
+
outline: 'geowebColors.buttons.focusDefault.outline',
|
|
2381
|
+
borderRadius: 0
|
|
2382
|
+
},
|
|
2383
|
+
'&:hover': {
|
|
2384
|
+
backgroundColor: function backgroundColor() {
|
|
2385
|
+
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2386
|
+
}
|
|
2452
2387
|
}
|
|
2453
|
-
}
|
|
2454
|
-
}
|
|
2388
|
+
};
|
|
2389
|
+
};
|
|
2390
|
+
|
|
2455
2391
|
var ManagerButton = function ManagerButton(_a) {
|
|
2456
2392
|
var _b = _a.tooltipTitle,
|
|
2457
2393
|
tooltipTitle = _b === void 0 ? '' : _b,
|
|
@@ -2465,14 +2401,10 @@
|
|
|
2465
2401
|
testId = _a.testId,
|
|
2466
2402
|
_f = _a.isAccessible,
|
|
2467
2403
|
isAccessible = _f === void 0 ? false : _f,
|
|
2468
|
-
|
|
2469
|
-
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "
|
|
2404
|
+
sx = _a.sx,
|
|
2405
|
+
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "sx"]);
|
|
2470
2406
|
|
|
2471
|
-
var
|
|
2472
|
-
isActive: isActive,
|
|
2473
|
-
isEnabled: isEnabled,
|
|
2474
|
-
isAccessible: isAccessible
|
|
2475
|
-
});
|
|
2407
|
+
var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
|
|
2476
2408
|
|
|
2477
2409
|
var handleClick = function handleClick(event) {
|
|
2478
2410
|
onClick(event);
|
|
@@ -2481,14 +2413,14 @@
|
|
|
2481
2413
|
return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
|
|
2482
2414
|
title: tooltipTitle,
|
|
2483
2415
|
placement: "top",
|
|
2484
|
-
|
|
2485
|
-
|
|
2416
|
+
sx: {
|
|
2417
|
+
pointerEvents: 'none'
|
|
2486
2418
|
}
|
|
2487
2419
|
}, /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
|
|
2488
2420
|
size: "small",
|
|
2489
2421
|
onClick: handleClick,
|
|
2490
2422
|
"data-testid": testId,
|
|
2491
|
-
|
|
2423
|
+
sx: __assign(__assign({}, buttonStyles), sx),
|
|
2492
2424
|
disableFocusRipple: true
|
|
2493
2425
|
}, props), icon));
|
|
2494
2426
|
};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
|
-
export interface
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
isEnabled?: boolean;
|
|
6
|
-
isAccessible?: boolean;
|
|
7
|
-
}
|
|
8
|
-
interface ManagerButtonProps extends IconButtonProps {
|
|
3
|
+
export interface ManagerButtonProps extends IconButtonProps {
|
|
9
4
|
tooltipTitle: string;
|
|
10
5
|
onClick?: (event: React.MouseEvent) => void;
|
|
11
6
|
isActive?: boolean;
|
|
@@ -15,4 +10,3 @@ interface ManagerButtonProps extends IconButtonProps {
|
|
|
15
10
|
isAccessible?: boolean;
|
|
16
11
|
}
|
|
17
12
|
export declare const ManagerButton: React.FC<ManagerButtonProps>;
|
|
18
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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,12 +14,11 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^17.0.2",
|
|
16
16
|
"@mui/material": "^5.2.8",
|
|
17
|
-
"@opengeoweb/theme": "
|
|
18
|
-
"@mui/styles": "^5.2.3",
|
|
17
|
+
"@opengeoweb/theme": "4.0.0",
|
|
19
18
|
"react-draggable": "^4.4.3",
|
|
20
19
|
"re-resizable": "^6.9.0",
|
|
21
20
|
"lodash": "^4.17.20",
|
|
22
|
-
"@opengeoweb/form-fields": "
|
|
21
|
+
"@opengeoweb/form-fields": "4.0.0",
|
|
23
22
|
"react-hook-form": "^6.12.1",
|
|
24
23
|
"moment": "^2.29.0",
|
|
25
24
|
"moment-timezone": "^0.5.31",
|