@opengeoweb/shared 8.1.0 → 8.2.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 +61 -22
- package/package.json +2 -2
- package/src/lib/components/DraggableResizable/types.d.ts +4 -0
- package/src/lib/components/SwitchButton/SwitchButton.d.ts +4 -0
- package/src/lib/components/SwitchButton/SwitchButton.spec.d.ts +1 -0
- package/src/lib/components/SwitchButton/index.d.ts +1 -0
- package/src/lib/components/ToggleMenu/ToggleMenu.d.ts +1 -0
- package/src/lib/components/ToolContainer/ToolContainerDraggable.d.ts +3 -3
- package/src/lib/components/ToolContainer/types.d.ts +0 -9
- package/src/lib/components/index.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { useRef, useContext } from 'react';
|
|
3
|
-
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
3
|
+
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, Switch } from '@mui/material';
|
|
4
4
|
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown } from '@opengeoweb/theme';
|
|
5
5
|
import require$$2, { flushSync } from 'react-dom';
|
|
6
6
|
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, set as set$1 } from 'date-fns';
|
|
@@ -21272,7 +21272,7 @@ var edgeBase = {
|
|
|
21272
21272
|
height: '20px',
|
|
21273
21273
|
position: 'absolute',
|
|
21274
21274
|
};
|
|
21275
|
-
var styles$
|
|
21275
|
+
var styles$6 = {
|
|
21276
21276
|
top: __assign$1(__assign$1({}, rowSizeBase), { top: '-5px' }),
|
|
21277
21277
|
right: __assign$1(__assign$1({}, colSizeBase), { left: undefined, right: '-5px' }),
|
|
21278
21278
|
bottom: __assign$1(__assign$1({}, rowSizeBase), { top: undefined, bottom: '-5px' }),
|
|
@@ -21295,7 +21295,7 @@ var Resizer = /** @class */ (function (_super) {
|
|
|
21295
21295
|
return _this;
|
|
21296
21296
|
}
|
|
21297
21297
|
Resizer.prototype.render = function () {
|
|
21298
|
-
return (React$1.createElement("div", { className: this.props.className || '', style: __assign$1(__assign$1({ position: 'absolute', userSelect: 'none' }, styles$
|
|
21298
|
+
return (React$1.createElement("div", { className: this.props.className || '', style: __assign$1(__assign$1({ position: 'absolute', userSelect: 'none' }, styles$6[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
|
|
21299
21299
|
};
|
|
21300
21300
|
return Resizer;
|
|
21301
21301
|
}(React$1.PureComponent));
|
|
@@ -22244,7 +22244,7 @@ ErrorBoundary.defaultProps = {
|
|
|
22244
22244
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
22245
22245
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
22246
22246
|
* */
|
|
22247
|
-
var styles$
|
|
22247
|
+
var styles$5 = {
|
|
22248
22248
|
small: {
|
|
22249
22249
|
height: 16,
|
|
22250
22250
|
width: 16,
|
|
@@ -22258,7 +22258,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
22258
22258
|
size = _ref$size === void 0 ? 'large' : _ref$size;
|
|
22259
22259
|
return /*#__PURE__*/React$1.createElement(Avatar$1, {
|
|
22260
22260
|
"data-testid": "avatar",
|
|
22261
|
-
sx: Object.assign({}, styles$
|
|
22261
|
+
sx: Object.assign({}, styles$5[size])
|
|
22262
22262
|
}, children);
|
|
22263
22263
|
};
|
|
22264
22264
|
|
|
@@ -22278,7 +22278,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
22278
22278
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
22279
22279
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
22280
22280
|
* */
|
|
22281
|
-
var styles$
|
|
22281
|
+
var styles$4 = {
|
|
22282
22282
|
container: {
|
|
22283
22283
|
position: 'absolute',
|
|
22284
22284
|
top: 38,
|
|
@@ -22321,13 +22321,13 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
22321
22321
|
},
|
|
22322
22322
|
size: "medium"
|
|
22323
22323
|
}, /*#__PURE__*/React__default.createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default.createElement(Paper, {
|
|
22324
|
-
sx: styles$
|
|
22324
|
+
sx: styles$4.container,
|
|
22325
22325
|
"data-testid": "userMenu"
|
|
22326
22326
|
}, /*#__PURE__*/React__default.createElement(ClickAwayListener, {
|
|
22327
22327
|
onClickAway: onClose,
|
|
22328
22328
|
mouseEvent: "onMouseDown"
|
|
22329
22329
|
}, /*#__PURE__*/React__default.createElement(MenuList, {
|
|
22330
|
-
sx: styles$
|
|
22330
|
+
sx: styles$4.userMenu,
|
|
22331
22331
|
variant: "menu"
|
|
22332
22332
|
}, children))));
|
|
22333
22333
|
};
|
|
@@ -22588,7 +22588,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
22588
22588
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
22589
22589
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
22590
22590
|
* */
|
|
22591
|
-
var styles$
|
|
22591
|
+
var styles$3 = {
|
|
22592
22592
|
container: {
|
|
22593
22593
|
overflow: 'hidden',
|
|
22594
22594
|
borderRadius: 0,
|
|
@@ -22629,7 +22629,7 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
22629
22629
|
props = __rest(_a, ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon"]);
|
|
22630
22630
|
return /*#__PURE__*/React__default.createElement(Paper, Object.assign({
|
|
22631
22631
|
elevation: elevation,
|
|
22632
|
-
sx: styles$
|
|
22632
|
+
sx: styles$3.container
|
|
22633
22633
|
}, props), /*#__PURE__*/React__default.createElement(ErrorBoundary, null, /*#__PURE__*/React__default.createElement(ToolHeader, {
|
|
22634
22634
|
title: title,
|
|
22635
22635
|
size: size,
|
|
@@ -22641,7 +22641,7 @@ var ToolContainer = function ToolContainer(_a) {
|
|
|
22641
22641
|
dragHandleIcon: dragHandleIcon,
|
|
22642
22642
|
closeIcon: closeIcon
|
|
22643
22643
|
})), /*#__PURE__*/React__default.createElement(Box, {
|
|
22644
|
-
sx: styles$
|
|
22644
|
+
sx: styles$3.content,
|
|
22645
22645
|
style: {
|
|
22646
22646
|
maxHeight: maxHeight
|
|
22647
22647
|
}
|
|
@@ -23006,7 +23006,7 @@ var segmentStyle = {
|
|
|
23006
23006
|
letterSpacing: 0.25,
|
|
23007
23007
|
justifyContent: 'center'
|
|
23008
23008
|
};
|
|
23009
|
-
var styles$
|
|
23009
|
+
var styles$2 = {
|
|
23010
23010
|
icon: Object.assign(Object.assign({}, segmentStyle), {
|
|
23011
23011
|
backgroundColor: 'geowebColors.textInputField.default.rgba',
|
|
23012
23012
|
width: 40,
|
|
@@ -23029,21 +23029,21 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
23029
23029
|
children = _ref.children;
|
|
23030
23030
|
if (type === 'divider') {
|
|
23031
23031
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
23032
|
-
sx: styles$
|
|
23032
|
+
sx: styles$2.divider,
|
|
23033
23033
|
"data-testid": "segment-divider",
|
|
23034
23034
|
component: "span"
|
|
23035
23035
|
}, children);
|
|
23036
23036
|
}
|
|
23037
23037
|
if (type === 'icon') {
|
|
23038
23038
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
23039
|
-
sx: styles$
|
|
23039
|
+
sx: styles$2.icon,
|
|
23040
23040
|
"data-testid": "segment-icon",
|
|
23041
23041
|
component: "span"
|
|
23042
23042
|
}, children);
|
|
23043
23043
|
}
|
|
23044
23044
|
if (type === 'connect') {
|
|
23045
23045
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
23046
|
-
sx: styles$
|
|
23046
|
+
sx: styles$2.connect,
|
|
23047
23047
|
"data-testid": "segment-connect",
|
|
23048
23048
|
component: "span"
|
|
23049
23049
|
}, children);
|
|
@@ -23300,7 +23300,7 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
23300
23300
|
"aria-labelledby": "tab-".concat(index)
|
|
23301
23301
|
}, value === index && children);
|
|
23302
23302
|
};
|
|
23303
|
-
var styles = {
|
|
23303
|
+
var styles$1 = {
|
|
23304
23304
|
container: {
|
|
23305
23305
|
margin: '0px 20px',
|
|
23306
23306
|
maxHeight: '90vh'
|
|
@@ -23318,16 +23318,16 @@ var CheatSheet = function CheatSheet() {
|
|
|
23318
23318
|
onChangeActiveTab(newValue);
|
|
23319
23319
|
};
|
|
23320
23320
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
23321
|
-
sx: styles.container
|
|
23321
|
+
sx: styles$1.container
|
|
23322
23322
|
}, /*#__PURE__*/React__default.createElement(Tabs, {
|
|
23323
23323
|
value: activeTab,
|
|
23324
23324
|
onChange: onChangeTab,
|
|
23325
23325
|
"aria-label": "platform"
|
|
23326
23326
|
}, /*#__PURE__*/React__default.createElement(Tab, {
|
|
23327
|
-
sx: styles.tab,
|
|
23327
|
+
sx: styles$1.tab,
|
|
23328
23328
|
label: "Windows"
|
|
23329
23329
|
}), /*#__PURE__*/React__default.createElement(Tab, {
|
|
23330
|
-
sx: styles.tab,
|
|
23330
|
+
sx: styles$1.tab,
|
|
23331
23331
|
label: "Mac"
|
|
23332
23332
|
})), /*#__PURE__*/React__default.createElement(TabPanel, {
|
|
23333
23333
|
value: activeTab,
|
|
@@ -23608,7 +23608,9 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
23608
23608
|
_ref$isDefaultOpen = _ref.isDefaultOpen,
|
|
23609
23609
|
isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen,
|
|
23610
23610
|
_ref$buttonIcon = _ref.buttonIcon,
|
|
23611
|
-
buttonIcon = _ref$buttonIcon === void 0 ? /*#__PURE__*/React$1.createElement(Options, null) : _ref$buttonIcon
|
|
23611
|
+
buttonIcon = _ref$buttonIcon === void 0 ? /*#__PURE__*/React$1.createElement(Options, null) : _ref$buttonIcon,
|
|
23612
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
23613
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
23612
23614
|
var _React$useState = React$1.useState(null),
|
|
23613
23615
|
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
23614
23616
|
anchorEl = _React$useState2[0],
|
|
@@ -23640,7 +23642,8 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
23640
23642
|
onClick: handleClick,
|
|
23641
23643
|
"data-testid": buttonTestId,
|
|
23642
23644
|
variant: variant,
|
|
23643
|
-
id: buttonTestId
|
|
23645
|
+
id: buttonTestId,
|
|
23646
|
+
disabled: isDisabled
|
|
23644
23647
|
}, buttonIcon), /*#__PURE__*/React$1.createElement(Menu, {
|
|
23645
23648
|
anchorEl: anchorEl,
|
|
23646
23649
|
open: isOpen,
|
|
@@ -24979,6 +24982,42 @@ var SearchHighlight = function SearchHighlight(_ref) {
|
|
|
24979
24982
|
}));
|
|
24980
24983
|
};
|
|
24981
24984
|
|
|
24985
|
+
/* *
|
|
24986
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
24987
|
+
* you may not use this file except in compliance with the License.
|
|
24988
|
+
* You may obtain a copy of the License at
|
|
24989
|
+
*
|
|
24990
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24991
|
+
*
|
|
24992
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24993
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
24994
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24995
|
+
* See the License for the specific language governing permissions and
|
|
24996
|
+
* limitations under the License.
|
|
24997
|
+
*
|
|
24998
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
24999
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
25000
|
+
* */
|
|
25001
|
+
var styles = {
|
|
25002
|
+
label: {
|
|
25003
|
+
color: 'geowebColors.buttons.tertiary.default.color',
|
|
25004
|
+
opacity: 1,
|
|
25005
|
+
fontSize: '12px',
|
|
25006
|
+
fontWeight: 500
|
|
25007
|
+
}
|
|
25008
|
+
};
|
|
25009
|
+
var SwitchButton = function SwitchButton(props) {
|
|
25010
|
+
return /*#__PURE__*/React$1.createElement(CustomTooltip, {
|
|
25011
|
+
title: "Switch mode"
|
|
25012
|
+
}, /*#__PURE__*/React$1.createElement("span", null, /*#__PURE__*/React$1.createElement(FormLabel, {
|
|
25013
|
+
sx: styles.label
|
|
25014
|
+
}, "Viewer"), /*#__PURE__*/React$1.createElement(Switch, Object.assign({
|
|
25015
|
+
"data-testid": "switchMode"
|
|
25016
|
+
}, props)), /*#__PURE__*/React$1.createElement(FormLabel, {
|
|
25017
|
+
sx: styles.label
|
|
25018
|
+
}, "Editor")));
|
|
25019
|
+
};
|
|
25020
|
+
|
|
24982
25021
|
/* *
|
|
24983
25022
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
24984
25023
|
* you may not use this file except in compliance with the License.
|
|
@@ -27232,4 +27271,4 @@ var createToolkitMockStoreWithEggs = function createToolkitMockStoreWithEggs(sto
|
|
|
27232
27271
|
return store;
|
|
27233
27272
|
};
|
|
27234
27273
|
|
|
27235
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, ResizeComponent as Resizable, SearchHighlight, StatusTag, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
|
|
27274
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, ResizeComponent as Resizable, SearchHighlight, StatusTag, SwitchButton, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.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": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@mui/material": "5.12.0",
|
|
16
|
-
"@opengeoweb/theme": "8.
|
|
16
|
+
"@opengeoweb/theme": "8.2.0",
|
|
17
17
|
"@redux-eggs/core": "2.2.0",
|
|
18
18
|
"@reduxjs/toolkit": "1.9.5",
|
|
19
19
|
"axios": "1.5.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SwitchButton } from './SwitchButton';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/material';
|
|
3
3
|
import { NumberSize } from 're-resizable';
|
|
4
|
-
import { DraggablePosition, Position, ResizableComponentProps, Size } from '../DraggableResizable/types';
|
|
5
|
-
import {
|
|
4
|
+
import { DraggableSize, DraggablePosition, Position, ResizableComponentProps, Size } from '../DraggableResizable/types';
|
|
5
|
+
import { HeaderSize } from './types';
|
|
6
6
|
export declare const calculateDialogSizeAndPosition: () => {
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
top: number;
|
|
10
10
|
left: number;
|
|
11
11
|
};
|
|
12
|
-
export declare const calculateStartSize: (minSize:
|
|
12
|
+
export declare const calculateStartSize: (minSize: DraggableSize, prefSize: DraggableSize, startPosition: Position) => DraggableSize;
|
|
13
13
|
interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'> {
|
|
14
14
|
startPosition?: Position;
|
|
15
15
|
onStartResize?: () => void;
|
|
@@ -18,12 +18,3 @@ export interface ToolContainerProps extends PaperProps, ToolHeaderProps {
|
|
|
18
18
|
maxHeight?: string | number;
|
|
19
19
|
headerClassName?: string;
|
|
20
20
|
}
|
|
21
|
-
export type DialogSize = {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
export type DialogPosition = {
|
|
26
|
-
top: number;
|
|
27
|
-
left?: number;
|
|
28
|
-
right?: number;
|
|
29
|
-
};
|