@opengeoweb/shared 19.6.0 → 19.6.1-nightly-20260912
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/dist/index.esm.js +366 -52
- package/dist/src/lib/components/DateTimePicker/DateTimePicker.d.ts +8 -0
- package/dist/src/lib/components/DateTimePicker/index.d.ts +1 -0
- package/dist/src/lib/components/NumberWithUnitField/NumberWithUnitField.d.ts +23 -0
- package/dist/src/lib/components/NumberWithUnitField/index.d.ts +1 -0
- package/dist/src/lib/components/index.d.ts +2 -0
- package/dist/src/lib/utils/index.d.ts +1 -0
- package/dist/src/lib/utils/numberInputUtils.d.ts +3 -0
- package/package.json +47 -46
package/dist/index.esm.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Typography, useTheme, Tooltip, IconButton, Menu, ListSubheader, MenuItem, Grid, ListItemText, ListItemIcon, FormControlLabel, Radio, DialogTitle, Button, Dialog, DialogContent, DialogActions, Paper, CircularProgress, Alert, AlertTitle, Drawer, Link, Avatar as Avatar$1, ClickAwayListener, MenuList, RadioGroup, Portal, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, Switch, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, ListItemButton, Checkbox } from '@mui/material';
|
|
2
|
+
import { Box, Typography, useTheme, Tooltip, IconButton, Menu, ListSubheader, MenuItem, Grid, ListItemText, ListItemIcon, FormControlLabel, Radio, DialogTitle, Button, Dialog, DialogContent, DialogActions, Paper, CircularProgress, Alert, AlertTitle, Drawer, Link, Avatar as Avatar$1, ClickAwayListener, MenuList, RadioGroup, Portal, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, Switch, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, ListItemButton, Checkbox, FormControl, InputLabel, FilledInput } from '@mui/material';
|
|
3
3
|
import 'i18next';
|
|
4
4
|
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
5
5
|
import React, { useRef, useEffect, useState, Component } from 'react';
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { Resizable } from 're-resizable';
|
|
8
|
-
import { Resize, BORDER_RADIUS, Options, ChevronUp, ChevronDown, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Search, Clear, Cached, Filter as Filter$1, Menu as Menu$1 } from '@opengeoweb/theme';
|
|
8
|
+
import { Resize, BORDER_RADIUS, Options, ChevronUp, ChevronDown, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Search, Clear, Cached, Filter as Filter$1, Menu as Menu$1, CalendarToday } from '@opengeoweb/theme';
|
|
9
9
|
import { throttle, isEqual, merge, escapeRegExp, debounce } from 'lodash';
|
|
10
10
|
import { add as add$1, startOfDay, addMinutes, addHours, format, differenceInDays as differenceInDays$1, differenceInHours as differenceInHours$1, differenceInMinutes as differenceInMinutes$1, differenceInMonths as differenceInMonths$1, differenceInSeconds as differenceInSeconds$1, differenceInYears as differenceInYears$1, fromUnixTime, getHours as getHours$1, isAfter as isAfter$1, isBefore as isBefore$1, isEqual as isEqual$1, isValid as isValid$1, parseISO, roundToNearestMinutes as roundToNearestMinutes$1, set as set$1, setSeconds as setSeconds$1, parse, sub as sub$1, getUnixTime, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
11
11
|
import { fi as fi$1, nl as nl$1, nb, enGB } from 'date-fns/locale';
|
|
12
|
+
import { DateTimePicker as DateTimePicker$1 } from '@mui/x-date-pickers';
|
|
13
|
+
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
14
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
12
15
|
|
|
13
16
|
var en = {
|
|
14
17
|
"shared-choose-app-mode": "Choose your default app mode",
|
|
@@ -462,7 +465,7 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
462
465
|
}
|
|
463
466
|
}
|
|
464
467
|
|
|
465
|
-
var _excluded$
|
|
468
|
+
var _excluded$f = ["content", "color", "icon", "sx"];
|
|
466
469
|
var bgColors = {
|
|
467
470
|
green: 'geowebColors.functional.successOutline.fill',
|
|
468
471
|
grey: 'geowebColors.functional.disabledOutline.fill',
|
|
@@ -503,7 +506,7 @@ var StatusTag = function StatusTag(_ref) {
|
|
|
503
506
|
color = _ref.color,
|
|
504
507
|
icon = _ref.icon,
|
|
505
508
|
sx = _ref.sx;
|
|
506
|
-
_objectWithoutPropertiesLoose(_ref, _excluded$
|
|
509
|
+
_objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
507
510
|
return jsxs(Box, {
|
|
508
511
|
className: "statusTag",
|
|
509
512
|
"data-testid": "statusTag",
|
|
@@ -577,14 +580,14 @@ var useSharedTranslation = function useSharedTranslation() {
|
|
|
577
580
|
return useTranslation([SHARED_NAMESPACE]);
|
|
578
581
|
};
|
|
579
582
|
|
|
580
|
-
var _excluded$
|
|
583
|
+
var _excluded$e = ["bounds", "setIsDragging", "children", "onStop"];
|
|
581
584
|
var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
582
585
|
var _ref$bounds = _ref.bounds,
|
|
583
586
|
bounds = _ref$bounds === void 0 ? 'body' : _ref$bounds,
|
|
584
587
|
setIsDragging = _ref.setIsDragging,
|
|
585
588
|
children = _ref.children,
|
|
586
589
|
onStop = _ref.onStop,
|
|
587
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
590
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
588
591
|
var onDragStart = function onDragStart(e) {
|
|
589
592
|
// This makes sure that nothing is selected during drag
|
|
590
593
|
setIsDragging == null || setIsDragging(true);
|
|
@@ -609,7 +612,7 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
|
609
612
|
}));
|
|
610
613
|
};
|
|
611
614
|
|
|
612
|
-
var _excluded$
|
|
615
|
+
var _excluded$d = ["children", "onResizeStart", "onResizeStop", "size", "setSize", "minHeight", "minWidth", "enable", "nodeRef"];
|
|
613
616
|
var isDraggingClassName = 'is-dragging';
|
|
614
617
|
var useBoundsProps = function useBoundsProps(nodeRef) {
|
|
615
618
|
var _React$useState = React.useState({}),
|
|
@@ -652,7 +655,7 @@ var ResizeComponent = function ResizeComponent(_ref) {
|
|
|
652
655
|
topLeft: true
|
|
653
656
|
} : _ref$enable,
|
|
654
657
|
nodeRef = _ref.nodeRef,
|
|
655
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
658
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
656
659
|
var theme = useTheme();
|
|
657
660
|
var onStartResize = React.useCallback(function (event, _direction, node) {
|
|
658
661
|
event.stopPropagation();
|
|
@@ -747,7 +750,7 @@ var CustomTooltip = function CustomTooltip(props) {
|
|
|
747
750
|
}));
|
|
748
751
|
};
|
|
749
752
|
|
|
750
|
-
var _excluded$
|
|
753
|
+
var _excluded$c = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps", "shouldShowExtraOptionsIndicator", "optionsActive"];
|
|
751
754
|
var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
752
755
|
var _defaultTooltipProps$;
|
|
753
756
|
var _ref$tooltipTitle = _ref.tooltipTitle,
|
|
@@ -767,7 +770,7 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
767
770
|
shouldShowExtraOptionsIndicator = _ref$shouldShowExtraO === void 0 ? false : _ref$shouldShowExtraO,
|
|
768
771
|
_ref$optionsActive = _ref.optionsActive,
|
|
769
772
|
optionsActive = _ref$optionsActive === void 0 ? false : _ref$optionsActive,
|
|
770
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
773
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
771
774
|
var classNames = [].concat(className ? [className] : [], isSelected ? ['Mui-selected'] : [], [variant]).join(' ');
|
|
772
775
|
var tooltipTitle = (_defaultTooltipProps$ = defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) != null ? _defaultTooltipProps$ : defaultTooltipTitle;
|
|
773
776
|
var tooltipProps = React.useMemo(function () {
|
|
@@ -1229,7 +1232,7 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
|
|
|
1229
1232
|
});
|
|
1230
1233
|
};
|
|
1231
1234
|
|
|
1232
|
-
var _excluded$
|
|
1235
|
+
var _excluded$b = ["defaultSize", "onResizeStop", "hasLayout", "minWidth"],
|
|
1233
1236
|
_excluded2$2 = ["title", "onClose", "description", "actions", "children", "sx", "resizableDefaultSize", "isResizable", "hasLayout", "shouldRenderInline", "slotProps", "disableRestoreFocus", "headerActions", "minWidth"];
|
|
1234
1237
|
var PaperComponent = function PaperComponent(_ref) {
|
|
1235
1238
|
var _ref$defaultSize = _ref.defaultSize,
|
|
@@ -1242,7 +1245,7 @@ var PaperComponent = function PaperComponent(_ref) {
|
|
|
1242
1245
|
hasLayout = _ref$hasLayout === void 0 ? true : _ref$hasLayout,
|
|
1243
1246
|
_ref$minWidth = _ref.minWidth,
|
|
1244
1247
|
minWidth = _ref$minWidth === void 0 ? 280 : _ref$minWidth,
|
|
1245
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1248
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
1246
1249
|
var maxWidth = '98%';
|
|
1247
1250
|
var maxHeight = '98%';
|
|
1248
1251
|
return jsx(ResizeComponent, Object.assign({
|
|
@@ -1467,7 +1470,7 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
|
|
|
1467
1470
|
});
|
|
1468
1471
|
};
|
|
1469
1472
|
|
|
1470
|
-
var _excluded$
|
|
1473
|
+
var _excluded$a = ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"],
|
|
1471
1474
|
_excluded2$1 = ["catchOnCancel"];
|
|
1472
1475
|
var ConfirmationDialog = function ConfirmationDialog(_ref) {
|
|
1473
1476
|
var open = _ref.open,
|
|
@@ -1483,7 +1486,7 @@ var ConfirmationDialog = function ConfirmationDialog(_ref) {
|
|
|
1483
1486
|
disableAutoFocus = _ref$disableAutoFocus === void 0 ? false : _ref$disableAutoFocus,
|
|
1484
1487
|
_ref$isLoading = _ref.isLoading,
|
|
1485
1488
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
1486
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1489
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
1487
1490
|
other.catchOnCancel;
|
|
1488
1491
|
var rest = _objectWithoutPropertiesLoose(other, _excluded2$1); // remove unwanted props
|
|
1489
1492
|
var _useSharedTranslation = useSharedTranslation(),
|
|
@@ -2407,7 +2410,7 @@ ErrorBoundary.defaultProps = {
|
|
|
2407
2410
|
onError: function onError() {}
|
|
2408
2411
|
};
|
|
2409
2412
|
|
|
2410
|
-
var styles$
|
|
2413
|
+
var styles$6 = {
|
|
2411
2414
|
small: {
|
|
2412
2415
|
height: 16,
|
|
2413
2416
|
width: 16,
|
|
@@ -2424,14 +2427,14 @@ var Avatar = function Avatar(_ref) {
|
|
|
2424
2427
|
var theme = useTheme();
|
|
2425
2428
|
return jsx(Avatar$1, {
|
|
2426
2429
|
"data-testid": "avatar",
|
|
2427
|
-
sx: Object.assign({}, styles$
|
|
2430
|
+
sx: Object.assign({}, styles$6[size], {
|
|
2428
2431
|
bgcolor: author ? theme.palette.geowebColors.buttons.icon.disabled.color : undefined
|
|
2429
2432
|
}),
|
|
2430
2433
|
children: children
|
|
2431
2434
|
});
|
|
2432
2435
|
};
|
|
2433
2436
|
|
|
2434
|
-
var styles$
|
|
2437
|
+
var styles$5 = {
|
|
2435
2438
|
container: {
|
|
2436
2439
|
position: 'absolute',
|
|
2437
2440
|
top: 38,
|
|
@@ -2501,7 +2504,7 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2501
2504
|
})
|
|
2502
2505
|
}), isOpen ? jsx(Paper, {
|
|
2503
2506
|
"data-testid": "userMenu",
|
|
2504
|
-
sx: styles$
|
|
2507
|
+
sx: styles$5.container,
|
|
2505
2508
|
children: jsx(ClickAwayListener, {
|
|
2506
2509
|
mouseEvent: "onMouseDown",
|
|
2507
2510
|
onClickAway: function onClickAway(event) {
|
|
@@ -2512,7 +2515,7 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2512
2515
|
onClose();
|
|
2513
2516
|
},
|
|
2514
2517
|
children: jsx(MenuList, {
|
|
2515
|
-
sx: styles$
|
|
2518
|
+
sx: styles$5.userMenu,
|
|
2516
2519
|
variant: "menu",
|
|
2517
2520
|
children: children
|
|
2518
2521
|
})
|
|
@@ -2756,8 +2759,8 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2756
2759
|
});
|
|
2757
2760
|
};
|
|
2758
2761
|
|
|
2759
|
-
var _excluded$
|
|
2760
|
-
var styles$
|
|
2762
|
+
var _excluded$9 = ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon"];
|
|
2763
|
+
var styles$4 = {
|
|
2761
2764
|
container: {
|
|
2762
2765
|
overflow: 'hidden',
|
|
2763
2766
|
borderRadius: 0,
|
|
@@ -2795,10 +2798,10 @@ var ToolContainer = function ToolContainer(_ref) {
|
|
|
2795
2798
|
rightHeaderComponent = _ref$rightHeaderCompo === void 0 ? null : _ref$rightHeaderCompo,
|
|
2796
2799
|
dragHandleIcon = _ref.dragHandleIcon,
|
|
2797
2800
|
closeIcon = _ref.closeIcon,
|
|
2798
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2801
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
2799
2802
|
return jsxs(Paper, Object.assign({
|
|
2800
2803
|
elevation: elevation,
|
|
2801
|
-
sx: styles$
|
|
2804
|
+
sx: styles$4.container
|
|
2802
2805
|
}, props, {
|
|
2803
2806
|
children: [jsx(ErrorBoundary, {
|
|
2804
2807
|
children: jsx(ToolHeader, {
|
|
@@ -2816,7 +2819,7 @@ var ToolContainer = function ToolContainer(_ref) {
|
|
|
2816
2819
|
style: {
|
|
2817
2820
|
maxHeight: maxHeight
|
|
2818
2821
|
},
|
|
2819
|
-
sx: styles$
|
|
2822
|
+
sx: styles$4.content,
|
|
2820
2823
|
children: children
|
|
2821
2824
|
}), isResizable ? jsx(ToolFooter, {}) : null]
|
|
2822
2825
|
}));
|
|
@@ -2968,7 +2971,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
|
|
|
2968
2971
|
}, [isOpen, getBoundsNode]);
|
|
2969
2972
|
};
|
|
2970
2973
|
|
|
2971
|
-
var _excluded$
|
|
2974
|
+
var _excluded$8 = ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "startDraggablePosition", "children", "isOpen", "onClose", "initialMaxHeight", "fixTopPosition", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon", "className", "sx", "resetPositionOnOpen"];
|
|
2972
2975
|
// calculate dialog size and position to 85% of screensize
|
|
2973
2976
|
var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
|
|
2974
2977
|
var width = window.innerWidth * 0.85;
|
|
@@ -3072,7 +3075,7 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3072
3075
|
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
3073
3076
|
_ref$resetPositionOnO = _ref.resetPositionOnOpen,
|
|
3074
3077
|
resetPositionOnOpen = _ref$resetPositionOnO === void 0 ? false : _ref$resetPositionOnO,
|
|
3075
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3078
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
3076
3079
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
3077
3080
|
var elevation = BASE_ELEVATION + order;
|
|
3078
3081
|
var nodeRef = React.useRef(null);
|
|
@@ -3229,7 +3232,7 @@ var segmentStyle = {
|
|
|
3229
3232
|
letterSpacing: 0.25,
|
|
3230
3233
|
justifyContent: 'center'
|
|
3231
3234
|
};
|
|
3232
|
-
var styles$
|
|
3235
|
+
var styles$3 = {
|
|
3233
3236
|
icon: Object.assign({}, segmentStyle, {
|
|
3234
3237
|
backgroundColor: 'geowebColors.textInputField.default.rgba',
|
|
3235
3238
|
width: 40,
|
|
@@ -3254,7 +3257,7 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
3254
3257
|
return jsx(Typography, {
|
|
3255
3258
|
component: "span",
|
|
3256
3259
|
"data-testid": "segment-divider",
|
|
3257
|
-
sx: styles$
|
|
3260
|
+
sx: styles$3.divider,
|
|
3258
3261
|
children: children
|
|
3259
3262
|
});
|
|
3260
3263
|
}
|
|
@@ -3262,7 +3265,7 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
3262
3265
|
return jsx(Typography, {
|
|
3263
3266
|
component: "span",
|
|
3264
3267
|
"data-testid": "segment-icon",
|
|
3265
|
-
sx: styles$
|
|
3268
|
+
sx: styles$3.icon,
|
|
3266
3269
|
children: children
|
|
3267
3270
|
});
|
|
3268
3271
|
}
|
|
@@ -3270,7 +3273,7 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
3270
3273
|
return jsx(Typography, {
|
|
3271
3274
|
component: "span",
|
|
3272
3275
|
"data-testid": "segment-connect",
|
|
3273
|
-
sx: styles$
|
|
3276
|
+
sx: styles$3.connect,
|
|
3274
3277
|
children: children
|
|
3275
3278
|
});
|
|
3276
3279
|
}
|
|
@@ -3724,7 +3727,7 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
3724
3727
|
children: value === index && children
|
|
3725
3728
|
});
|
|
3726
3729
|
};
|
|
3727
|
-
var styles$
|
|
3730
|
+
var styles$2 = {
|
|
3728
3731
|
container: {
|
|
3729
3732
|
margin: '0px 20px',
|
|
3730
3733
|
maxHeight: '90vh'
|
|
@@ -3741,17 +3744,17 @@ var CheatSheet = function CheatSheet() {
|
|
|
3741
3744
|
setActiveTab(newValue);
|
|
3742
3745
|
};
|
|
3743
3746
|
return jsxs(Box, {
|
|
3744
|
-
sx: styles$
|
|
3747
|
+
sx: styles$2.container,
|
|
3745
3748
|
children: [jsxs(Tabs, {
|
|
3746
3749
|
"aria-label": "platform",
|
|
3747
3750
|
onChange: onChangeTab,
|
|
3748
3751
|
value: activeTab,
|
|
3749
3752
|
children: [jsx(Tab, {
|
|
3750
3753
|
label: "Windows",
|
|
3751
|
-
sx: styles$
|
|
3754
|
+
sx: styles$2.tab
|
|
3752
3755
|
}), jsx(Tab, {
|
|
3753
3756
|
label: "Mac",
|
|
3754
|
-
sx: styles$
|
|
3757
|
+
sx: styles$2.tab
|
|
3755
3758
|
})]
|
|
3756
3759
|
}), jsx(TabPanel, {
|
|
3757
3760
|
index: 0,
|
|
@@ -3880,7 +3883,7 @@ var getInitials = function getInitials(name) {
|
|
|
3880
3883
|
}
|
|
3881
3884
|
};
|
|
3882
3885
|
|
|
3883
|
-
var _excluded$
|
|
3886
|
+
var _excluded$7 = ["value", "orientation", "shouldAutoFocus", "extraStyles"];
|
|
3884
3887
|
var sliderHeaderStyle = {
|
|
3885
3888
|
fontFamily: 'Roboto-Black, Roboto',
|
|
3886
3889
|
fontSize: 12,
|
|
@@ -3939,7 +3942,7 @@ var CustomSlider = function CustomSlider(_ref) {
|
|
|
3939
3942
|
shouldAutoFocus = _ref$shouldAutoFocus === void 0 ? false : _ref$shouldAutoFocus,
|
|
3940
3943
|
_ref$extraStyles = _ref.extraStyles,
|
|
3941
3944
|
extraStyles = _ref$extraStyles === void 0 ? {} : _ref$extraStyles,
|
|
3942
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3945
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
3943
3946
|
// Add custom class (for bold text) to label adjacent to thumb component.
|
|
3944
3947
|
// Material UI doesn't support highlighing only adjacent label
|
|
3945
3948
|
// when track is highlighted everywhere below selected value.
|
|
@@ -3986,7 +3989,7 @@ var CustomSlider = function CustomSlider(_ref) {
|
|
|
3986
3989
|
}, props));
|
|
3987
3990
|
};
|
|
3988
3991
|
|
|
3989
|
-
var _excluded$
|
|
3992
|
+
var _excluded$6 = ["variant", "className", "value"];
|
|
3990
3993
|
// This button is same as MUI ToggleButton but adds the variant prop
|
|
3991
3994
|
var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3992
3995
|
var _ref$variant = _ref.variant,
|
|
@@ -3994,7 +3997,7 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3994
3997
|
className = _ref.className,
|
|
3995
3998
|
_ref$value = _ref.value,
|
|
3996
3999
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
3997
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4000
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
3998
4001
|
return jsx(ToggleButton, Object.assign({
|
|
3999
4002
|
className: variant + " " + className,
|
|
4000
4003
|
ref: ref,
|
|
@@ -4002,7 +4005,7 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4002
4005
|
}, props));
|
|
4003
4006
|
});
|
|
4004
4007
|
|
|
4005
|
-
var _excluded$
|
|
4008
|
+
var _excluded$5 = ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "isEnabled", "hasBackgroundColor", "variant", "additionalStyling", "skipLocalStyling"],
|
|
4006
4009
|
_excluded2 = ["className", "additionalStyling", "MenuProps"];
|
|
4007
4010
|
var TooltipSelect = function TooltipSelect(_ref) {
|
|
4008
4011
|
var _ref$tooltip = _ref.tooltip,
|
|
@@ -4021,7 +4024,7 @@ var TooltipSelect = function TooltipSelect(_ref) {
|
|
|
4021
4024
|
additionalStyling = _ref$additionalStylin === void 0 ? {} : _ref$additionalStylin,
|
|
4022
4025
|
_ref$skipLocalStyling = _ref.skipLocalStyling,
|
|
4023
4026
|
skipLocalStyling = _ref$skipLocalStyling === void 0 ? false : _ref$skipLocalStyling,
|
|
4024
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4027
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
4025
4028
|
var _React$useState = React.useState(false),
|
|
4026
4029
|
selectOpen = _React$useState[0],
|
|
4027
4030
|
setSelectOpen = _React$useState[1];
|
|
@@ -4228,7 +4231,7 @@ var tooltipContainerStyles = function tooltipContainerStyles(theme, isEnabled, h
|
|
|
4228
4231
|
});
|
|
4229
4232
|
};
|
|
4230
4233
|
|
|
4231
|
-
var _excluded$
|
|
4234
|
+
var _excluded$4 = ["title", "title2", "defaultExpanded", "disableGutters", "expandedElevation", "collapsedElevation", "transitionDuration", "detailsSx", "CustomExpandIcon", "children", "amountOfItems"];
|
|
4232
4235
|
var CustomAccordion = function CustomAccordion(_ref) {
|
|
4233
4236
|
var title = _ref.title,
|
|
4234
4237
|
title2 = _ref.title2,
|
|
@@ -4246,7 +4249,7 @@ var CustomAccordion = function CustomAccordion(_ref) {
|
|
|
4246
4249
|
CustomExpandIcon = _ref.CustomExpandIcon,
|
|
4247
4250
|
children = _ref.children,
|
|
4248
4251
|
amountOfItems = _ref.amountOfItems,
|
|
4249
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4252
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
4250
4253
|
var _React$useState = React.useState(defaultExpanded),
|
|
4251
4254
|
expanded = _React$useState[0],
|
|
4252
4255
|
setExpanded = _React$useState[1];
|
|
@@ -4357,8 +4360,8 @@ var SearchHighlight = function SearchHighlight(_ref) {
|
|
|
4357
4360
|
});
|
|
4358
4361
|
};
|
|
4359
4362
|
|
|
4360
|
-
var _excluded$
|
|
4361
|
-
var styles = {
|
|
4363
|
+
var _excluded$3 = ["activeLabel", "inActiveLabel", "tooltip"];
|
|
4364
|
+
var styles$1 = {
|
|
4362
4365
|
label: {
|
|
4363
4366
|
color: 'geowebColors.buttons.tertiary.default.color',
|
|
4364
4367
|
opacity: 1,
|
|
@@ -4373,19 +4376,19 @@ var SwitchButton = function SwitchButton(_ref) {
|
|
|
4373
4376
|
inActiveLabel = _ref$inActiveLabel === void 0 ? 'Viewer' : _ref$inActiveLabel,
|
|
4374
4377
|
_ref$tooltip = _ref.tooltip,
|
|
4375
4378
|
tooltip = _ref$tooltip === void 0 ? 'Switch mode' : _ref$tooltip,
|
|
4376
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4379
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
4377
4380
|
return jsx(CustomTooltip, {
|
|
4378
4381
|
className: "switch-button",
|
|
4379
4382
|
title: tooltip,
|
|
4380
4383
|
children: jsxs("span", {
|
|
4381
4384
|
role: "button",
|
|
4382
4385
|
children: [jsx(FormLabel, {
|
|
4383
|
-
sx: styles.label,
|
|
4386
|
+
sx: styles$1.label,
|
|
4384
4387
|
children: inActiveLabel
|
|
4385
4388
|
}), jsx(Switch, Object.assign({
|
|
4386
4389
|
"data-testid": "switchMode"
|
|
4387
4390
|
}, props)), jsx(FormLabel, {
|
|
4388
|
-
sx: styles.label,
|
|
4391
|
+
sx: styles$1.label,
|
|
4389
4392
|
children: activeLabel
|
|
4390
4393
|
})]
|
|
4391
4394
|
})
|
|
@@ -5143,7 +5146,7 @@ var SearchField = function SearchField(_ref3) {
|
|
|
5143
5146
|
});
|
|
5144
5147
|
};
|
|
5145
5148
|
|
|
5146
|
-
var _excluded$
|
|
5149
|
+
var _excluded$2 = ["activeLabelFilterCount", "filters", "onClickFilterChip", "onSearch", "isAllSelected", "searchQuery", "showLabelFilterToggle", "isLabelFilterOpen", "onToggleLabelFilter", "showSearchField"];
|
|
5147
5150
|
var DEFAULT_FILTER_HEIGHT = 85;
|
|
5148
5151
|
var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
5149
5152
|
var _ref$activeLabelFilte = _ref.activeLabelFilterCount,
|
|
@@ -5161,7 +5164,7 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5161
5164
|
onToggleLabelFilter = _ref.onToggleLabelFilter,
|
|
5162
5165
|
_ref$showSearchField = _ref.showSearchField,
|
|
5163
5166
|
showSearchField = _ref$showSearchField === void 0 ? true : _ref$showSearchField,
|
|
5164
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5167
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
5165
5168
|
return jsx(Box, {
|
|
5166
5169
|
ref: ref,
|
|
5167
5170
|
sx: Object.assign({
|
|
@@ -5310,14 +5313,14 @@ var LegendToggleButton = function LegendToggleButton(_ref) {
|
|
|
5310
5313
|
});
|
|
5311
5314
|
};
|
|
5312
5315
|
|
|
5313
|
-
var _excluded = ["isDark", "children", "sx"];
|
|
5316
|
+
var _excluded$1 = ["isDark", "children", "sx"];
|
|
5314
5317
|
var StorybookDocsWrapper = function StorybookDocsWrapper(_ref) {
|
|
5315
5318
|
var _ref$isDark = _ref.isDark,
|
|
5316
5319
|
isDark = _ref$isDark === void 0 ? false : _ref$isDark,
|
|
5317
5320
|
children = _ref.children,
|
|
5318
5321
|
_ref$sx = _ref.sx,
|
|
5319
5322
|
sx = _ref$sx === void 0 ? [] : _ref$sx,
|
|
5320
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
5323
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
5321
5324
|
return jsx(Box, Object.assign({
|
|
5322
5325
|
sx: [].concat(isDark ? [{
|
|
5323
5326
|
backgroundColor: 'geowebColors.background.surfaceBrowser'
|
|
@@ -6611,6 +6614,317 @@ var isDialogFocused = function isDialogFocused() {
|
|
|
6611
6614
|
return Boolean((_document$activeEleme = document.activeElement) == null ? void 0 : _document$activeEleme.closest('[role="dialog"]'));
|
|
6612
6615
|
};
|
|
6613
6616
|
|
|
6617
|
+
/* *
|
|
6618
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6619
|
+
* you may not use this file except in compliance with the License.
|
|
6620
|
+
* You may obtain a copy of the License at
|
|
6621
|
+
*
|
|
6622
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6623
|
+
*
|
|
6624
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6625
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6626
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6627
|
+
* See the License for the specific language governing permissions and
|
|
6628
|
+
* limitations under the License.
|
|
6629
|
+
*
|
|
6630
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6631
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
6632
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
6633
|
+
* */
|
|
6634
|
+
var convertNumericInputValue = function convertNumericInputValue(value, inputMode) {
|
|
6635
|
+
if (value !== '' && !isNaN(parseFloat(value))) {
|
|
6636
|
+
return inputMode === 'numeric' ? parseInt(value, 10) : parseFloat(value);
|
|
6637
|
+
}
|
|
6638
|
+
return null;
|
|
6639
|
+
};
|
|
6640
|
+
var getAllowedKeys = function getAllowedKeys(inputMode) {
|
|
6641
|
+
if (inputMode === void 0) {
|
|
6642
|
+
inputMode = 'numeric';
|
|
6643
|
+
}
|
|
6644
|
+
var allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', 'Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Home', 'End', 'PageDown', 'PageUp', 'Delete'].concat(inputMode === 'decimal' ? ['.'] : []);
|
|
6645
|
+
return allowedKeys;
|
|
6646
|
+
};
|
|
6647
|
+
|
|
6648
|
+
var arrowKeySteps = {
|
|
6649
|
+
ArrowUp: 1,
|
|
6650
|
+
ArrowDown: -1
|
|
6651
|
+
};
|
|
6652
|
+
var integerKeys = getAllowedKeys('numeric');
|
|
6653
|
+
var CARET_WIDTH = '24px';
|
|
6654
|
+
var SIGN_WIDTH = '1ch';
|
|
6655
|
+
var transparentBackdrop = {
|
|
6656
|
+
slotProps: {
|
|
6657
|
+
backdrop: {
|
|
6658
|
+
sx: {
|
|
6659
|
+
backgroundColor: 'transparent'
|
|
6660
|
+
}
|
|
6661
|
+
}
|
|
6662
|
+
}
|
|
6663
|
+
};
|
|
6664
|
+
var countDigits = function countDigits(text) {
|
|
6665
|
+
return text.replace(/[^0-9]/g, '').length;
|
|
6666
|
+
};
|
|
6667
|
+
var styles = {
|
|
6668
|
+
field: {
|
|
6669
|
+
flexShrink: 0
|
|
6670
|
+
},
|
|
6671
|
+
/* Filled inputs only offset start adornments for the label, so match that offset here. */
|
|
6672
|
+
unit: {
|
|
6673
|
+
flexShrink: 0,
|
|
6674
|
+
marginTop: '16px'
|
|
6675
|
+
}
|
|
6676
|
+
};
|
|
6677
|
+
var isClipboardShortcut = function isClipboardShortcut(event) {
|
|
6678
|
+
var isMac = window.navigator.userAgent.includes(' Mac ');
|
|
6679
|
+
var hasModifier = isMac ? event.metaKey : event.ctrlKey;
|
|
6680
|
+
return hasModifier && ['c', 'v', 'x'].includes(event.key.toLowerCase());
|
|
6681
|
+
};
|
|
6682
|
+
var NumberWithUnitField = function NumberWithUnitField(_ref) {
|
|
6683
|
+
var label = _ref.label,
|
|
6684
|
+
value = _ref.value,
|
|
6685
|
+
unit = _ref.unit,
|
|
6686
|
+
unitOptions = _ref.unitOptions,
|
|
6687
|
+
_onChange = _ref.onChange,
|
|
6688
|
+
unitAriaLabel = _ref.unitAriaLabel,
|
|
6689
|
+
minValue = _ref.minValue,
|
|
6690
|
+
_ref$maxDigits = _ref.maxDigits,
|
|
6691
|
+
maxDigits = _ref$maxDigits === void 0 ? 5 : _ref$maxDigits,
|
|
6692
|
+
maxMagnitude = _ref.maxMagnitude,
|
|
6693
|
+
_ref$error = _ref.error,
|
|
6694
|
+
error = _ref$error === void 0 ? false : _ref$error,
|
|
6695
|
+
_ref$disabled = _ref.disabled,
|
|
6696
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
6697
|
+
var inputId = React.useId();
|
|
6698
|
+
var _React$useState = React.useState(String(value)),
|
|
6699
|
+
typedValue = _React$useState[0],
|
|
6700
|
+
setTypedValue = _React$useState[1];
|
|
6701
|
+
React.useEffect(function () {
|
|
6702
|
+
setTypedValue(String(value));
|
|
6703
|
+
}, [value]);
|
|
6704
|
+
var clampValue = function clampValue(newValue) {
|
|
6705
|
+
if (!Number.isFinite(newValue)) {
|
|
6706
|
+
return minValue != null ? minValue : 0;
|
|
6707
|
+
}
|
|
6708
|
+
var truncated = Math.trunc(newValue);
|
|
6709
|
+
return minValue === undefined ? truncated : Math.max(minValue, truncated);
|
|
6710
|
+
};
|
|
6711
|
+
var commitTypedValue = function commitTypedValue(newValue) {
|
|
6712
|
+
var allowedDigits = maxMagnitude === undefined ? maxDigits : Math.min(maxDigits, String(maxMagnitude).length);
|
|
6713
|
+
var parsed = convertNumericInputValue(newValue, 'numeric');
|
|
6714
|
+
if (countDigits(newValue) > allowedDigits || parsed !== null && maxMagnitude !== undefined && Math.abs(parsed) > maxMagnitude) {
|
|
6715
|
+
return;
|
|
6716
|
+
}
|
|
6717
|
+
setTypedValue(newValue);
|
|
6718
|
+
if (parsed === null) {
|
|
6719
|
+
return;
|
|
6720
|
+
}
|
|
6721
|
+
_onChange({
|
|
6722
|
+
value: clampValue(parsed),
|
|
6723
|
+
unit: unit
|
|
6724
|
+
});
|
|
6725
|
+
};
|
|
6726
|
+
/* Typed text can clamp onto the value already stored, which leaves no prop change to resync from. */
|
|
6727
|
+
var showStoredValue = function showStoredValue() {
|
|
6728
|
+
setTypedValue(String(value));
|
|
6729
|
+
};
|
|
6730
|
+
var stepValue = function stepValue(step) {
|
|
6731
|
+
var parsed = convertNumericInputValue(typedValue, 'numeric');
|
|
6732
|
+
commitTypedValue(String(clampValue((parsed != null ? parsed : value) + step)));
|
|
6733
|
+
};
|
|
6734
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
6735
|
+
var step = arrowKeySteps[event.key];
|
|
6736
|
+
if (step !== undefined) {
|
|
6737
|
+
event.preventDefault();
|
|
6738
|
+
event.stopPropagation();
|
|
6739
|
+
stepValue(step);
|
|
6740
|
+
return;
|
|
6741
|
+
}
|
|
6742
|
+
if (isClipboardShortcut(event)) {
|
|
6743
|
+
return;
|
|
6744
|
+
}
|
|
6745
|
+
var isRepeatedMinus = event.key === '-' && event.target.value.includes('-');
|
|
6746
|
+
if (!integerKeys.includes(event.key) || isRepeatedMinus) {
|
|
6747
|
+
event.preventDefault();
|
|
6748
|
+
}
|
|
6749
|
+
};
|
|
6750
|
+
var handlePaste = function handlePaste(event) {
|
|
6751
|
+
var input = event.target;
|
|
6752
|
+
var pasted = event.clipboardData.getData('text/plain');
|
|
6753
|
+
var before = input.value.slice(0, input.selectionStart);
|
|
6754
|
+
var after = input.value.slice(input.selectionEnd);
|
|
6755
|
+
if (!/^-?[0-9]+$/.exec(before + pasted + after)) {
|
|
6756
|
+
event.preventDefault();
|
|
6757
|
+
}
|
|
6758
|
+
};
|
|
6759
|
+
var longestUnitLabel = unitOptions.reduce(function (longest, option) {
|
|
6760
|
+
return Math.max(longest, option.label.length);
|
|
6761
|
+
}, 0);
|
|
6762
|
+
var inputWidth = "calc(" + maxDigits + "ch + " + SIGN_WIDTH + ")";
|
|
6763
|
+
/* Fixed so a longer unit grows the value box leftwards instead of widening the field. */
|
|
6764
|
+
var unitWidth = "calc(" + longestUnitLabel + "ch + " + CARET_WIDTH + ")";
|
|
6765
|
+
return jsxs(FormControl, {
|
|
6766
|
+
disabled: disabled,
|
|
6767
|
+
error: error,
|
|
6768
|
+
sx: styles.field,
|
|
6769
|
+
variant: "filled",
|
|
6770
|
+
children: [jsx(InputLabel, {
|
|
6771
|
+
htmlFor: inputId,
|
|
6772
|
+
shrink: true,
|
|
6773
|
+
variant: "filled",
|
|
6774
|
+
children: label
|
|
6775
|
+
}), jsx(FilledInput, {
|
|
6776
|
+
endAdornment: jsx(FormControl, {
|
|
6777
|
+
sx: styles.unit,
|
|
6778
|
+
variant: "standard",
|
|
6779
|
+
children: jsx(Select, {
|
|
6780
|
+
MenuProps: transparentBackdrop,
|
|
6781
|
+
disableUnderline: true,
|
|
6782
|
+
disabled: disabled,
|
|
6783
|
+
inputProps: {
|
|
6784
|
+
'aria-label': unitAriaLabel != null ? unitAriaLabel : label
|
|
6785
|
+
},
|
|
6786
|
+
onChange: function onChange(event) {
|
|
6787
|
+
return _onChange({
|
|
6788
|
+
value: value,
|
|
6789
|
+
unit: event.target.value
|
|
6790
|
+
});
|
|
6791
|
+
},
|
|
6792
|
+
/* Select escalates its own min-width rule by repeating its class, so only an inline style wins. */
|
|
6793
|
+
SelectDisplayProps: {
|
|
6794
|
+
style: {
|
|
6795
|
+
textAlign: 'right',
|
|
6796
|
+
width: unitWidth
|
|
6797
|
+
}
|
|
6798
|
+
},
|
|
6799
|
+
value: unit,
|
|
6800
|
+
variant: "standard",
|
|
6801
|
+
children: unitOptions.map(function (option) {
|
|
6802
|
+
return jsx(MenuItem, {
|
|
6803
|
+
value: option.value,
|
|
6804
|
+
children: option.label
|
|
6805
|
+
}, option.value);
|
|
6806
|
+
})
|
|
6807
|
+
})
|
|
6808
|
+
}),
|
|
6809
|
+
id: inputId,
|
|
6810
|
+
inputProps: {
|
|
6811
|
+
inputMode: 'numeric',
|
|
6812
|
+
style: {
|
|
6813
|
+
width: inputWidth
|
|
6814
|
+
}
|
|
6815
|
+
},
|
|
6816
|
+
onBlur: showStoredValue,
|
|
6817
|
+
onChange: function onChange(event) {
|
|
6818
|
+
return commitTypedValue(event.target.value);
|
|
6819
|
+
},
|
|
6820
|
+
onKeyDown: handleKeyDown,
|
|
6821
|
+
onPaste: handlePaste,
|
|
6822
|
+
value: typedValue
|
|
6823
|
+
})]
|
|
6824
|
+
});
|
|
6825
|
+
};
|
|
6826
|
+
|
|
6827
|
+
var _excluded = ["value", "defaultValue", "minDateTime", "maxDateTime", "onAccept", "onChange", "showUTCAdornment", "slots", "slotProps"];
|
|
6828
|
+
var utcToPickerDate = function utcToPickerDate(value) {
|
|
6829
|
+
return new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), 0,
|
|
6830
|
+
// seconds to zero
|
|
6831
|
+
0);
|
|
6832
|
+
};
|
|
6833
|
+
var pickerDateToUTC = function pickerDateToUTC(value) {
|
|
6834
|
+
return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), 0,
|
|
6835
|
+
// seconds to zero
|
|
6836
|
+
0));
|
|
6837
|
+
};
|
|
6838
|
+
var OpenPickerIcon = function OpenPickerIcon() {
|
|
6839
|
+
return jsx(CalendarToday, {});
|
|
6840
|
+
};
|
|
6841
|
+
var mergeFieldSlotProps = function mergeFieldSlotProps(slotProps) {
|
|
6842
|
+
return Object.assign({
|
|
6843
|
+
openPickerButtonPosition: 'start'
|
|
6844
|
+
}, slotProps);
|
|
6845
|
+
};
|
|
6846
|
+
var mergeOpenPickerButtonSlotProps = function mergeOpenPickerButtonSlotProps(slotProps) {
|
|
6847
|
+
return Object.assign({
|
|
6848
|
+
size: 'small',
|
|
6849
|
+
sx: {
|
|
6850
|
+
padding: 0
|
|
6851
|
+
}
|
|
6852
|
+
}, slotProps);
|
|
6853
|
+
};
|
|
6854
|
+
var mergeTextFieldSlotProps = function mergeTextFieldSlotProps(slotProps, showUTCAdornment) {
|
|
6855
|
+
var _slotProps$slotProps;
|
|
6856
|
+
return Object.assign({
|
|
6857
|
+
variant: 'filled'
|
|
6858
|
+
}, showUTCAdornment && {
|
|
6859
|
+
endAdornment: jsx(InputAdornment, {
|
|
6860
|
+
position: "end",
|
|
6861
|
+
sx: {
|
|
6862
|
+
paddingTop: '16px'
|
|
6863
|
+
},
|
|
6864
|
+
children: "UTC"
|
|
6865
|
+
})
|
|
6866
|
+
}, slotProps, {
|
|
6867
|
+
slotProps: Object.assign({}, slotProps == null ? void 0 : slotProps.slotProps, {
|
|
6868
|
+
input: Object.assign({}, slotProps == null || (_slotProps$slotProps = slotProps.slotProps) == null ? void 0 : _slotProps$slotProps.input)
|
|
6869
|
+
})
|
|
6870
|
+
});
|
|
6871
|
+
};
|
|
6872
|
+
var DateTimePicker = function DateTimePicker(_ref) {
|
|
6873
|
+
var value = _ref.value,
|
|
6874
|
+
defaultValue = _ref.defaultValue,
|
|
6875
|
+
minDateTime = _ref.minDateTime,
|
|
6876
|
+
maxDateTime = _ref.maxDateTime,
|
|
6877
|
+
onAccept = _ref.onAccept,
|
|
6878
|
+
onChange = _ref.onChange,
|
|
6879
|
+
_ref$showUTCAdornment = _ref.showUTCAdornment,
|
|
6880
|
+
showUTCAdornment = _ref$showUTCAdornment === void 0 ? true : _ref$showUTCAdornment,
|
|
6881
|
+
slots = _ref.slots,
|
|
6882
|
+
slotProps = _ref.slotProps,
|
|
6883
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
6884
|
+
var callerFieldSlotProps = slotProps == null ? void 0 : slotProps.field;
|
|
6885
|
+
var callerOpenPickerButtonSlotProps = slotProps == null ? void 0 : slotProps.openPickerButton;
|
|
6886
|
+
var callerTextFieldSlotProps = slotProps == null ? void 0 : slotProps.textField;
|
|
6887
|
+
var fieldSlotProps = typeof callerFieldSlotProps === 'function' ? function (ownerState) {
|
|
6888
|
+
return mergeFieldSlotProps(callerFieldSlotProps(ownerState));
|
|
6889
|
+
} : mergeFieldSlotProps(callerFieldSlotProps);
|
|
6890
|
+
var openPickerButtonSlotProps = typeof callerOpenPickerButtonSlotProps === 'function' ? function (ownerState) {
|
|
6891
|
+
return mergeOpenPickerButtonSlotProps(callerOpenPickerButtonSlotProps(ownerState));
|
|
6892
|
+
} : mergeOpenPickerButtonSlotProps(callerOpenPickerButtonSlotProps);
|
|
6893
|
+
var textFieldSlotProps = typeof callerTextFieldSlotProps === 'function' ? function (ownerState) {
|
|
6894
|
+
return mergeTextFieldSlotProps(callerTextFieldSlotProps(ownerState), showUTCAdornment);
|
|
6895
|
+
} : mergeTextFieldSlotProps(callerTextFieldSlotProps, showUTCAdornment);
|
|
6896
|
+
return jsx(LocalizationProvider, {
|
|
6897
|
+
dateAdapter: AdapterDateFns,
|
|
6898
|
+
children: jsx(DateTimePicker$1, Object.assign({
|
|
6899
|
+
ampm: false,
|
|
6900
|
+
desktopModeMediaQuery: "@media (min-width: 720px)",
|
|
6901
|
+
format: DATE_FORMAT_DATEPICKER,
|
|
6902
|
+
timeSteps: {
|
|
6903
|
+
minutes: 1
|
|
6904
|
+
}
|
|
6905
|
+
}, props, {
|
|
6906
|
+
defaultValue: defaultValue ? utcToPickerDate(defaultValue) : undefined,
|
|
6907
|
+
maxDateTime: maxDateTime ? utcToPickerDate(maxDateTime) : undefined,
|
|
6908
|
+
minDateTime: minDateTime ? utcToPickerDate(minDateTime) : undefined,
|
|
6909
|
+
onAccept: onAccept ? function (acceptedValue, context) {
|
|
6910
|
+
return onAccept(acceptedValue ? pickerDateToUTC(acceptedValue) : null, context);
|
|
6911
|
+
} : undefined,
|
|
6912
|
+
onChange: onChange ? function (changedValue, context) {
|
|
6913
|
+
return onChange(changedValue ? pickerDateToUTC(changedValue) : null, context);
|
|
6914
|
+
} : undefined,
|
|
6915
|
+
slotProps: Object.assign({}, slotProps, {
|
|
6916
|
+
field: fieldSlotProps,
|
|
6917
|
+
openPickerButton: openPickerButtonSlotProps,
|
|
6918
|
+
textField: textFieldSlotProps
|
|
6919
|
+
}),
|
|
6920
|
+
slots: Object.assign({
|
|
6921
|
+
openPickerIcon: OpenPickerIcon
|
|
6922
|
+
}, slots),
|
|
6923
|
+
value: value ? utcToPickerDate(value) : value
|
|
6924
|
+
}))
|
|
6925
|
+
});
|
|
6926
|
+
};
|
|
6927
|
+
|
|
6614
6928
|
/* *
|
|
6615
6929
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6616
6930
|
* you may not use this file except in compliance with the License.
|
|
@@ -6635,4 +6949,4 @@ var SystemScope = {
|
|
|
6635
6949
|
plugin: 'plugin'
|
|
6636
6950
|
};
|
|
6637
6951
|
|
|
6638
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, index$1 as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, isDialogFocused, isTargetInteractiveInput, linkifyText, loadAllTranslations, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
|
6952
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DateTimePicker, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, NumberWithUnitField, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, convertNumericInputValue, index$1 as dateUtils, defaultDelay, getAllowedKeys, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, isDialogFocused, isTargetInteractiveInput, linkifyText, loadAllTranslations, pickerDateToUTC, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation, utcToPickerDate };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DateTimePickerProps as MuiDateTimePickerProps } from '@mui/x-date-pickers';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const utcToPickerDate: (value: Date) => Date;
|
|
4
|
+
export declare const pickerDateToUTC: (value: Date) => Date;
|
|
5
|
+
export interface DateTimePickerProps extends MuiDateTimePickerProps {
|
|
6
|
+
showUTCAdornment?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const DateTimePicker: React.FC<DateTimePickerProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateTimePicker';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface NumberWithUnitOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface NumberWithUnitValue {
|
|
7
|
+
value: number;
|
|
8
|
+
unit: string;
|
|
9
|
+
}
|
|
10
|
+
export interface NumberWithUnitFieldProps {
|
|
11
|
+
label: string;
|
|
12
|
+
value: number;
|
|
13
|
+
unit: string;
|
|
14
|
+
unitOptions: NumberWithUnitOption[];
|
|
15
|
+
onChange: (value: NumberWithUnitValue) => void;
|
|
16
|
+
unitAriaLabel?: string;
|
|
17
|
+
minValue?: number;
|
|
18
|
+
maxDigits?: number;
|
|
19
|
+
maxMagnitude?: number;
|
|
20
|
+
error?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const NumberWithUnitField: React.FC<NumberWithUnitFieldProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NumberWithUnitField';
|
|
@@ -7,3 +7,4 @@ export { renderCounter } from './renderCounter';
|
|
|
7
7
|
export { SessionStorageKey, sessionStorageProvider } from './sessionStorage';
|
|
8
8
|
export type { SessionStorageProvider } from './sessionStorage';
|
|
9
9
|
export { isTargetInteractiveInput, isDialogFocused } from './keyboardUtils';
|
|
10
|
+
export * from './numberInputUtils';
|
package/package.json
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
2
|
+
"name": "@opengeoweb/shared",
|
|
3
|
+
"version": "19.6.1-nightly-20260912",
|
|
4
|
+
"description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.esm.js",
|
|
11
|
+
"module": "./dist/index.esm.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"@opengeoweb/source": "./src/index.ts",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"default": "./dist/index.esm.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@opengeoweb/theme": "19.6.1-nightly-20260912",
|
|
24
|
+
"react-draggable": "^4.4.6",
|
|
25
|
+
"re-resizable": "^6.9.11",
|
|
26
|
+
"lodash": "^4.18.1",
|
|
27
|
+
"axios": "^1.18.0",
|
|
28
|
+
"date-fns": "^4.1.0",
|
|
29
|
+
"react-i18next": "^15.1.1",
|
|
30
|
+
"i18next": "^25.0.1",
|
|
31
|
+
"@mui/material": "^9.0.1",
|
|
32
|
+
"@mui/x-date-pickers": "^9.3.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "19",
|
|
36
|
+
"@emotion/react": "*",
|
|
37
|
+
"@emotion/styled": "*"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"eslint-plugin-storybook": "10.3.3"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"!dist/package.json",
|
|
45
|
+
"README.md",
|
|
46
|
+
"package.json"
|
|
47
|
+
]
|
|
48
|
+
}
|