@opengeoweb/shared 2.5.0 → 2.8.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 +374 -78
- package/index.umd.js +410 -92
- package/lib/components/AlertBanner/AlertBanner.d.ts +5 -0
- package/lib/components/AlertIcon/AlertIcon.d.ts +8 -0
- package/lib/components/AlertIcon/index.d.ts +1 -0
- package/lib/components/{Manager/EnableButton → EnableButton}/EnableButton.d.ts +0 -0
- package/lib/components/{Manager/EnableButton → EnableButton}/EnableButton.spec.d.ts +0 -0
- package/lib/components/{Manager/EnableButton → EnableButton}/EnableButton.stories.d.ts +0 -0
- package/lib/components/{Manager/EnableButton → EnableButton}/index.d.ts +0 -0
- package/lib/components/{Manager/ManagerButton → ManagerButton}/ManagerButton.d.ts +5 -0
- package/lib/components/{Manager/ManagerButton → ManagerButton}/ManagerButton.spec.d.ts +0 -0
- package/lib/components/{Manager/ManagerButton → ManagerButton}/ManagerButton.stories.d.ts +0 -0
- package/lib/components/{Manager/ManagerButton → ManagerButton}/index.d.ts +0 -0
- package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/ManagerDeleteButton.d.ts +0 -0
- package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/ManagerDeleteButton.spec.d.ts +0 -0
- package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/ManagerDeleteButton.stories.d.ts +0 -0
- package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/index.d.ts +0 -0
- package/lib/components/ToggleMenu/ToggleMenu.d.ts +11 -3
- package/lib/components/ToggleMenu/ToggleMenu.stories.d.ts +8 -2
- package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +1 -0
- package/lib/components/ToolContainer/types.d.ts +1 -0
- package/lib/components/TooltipSelect/TooltipSelect.d.ts +17 -0
- package/lib/components/TooltipSelect/TooltipSelect.spec.d.ts +1 -0
- package/lib/components/TooltipSelect/TooltipSelect.stories.d.ts +13 -0
- package/lib/components/TooltipSelect/index.d.ts +2 -0
- package/lib/components/TooltipSelect/tooltipContainerStyles.d.ts +2 -0
- package/lib/components/index.d.ts +5 -1
- package/lib/hooks/useDraftFormHelpers/useDraftFormHelpers.d.ts +1 -1
- package/package.json +3 -3
- package/lib/components/Manager/index.d.ts +0 -4
- package/lib/components/Manager/styles.d.ts +0 -5
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, Alert, AlertTitle,
|
|
3
|
+
import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, SvgIcon, Alert, AlertTitle, Grid, useTheme, Link, Avatar, Paper, ClickAwayListener, MenuList, MenuItem, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Tooltip, Menu, ListItemIcon, Checkbox, Select } from '@mui/material';
|
|
4
4
|
import Close from '@mui/icons-material/Close';
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
6
|
import { isEmpty, errorMessages } from '@opengeoweb/form-fields';
|
|
@@ -552,11 +552,17 @@ var useIsMounted = function useIsMounted() {
|
|
|
552
552
|
|
|
553
553
|
var HIDDEN_INPUT_HELPER_IS_DRAFT = 'IS_DRAFT';
|
|
554
554
|
var useDraftFormHelpers = function useDraftFormHelpers() {
|
|
555
|
+
var isDefaultDraft = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
556
|
+
|
|
555
557
|
var _useFormContext = useFormContext(),
|
|
556
558
|
getValues = _useFormContext.getValues,
|
|
557
559
|
setValue = _useFormContext.setValue,
|
|
558
560
|
register = _useFormContext.register;
|
|
559
561
|
|
|
562
|
+
React.useEffect(function () {
|
|
563
|
+
setValue(HIDDEN_INPUT_HELPER_IS_DRAFT, isDefaultDraft); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
564
|
+
}, []);
|
|
565
|
+
|
|
560
566
|
var isDraft = function isDraft() {
|
|
561
567
|
return getValues(HIDDEN_INPUT_HELPER_IS_DRAFT) === true;
|
|
562
568
|
};
|
|
@@ -574,9 +580,7 @@ var useDraftFormHelpers = function useDraftFormHelpers() {
|
|
|
574
580
|
};
|
|
575
581
|
|
|
576
582
|
var DraftFieldHelper = function DraftFieldHelper() {
|
|
577
|
-
return /*#__PURE__*/React.createElement("input", Object.assign({
|
|
578
|
-
defaultValue: "false"
|
|
579
|
-
}, register(HIDDEN_INPUT_HELPER_IS_DRAFT), {
|
|
583
|
+
return /*#__PURE__*/React.createElement("input", Object.assign({}, register(HIDDEN_INPUT_HELPER_IS_DRAFT), {
|
|
580
584
|
type: "hidden"
|
|
581
585
|
}));
|
|
582
586
|
};
|
|
@@ -683,24 +687,21 @@ var ConfirmationServiceProvider = function ConfirmationServiceProvider(_ref) {
|
|
|
683
687
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
684
688
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
685
689
|
* */
|
|
686
|
-
var useStyles$a = makeStyles(function () {
|
|
687
|
-
return {
|
|
688
|
-
title: {
|
|
689
|
-
fontSize: '14px',
|
|
690
|
-
fontWeight: 'normal',
|
|
691
|
-
marginTop: '0px!important',
|
|
692
|
-
paddingTop: '0px!important'
|
|
693
|
-
},
|
|
694
|
-
info: {
|
|
695
|
-
fontSize: '16px'
|
|
696
|
-
}
|
|
697
|
-
};
|
|
698
|
-
});
|
|
699
690
|
|
|
700
|
-
var
|
|
691
|
+
var AlertIcon = function AlertIcon(_ref) {
|
|
692
|
+
var _ref$severity = _ref.severity,
|
|
693
|
+
severity = _ref$severity === void 0 ? 'error' : _ref$severity,
|
|
694
|
+
_ref$dataTestId = _ref.dataTestId,
|
|
695
|
+
dataTestId = _ref$dataTestId === void 0 ? 'alert-icon' : _ref$dataTestId;
|
|
696
|
+
|
|
701
697
|
switch (severity) {
|
|
702
698
|
case 'info':
|
|
703
|
-
return /*#__PURE__*/React.createElement(SvgIcon,
|
|
699
|
+
return /*#__PURE__*/React.createElement(SvgIcon, {
|
|
700
|
+
sx: {
|
|
701
|
+
color: 'geowebColors.functional.notification'
|
|
702
|
+
},
|
|
703
|
+
"data-testid": dataTestId
|
|
704
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
704
705
|
width: 24,
|
|
705
706
|
height: 24,
|
|
706
707
|
fill: "transparent"
|
|
@@ -710,7 +711,12 @@ var getIcon = function getIcon(severity) {
|
|
|
710
711
|
}));
|
|
711
712
|
|
|
712
713
|
case 'success':
|
|
713
|
-
return /*#__PURE__*/React.createElement(SvgIcon,
|
|
714
|
+
return /*#__PURE__*/React.createElement(SvgIcon, {
|
|
715
|
+
sx: {
|
|
716
|
+
color: 'geowebColors.functional.success'
|
|
717
|
+
},
|
|
718
|
+
"data-testid": dataTestId
|
|
719
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
714
720
|
width: 24,
|
|
715
721
|
height: 24,
|
|
716
722
|
fill: "transparent"
|
|
@@ -720,7 +726,12 @@ var getIcon = function getIcon(severity) {
|
|
|
720
726
|
}));
|
|
721
727
|
|
|
722
728
|
case 'warning':
|
|
723
|
-
return /*#__PURE__*/React.createElement(SvgIcon,
|
|
729
|
+
return /*#__PURE__*/React.createElement(SvgIcon, {
|
|
730
|
+
sx: {
|
|
731
|
+
color: 'geowebColors.functional.warning'
|
|
732
|
+
},
|
|
733
|
+
"data-testid": dataTestId
|
|
734
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
724
735
|
width: 24,
|
|
725
736
|
height: 24,
|
|
726
737
|
fill: "transparent"
|
|
@@ -731,7 +742,12 @@ var getIcon = function getIcon(severity) {
|
|
|
731
742
|
|
|
732
743
|
case 'error':
|
|
733
744
|
default:
|
|
734
|
-
return /*#__PURE__*/React.createElement(SvgIcon,
|
|
745
|
+
return /*#__PURE__*/React.createElement(SvgIcon, {
|
|
746
|
+
sx: {
|
|
747
|
+
color: 'geowebColors.functional.error'
|
|
748
|
+
},
|
|
749
|
+
"data-testid": dataTestId
|
|
750
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
735
751
|
width: 24,
|
|
736
752
|
height: 24,
|
|
737
753
|
fill: "transparent"
|
|
@@ -742,6 +758,12 @@ var getIcon = function getIcon(severity) {
|
|
|
742
758
|
}
|
|
743
759
|
};
|
|
744
760
|
|
|
761
|
+
var IconChevronRight = /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("path", {
|
|
762
|
+
d: "M5.427 15.03c-.57.618-.57 1.57 0 2.188.57.603 1.494.603 2.062 0l5.514-5.843 5.512 5.843c.57.603 1.494.603 2.063 0 .285-.303.426-.7.426-1.094a1.59 1.59 0 0 0-.426-1.094L13.003 7l-7.576 8.03z",
|
|
763
|
+
id: "chrevron-right",
|
|
764
|
+
transform: "rotate(90 13.002 12.335)"
|
|
765
|
+
}));
|
|
766
|
+
|
|
745
767
|
var AlertBanner = function AlertBanner(_ref) {
|
|
746
768
|
var title = _ref.title,
|
|
747
769
|
_ref$severity = _ref.severity,
|
|
@@ -751,12 +773,32 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
751
773
|
_ref$dataTestId = _ref.dataTestId,
|
|
752
774
|
dataTestId = _ref$dataTestId === void 0 ? 'alert-banner' : _ref$dataTestId,
|
|
753
775
|
_ref$isCompact = _ref.isCompact,
|
|
754
|
-
isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact
|
|
755
|
-
|
|
756
|
-
|
|
776
|
+
isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact,
|
|
777
|
+
_ref$shouldClose = _ref.shouldClose,
|
|
778
|
+
shouldClose = _ref$shouldClose === void 0 ? false : _ref$shouldClose,
|
|
779
|
+
_ref$actionButtonProp = _ref.actionButtonProps,
|
|
780
|
+
actionButtonProps = _ref$actionButtonProp === void 0 ? undefined : _ref$actionButtonProp;
|
|
781
|
+
|
|
782
|
+
var _React$useState = React.useState(true),
|
|
783
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
784
|
+
isOpen = _React$useState2[0],
|
|
785
|
+
setIsOpen = _React$useState2[1];
|
|
786
|
+
|
|
787
|
+
return isOpen && /*#__PURE__*/React.createElement(Alert, {
|
|
757
788
|
"data-testid": dataTestId,
|
|
758
789
|
severity: severity,
|
|
759
|
-
icon:
|
|
790
|
+
icon: /*#__PURE__*/React.createElement(AlertIcon, {
|
|
791
|
+
severity: severity
|
|
792
|
+
}),
|
|
793
|
+
action: shouldClose ? /*#__PURE__*/React.createElement(Button, {
|
|
794
|
+
variant: "flat",
|
|
795
|
+
onClick: function onClick() {
|
|
796
|
+
return setIsOpen(false);
|
|
797
|
+
},
|
|
798
|
+
sx: {
|
|
799
|
+
backgroundColor: 'transparent!important'
|
|
800
|
+
}
|
|
801
|
+
}, "CLOSE") : undefined,
|
|
760
802
|
sx: isCompact ? {
|
|
761
803
|
height: '32px',
|
|
762
804
|
boxSizing: 'border-box',
|
|
@@ -773,12 +815,42 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
773
815
|
margin: '-3px 10px 0px 0px',
|
|
774
816
|
padding: '0px'
|
|
775
817
|
}
|
|
776
|
-
} : {
|
|
818
|
+
} : {
|
|
819
|
+
padding: '3px 16px',
|
|
820
|
+
'& .MuiAlert-message': {
|
|
821
|
+
padding: '8px 0'
|
|
822
|
+
},
|
|
823
|
+
'& .MuiAlert-icon': {
|
|
824
|
+
padding: '8px 0'
|
|
825
|
+
},
|
|
826
|
+
'& .MuiAlert-action': {
|
|
827
|
+
padding: 0
|
|
828
|
+
}
|
|
829
|
+
}
|
|
777
830
|
}, /*#__PURE__*/React.createElement(AlertTitle, {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
831
|
+
sx: {
|
|
832
|
+
fontSize: '14px',
|
|
833
|
+
fontWeight: 'normal',
|
|
834
|
+
marginTop: '0px!important',
|
|
835
|
+
paddingTop: '0px!important',
|
|
836
|
+
marginBottom: '0px!important'
|
|
837
|
+
}
|
|
838
|
+
}, title), info && /*#__PURE__*/React.createElement(Box, {
|
|
839
|
+
sx: {
|
|
840
|
+
fontSize: '16px',
|
|
841
|
+
marginTop: 1
|
|
842
|
+
}
|
|
843
|
+
}, info), actionButtonProps && /*#__PURE__*/React.createElement(Button, {
|
|
844
|
+
variant: "flat",
|
|
845
|
+
onClick: function onClick(event) {
|
|
846
|
+
setIsOpen(false);
|
|
847
|
+
actionButtonProps.onClick(event);
|
|
848
|
+
},
|
|
849
|
+
sx: {
|
|
850
|
+
backgroundColor: 'transparent!important'
|
|
851
|
+
},
|
|
852
|
+
startIcon: IconChevronRight
|
|
853
|
+
}, actionButtonProps.title.toUpperCase()));
|
|
782
854
|
};
|
|
783
855
|
|
|
784
856
|
/* *
|
|
@@ -797,7 +869,7 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
797
869
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
798
870
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
799
871
|
* */
|
|
800
|
-
var useStyles$
|
|
872
|
+
var useStyles$8 = makeStyles(function () {
|
|
801
873
|
return {
|
|
802
874
|
wrapper: {
|
|
803
875
|
height: '100vh',
|
|
@@ -814,7 +886,7 @@ var useStyles$9 = makeStyles(function () {
|
|
|
814
886
|
var AppLayout = function AppLayout(_ref) {
|
|
815
887
|
var header = _ref.header,
|
|
816
888
|
children = _ref.children;
|
|
817
|
-
var classes = useStyles$
|
|
889
|
+
var classes = useStyles$8();
|
|
818
890
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
819
891
|
className: classes.wrapper
|
|
820
892
|
}, header, /*#__PURE__*/React__default.createElement("main", {
|
|
@@ -824,7 +896,7 @@ var AppLayout = function AppLayout(_ref) {
|
|
|
824
896
|
|
|
825
897
|
var img = "data:image/svg+xml,%3c!--Licensed under the Apache License%2c Version 2.0 (the 'License')%3byou may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing%2c softwaredistributed under the License is distributed on an 'AS IS' BASIS%2cWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND%2c either express or implied.See the License for the specific language governing permissions andlimitations under the License.Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)Copyright 2021 - Finnish Meteorological Institute (FMI)--%3e%3csvg id='svg4550' xmlnsRdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns='http://www.w3.org/2000/svg' height='55.156mm' viewBox='0 0 289.84072 195.43326' width='81.799mm' version='1.1' xmlnsCc='http://creativecommons.org/ns%23' xmlnsXlink='http://www.w3.org/1999/xlink' xmlnsDc='http://purl.org/dc/elements/1.1/'%3e %3cdefs id='defs14'%3e %3clinearGradient id='linearGradient4263' y2='113.1' gradientUnits='userSpaceOnUse' y1='76.066' gradientTransform='translate(0 -.0012816)' x2='199.26' x1='160.9'%3e %3cstop id='stop4259' stop-color='white' stop-opacity='.33333' offset='0'/%3e %3cstop id='stop4261' stop-color='white' stop-opacity='0' offset='1'/%3e %3c/linearGradient%3e %3clinearGradient id='linearGradient4240' y2='79.833' gradientUnits='userSpaceOnUse' x2='120.82' y1='120.77' x1='128.56'%3e %3cstop id='stop4236' stop-color='white' stop-opacity='0' offset='0'/%3e %3cstop id='stop4238' stop-color='white' stop-opacity='.33333' offset='1'/%3e %3c/linearGradient%3e %3c/defs%3e %3cg id='layer1' transform='translate(353.49 -626.07)'%3e %3cg id='g4'%3e %3cpath id='path4220' d='m-207 679.86c-7.6546-3.9726-16.149-6.0541-24.773-6.0703-24.585 0.0315-46.045 16.665-52.207 40.465-2.23-0.35755-4.4838-0.54689-6.7422-0.56642-24.881-0.00043-45.051 20.17-45.051 45.051-0.00043 24.881 20.17 45.051 45.051 45.051 36.152-0.20272 72.845-0.0898 109.18-0.0898 8.9834 0 22.962 0.009 36.879 0.0165 9.7409 0.38215 35.645-0.43398 53.537-23.548 17.892-23.115 7.1203-72.79-0.31513-94.017s-30.566-42.361-53.247-42.361c-26.664 0-50.367 14.562-62.311 36.07z' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='%230b9ee5'/%3e %3cpath id='path4220-7' opacity='.98' d='m-335.78 758.74c-0.00043 24.881 20.17 45.051 45.051 45.051 36.152-0.20272 72.845-0.0898 109.18-0.0898 10.101 0 27.126 0.009 42.523 0.0156 11.975-0.4199 32.775-4.017 47.893-23.547 4.439-5.7347 7.1108-13.107 8.5098-21.271-35.448-0.0105-239.67-0.15823-253.16-0.15823z' fill='%2360bce9'/%3e %3c/g%3e %3cpath id='path4220-2' d='m-144.69 643.79c-19.529 0-37.464 7.8167-50.359 20.447-4.6476 4.6419-8.6513 9.9041-11.953 15.623 0 40.944 0.0195 77.914 0.0195 123.83 8.4824 0.007 16.983 0.0137 25.438 0.0137 10.101 0 27.126 0.009 42.523 0.0156 11.975-0.4199 32.775-4.017 47.893-23.547 17.892-23.115 7.1209-72.791-0.31446-94.018s-30.565-42.361-53.246-42.361z' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='white' fill-opacity='.31373'/%3e %3c/g%3e %3cg id='g4244' transform='translate(2.926 -1.3827)'%3e %3cpath id='path4329' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='%23003232' d='m211.54 98.88c11.484 8.7901 14.857 8.43 22.486 19.238 3.6519 5.1733 5.5602 11.69 5.5645 18.164-0.00018 17.949-14.551 32.499-32.5 32.498-17.948-0.00018-32.498-14.55-32.498-32.498 0.006-0.50098 0.0236-1.0018 0.0527-1.502-3.4629-1.1175-6.9173-1.9297-9.6543-1.9297-2.7565 0-6.2409 0.82134-9.7285 1.9512 0.036 0.49286 0.0607 0.98649 0.0742 1.4805-0.00018 17.948-14.55 32.498-32.498 32.498-17.948-0.00019-32.498-14.55-32.498-32.498 0.006-3.5239 0.71774-6.9687 1.8781-10.26 5.474-20.521 8.7944-44.229 27.665-46.855 8.2552-1.1488 15.952 8.848 25.107 8.848 9.1558-0.00028 9.318-14.58 23.088-14.836 16.828-0.3123 31.185 16.304 43.462 25.701zm-4.7539 13.92c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-84.125 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z'/%3e %3cpath id='path4329-2' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' fill='url(%23linearGradient4263)' d='m157.24 77.869c-2.1199 2.1753-3.6401 4.4832-5.4018 6.5241-0.53185 0.61614-1.2448 1.3191-1.8477 1.7949-1.2058 0.9517-2.5477 1.6107-4.168 1.7793-0.27005 0.0281-0.54787 0.04296-0.83398 0.04297 5.0928 13.298 11.821 26.014 20 44.834 2.737 0 6.1914 0.8122 9.6543 1.9297-0.0291 0.5002-0.0467 1.001-0.0527 1.502 0 8.4131 3.196 16.08 8.4414 21.852 0.34969 0.38474 0.70861 0.75939 1.0762 1.127 5.881 5.8809 14.007 9.5194 22.98 9.5195 0.5609 0.00004 1.118-0.0149 1.6719-0.043 3.3236-0.16829 6.5154-0.83435 9.502-1.9277 0.99554-0.36446 1.9688-0.77802 2.916-1.2344 1.4208-0.68453 2.7833-1.4677 4.0801-2.3438 8.645-5.84 14.33-15.731 14.33-26.949-0.004-6.474-2.0849-12.873-5.5645-18.164-7.0668-10.745-14.684-12.763-22.486-19.238-11.815-9.8048-26.968-25.716-42.627-25.716-6.2104 0-9.3385 2.3185-11.67 4.7112zm49.543 34.924c4.9706 0 9.5876 1.5119 13.418 4.0996 0.6384 0.43129 1.255 0.89176 1.8476 1.3809 0.59266 0.4891 1.1622 1.0059 1.7051 1.5488 4.3431 4.3431 7.0293 10.343 7.0293 16.971 0 12.841-10.085 23.326-22.766 23.969-0.40906 0.0207-0.82015 0.0312-1.2344 0.0312-4.97 0-9.5878-1.5105-13.418-4.0976-0.00044-0.0003-0.002 0.00029-0.002 0-6.384-4.3129-10.58-11.618-10.58-19.902 0-6.6275 2.6862-12.628 7.0293-16.971 0.54288-0.54289 1.1124-1.0597 1.7051-1.5488 0.59266-0.4891 1.2073-0.94957 1.8457-1.3809 3.8304-2.5878 8.4493-4.0996 13.42-4.0996z'/%3e %3cpath id='path4329-7' style='color-rendering:auto%3bcolor:black%3bisolation:auto%3bmix-blend-mode:normal%3bshape-rendering:auto%3bsolid-color:black%3bimage-rendering:auto' d='m121.43 79.077c-0.51208-0.01011-1.027 0.01805-1.543 0.08985-18.871 2.626-22.19 26.335-27.664 46.856-1.1604 3.2913-1.8729 6.7359-1.8789 10.26 0 17.948 14.55 32.498 32.498 32.498s32.498-14.55 32.498-32.498c-0.0135-0.49402-0.0382-0.98762-0.0742-1.4805 3.5012-1.0071 5.7853-1.8693 9.6893-1.9248-4.8944-11.377-14.29-31.914-19.961-44.863-8.5828 0.000001-15.883-8.7859-23.565-8.9376zm1.2344 33.723c13.255 0 24 10.745 24 24s-10.745 24-24 24-24-10.745-24-24 10.745-24 24-24z' fill='url(%23linearGradient4240)'/%3e %3c/g%3e%3c/svg%3e";
|
|
826
898
|
|
|
827
|
-
var useStyles$
|
|
899
|
+
var useStyles$7 = makeStyles(function (theme) {
|
|
828
900
|
var _header;
|
|
829
901
|
|
|
830
902
|
return {
|
|
@@ -861,7 +933,7 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
861
933
|
userMenu = _ref.userMenu,
|
|
862
934
|
_ref$title = _ref.title,
|
|
863
935
|
title = _ref$title === void 0 ? 'GeoWeb' : _ref$title;
|
|
864
|
-
var classes = useStyles$
|
|
936
|
+
var classes = useStyles$7();
|
|
865
937
|
return /*#__PURE__*/React__default.createElement("header", {
|
|
866
938
|
className: classes.header
|
|
867
939
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -1143,7 +1215,7 @@ ErrorBoundary.defaultProps = {
|
|
|
1143
1215
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1144
1216
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1145
1217
|
* */
|
|
1146
|
-
var useStyles$
|
|
1218
|
+
var useStyles$6 = makeStyles(function (theme) {
|
|
1147
1219
|
return {
|
|
1148
1220
|
container: {
|
|
1149
1221
|
position: 'absolute',
|
|
@@ -1191,7 +1263,7 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
1191
1263
|
} : _ref$onClose,
|
|
1192
1264
|
children = _ref.children,
|
|
1193
1265
|
initials = _ref.initials;
|
|
1194
|
-
var classes = useStyles$
|
|
1266
|
+
var classes = useStyles$6();
|
|
1195
1267
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1196
1268
|
"data-testid": "userButton",
|
|
1197
1269
|
onClick: onToggle,
|
|
@@ -1274,7 +1346,7 @@ var MenuItemTheme = function MenuItemTheme() {
|
|
|
1274
1346
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1275
1347
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1276
1348
|
* */
|
|
1277
|
-
var useStyles$
|
|
1349
|
+
var useStyles$5 = makeStyles(function (theme) {
|
|
1278
1350
|
return {
|
|
1279
1351
|
footer: {
|
|
1280
1352
|
boxShadow: theme.shadows[1],
|
|
@@ -1287,7 +1359,7 @@ var useStyles$6 = makeStyles(function (theme) {
|
|
|
1287
1359
|
}); // drag handles will be handled by DraggableResizable/Resizable
|
|
1288
1360
|
|
|
1289
1361
|
var ToolFooter = function ToolFooter() {
|
|
1290
|
-
var classes = useStyles$
|
|
1362
|
+
var classes = useStyles$5();
|
|
1291
1363
|
return /*#__PURE__*/React__default.createElement("footer", {
|
|
1292
1364
|
className: classes.footer
|
|
1293
1365
|
});
|
|
@@ -1370,13 +1442,17 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1370
1442
|
_ref$isDraggable = _ref.isDraggable,
|
|
1371
1443
|
isDraggable = _ref$isDraggable === void 0 ? false : _ref$isDraggable,
|
|
1372
1444
|
_ref$className = _ref.className,
|
|
1373
|
-
className = _ref$className === void 0 ? '' : _ref$className
|
|
1445
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1446
|
+
_ref$leftComponent = _ref.leftComponent,
|
|
1447
|
+
leftComponent = _ref$leftComponent === void 0 ? null : _ref$leftComponent;
|
|
1374
1448
|
var styles = getStyle(size);
|
|
1375
1449
|
|
|
1376
1450
|
var onClickClose = function onClickClose() {
|
|
1377
1451
|
return onClose();
|
|
1378
1452
|
};
|
|
1379
1453
|
|
|
1454
|
+
var columnSizeIcon = leftComponent ? 3 : 1;
|
|
1455
|
+
var columnSizeTitle = leftComponent ? 6 : 10;
|
|
1380
1456
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
1381
1457
|
component: "header",
|
|
1382
1458
|
className: className,
|
|
@@ -1392,26 +1468,27 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1392
1468
|
alignItems: "center"
|
|
1393
1469
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1394
1470
|
item: true,
|
|
1395
|
-
xs:
|
|
1396
|
-
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1471
|
+
xs: columnSizeIcon
|
|
1472
|
+
}, isDraggable && size !== 'xxs' && !leftComponent && /*#__PURE__*/React__default.createElement(Grid, {
|
|
1397
1473
|
container: true,
|
|
1398
1474
|
justifyContent: "flex-start"
|
|
1399
|
-
},
|
|
1475
|
+
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
1400
1476
|
"data-testid": "dragBtn",
|
|
1401
1477
|
disableRipple: true,
|
|
1402
1478
|
size: "large",
|
|
1403
1479
|
sx: Object.assign(Object.assign({}, iconStyle), {
|
|
1404
1480
|
pointerEvents: 'none'
|
|
1405
1481
|
})
|
|
1406
|
-
}, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1482
|
+
}, /*#__PURE__*/React__default.createElement(DragIndicator, null))), leftComponent && leftComponent), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1407
1483
|
item: true,
|
|
1408
|
-
xs:
|
|
1484
|
+
xs: columnSizeTitle
|
|
1409
1485
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1410
1486
|
container: true,
|
|
1411
1487
|
justifyContent: "center",
|
|
1412
1488
|
alignItems: "center"
|
|
1413
1489
|
}, title && /*#__PURE__*/React__default.createElement(Typography, {
|
|
1414
1490
|
variant: "h2",
|
|
1491
|
+
noWrap: true,
|
|
1415
1492
|
sx: {
|
|
1416
1493
|
fontSize: styles.fontSize,
|
|
1417
1494
|
fontWeight: styles.fontWeight
|
|
@@ -1427,7 +1504,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1427
1504
|
})
|
|
1428
1505
|
}, /*#__PURE__*/React__default.createElement(DragIndicator, null)))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1429
1506
|
item: true,
|
|
1430
|
-
xs:
|
|
1507
|
+
xs: columnSizeIcon,
|
|
1431
1508
|
container: true,
|
|
1432
1509
|
justifyContent: "flex-end"
|
|
1433
1510
|
}, onClose && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
@@ -1454,22 +1531,20 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1454
1531
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1455
1532
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1456
1533
|
* */
|
|
1457
|
-
var
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
};
|
|
1472
|
-
});
|
|
1534
|
+
var styles$1 = {
|
|
1535
|
+
container: {
|
|
1536
|
+
overflow: 'hidden',
|
|
1537
|
+
borderRadius: 0,
|
|
1538
|
+
display: 'flex',
|
|
1539
|
+
flexDirection: 'column',
|
|
1540
|
+
height: '100%'
|
|
1541
|
+
},
|
|
1542
|
+
content: {
|
|
1543
|
+
flex: 1,
|
|
1544
|
+
overflowY: 'auto',
|
|
1545
|
+
position: 'relative'
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1473
1548
|
var BASE_ELEVATION = 5;
|
|
1474
1549
|
|
|
1475
1550
|
var ToolContainer = function ToolContainer(_a) {
|
|
@@ -1489,20 +1564,22 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
1489
1564
|
elevation = _a$elevation === void 0 ? BASE_ELEVATION : _a$elevation,
|
|
1490
1565
|
_a$headerClassName = _a.headerClassName,
|
|
1491
1566
|
headerClassName = _a$headerClassName === void 0 ? '' : _a$headerClassName,
|
|
1492
|
-
|
|
1567
|
+
_a$leftComponent = _a.leftComponent,
|
|
1568
|
+
leftComponent = _a$leftComponent === void 0 ? null : _a$leftComponent,
|
|
1569
|
+
props = __rest(_a, ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName", "leftComponent"]);
|
|
1493
1570
|
|
|
1494
|
-
var classes = useStyles$5();
|
|
1495
1571
|
return /*#__PURE__*/React__default.createElement(Paper, Object.assign({
|
|
1496
1572
|
elevation: elevation,
|
|
1497
|
-
|
|
1573
|
+
sx: styles$1.container
|
|
1498
1574
|
}, props), /*#__PURE__*/React__default.createElement(ToolHeader, {
|
|
1499
1575
|
title: title,
|
|
1500
1576
|
size: size,
|
|
1501
1577
|
isDraggable: isDraggable,
|
|
1502
1578
|
onClose: onClose,
|
|
1503
|
-
className: headerClassName
|
|
1504
|
-
|
|
1505
|
-
|
|
1579
|
+
className: headerClassName,
|
|
1580
|
+
leftComponent: leftComponent
|
|
1581
|
+
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
1582
|
+
sx: styles$1.content,
|
|
1506
1583
|
style: {
|
|
1507
1584
|
maxHeight: maxHeight
|
|
1508
1585
|
}
|
|
@@ -1561,7 +1638,9 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1561
1638
|
order = _a$order === void 0 ? 1 : _a$order,
|
|
1562
1639
|
_a$source = _a.source,
|
|
1563
1640
|
source = _a$source === void 0 ? 'app' : _a$source,
|
|
1564
|
-
|
|
1641
|
+
_a$leftComponent = _a.leftComponent,
|
|
1642
|
+
leftComponent = _a$leftComponent === void 0 ? null : _a$leftComponent,
|
|
1643
|
+
props = __rest(_a, ["title", "bounds", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "order", "source", "leftComponent"]);
|
|
1565
1644
|
|
|
1566
1645
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
1567
1646
|
var elevation = BASE_ELEVATION + order;
|
|
@@ -1673,7 +1752,8 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1673
1752
|
isDraggable: true,
|
|
1674
1753
|
isResizable: true,
|
|
1675
1754
|
elevation: elevation,
|
|
1676
|
-
headerClassName: headerClassName
|
|
1755
|
+
headerClassName: headerClassName,
|
|
1756
|
+
leftComponent: leftComponent
|
|
1677
1757
|
}, children)))) : null;
|
|
1678
1758
|
};
|
|
1679
1759
|
|
|
@@ -2486,9 +2566,20 @@ var getPosition = function getPosition(menuPosition) {
|
|
|
2486
2566
|
horizontal: 'right'
|
|
2487
2567
|
}
|
|
2488
2568
|
};
|
|
2569
|
+
|
|
2570
|
+
case 'right':
|
|
2571
|
+
return {
|
|
2572
|
+
anchorOrigin: {
|
|
2573
|
+
vertical: 'center',
|
|
2574
|
+
horizontal: 'right'
|
|
2575
|
+
},
|
|
2576
|
+
transformOrigin: {
|
|
2577
|
+
vertical: 'center',
|
|
2578
|
+
horizontal: 'left'
|
|
2579
|
+
}
|
|
2580
|
+
};
|
|
2489
2581
|
}
|
|
2490
2582
|
};
|
|
2491
|
-
|
|
2492
2583
|
var ToggleMenu = function ToggleMenu(_ref) {
|
|
2493
2584
|
var _ref$buttonTestId = _ref.buttonTestId,
|
|
2494
2585
|
buttonTestId = _ref$buttonTestId === void 0 ? 'toggleMenuButton' : _ref$buttonTestId,
|
|
@@ -2498,7 +2589,10 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2498
2589
|
children = _ref.children,
|
|
2499
2590
|
buttonSx = _ref.buttonSx,
|
|
2500
2591
|
_ref$tooltipTitle = _ref.tooltipTitle,
|
|
2501
|
-
tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle
|
|
2592
|
+
tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
|
|
2593
|
+
variant = _ref.variant,
|
|
2594
|
+
_ref$isDefaultOpen = _ref.isDefaultOpen,
|
|
2595
|
+
isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen;
|
|
2502
2596
|
|
|
2503
2597
|
var _React$useState = React.useState(null),
|
|
2504
2598
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -2512,18 +2606,27 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2512
2606
|
transformOrigin = _getPosition.transformOrigin;
|
|
2513
2607
|
|
|
2514
2608
|
var handleClick = function handleClick(event) {
|
|
2609
|
+
event.stopPropagation();
|
|
2515
2610
|
setAnchorEl(event.currentTarget);
|
|
2516
2611
|
};
|
|
2517
2612
|
|
|
2518
|
-
var handleClose = function handleClose() {
|
|
2613
|
+
var handleClose = function handleClose(event) {
|
|
2614
|
+
event.stopPropagation();
|
|
2519
2615
|
setAnchorEl(null);
|
|
2520
2616
|
};
|
|
2521
2617
|
|
|
2618
|
+
React.useEffect(function () {
|
|
2619
|
+
if (isDefaultOpen) {
|
|
2620
|
+
setAnchorEl(document.getElementById(buttonTestId));
|
|
2621
|
+
}
|
|
2622
|
+
}, [isDefaultOpen, buttonTestId]);
|
|
2522
2623
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToolButton, {
|
|
2523
2624
|
active: isOpen,
|
|
2524
2625
|
sx: buttonSx,
|
|
2525
2626
|
onClick: handleClick,
|
|
2526
|
-
"data-testid": buttonTestId
|
|
2627
|
+
"data-testid": buttonTestId,
|
|
2628
|
+
variant: variant,
|
|
2629
|
+
id: buttonTestId
|
|
2527
2630
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
2528
2631
|
placement: "top",
|
|
2529
2632
|
title: tooltipTitle
|
|
@@ -2550,9 +2653,9 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2550
2653
|
action = menuItem.action;
|
|
2551
2654
|
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
2552
2655
|
key: text,
|
|
2553
|
-
onClick: function onClick() {
|
|
2554
|
-
action();
|
|
2555
|
-
handleClose();
|
|
2656
|
+
onClick: function onClick(event) {
|
|
2657
|
+
action(event);
|
|
2658
|
+
handleClose(event);
|
|
2556
2659
|
}
|
|
2557
2660
|
}, icon && /*#__PURE__*/React.createElement(ListItemIcon, null, icon), /*#__PURE__*/React.createElement(Typography, null, text));
|
|
2558
2661
|
}), children));
|
|
@@ -2772,6 +2875,199 @@ var EnableButton = function EnableButton(_ref) {
|
|
|
2772
2875
|
});
|
|
2773
2876
|
};
|
|
2774
2877
|
|
|
2878
|
+
/* *
|
|
2879
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2880
|
+
* you may not use this file except in compliance with the License.
|
|
2881
|
+
* You may obtain a copy of the License at
|
|
2882
|
+
*
|
|
2883
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2884
|
+
*
|
|
2885
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2886
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2887
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2888
|
+
* See the License for the specific language governing permissions and
|
|
2889
|
+
* limitations under the License.
|
|
2890
|
+
*
|
|
2891
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2892
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2893
|
+
* */
|
|
2894
|
+
var tooltipContainerStyles = function tooltipContainerStyles(isEnabled) {
|
|
2895
|
+
var hasBackgroundColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2896
|
+
return Object.assign({
|
|
2897
|
+
width: '100%',
|
|
2898
|
+
height: 32,
|
|
2899
|
+
fontWeight: 500,
|
|
2900
|
+
fontSize: function fontSize(theme) {
|
|
2901
|
+
return theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize;
|
|
2902
|
+
},
|
|
2903
|
+
color: isEnabled ? 'geowebColors.layerManager.tableRowDefaultText.rgba' : 'geowebColors.layerManager.tableRowDisabledText.rgba',
|
|
2904
|
+
'& .MuiOutlinedInput-input': {
|
|
2905
|
+
padding: '6px 24px 6px 8px'
|
|
2906
|
+
},
|
|
2907
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
2908
|
+
borderColor: 'transparent!important'
|
|
2909
|
+
},
|
|
2910
|
+
'&:hover .MuiSelect-select': {
|
|
2911
|
+
outline: function outline(theme) {
|
|
2912
|
+
return theme.palette.geowebColors.buttons.focusDefault.outline;
|
|
2913
|
+
}
|
|
2914
|
+
},
|
|
2915
|
+
'&.Mui-focused .MuiSelect-select': {
|
|
2916
|
+
outline: function outline(theme) {
|
|
2917
|
+
return theme.palette.geowebColors.buttons.focusDefault.outline;
|
|
2918
|
+
}
|
|
2919
|
+
},
|
|
2920
|
+
'&:focus&.MuiButton-root': {
|
|
2921
|
+
outline: function outline(theme) {
|
|
2922
|
+
return theme.palette.geowebColors.buttons.focusDefault.outline;
|
|
2923
|
+
}
|
|
2924
|
+
},
|
|
2925
|
+
'& .MuiSvgIcon-root': {
|
|
2926
|
+
transition: 'none',
|
|
2927
|
+
fill: function fill(theme) {
|
|
2928
|
+
return isEnabled ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color;
|
|
2929
|
+
}
|
|
2930
|
+
},
|
|
2931
|
+
'&>div': {
|
|
2932
|
+
paddingLeft: 1
|
|
2933
|
+
}
|
|
2934
|
+
}, hasBackgroundColor && backgroundColor);
|
|
2935
|
+
};
|
|
2936
|
+
var backgroundColor = {
|
|
2937
|
+
'&:hover .MuiSelect-select': {
|
|
2938
|
+
outline: function outline(theme) {
|
|
2939
|
+
return theme.palette.geowebColors.buttons.focusDefault.outline;
|
|
2940
|
+
},
|
|
2941
|
+
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2942
|
+
},
|
|
2943
|
+
'&.Mui-focused .MuiSelect-select': {
|
|
2944
|
+
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2945
|
+
},
|
|
2946
|
+
'&:hover&.MuiButton-root': {
|
|
2947
|
+
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2948
|
+
},
|
|
2949
|
+
'&:focus&.MuiButton-root': {
|
|
2950
|
+
outline: function outline(theme) {
|
|
2951
|
+
return theme.palette.geowebColors.buttons.focusDefault.outline;
|
|
2952
|
+
},
|
|
2953
|
+
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2954
|
+
}
|
|
2955
|
+
};
|
|
2956
|
+
|
|
2957
|
+
var TooltipSelect = function TooltipSelect(_a) {
|
|
2958
|
+
var tooltip = _a.tooltip,
|
|
2959
|
+
_a$list = _a.list,
|
|
2960
|
+
list = _a$list === void 0 ? [] : _a$list,
|
|
2961
|
+
_a$currentIndex = _a.currentIndex,
|
|
2962
|
+
currentIndex = _a$currentIndex === void 0 ? -1 : _a$currentIndex,
|
|
2963
|
+
_a$onChangeMouseWheel = _a.onChangeMouseWheel,
|
|
2964
|
+
onChangeMouseWheel = _a$onChangeMouseWheel === void 0 ? function () {} : _a$onChangeMouseWheel,
|
|
2965
|
+
_a$requiresCtrlToChan = _a.requiresCtrlToChange,
|
|
2966
|
+
requiresCtrlToChange = _a$requiresCtrlToChan === void 0 ? false : _a$requiresCtrlToChan,
|
|
2967
|
+
isEnabled = _a.isEnabled,
|
|
2968
|
+
noStyling = _a.noStyling,
|
|
2969
|
+
hasBackgroundColor = _a.hasBackgroundColor,
|
|
2970
|
+
props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange", "isEnabled", "noStyling", "hasBackgroundColor"]);
|
|
2971
|
+
|
|
2972
|
+
props.disableUnderline;
|
|
2973
|
+
var otherProps = __rest(props, ["disableUnderline"]);
|
|
2974
|
+
|
|
2975
|
+
var _React$useState = React.useState(false),
|
|
2976
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2977
|
+
selectOpen = _React$useState2[0],
|
|
2978
|
+
setSelectOpen = _React$useState2[1];
|
|
2979
|
+
|
|
2980
|
+
var _React$useState3 = React.useState(false),
|
|
2981
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
2982
|
+
tooltipOpen = _React$useState4[0],
|
|
2983
|
+
setTooltipOpen = _React$useState4[1];
|
|
2984
|
+
|
|
2985
|
+
var onWheel = React.useCallback(function (event) {
|
|
2986
|
+
if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
|
|
2987
|
+
if (selectOpen) return;
|
|
2988
|
+
var direction = event.deltaY < 0 ? 1 : -1;
|
|
2989
|
+
var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
|
|
2990
|
+
onChangeMouseWheel(newValue);
|
|
2991
|
+
}
|
|
2992
|
+
}, [selectOpen, currentIndex, list, onChangeMouseWheel, requiresCtrlToChange]);
|
|
2993
|
+
var onOpen = React.useCallback(function () {
|
|
2994
|
+
setSelectOpen(true);
|
|
2995
|
+
setTooltipOpen(false);
|
|
2996
|
+
}, []);
|
|
2997
|
+
var onClose = React.useCallback(function () {
|
|
2998
|
+
setSelectOpen(false);
|
|
2999
|
+
}, []);
|
|
3000
|
+
var onMouseEnter = React.useCallback(function () {
|
|
3001
|
+
if (!selectOpen) setTooltipOpen(true);
|
|
3002
|
+
}, [selectOpen]);
|
|
3003
|
+
var onMouseLeave = React.useCallback(function () {
|
|
3004
|
+
setTooltipOpen(false);
|
|
3005
|
+
}, []);
|
|
3006
|
+
var onFocus = React.useCallback(function () {
|
|
3007
|
+
setTooltipOpen(true);
|
|
3008
|
+
}, []);
|
|
3009
|
+
var onBlur = React.useCallback(function () {
|
|
3010
|
+
setTooltipOpen(false);
|
|
3011
|
+
}, []);
|
|
3012
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
3013
|
+
title: tooltip,
|
|
3014
|
+
placement: "top",
|
|
3015
|
+
open: tooltipOpen,
|
|
3016
|
+
sx: noStyling ? undefined : tooltipContainerStyles(isEnabled, hasBackgroundColor)
|
|
3017
|
+
}, /*#__PURE__*/React.createElement(Select, Object.assign({
|
|
3018
|
+
onOpen: onOpen,
|
|
3019
|
+
onClose: onClose,
|
|
3020
|
+
onMouseEnter: onMouseEnter,
|
|
3021
|
+
onMouseLeave: onMouseLeave,
|
|
3022
|
+
onFocus: onFocus,
|
|
3023
|
+
onBlur: onBlur,
|
|
3024
|
+
onWheel: onWheel,
|
|
3025
|
+
MenuProps: {
|
|
3026
|
+
BackdropProps: {
|
|
3027
|
+
sx: {
|
|
3028
|
+
'&.MuiBackdrop-root': {
|
|
3029
|
+
backgroundColor: 'transparent'
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
},
|
|
3033
|
+
sx: {
|
|
3034
|
+
'& ul': {
|
|
3035
|
+
backgroundColor: 'geowebColors.background.surface'
|
|
3036
|
+
},
|
|
3037
|
+
'& li': {
|
|
3038
|
+
fontSize: '16px',
|
|
3039
|
+
padding: '12px',
|
|
3040
|
+
'&:hover': {
|
|
3041
|
+
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
3042
|
+
},
|
|
3043
|
+
'&.Mui-selected': {
|
|
3044
|
+
color: 'geowebColors.buttons.tool.active.color',
|
|
3045
|
+
backgroundColor: 'geowebColors.buttons.tool.active.fill',
|
|
3046
|
+
boxShadow: "none",
|
|
3047
|
+
'&:hover': {
|
|
3048
|
+
backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
|
|
3049
|
+
},
|
|
3050
|
+
'&:focus': {
|
|
3051
|
+
backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3054
|
+
'&:after': {
|
|
3055
|
+
background: 'none!important'
|
|
3056
|
+
},
|
|
3057
|
+
'&.Mui-disabled': {
|
|
3058
|
+
fontSize: '12px',
|
|
3059
|
+
opacity: 0.67,
|
|
3060
|
+
padding: '0px 12px',
|
|
3061
|
+
'&.MuiMenuItem-root': {
|
|
3062
|
+
minHeight: '30px!important'
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
}, otherProps)));
|
|
3069
|
+
};
|
|
3070
|
+
|
|
2775
3071
|
/* *
|
|
2776
3072
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2777
3073
|
* you may not use this file except in compliance with the License.
|
|
@@ -2806,4 +3102,4 @@ var getAxiosErrorMessage = function getAxiosErrorMessage(error) {
|
|
|
2806
3102
|
return 'An error has occurred';
|
|
2807
3103
|
};
|
|
2808
3104
|
|
|
2809
|
-
export { AlertBanner, AppHeader, AppLayout, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, CustomToggleButton, DraggableComponent$1 as Draggable, EnableButton, ErrorBoundary, HIDDEN_INPUT_HELPER_IS_DRAFT, ManagerButton, ManagerDeleteButton, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, calculateDialogSizeAndPosition, getAxiosErrorMessage, getInitials, isAxiosError, showPrompt, sliderStyles, useConfirmationDialog, useDialogActions, useDraftFormHelpers, useIsMounted, usePoller, usePreventBrowserClose, usePrevious, useUserMenu };
|
|
3105
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, CustomToggleButton, DraggableComponent$1 as Draggable, EnableButton, ErrorBoundary, HIDDEN_INPUT_HELPER_IS_DRAFT, ManagerButton, ManagerDeleteButton, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, calculateDialogSizeAndPosition, getAxiosErrorMessage, getInitials, getPosition, isAxiosError, showPrompt, sliderStyles, tooltipContainerStyles, useConfirmationDialog, useDialogActions, useDraftFormHelpers, useIsMounted, usePoller, usePreventBrowserClose, usePrevious, useUserMenu };
|