@opengeoweb/shared 4.16.0 → 4.18.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 +91 -183
- package/index.umd.js +105 -199
- package/lib/components/AppHeader/AppHeader.d.ts +1 -0
- package/lib/components/ManagerButton/ManagerButton.d.ts +0 -2
- package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +2 -0
- package/lib/components/index.d.ts +0 -2
- package/package.json +2 -2
- package/lib/components/EnableButton/EnableButton.d.ts +0 -10
- package/lib/components/EnableButton/EnableButton.spec.d.ts +0 -1
- package/lib/components/EnableButton/EnableButton.stories.d.ts +0 -13
- package/lib/components/EnableButton/index.d.ts +0 -1
- package/lib/components/ManagerDeleteButton/ManagerDeleteButton.d.ts +0 -9
- package/lib/components/ManagerDeleteButton/ManagerDeleteButton.spec.d.ts +0 -1
- package/lib/components/ManagerDeleteButton/ManagerDeleteButton.stories.d.ts +0 -13
- package/lib/components/ManagerDeleteButton/index.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useRef } from 'react';
|
|
3
|
-
import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, Tooltip, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon,
|
|
4
|
-
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options,
|
|
3
|
+
import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, Tooltip, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
4
|
+
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown } from '@opengeoweb/theme';
|
|
5
5
|
import { throttle } from 'lodash';
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { Resizable } from 're-resizable';
|
|
@@ -95,15 +95,16 @@ var CustomDialog = function CustomDialog(_a) {
|
|
|
95
95
|
_a$actions = _a.actions,
|
|
96
96
|
actions = _a$actions === void 0 ? null : _a$actions,
|
|
97
97
|
children = _a.children,
|
|
98
|
-
|
|
98
|
+
sx = _a.sx,
|
|
99
|
+
other = __rest(_a, ["title", "onClose", "description", "actions", "children", "sx"]);
|
|
99
100
|
|
|
100
101
|
return /*#__PURE__*/React.createElement(Dialog, Object.assign({
|
|
101
102
|
"data-testid": "customDialog",
|
|
102
103
|
PaperProps: {
|
|
103
|
-
sx: {
|
|
104
|
+
sx: Object.assign({
|
|
104
105
|
width: '560px',
|
|
105
106
|
margin: 2.5
|
|
106
|
-
}
|
|
107
|
+
}, sx)
|
|
107
108
|
},
|
|
108
109
|
// fix for briefly showing default options when closing dialog
|
|
109
110
|
transitionDuration: 0,
|
|
@@ -122,14 +123,8 @@ var CustomDialog = function CustomDialog(_a) {
|
|
|
122
123
|
}
|
|
123
124
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
124
125
|
sx: {
|
|
125
|
-
fontSize:
|
|
126
|
-
|
|
127
|
-
sm: '34px'
|
|
128
|
-
},
|
|
129
|
-
fontWeight: {
|
|
130
|
-
xs: 500,
|
|
131
|
-
sm: 400
|
|
132
|
-
}
|
|
126
|
+
fontSize: '16px',
|
|
127
|
+
fontWeight: 500
|
|
133
128
|
},
|
|
134
129
|
"data-testid": "customDialog-title",
|
|
135
130
|
component: "span"
|
|
@@ -220,8 +215,7 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
|
220
215
|
},
|
|
221
216
|
onClick: function onClick() {
|
|
222
217
|
return onClose('CANCELLED');
|
|
223
|
-
}
|
|
224
|
-
disableFocusRipple: true
|
|
218
|
+
}
|
|
225
219
|
}, cancelLabel), isLoading ? /*#__PURE__*/React.createElement(Box, {
|
|
226
220
|
"data-testid": "confirm-dialog-spinner",
|
|
227
221
|
sx: Object.assign(Object.assign({}, confirmStyle), {
|
|
@@ -246,8 +240,7 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
|
246
240
|
});
|
|
247
241
|
},
|
|
248
242
|
onClick: onSubmit,
|
|
249
|
-
autoFocus: !disableAutoFocus
|
|
250
|
-
disableFocusRipple: true
|
|
243
|
+
autoFocus: !disableAutoFocus
|
|
251
244
|
}, confirmLabel))
|
|
252
245
|
}, rest), content);
|
|
253
246
|
};
|
|
@@ -602,49 +595,52 @@ var adjustPosition = function adjustPosition(bbox, containingView, position, set
|
|
|
602
595
|
x: position.x + diffX,
|
|
603
596
|
y: position.y + diffY
|
|
604
597
|
});
|
|
605
|
-
} // bottom right
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
var _diffY = containingView.bottom - bbox.bottom;
|
|
598
|
+
} else if ( // bottom right
|
|
599
|
+
bbox.right >= containingView.right && bbox.bottom >= containingView.bottom) {
|
|
600
|
+
var _diffX = containingView.right - bbox.right;
|
|
610
601
|
|
|
611
|
-
|
|
612
|
-
x: position.x + _diffX,
|
|
613
|
-
y: position.y + _diffY
|
|
614
|
-
});
|
|
615
|
-
} // left screen
|
|
616
|
-
else if (bbox.x < containingView.x || isHorizontallyLarger) {
|
|
617
|
-
var _diffX2 = containingView.x - bbox.x;
|
|
602
|
+
var _diffY = containingView.bottom - bbox.bottom;
|
|
618
603
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
604
|
+
setPosition({
|
|
605
|
+
x: position.x + _diffX,
|
|
606
|
+
y: position.y + _diffY
|
|
607
|
+
});
|
|
608
|
+
} else if (bbox.x < containingView.x || isHorizontallyLarger) {
|
|
609
|
+
// left screen
|
|
610
|
+
var _diffX2 = containingView.x - bbox.x;
|
|
611
|
+
|
|
612
|
+
setPosition(Object.assign(Object.assign({}, position), {
|
|
613
|
+
x: position.x + _diffX2
|
|
614
|
+
}));
|
|
615
|
+
} else if (bbox.right >= containingView.right) {
|
|
616
|
+
// right screen
|
|
617
|
+
var _diffX3 = containingView.right - bbox.right;
|
|
618
|
+
|
|
619
|
+
setPosition(Object.assign(Object.assign({}, position), {
|
|
620
|
+
x: position.x + _diffX3
|
|
621
|
+
}));
|
|
622
|
+
} else if (bbox.y < containingView.y || isVerticallyLarger) {
|
|
623
|
+
// top screen
|
|
624
|
+
var _diffY2 = containingView.y - bbox.y;
|
|
625
|
+
|
|
626
|
+
setPosition(Object.assign(Object.assign({}, position), {
|
|
627
|
+
y: position.y + _diffY2
|
|
628
|
+
}));
|
|
629
|
+
} else if (bbox.bottom >= containingView.bottom) {
|
|
630
|
+
// bottom screen
|
|
631
|
+
var _diffY3 = containingView.bottom - bbox.bottom;
|
|
632
|
+
|
|
633
|
+
setPosition(Object.assign(Object.assign({}, position), {
|
|
634
|
+
y: position.y + _diffY3
|
|
635
|
+
}));
|
|
636
|
+
}
|
|
644
637
|
};
|
|
645
638
|
var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysInsideWindow(nodeRef, position, setPosition) {
|
|
646
639
|
var onResizeWindow = React__default.useCallback(function () {
|
|
647
|
-
if (!nodeRef.current)
|
|
640
|
+
if (!nodeRef.current) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
|
|
648
644
|
var bbox = nodeRef.current.firstChild.getBoundingClientRect();
|
|
649
645
|
var containingView = nodeRef.current.parentElement.getBoundingClientRect();
|
|
650
646
|
adjustPosition(bbox, containingView, position, setPosition);
|
|
@@ -964,14 +960,17 @@ var AppHeader = function AppHeader(_ref2) {
|
|
|
964
960
|
userMenu = _ref2.userMenu,
|
|
965
961
|
workspaceTopBar = _ref2.workspaceTopBar,
|
|
966
962
|
_ref2$title = _ref2.title,
|
|
967
|
-
title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title
|
|
963
|
+
title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title,
|
|
964
|
+
onClick = _ref2.onClick;
|
|
968
965
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
969
966
|
component: "header",
|
|
970
967
|
sx: styles$5.header
|
|
971
968
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
969
|
+
onClick: onClick,
|
|
972
970
|
sx: {
|
|
973
971
|
display: 'inherit',
|
|
974
|
-
alignItems: 'center'
|
|
972
|
+
alignItems: 'center',
|
|
973
|
+
cursor: onClick ? 'pointer' : 'auto'
|
|
975
974
|
}
|
|
976
975
|
}, /*#__PURE__*/React__default.createElement(GeoWebLogo, {
|
|
977
976
|
style: {
|
|
@@ -1181,8 +1180,8 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
1181
1180
|
return /*#__PURE__*/React.createElement(Box, {
|
|
1182
1181
|
sx: {
|
|
1183
1182
|
whiteSpace: 'pre-wrap',
|
|
1184
|
-
width: '
|
|
1185
|
-
height: '
|
|
1183
|
+
width: '100%',
|
|
1184
|
+
height: '100%',
|
|
1186
1185
|
overflowY: 'scroll'
|
|
1187
1186
|
}
|
|
1188
1187
|
}, /*#__PURE__*/React.createElement(AlertBanner, {
|
|
@@ -1894,6 +1893,10 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1894
1893
|
onResizeStop = _a$onResizeStop === void 0 ? function () {} : _a$onResizeStop,
|
|
1895
1894
|
_a$onDragEnd = _a.onDragEnd,
|
|
1896
1895
|
onDragEnd = _a$onDragEnd === void 0 ? function () {} : _a$onDragEnd,
|
|
1896
|
+
_a$onFocus = _a.onFocus,
|
|
1897
|
+
onFocus = _a$onFocus === void 0 ? function () {} : _a$onFocus,
|
|
1898
|
+
_a$onBlur = _a.onBlur,
|
|
1899
|
+
onBlur = _a$onBlur === void 0 ? function () {} : _a$onBlur,
|
|
1897
1900
|
_a$order = _a.order,
|
|
1898
1901
|
order = _a$order === void 0 ? 1 : _a$order,
|
|
1899
1902
|
_a$source = _a.source,
|
|
@@ -1905,7 +1908,7 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1905
1908
|
className = _a.className,
|
|
1906
1909
|
_a$sx = _a.sx,
|
|
1907
1910
|
sx = _a$sx === void 0 ? {} : _a$sx,
|
|
1908
|
-
props = __rest(_a, ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "className", "sx"]);
|
|
1911
|
+
props = __rest(_a, ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "onFocus", "onBlur", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "className", "sx"]);
|
|
1909
1912
|
|
|
1910
1913
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
1911
1914
|
var elevation = BASE_ELEVATION + order;
|
|
@@ -1980,6 +1983,9 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1980
1983
|
handle: ".".concat(headerClassName),
|
|
1981
1984
|
onMouseDown: onMouseDown
|
|
1982
1985
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
1986
|
+
tabIndex: -1,
|
|
1987
|
+
onFocus: onFocus,
|
|
1988
|
+
onBlur: onBlur,
|
|
1983
1989
|
sx: Object.assign(Object.assign(Object.assign({
|
|
1984
1990
|
position: 'absolute',
|
|
1985
1991
|
pointerEvents: 'all',
|
|
@@ -2463,7 +2469,10 @@ var useUserMenu = function useUserMenu() {
|
|
|
2463
2469
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2464
2470
|
* */
|
|
2465
2471
|
var getInitials = function getInitials(name) {
|
|
2466
|
-
if (!name)
|
|
2472
|
+
if (!name) {
|
|
2473
|
+
return '';
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2467
2476
|
var nameWithoutEmail = name.split('@')[0];
|
|
2468
2477
|
var array = nameWithoutEmail.split('.');
|
|
2469
2478
|
|
|
@@ -2547,7 +2556,10 @@ var CustomSlider = function CustomSlider(_a) {
|
|
|
2547
2556
|
first = _reverse2[0],
|
|
2548
2557
|
rest = _reverse2.slice(1);
|
|
2549
2558
|
|
|
2550
|
-
if (first)
|
|
2559
|
+
if (first) {
|
|
2560
|
+
first.classList.add('selectedLabel');
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2551
2563
|
rest.forEach(function (element) {
|
|
2552
2564
|
return element.classList.remove('selectedLabel');
|
|
2553
2565
|
});
|
|
@@ -2745,7 +2757,10 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2745
2757
|
anchorEl: anchorEl,
|
|
2746
2758
|
open: isOpen,
|
|
2747
2759
|
onClose: function onClose(event, reason) {
|
|
2748
|
-
if (reason === 'tabKeyDown')
|
|
2760
|
+
if (reason === 'tabKeyDown') {
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2749
2764
|
handleClose(event);
|
|
2750
2765
|
},
|
|
2751
2766
|
anchorOrigin: anchorOrigin,
|
|
@@ -2823,13 +2838,6 @@ var makeButtonStyles = function makeButtonStyles(isActive, isEnabled, isAccessib
|
|
|
2823
2838
|
backgroundColor: function backgroundColor() {
|
|
2824
2839
|
return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
|
|
2825
2840
|
},
|
|
2826
|
-
'&:focus': {
|
|
2827
|
-
backgroundColor: function backgroundColor() {
|
|
2828
|
-
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2829
|
-
},
|
|
2830
|
-
outline: 'geowebColors.buttons.focusDefault.outline',
|
|
2831
|
-
borderRadius: 0
|
|
2832
|
-
},
|
|
2833
2841
|
'&:hover': {
|
|
2834
2842
|
backgroundColor: function backgroundColor() {
|
|
2835
2843
|
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
@@ -2848,12 +2856,11 @@ var ManagerButton = function ManagerButton(_a) {
|
|
|
2848
2856
|
_a$isEnabled = _a.isEnabled,
|
|
2849
2857
|
isEnabled = _a$isEnabled === void 0 ? true : _a$isEnabled,
|
|
2850
2858
|
icon = _a.icon,
|
|
2851
|
-
testId = _a.testId,
|
|
2852
2859
|
_a$isAccessible = _a.isAccessible,
|
|
2853
2860
|
isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
|
|
2854
2861
|
sx = _a.sx,
|
|
2855
2862
|
children = _a.children,
|
|
2856
|
-
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "
|
|
2863
|
+
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "isAccessible", "sx", "children"]);
|
|
2857
2864
|
|
|
2858
2865
|
var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
|
|
2859
2866
|
|
|
@@ -2870,117 +2877,10 @@ var ManagerButton = function ManagerButton(_a) {
|
|
|
2870
2877
|
}, children || /*#__PURE__*/React.createElement(IconButton, Object.assign({
|
|
2871
2878
|
size: "small",
|
|
2872
2879
|
onClick: handleClick,
|
|
2873
|
-
|
|
2874
|
-
sx: Object.assign(Object.assign({}, buttonStyles), sx),
|
|
2875
|
-
disableFocusRipple: true
|
|
2880
|
+
sx: Object.assign(Object.assign({}, buttonStyles), sx)
|
|
2876
2881
|
}, props), icon));
|
|
2877
2882
|
};
|
|
2878
2883
|
|
|
2879
|
-
/* *
|
|
2880
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2881
|
-
* you may not use this file except in compliance with the License.
|
|
2882
|
-
* You may obtain a copy of the License at
|
|
2883
|
-
*
|
|
2884
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2885
|
-
*
|
|
2886
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2887
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2888
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2889
|
-
* See the License for the specific language governing permissions and
|
|
2890
|
-
* limitations under the License.
|
|
2891
|
-
*
|
|
2892
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2893
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2894
|
-
* */
|
|
2895
|
-
var ManagerDeleteButton = function ManagerDeleteButton(_ref) {
|
|
2896
|
-
var tooltipTitle = _ref.tooltipTitle,
|
|
2897
|
-
onClickDelete = _ref.onClickDelete,
|
|
2898
|
-
_ref$isEnabled = _ref.isEnabled,
|
|
2899
|
-
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
|
|
2900
|
-
sx = _ref.sx;
|
|
2901
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2902
|
-
tooltipTitle: tooltipTitle,
|
|
2903
|
-
onClick: onClickDelete,
|
|
2904
|
-
testId: "deleteButtonMedium",
|
|
2905
|
-
isEnabled: isEnabled,
|
|
2906
|
-
icon: /*#__PURE__*/React.createElement(Delete, null)
|
|
2907
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
2908
|
-
className: "deleteBtnMedium",
|
|
2909
|
-
variant: "tertiary",
|
|
2910
|
-
onClick: onClickDelete,
|
|
2911
|
-
startIcon: /*#__PURE__*/React.createElement(Delete, null),
|
|
2912
|
-
sx: Object.assign({
|
|
2913
|
-
display: 'none'
|
|
2914
|
-
}, sx)
|
|
2915
|
-
}, "Delete")), /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2916
|
-
tooltipTitle: tooltipTitle,
|
|
2917
|
-
onClick: onClickDelete,
|
|
2918
|
-
icon: /*#__PURE__*/React.createElement(Delete, null),
|
|
2919
|
-
testId: "deleteButton",
|
|
2920
|
-
isEnabled: isEnabled,
|
|
2921
|
-
sx: sx
|
|
2922
|
-
}));
|
|
2923
|
-
};
|
|
2924
|
-
|
|
2925
|
-
/* *
|
|
2926
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2927
|
-
* you may not use this file except in compliance with the License.
|
|
2928
|
-
* You may obtain a copy of the License at
|
|
2929
|
-
*
|
|
2930
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2931
|
-
*
|
|
2932
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2933
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2934
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2935
|
-
* See the License for the specific language governing permissions and
|
|
2936
|
-
* limitations under the License.
|
|
2937
|
-
*
|
|
2938
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2939
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2940
|
-
* */
|
|
2941
|
-
var EnableButton = function EnableButton(_ref) {
|
|
2942
|
-
var isEnabled = _ref.isEnabled,
|
|
2943
|
-
title = _ref.title,
|
|
2944
|
-
onChangeEnableLayer = _ref.onChangeEnableLayer,
|
|
2945
|
-
className = _ref.className,
|
|
2946
|
-
_ref$id = _ref.id,
|
|
2947
|
-
id = _ref$id === void 0 ? 'enableButton' : _ref$id;
|
|
2948
|
-
|
|
2949
|
-
var onClick = function onClick(event) {
|
|
2950
|
-
event.stopPropagation();
|
|
2951
|
-
onChangeEnableLayer(!isEnabled);
|
|
2952
|
-
};
|
|
2953
|
-
|
|
2954
|
-
return /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2955
|
-
tooltipTitle: title,
|
|
2956
|
-
onClick: onClick,
|
|
2957
|
-
icon: /*#__PURE__*/React.createElement(Checkbox, {
|
|
2958
|
-
sx: {
|
|
2959
|
-
color: 'inherit',
|
|
2960
|
-
padding: 0.5,
|
|
2961
|
-
borderRadius: 1.25,
|
|
2962
|
-
'&.Mui-focusVisible': {
|
|
2963
|
-
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2964
|
-
},
|
|
2965
|
-
'&:hover': {
|
|
2966
|
-
backgroundColor: 'transparent!important'
|
|
2967
|
-
},
|
|
2968
|
-
'&.Mui-checked': {
|
|
2969
|
-
color: 'inherit'
|
|
2970
|
-
}
|
|
2971
|
-
},
|
|
2972
|
-
icon: /*#__PURE__*/React.createElement(VisibilityOff, null),
|
|
2973
|
-
checkedIcon: /*#__PURE__*/React.createElement(Visibility, null),
|
|
2974
|
-
checked: isEnabled,
|
|
2975
|
-
disableFocusRipple: true,
|
|
2976
|
-
tabIndex: -1
|
|
2977
|
-
}),
|
|
2978
|
-
testId: id,
|
|
2979
|
-
isEnabled: isEnabled,
|
|
2980
|
-
className: className
|
|
2981
|
-
});
|
|
2982
|
-
};
|
|
2983
|
-
|
|
2984
2884
|
/* *
|
|
2985
2885
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2986
2886
|
* you may not use this file except in compliance with the License.
|
|
@@ -3085,7 +2985,10 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
3085
2985
|
|
|
3086
2986
|
var onWheel = React.useCallback(function (event) {
|
|
3087
2987
|
if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
|
|
3088
|
-
if (selectOpen)
|
|
2988
|
+
if (selectOpen) {
|
|
2989
|
+
return;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
3089
2992
|
var direction = event.deltaY < 0 ? 1 : -1;
|
|
3090
2993
|
var newIndex = currentIndex - direction;
|
|
3091
2994
|
|
|
@@ -3104,7 +3007,9 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
3104
3007
|
setSelectOpen(false);
|
|
3105
3008
|
}, []);
|
|
3106
3009
|
var onMouseEnter = React.useCallback(function () {
|
|
3107
|
-
if (!selectOpen)
|
|
3010
|
+
if (!selectOpen) {
|
|
3011
|
+
setTooltipOpen(true);
|
|
3012
|
+
}
|
|
3108
3013
|
}, [selectOpen, setTooltipOpen]);
|
|
3109
3014
|
var onMouseLeave = React.useCallback(function () {
|
|
3110
3015
|
setTooltipOpen(false);
|
|
@@ -3156,6 +3061,9 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
3156
3061
|
},
|
|
3157
3062
|
'&:focus': {
|
|
3158
3063
|
backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
|
|
3064
|
+
},
|
|
3065
|
+
'.MuiListItemIcon-root': {
|
|
3066
|
+
color: 'geowebColors.buttons.tool.active.color'
|
|
3159
3067
|
}
|
|
3160
3068
|
},
|
|
3161
3069
|
'&:after': {
|
|
@@ -3539,4 +3447,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
3539
3447
|
createDate: createDate
|
|
3540
3448
|
});
|
|
3541
3449
|
|
|
3542
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable,
|
|
3450
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, ManagerButton, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
|
package/index.umd.js
CHANGED
|
@@ -169,15 +169,16 @@
|
|
|
169
169
|
_c = _a.actions,
|
|
170
170
|
actions = _c === void 0 ? null : _c,
|
|
171
171
|
children = _a.children,
|
|
172
|
-
|
|
172
|
+
sx = _a.sx,
|
|
173
|
+
other = __rest(_a, ["title", "onClose", "description", "actions", "children", "sx"]);
|
|
173
174
|
|
|
174
175
|
return /*#__PURE__*/React__namespace.createElement(material.Dialog, __assign({
|
|
175
176
|
"data-testid": "customDialog",
|
|
176
177
|
PaperProps: {
|
|
177
|
-
sx: {
|
|
178
|
+
sx: __assign({
|
|
178
179
|
width: '560px',
|
|
179
180
|
margin: 2.5
|
|
180
|
-
}
|
|
181
|
+
}, sx)
|
|
181
182
|
},
|
|
182
183
|
// fix for briefly showing default options when closing dialog
|
|
183
184
|
transitionDuration: 0,
|
|
@@ -196,14 +197,8 @@
|
|
|
196
197
|
}
|
|
197
198
|
}, /*#__PURE__*/React__namespace.createElement(material.Typography, {
|
|
198
199
|
sx: {
|
|
199
|
-
fontSize:
|
|
200
|
-
|
|
201
|
-
sm: '34px'
|
|
202
|
-
},
|
|
203
|
-
fontWeight: {
|
|
204
|
-
xs: 500,
|
|
205
|
-
sm: 400
|
|
206
|
-
}
|
|
200
|
+
fontSize: '16px',
|
|
201
|
+
fontWeight: 500
|
|
207
202
|
},
|
|
208
203
|
"data-testid": "customDialog-title",
|
|
209
204
|
component: "span"
|
|
@@ -294,8 +289,7 @@
|
|
|
294
289
|
},
|
|
295
290
|
onClick: function onClick() {
|
|
296
291
|
return onClose('CANCELLED');
|
|
297
|
-
}
|
|
298
|
-
disableFocusRipple: true
|
|
292
|
+
}
|
|
299
293
|
}, cancelLabel), isLoading ? /*#__PURE__*/React__namespace.createElement(material.Box, {
|
|
300
294
|
"data-testid": "confirm-dialog-spinner",
|
|
301
295
|
sx: __assign(__assign({}, confirmStyle), {
|
|
@@ -320,8 +314,7 @@
|
|
|
320
314
|
});
|
|
321
315
|
},
|
|
322
316
|
onClick: onSubmit,
|
|
323
|
-
autoFocus: !disableAutoFocus
|
|
324
|
-
disableFocusRipple: true
|
|
317
|
+
autoFocus: !disableAutoFocus
|
|
325
318
|
}, confirmLabel))
|
|
326
319
|
}, rest), content);
|
|
327
320
|
};
|
|
@@ -471,43 +464,46 @@
|
|
|
471
464
|
x: position.x + diffX,
|
|
472
465
|
y: position.y + diffY
|
|
473
466
|
});
|
|
474
|
-
} // bottom right
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
467
|
+
} else if ( // bottom right
|
|
468
|
+
bbox.right >= containingView.right && bbox.bottom >= containingView.bottom) {
|
|
469
|
+
var diffX = containingView.right - bbox.right;
|
|
470
|
+
var diffY = containingView.bottom - bbox.bottom;
|
|
471
|
+
setPosition({
|
|
472
|
+
x: position.x + diffX,
|
|
473
|
+
y: position.y + diffY
|
|
474
|
+
});
|
|
475
|
+
} else if (bbox.x < containingView.x || isHorizontallyLarger) {
|
|
476
|
+
// left screen
|
|
477
|
+
var diffX = containingView.x - bbox.x;
|
|
478
|
+
setPosition(__assign(__assign({}, position), {
|
|
479
|
+
x: position.x + diffX
|
|
480
|
+
}));
|
|
481
|
+
} else if (bbox.right >= containingView.right) {
|
|
482
|
+
// right screen
|
|
483
|
+
var diffX = containingView.right - bbox.right;
|
|
484
|
+
setPosition(__assign(__assign({}, position), {
|
|
485
|
+
x: position.x + diffX
|
|
486
|
+
}));
|
|
487
|
+
} else if (bbox.y < containingView.y || isVerticallyLarger) {
|
|
488
|
+
// top screen
|
|
489
|
+
var diffY = containingView.y - bbox.y;
|
|
490
|
+
setPosition(__assign(__assign({}, position), {
|
|
491
|
+
y: position.y + diffY
|
|
492
|
+
}));
|
|
493
|
+
} else if (bbox.bottom >= containingView.bottom) {
|
|
494
|
+
// bottom screen
|
|
495
|
+
var diffY = containingView.bottom - bbox.bottom;
|
|
496
|
+
setPosition(__assign(__assign({}, position), {
|
|
497
|
+
y: position.y + diffY
|
|
498
|
+
}));
|
|
499
|
+
}
|
|
507
500
|
};
|
|
508
501
|
var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysInsideWindow(nodeRef, position, setPosition) {
|
|
509
502
|
var onResizeWindow = React__default["default"].useCallback(function () {
|
|
510
|
-
if (!nodeRef.current)
|
|
503
|
+
if (!nodeRef.current) {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
|
|
511
507
|
var bbox = nodeRef.current.firstChild.getBoundingClientRect();
|
|
512
508
|
var containingView = nodeRef.current.parentElement.getBoundingClientRect();
|
|
513
509
|
adjustPosition(bbox, containingView, position, setPosition);
|
|
@@ -844,14 +840,17 @@
|
|
|
844
840
|
userMenu = _a.userMenu,
|
|
845
841
|
workspaceTopBar = _a.workspaceTopBar,
|
|
846
842
|
_b = _a.title,
|
|
847
|
-
title = _b === void 0 ? 'GeoWeb' : _b
|
|
843
|
+
title = _b === void 0 ? 'GeoWeb' : _b,
|
|
844
|
+
onClick = _a.onClick;
|
|
848
845
|
return /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
849
846
|
component: "header",
|
|
850
847
|
sx: styles$5.header
|
|
851
848
|
}, /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
849
|
+
onClick: onClick,
|
|
852
850
|
sx: {
|
|
853
851
|
display: 'inherit',
|
|
854
|
-
alignItems: 'center'
|
|
852
|
+
alignItems: 'center',
|
|
853
|
+
cursor: onClick ? 'pointer' : 'auto'
|
|
855
854
|
}
|
|
856
855
|
}, /*#__PURE__*/React__default["default"].createElement(theme.GeoWebLogo, {
|
|
857
856
|
style: {
|
|
@@ -1061,8 +1060,8 @@
|
|
|
1061
1060
|
return /*#__PURE__*/React__namespace.createElement(material.Box, {
|
|
1062
1061
|
sx: {
|
|
1063
1062
|
whiteSpace: 'pre-wrap',
|
|
1064
|
-
width: '
|
|
1065
|
-
height: '
|
|
1063
|
+
width: '100%',
|
|
1064
|
+
height: '100%',
|
|
1066
1065
|
overflowY: 'scroll'
|
|
1067
1066
|
}
|
|
1068
1067
|
}, /*#__PURE__*/React__namespace.createElement(AlertBanner, {
|
|
@@ -1691,8 +1690,8 @@
|
|
|
1691
1690
|
* See the License for the specific language governing permissions and
|
|
1692
1691
|
* limitations under the License.
|
|
1693
1692
|
*
|
|
1694
|
-
* Copyright
|
|
1695
|
-
* Copyright
|
|
1693
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1694
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1696
1695
|
* */
|
|
1697
1696
|
|
|
1698
1697
|
var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
|
|
@@ -1768,33 +1767,37 @@
|
|
|
1768
1767
|
onResizeStop = _m === void 0 ? function () {} : _m,
|
|
1769
1768
|
_o = _a.onDragEnd,
|
|
1770
1769
|
onDragEnd = _o === void 0 ? function () {} : _o,
|
|
1771
|
-
_p = _a.
|
|
1772
|
-
|
|
1773
|
-
_q = _a.
|
|
1774
|
-
|
|
1775
|
-
_r = _a.
|
|
1776
|
-
|
|
1777
|
-
_s = _a.
|
|
1778
|
-
|
|
1770
|
+
_p = _a.onFocus,
|
|
1771
|
+
onFocus = _p === void 0 ? function () {} : _p,
|
|
1772
|
+
_q = _a.onBlur,
|
|
1773
|
+
onBlur = _q === void 0 ? function () {} : _q,
|
|
1774
|
+
_r = _a.order,
|
|
1775
|
+
order = _r === void 0 ? 1 : _r,
|
|
1776
|
+
_s = _a.source,
|
|
1777
|
+
source = _s === void 0 ? 'app' : _s,
|
|
1778
|
+
_t = _a.leftHeaderComponent,
|
|
1779
|
+
leftHeaderComponent = _t === void 0 ? null : _t,
|
|
1780
|
+
_u = _a.rightHeaderComponent,
|
|
1781
|
+
rightHeaderComponent = _u === void 0 ? null : _u,
|
|
1779
1782
|
className = _a.className,
|
|
1780
|
-
|
|
1781
|
-
sx =
|
|
1782
|
-
props = __rest(_a, ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "className", "sx"]);
|
|
1783
|
+
_v = _a.sx,
|
|
1784
|
+
sx = _v === void 0 ? {} : _v,
|
|
1785
|
+
props = __rest(_a, ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "onFocus", "onBlur", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "className", "sx"]);
|
|
1783
1786
|
|
|
1784
1787
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
1785
1788
|
var elevation = BASE_ELEVATION + order;
|
|
1786
1789
|
var nodeRef = React__default["default"].useRef(null);
|
|
1787
1790
|
|
|
1788
|
-
var
|
|
1791
|
+
var _w = __read(React__default["default"].useState({
|
|
1789
1792
|
x: 0,
|
|
1790
1793
|
y: 0
|
|
1791
1794
|
}), 2),
|
|
1792
|
-
position =
|
|
1793
|
-
setPosition =
|
|
1795
|
+
position = _w[0],
|
|
1796
|
+
setPosition = _w[1];
|
|
1794
1797
|
|
|
1795
|
-
var
|
|
1796
|
-
size =
|
|
1797
|
-
setSize =
|
|
1798
|
+
var _x = __read(React__default["default"].useState(startSize), 2),
|
|
1799
|
+
size = _x[0],
|
|
1800
|
+
setSize = _x[1];
|
|
1798
1801
|
|
|
1799
1802
|
var isRightAligned = startPosition && startPosition.right !== null && startPosition.right !== undefined;
|
|
1800
1803
|
var onStopDrag = React__default["default"].useCallback(function (_event, position) {
|
|
@@ -1802,9 +1805,9 @@
|
|
|
1802
1805
|
onDragEnd(position, size);
|
|
1803
1806
|
}, [setPosition, onDragEnd, size]);
|
|
1804
1807
|
|
|
1805
|
-
var
|
|
1806
|
-
initialMaxHeight =
|
|
1807
|
-
setInitialMaxHeight =
|
|
1808
|
+
var _y = __read(React__default["default"].useState(defaultInitialMaxHeight), 2),
|
|
1809
|
+
initialMaxHeight = _y[0],
|
|
1810
|
+
setInitialMaxHeight = _y[1];
|
|
1808
1811
|
|
|
1809
1812
|
var onStartResize = function onStartResize() {
|
|
1810
1813
|
setInitialMaxHeight('initial');
|
|
@@ -1851,6 +1854,9 @@
|
|
|
1851
1854
|
handle: "." + headerClassName,
|
|
1852
1855
|
onMouseDown: onMouseDown
|
|
1853
1856
|
}, /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
1857
|
+
tabIndex: -1,
|
|
1858
|
+
onFocus: onFocus,
|
|
1859
|
+
onBlur: onBlur,
|
|
1854
1860
|
sx: __assign(__assign(__assign({
|
|
1855
1861
|
position: 'absolute',
|
|
1856
1862
|
pointerEvents: 'all',
|
|
@@ -2320,7 +2326,10 @@
|
|
|
2320
2326
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2321
2327
|
* */
|
|
2322
2328
|
var getInitials = function getInitials(name) {
|
|
2323
|
-
if (!name)
|
|
2329
|
+
if (!name) {
|
|
2330
|
+
return '';
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2324
2333
|
var nameWithoutEmail = name.split('@')[0];
|
|
2325
2334
|
var array = nameWithoutEmail.split('.');
|
|
2326
2335
|
|
|
@@ -2419,7 +2428,10 @@
|
|
|
2419
2428
|
first = _a[0],
|
|
2420
2429
|
rest = _a.slice(1);
|
|
2421
2430
|
|
|
2422
|
-
if (first)
|
|
2431
|
+
if (first) {
|
|
2432
|
+
first.classList.add('selectedLabel');
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2423
2435
|
rest.forEach(function (element) {
|
|
2424
2436
|
return element.classList.remove('selectedLabel');
|
|
2425
2437
|
});
|
|
@@ -2616,7 +2628,10 @@
|
|
|
2616
2628
|
anchorEl: anchorEl,
|
|
2617
2629
|
open: isOpen,
|
|
2618
2630
|
onClose: function onClose(event, reason) {
|
|
2619
|
-
if (reason === 'tabKeyDown')
|
|
2631
|
+
if (reason === 'tabKeyDown') {
|
|
2632
|
+
return;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2620
2635
|
handleClose(event);
|
|
2621
2636
|
},
|
|
2622
2637
|
anchorOrigin: anchorOrigin,
|
|
@@ -2694,13 +2709,6 @@
|
|
|
2694
2709
|
backgroundColor: function backgroundColor() {
|
|
2695
2710
|
return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
|
|
2696
2711
|
},
|
|
2697
|
-
'&:focus': {
|
|
2698
|
-
backgroundColor: function backgroundColor() {
|
|
2699
|
-
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2700
|
-
},
|
|
2701
|
-
outline: 'geowebColors.buttons.focusDefault.outline',
|
|
2702
|
-
borderRadius: 0
|
|
2703
|
-
},
|
|
2704
2712
|
'&:hover': {
|
|
2705
2713
|
backgroundColor: function backgroundColor() {
|
|
2706
2714
|
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
@@ -2719,12 +2727,11 @@
|
|
|
2719
2727
|
_e = _a.isEnabled,
|
|
2720
2728
|
isEnabled = _e === void 0 ? true : _e,
|
|
2721
2729
|
icon = _a.icon,
|
|
2722
|
-
testId = _a.testId,
|
|
2723
2730
|
_f = _a.isAccessible,
|
|
2724
2731
|
isAccessible = _f === void 0 ? false : _f,
|
|
2725
2732
|
sx = _a.sx,
|
|
2726
2733
|
children = _a.children,
|
|
2727
|
-
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "
|
|
2734
|
+
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "isAccessible", "sx", "children"]);
|
|
2728
2735
|
|
|
2729
2736
|
var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
|
|
2730
2737
|
|
|
@@ -2741,117 +2748,10 @@
|
|
|
2741
2748
|
}, children || /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
|
|
2742
2749
|
size: "small",
|
|
2743
2750
|
onClick: handleClick,
|
|
2744
|
-
|
|
2745
|
-
sx: __assign(__assign({}, buttonStyles), sx),
|
|
2746
|
-
disableFocusRipple: true
|
|
2751
|
+
sx: __assign(__assign({}, buttonStyles), sx)
|
|
2747
2752
|
}, props), icon));
|
|
2748
2753
|
};
|
|
2749
2754
|
|
|
2750
|
-
/* *
|
|
2751
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2752
|
-
* you may not use this file except in compliance with the License.
|
|
2753
|
-
* You may obtain a copy of the License at
|
|
2754
|
-
*
|
|
2755
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2756
|
-
*
|
|
2757
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2758
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2759
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2760
|
-
* See the License for the specific language governing permissions and
|
|
2761
|
-
* limitations under the License.
|
|
2762
|
-
*
|
|
2763
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2764
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2765
|
-
* */
|
|
2766
|
-
var ManagerDeleteButton = function ManagerDeleteButton(_a) {
|
|
2767
|
-
var tooltipTitle = _a.tooltipTitle,
|
|
2768
|
-
onClickDelete = _a.onClickDelete,
|
|
2769
|
-
_b = _a.isEnabled,
|
|
2770
|
-
isEnabled = _b === void 0 ? true : _b,
|
|
2771
|
-
sx = _a.sx;
|
|
2772
|
-
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ManagerButton, {
|
|
2773
|
-
tooltipTitle: tooltipTitle,
|
|
2774
|
-
onClick: onClickDelete,
|
|
2775
|
-
testId: "deleteButtonMedium",
|
|
2776
|
-
isEnabled: isEnabled,
|
|
2777
|
-
icon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null)
|
|
2778
|
-
}, /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
2779
|
-
className: "deleteBtnMedium",
|
|
2780
|
-
variant: "tertiary",
|
|
2781
|
-
onClick: onClickDelete,
|
|
2782
|
-
startIcon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null),
|
|
2783
|
-
sx: __assign({
|
|
2784
|
-
display: 'none'
|
|
2785
|
-
}, sx)
|
|
2786
|
-
}, "Delete")), /*#__PURE__*/React__namespace.createElement(ManagerButton, {
|
|
2787
|
-
tooltipTitle: tooltipTitle,
|
|
2788
|
-
onClick: onClickDelete,
|
|
2789
|
-
icon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null),
|
|
2790
|
-
testId: "deleteButton",
|
|
2791
|
-
isEnabled: isEnabled,
|
|
2792
|
-
sx: sx
|
|
2793
|
-
}));
|
|
2794
|
-
};
|
|
2795
|
-
|
|
2796
|
-
/* *
|
|
2797
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2798
|
-
* you may not use this file except in compliance with the License.
|
|
2799
|
-
* You may obtain a copy of the License at
|
|
2800
|
-
*
|
|
2801
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2802
|
-
*
|
|
2803
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2804
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2805
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2806
|
-
* See the License for the specific language governing permissions and
|
|
2807
|
-
* limitations under the License.
|
|
2808
|
-
*
|
|
2809
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2810
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2811
|
-
* */
|
|
2812
|
-
var EnableButton = function EnableButton(_a) {
|
|
2813
|
-
var isEnabled = _a.isEnabled,
|
|
2814
|
-
title = _a.title,
|
|
2815
|
-
onChangeEnableLayer = _a.onChangeEnableLayer,
|
|
2816
|
-
className = _a.className,
|
|
2817
|
-
_b = _a.id,
|
|
2818
|
-
id = _b === void 0 ? 'enableButton' : _b;
|
|
2819
|
-
|
|
2820
|
-
var onClick = function onClick(event) {
|
|
2821
|
-
event.stopPropagation();
|
|
2822
|
-
onChangeEnableLayer(!isEnabled);
|
|
2823
|
-
};
|
|
2824
|
-
|
|
2825
|
-
return /*#__PURE__*/React__namespace.createElement(ManagerButton, {
|
|
2826
|
-
tooltipTitle: title,
|
|
2827
|
-
onClick: onClick,
|
|
2828
|
-
icon: /*#__PURE__*/React__namespace.createElement(material.Checkbox, {
|
|
2829
|
-
sx: {
|
|
2830
|
-
color: 'inherit',
|
|
2831
|
-
padding: 0.5,
|
|
2832
|
-
borderRadius: 1.25,
|
|
2833
|
-
'&.Mui-focusVisible': {
|
|
2834
|
-
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2835
|
-
},
|
|
2836
|
-
'&:hover': {
|
|
2837
|
-
backgroundColor: 'transparent!important'
|
|
2838
|
-
},
|
|
2839
|
-
'&.Mui-checked': {
|
|
2840
|
-
color: 'inherit'
|
|
2841
|
-
}
|
|
2842
|
-
},
|
|
2843
|
-
icon: /*#__PURE__*/React__namespace.createElement(theme.VisibilityOff, null),
|
|
2844
|
-
checkedIcon: /*#__PURE__*/React__namespace.createElement(theme.Visibility, null),
|
|
2845
|
-
checked: isEnabled,
|
|
2846
|
-
disableFocusRipple: true,
|
|
2847
|
-
tabIndex: -1
|
|
2848
|
-
}),
|
|
2849
|
-
testId: id,
|
|
2850
|
-
isEnabled: isEnabled,
|
|
2851
|
-
className: className
|
|
2852
|
-
});
|
|
2853
|
-
};
|
|
2854
|
-
|
|
2855
2755
|
/* *
|
|
2856
2756
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2857
2757
|
* you may not use this file except in compliance with the License.
|
|
@@ -2973,7 +2873,10 @@
|
|
|
2973
2873
|
|
|
2974
2874
|
var onWheel = React__namespace.useCallback(function (event) {
|
|
2975
2875
|
if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
|
|
2976
|
-
if (selectOpen)
|
|
2876
|
+
if (selectOpen) {
|
|
2877
|
+
return;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2977
2880
|
var direction = event.deltaY < 0 ? 1 : -1;
|
|
2978
2881
|
var newIndex = currentIndex - direction;
|
|
2979
2882
|
|
|
@@ -2992,7 +2895,9 @@
|
|
|
2992
2895
|
setSelectOpen(false);
|
|
2993
2896
|
}, []);
|
|
2994
2897
|
var onMouseEnter = React__namespace.useCallback(function () {
|
|
2995
|
-
if (!selectOpen)
|
|
2898
|
+
if (!selectOpen) {
|
|
2899
|
+
setTooltipOpen(true);
|
|
2900
|
+
}
|
|
2996
2901
|
}, [selectOpen, setTooltipOpen]);
|
|
2997
2902
|
var onMouseLeave = React__namespace.useCallback(function () {
|
|
2998
2903
|
setTooltipOpen(false);
|
|
@@ -3044,6 +2949,9 @@
|
|
|
3044
2949
|
},
|
|
3045
2950
|
'&:focus': {
|
|
3046
2951
|
backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
|
|
2952
|
+
},
|
|
2953
|
+
'.MuiListItemIcon-root': {
|
|
2954
|
+
color: 'geowebColors.buttons.tool.active.color'
|
|
3047
2955
|
}
|
|
3048
2956
|
},
|
|
3049
2957
|
'&:after': {
|
|
@@ -3463,10 +3371,8 @@
|
|
|
3463
3371
|
exports.CustomTooltip = CustomTooltip;
|
|
3464
3372
|
exports.DEFAULT_ERROR_MESSAGE = DEFAULT_ERROR_MESSAGE;
|
|
3465
3373
|
exports.Draggable = DraggableComponent$1;
|
|
3466
|
-
exports.EnableButton = EnableButton;
|
|
3467
3374
|
exports.ErrorBoundary = ErrorBoundary;
|
|
3468
3375
|
exports.ManagerButton = ManagerButton;
|
|
3469
|
-
exports.ManagerDeleteButton = ManagerDeleteButton;
|
|
3470
3376
|
exports.Resizable = ResizeComponent;
|
|
3471
3377
|
exports.StatusTag = StatusTag;
|
|
3472
3378
|
exports.ToggleMenu = ToggleMenu;
|
|
@@ -2,11 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
3
|
export interface ManagerButtonProps extends IconButtonProps {
|
|
4
4
|
tooltipTitle: string;
|
|
5
|
-
onClick?: (event: React.MouseEvent) => void;
|
|
6
5
|
isActive?: boolean;
|
|
7
6
|
isEnabled?: boolean;
|
|
8
7
|
icon: React.ReactNode;
|
|
9
|
-
testId: string;
|
|
10
8
|
isAccessible?: boolean;
|
|
11
9
|
children?: React.ReactElement;
|
|
12
10
|
}
|
|
@@ -20,6 +20,8 @@ interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'
|
|
|
20
20
|
onChangeSize?: (size: Size) => void;
|
|
21
21
|
onDragEnd?: (position: DraggablePosition, size: Size) => void;
|
|
22
22
|
onMouseDown?: (event: MouseEvent) => void;
|
|
23
|
+
onFocus?: (event: React.FocusEvent<HTMLElement>) => void;
|
|
24
|
+
onBlur?: (event: React.FocusEvent<HTMLElement>) => void;
|
|
23
25
|
bounds?: 'parent' | string;
|
|
24
26
|
cancel?: string;
|
|
25
27
|
order?: number;
|
|
@@ -12,8 +12,6 @@ export * from './CustomToggleButton';
|
|
|
12
12
|
export * from './ToolButton';
|
|
13
13
|
export * from './ToggleMenu';
|
|
14
14
|
export * from './ManagerButton';
|
|
15
|
-
export * from './ManagerDeleteButton';
|
|
16
|
-
export * from './EnableButton';
|
|
17
15
|
export * from './AlertIcon';
|
|
18
16
|
export * from './TooltipSelect';
|
|
19
17
|
export * from './Avatar';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.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,7 +14,7 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^18.2.0",
|
|
16
16
|
"@mui/material": "^5.10.8",
|
|
17
|
-
"@opengeoweb/theme": "4.
|
|
17
|
+
"@opengeoweb/theme": "4.18.0",
|
|
18
18
|
"react-draggable": "^4.4.5",
|
|
19
19
|
"re-resizable": "^6.9.0",
|
|
20
20
|
"@redux-eggs/core": "^2.2.0",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface EnableLayerProps {
|
|
3
|
-
isEnabled?: boolean;
|
|
4
|
-
title: string;
|
|
5
|
-
onChangeEnableLayer: (enable: boolean) => void;
|
|
6
|
-
className?: string;
|
|
7
|
-
id?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const EnableButton: React.FC<EnableLayerProps>;
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const EnableButtonLight: {
|
|
7
|
-
(): React.ReactElement;
|
|
8
|
-
storyName: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const EnableButtonDark: {
|
|
11
|
-
(): React.ReactElement;
|
|
12
|
-
storyName: string;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './EnableButton';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IconButtonProps } from '@mui/material';
|
|
3
|
-
interface DeleteButtonProps extends IconButtonProps {
|
|
4
|
-
tooltipTitle: string;
|
|
5
|
-
onClickDelete: () => void;
|
|
6
|
-
isEnabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const ManagerDeleteButton: React.FC<DeleteButtonProps>;
|
|
9
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const ManagerDeleteButtonLight: {
|
|
7
|
-
(): React.ReactElement;
|
|
8
|
-
storyName: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const ManagerDeleteButtonDark: {
|
|
11
|
-
(): React.ReactElement;
|
|
12
|
-
storyName: string;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ManagerDeleteButton';
|