@opengeoweb/shared 19.5.1 → 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 +385 -75
- 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/ToolContainer/ToolContainerDraggable.d.ts +1 -0
- package/dist/src/lib/components/index.d.ts +2 -0
- package/dist/src/lib/types/types.d.ts +1 -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
|
}));
|
|
@@ -2857,20 +2860,13 @@ var getNewPositionSize = function getNewPositionSize(element, boundsNode, isRigh
|
|
|
2857
2860
|
if (isElementWider) {
|
|
2858
2861
|
newX = isRightAligned ? initialX : -initialX;
|
|
2859
2862
|
}
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
newY = -initialY;
|
|
2868
|
-
}
|
|
2869
|
-
// top aligned
|
|
2870
|
-
var newTop = newY + initialY + newHeight;
|
|
2871
|
-
if (newTop > parentBbox.height) {
|
|
2872
|
-
newY = parentBbox.height - newTop + position.y;
|
|
2873
|
-
}
|
|
2863
|
+
var shouldAlignToTop = !fixTopPosition && isElementLarger;
|
|
2864
|
+
if (shouldAlignToTop) {
|
|
2865
|
+
newY = -initialY;
|
|
2866
|
+
}
|
|
2867
|
+
var bottomOverflow = newY + initialY + newHeight - parentBbox.height;
|
|
2868
|
+
if (bottomOverflow > 0) {
|
|
2869
|
+
newY = position.y - bottomOverflow;
|
|
2874
2870
|
}
|
|
2875
2871
|
// right aligned
|
|
2876
2872
|
if (isRightAligned) {
|
|
@@ -2975,7 +2971,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
|
|
|
2975
2971
|
}, [isOpen, getBoundsNode]);
|
|
2976
2972
|
};
|
|
2977
2973
|
|
|
2978
|
-
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"];
|
|
2979
2975
|
// calculate dialog size and position to 85% of screensize
|
|
2980
2976
|
var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
|
|
2981
2977
|
var width = window.innerWidth * 0.85;
|
|
@@ -3026,7 +3022,7 @@ var calculateNewPosition = function calculateNewPosition(position, isRightAligne
|
|
|
3026
3022
|
var DraggableComponent = function DraggableComponent(_ref) {
|
|
3027
3023
|
var title = _ref.title,
|
|
3028
3024
|
_ref$bounds = _ref.bounds,
|
|
3029
|
-
bounds = _ref$bounds === void 0 ? '
|
|
3025
|
+
bounds = _ref$bounds === void 0 ? 'parent' : _ref$bounds,
|
|
3030
3026
|
_ref$cancel = _ref.cancel,
|
|
3031
3027
|
cancel = _ref$cancel === void 0 ? '.MuiButtonBase-root' : _ref$cancel,
|
|
3032
3028
|
_ref$headerSize = _ref.headerSize,
|
|
@@ -3079,7 +3075,7 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3079
3075
|
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
3080
3076
|
_ref$resetPositionOnO = _ref.resetPositionOnOpen,
|
|
3081
3077
|
resetPositionOnOpen = _ref$resetPositionOnO === void 0 ? false : _ref$resetPositionOnO,
|
|
3082
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3078
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
3083
3079
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
3084
3080
|
var elevation = BASE_ELEVATION + order;
|
|
3085
3081
|
var nodeRef = React.useRef(null);
|
|
@@ -3236,7 +3232,7 @@ var segmentStyle = {
|
|
|
3236
3232
|
letterSpacing: 0.25,
|
|
3237
3233
|
justifyContent: 'center'
|
|
3238
3234
|
};
|
|
3239
|
-
var styles$
|
|
3235
|
+
var styles$3 = {
|
|
3240
3236
|
icon: Object.assign({}, segmentStyle, {
|
|
3241
3237
|
backgroundColor: 'geowebColors.textInputField.default.rgba',
|
|
3242
3238
|
width: 40,
|
|
@@ -3261,7 +3257,7 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
3261
3257
|
return jsx(Typography, {
|
|
3262
3258
|
component: "span",
|
|
3263
3259
|
"data-testid": "segment-divider",
|
|
3264
|
-
sx: styles$
|
|
3260
|
+
sx: styles$3.divider,
|
|
3265
3261
|
children: children
|
|
3266
3262
|
});
|
|
3267
3263
|
}
|
|
@@ -3269,7 +3265,7 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
3269
3265
|
return jsx(Typography, {
|
|
3270
3266
|
component: "span",
|
|
3271
3267
|
"data-testid": "segment-icon",
|
|
3272
|
-
sx: styles$
|
|
3268
|
+
sx: styles$3.icon,
|
|
3273
3269
|
children: children
|
|
3274
3270
|
});
|
|
3275
3271
|
}
|
|
@@ -3277,7 +3273,7 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
3277
3273
|
return jsx(Typography, {
|
|
3278
3274
|
component: "span",
|
|
3279
3275
|
"data-testid": "segment-connect",
|
|
3280
|
-
sx: styles$
|
|
3276
|
+
sx: styles$3.connect,
|
|
3281
3277
|
children: children
|
|
3282
3278
|
});
|
|
3283
3279
|
}
|
|
@@ -3731,7 +3727,7 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
3731
3727
|
children: value === index && children
|
|
3732
3728
|
});
|
|
3733
3729
|
};
|
|
3734
|
-
var styles$
|
|
3730
|
+
var styles$2 = {
|
|
3735
3731
|
container: {
|
|
3736
3732
|
margin: '0px 20px',
|
|
3737
3733
|
maxHeight: '90vh'
|
|
@@ -3748,17 +3744,17 @@ var CheatSheet = function CheatSheet() {
|
|
|
3748
3744
|
setActiveTab(newValue);
|
|
3749
3745
|
};
|
|
3750
3746
|
return jsxs(Box, {
|
|
3751
|
-
sx: styles$
|
|
3747
|
+
sx: styles$2.container,
|
|
3752
3748
|
children: [jsxs(Tabs, {
|
|
3753
3749
|
"aria-label": "platform",
|
|
3754
3750
|
onChange: onChangeTab,
|
|
3755
3751
|
value: activeTab,
|
|
3756
3752
|
children: [jsx(Tab, {
|
|
3757
3753
|
label: "Windows",
|
|
3758
|
-
sx: styles$
|
|
3754
|
+
sx: styles$2.tab
|
|
3759
3755
|
}), jsx(Tab, {
|
|
3760
3756
|
label: "Mac",
|
|
3761
|
-
sx: styles$
|
|
3757
|
+
sx: styles$2.tab
|
|
3762
3758
|
})]
|
|
3763
3759
|
}), jsx(TabPanel, {
|
|
3764
3760
|
index: 0,
|
|
@@ -3887,7 +3883,7 @@ var getInitials = function getInitials(name) {
|
|
|
3887
3883
|
}
|
|
3888
3884
|
};
|
|
3889
3885
|
|
|
3890
|
-
var _excluded$
|
|
3886
|
+
var _excluded$7 = ["value", "orientation", "shouldAutoFocus", "extraStyles"];
|
|
3891
3887
|
var sliderHeaderStyle = {
|
|
3892
3888
|
fontFamily: 'Roboto-Black, Roboto',
|
|
3893
3889
|
fontSize: 12,
|
|
@@ -3946,7 +3942,7 @@ var CustomSlider = function CustomSlider(_ref) {
|
|
|
3946
3942
|
shouldAutoFocus = _ref$shouldAutoFocus === void 0 ? false : _ref$shouldAutoFocus,
|
|
3947
3943
|
_ref$extraStyles = _ref.extraStyles,
|
|
3948
3944
|
extraStyles = _ref$extraStyles === void 0 ? {} : _ref$extraStyles,
|
|
3949
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3945
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
3950
3946
|
// Add custom class (for bold text) to label adjacent to thumb component.
|
|
3951
3947
|
// Material UI doesn't support highlighing only adjacent label
|
|
3952
3948
|
// when track is highlighted everywhere below selected value.
|
|
@@ -3993,7 +3989,7 @@ var CustomSlider = function CustomSlider(_ref) {
|
|
|
3993
3989
|
}, props));
|
|
3994
3990
|
};
|
|
3995
3991
|
|
|
3996
|
-
var _excluded$
|
|
3992
|
+
var _excluded$6 = ["variant", "className", "value"];
|
|
3997
3993
|
// This button is same as MUI ToggleButton but adds the variant prop
|
|
3998
3994
|
var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3999
3995
|
var _ref$variant = _ref.variant,
|
|
@@ -4001,7 +3997,7 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4001
3997
|
className = _ref.className,
|
|
4002
3998
|
_ref$value = _ref.value,
|
|
4003
3999
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
4004
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4000
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
4005
4001
|
return jsx(ToggleButton, Object.assign({
|
|
4006
4002
|
className: variant + " " + className,
|
|
4007
4003
|
ref: ref,
|
|
@@ -4009,8 +4005,8 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4009
4005
|
}, props));
|
|
4010
4006
|
});
|
|
4011
4007
|
|
|
4012
|
-
var _excluded$
|
|
4013
|
-
_excluded2 = ["className", "additionalStyling"];
|
|
4008
|
+
var _excluded$5 = ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "isEnabled", "hasBackgroundColor", "variant", "additionalStyling", "skipLocalStyling"],
|
|
4009
|
+
_excluded2 = ["className", "additionalStyling", "MenuProps"];
|
|
4014
4010
|
var TooltipSelect = function TooltipSelect(_ref) {
|
|
4015
4011
|
var _ref$tooltip = _ref.tooltip,
|
|
4016
4012
|
tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip,
|
|
@@ -4028,7 +4024,7 @@ var TooltipSelect = function TooltipSelect(_ref) {
|
|
|
4028
4024
|
additionalStyling = _ref$additionalStylin === void 0 ? {} : _ref$additionalStylin,
|
|
4029
4025
|
_ref$skipLocalStyling = _ref.skipLocalStyling,
|
|
4030
4026
|
skipLocalStyling = _ref$skipLocalStyling === void 0 ? false : _ref$skipLocalStyling,
|
|
4031
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4027
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
4032
4028
|
var _React$useState = React.useState(false),
|
|
4033
4029
|
selectOpen = _React$useState[0],
|
|
4034
4030
|
setSelectOpen = _React$useState[1];
|
|
@@ -4112,15 +4108,17 @@ var BaseSelect = styled(Select, {
|
|
|
4112
4108
|
});
|
|
4113
4109
|
// Style the menu pop-over
|
|
4114
4110
|
var StyledSelect = styled(/*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
4111
|
+
var _MenuProps$slotProps;
|
|
4115
4112
|
var className = _ref3.className,
|
|
4116
4113
|
additionalStyling = _ref3.additionalStyling,
|
|
4114
|
+
MenuProps = _ref3.MenuProps,
|
|
4117
4115
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
4118
4116
|
return jsx(BaseSelect, Object.assign({}, props, {
|
|
4119
|
-
MenuProps: {
|
|
4120
|
-
classes: {
|
|
4117
|
+
MenuProps: Object.assign({}, MenuProps, {
|
|
4118
|
+
classes: Object.assign({}, MenuProps == null ? void 0 : MenuProps.classes, {
|
|
4121
4119
|
paper: className
|
|
4122
|
-
},
|
|
4123
|
-
slotProps: {
|
|
4120
|
+
}),
|
|
4121
|
+
slotProps: Object.assign({}, (_MenuProps$slotProps = MenuProps == null ? void 0 : MenuProps.slotProps) != null ? _MenuProps$slotProps : {}, {
|
|
4124
4122
|
root: {
|
|
4125
4123
|
slotProps: {
|
|
4126
4124
|
backdrop: {
|
|
@@ -4130,8 +4128,8 @@ var StyledSelect = styled(/*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
4130
4128
|
}
|
|
4131
4129
|
}
|
|
4132
4130
|
}
|
|
4133
|
-
}
|
|
4134
|
-
},
|
|
4131
|
+
})
|
|
4132
|
+
}),
|
|
4135
4133
|
ref: ref,
|
|
4136
4134
|
sx: additionalStyling
|
|
4137
4135
|
}));
|
|
@@ -4233,7 +4231,7 @@ var tooltipContainerStyles = function tooltipContainerStyles(theme, isEnabled, h
|
|
|
4233
4231
|
});
|
|
4234
4232
|
};
|
|
4235
4233
|
|
|
4236
|
-
var _excluded$
|
|
4234
|
+
var _excluded$4 = ["title", "title2", "defaultExpanded", "disableGutters", "expandedElevation", "collapsedElevation", "transitionDuration", "detailsSx", "CustomExpandIcon", "children", "amountOfItems"];
|
|
4237
4235
|
var CustomAccordion = function CustomAccordion(_ref) {
|
|
4238
4236
|
var title = _ref.title,
|
|
4239
4237
|
title2 = _ref.title2,
|
|
@@ -4251,7 +4249,7 @@ var CustomAccordion = function CustomAccordion(_ref) {
|
|
|
4251
4249
|
CustomExpandIcon = _ref.CustomExpandIcon,
|
|
4252
4250
|
children = _ref.children,
|
|
4253
4251
|
amountOfItems = _ref.amountOfItems,
|
|
4254
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4252
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
4255
4253
|
var _React$useState = React.useState(defaultExpanded),
|
|
4256
4254
|
expanded = _React$useState[0],
|
|
4257
4255
|
setExpanded = _React$useState[1];
|
|
@@ -4362,8 +4360,8 @@ var SearchHighlight = function SearchHighlight(_ref) {
|
|
|
4362
4360
|
});
|
|
4363
4361
|
};
|
|
4364
4362
|
|
|
4365
|
-
var _excluded$
|
|
4366
|
-
var styles = {
|
|
4363
|
+
var _excluded$3 = ["activeLabel", "inActiveLabel", "tooltip"];
|
|
4364
|
+
var styles$1 = {
|
|
4367
4365
|
label: {
|
|
4368
4366
|
color: 'geowebColors.buttons.tertiary.default.color',
|
|
4369
4367
|
opacity: 1,
|
|
@@ -4378,19 +4376,19 @@ var SwitchButton = function SwitchButton(_ref) {
|
|
|
4378
4376
|
inActiveLabel = _ref$inActiveLabel === void 0 ? 'Viewer' : _ref$inActiveLabel,
|
|
4379
4377
|
_ref$tooltip = _ref.tooltip,
|
|
4380
4378
|
tooltip = _ref$tooltip === void 0 ? 'Switch mode' : _ref$tooltip,
|
|
4381
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4379
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
4382
4380
|
return jsx(CustomTooltip, {
|
|
4383
4381
|
className: "switch-button",
|
|
4384
4382
|
title: tooltip,
|
|
4385
4383
|
children: jsxs("span", {
|
|
4386
4384
|
role: "button",
|
|
4387
4385
|
children: [jsx(FormLabel, {
|
|
4388
|
-
sx: styles.label,
|
|
4386
|
+
sx: styles$1.label,
|
|
4389
4387
|
children: inActiveLabel
|
|
4390
4388
|
}), jsx(Switch, Object.assign({
|
|
4391
4389
|
"data-testid": "switchMode"
|
|
4392
4390
|
}, props)), jsx(FormLabel, {
|
|
4393
|
-
sx: styles.label,
|
|
4391
|
+
sx: styles$1.label,
|
|
4394
4392
|
children: activeLabel
|
|
4395
4393
|
})]
|
|
4396
4394
|
})
|
|
@@ -4508,7 +4506,8 @@ var SearchField$1 = function SearchField(_ref) {
|
|
|
4508
4506
|
setUrlIsValid(isURL(localSearchString));
|
|
4509
4507
|
}, [localSearchString]);
|
|
4510
4508
|
var handleKeyDown = function handleKeyDown(event) {
|
|
4511
|
-
|
|
4509
|
+
event.stopPropagation();
|
|
4510
|
+
if (event.key === 'Enter' && event.target instanceof HTMLInputElement) {
|
|
4512
4511
|
event.preventDefault();
|
|
4513
4512
|
if (urlIsValid && onOpenServicePopup) {
|
|
4514
4513
|
onOpenServicePopup(localSearchString);
|
|
@@ -5147,7 +5146,7 @@ var SearchField = function SearchField(_ref3) {
|
|
|
5147
5146
|
});
|
|
5148
5147
|
};
|
|
5149
5148
|
|
|
5150
|
-
var _excluded$
|
|
5149
|
+
var _excluded$2 = ["activeLabelFilterCount", "filters", "onClickFilterChip", "onSearch", "isAllSelected", "searchQuery", "showLabelFilterToggle", "isLabelFilterOpen", "onToggleLabelFilter", "showSearchField"];
|
|
5151
5150
|
var DEFAULT_FILTER_HEIGHT = 85;
|
|
5152
5151
|
var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
5153
5152
|
var _ref$activeLabelFilte = _ref.activeLabelFilterCount,
|
|
@@ -5165,7 +5164,7 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5165
5164
|
onToggleLabelFilter = _ref.onToggleLabelFilter,
|
|
5166
5165
|
_ref$showSearchField = _ref.showSearchField,
|
|
5167
5166
|
showSearchField = _ref$showSearchField === void 0 ? true : _ref$showSearchField,
|
|
5168
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5167
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
5169
5168
|
return jsx(Box, {
|
|
5170
5169
|
ref: ref,
|
|
5171
5170
|
sx: Object.assign({
|
|
@@ -5314,14 +5313,14 @@ var LegendToggleButton = function LegendToggleButton(_ref) {
|
|
|
5314
5313
|
});
|
|
5315
5314
|
};
|
|
5316
5315
|
|
|
5317
|
-
var _excluded = ["isDark", "children", "sx"];
|
|
5316
|
+
var _excluded$1 = ["isDark", "children", "sx"];
|
|
5318
5317
|
var StorybookDocsWrapper = function StorybookDocsWrapper(_ref) {
|
|
5319
5318
|
var _ref$isDark = _ref.isDark,
|
|
5320
5319
|
isDark = _ref$isDark === void 0 ? false : _ref$isDark,
|
|
5321
5320
|
children = _ref.children,
|
|
5322
5321
|
_ref$sx = _ref.sx,
|
|
5323
5322
|
sx = _ref$sx === void 0 ? [] : _ref$sx,
|
|
5324
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
5323
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
5325
5324
|
return jsx(Box, Object.assign({
|
|
5326
5325
|
sx: [].concat(isDark ? [{
|
|
5327
5326
|
backgroundColor: 'geowebColors.background.surfaceBrowser'
|
|
@@ -6615,6 +6614,317 @@ var isDialogFocused = function isDialogFocused() {
|
|
|
6615
6614
|
return Boolean((_document$activeEleme = document.activeElement) == null ? void 0 : _document$activeEleme.closest('[role="dialog"]'));
|
|
6616
6615
|
};
|
|
6617
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
|
+
|
|
6618
6928
|
/* *
|
|
6619
6929
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6620
6930
|
* you may not use this file except in compliance with the License.
|
|
@@ -6639,4 +6949,4 @@ var SystemScope = {
|
|
|
6639
6949
|
plugin: 'plugin'
|
|
6640
6950
|
};
|
|
6641
6951
|
|
|
6642
|
-
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';
|
|
@@ -23,6 +23,7 @@ interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'
|
|
|
23
23
|
onChangeSize?: (size: Size) => void;
|
|
24
24
|
onDragEnd?: (position: DraggablePosition, size: Size) => void;
|
|
25
25
|
onMouseDown?: (event: MouseEvent) => void;
|
|
26
|
+
/** Defaults to the containing element. Pass 'body' to opt out. */
|
|
26
27
|
bounds?: 'parent' | string;
|
|
27
28
|
cancel?: string;
|
|
28
29
|
order?: number;
|
|
@@ -46,6 +46,7 @@ export interface ConfigType {
|
|
|
46
46
|
GW_HIDE_SIGMET_MENU?: boolean;
|
|
47
47
|
GW_HIDE_AIRMET_MENU?: boolean;
|
|
48
48
|
GW_FEATURE_WARNINGS_EVENT?: boolean;
|
|
49
|
+
GW_FEATURE_SILENT_LOGIN?: boolean;
|
|
49
50
|
GW_LANGUAGE?: string;
|
|
50
51
|
GW_EXTERNAL_APPLICATIONS_MENU_LINKS?: string;
|
|
51
52
|
GW_PLUGIN_BACKEND_URL?: string;
|
|
@@ -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
|
+
}
|