@opengeoweb/shared 2.15.0 → 3.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 +98 -90
- package/index.umd.js +97 -87
- package/lib/components/AppHeader/AppHeader.stories.d.ts +12 -1
- package/lib/components/CustomSlider/CustomSlider.d.ts +6 -1
- package/lib/components/CustomSlider/CustomSlider.stories.d.ts +0 -1
- package/lib/components/CustomSlider/index.d.ts +1 -1
- package/lib/components/components.stories.d.ts +0 -1
- package/lib/utils/axiosErrorUtils/axiosErrorUtils.d.ts +2 -0
- package/package.json +3 -3
package/index.esm.js
CHANGED
|
@@ -8,7 +8,6 @@ import makeStyles from '@mui/styles/makeStyles';
|
|
|
8
8
|
import Draggable from 'react-draggable';
|
|
9
9
|
import { Resizable } from 're-resizable';
|
|
10
10
|
import { throttle } from 'lodash';
|
|
11
|
-
import withStyles from '@mui/styles/withStyles';
|
|
12
11
|
import createStyles from '@mui/styles/createStyles';
|
|
13
12
|
|
|
14
13
|
/* *
|
|
@@ -870,7 +869,7 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
870
869
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
871
870
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
872
871
|
* */
|
|
873
|
-
var useStyles$
|
|
872
|
+
var useStyles$5 = makeStyles(function () {
|
|
874
873
|
return {
|
|
875
874
|
wrapper: {
|
|
876
875
|
height: '100vh',
|
|
@@ -887,7 +886,7 @@ var useStyles$6 = makeStyles(function () {
|
|
|
887
886
|
var AppLayout = function AppLayout(_ref) {
|
|
888
887
|
var header = _ref.header,
|
|
889
888
|
children = _ref.children;
|
|
890
|
-
var classes = useStyles$
|
|
889
|
+
var classes = useStyles$5();
|
|
891
890
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
892
891
|
className: classes.wrapper
|
|
893
892
|
}, header, /*#__PURE__*/React__default.createElement("main", {
|
|
@@ -895,45 +894,46 @@ var AppLayout = function AppLayout(_ref) {
|
|
|
895
894
|
}, children));
|
|
896
895
|
};
|
|
897
896
|
|
|
898
|
-
var
|
|
899
|
-
|
|
897
|
+
var styles$4 = {
|
|
898
|
+
header: function header(theme) {
|
|
899
|
+
var _ref;
|
|
900
900
|
|
|
901
|
-
|
|
902
|
-
header: (_header = {
|
|
901
|
+
return _ref = {
|
|
903
902
|
height: 40,
|
|
904
|
-
|
|
903
|
+
backgroundColor: theme.palette.geowebColors.brand.brand,
|
|
905
904
|
color: theme.palette.common.white,
|
|
906
905
|
boxShadow: theme.shadows[1],
|
|
907
906
|
zIndex: 1000
|
|
908
|
-
}, _defineProperty(
|
|
907
|
+
}, _defineProperty(_ref, theme.breakpoints.down('sm'), {
|
|
909
908
|
padding: '0 8px'
|
|
910
|
-
}), _defineProperty(
|
|
909
|
+
}), _defineProperty(_ref, theme.breakpoints.up('sm'), {
|
|
911
910
|
padding: '0 24px'
|
|
912
|
-
}),
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}
|
|
911
|
+
}), _ref;
|
|
912
|
+
},
|
|
913
|
+
title: {
|
|
914
|
+
marginLeft: 1,
|
|
915
|
+
fontSize: '1.25rem',
|
|
916
|
+
fontWeight: 400,
|
|
917
|
+
overflow: 'hidden',
|
|
918
|
+
whiteSpace: 'nowrap',
|
|
919
|
+
textOverflow: 'ellipsis',
|
|
920
|
+
letterSpacing: '0.15px'
|
|
921
|
+
},
|
|
922
|
+
container: {
|
|
923
|
+
height: '100%'
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
926
|
|
|
927
|
-
var AppHeader = function AppHeader(
|
|
928
|
-
var menu =
|
|
929
|
-
userMenu =
|
|
930
|
-
|
|
931
|
-
title =
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
927
|
+
var AppHeader = function AppHeader(_ref2) {
|
|
928
|
+
var menu = _ref2.menu,
|
|
929
|
+
userMenu = _ref2.userMenu,
|
|
930
|
+
_ref2$title = _ref2.title,
|
|
931
|
+
title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title;
|
|
932
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
933
|
+
component: "header",
|
|
934
|
+
sx: styles$4.header
|
|
935
935
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
936
|
-
|
|
936
|
+
sx: styles$4.container,
|
|
937
937
|
container: true,
|
|
938
938
|
alignItems: "center"
|
|
939
939
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -954,7 +954,7 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
954
954
|
wrap: "nowrap"
|
|
955
955
|
}, /*#__PURE__*/React__default.createElement(GeoWebLogo, null), /*#__PURE__*/React__default.createElement(Typography, {
|
|
956
956
|
variant: "h1",
|
|
957
|
-
|
|
957
|
+
sx: styles$4.title
|
|
958
958
|
}, title))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
959
959
|
item: true,
|
|
960
960
|
xs: 1,
|
|
@@ -2215,65 +2215,56 @@ var getInitials = function getInitials(name) {
|
|
|
2215
2215
|
}
|
|
2216
2216
|
};
|
|
2217
2217
|
|
|
2218
|
-
var
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2218
|
+
var sliderHeaderStyle = {
|
|
2219
|
+
fontFamily: 'Roboto-Black, Roboto',
|
|
2220
|
+
fontSize: 12,
|
|
2221
|
+
color: 'geowebColors.typographyAndIcons.text',
|
|
2222
|
+
padding: '11px 0 11px 16px'
|
|
2223
|
+
};
|
|
2224
|
+
var sliderStyle = {
|
|
2225
|
+
'& span.selectedLabel': {
|
|
2226
|
+
fontWeight: 'bold'
|
|
2227
|
+
},
|
|
2228
|
+
'& .MuiSlider-thumb': {
|
|
2229
|
+
backgroundColor: 'geowebColors.customSlider.thumb',
|
|
2230
|
+
boxShadow: '0px 3px 5px 1px rgba(0,0,0,0.3)',
|
|
2231
|
+
'&.Mui-focusVisible, &:hover, &:active': {
|
|
2232
|
+
boxShadow: '0px 3px 5px 2px rgba(0,0,0,0.4)'
|
|
2225
2233
|
}
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
mark: {
|
|
2247
|
-
backgroundColor: theme.palette.geowebColors.customSlider.mark,
|
|
2248
|
-
'$disabled &': {
|
|
2249
|
-
backgroundColor: theme.palette.geowebColors.customSlider.markDisabled
|
|
2250
|
-
}
|
|
2251
|
-
},
|
|
2252
|
-
markLabel: {
|
|
2253
|
-
fontFamily: 'Roboto-Black, Roboto',
|
|
2254
|
-
fontSize: 12,
|
|
2255
|
-
color: theme.palette.geowebColors.typographyAndIcons.text
|
|
2234
|
+
},
|
|
2235
|
+
'& .MuiSlider-mark': {
|
|
2236
|
+
backgroundColor: 'geowebColors.customSlider.mark'
|
|
2237
|
+
},
|
|
2238
|
+
'& .MuiSlider-markLabel': {
|
|
2239
|
+
fontFamily: 'Roboto-Black, Roboto',
|
|
2240
|
+
fontSize: 12,
|
|
2241
|
+
color: 'geowebColors.typographyAndIcons.text'
|
|
2242
|
+
},
|
|
2243
|
+
'& .MuiSlider-track': {
|
|
2244
|
+
color: 'geowebColors.customSlider.track',
|
|
2245
|
+
backgroundColor: 'geowebColors.customSlider.track'
|
|
2246
|
+
},
|
|
2247
|
+
'& .MuiSlider-rail': {
|
|
2248
|
+
backgroundColor: 'geowebColors.customSlider.rail',
|
|
2249
|
+
opacity: 1
|
|
2250
|
+
},
|
|
2251
|
+
'&.Mui-disabled': {
|
|
2252
|
+
'& .MuiSlider-thumb': {
|
|
2253
|
+
backgroundColor: 'geowebColors.customSlider.thumbDisabled'
|
|
2256
2254
|
},
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
backgroundColor: theme.palette.geowebColors.customSlider.track,
|
|
2260
|
-
'$disabled &': {
|
|
2261
|
-
backgroundColor: theme.palette.geowebColors.customSlider.trackDisabled,
|
|
2262
|
-
color: theme.palette.geowebColors.customSlider.trackDisabled
|
|
2263
|
-
}
|
|
2255
|
+
'& .MuiSlider-mark': {
|
|
2256
|
+
backgroundColor: 'geowebColors.customSlider.markDisabled'
|
|
2264
2257
|
},
|
|
2265
|
-
|
|
2266
|
-
backgroundColor:
|
|
2267
|
-
|
|
2268
|
-
'$disabled &': {
|
|
2269
|
-
backgroundColor: theme.palette.geowebColors.customSlider.railDisabled,
|
|
2270
|
-
opacity: 1
|
|
2271
|
-
}
|
|
2258
|
+
'& .MuiSlider-track': {
|
|
2259
|
+
backgroundColor: 'geowebColors.customSlider.trackDisabled',
|
|
2260
|
+
color: 'geowebColors.customSlider.trackDisabled'
|
|
2272
2261
|
},
|
|
2273
|
-
|
|
2262
|
+
'& .MuiSlider-rail': {
|
|
2263
|
+
backgroundColor: 'geowebColors.customSlider.railDisabled',
|
|
2264
|
+
opacity: 1
|
|
2274
2265
|
}
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2266
|
+
}
|
|
2267
|
+
};
|
|
2277
2268
|
var CustomSlider = function CustomSlider(_a) {
|
|
2278
2269
|
var value = _a.value,
|
|
2279
2270
|
_a$orientation = _a.orientation,
|
|
@@ -2308,7 +2299,8 @@ var CustomSlider = function CustomSlider(_a) {
|
|
|
2308
2299
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2309
2300
|
|
|
2310
2301
|
}, []);
|
|
2311
|
-
return /*#__PURE__*/React.createElement(
|
|
2302
|
+
return /*#__PURE__*/React.createElement(Slider, Object.assign({
|
|
2303
|
+
sx: sliderStyle,
|
|
2312
2304
|
ref: element,
|
|
2313
2305
|
value: value,
|
|
2314
2306
|
orientation: orientation
|
|
@@ -2946,5 +2938,21 @@ var getErrorMessage = function getErrorMessage(error) {
|
|
|
2946
2938
|
|
|
2947
2939
|
return error.message || DEFAULT_ERROR_MESSAGE;
|
|
2948
2940
|
};
|
|
2941
|
+
var getAxiosWarningMessage = function getAxiosWarningMessage(error) {
|
|
2942
|
+
var data = error.response && error.response.data;
|
|
2943
|
+
|
|
2944
|
+
if (data && data.WarningMessage && typeof data.WarningMessage === 'string') {
|
|
2945
|
+
return data.WarningMessage;
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
return '';
|
|
2949
|
+
};
|
|
2950
|
+
var getWarningMessage = function getWarningMessage(error) {
|
|
2951
|
+
if (isAxiosError(error)) {
|
|
2952
|
+
return getAxiosWarningMessage(error);
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
return '';
|
|
2956
|
+
};
|
|
2949
2957
|
|
|
2950
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, CustomToggleButton, DEFAULT_ERROR_MESSAGE, 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, getErrorMessage, getInitials, getPosition, isAxiosError, showPrompt,
|
|
2958
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomSlider, CustomToggleButton, DEFAULT_ERROR_MESSAGE, 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, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useDialogActions, useDraftFormHelpers, useIsMounted, usePoller, usePreventBrowserClose, usePrevious, useUserMenu };
|
package/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@opengeoweb/theme'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('@mui/styles/makeStyles'), require('react-draggable'), require('re-resizable'), require('lodash'), require('@mui/styles/
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@opengeoweb/theme', 'react-hook-form', '@opengeoweb/form-fields', '@mui/styles/makeStyles', 'react-draggable', 're-resizable', 'lodash', '@mui/styles/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.theme, global.reactHookForm, global.formFields, global.makeStyles, global.Draggable, global.reResizable, global.lodash, global.
|
|
5
|
-
})(this, (function (exports, React, material, theme, reactHookForm, formFields, makeStyles, Draggable, reResizable, lodash,
|
|
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('@mui/styles/makeStyles'), require('react-draggable'), require('re-resizable'), require('lodash'), require('@mui/styles/createStyles')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@opengeoweb/theme', 'react-hook-form', '@opengeoweb/form-fields', '@mui/styles/makeStyles', 'react-draggable', 're-resizable', 'lodash', '@mui/styles/createStyles'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.theme, global.reactHookForm, global.formFields, global.makeStyles, global.Draggable, global.reResizable, global.lodash, global.createStyles));
|
|
5
|
+
})(this, (function (exports, React, material, theme, reactHookForm, formFields, makeStyles, Draggable, reResizable, lodash, createStyles) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
29
|
var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
|
|
30
30
|
var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
|
|
31
|
-
var withStyles__default = /*#__PURE__*/_interopDefaultLegacy(withStyles);
|
|
32
31
|
var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
|
|
33
32
|
|
|
34
33
|
/*! *****************************************************************************
|
|
@@ -723,7 +722,7 @@
|
|
|
723
722
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
724
723
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
725
724
|
* */
|
|
726
|
-
var useStyles$
|
|
725
|
+
var useStyles$5 = makeStyles__default["default"](function () {
|
|
727
726
|
return {
|
|
728
727
|
wrapper: {
|
|
729
728
|
height: '100vh',
|
|
@@ -740,7 +739,7 @@
|
|
|
740
739
|
var AppLayout = function AppLayout(_a) {
|
|
741
740
|
var header = _a.header,
|
|
742
741
|
children = _a.children;
|
|
743
|
-
var classes = useStyles$
|
|
742
|
+
var classes = useStyles$5();
|
|
744
743
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
745
744
|
className: classes.wrapper
|
|
746
745
|
}, header, /*#__PURE__*/React__default["default"].createElement("main", {
|
|
@@ -764,13 +763,13 @@
|
|
|
764
763
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
765
764
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
766
765
|
* */
|
|
767
|
-
var
|
|
768
|
-
|
|
766
|
+
var styles$4 = {
|
|
767
|
+
header: function header(theme) {
|
|
768
|
+
var _a;
|
|
769
769
|
|
|
770
|
-
|
|
771
|
-
header: (_a = {
|
|
770
|
+
return _a = {
|
|
772
771
|
height: 40,
|
|
773
|
-
|
|
772
|
+
backgroundColor: theme.palette.geowebColors.brand.brand,
|
|
774
773
|
color: theme.palette.common.white,
|
|
775
774
|
boxShadow: theme.shadows[1],
|
|
776
775
|
zIndex: 1000
|
|
@@ -778,31 +777,32 @@
|
|
|
778
777
|
padding: '0 8px'
|
|
779
778
|
}, _a[theme.breakpoints.up('sm')] = {
|
|
780
779
|
padding: '0 24px'
|
|
781
|
-
}, _a
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
780
|
+
}, _a;
|
|
781
|
+
},
|
|
782
|
+
title: {
|
|
783
|
+
marginLeft: 1,
|
|
784
|
+
fontSize: '1.25rem',
|
|
785
|
+
fontWeight: 400,
|
|
786
|
+
overflow: 'hidden',
|
|
787
|
+
whiteSpace: 'nowrap',
|
|
788
|
+
textOverflow: 'ellipsis',
|
|
789
|
+
letterSpacing: '0.15px'
|
|
790
|
+
},
|
|
791
|
+
container: {
|
|
792
|
+
height: '100%'
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
795
|
|
|
796
796
|
var AppHeader = function AppHeader(_a) {
|
|
797
797
|
var menu = _a.menu,
|
|
798
798
|
userMenu = _a.userMenu,
|
|
799
799
|
_b = _a.title,
|
|
800
800
|
title = _b === void 0 ? 'GeoWeb' : _b;
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
801
|
+
return /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
802
|
+
component: "header",
|
|
803
|
+
sx: styles$4.header
|
|
804
804
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
805
|
-
|
|
805
|
+
sx: styles$4.container,
|
|
806
806
|
container: true,
|
|
807
807
|
alignItems: "center"
|
|
808
808
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
@@ -823,7 +823,7 @@
|
|
|
823
823
|
wrap: "nowrap"
|
|
824
824
|
}, /*#__PURE__*/React__default["default"].createElement(theme.GeoWebLogo, null), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
825
825
|
variant: "h1",
|
|
826
|
-
|
|
826
|
+
sx: styles$4.title
|
|
827
827
|
}, title))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
828
828
|
item: true,
|
|
829
829
|
xs: 1,
|
|
@@ -2094,65 +2094,56 @@
|
|
|
2094
2094
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2095
2095
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2096
2096
|
* */
|
|
2097
|
-
var
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2097
|
+
var sliderHeaderStyle = {
|
|
2098
|
+
fontFamily: 'Roboto-Black, Roboto',
|
|
2099
|
+
fontSize: 12,
|
|
2100
|
+
color: 'geowebColors.typographyAndIcons.text',
|
|
2101
|
+
padding: '11px 0 11px 16px'
|
|
2102
|
+
};
|
|
2103
|
+
var sliderStyle = {
|
|
2104
|
+
'& span.selectedLabel': {
|
|
2105
|
+
fontWeight: 'bold'
|
|
2106
|
+
},
|
|
2107
|
+
'& .MuiSlider-thumb': {
|
|
2108
|
+
backgroundColor: 'geowebColors.customSlider.thumb',
|
|
2109
|
+
boxShadow: '0px 3px 5px 1px rgba(0,0,0,0.3)',
|
|
2110
|
+
'&.Mui-focusVisible, &:hover, &:active': {
|
|
2111
|
+
boxShadow: '0px 3px 5px 2px rgba(0,0,0,0.4)'
|
|
2104
2112
|
}
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
mark: {
|
|
2126
|
-
backgroundColor: theme.palette.geowebColors.customSlider.mark,
|
|
2127
|
-
'$disabled &': {
|
|
2128
|
-
backgroundColor: theme.palette.geowebColors.customSlider.markDisabled
|
|
2129
|
-
}
|
|
2130
|
-
},
|
|
2131
|
-
markLabel: {
|
|
2132
|
-
fontFamily: 'Roboto-Black, Roboto',
|
|
2133
|
-
fontSize: 12,
|
|
2134
|
-
color: theme.palette.geowebColors.typographyAndIcons.text
|
|
2113
|
+
},
|
|
2114
|
+
'& .MuiSlider-mark': {
|
|
2115
|
+
backgroundColor: 'geowebColors.customSlider.mark'
|
|
2116
|
+
},
|
|
2117
|
+
'& .MuiSlider-markLabel': {
|
|
2118
|
+
fontFamily: 'Roboto-Black, Roboto',
|
|
2119
|
+
fontSize: 12,
|
|
2120
|
+
color: 'geowebColors.typographyAndIcons.text'
|
|
2121
|
+
},
|
|
2122
|
+
'& .MuiSlider-track': {
|
|
2123
|
+
color: 'geowebColors.customSlider.track',
|
|
2124
|
+
backgroundColor: 'geowebColors.customSlider.track'
|
|
2125
|
+
},
|
|
2126
|
+
'& .MuiSlider-rail': {
|
|
2127
|
+
backgroundColor: 'geowebColors.customSlider.rail',
|
|
2128
|
+
opacity: 1
|
|
2129
|
+
},
|
|
2130
|
+
'&.Mui-disabled': {
|
|
2131
|
+
'& .MuiSlider-thumb': {
|
|
2132
|
+
backgroundColor: 'geowebColors.customSlider.thumbDisabled'
|
|
2135
2133
|
},
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
backgroundColor: theme.palette.geowebColors.customSlider.track,
|
|
2139
|
-
'$disabled &': {
|
|
2140
|
-
backgroundColor: theme.palette.geowebColors.customSlider.trackDisabled,
|
|
2141
|
-
color: theme.palette.geowebColors.customSlider.trackDisabled
|
|
2142
|
-
}
|
|
2134
|
+
'& .MuiSlider-mark': {
|
|
2135
|
+
backgroundColor: 'geowebColors.customSlider.markDisabled'
|
|
2143
2136
|
},
|
|
2144
|
-
|
|
2145
|
-
backgroundColor:
|
|
2146
|
-
|
|
2147
|
-
'$disabled &': {
|
|
2148
|
-
backgroundColor: theme.palette.geowebColors.customSlider.railDisabled,
|
|
2149
|
-
opacity: 1
|
|
2150
|
-
}
|
|
2137
|
+
'& .MuiSlider-track': {
|
|
2138
|
+
backgroundColor: 'geowebColors.customSlider.trackDisabled',
|
|
2139
|
+
color: 'geowebColors.customSlider.trackDisabled'
|
|
2151
2140
|
},
|
|
2152
|
-
|
|
2141
|
+
'& .MuiSlider-rail': {
|
|
2142
|
+
backgroundColor: 'geowebColors.customSlider.railDisabled',
|
|
2143
|
+
opacity: 1
|
|
2153
2144
|
}
|
|
2154
|
-
}
|
|
2155
|
-
}
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2156
2147
|
var CustomSlider = function CustomSlider(_a) {
|
|
2157
2148
|
var value = _a.value,
|
|
2158
2149
|
_b = _a.orientation,
|
|
@@ -2186,7 +2177,8 @@
|
|
|
2186
2177
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2187
2178
|
|
|
2188
2179
|
}, []);
|
|
2189
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
2180
|
+
return /*#__PURE__*/React__namespace.createElement(material.Slider, __assign({
|
|
2181
|
+
sx: sliderStyle,
|
|
2190
2182
|
ref: element,
|
|
2191
2183
|
value: value,
|
|
2192
2184
|
orientation: orientation
|
|
@@ -2840,6 +2832,22 @@
|
|
|
2840
2832
|
|
|
2841
2833
|
return error.message || DEFAULT_ERROR_MESSAGE;
|
|
2842
2834
|
};
|
|
2835
|
+
var getAxiosWarningMessage = function getAxiosWarningMessage(error) {
|
|
2836
|
+
var data = error.response && error.response.data;
|
|
2837
|
+
|
|
2838
|
+
if (data && data.WarningMessage && typeof data.WarningMessage === 'string') {
|
|
2839
|
+
return data.WarningMessage;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
return '';
|
|
2843
|
+
};
|
|
2844
|
+
var getWarningMessage = function getWarningMessage(error) {
|
|
2845
|
+
if (isAxiosError(error)) {
|
|
2846
|
+
return getAxiosWarningMessage(error);
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
return '';
|
|
2850
|
+
};
|
|
2843
2851
|
|
|
2844
2852
|
exports.AlertBanner = AlertBanner;
|
|
2845
2853
|
exports.AlertIcon = AlertIcon;
|
|
@@ -2871,12 +2879,14 @@
|
|
|
2871
2879
|
exports.UserMenuItemTheme = MenuItemTheme;
|
|
2872
2880
|
exports.calculateDialogSizeAndPosition = calculateDialogSizeAndPosition;
|
|
2873
2881
|
exports.getAxiosErrorMessage = getAxiosErrorMessage;
|
|
2882
|
+
exports.getAxiosWarningMessage = getAxiosWarningMessage;
|
|
2874
2883
|
exports.getErrorMessage = getErrorMessage;
|
|
2875
2884
|
exports.getInitials = getInitials;
|
|
2876
2885
|
exports.getPosition = getPosition;
|
|
2886
|
+
exports.getWarningMessage = getWarningMessage;
|
|
2877
2887
|
exports.isAxiosError = isAxiosError;
|
|
2878
2888
|
exports.showPrompt = showPrompt;
|
|
2879
|
-
exports.
|
|
2889
|
+
exports.sliderHeaderStyle = sliderHeaderStyle;
|
|
2880
2890
|
exports.tooltipContainerStyles = tooltipContainerStyles;
|
|
2881
2891
|
exports.useConfirmationDialog = useConfirmationDialog;
|
|
2882
2892
|
exports.useDialogActions = useDialogActions;
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const AppHeaderDark: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const AppHeaderLight: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SliderProps } from '@mui/material';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const sliderHeaderStyle: {
|
|
4
|
+
fontFamily: string;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
color: string;
|
|
7
|
+
padding: string;
|
|
8
|
+
};
|
|
4
9
|
interface CustomSliderProps extends Omit<SliderProps, 'onChange'> {
|
|
5
10
|
onChange: (event: Event, newValue: number) => void;
|
|
6
11
|
shouldAutoFocus?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CustomSlider,
|
|
1
|
+
export { CustomSlider, sliderHeaderStyle } from './CustomSlider';
|
|
@@ -3,3 +3,5 @@ export declare const DEFAULT_ERROR_MESSAGE = "An error has occurred";
|
|
|
3
3
|
export declare const isAxiosError: (error: AxiosError | Error) => error is AxiosError<any, any>;
|
|
4
4
|
export declare const getAxiosErrorMessage: (error: AxiosError) => string;
|
|
5
5
|
export declare const getErrorMessage: (error: Error | AxiosError) => string;
|
|
6
|
+
export declare const getAxiosWarningMessage: (error: AxiosError) => string;
|
|
7
|
+
export declare const getWarningMessage: (error: AxiosError | Error) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.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,12 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^17.0.2",
|
|
16
16
|
"@mui/material": "^5.2.8",
|
|
17
|
-
"@opengeoweb/theme": "
|
|
17
|
+
"@opengeoweb/theme": "3.0.0",
|
|
18
18
|
"@mui/styles": "^5.2.3",
|
|
19
19
|
"react-draggable": "^4.4.3",
|
|
20
20
|
"re-resizable": "^6.9.0",
|
|
21
21
|
"lodash": "^4.17.20",
|
|
22
|
-
"@opengeoweb/form-fields": "
|
|
22
|
+
"@opengeoweb/form-fields": "3.0.0",
|
|
23
23
|
"react-hook-form": "^6.12.1",
|
|
24
24
|
"moment": "^2.29.0",
|
|
25
25
|
"moment-timezone": "^0.5.31",
|