@opengeoweb/shared 9.37.0 → 10.1.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 +92 -242
- package/package.json +2 -4
- package/src/lib/components/DraggableResizable/Draggable.d.ts +1 -0
- package/src/lib/components/Filter/index.d.ts +0 -2
- package/src/lib/components/index.d.ts +0 -1
- package/src/lib/utils/reduxTestUtils/createMockStore.d.ts +2 -0
- package/src/lib/utils/reduxTestUtils/index.d.ts +1 -1
- package/src/lib/components/Filter/FilterListItem.d.ts +0 -17
- package/src/lib/components/Filter/FilterListItem.spec.d.ts +0 -1
- package/src/lib/components/Filter/FilterListItem.stories.d.ts +0 -13
- package/src/lib/components/WithEggs/WithEggs.d.ts +0 -9
- package/src/lib/components/WithEggs/WithEggs.spec.d.ts +0 -1
- package/src/lib/components/WithEggs/index.d.ts +0 -1
- package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.d.ts +0 -7
- package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.spec.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid2, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Switch, Slider, ToggleButton, Menu, ListSubheader, ListItemText, ListItemIcon, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, TextField, InputAdornment, Chip, Stack, debounce as debounce$1,
|
|
3
|
-
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, Admin, useThemeContext, ThemeTypes,
|
|
2
|
+
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid2, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Switch, Slider, ToggleButton, Menu, ListSubheader, ListItemText, ListItemIcon, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, ListItemButton, Checkbox } from '@mui/material';
|
|
3
|
+
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { useRef, Component, useState } from 'react';
|
|
6
6
|
import 'i18next';
|
|
@@ -9,7 +9,6 @@ import { throttle, escapeRegExp, debounce } from 'lodash';
|
|
|
9
9
|
import Draggable from 'react-draggable';
|
|
10
10
|
import { Resizable } from 're-resizable';
|
|
11
11
|
import * as Sentry from '@sentry/react';
|
|
12
|
-
import { useStore } from 'react-redux';
|
|
13
12
|
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$1, getHours as getHours$1, startOfDay, addMinutes, addHours, setSeconds as setSeconds$1, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
14
13
|
import { configureStore } from '@reduxjs/toolkit';
|
|
15
14
|
|
|
@@ -1626,19 +1625,29 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
1626
1625
|
});
|
|
1627
1626
|
};
|
|
1628
1627
|
|
|
1629
|
-
var _excluded$a = ["bounds", "children"];
|
|
1628
|
+
var _excluded$a = ["bounds", "setIsDragging", "children", "onStop"];
|
|
1630
1629
|
var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
1631
1630
|
var _ref$bounds = _ref.bounds,
|
|
1632
1631
|
bounds = _ref$bounds === void 0 ? 'body' : _ref$bounds,
|
|
1632
|
+
setIsDragging = _ref.setIsDragging,
|
|
1633
1633
|
children = _ref.children,
|
|
1634
|
+
onStop = _ref.onStop,
|
|
1634
1635
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
1635
1636
|
var onDragStart = function onDragStart(e) {
|
|
1636
1637
|
// This makes sure that nothing is selected during drag
|
|
1638
|
+
setIsDragging && setIsDragging(true);
|
|
1637
1639
|
e.preventDefault();
|
|
1638
1640
|
};
|
|
1641
|
+
var onDragStop = function onDragStop(event, pos) {
|
|
1642
|
+
setIsDragging && setIsDragging(false);
|
|
1643
|
+
onStop && onStop(event, pos);
|
|
1644
|
+
};
|
|
1639
1645
|
return jsx(Draggable, Object.assign({
|
|
1640
1646
|
bounds: bounds
|
|
1641
1647
|
}, props, {
|
|
1648
|
+
onStop: function onStop(event, pos) {
|
|
1649
|
+
return onDragStop(event, pos);
|
|
1650
|
+
},
|
|
1642
1651
|
enableUserSelectHack: false,
|
|
1643
1652
|
onStart: onDragStart,
|
|
1644
1653
|
children: children
|
|
@@ -2094,8 +2103,6 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2094
2103
|
leftHeaderComponent = _ref$leftHeaderCompon === void 0 ? null : _ref$leftHeaderCompon,
|
|
2095
2104
|
_ref$rightHeaderCompo = _ref.rightHeaderComponent,
|
|
2096
2105
|
rightHeaderComponent = _ref$rightHeaderCompo === void 0 ? null : _ref$rightHeaderCompo,
|
|
2097
|
-
_ref$dragHandleIcon = _ref.dragHandleIcon,
|
|
2098
|
-
dragHandleIcon = _ref$dragHandleIcon === void 0 ? jsx(DragHandle, {}) : _ref$dragHandleIcon,
|
|
2099
2106
|
_ref$closeIcon = _ref.closeIcon,
|
|
2100
2107
|
closeIcon = _ref$closeIcon === void 0 ? jsx(Close, {
|
|
2101
2108
|
"data-testid": "CloseIcon"
|
|
@@ -2125,35 +2132,24 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2125
2132
|
padding: styles.padding,
|
|
2126
2133
|
height: styles.height
|
|
2127
2134
|
},
|
|
2128
|
-
|
|
2135
|
+
justifyContent: "space-between",
|
|
2136
|
+
children: [jsx(Grid2, {
|
|
2129
2137
|
className: "header-left",
|
|
2130
2138
|
sx: {
|
|
2131
2139
|
paddingRight: 1
|
|
2132
2140
|
},
|
|
2133
|
-
size:
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
children: [isDraggable && size !== 'xxs' && !leftHeaderComponent && jsx(Grid2, {
|
|
2137
|
-
container: true,
|
|
2138
|
-
justifyContent: "flex-start",
|
|
2139
|
-
size: "grow",
|
|
2140
|
-
children: jsx(CustomIconButton, {
|
|
2141
|
-
"data-testid": "dragBtn",
|
|
2142
|
-
disableRipple: true,
|
|
2143
|
-
sx: {
|
|
2144
|
-
pointerEvents: 'none',
|
|
2145
|
-
'&.MuiIconButton-root': iconStyle
|
|
2146
|
-
},
|
|
2147
|
-
children: dragHandleIcon
|
|
2148
|
-
})
|
|
2149
|
-
}), leftHeaderComponent && leftHeaderComponent]
|
|
2150
|
-
}), jsxs(Grid2, {
|
|
2141
|
+
size: columnSizeLeft,
|
|
2142
|
+
children: leftHeaderComponent && leftHeaderComponent
|
|
2143
|
+
}), jsx(Grid2, {
|
|
2151
2144
|
className: "header-title",
|
|
2152
2145
|
size: title ? columnSizeTitle : 0,
|
|
2153
2146
|
container: true,
|
|
2154
2147
|
justifyContent: "center",
|
|
2155
2148
|
alignItems: "center",
|
|
2156
|
-
|
|
2149
|
+
sx: {
|
|
2150
|
+
minHeight: 12
|
|
2151
|
+
},
|
|
2152
|
+
children: title && jsx(Typography, {
|
|
2157
2153
|
variant: "h2",
|
|
2158
2154
|
noWrap: true,
|
|
2159
2155
|
sx: {
|
|
@@ -2165,19 +2161,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2165
2161
|
},
|
|
2166
2162
|
role: "heading",
|
|
2167
2163
|
children: title
|
|
2168
|
-
})
|
|
2169
|
-
"data-testid": "dragBtn-xxs",
|
|
2170
|
-
disableRipple: true,
|
|
2171
|
-
sx: {
|
|
2172
|
-
pointerEvents: 'none',
|
|
2173
|
-
right: -12,
|
|
2174
|
-
transform: 'rotate(90deg)',
|
|
2175
|
-
'&.MuiButtonBase-root.MuiIconButton-root': Object.assign({}, iconStyle, {
|
|
2176
|
-
height: 12
|
|
2177
|
-
})
|
|
2178
|
-
},
|
|
2179
|
-
children: dragHandleIcon
|
|
2180
|
-
})]
|
|
2164
|
+
})
|
|
2181
2165
|
}), jsxs(Grid2, {
|
|
2182
2166
|
className: "header-right",
|
|
2183
2167
|
container: true,
|
|
@@ -2519,15 +2503,19 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
2519
2503
|
var _React$useState2 = React__default.useState(startSize),
|
|
2520
2504
|
size = _React$useState2[0],
|
|
2521
2505
|
setSize = _React$useState2[1];
|
|
2506
|
+
var _React$useState3 = React__default.useState(false),
|
|
2507
|
+
isDragging = _React$useState3[0],
|
|
2508
|
+
setIsDragging = _React$useState3[1];
|
|
2522
2509
|
var isRightAligned = startPosition && startPosition.right !== null && startPosition.right !== undefined;
|
|
2523
2510
|
var onStopDrag = React__default.useCallback(function (_event, position) {
|
|
2524
2511
|
setPosition(position);
|
|
2525
2512
|
onDragEnd(position, size);
|
|
2526
2513
|
}, [setPosition, onDragEnd, size]);
|
|
2527
|
-
var _React$
|
|
2528
|
-
initialMaxHeight = _React$
|
|
2529
|
-
setInitialMaxHeight = _React$
|
|
2514
|
+
var _React$useState4 = React__default.useState(defaultInitialMaxHeight),
|
|
2515
|
+
initialMaxHeight = _React$useState4[0],
|
|
2516
|
+
setInitialMaxHeight = _React$useState4[1];
|
|
2530
2517
|
var onStartResize = function onStartResize() {
|
|
2518
|
+
setIsDragging(true);
|
|
2531
2519
|
setInitialMaxHeight('initial');
|
|
2532
2520
|
};
|
|
2533
2521
|
var onResize = React__default.useCallback(function (_event, handle, node, delta) {
|
|
@@ -2544,6 +2532,7 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
2544
2532
|
parent.style.transform = "translate(" + newPos.x + "px, " + newPos.y + "px)";
|
|
2545
2533
|
}, [onChangeSize, position, isRightAligned]);
|
|
2546
2534
|
var onStopResize = function onStopResize(_event, direction, node, delta) {
|
|
2535
|
+
setIsDragging(false);
|
|
2547
2536
|
setPosition(calculateNewPosition(position, isRightAligned, direction, delta));
|
|
2548
2537
|
onResizeStop(_event, direction, node, delta);
|
|
2549
2538
|
};
|
|
@@ -2560,54 +2549,67 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
2560
2549
|
setSize(size);
|
|
2561
2550
|
}
|
|
2562
2551
|
});
|
|
2563
|
-
return isOpen ?
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
children: jsx(Box, {
|
|
2572
|
-
tabIndex: -1,
|
|
2573
|
-
sx: Object.assign({
|
|
2552
|
+
return isOpen ? jsxs(Fragment, {
|
|
2553
|
+
children: [isDragging && jsx(Box, {
|
|
2554
|
+
"data-testid": "dragging-overlay",
|
|
2555
|
+
sx: {
|
|
2556
|
+
top: 0,
|
|
2557
|
+
left: 0,
|
|
2558
|
+
right: 0,
|
|
2559
|
+
bottom: 0,
|
|
2574
2560
|
position: 'absolute',
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
children: jsx(
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2561
|
+
zIndex: 999
|
|
2562
|
+
}
|
|
2563
|
+
}), jsx(DraggableComponent$1, {
|
|
2564
|
+
nodeRef: nodeRef,
|
|
2565
|
+
bounds: bounds,
|
|
2566
|
+
cancel: cancel,
|
|
2567
|
+
position: position,
|
|
2568
|
+
onStop: onStopDrag,
|
|
2569
|
+
handle: "." + headerClassName,
|
|
2570
|
+
onMouseDown: onMouseDown,
|
|
2571
|
+
setIsDragging: setIsDragging,
|
|
2572
|
+
children: jsx(Box, {
|
|
2573
|
+
tabIndex: -1,
|
|
2574
|
+
sx: Object.assign({
|
|
2575
|
+
position: 'absolute',
|
|
2576
|
+
pointerEvents: 'all',
|
|
2577
|
+
zIndex: zIndex
|
|
2578
|
+
}, startPosition, sx, {
|
|
2579
|
+
'&:hover .resizableHandle': {
|
|
2580
|
+
display: 'inline'
|
|
2581
|
+
}
|
|
2582
|
+
}),
|
|
2583
|
+
ref: nodeRef,
|
|
2584
|
+
className: "toolContainerDraggable",
|
|
2585
|
+
role: "dialog",
|
|
2586
|
+
"aria-label": title,
|
|
2587
|
+
children: jsx(ResizeComponent, Object.assign({}, props, {
|
|
2588
|
+
size: size,
|
|
2589
|
+
setSize: setSize,
|
|
2590
|
+
onResizeStart: onStartResize,
|
|
2591
|
+
onResizeStop: onStopResize,
|
|
2592
|
+
onResize: onResize,
|
|
2593
|
+
nodeRef: nodeRef,
|
|
2594
|
+
children: jsx(ToolContainer, {
|
|
2595
|
+
maxHeight: initialMaxHeight,
|
|
2596
|
+
onClose: onClose,
|
|
2597
|
+
title: title,
|
|
2598
|
+
size: headerSize,
|
|
2599
|
+
isDraggable: true,
|
|
2600
|
+
isResizable: true,
|
|
2601
|
+
elevation: elevation,
|
|
2602
|
+
headerClassName: headerClassName,
|
|
2603
|
+
leftHeaderComponent: leftHeaderComponent,
|
|
2604
|
+
rightHeaderComponent: rightHeaderComponent,
|
|
2605
|
+
dragHandleIcon: dragHandleIcon,
|
|
2606
|
+
closeIcon: closeIcon,
|
|
2607
|
+
className: className,
|
|
2608
|
+
children: children
|
|
2609
|
+
})
|
|
2610
|
+
}))
|
|
2611
|
+
})
|
|
2612
|
+
})]
|
|
2611
2613
|
}) : null;
|
|
2612
2614
|
};
|
|
2613
2615
|
|
|
@@ -3906,24 +3908,6 @@ var tooltipContainerStyles = function tooltipContainerStyles(theme, isEnabled, h
|
|
|
3906
3908
|
});
|
|
3907
3909
|
};
|
|
3908
3910
|
|
|
3909
|
-
function withEggs(eggs) {
|
|
3910
|
-
return function (Component) {
|
|
3911
|
-
var WithEggs = function WithEggs(props) {
|
|
3912
|
-
var store = useStore();
|
|
3913
|
-
var _React$useState = React.useState(function () {
|
|
3914
|
-
return store.addEggs(eggs);
|
|
3915
|
-
}),
|
|
3916
|
-
remover = _React$useState[0];
|
|
3917
|
-
React.useEffect(function () {
|
|
3918
|
-
return remover;
|
|
3919
|
-
}, [remover]);
|
|
3920
|
-
return jsx(Component, Object.assign({}, props));
|
|
3921
|
-
};
|
|
3922
|
-
WithEggs.displayName = "withEggs(" + (Component.displayName || Component.name || 'Component') + ")";
|
|
3923
|
-
return WithEggs;
|
|
3924
|
-
};
|
|
3925
|
-
}
|
|
3926
|
-
|
|
3927
3911
|
var _excluded$3 = ["title", "title2", "defaultExpanded", "disableGutters", "expandedElevation", "collapsedElevation", "transitionDuration", "detailsSx", "CustomExpandIcon", "children", "amountOfItems"];
|
|
3928
3912
|
var CustomAccordion = function CustomAccordion(_ref) {
|
|
3929
3913
|
var title = _ref.title,
|
|
@@ -4773,130 +4757,6 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4773
4757
|
});
|
|
4774
4758
|
});
|
|
4775
4759
|
|
|
4776
|
-
var FilterLabel = function FilterLabel(_ref) {
|
|
4777
|
-
var name = _ref.name;
|
|
4778
|
-
return jsx(Typography, {
|
|
4779
|
-
variant: "body2",
|
|
4780
|
-
sx: {
|
|
4781
|
-
fontSize: '16px',
|
|
4782
|
-
textOverflow: 'ellipsis',
|
|
4783
|
-
whiteSpace: 'nowrap',
|
|
4784
|
-
overflow: 'hidden'
|
|
4785
|
-
},
|
|
4786
|
-
children: name
|
|
4787
|
-
});
|
|
4788
|
-
};
|
|
4789
|
-
var FilterListItem = function FilterListItem(_ref2) {
|
|
4790
|
-
var filter = _ref2.filter,
|
|
4791
|
-
_ref2$toggleFilter = _ref2.toggleFilter,
|
|
4792
|
-
toggleFilter = _ref2$toggleFilter === void 0 ? function () {} : _ref2$toggleFilter,
|
|
4793
|
-
_ref2$enableOnlyOneFi = _ref2.enableOnlyOneFilter,
|
|
4794
|
-
enableOnlyOneFilter = _ref2$enableOnlyOneFi === void 0 ? function () {} : _ref2$enableOnlyOneFi,
|
|
4795
|
-
children = _ref2.children;
|
|
4796
|
-
var _useSharedTranslation = useSharedTranslation(),
|
|
4797
|
-
t = _useSharedTranslation.t;
|
|
4798
|
-
var _React$useState = React.useState(false),
|
|
4799
|
-
isHovering = _React$useState[0],
|
|
4800
|
-
setIsHovering = _React$useState[1];
|
|
4801
|
-
var handleMouseEnter = React.useCallback(function () {
|
|
4802
|
-
setIsHovering(true);
|
|
4803
|
-
}, []);
|
|
4804
|
-
var handleMouseLeave = React.useCallback(function () {
|
|
4805
|
-
setIsHovering(false);
|
|
4806
|
-
}, []);
|
|
4807
|
-
var selectOnlyOne = function selectOnlyOne(filterId) {
|
|
4808
|
-
enableOnlyOneFilter(filterId);
|
|
4809
|
-
};
|
|
4810
|
-
var toggleCheckbox = function toggleCheckbox(filterId) {
|
|
4811
|
-
toggleFilter([filterId]);
|
|
4812
|
-
};
|
|
4813
|
-
var mouseMoveRef = React.useRef(null);
|
|
4814
|
-
React.useEffect(function () {
|
|
4815
|
-
window.addEventListener('mousemove', checkHover, true);
|
|
4816
|
-
return function () {
|
|
4817
|
-
window.removeEventListener('mousemove', checkHover, true);
|
|
4818
|
-
};
|
|
4819
|
-
});
|
|
4820
|
-
var checkHover = function checkHover(e) {
|
|
4821
|
-
if (mouseMoveRef.current) {
|
|
4822
|
-
var mouseOver = mouseMoveRef.current.contains(e.target);
|
|
4823
|
-
if (!isHovering && mouseOver) {
|
|
4824
|
-
handleMouseEnter();
|
|
4825
|
-
}
|
|
4826
|
-
if (isHovering && !mouseOver) {
|
|
4827
|
-
handleMouseLeave();
|
|
4828
|
-
}
|
|
4829
|
-
}
|
|
4830
|
-
};
|
|
4831
|
-
var name = filter.amountVisible ? filter.name + " (" + filter.amountVisible + ")" : filter.name;
|
|
4832
|
-
if (filter.amountVisible !== 0) {
|
|
4833
|
-
return jsx("div", {
|
|
4834
|
-
ref: mouseMoveRef,
|
|
4835
|
-
onMouseEnter: handleMouseEnter,
|
|
4836
|
-
onMouseLeave: handleMouseLeave,
|
|
4837
|
-
onFocus: handleMouseEnter,
|
|
4838
|
-
onBlur: handleMouseLeave,
|
|
4839
|
-
children: jsxs(ListItem, {
|
|
4840
|
-
sx: {
|
|
4841
|
-
width: '100%',
|
|
4842
|
-
minWidth: '300px',
|
|
4843
|
-
padding: '0px',
|
|
4844
|
-
paddingLeft: '0px',
|
|
4845
|
-
paddingRight: '50px',
|
|
4846
|
-
fontSize: '12px'
|
|
4847
|
-
},
|
|
4848
|
-
secondaryAction: jsx(CustomIconButton, {
|
|
4849
|
-
"aria-label": "Only " + filter.name,
|
|
4850
|
-
style: {
|
|
4851
|
-
backgroundColor: 'transparent',
|
|
4852
|
-
width: 'auto',
|
|
4853
|
-
display: isHovering ? 'block' : 'none'
|
|
4854
|
-
},
|
|
4855
|
-
edge: "end",
|
|
4856
|
-
onClick: function onClick() {
|
|
4857
|
-
selectOnlyOne(filter.id);
|
|
4858
|
-
},
|
|
4859
|
-
children: jsx(Typography, {
|
|
4860
|
-
sx: {
|
|
4861
|
-
color: 'geowebColors.buttons.primary.default.fill',
|
|
4862
|
-
fontSize: '14px',
|
|
4863
|
-
fontWeight: 500
|
|
4864
|
-
},
|
|
4865
|
-
children: t('shared-only')
|
|
4866
|
-
})
|
|
4867
|
-
}),
|
|
4868
|
-
children: [jsx(ListItemIcon, {
|
|
4869
|
-
sx: {
|
|
4870
|
-
minWidth: '42px'
|
|
4871
|
-
},
|
|
4872
|
-
children: jsx(Checkbox, {
|
|
4873
|
-
inputProps: {
|
|
4874
|
-
'aria-label': filter.name,
|
|
4875
|
-
checked: filter.checked
|
|
4876
|
-
},
|
|
4877
|
-
className: filter.checked ? 'is-checked' : '',
|
|
4878
|
-
color: "secondary",
|
|
4879
|
-
checked: filter.checked,
|
|
4880
|
-
onChange: function onChange() {
|
|
4881
|
-
toggleCheckbox(filter.id);
|
|
4882
|
-
},
|
|
4883
|
-
sx: {
|
|
4884
|
-
paddingTop: '6px',
|
|
4885
|
-
paddingBottom: '7px',
|
|
4886
|
-
'&&:hover': {
|
|
4887
|
-
backgroundColor: 'transparent'
|
|
4888
|
-
}
|
|
4889
|
-
}
|
|
4890
|
-
})
|
|
4891
|
-
}), children || jsx(FilterLabel, {
|
|
4892
|
-
name: name
|
|
4893
|
-
})]
|
|
4894
|
-
})
|
|
4895
|
-
});
|
|
4896
|
-
}
|
|
4897
|
-
return null;
|
|
4898
|
-
};
|
|
4899
|
-
|
|
4900
4760
|
var FilterOption = function FilterOption(_ref) {
|
|
4901
4761
|
var optionId = _ref.optionId,
|
|
4902
4762
|
checked = _ref.checked,
|
|
@@ -5847,16 +5707,6 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
5847
5707
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5848
5708
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5849
5709
|
* */
|
|
5850
|
-
var createToolkitMockStoreWithEggs = function createToolkitMockStoreWithEggs(storeConfig) {
|
|
5851
|
-
var reducer = storeConfig.reducer,
|
|
5852
|
-
preloadedState = storeConfig.preloadedState;
|
|
5853
|
-
var store = configureStore(Object.assign({}, storeConfig, {
|
|
5854
|
-
reducer: reducer,
|
|
5855
|
-
preloadedState: preloadedState
|
|
5856
|
-
}));
|
|
5857
|
-
store.addEggs = typeof jest !== 'undefined' ? jest.fn() : function () {}; // mocking the dynamic module loader
|
|
5858
|
-
return store;
|
|
5859
|
-
};
|
|
5860
5710
|
var createToolkitMockStore = function createToolkitMockStore(storeConfig) {
|
|
5861
5711
|
var reducer = storeConfig.reducer,
|
|
5862
5712
|
preloadedState = storeConfig.preloadedState;
|
|
@@ -6011,4 +5861,4 @@ var RenderCounter = /*#__PURE__*/function () {
|
|
|
6011
5861
|
}();
|
|
6012
5862
|
var renderCounter = new RenderCounter();
|
|
6013
5863
|
|
|
6014
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip,
|
|
5864
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, StatusTag, StorybookDocsWrapper, SwitchButton, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, UserMenuItemSentryRecording, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createToolkitMockStore, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, pollingIntervalTimeout, renderCounter, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, useWheelStopPropagation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.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": {
|
|
@@ -12,10 +12,8 @@
|
|
|
12
12
|
"react-draggable": "^4.4.6",
|
|
13
13
|
"re-resizable": "^6.9.11",
|
|
14
14
|
"lodash": "^4.17.21",
|
|
15
|
-
"@redux-eggs/core": "^2.2.0",
|
|
16
|
-
"react-redux": "^8.1.3",
|
|
17
15
|
"axios": "^1.7.7",
|
|
18
|
-
"date-fns": "^
|
|
16
|
+
"date-fns": "^4.1.0",
|
|
19
17
|
"@reduxjs/toolkit": "^1.9.7",
|
|
20
18
|
"react-i18next": "^15.1.1",
|
|
21
19
|
"i18next": "^23.11.5",
|
|
@@ -10,6 +10,7 @@ export interface DraggableComponentProps {
|
|
|
10
10
|
onStop?: (event: DraggableEvent, pos: DraggablePosition) => void;
|
|
11
11
|
onMouseDown?: (event: MouseEvent) => void;
|
|
12
12
|
handle?: string;
|
|
13
|
+
setIsDragging?: (isDragging: boolean) => void;
|
|
13
14
|
}
|
|
14
15
|
declare const DraggableComponent: React.FC<DraggableComponentProps>;
|
|
15
16
|
export default DraggableComponent;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { default as Filter } from './Filter';
|
|
2
2
|
export { DEFAULT_FILTER_HEIGHT } from './Filter';
|
|
3
3
|
export type { ListFilter } from './FilterList';
|
|
4
|
-
export { FilterListItem, FilterLabel } from './FilterListItem';
|
|
5
|
-
export type { Filter as FilterListItemFilter, FilterListItemProps, } from './FilterListItem';
|
|
6
4
|
export { FilterOption } from './FilterOption';
|
|
7
5
|
export { default as FilterChip } from './FilterChip';
|
|
8
6
|
export type { FilterChipProps } from './FilterChip';
|
|
@@ -13,7 +13,6 @@ export * from './ToggleMenu';
|
|
|
13
13
|
export * from './AlertIcon';
|
|
14
14
|
export * from './TooltipSelect';
|
|
15
15
|
export * from './Avatar';
|
|
16
|
-
export * from './WithEggs';
|
|
17
16
|
export * from './CustomTooltip';
|
|
18
17
|
export * from './CustomAccordion';
|
|
19
18
|
export * from './CustomDialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './createMockStore';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface Filter {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
checked?: boolean;
|
|
6
|
-
amountVisible?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface FilterListItemProps {
|
|
9
|
-
filter: Filter;
|
|
10
|
-
toggleFilter?: (filterIds: string[]) => void;
|
|
11
|
-
enableOnlyOneFilter?: (filterId: string) => void;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
export declare const FilterLabel: React.FC<{
|
|
15
|
-
name: string;
|
|
16
|
-
}>;
|
|
17
|
-
export declare const FilterListItem: React.FC<FilterListItemProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const FilterListItemLight: {
|
|
7
|
-
(): React.ReactElement;
|
|
8
|
-
tags: string[];
|
|
9
|
-
};
|
|
10
|
-
export declare const FilterListItemDark: {
|
|
11
|
-
(): React.ReactElement;
|
|
12
|
-
tags: string[];
|
|
13
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Egg } from '@redux-eggs/core';
|
|
3
|
-
import { Theme } from '@mui/material';
|
|
4
|
-
interface WithEggsProps {
|
|
5
|
-
children: React.ReactElement;
|
|
6
|
-
theme?: Theme;
|
|
7
|
-
}
|
|
8
|
-
export declare function withEggs(eggs: Egg[]): (Component: React.FC<WithEggsProps>) => React.FC<WithEggsProps>;
|
|
9
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { withEggs } from './WithEggs';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ConfigureStoreOptions, ToolkitStore } from '@reduxjs/toolkit/dist/configureStore';
|
|
2
|
-
interface ToolkitStoreWithEggs extends ToolkitStore {
|
|
3
|
-
addEggs?: () => void;
|
|
4
|
-
}
|
|
5
|
-
export declare const createToolkitMockStoreWithEggs: (storeConfig: ConfigureStoreOptions) => ToolkitStoreWithEggs;
|
|
6
|
-
export declare const createToolkitMockStore: (storeConfig: ConfigureStoreOptions) => ToolkitStore;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|