@opengeoweb/shared 9.36.0 → 10.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 +138 -189
- package/package.json +1 -1
- package/src/lib/components/DraggableResizable/Draggable.d.ts +1 -0
- package/src/lib/components/Filter/index.d.ts +0 -2
- package/src/lib/utils/dateUtils/dateUtils.d.ts +21 -0
- 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/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, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
|
|
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, DragHandle, 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';
|
|
@@ -10,7 +10,7 @@ import Draggable from 'react-draggable';
|
|
|
10
10
|
import { Resizable } from 're-resizable';
|
|
11
11
|
import * as Sentry from '@sentry/react';
|
|
12
12
|
import { useStore } from 'react-redux';
|
|
13
|
-
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, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
13
|
+
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
14
|
import { configureStore } from '@reduxjs/toolkit';
|
|
15
15
|
|
|
16
16
|
var en = {
|
|
@@ -66,6 +66,7 @@ var en = {
|
|
|
66
66
|
"shared-clear": "Clear",
|
|
67
67
|
"shared-light": "Light",
|
|
68
68
|
"shared-dark": "Dark",
|
|
69
|
+
"shared-xmas": "Christmas",
|
|
69
70
|
"shared-filter-all": "All",
|
|
70
71
|
"shared-filter-my-presets": "My presets",
|
|
71
72
|
"shared-filter-system-presets": "System presets",
|
|
@@ -125,6 +126,7 @@ var fi = {
|
|
|
125
126
|
"shared-clear": "Tyhjennä",
|
|
126
127
|
"shared-light": "Vaalea",
|
|
127
128
|
"shared-dark": "Tumma",
|
|
129
|
+
"shared-xmas": "Joulu",
|
|
128
130
|
"shared-filter-all": "Kaikki",
|
|
129
131
|
"shared-filter-my-presets": "Omat presetit",
|
|
130
132
|
"shared-filter-system-presets": "Järestelmä presetit",
|
|
@@ -184,6 +186,7 @@ var no = {
|
|
|
184
186
|
"shared-clear": "Tøm",
|
|
185
187
|
"shared-light": "Lys",
|
|
186
188
|
"shared-dark": "Mørk",
|
|
189
|
+
"shared-xmas": "Christmas",
|
|
187
190
|
"shared-filter-all": "Alle",
|
|
188
191
|
"shared-filter-my-presets": "Mine presets",
|
|
189
192
|
"shared-filter-system-presets": "System presets",
|
|
@@ -243,6 +246,7 @@ var nl = {
|
|
|
243
246
|
"shared-clear": "Wissen",
|
|
244
247
|
"shared-light": "Licht",
|
|
245
248
|
"shared-dark": "Donker",
|
|
249
|
+
"shared-xmas": "Kerstmis",
|
|
246
250
|
"shared-filter-all": "Alle",
|
|
247
251
|
"shared-filter-my-presets": "Mijn presets",
|
|
248
252
|
"shared-filter-system-presets": "Systeem presets",
|
|
@@ -1476,7 +1480,7 @@ var AppLayout = function AppLayout(_ref) {
|
|
|
1476
1480
|
};
|
|
1477
1481
|
|
|
1478
1482
|
var AppHeader = function AppHeader(_ref) {
|
|
1479
|
-
var _sx;
|
|
1483
|
+
var _sx, _theme$palette$geoweb;
|
|
1480
1484
|
var menu = _ref.menu,
|
|
1481
1485
|
userMenu = _ref.userMenu,
|
|
1482
1486
|
workspaceTopBar = _ref.workspaceTopBar,
|
|
@@ -1529,7 +1533,14 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
1529
1533
|
alignItems: 'center',
|
|
1530
1534
|
cursor: onClick ? 'pointer' : 'auto'
|
|
1531
1535
|
},
|
|
1532
|
-
children: [jsx(
|
|
1536
|
+
children: [(_theme$palette$geoweb = theme.palette.geowebColors.logo) != null && _theme$palette$geoweb.image ? jsx("img", {
|
|
1537
|
+
src: theme.palette.geowebColors.logo.image,
|
|
1538
|
+
alt: "GeoWeb",
|
|
1539
|
+
style: {
|
|
1540
|
+
height: '29px',
|
|
1541
|
+
width: '47px'
|
|
1542
|
+
}
|
|
1543
|
+
}) : jsx(GeoWebLogo, {
|
|
1533
1544
|
style: {
|
|
1534
1545
|
position: 'relative',
|
|
1535
1546
|
top: '-1px',
|
|
@@ -1615,19 +1626,29 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
1615
1626
|
});
|
|
1616
1627
|
};
|
|
1617
1628
|
|
|
1618
|
-
var _excluded$a = ["bounds", "children"];
|
|
1629
|
+
var _excluded$a = ["bounds", "setIsDragging", "children", "onStop"];
|
|
1619
1630
|
var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
1620
1631
|
var _ref$bounds = _ref.bounds,
|
|
1621
1632
|
bounds = _ref$bounds === void 0 ? 'body' : _ref$bounds,
|
|
1633
|
+
setIsDragging = _ref.setIsDragging,
|
|
1622
1634
|
children = _ref.children,
|
|
1635
|
+
onStop = _ref.onStop,
|
|
1623
1636
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
1624
1637
|
var onDragStart = function onDragStart(e) {
|
|
1625
1638
|
// This makes sure that nothing is selected during drag
|
|
1639
|
+
setIsDragging && setIsDragging(true);
|
|
1626
1640
|
e.preventDefault();
|
|
1627
1641
|
};
|
|
1642
|
+
var onDragStop = function onDragStop(event, pos) {
|
|
1643
|
+
setIsDragging && setIsDragging(false);
|
|
1644
|
+
onStop && onStop(event, pos);
|
|
1645
|
+
};
|
|
1628
1646
|
return jsx(Draggable, Object.assign({
|
|
1629
1647
|
bounds: bounds
|
|
1630
1648
|
}, props, {
|
|
1649
|
+
onStop: function onStop(event, pos) {
|
|
1650
|
+
return onDragStop(event, pos);
|
|
1651
|
+
},
|
|
1631
1652
|
enableUserSelectHack: false,
|
|
1632
1653
|
onStart: onDragStart,
|
|
1633
1654
|
children: children
|
|
@@ -1952,8 +1973,8 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
1952
1973
|
|
|
1953
1974
|
var MenuItemTheme = function MenuItemTheme() {
|
|
1954
1975
|
var _useThemeContext = useThemeContext(),
|
|
1955
|
-
|
|
1956
|
-
|
|
1976
|
+
namedTheme = _useThemeContext.namedTheme,
|
|
1977
|
+
setThemeName = _useThemeContext.setThemeName;
|
|
1957
1978
|
var _useTranslation = useTranslation(SHARED_NAMESPACE),
|
|
1958
1979
|
t = _useTranslation.t;
|
|
1959
1980
|
return jsx(MenuItem, {
|
|
@@ -1964,19 +1985,29 @@ var MenuItemTheme = function MenuItemTheme() {
|
|
|
1964
1985
|
children: t('shared-choose-app-mode')
|
|
1965
1986
|
}), jsx(Grid2, {
|
|
1966
1987
|
children: jsxs(RadioGroup, {
|
|
1967
|
-
onChange:
|
|
1988
|
+
onChange: function onChange(event, value) {
|
|
1989
|
+
if (value && setThemeName) {
|
|
1990
|
+
setThemeName(value);
|
|
1991
|
+
}
|
|
1992
|
+
},
|
|
1968
1993
|
children: [jsx(FormControlLabel, {
|
|
1969
|
-
value:
|
|
1994
|
+
value: ThemeTypes.LIGHT_THEME,
|
|
1970
1995
|
control: jsx(Radio, {
|
|
1971
|
-
checked:
|
|
1996
|
+
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.LIGHT_THEME
|
|
1972
1997
|
}),
|
|
1973
1998
|
label: t('shared-light')
|
|
1974
1999
|
}), jsx(FormControlLabel, {
|
|
1975
|
-
value:
|
|
2000
|
+
value: ThemeTypes.DARK_THEME,
|
|
1976
2001
|
control: jsx(Radio, {
|
|
1977
|
-
checked:
|
|
2002
|
+
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.DARK_THEME
|
|
1978
2003
|
}),
|
|
1979
2004
|
label: t('shared-dark')
|
|
2005
|
+
}), jsx(FormControlLabel, {
|
|
2006
|
+
value: ThemeTypes.XMAS2024_THEME,
|
|
2007
|
+
control: jsx(Radio, {
|
|
2008
|
+
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.XMAS2024_THEME
|
|
2009
|
+
}),
|
|
2010
|
+
label: t('shared-xmas') + " 2024"
|
|
1980
2011
|
})]
|
|
1981
2012
|
})
|
|
1982
2013
|
})]
|
|
@@ -2498,15 +2529,19 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
2498
2529
|
var _React$useState2 = React__default.useState(startSize),
|
|
2499
2530
|
size = _React$useState2[0],
|
|
2500
2531
|
setSize = _React$useState2[1];
|
|
2532
|
+
var _React$useState3 = React__default.useState(false),
|
|
2533
|
+
isDragging = _React$useState3[0],
|
|
2534
|
+
setIsDragging = _React$useState3[1];
|
|
2501
2535
|
var isRightAligned = startPosition && startPosition.right !== null && startPosition.right !== undefined;
|
|
2502
2536
|
var onStopDrag = React__default.useCallback(function (_event, position) {
|
|
2503
2537
|
setPosition(position);
|
|
2504
2538
|
onDragEnd(position, size);
|
|
2505
2539
|
}, [setPosition, onDragEnd, size]);
|
|
2506
|
-
var _React$
|
|
2507
|
-
initialMaxHeight = _React$
|
|
2508
|
-
setInitialMaxHeight = _React$
|
|
2540
|
+
var _React$useState4 = React__default.useState(defaultInitialMaxHeight),
|
|
2541
|
+
initialMaxHeight = _React$useState4[0],
|
|
2542
|
+
setInitialMaxHeight = _React$useState4[1];
|
|
2509
2543
|
var onStartResize = function onStartResize() {
|
|
2544
|
+
setIsDragging(true);
|
|
2510
2545
|
setInitialMaxHeight('initial');
|
|
2511
2546
|
};
|
|
2512
2547
|
var onResize = React__default.useCallback(function (_event, handle, node, delta) {
|
|
@@ -2523,6 +2558,7 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
2523
2558
|
parent.style.transform = "translate(" + newPos.x + "px, " + newPos.y + "px)";
|
|
2524
2559
|
}, [onChangeSize, position, isRightAligned]);
|
|
2525
2560
|
var onStopResize = function onStopResize(_event, direction, node, delta) {
|
|
2561
|
+
setIsDragging(false);
|
|
2526
2562
|
setPosition(calculateNewPosition(position, isRightAligned, direction, delta));
|
|
2527
2563
|
onResizeStop(_event, direction, node, delta);
|
|
2528
2564
|
};
|
|
@@ -2539,54 +2575,67 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
2539
2575
|
setSize(size);
|
|
2540
2576
|
}
|
|
2541
2577
|
});
|
|
2542
|
-
return isOpen ?
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
children: jsx(Box, {
|
|
2551
|
-
tabIndex: -1,
|
|
2552
|
-
sx: Object.assign({
|
|
2578
|
+
return isOpen ? jsxs(Fragment, {
|
|
2579
|
+
children: [isDragging && jsx(Box, {
|
|
2580
|
+
"data-testid": "dragging-overlay",
|
|
2581
|
+
sx: {
|
|
2582
|
+
top: 0,
|
|
2583
|
+
left: 0,
|
|
2584
|
+
right: 0,
|
|
2585
|
+
bottom: 0,
|
|
2553
2586
|
position: 'absolute',
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
children: jsx(
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2587
|
+
zIndex: 999
|
|
2588
|
+
}
|
|
2589
|
+
}), jsx(DraggableComponent$1, {
|
|
2590
|
+
nodeRef: nodeRef,
|
|
2591
|
+
bounds: bounds,
|
|
2592
|
+
cancel: cancel,
|
|
2593
|
+
position: position,
|
|
2594
|
+
onStop: onStopDrag,
|
|
2595
|
+
handle: "." + headerClassName,
|
|
2596
|
+
onMouseDown: onMouseDown,
|
|
2597
|
+
setIsDragging: setIsDragging,
|
|
2598
|
+
children: jsx(Box, {
|
|
2599
|
+
tabIndex: -1,
|
|
2600
|
+
sx: Object.assign({
|
|
2601
|
+
position: 'absolute',
|
|
2602
|
+
pointerEvents: 'all',
|
|
2603
|
+
zIndex: zIndex
|
|
2604
|
+
}, startPosition, sx, {
|
|
2605
|
+
'&:hover .resizableHandle': {
|
|
2606
|
+
display: 'inline'
|
|
2607
|
+
}
|
|
2608
|
+
}),
|
|
2609
|
+
ref: nodeRef,
|
|
2610
|
+
className: "toolContainerDraggable",
|
|
2611
|
+
role: "dialog",
|
|
2612
|
+
"aria-label": title,
|
|
2613
|
+
children: jsx(ResizeComponent, Object.assign({}, props, {
|
|
2614
|
+
size: size,
|
|
2615
|
+
setSize: setSize,
|
|
2616
|
+
onResizeStart: onStartResize,
|
|
2617
|
+
onResizeStop: onStopResize,
|
|
2618
|
+
onResize: onResize,
|
|
2619
|
+
nodeRef: nodeRef,
|
|
2620
|
+
children: jsx(ToolContainer, {
|
|
2621
|
+
maxHeight: initialMaxHeight,
|
|
2622
|
+
onClose: onClose,
|
|
2623
|
+
title: title,
|
|
2624
|
+
size: headerSize,
|
|
2625
|
+
isDraggable: true,
|
|
2626
|
+
isResizable: true,
|
|
2627
|
+
elevation: elevation,
|
|
2628
|
+
headerClassName: headerClassName,
|
|
2629
|
+
leftHeaderComponent: leftHeaderComponent,
|
|
2630
|
+
rightHeaderComponent: rightHeaderComponent,
|
|
2631
|
+
dragHandleIcon: dragHandleIcon,
|
|
2632
|
+
closeIcon: closeIcon,
|
|
2633
|
+
className: className,
|
|
2634
|
+
children: children
|
|
2635
|
+
})
|
|
2636
|
+
}))
|
|
2637
|
+
})
|
|
2638
|
+
})]
|
|
2590
2639
|
}) : null;
|
|
2591
2640
|
};
|
|
2592
2641
|
|
|
@@ -3462,7 +3511,7 @@ var CustomSlider = function CustomSlider(_ref) {
|
|
|
3462
3511
|
rest.forEach(function (element) {
|
|
3463
3512
|
return element.classList.remove('selectedLabel');
|
|
3464
3513
|
});
|
|
3465
|
-
}, [value, themeContext.
|
|
3514
|
+
}, [value, themeContext.namedTheme]);
|
|
3466
3515
|
// autofocus
|
|
3467
3516
|
React.useEffect(function () {
|
|
3468
3517
|
if (shouldAutoFocus && element.current) {
|
|
@@ -4752,130 +4801,6 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4752
4801
|
});
|
|
4753
4802
|
});
|
|
4754
4803
|
|
|
4755
|
-
var FilterLabel = function FilterLabel(_ref) {
|
|
4756
|
-
var name = _ref.name;
|
|
4757
|
-
return jsx(Typography, {
|
|
4758
|
-
variant: "body2",
|
|
4759
|
-
sx: {
|
|
4760
|
-
fontSize: '16px',
|
|
4761
|
-
textOverflow: 'ellipsis',
|
|
4762
|
-
whiteSpace: 'nowrap',
|
|
4763
|
-
overflow: 'hidden'
|
|
4764
|
-
},
|
|
4765
|
-
children: name
|
|
4766
|
-
});
|
|
4767
|
-
};
|
|
4768
|
-
var FilterListItem = function FilterListItem(_ref2) {
|
|
4769
|
-
var filter = _ref2.filter,
|
|
4770
|
-
_ref2$toggleFilter = _ref2.toggleFilter,
|
|
4771
|
-
toggleFilter = _ref2$toggleFilter === void 0 ? function () {} : _ref2$toggleFilter,
|
|
4772
|
-
_ref2$enableOnlyOneFi = _ref2.enableOnlyOneFilter,
|
|
4773
|
-
enableOnlyOneFilter = _ref2$enableOnlyOneFi === void 0 ? function () {} : _ref2$enableOnlyOneFi,
|
|
4774
|
-
children = _ref2.children;
|
|
4775
|
-
var _useSharedTranslation = useSharedTranslation(),
|
|
4776
|
-
t = _useSharedTranslation.t;
|
|
4777
|
-
var _React$useState = React.useState(false),
|
|
4778
|
-
isHovering = _React$useState[0],
|
|
4779
|
-
setIsHovering = _React$useState[1];
|
|
4780
|
-
var handleMouseEnter = React.useCallback(function () {
|
|
4781
|
-
setIsHovering(true);
|
|
4782
|
-
}, []);
|
|
4783
|
-
var handleMouseLeave = React.useCallback(function () {
|
|
4784
|
-
setIsHovering(false);
|
|
4785
|
-
}, []);
|
|
4786
|
-
var selectOnlyOne = function selectOnlyOne(filterId) {
|
|
4787
|
-
enableOnlyOneFilter(filterId);
|
|
4788
|
-
};
|
|
4789
|
-
var toggleCheckbox = function toggleCheckbox(filterId) {
|
|
4790
|
-
toggleFilter([filterId]);
|
|
4791
|
-
};
|
|
4792
|
-
var mouseMoveRef = React.useRef(null);
|
|
4793
|
-
React.useEffect(function () {
|
|
4794
|
-
window.addEventListener('mousemove', checkHover, true);
|
|
4795
|
-
return function () {
|
|
4796
|
-
window.removeEventListener('mousemove', checkHover, true);
|
|
4797
|
-
};
|
|
4798
|
-
});
|
|
4799
|
-
var checkHover = function checkHover(e) {
|
|
4800
|
-
if (mouseMoveRef.current) {
|
|
4801
|
-
var mouseOver = mouseMoveRef.current.contains(e.target);
|
|
4802
|
-
if (!isHovering && mouseOver) {
|
|
4803
|
-
handleMouseEnter();
|
|
4804
|
-
}
|
|
4805
|
-
if (isHovering && !mouseOver) {
|
|
4806
|
-
handleMouseLeave();
|
|
4807
|
-
}
|
|
4808
|
-
}
|
|
4809
|
-
};
|
|
4810
|
-
var name = filter.amountVisible ? filter.name + " (" + filter.amountVisible + ")" : filter.name;
|
|
4811
|
-
if (filter.amountVisible !== 0) {
|
|
4812
|
-
return jsx("div", {
|
|
4813
|
-
ref: mouseMoveRef,
|
|
4814
|
-
onMouseEnter: handleMouseEnter,
|
|
4815
|
-
onMouseLeave: handleMouseLeave,
|
|
4816
|
-
onFocus: handleMouseEnter,
|
|
4817
|
-
onBlur: handleMouseLeave,
|
|
4818
|
-
children: jsxs(ListItem, {
|
|
4819
|
-
sx: {
|
|
4820
|
-
width: '100%',
|
|
4821
|
-
minWidth: '300px',
|
|
4822
|
-
padding: '0px',
|
|
4823
|
-
paddingLeft: '0px',
|
|
4824
|
-
paddingRight: '50px',
|
|
4825
|
-
fontSize: '12px'
|
|
4826
|
-
},
|
|
4827
|
-
secondaryAction: jsx(CustomIconButton, {
|
|
4828
|
-
"aria-label": "Only " + filter.name,
|
|
4829
|
-
style: {
|
|
4830
|
-
backgroundColor: 'transparent',
|
|
4831
|
-
width: 'auto',
|
|
4832
|
-
display: isHovering ? 'block' : 'none'
|
|
4833
|
-
},
|
|
4834
|
-
edge: "end",
|
|
4835
|
-
onClick: function onClick() {
|
|
4836
|
-
selectOnlyOne(filter.id);
|
|
4837
|
-
},
|
|
4838
|
-
children: jsx(Typography, {
|
|
4839
|
-
sx: {
|
|
4840
|
-
color: 'geowebColors.buttons.primary.default.fill',
|
|
4841
|
-
fontSize: '14px',
|
|
4842
|
-
fontWeight: 500
|
|
4843
|
-
},
|
|
4844
|
-
children: t('shared-only')
|
|
4845
|
-
})
|
|
4846
|
-
}),
|
|
4847
|
-
children: [jsx(ListItemIcon, {
|
|
4848
|
-
sx: {
|
|
4849
|
-
minWidth: '42px'
|
|
4850
|
-
},
|
|
4851
|
-
children: jsx(Checkbox, {
|
|
4852
|
-
inputProps: {
|
|
4853
|
-
'aria-label': filter.name,
|
|
4854
|
-
checked: filter.checked
|
|
4855
|
-
},
|
|
4856
|
-
className: filter.checked ? 'is-checked' : '',
|
|
4857
|
-
color: "secondary",
|
|
4858
|
-
checked: filter.checked,
|
|
4859
|
-
onChange: function onChange() {
|
|
4860
|
-
toggleCheckbox(filter.id);
|
|
4861
|
-
},
|
|
4862
|
-
sx: {
|
|
4863
|
-
paddingTop: '6px',
|
|
4864
|
-
paddingBottom: '7px',
|
|
4865
|
-
'&&:hover': {
|
|
4866
|
-
backgroundColor: 'transparent'
|
|
4867
|
-
}
|
|
4868
|
-
}
|
|
4869
|
-
})
|
|
4870
|
-
}), children || jsx(FilterLabel, {
|
|
4871
|
-
name: name
|
|
4872
|
-
})]
|
|
4873
|
-
})
|
|
4874
|
-
});
|
|
4875
|
-
}
|
|
4876
|
-
return null;
|
|
4877
|
-
};
|
|
4878
|
-
|
|
4879
4804
|
var FilterOption = function FilterOption(_ref) {
|
|
4880
4805
|
var optionId = _ref.optionId,
|
|
4881
4806
|
checked = _ref.checked,
|
|
@@ -5710,6 +5635,29 @@ var convertNOWandTODAYFormatsToUTC = function convertNOWandTODAYFormatsToUTC(tim
|
|
|
5710
5635
|
}
|
|
5711
5636
|
throw new Error('Invalid endTime format');
|
|
5712
5637
|
};
|
|
5638
|
+
/**
|
|
5639
|
+
* @name setSeconds
|
|
5640
|
+
* @category Second Helpers
|
|
5641
|
+
* @summary Set the seconds to the given date.
|
|
5642
|
+
*
|
|
5643
|
+
* @description
|
|
5644
|
+
* Set the seconds to the given date.
|
|
5645
|
+
*
|
|
5646
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
5647
|
+
*
|
|
5648
|
+
* @param date - The date to be changed
|
|
5649
|
+
* @param seconds - The seconds of the new date
|
|
5650
|
+
*
|
|
5651
|
+
* @returns The new date with the seconds set
|
|
5652
|
+
*
|
|
5653
|
+
* @example
|
|
5654
|
+
* // Set 45 seconds to 1 September 2014 11:30:40:
|
|
5655
|
+
* const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
|
|
5656
|
+
* //=> Mon Sep 01 2014 11:30:45
|
|
5657
|
+
*/
|
|
5658
|
+
var setSeconds = function setSeconds(date, seconds) {
|
|
5659
|
+
return setSeconds$1(date, seconds);
|
|
5660
|
+
};
|
|
5713
5661
|
|
|
5714
5662
|
/* *
|
|
5715
5663
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -5772,6 +5720,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
5772
5720
|
parseISO: parseISO,
|
|
5773
5721
|
roundToNearestMinutes: roundToNearestMinutes,
|
|
5774
5722
|
set: set,
|
|
5723
|
+
setSeconds: setSeconds,
|
|
5775
5724
|
setUTCDate: setUTCDate,
|
|
5776
5725
|
startOfDay: startOfDay,
|
|
5777
5726
|
startOfDayUTC: startOfDayUTC,
|
|
@@ -5966,4 +5915,4 @@ var RenderCounter = /*#__PURE__*/function () {
|
|
|
5966
5915
|
}();
|
|
5967
5916
|
var renderCounter = new RenderCounter();
|
|
5968
5917
|
|
|
5969
|
-
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,
|
|
5918
|
+
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, createToolkitMockStoreWithEggs, 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, withEggs };
|
package/package.json
CHANGED
|
@@ -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';
|
|
@@ -334,6 +334,27 @@ export declare const convertNOWFormatToUTC: (timeValue: string) => string;
|
|
|
334
334
|
* @returns Time in UTC format
|
|
335
335
|
*/
|
|
336
336
|
export declare const convertNOWandTODAYFormatsToUTC: (timeValue: string) => string;
|
|
337
|
+
/**
|
|
338
|
+
* @name setSeconds
|
|
339
|
+
* @category Second Helpers
|
|
340
|
+
* @summary Set the seconds to the given date.
|
|
341
|
+
*
|
|
342
|
+
* @description
|
|
343
|
+
* Set the seconds to the given date.
|
|
344
|
+
*
|
|
345
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
346
|
+
*
|
|
347
|
+
* @param date - The date to be changed
|
|
348
|
+
* @param seconds - The seconds of the new date
|
|
349
|
+
*
|
|
350
|
+
* @returns The new date with the seconds set
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* // Set 45 seconds to 1 September 2014 11:30:40:
|
|
354
|
+
* const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
|
|
355
|
+
* //=> Mon Sep 01 2014 11:30:45
|
|
356
|
+
*/
|
|
357
|
+
export declare const setSeconds: (date: Date, seconds: number) => Date;
|
|
337
358
|
/**
|
|
338
359
|
* Compares two dates if values are the same
|
|
339
360
|
* @param {Date} date - first date
|
|
@@ -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
|
-
};
|