@opengeoweb/shared 14.0.1 → 14.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +608 -494
- package/package.json +2 -2
- package/src/index.d.ts +1 -1
- package/src/lib/components/AlertBanner/AlertBanner.d.ts +2 -2
- package/src/lib/components/AlertBanner/AlertBanner.stories.d.ts +1 -1
- package/src/lib/components/AlertIcon/AlertIcon.d.ts +2 -2
- package/src/lib/components/AppHeader/AppHeader.stories.d.ts +1 -1
- package/src/lib/components/AppLayout/AppLayout.stories.d.ts +1 -1
- package/src/lib/components/Avatar/Avatar.d.ts +1 -1
- package/src/lib/components/CanvasComponent/CanvasComponent.stories.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationButtons.d.ts +2 -2
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +3 -3
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationService.d.ts +2 -2
- package/src/lib/components/CustomAccordion/CustomAccordion.d.ts +2 -2
- package/src/lib/components/CustomDialog/CustomDialog.d.ts +5 -5
- package/src/lib/components/CustomDialog/CustomDialog.stories.d.ts +1 -1
- package/src/lib/components/CustomDialog/CustomDialogHeader.d.ts +4 -4
- package/src/lib/components/CustomIconButton/CustomIconButton.d.ts +2 -2
- package/src/lib/components/CustomSlider/CustomSlider.d.ts +2 -2
- package/src/lib/components/CustomToggleButton/CustomToggleButton.d.ts +3 -3
- package/src/lib/components/CustomTooltip/CustomTooltip.d.ts +2 -2
- package/src/lib/components/DraggableResizable/Draggable.d.ts +2 -2
- package/src/lib/components/DraggableResizable/Resizable.d.ts +1 -1
- package/src/lib/components/DraggableResizable/index.d.ts +1 -1
- package/src/lib/components/DraggableResizable/types.d.ts +2 -2
- package/src/lib/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/src/lib/components/Filter/Filter.d.ts +3 -3
- package/src/lib/components/Filter/FilterChip.d.ts +2 -2
- package/src/lib/components/Filter/FilterList.d.ts +1 -1
- package/src/lib/components/Filter/FilterOption.d.ts +3 -2
- package/src/lib/components/Filter/SearchField.d.ts +1 -1
- package/src/lib/components/LastUpdateTime/LastUpdateTime.d.ts +1 -1
- package/src/lib/components/Providers/Providers.d.ts +1 -1
- package/src/lib/components/SearchField/SearchField.d.ts +1 -1
- package/src/lib/components/StatusTag/StatusTag.d.ts +2 -2
- package/src/lib/components/StatusTag/StatusTag.stories.d.ts +1 -1
- package/src/lib/components/Storybook/StorybookDocsWrapper.d.ts +1 -1
- package/src/lib/components/SwitchButton/SwitchButton.d.ts +2 -2
- package/src/lib/components/ToggleMenu/ToggleMenu.d.ts +3 -3
- package/src/lib/components/ToolContainer/ToolContainer.d.ts +1 -1
- package/src/lib/components/ToolContainer/ToolContainer.stories.d.ts +1 -1
- package/src/lib/components/ToolContainer/ToolContainerDraggable.d.ts +4 -4
- package/src/lib/components/ToolContainer/ToolHeader.d.ts +1 -1
- package/src/lib/components/ToolContainer/index.d.ts +1 -1
- package/src/lib/components/ToolContainer/types.d.ts +1 -1
- package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.d.ts +1 -1
- package/src/lib/components/TooltipSelect/TooltipSelect.d.ts +2 -2
- package/src/lib/hooks/index.d.ts +1 -0
- package/src/lib/hooks/useIsMounted/useIsMounted.d.ts +1 -1
- package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +1 -1
- package/src/lib/hooks/usePoller/usePoller.d.ts +1 -1
- package/src/lib/hooks/usePrevious/usePrevious.stories.d.ts +1 -1
- package/src/lib/hooks/useResizeObserver/useResizeObserver.d.ts +2 -0
- package/src/lib/hooks/useResizeObserver/useResizeObserver.spec.d.ts +1 -0
- package/src/lib/types/edr-coverage-types.d.ts +31 -6
- package/src/lib/types/index.d.ts +1 -1
- package/src/lib/types/types.d.ts +19 -1
- package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.d.ts +1 -1
- package/src/lib/utils/dateUtils/dateFormats.d.ts +1 -0
- package/src/lib/utils/dateUtils/dateUtils.d.ts +3 -2
- package/src/lib/utils/i18n.d.ts +1 -1
- package/src/lib/utils/index.d.ts +1 -1
- package/src/lib/utils/sessionStorage.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Box, Typography, useTheme, Tooltip, IconButton, Menu, ListSubheader, MenuItem, Grid, ListItemText, ListItemIcon, DialogTitle, Button, Dialog, DialogContent, DialogActions, Paper, CircularProgress, Alert, AlertTitle, Drawer, Link, Avatar as Avatar$1, ClickAwayListener, MenuList, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Switch, Slider, ToggleButton, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, ListItemButton, Checkbox } from '@mui/material';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import 'i18next';
|
|
4
|
+
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
5
|
+
import React, { useRef, useEffect, useState, Component } from 'react';
|
|
5
6
|
import Draggable from 'react-draggable';
|
|
6
7
|
import { Resizable } from 're-resizable';
|
|
7
8
|
import { Resize, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, KeyCommand, ArrowUp, ArrowDown, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
|
|
8
|
-
import 'i18next';
|
|
9
|
-
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
10
9
|
import { throttle, merge, escapeRegExp, debounce } from 'lodash';
|
|
11
|
-
import
|
|
10
|
+
import { addIntegration } from '@sentry/react';
|
|
12
11
|
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$1, getHours as getHours$1, startOfDay, addMinutes, addHours, setSeconds as setSeconds$1, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
13
12
|
import { fi as fi$1, nl as nl$1, nb, enGB } from 'date-fns/locale';
|
|
14
13
|
|
|
@@ -286,6 +285,11 @@ var sharedTranslations = {
|
|
|
286
285
|
function _OverloadYield(e, d) {
|
|
287
286
|
this.v = e, this.k = d;
|
|
288
287
|
}
|
|
288
|
+
function _arrayLikeToArray(r, a) {
|
|
289
|
+
(null == a || a > r.length) && (a = r.length);
|
|
290
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
291
|
+
return n;
|
|
292
|
+
}
|
|
289
293
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
290
294
|
try {
|
|
291
295
|
var i = n[a](c),
|
|
@@ -311,6 +315,23 @@ function _asyncToGenerator(n) {
|
|
|
311
315
|
});
|
|
312
316
|
};
|
|
313
317
|
}
|
|
318
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
319
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
320
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
321
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
322
|
+
t && (r = t);
|
|
323
|
+
var o = 0;
|
|
324
|
+
return function () {
|
|
325
|
+
return o >= r.length ? {
|
|
326
|
+
done: true
|
|
327
|
+
} : {
|
|
328
|
+
done: false,
|
|
329
|
+
value: r[o++]
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
334
|
+
}
|
|
314
335
|
function _inheritsLoose(t, o) {
|
|
315
336
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
316
337
|
}
|
|
@@ -503,6 +524,13 @@ function _setPrototypeOf(t, e) {
|
|
|
503
524
|
return t.__proto__ = e, t;
|
|
504
525
|
}, _setPrototypeOf(t, e);
|
|
505
526
|
}
|
|
527
|
+
function _unsupportedIterableToArray(r, a) {
|
|
528
|
+
if (r) {
|
|
529
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
530
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
531
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
506
534
|
function _regeneratorRuntime() {
|
|
507
535
|
|
|
508
536
|
var r = _regenerator(),
|
|
@@ -572,7 +600,7 @@ function _regeneratorRuntime() {
|
|
|
572
600
|
})();
|
|
573
601
|
}
|
|
574
602
|
|
|
575
|
-
var _excluded$e = ["content", "color", "icon"];
|
|
603
|
+
var _excluded$e = ["content", "color", "icon", "sx"];
|
|
576
604
|
var bgColors = {
|
|
577
605
|
green: 'geowebColors.functional.successOutline.fill',
|
|
578
606
|
grey: 'geowebColors.functional.disabledOutline.fill',
|
|
@@ -612,15 +640,16 @@ var StatusTag = function StatusTag(_ref) {
|
|
|
612
640
|
var content = _ref.content,
|
|
613
641
|
color = _ref.color,
|
|
614
642
|
icon = _ref.icon,
|
|
615
|
-
|
|
643
|
+
sx = _ref.sx;
|
|
644
|
+
_objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
616
645
|
return jsxs(Box, {
|
|
617
|
-
display: "flex",
|
|
618
646
|
alignItems: "center",
|
|
619
|
-
textAlign: "center",
|
|
620
|
-
"data-testid": "statusTag",
|
|
621
647
|
className: "statusTag",
|
|
648
|
+
"data-testid": "statusTag",
|
|
649
|
+
display: "flex",
|
|
622
650
|
position: "relative",
|
|
623
|
-
sx: Object.assign({}, tagStyle(color),
|
|
651
|
+
sx: Object.assign({}, tagStyle(color), Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx),
|
|
652
|
+
textAlign: "center",
|
|
624
653
|
children: [jsx(Box, {
|
|
625
654
|
sx: {
|
|
626
655
|
position: 'absolute',
|
|
@@ -637,6 +666,54 @@ var StatusTag = function StatusTag(_ref) {
|
|
|
637
666
|
});
|
|
638
667
|
};
|
|
639
668
|
|
|
669
|
+
/* *
|
|
670
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
671
|
+
* you may not use this file except in compliance with the License.
|
|
672
|
+
* You may obtain a copy of the License at
|
|
673
|
+
*
|
|
674
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
675
|
+
*
|
|
676
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
677
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
678
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
679
|
+
* See the License for the specific language governing permissions and
|
|
680
|
+
* limitations under the License.
|
|
681
|
+
*
|
|
682
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
683
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
684
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
685
|
+
* */
|
|
686
|
+
var SHARED_NAMESPACE = 'shared';
|
|
687
|
+
var geowebLanguages = ['en', 'fi', 'no', 'nl'];
|
|
688
|
+
var loadAllTranslations = function loadAllTranslations(i18nInstance, translationsToLoad) {
|
|
689
|
+
translationsToLoad.forEach(function (_ref) {
|
|
690
|
+
var ns = _ref.ns,
|
|
691
|
+
translations = _ref.translations;
|
|
692
|
+
geowebLanguages.forEach(function (lang) {
|
|
693
|
+
i18nInstance.addResourceBundle(lang, ns, translations[lang]);
|
|
694
|
+
});
|
|
695
|
+
});
|
|
696
|
+
};
|
|
697
|
+
var safelyInitI18nForTestsAndStories = function safelyInitI18nForTestsAndStories(i18nInstance, namespace, translationsToLoad, initLanguage) {
|
|
698
|
+
// This check ensures that we don't init the library many times.
|
|
699
|
+
// - in tests, the init is done globally, so this should not init
|
|
700
|
+
// - in stories, this function should init, but only once if called many times
|
|
701
|
+
if (!i18nInstance.isInitialized && !i18nInstance.isInitializing) {
|
|
702
|
+
void i18nInstance.use(initReactI18next).init({
|
|
703
|
+
lng: initLanguage != null ? initLanguage : 'en',
|
|
704
|
+
ns: namespace,
|
|
705
|
+
interpolation: {
|
|
706
|
+
escapeValue: false
|
|
707
|
+
},
|
|
708
|
+
resources: {}
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
loadAllTranslations(i18nInstance, translationsToLoad);
|
|
712
|
+
};
|
|
713
|
+
var useSharedTranslation = function useSharedTranslation() {
|
|
714
|
+
return useTranslation([SHARED_NAMESPACE]);
|
|
715
|
+
};
|
|
716
|
+
|
|
640
717
|
var _excluded$d = ["bounds", "setIsDragging", "children", "onStop"];
|
|
641
718
|
var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
642
719
|
var _ref$bounds = _ref.bounds,
|
|
@@ -647,21 +724,21 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
|
647
724
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
648
725
|
var onDragStart = function onDragStart(e) {
|
|
649
726
|
// This makes sure that nothing is selected during drag
|
|
650
|
-
setIsDragging
|
|
727
|
+
setIsDragging == null || setIsDragging(true);
|
|
651
728
|
e.preventDefault();
|
|
652
729
|
};
|
|
653
730
|
var onDragStop = function onDragStop(event, pos) {
|
|
654
|
-
setIsDragging
|
|
655
|
-
onStop
|
|
731
|
+
setIsDragging == null || setIsDragging(false);
|
|
732
|
+
onStop == null || onStop(event, pos);
|
|
656
733
|
};
|
|
657
734
|
return jsx(Draggable, Object.assign({
|
|
658
735
|
bounds: bounds
|
|
659
736
|
}, props, {
|
|
737
|
+
enableUserSelectHack: false,
|
|
738
|
+
onStart: onDragStart,
|
|
660
739
|
onStop: function onStop(event, pos) {
|
|
661
740
|
return onDragStop(event, pos);
|
|
662
741
|
},
|
|
663
|
-
enableUserSelectHack: false,
|
|
664
|
-
onStart: onDragStart,
|
|
665
742
|
children: children
|
|
666
743
|
}));
|
|
667
744
|
};
|
|
@@ -669,10 +746,10 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
|
669
746
|
var _excluded$c = ["children", "onResizeStart", "onResizeStop", "size", "setSize", "minHeight", "minWidth", "enable", "nodeRef"];
|
|
670
747
|
var isDraggingClassName = 'is-dragging';
|
|
671
748
|
var useBoundsProps = function useBoundsProps(nodeRef) {
|
|
672
|
-
var _React$useState =
|
|
749
|
+
var _React$useState = React.useState({}),
|
|
673
750
|
boundsProps = _React$useState[0],
|
|
674
751
|
setBoundsProps = _React$useState[1];
|
|
675
|
-
|
|
752
|
+
React.useEffect(function () {
|
|
676
753
|
if (nodeRef) {
|
|
677
754
|
var _nodeRef$current;
|
|
678
755
|
setBoundsProps({
|
|
@@ -711,7 +788,7 @@ var ResizeComponent = function ResizeComponent(_ref) {
|
|
|
711
788
|
nodeRef = _ref.nodeRef,
|
|
712
789
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
713
790
|
var theme = useTheme();
|
|
714
|
-
var onStartResize =
|
|
791
|
+
var onStartResize = React.useCallback(function (event, _direction, node) {
|
|
715
792
|
event.stopPropagation();
|
|
716
793
|
node.classList.add(isDraggingClassName);
|
|
717
794
|
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
@@ -726,7 +803,7 @@ var ResizeComponent = function ResizeComponent(_ref) {
|
|
|
726
803
|
node.style.height = height + "px";
|
|
727
804
|
onResizeStart();
|
|
728
805
|
}, [onResizeStart, setSize]);
|
|
729
|
-
var onStopResize =
|
|
806
|
+
var onStopResize = React.useCallback(function (event, direction, node, delta) {
|
|
730
807
|
node.classList.remove(isDraggingClassName);
|
|
731
808
|
if (!size) {
|
|
732
809
|
return;
|
|
@@ -743,31 +820,31 @@ var ResizeComponent = function ResizeComponent(_ref) {
|
|
|
743
820
|
return jsx(Resizable, Object.assign({
|
|
744
821
|
minHeight: minHeight,
|
|
745
822
|
minWidth: minWidth,
|
|
746
|
-
|
|
747
|
-
|
|
823
|
+
onResizeStop: onStopResize,
|
|
824
|
+
size: size
|
|
748
825
|
}, boundsProps, {
|
|
826
|
+
enable: enable,
|
|
749
827
|
handleComponent: {
|
|
750
828
|
bottomRight: jsx(Resize, {
|
|
829
|
+
className: "resizableHandle",
|
|
751
830
|
style: {
|
|
752
831
|
fill: "" + theme.palette.geowebColors.buttons.flat["default"].color
|
|
753
832
|
},
|
|
754
833
|
sx: {
|
|
755
834
|
display: 'none'
|
|
756
|
-
}
|
|
757
|
-
className: "resizableHandle"
|
|
835
|
+
}
|
|
758
836
|
}),
|
|
759
837
|
bottomLeft: jsx(Resize, {
|
|
838
|
+
className: "resizableHandle",
|
|
760
839
|
isRightAligned: true,
|
|
761
840
|
style: {
|
|
762
841
|
fill: "" + theme.palette.geowebColors.buttons.flat["default"].color
|
|
763
842
|
},
|
|
764
843
|
sx: {
|
|
765
844
|
display: 'none'
|
|
766
|
-
}
|
|
767
|
-
className: "resizableHandle"
|
|
845
|
+
}
|
|
768
846
|
})
|
|
769
847
|
},
|
|
770
|
-
enable: enable,
|
|
771
848
|
onResizeStart: onStartResize
|
|
772
849
|
}, props, {
|
|
773
850
|
children: children
|
|
@@ -783,7 +860,7 @@ var useControlledTooltip = function useControlledTooltip() {
|
|
|
783
860
|
delayedTooltip = _React$useState2[0],
|
|
784
861
|
setDelayedTooltip = _React$useState2[1];
|
|
785
862
|
React.useEffect(function () {
|
|
786
|
-
if (tooltipOpen
|
|
863
|
+
if (tooltipOpen) {
|
|
787
864
|
var timer = setTimeout(function () {
|
|
788
865
|
return setDelayedTooltip(true);
|
|
789
866
|
}, defaultDelay);
|
|
@@ -798,14 +875,15 @@ var useControlledTooltip = function useControlledTooltip() {
|
|
|
798
875
|
};
|
|
799
876
|
var CustomTooltip = function CustomTooltip(props) {
|
|
800
877
|
return jsx(Tooltip, Object.assign({}, props, {
|
|
878
|
+
disableInteractive: true,
|
|
801
879
|
enterDelay: defaultDelay,
|
|
802
|
-
enterNextDelay: defaultDelay
|
|
803
|
-
disableInteractive: true
|
|
880
|
+
enterNextDelay: defaultDelay
|
|
804
881
|
}));
|
|
805
882
|
};
|
|
806
883
|
|
|
807
884
|
var _excluded$b = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps"];
|
|
808
885
|
var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
886
|
+
var _defaultTooltipProps$;
|
|
809
887
|
var _ref$tooltipTitle = _ref.tooltipTitle,
|
|
810
888
|
defaultTooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
|
|
811
889
|
_ref$variant = _ref.variant,
|
|
@@ -821,11 +899,12 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
821
899
|
defaultTooltipProps = _ref.tooltipProps,
|
|
822
900
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
823
901
|
var classNames = [].concat(className ? [className] : [], isSelected ? ['Mui-selected'] : [], [variant]).join(' ');
|
|
824
|
-
var tooltipTitle = (defaultTooltipProps == null ? void 0 : defaultTooltipProps.title)
|
|
902
|
+
var tooltipTitle = (_defaultTooltipProps$ = defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) != null ? _defaultTooltipProps$ : defaultTooltipTitle;
|
|
825
903
|
var tooltipProps = React.useMemo(function () {
|
|
904
|
+
var _defaultTooltipProps$2;
|
|
826
905
|
return Object.assign({}, defaultTooltipProps, {
|
|
827
906
|
title: tooltipTitle,
|
|
828
|
-
placement: (defaultTooltipProps == null ? void 0 : defaultTooltipProps.placement)
|
|
907
|
+
placement: (_defaultTooltipProps$2 = defaultTooltipProps == null ? void 0 : defaultTooltipProps.placement) != null ? _defaultTooltipProps$2 : 'top',
|
|
829
908
|
sx: {
|
|
830
909
|
pointerEvents: 'none'
|
|
831
910
|
}
|
|
@@ -835,11 +914,11 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
835
914
|
return jsx(IconButton, Object.assign({
|
|
836
915
|
"aria-label": tooltipTitle
|
|
837
916
|
}, props, {
|
|
838
|
-
|
|
917
|
+
"aria-pressed": isSelected,
|
|
839
918
|
className: classNames,
|
|
840
919
|
ref: ref,
|
|
841
|
-
|
|
842
|
-
sx: Object.assign({}, props.sx, shouldShowAsDisabled && {
|
|
920
|
+
size: size,
|
|
921
|
+
sx: Object.assign({}, Array.isArray(props.sx) ? Object.assign.apply(Object, [{}].concat(props.sx)) : props.sx, shouldShowAsDisabled && {
|
|
843
922
|
'&.MuiIconButton-root': {
|
|
844
923
|
color: "geowebColors.iconButtons." + variant + ".disabled.color"
|
|
845
924
|
},
|
|
@@ -937,29 +1016,28 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
937
1016
|
}, [isDefaultOpen, buttonTestId]);
|
|
938
1017
|
return jsxs(Fragment, {
|
|
939
1018
|
children: [jsx(CustomIconButton, {
|
|
1019
|
+
"data-testid": buttonTestId,
|
|
1020
|
+
disabled: isDisabled,
|
|
1021
|
+
id: buttonTestId,
|
|
1022
|
+
isSelected: isOpen,
|
|
1023
|
+
onClick: handleClick,
|
|
1024
|
+
sx: buttonSx,
|
|
940
1025
|
tooltipProps: {
|
|
941
1026
|
placement: 'top',
|
|
942
1027
|
title: tooltipTitle
|
|
943
1028
|
},
|
|
944
|
-
isSelected: isOpen,
|
|
945
|
-
sx: buttonSx,
|
|
946
|
-
onClick: handleClick,
|
|
947
|
-
"data-testid": buttonTestId,
|
|
948
1029
|
variant: variant,
|
|
949
|
-
id: buttonTestId,
|
|
950
|
-
disabled: isDisabled,
|
|
951
1030
|
children: buttonIcon
|
|
952
1031
|
}), jsxs(Menu, {
|
|
953
1032
|
anchorEl: anchorEl,
|
|
954
|
-
|
|
1033
|
+
anchorOrigin: anchorOrigin,
|
|
955
1034
|
onClose: function onClose(event, reason) {
|
|
956
1035
|
if (reason === 'tabKeyDown') {
|
|
957
1036
|
return;
|
|
958
1037
|
}
|
|
959
1038
|
handleClose(event);
|
|
960
1039
|
},
|
|
961
|
-
|
|
962
|
-
transformOrigin: transformOrigin,
|
|
1040
|
+
open: isOpen,
|
|
963
1041
|
slotProps: {
|
|
964
1042
|
backdrop: {
|
|
965
1043
|
style: {
|
|
@@ -973,7 +1051,8 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
973
1051
|
}
|
|
974
1052
|
})
|
|
975
1053
|
},
|
|
976
|
-
|
|
1054
|
+
transformOrigin: transformOrigin,
|
|
1055
|
+
children: [menuTitle ? jsx(ListSubheader, {
|
|
977
1056
|
"data-testid": "toggleMenuTitle",
|
|
978
1057
|
children: jsx(Typography, {
|
|
979
1058
|
sx: {
|
|
@@ -981,28 +1060,28 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
981
1060
|
},
|
|
982
1061
|
children: menuTitle
|
|
983
1062
|
})
|
|
984
|
-
}), menuItems && menuItems.length ? menuItems.map(function (menuItem) {
|
|
1063
|
+
}) : null, menuItems != null && menuItems.length ? menuItems.map(function (menuItem) {
|
|
985
1064
|
var text = menuItem.text,
|
|
986
1065
|
icon = menuItem.icon,
|
|
987
1066
|
action = menuItem.action,
|
|
988
1067
|
isDisabled = menuItem.isDisabled;
|
|
989
1068
|
return jsx(MenuItem, {
|
|
1069
|
+
disabled: isDisabled,
|
|
990
1070
|
onClick: function onClick(event) {
|
|
991
1071
|
action(event);
|
|
992
1072
|
handleClose(event);
|
|
993
1073
|
},
|
|
994
|
-
disabled: isDisabled,
|
|
995
1074
|
selected: menuItem.isSelected,
|
|
996
1075
|
children: jsxs(Grid, {
|
|
997
1076
|
container: true,
|
|
998
|
-
spacing: 2,
|
|
999
1077
|
justifyContent: "space-between",
|
|
1000
1078
|
size: "grow",
|
|
1079
|
+
spacing: 2,
|
|
1001
1080
|
children: [jsx(Grid, {
|
|
1002
1081
|
children: jsx(ListItemText, {
|
|
1003
1082
|
children: text
|
|
1004
1083
|
})
|
|
1005
|
-
}), icon
|
|
1084
|
+
}), icon ? jsx(Grid, {
|
|
1006
1085
|
alignItems: "flex-end",
|
|
1007
1086
|
children: jsx(ListItemIcon, {
|
|
1008
1087
|
sx: {
|
|
@@ -1012,7 +1091,7 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
1012
1091
|
},
|
|
1013
1092
|
children: icon
|
|
1014
1093
|
})
|
|
1015
|
-
})]
|
|
1094
|
+
}) : null]
|
|
1016
1095
|
})
|
|
1017
1096
|
}, text);
|
|
1018
1097
|
}) : jsx("div", {}) // Needed to make the menu work without any menuItems
|
|
@@ -1021,57 +1100,11 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
1021
1100
|
});
|
|
1022
1101
|
};
|
|
1023
1102
|
|
|
1024
|
-
/* *
|
|
1025
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1026
|
-
* you may not use this file except in compliance with the License.
|
|
1027
|
-
* You may obtain a copy of the License at
|
|
1028
|
-
*
|
|
1029
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1030
|
-
*
|
|
1031
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1032
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1033
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1034
|
-
* See the License for the specific language governing permissions and
|
|
1035
|
-
* limitations under the License.
|
|
1036
|
-
*
|
|
1037
|
-
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1038
|
-
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
1039
|
-
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
1040
|
-
* */
|
|
1041
|
-
var SHARED_NAMESPACE = 'shared';
|
|
1042
|
-
var geowebLanguages = ['en', 'fi', 'no', 'nl'];
|
|
1043
|
-
var loadAllTranslations = function loadAllTranslations(i18nInstance, translationsToLoad) {
|
|
1044
|
-
translationsToLoad.forEach(function (_ref) {
|
|
1045
|
-
var ns = _ref.ns,
|
|
1046
|
-
translations = _ref.translations;
|
|
1047
|
-
geowebLanguages.forEach(function (lang) {
|
|
1048
|
-
i18nInstance.addResourceBundle(lang, ns, translations[lang]);
|
|
1049
|
-
});
|
|
1050
|
-
});
|
|
1051
|
-
};
|
|
1052
|
-
var safelyInitI18nForTestsAndStories = function safelyInitI18nForTestsAndStories(i18nInstance, namespace, translationsToLoad, initLanguage) {
|
|
1053
|
-
// This check ensures that we don't init the library many times.
|
|
1054
|
-
// - in tests, the init is done globally, so this should not init
|
|
1055
|
-
// - in stories, this function should init, but only once if called many times
|
|
1056
|
-
if (!i18nInstance.isInitialized && !i18nInstance.isInitializing) {
|
|
1057
|
-
void i18nInstance.use(initReactI18next).init({
|
|
1058
|
-
lng: initLanguage != null ? initLanguage : 'en',
|
|
1059
|
-
ns: namespace,
|
|
1060
|
-
interpolation: {
|
|
1061
|
-
escapeValue: false
|
|
1062
|
-
},
|
|
1063
|
-
resources: {}
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
loadAllTranslations(i18nInstance, translationsToLoad);
|
|
1067
|
-
};
|
|
1068
|
-
var useSharedTranslation = function useSharedTranslation() {
|
|
1069
|
-
return useTranslation([SHARED_NAMESPACE]);
|
|
1070
|
-
};
|
|
1071
|
-
|
|
1072
1103
|
var Title = function Title(_ref) {
|
|
1073
1104
|
var title = _ref.title;
|
|
1074
1105
|
return jsx(Typography, {
|
|
1106
|
+
component: "span",
|
|
1107
|
+
"data-testid": "customDialog-title",
|
|
1075
1108
|
sx: {
|
|
1076
1109
|
fontSize: '16px',
|
|
1077
1110
|
fontWeight: 500,
|
|
@@ -1081,8 +1114,6 @@ var Title = function Title(_ref) {
|
|
|
1081
1114
|
whiteSpace: 'nowrap',
|
|
1082
1115
|
color: 'geowebColors.typographyAndIcons.text'
|
|
1083
1116
|
},
|
|
1084
|
-
"data-testid": "customDialog-title",
|
|
1085
|
-
component: "span",
|
|
1086
1117
|
children: title
|
|
1087
1118
|
});
|
|
1088
1119
|
};
|
|
@@ -1101,11 +1132,11 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
|
|
|
1101
1132
|
justifyContent: 'space-between',
|
|
1102
1133
|
alignItems: 'center'
|
|
1103
1134
|
},
|
|
1104
|
-
children: [title
|
|
1135
|
+
children: [title ? jsx(Title, {
|
|
1105
1136
|
title: title
|
|
1106
|
-
}), jsx(CustomIconButton, {
|
|
1107
|
-
"data-testid": "customDialog-close",
|
|
1137
|
+
}) : null, jsx(CustomIconButton, {
|
|
1108
1138
|
"aria-label": "close",
|
|
1139
|
+
"data-testid": "customDialog-close",
|
|
1109
1140
|
onClick: function onClick() {
|
|
1110
1141
|
return onClose('CLOSED');
|
|
1111
1142
|
},
|
|
@@ -1119,41 +1150,41 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
|
|
|
1119
1150
|
})
|
|
1120
1151
|
})]
|
|
1121
1152
|
}) : jsxs(Grid, {
|
|
1153
|
+
alignItems: "center",
|
|
1154
|
+
"aria-label": "Dialog options header",
|
|
1122
1155
|
container: true,
|
|
1123
1156
|
"data-testid": "dialog-action-header",
|
|
1124
|
-
alignItems: "center",
|
|
1125
1157
|
sx: {
|
|
1126
1158
|
boxShadow: 1,
|
|
1127
1159
|
py: 0.5,
|
|
1128
1160
|
px: 1,
|
|
1129
1161
|
zIndex: 1
|
|
1130
1162
|
},
|
|
1131
|
-
"aria-label": "Dialog options header",
|
|
1132
1163
|
children: [jsx(Grid, {
|
|
1133
1164
|
size: 4,
|
|
1134
1165
|
children: jsx(Button, {
|
|
1166
|
+
"aria-label": "close",
|
|
1167
|
+
"data-testid": "contentdialog-close",
|
|
1135
1168
|
onClick: function onClick() {
|
|
1136
1169
|
return onClose('CLOSED');
|
|
1137
1170
|
},
|
|
1138
|
-
variant: "flat",
|
|
1139
|
-
"aria-label": "close",
|
|
1140
1171
|
startIcon: jsx(ChevronLeft, {}),
|
|
1141
|
-
"data-testid": "contentdialog-close",
|
|
1142
1172
|
sx: {
|
|
1143
1173
|
textTransform: 'uppercase'
|
|
1144
1174
|
},
|
|
1175
|
+
variant: "flat",
|
|
1145
1176
|
children: t('shared-customdialog-back')
|
|
1146
1177
|
})
|
|
1147
1178
|
}), jsx(Grid, {
|
|
1179
|
+
size: 4,
|
|
1148
1180
|
sx: {
|
|
1149
1181
|
display: 'flex',
|
|
1150
1182
|
justifyContent: 'center',
|
|
1151
1183
|
textAlign: 'center'
|
|
1152
1184
|
},
|
|
1153
|
-
|
|
1154
|
-
children: title && jsx(Title, {
|
|
1185
|
+
children: title ? jsx(Title, {
|
|
1155
1186
|
title: title
|
|
1156
|
-
})
|
|
1187
|
+
}) : null
|
|
1157
1188
|
}), jsx(Grid, {
|
|
1158
1189
|
size: 4,
|
|
1159
1190
|
children: jsx(Box, {
|
|
@@ -1177,12 +1208,12 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
|
|
|
1177
1208
|
_ref3$isDisabled = _ref3.isDisabled,
|
|
1178
1209
|
isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled;
|
|
1179
1210
|
return jsx(Button, {
|
|
1211
|
+
disabled: isDisabled,
|
|
1180
1212
|
onClick: action,
|
|
1181
|
-
variant: variant || 'flat',
|
|
1182
1213
|
sx: {
|
|
1183
1214
|
minWidth: 96
|
|
1184
1215
|
},
|
|
1185
|
-
|
|
1216
|
+
variant: variant != null ? variant : 'flat',
|
|
1186
1217
|
children: text
|
|
1187
1218
|
}, text + "-" + variant);
|
|
1188
1219
|
})
|
|
@@ -1227,12 +1258,12 @@ var PaperComponent = function PaperComponent(_ref) {
|
|
|
1227
1258
|
var maxWidth = '98%';
|
|
1228
1259
|
var maxHeight = '98%';
|
|
1229
1260
|
return jsx(ResizeComponent, Object.assign({
|
|
1230
|
-
|
|
1231
|
-
maxWidth: maxWidth,
|
|
1261
|
+
className: "custom-dialog-resize",
|
|
1232
1262
|
maxHeight: maxHeight,
|
|
1263
|
+
maxWidth: maxWidth,
|
|
1233
1264
|
minHeight: 120,
|
|
1234
1265
|
minWidth: 280,
|
|
1235
|
-
|
|
1266
|
+
size: defaultSize,
|
|
1236
1267
|
style: {
|
|
1237
1268
|
display: 'flex'
|
|
1238
1269
|
}
|
|
@@ -1293,20 +1324,26 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
1293
1324
|
size = _React$useState[0],
|
|
1294
1325
|
setSize = _React$useState[1];
|
|
1295
1326
|
return jsx(Dialog, Object.assign({
|
|
1327
|
+
"aria-labelledby": "dialog-title",
|
|
1296
1328
|
"data-testid": "customDialog",
|
|
1297
1329
|
// fix for briefly showing default options when closing dialog
|
|
1298
|
-
transitionDuration: 0
|
|
1330
|
+
transitionDuration: 0
|
|
1331
|
+
}, isResizable && {
|
|
1332
|
+
PaperComponent: PaperComponent
|
|
1333
|
+
}, shouldRenderInline && {
|
|
1334
|
+
disablePortal: true
|
|
1335
|
+
}, {
|
|
1336
|
+
disableRestoreFocus: disableRestoreFocus,
|
|
1299
1337
|
onClose: function onClose() {
|
|
1300
1338
|
_onClose('CLOSED');
|
|
1301
1339
|
},
|
|
1302
|
-
"aria-labelledby": "dialog-title",
|
|
1303
1340
|
slotProps: Object.assign({}, slotProps, {
|
|
1304
1341
|
paper: {
|
|
1305
1342
|
sx: Object.assign({}, !other.fullWidth && !other.maxWidth && {
|
|
1306
1343
|
maxWidth: '560px'
|
|
1307
1344
|
}, other.maxWidth && {
|
|
1308
1345
|
maxWidth: other.maxWidth
|
|
1309
|
-
}, sx)
|
|
1346
|
+
}, Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx)
|
|
1310
1347
|
}
|
|
1311
1348
|
}, isResizable && {
|
|
1312
1349
|
paper: {
|
|
@@ -1325,32 +1362,26 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
1325
1362
|
position: 'absolute'
|
|
1326
1363
|
}
|
|
1327
1364
|
}
|
|
1328
|
-
})
|
|
1329
|
-
|
|
1330
|
-
PaperComponent: PaperComponent
|
|
1331
|
-
}, shouldRenderInline && {
|
|
1332
|
-
disablePortal: true
|
|
1333
|
-
}, {
|
|
1334
|
-
sx: Object.assign({}, sx, isResizable && {
|
|
1365
|
+
}),
|
|
1366
|
+
sx: Object.assign({}, Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx, isResizable && {
|
|
1335
1367
|
'.custom-dialog-resize': {
|
|
1336
1368
|
height: 'initial'
|
|
1337
1369
|
}
|
|
1338
|
-
})
|
|
1339
|
-
disableRestoreFocus: disableRestoreFocus
|
|
1370
|
+
})
|
|
1340
1371
|
}, other, {
|
|
1341
1372
|
children: hasLayout ? jsxs(Fragment, {
|
|
1342
1373
|
children: [jsx(CustomDialogHeader, {
|
|
1343
|
-
title: title,
|
|
1344
1374
|
headerActions: headerActions,
|
|
1345
|
-
onClose: _onClose
|
|
1375
|
+
onClose: _onClose,
|
|
1376
|
+
title: title
|
|
1346
1377
|
}), jsxs(DialogContent, {
|
|
1347
1378
|
sx: {
|
|
1348
1379
|
padding: '8px 16px'
|
|
1349
1380
|
},
|
|
1350
|
-
children: [description
|
|
1381
|
+
children: [description ? jsx(Typography, {
|
|
1351
1382
|
variant: "body1",
|
|
1352
1383
|
children: description
|
|
1353
|
-
}), children]
|
|
1384
|
+
}) : null, children]
|
|
1354
1385
|
}), !headerActions && jsx(DialogActions, {
|
|
1355
1386
|
sx: {
|
|
1356
1387
|
padding: 2,
|
|
@@ -1395,7 +1426,9 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
|
|
|
1395
1426
|
return jsxs(Fragment, {
|
|
1396
1427
|
children: [jsx(Button, {
|
|
1397
1428
|
"data-testid": "confirmationDialog-cancel",
|
|
1398
|
-
|
|
1429
|
+
onClick: function onClick() {
|
|
1430
|
+
return onClose('CANCELLED');
|
|
1431
|
+
},
|
|
1399
1432
|
sx: function sx(theme) {
|
|
1400
1433
|
return {
|
|
1401
1434
|
width: {
|
|
@@ -1408,9 +1441,7 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
|
|
|
1408
1441
|
}
|
|
1409
1442
|
};
|
|
1410
1443
|
},
|
|
1411
|
-
|
|
1412
|
-
return onClose('CANCELLED');
|
|
1413
|
-
},
|
|
1444
|
+
variant: "tertiary",
|
|
1414
1445
|
children: cancelLabel != null ? cancelLabel : t('shared-confirmation-cancel')
|
|
1415
1446
|
}), isLoading ? jsx(Box, {
|
|
1416
1447
|
"data-testid": "confirm-dialog-spinner",
|
|
@@ -1421,12 +1452,13 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
|
|
|
1421
1452
|
alignItems: 'center'
|
|
1422
1453
|
}),
|
|
1423
1454
|
children: jsx(CircularProgress, {
|
|
1424
|
-
|
|
1425
|
-
|
|
1455
|
+
color: "secondary",
|
|
1456
|
+
size: 40
|
|
1426
1457
|
})
|
|
1427
1458
|
}) : jsx(Button, {
|
|
1459
|
+
autoFocus: !disableAutoFocus,
|
|
1428
1460
|
"data-testid": "confirmationDialog-confirm",
|
|
1429
|
-
|
|
1461
|
+
onClick: onSubmit,
|
|
1430
1462
|
sx: function sx(theme) {
|
|
1431
1463
|
return Object.assign({}, confirmStyle, {
|
|
1432
1464
|
'&:focus': {
|
|
@@ -1435,8 +1467,7 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
|
|
|
1435
1467
|
}
|
|
1436
1468
|
});
|
|
1437
1469
|
},
|
|
1438
|
-
|
|
1439
|
-
autoFocus: !disableAutoFocus,
|
|
1470
|
+
variant: "primary",
|
|
1440
1471
|
children: confirmLabel != null ? confirmLabel : t('shared-confirmation-submit')
|
|
1441
1472
|
})]
|
|
1442
1473
|
});
|
|
@@ -1464,19 +1495,19 @@ var ConfirmationDialog = function ConfirmationDialog(_ref) {
|
|
|
1464
1495
|
var _useSharedTranslation = useSharedTranslation(),
|
|
1465
1496
|
t = _useSharedTranslation.t;
|
|
1466
1497
|
return jsx(CustomDialog, Object.assign({
|
|
1467
|
-
"data-testid": "confirmationDialog",
|
|
1468
|
-
open: open,
|
|
1469
|
-
title: title,
|
|
1470
|
-
description: description != null ? description : t('shared-confirmation-description'),
|
|
1471
|
-
onClose: onClose,
|
|
1472
1498
|
actions: jsx(ConfirmationButtons, {
|
|
1473
|
-
onClose: onClose,
|
|
1474
1499
|
cancelLabel: cancelLabel,
|
|
1475
|
-
|
|
1476
|
-
onSubmit: onSubmit,
|
|
1500
|
+
confirmLabel: confirmLabel,
|
|
1477
1501
|
disableAutoFocus: disableAutoFocus,
|
|
1478
|
-
|
|
1479
|
-
|
|
1502
|
+
isLoading: isLoading,
|
|
1503
|
+
onClose: onClose,
|
|
1504
|
+
onSubmit: onSubmit
|
|
1505
|
+
}),
|
|
1506
|
+
"data-testid": "confirmationDialog",
|
|
1507
|
+
description: description != null ? description : t('shared-confirmation-description'),
|
|
1508
|
+
onClose: onClose,
|
|
1509
|
+
open: open,
|
|
1510
|
+
title: title
|
|
1480
1511
|
}, rest, {
|
|
1481
1512
|
children: content
|
|
1482
1513
|
}));
|
|
@@ -1577,8 +1608,8 @@ var usePoller = function usePoller(deps, callback, pollingInterval) {
|
|
|
1577
1608
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1578
1609
|
* */
|
|
1579
1610
|
function usePrevious(value) {
|
|
1580
|
-
var ref =
|
|
1581
|
-
|
|
1611
|
+
var ref = useRef();
|
|
1612
|
+
useEffect(function () {
|
|
1582
1613
|
ref.current = value;
|
|
1583
1614
|
});
|
|
1584
1615
|
return ref.current;
|
|
@@ -1679,7 +1710,7 @@ var adjustPosition = function adjustPosition(bbox, containingView, position, set
|
|
|
1679
1710
|
}
|
|
1680
1711
|
};
|
|
1681
1712
|
var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysInsideWindow(nodeRef, position, setPosition) {
|
|
1682
|
-
var onResizeWindow =
|
|
1713
|
+
var onResizeWindow = React.useCallback(function () {
|
|
1683
1714
|
if (!nodeRef.current) {
|
|
1684
1715
|
return;
|
|
1685
1716
|
}
|
|
@@ -1687,7 +1718,7 @@ var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysIn
|
|
|
1687
1718
|
var containingView = nodeRef.current.parentElement.getBoundingClientRect();
|
|
1688
1719
|
adjustPosition(bbox, containingView, position, setPosition);
|
|
1689
1720
|
}, [nodeRef, position, setPosition]);
|
|
1690
|
-
|
|
1721
|
+
React.useEffect(function () {
|
|
1691
1722
|
var throttledResize = throttle(onResizeWindow, 100);
|
|
1692
1723
|
window.addEventListener('resize', throttledResize);
|
|
1693
1724
|
return function () {
|
|
@@ -1724,10 +1755,10 @@ var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysIn
|
|
|
1724
1755
|
const debouncedName = useDebounce('testing', 2000)
|
|
1725
1756
|
*/
|
|
1726
1757
|
var useDebounce = function useDebounce(value, timeout) {
|
|
1727
|
-
var
|
|
1728
|
-
state =
|
|
1729
|
-
setState =
|
|
1730
|
-
|
|
1758
|
+
var _useState = useState(value),
|
|
1759
|
+
state = _useState[0],
|
|
1760
|
+
setState = _useState[1];
|
|
1761
|
+
useEffect(function () {
|
|
1731
1762
|
var handler = setTimeout(function () {
|
|
1732
1763
|
return setState(value);
|
|
1733
1764
|
}, timeout);
|
|
@@ -1756,8 +1787,8 @@ var useDebounce = function useDebounce(value, timeout) {
|
|
|
1756
1787
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1757
1788
|
* */
|
|
1758
1789
|
var useWheelStopPropagation = function useWheelStopPropagation() {
|
|
1759
|
-
var ref =
|
|
1760
|
-
|
|
1790
|
+
var ref = React.useRef(null);
|
|
1791
|
+
React.useEffect(function () {
|
|
1761
1792
|
var element = ref.current;
|
|
1762
1793
|
if (!element) {
|
|
1763
1794
|
return;
|
|
@@ -1800,8 +1831,8 @@ var useWheelStopPropagation = function useWheelStopPropagation() {
|
|
|
1800
1831
|
* as calling event.stopPropagation() on syncthetic events does not stop the propagation
|
|
1801
1832
|
*/
|
|
1802
1833
|
var useScrollingInIsolation = function useScrollingInIsolation(options) {
|
|
1803
|
-
var scrollInIsolationRef =
|
|
1804
|
-
|
|
1834
|
+
var scrollInIsolationRef = React.useRef(null);
|
|
1835
|
+
React.useEffect(function () {
|
|
1805
1836
|
var element = scrollInIsolationRef.current;
|
|
1806
1837
|
if (!element) {
|
|
1807
1838
|
return;
|
|
@@ -1826,6 +1857,43 @@ var useScrollingInIsolation = function useScrollingInIsolation(options) {
|
|
|
1826
1857
|
return scrollInIsolationRef;
|
|
1827
1858
|
};
|
|
1828
1859
|
|
|
1860
|
+
/*
|
|
1861
|
+
Accepts an array and html div element that is being observed for resizes.
|
|
1862
|
+
*/
|
|
1863
|
+
var useResizeObserver = function useResizeObserver(listContainerRef, collections,
|
|
1864
|
+
/**
|
|
1865
|
+
* Optional ResizeObserver implementation for dependency injection (testing, polyfills).
|
|
1866
|
+
* Defaults to window.ResizeObserver when not provided.
|
|
1867
|
+
*/
|
|
1868
|
+
ResizeObserverImpl) {
|
|
1869
|
+
if (ResizeObserverImpl === void 0) {
|
|
1870
|
+
ResizeObserverImpl = window.ResizeObserver;
|
|
1871
|
+
}
|
|
1872
|
+
var _React$useState = React.useState(350),
|
|
1873
|
+
listHeight = _React$useState[0],
|
|
1874
|
+
setListHeight = _React$useState[1]; // default fallback
|
|
1875
|
+
React.useEffect(function () {
|
|
1876
|
+
var node = listContainerRef.current;
|
|
1877
|
+
if (!node) {
|
|
1878
|
+
return;
|
|
1879
|
+
}
|
|
1880
|
+
var resizeObserver = new ResizeObserverImpl(function (entries) {
|
|
1881
|
+
for (var _iterator = _createForOfIteratorHelperLoose(entries), _step; !(_step = _iterator()).done;) {
|
|
1882
|
+
var entry = _step.value;
|
|
1883
|
+
if (entry.contentRect) {
|
|
1884
|
+
if (collections && collections.length > 1) {
|
|
1885
|
+
setListHeight(entry.contentRect.height - 150); // Subtract header height + accordion summary height
|
|
1886
|
+
} else {
|
|
1887
|
+
setListHeight(entry.contentRect.height - 115); // Subtract header height
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
});
|
|
1892
|
+
resizeObserver.observe(node);
|
|
1893
|
+
}, [listContainerRef, collections, ResizeObserverImpl]);
|
|
1894
|
+
return listHeight;
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1829
1897
|
var ConfirmationServiceContext = /*#__PURE__*/React.createContext(Promise.reject);
|
|
1830
1898
|
var useConfirmationDialog = function useConfirmationDialog() {
|
|
1831
1899
|
return React.useContext(ConfirmationServiceContext);
|
|
@@ -1839,6 +1907,7 @@ var useDialogActions = function useDialogActions(awaitingPromiseRef, defaultOpti
|
|
|
1839
1907
|
var _React$useState = React.useState(defaultOptions),
|
|
1840
1908
|
confirmationState = _React$useState[0],
|
|
1841
1909
|
setConfirmationState = _React$useState[1];
|
|
1910
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
1842
1911
|
var openConfirmation = function openConfirmation(options) {
|
|
1843
1912
|
setConfirmationState(options);
|
|
1844
1913
|
return new Promise(function (resolve, reject) {
|
|
@@ -1880,12 +1949,40 @@ var useDialogActions = function useDialogActions(awaitingPromiseRef, defaultOpti
|
|
|
1880
1949
|
var ConfirmationServiceProvider = function ConfirmationServiceProvider(_ref) {
|
|
1881
1950
|
var children = _ref.children;
|
|
1882
1951
|
var awaitingPromiseRef = React.useRef({
|
|
1883
|
-
resolve: function
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1952
|
+
resolve: function () {
|
|
1953
|
+
var _resolve = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
1954
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1955
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1956
|
+
case 0:
|
|
1957
|
+
return _context.abrupt("return", Promise.resolve());
|
|
1958
|
+
case 1:
|
|
1959
|
+
case "end":
|
|
1960
|
+
return _context.stop();
|
|
1961
|
+
}
|
|
1962
|
+
}, _callee);
|
|
1963
|
+
}));
|
|
1964
|
+
function resolve() {
|
|
1965
|
+
return _resolve.apply(this, arguments);
|
|
1966
|
+
}
|
|
1967
|
+
return resolve;
|
|
1968
|
+
}(),
|
|
1969
|
+
reject: function () {
|
|
1970
|
+
var _reject = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1971
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1972
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1973
|
+
case 0:
|
|
1974
|
+
return _context2.abrupt("return", Promise.reject());
|
|
1975
|
+
case 1:
|
|
1976
|
+
case "end":
|
|
1977
|
+
return _context2.stop();
|
|
1978
|
+
}
|
|
1979
|
+
}, _callee2);
|
|
1980
|
+
}));
|
|
1981
|
+
function reject() {
|
|
1982
|
+
return _reject.apply(this, arguments);
|
|
1983
|
+
}
|
|
1984
|
+
return reject;
|
|
1985
|
+
}()
|
|
1889
1986
|
});
|
|
1890
1987
|
var _useDialogActions = useDialogActions(awaitingPromiseRef),
|
|
1891
1988
|
openConfirmation = _useDialogActions.openConfirmation,
|
|
@@ -1895,9 +1992,9 @@ var ConfirmationServiceProvider = function ConfirmationServiceProvider(_ref) {
|
|
|
1895
1992
|
return jsxs(ConfirmationServiceContext.Provider, {
|
|
1896
1993
|
value: openConfirmation,
|
|
1897
1994
|
children: [children, jsx(ConfirmationDialog, Object.assign({
|
|
1898
|
-
|
|
1995
|
+
onClose: handleClose,
|
|
1899
1996
|
onSubmit: handleSubmit,
|
|
1900
|
-
|
|
1997
|
+
open: Boolean(confirmationState)
|
|
1901
1998
|
}, confirmationState))]
|
|
1902
1999
|
});
|
|
1903
2000
|
};
|
|
@@ -1910,32 +2007,32 @@ var AlertIcon = function AlertIcon(_ref) {
|
|
|
1910
2007
|
switch (severity) {
|
|
1911
2008
|
case 'info':
|
|
1912
2009
|
return jsx(Info, {
|
|
2010
|
+
"data-testid": dataTestId,
|
|
1913
2011
|
sx: {
|
|
1914
2012
|
color: 'geowebColors.functional.notification'
|
|
1915
|
-
}
|
|
1916
|
-
"data-testid": dataTestId
|
|
2013
|
+
}
|
|
1917
2014
|
});
|
|
1918
2015
|
case 'success':
|
|
1919
2016
|
return jsx(Success, {
|
|
2017
|
+
"data-testid": dataTestId,
|
|
1920
2018
|
sx: {
|
|
1921
2019
|
color: 'geowebColors.functional.success'
|
|
1922
|
-
}
|
|
1923
|
-
"data-testid": dataTestId
|
|
2020
|
+
}
|
|
1924
2021
|
});
|
|
1925
2022
|
case 'warning':
|
|
1926
2023
|
return jsx(Exclamation, {
|
|
2024
|
+
"data-testid": dataTestId,
|
|
1927
2025
|
sx: {
|
|
1928
2026
|
color: 'geowebColors.functional.warning'
|
|
1929
|
-
}
|
|
1930
|
-
"data-testid": dataTestId
|
|
2027
|
+
}
|
|
1931
2028
|
});
|
|
1932
2029
|
case 'error':
|
|
1933
2030
|
default:
|
|
1934
2031
|
return jsx(Exclamation, {
|
|
2032
|
+
"data-testid": dataTestId,
|
|
1935
2033
|
sx: {
|
|
1936
2034
|
color: 'geowebColors.functional.error'
|
|
1937
|
-
}
|
|
1938
|
-
"data-testid": dataTestId
|
|
2035
|
+
}
|
|
1939
2036
|
});
|
|
1940
2037
|
}
|
|
1941
2038
|
};
|
|
@@ -1963,21 +2060,21 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
1963
2060
|
return null;
|
|
1964
2061
|
}
|
|
1965
2062
|
return jsxs(Alert, {
|
|
1966
|
-
"data-testid": dataTestId,
|
|
1967
|
-
severity: severity,
|
|
1968
|
-
icon: jsx(AlertIcon, {
|
|
1969
|
-
severity: severity
|
|
1970
|
-
}),
|
|
1971
2063
|
action: shouldClose ? jsx(Button, {
|
|
1972
|
-
variant: "flat",
|
|
1973
2064
|
onClick: function onClick() {
|
|
1974
2065
|
return setIsOpen(false);
|
|
1975
2066
|
},
|
|
1976
2067
|
sx: {
|
|
1977
2068
|
backgroundColor: 'transparent!important'
|
|
1978
2069
|
},
|
|
2070
|
+
variant: "flat",
|
|
1979
2071
|
children: t('shared-close-caps')
|
|
1980
2072
|
}) : undefined,
|
|
2073
|
+
"data-testid": dataTestId,
|
|
2074
|
+
icon: jsx(AlertIcon, {
|
|
2075
|
+
severity: severity
|
|
2076
|
+
}),
|
|
2077
|
+
severity: severity,
|
|
1981
2078
|
sx: isCompact ? {
|
|
1982
2079
|
height: '32px',
|
|
1983
2080
|
boxSizing: 'border-box',
|
|
@@ -2016,7 +2113,7 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
2016
2113
|
lineHeight: isCompact ? '18px' : '24px'
|
|
2017
2114
|
},
|
|
2018
2115
|
children: title
|
|
2019
|
-
}), info
|
|
2116
|
+
}), info ? jsx(Box, {
|
|
2020
2117
|
sx: {
|
|
2021
2118
|
fontSize: '16px',
|
|
2022
2119
|
marginTop: 1,
|
|
@@ -2024,18 +2121,18 @@ var AlertBanner = function AlertBanner(_ref) {
|
|
|
2024
2121
|
lineHeight: '22px'
|
|
2025
2122
|
},
|
|
2026
2123
|
children: info
|
|
2027
|
-
}), actionButtonProps
|
|
2028
|
-
variant: "flat",
|
|
2124
|
+
}) : null, actionButtonProps ? jsx(Button, {
|
|
2029
2125
|
onClick: function onClick(event) {
|
|
2030
2126
|
setIsOpen(false);
|
|
2031
2127
|
actionButtonProps.onClick(event);
|
|
2032
2128
|
},
|
|
2129
|
+
startIcon: jsx(ChevronRight, {}),
|
|
2033
2130
|
sx: {
|
|
2034
2131
|
backgroundColor: 'transparent!important'
|
|
2035
2132
|
},
|
|
2036
|
-
|
|
2133
|
+
variant: "flat",
|
|
2037
2134
|
children: actionButtonProps.title.toUpperCase()
|
|
2038
|
-
})]
|
|
2135
|
+
}) : null]
|
|
2039
2136
|
});
|
|
2040
2137
|
};
|
|
2041
2138
|
|
|
@@ -2043,12 +2140,12 @@ var AppLayout = function AppLayout(_ref) {
|
|
|
2043
2140
|
var header = _ref.header,
|
|
2044
2141
|
children = _ref.children;
|
|
2045
2142
|
return jsxs(Box, {
|
|
2143
|
+
"data-testid": "appLayout",
|
|
2046
2144
|
sx: {
|
|
2047
2145
|
height: '100dvh',
|
|
2048
2146
|
display: 'flex',
|
|
2049
2147
|
flexDirection: 'column'
|
|
2050
2148
|
},
|
|
2051
|
-
"data-testid": "appLayout",
|
|
2052
2149
|
children: [header, jsx(Box, {
|
|
2053
2150
|
component: "main",
|
|
2054
2151
|
sx: {
|
|
@@ -2069,17 +2166,17 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
2069
2166
|
title = _ref$title === void 0 ? 'GeoWeb' : _ref$title,
|
|
2070
2167
|
onClick = _ref.onClick;
|
|
2071
2168
|
var theme = useTheme();
|
|
2072
|
-
var _React$useState =
|
|
2169
|
+
var _React$useState = React.useState(false),
|
|
2073
2170
|
isDrawerOpen = _React$useState[0],
|
|
2074
|
-
|
|
2171
|
+
setIsDrawerOpen = _React$useState[1];
|
|
2075
2172
|
var onToggleDrawer = function onToggleDrawer(isOpen) {
|
|
2076
|
-
return
|
|
2173
|
+
return setIsDrawerOpen(isOpen);
|
|
2077
2174
|
};
|
|
2078
2175
|
var onKeyDown = function onKeyDown(event) {
|
|
2079
2176
|
if (event.key === 'Tab' || event.key === 'Shift') {
|
|
2080
2177
|
return;
|
|
2081
2178
|
}
|
|
2082
|
-
|
|
2179
|
+
setIsDrawerOpen(false);
|
|
2083
2180
|
};
|
|
2084
2181
|
return jsxs(Box, {
|
|
2085
2182
|
component: "header",
|
|
@@ -2115,8 +2212,8 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
2115
2212
|
cursor: onClick ? 'pointer' : 'auto'
|
|
2116
2213
|
},
|
|
2117
2214
|
children: [(_theme$palette$geoweb = theme.palette.geowebColors.logo) != null && _theme$palette$geoweb.image ? jsx("img", {
|
|
2118
|
-
src: theme.palette.geowebColors.logo.image,
|
|
2119
2215
|
alt: "GeoWeb",
|
|
2216
|
+
src: theme.palette.geowebColors.logo.image,
|
|
2120
2217
|
style: {
|
|
2121
2218
|
height: '29px',
|
|
2122
2219
|
width: '47px'
|
|
@@ -2128,7 +2225,6 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
2128
2225
|
right: '-1px'
|
|
2129
2226
|
}
|
|
2130
2227
|
}), jsx(Typography, {
|
|
2131
|
-
variant: "h1",
|
|
2132
2228
|
sx: {
|
|
2133
2229
|
display: 'none',
|
|
2134
2230
|
fontSize: '20px',
|
|
@@ -2144,9 +2240,10 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
2144
2240
|
marginLeft: 1,
|
|
2145
2241
|
maxWidth: 130
|
|
2146
2242
|
},
|
|
2243
|
+
variant: "h1",
|
|
2147
2244
|
children: title
|
|
2148
2245
|
})]
|
|
2149
|
-
}), menu
|
|
2246
|
+
}), menu ? jsxs(Box, {
|
|
2150
2247
|
className: "hamburger-btn",
|
|
2151
2248
|
sx: {
|
|
2152
2249
|
display: 'flex',
|
|
@@ -2155,22 +2252,22 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
2155
2252
|
},
|
|
2156
2253
|
children: [jsx(CustomIconButton, {
|
|
2157
2254
|
"data-testid": "menuButton",
|
|
2255
|
+
isSelected: isDrawerOpen,
|
|
2158
2256
|
onClick: function onClick() {
|
|
2159
2257
|
return onToggleDrawer(true);
|
|
2160
2258
|
},
|
|
2161
|
-
isSelected: isDrawerOpen,
|
|
2162
2259
|
children: jsx(HamburgerMenu, {})
|
|
2163
2260
|
}), jsx(Drawer, {
|
|
2164
|
-
"data-testid": "app-drawer",
|
|
2165
2261
|
anchor: "left",
|
|
2166
|
-
|
|
2167
|
-
|
|
2262
|
+
"data-testid": "app-drawer",
|
|
2263
|
+
onClick: function onClick() {
|
|
2168
2264
|
return onToggleDrawer(false);
|
|
2169
2265
|
},
|
|
2170
|
-
|
|
2266
|
+
onClose: function onClose() {
|
|
2171
2267
|
return onToggleDrawer(false);
|
|
2172
2268
|
},
|
|
2173
2269
|
onKeyDown: onKeyDown,
|
|
2270
|
+
open: isDrawerOpen,
|
|
2174
2271
|
sx: {
|
|
2175
2272
|
'& .MuiDrawer-paper': {
|
|
2176
2273
|
top: '40px'
|
|
@@ -2185,7 +2282,7 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
2185
2282
|
children: menu
|
|
2186
2283
|
})
|
|
2187
2284
|
})]
|
|
2188
|
-
}), jsx(Box, {
|
|
2285
|
+
}) : null, jsx(Box, {
|
|
2189
2286
|
className: "workspace-topbar",
|
|
2190
2287
|
sx: {
|
|
2191
2288
|
flexGrow: 1,
|
|
@@ -2291,20 +2388,20 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
2291
2388
|
return jsx(Box, {
|
|
2292
2389
|
sx: displayOnTop ? displayOnTopStyles : normalStyles,
|
|
2293
2390
|
children: jsx(AlertBanner, {
|
|
2294
|
-
severity: "error",
|
|
2295
|
-
title: "Woops, an error has occurred. Please report the error shown below and reload the page if needed.",
|
|
2296
2391
|
info: jsxs("div", {
|
|
2297
|
-
children: [jsx("br", {}), error.toString(), jsx("br", {}), errorInfo
|
|
2298
|
-
underline: "always",
|
|
2299
|
-
style: {
|
|
2300
|
-
cursor: 'pointer'
|
|
2301
|
-
},
|
|
2392
|
+
children: [jsx("br", {}), error.toString(), jsx("br", {}), errorInfo == null ? void 0 : errorInfo.componentStack, jsx("br", {}), jsx("br", {}), jsx(Link, {
|
|
2302
2393
|
onClick: function onClick() {
|
|
2303
2394
|
return window.location.reload();
|
|
2304
2395
|
},
|
|
2396
|
+
style: {
|
|
2397
|
+
cursor: 'pointer'
|
|
2398
|
+
},
|
|
2399
|
+
underline: "always",
|
|
2305
2400
|
children: reloadPage
|
|
2306
2401
|
})]
|
|
2307
|
-
})
|
|
2402
|
+
}),
|
|
2403
|
+
severity: "error",
|
|
2404
|
+
title: "Woops, an error has occurred. Please report the error shown below and reload the page if needed."
|
|
2308
2405
|
})
|
|
2309
2406
|
});
|
|
2310
2407
|
}
|
|
@@ -2376,9 +2473,10 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2376
2473
|
var toggleRef = useRef(null);
|
|
2377
2474
|
return jsxs(Fragment, {
|
|
2378
2475
|
children: [jsx(CustomIconButton, {
|
|
2379
|
-
ref: toggleRef,
|
|
2380
2476
|
"data-testid": "userButton",
|
|
2381
2477
|
onClick: onToggle,
|
|
2478
|
+
ref: toggleRef,
|
|
2479
|
+
size: "medium",
|
|
2382
2480
|
sx: {
|
|
2383
2481
|
'&.MuiButtonBase-root': Object.assign({
|
|
2384
2482
|
background: 'transparent',
|
|
@@ -2393,11 +2491,10 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2393
2491
|
}
|
|
2394
2492
|
})
|
|
2395
2493
|
},
|
|
2396
|
-
size: "medium",
|
|
2397
2494
|
children: !isAdmin ? jsx(Avatar, {
|
|
2398
2495
|
children: initials
|
|
2399
2496
|
}) : jsxs(Fragment, {
|
|
2400
|
-
children: [jsx(Admin, {}), initials
|
|
2497
|
+
children: [jsx(Admin, {}), initials ? jsx("div", {
|
|
2401
2498
|
style: {
|
|
2402
2499
|
position: 'absolute',
|
|
2403
2500
|
fontSize: '14px',
|
|
@@ -2406,12 +2503,13 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2406
2503
|
fontWeight: 500
|
|
2407
2504
|
},
|
|
2408
2505
|
children: initials
|
|
2409
|
-
})]
|
|
2506
|
+
}) : null]
|
|
2410
2507
|
})
|
|
2411
|
-
}), isOpen
|
|
2412
|
-
sx: styles$4.container,
|
|
2508
|
+
}), isOpen ? jsx(Paper, {
|
|
2413
2509
|
"data-testid": "userMenu",
|
|
2510
|
+
sx: styles$4.container,
|
|
2414
2511
|
children: jsx(ClickAwayListener, {
|
|
2512
|
+
mouseEvent: "onMouseDown",
|
|
2415
2513
|
onClickAway: function onClickAway(event) {
|
|
2416
2514
|
var _toggleRef$current;
|
|
2417
2515
|
if ((_toggleRef$current = toggleRef.current) != null && _toggleRef$current.contains(event.target)) {
|
|
@@ -2419,14 +2517,13 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2419
2517
|
}
|
|
2420
2518
|
onClose();
|
|
2421
2519
|
},
|
|
2422
|
-
mouseEvent: "onMouseDown",
|
|
2423
2520
|
children: jsx(MenuList, {
|
|
2424
2521
|
sx: styles$4.userMenu,
|
|
2425
2522
|
variant: "menu",
|
|
2426
2523
|
children: children
|
|
2427
2524
|
})
|
|
2428
2525
|
})
|
|
2429
|
-
})]
|
|
2526
|
+
}) : null]
|
|
2430
2527
|
});
|
|
2431
2528
|
};
|
|
2432
2529
|
|
|
@@ -2451,38 +2548,38 @@ var MenuItemTheme = function MenuItemTheme(_ref) {
|
|
|
2451
2548
|
}
|
|
2452
2549
|
},
|
|
2453
2550
|
children: [jsx(FormControlLabel, {
|
|
2454
|
-
value: ThemeTypes.LIGHT_THEME,
|
|
2455
2551
|
control: jsx(Radio, {
|
|
2456
2552
|
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.LIGHT_THEME
|
|
2457
2553
|
}),
|
|
2458
|
-
label: t('shared-light')
|
|
2554
|
+
label: t('shared-light'),
|
|
2555
|
+
value: ThemeTypes.LIGHT_THEME
|
|
2459
2556
|
}), jsx(FormControlLabel, {
|
|
2460
|
-
value: ThemeTypes.DARK_THEME,
|
|
2461
2557
|
control: jsx(Radio, {
|
|
2462
2558
|
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.DARK_THEME
|
|
2463
2559
|
}),
|
|
2464
|
-
label: t('shared-dark')
|
|
2465
|
-
|
|
2560
|
+
label: t('shared-dark'),
|
|
2561
|
+
value: ThemeTypes.DARK_THEME
|
|
2562
|
+
}), enableSpecialThemes ? jsxs(Fragment, {
|
|
2466
2563
|
children: [jsx(FormControlLabel, {
|
|
2467
|
-
value: ThemeTypes.DEMO_THEME,
|
|
2468
2564
|
control: jsx(Radio, {
|
|
2469
2565
|
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.DEMO_THEME
|
|
2470
2566
|
}),
|
|
2471
|
-
label: "Demo"
|
|
2567
|
+
label: "Demo",
|
|
2568
|
+
value: ThemeTypes.DEMO_THEME
|
|
2472
2569
|
}), jsx(FormControlLabel, {
|
|
2473
|
-
value: ThemeTypes.XMAS2024_THEME,
|
|
2474
2570
|
control: jsx(Radio, {
|
|
2475
2571
|
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.XMAS2024_THEME
|
|
2476
2572
|
}),
|
|
2477
|
-
label: t('shared-xmas') + " 2024"
|
|
2573
|
+
label: t('shared-xmas') + " 2024",
|
|
2574
|
+
value: ThemeTypes.XMAS2024_THEME
|
|
2478
2575
|
}), jsx(FormControlLabel, {
|
|
2479
|
-
value: ThemeTypes.EUMETNET_THEME,
|
|
2480
2576
|
control: jsx(Radio, {
|
|
2481
2577
|
checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.EUMETNET_THEME
|
|
2482
2578
|
}),
|
|
2483
|
-
label: "EUMETNET"
|
|
2579
|
+
label: "EUMETNET",
|
|
2580
|
+
value: ThemeTypes.EUMETNET_THEME
|
|
2484
2581
|
})]
|
|
2485
|
-
})]
|
|
2582
|
+
}) : null]
|
|
2486
2583
|
})
|
|
2487
2584
|
})]
|
|
2488
2585
|
})
|
|
@@ -2493,14 +2590,14 @@ var MenuItemTheme = function MenuItemTheme(_ref) {
|
|
|
2493
2590
|
var ToolFooter = function ToolFooter() {
|
|
2494
2591
|
return jsx(Box, {
|
|
2495
2592
|
component: "footer",
|
|
2593
|
+
role: "contentinfo",
|
|
2496
2594
|
sx: {
|
|
2497
2595
|
boxShadow: 1,
|
|
2498
2596
|
backgroundColor: 'geowebColors.background.surface',
|
|
2499
2597
|
textAlign: 'right',
|
|
2500
2598
|
height: 18,
|
|
2501
2599
|
zIndex: 1
|
|
2502
|
-
}
|
|
2503
|
-
role: "contentinfo"
|
|
2600
|
+
}
|
|
2504
2601
|
});
|
|
2505
2602
|
};
|
|
2506
2603
|
|
|
@@ -2583,14 +2680,16 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2583
2680
|
"data-testid": "CloseIcon"
|
|
2584
2681
|
}) : _ref$closeIcon;
|
|
2585
2682
|
var styles = getStyle(size);
|
|
2586
|
-
var columnSizeIcon = title && (leftHeaderComponent
|
|
2587
|
-
var columnSizeTitle = leftHeaderComponent
|
|
2683
|
+
var columnSizeIcon = title && (leftHeaderComponent != null ? leftHeaderComponent : rightHeaderComponent) ? 4 : 1;
|
|
2684
|
+
var columnSizeTitle = (leftHeaderComponent != null ? leftHeaderComponent : rightHeaderComponent) ? 4 : 10;
|
|
2588
2685
|
var columnSizeLeft = title ? columnSizeIcon : 12 - columnSizeIcon;
|
|
2589
2686
|
var _useTranslation = useTranslation(SHARED_NAMESPACE),
|
|
2590
2687
|
t = _useTranslation.t;
|
|
2591
2688
|
return jsx(Box, {
|
|
2592
|
-
|
|
2689
|
+
"aria-label": "toolheader",
|
|
2593
2690
|
className: className,
|
|
2691
|
+
component: "header",
|
|
2692
|
+
role: "heading",
|
|
2594
2693
|
sx: Object.assign({}, rightHeaderComponent ? headerStyle : {}, {
|
|
2595
2694
|
boxShadow: 1,
|
|
2596
2695
|
// elevation_01
|
|
@@ -2598,35 +2697,33 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2598
2697
|
zIndex: 2,
|
|
2599
2698
|
cursor: isDraggable ? 'move' : null
|
|
2600
2699
|
}),
|
|
2601
|
-
role: "heading",
|
|
2602
|
-
"aria-label": "toolheader",
|
|
2603
2700
|
children: jsxs(Grid, {
|
|
2604
|
-
container: true,
|
|
2605
2701
|
alignItems: "center",
|
|
2702
|
+
container: true,
|
|
2703
|
+
justifyContent: "space-between",
|
|
2606
2704
|
sx: {
|
|
2607
2705
|
padding: styles.padding,
|
|
2608
2706
|
height: styles.height
|
|
2609
2707
|
},
|
|
2610
|
-
justifyContent: "space-between",
|
|
2611
2708
|
children: [jsx(Grid, {
|
|
2612
2709
|
className: "header-left",
|
|
2710
|
+
size: columnSizeLeft,
|
|
2613
2711
|
sx: {
|
|
2614
2712
|
paddingRight: 1
|
|
2615
2713
|
},
|
|
2616
|
-
|
|
2617
|
-
children: leftHeaderComponent && leftHeaderComponent
|
|
2714
|
+
children: leftHeaderComponent != null ? leftHeaderComponent : null
|
|
2618
2715
|
}), jsx(Grid, {
|
|
2716
|
+
alignItems: "center",
|
|
2619
2717
|
className: "header-title",
|
|
2620
|
-
size: title ? columnSizeTitle : 0,
|
|
2621
2718
|
container: true,
|
|
2622
2719
|
justifyContent: "center",
|
|
2623
|
-
|
|
2720
|
+
size: title ? columnSizeTitle : 0,
|
|
2624
2721
|
sx: {
|
|
2625
2722
|
minHeight: 12
|
|
2626
2723
|
},
|
|
2627
|
-
children: title
|
|
2628
|
-
variant: "h2",
|
|
2724
|
+
children: title ? jsx(Typography, {
|
|
2629
2725
|
noWrap: true,
|
|
2726
|
+
role: "heading",
|
|
2630
2727
|
sx: {
|
|
2631
2728
|
fontSize: styles.fontSize,
|
|
2632
2729
|
fontWeight: styles.fontWeight,
|
|
@@ -2634,20 +2731,20 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2634
2731
|
marginTop: styles.marginTop,
|
|
2635
2732
|
textAlign: 'center'
|
|
2636
2733
|
},
|
|
2637
|
-
|
|
2734
|
+
variant: "h2",
|
|
2638
2735
|
children: title
|
|
2639
|
-
})
|
|
2736
|
+
}) : null
|
|
2640
2737
|
}), jsxs(Grid, {
|
|
2641
2738
|
className: "header-right",
|
|
2642
2739
|
container: true,
|
|
2643
2740
|
justifyContent: "flex-end",
|
|
2644
2741
|
size: columnSizeIcon,
|
|
2645
|
-
children: [rightHeaderComponent
|
|
2646
|
-
title: t('shared-close'),
|
|
2742
|
+
children: [rightHeaderComponent != null ? rightHeaderComponent : null, onClose ? jsx(CustomTooltip, {
|
|
2647
2743
|
placement: "bottom",
|
|
2648
2744
|
sx: {
|
|
2649
2745
|
pointerEvents: 'none'
|
|
2650
2746
|
},
|
|
2747
|
+
title: t('shared-close'),
|
|
2651
2748
|
children: jsx(CustomIconButton, {
|
|
2652
2749
|
"data-testid": "closeBtn",
|
|
2653
2750
|
onClick: onClose,
|
|
@@ -2657,7 +2754,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2657
2754
|
},
|
|
2658
2755
|
children: closeIcon
|
|
2659
2756
|
})
|
|
2660
|
-
})]
|
|
2757
|
+
}) : null]
|
|
2661
2758
|
})]
|
|
2662
2759
|
})
|
|
2663
2760
|
});
|
|
@@ -2709,23 +2806,23 @@ var ToolContainer = function ToolContainer(_ref) {
|
|
|
2709
2806
|
}, props, {
|
|
2710
2807
|
children: [jsx(ErrorBoundary, {
|
|
2711
2808
|
children: jsx(ToolHeader, {
|
|
2712
|
-
title: title,
|
|
2713
|
-
size: size,
|
|
2714
|
-
isDraggable: isDraggable,
|
|
2715
|
-
onClose: onClose,
|
|
2716
2809
|
className: headerClassName,
|
|
2810
|
+
closeIcon: closeIcon,
|
|
2811
|
+
dragHandleIcon: dragHandleIcon,
|
|
2812
|
+
isDraggable: isDraggable,
|
|
2717
2813
|
leftHeaderComponent: leftHeaderComponent,
|
|
2814
|
+
onClose: onClose,
|
|
2718
2815
|
rightHeaderComponent: rightHeaderComponent,
|
|
2719
|
-
|
|
2720
|
-
|
|
2816
|
+
size: size,
|
|
2817
|
+
title: title
|
|
2721
2818
|
})
|
|
2722
2819
|
}), jsx(Box, {
|
|
2723
|
-
sx: styles$3.content,
|
|
2724
2820
|
style: {
|
|
2725
2821
|
maxHeight: maxHeight
|
|
2726
2822
|
},
|
|
2823
|
+
sx: styles$3.content,
|
|
2727
2824
|
children: children
|
|
2728
|
-
}), isResizable
|
|
2825
|
+
}), isResizable ? jsx(ToolFooter, {}) : null]
|
|
2729
2826
|
}));
|
|
2730
2827
|
};
|
|
2731
2828
|
|
|
@@ -2805,7 +2902,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
|
|
|
2805
2902
|
isOpen = _ref.isOpen,
|
|
2806
2903
|
startSize = _ref.startSize,
|
|
2807
2904
|
onChangeSize = _ref.onChangeSize;
|
|
2808
|
-
var updateDomDirectly =
|
|
2905
|
+
var updateDomDirectly = React.useCallback(function (position, size) {
|
|
2809
2906
|
if (nodeRef.current) {
|
|
2810
2907
|
var element = nodeRef.current;
|
|
2811
2908
|
var firstChild = element.firstChild;
|
|
@@ -2814,16 +2911,16 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
|
|
|
2814
2911
|
firstChild.style.height = size.height + "px";
|
|
2815
2912
|
}
|
|
2816
2913
|
}, [nodeRef]);
|
|
2817
|
-
var getBoundsNode =
|
|
2914
|
+
var getBoundsNode = React.useCallback(function () {
|
|
2818
2915
|
var _nodeRef$current;
|
|
2819
2916
|
return bounds === 'parent' ? (_nodeRef$current = nodeRef.current) == null ? void 0 : _nodeRef$current.parentNode : document.querySelector(bounds);
|
|
2820
2917
|
}, [bounds, nodeRef]);
|
|
2821
2918
|
// store the position as ref so we can access it in another ref
|
|
2822
|
-
var refPosition =
|
|
2919
|
+
var refPosition = React.useRef(position);
|
|
2823
2920
|
refPosition.current = position;
|
|
2824
|
-
var lastSize =
|
|
2921
|
+
var lastSize = React.useRef(startSize);
|
|
2825
2922
|
// handle size from outside component
|
|
2826
|
-
|
|
2923
|
+
React.useEffect(function () {
|
|
2827
2924
|
var boundsNode = getBoundsNode();
|
|
2828
2925
|
if (boundsNode && lastSize.current.width && lastSize.current.height && (lastSize.current.width !== startSize.width || lastSize.current.height !== startSize.height) && typeof startSize.height === 'number' && typeof startSize.width === 'number' && nodeRef.current) {
|
|
2829
2926
|
var _getNewPositionSize = getNewPositionSize(nodeRef.current, boundsNode, isRightAligned, refPosition.current, startSize),
|
|
@@ -2837,7 +2934,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
|
|
|
2837
2934
|
}
|
|
2838
2935
|
}, [startSize, isRightAligned, lastSize, getBoundsNode, nodeRef, updateDomDirectly, onChangeSize]);
|
|
2839
2936
|
// observe parent div dimensions
|
|
2840
|
-
var resizeObserverRef =
|
|
2937
|
+
var resizeObserverRef = React.useRef(new ResizeObserver(function (entry) {
|
|
2841
2938
|
var boundsTarget = entry[0].target;
|
|
2842
2939
|
var element = nodeRef.current;
|
|
2843
2940
|
var boundsBbox = boundsTarget.getBoundingClientRect();
|
|
@@ -2849,7 +2946,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
|
|
|
2849
2946
|
newSize = _getNewPositionSize2.size;
|
|
2850
2947
|
updateDomDirectly(newPosition, newSize);
|
|
2851
2948
|
}));
|
|
2852
|
-
|
|
2949
|
+
React.useLayoutEffect(function () {
|
|
2853
2950
|
var boundsNode = getBoundsNode();
|
|
2854
2951
|
if (!boundsNode || !isOpen) {
|
|
2855
2952
|
return function () {};
|
|
@@ -2968,32 +3065,32 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
2968
3065
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
2969
3066
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
2970
3067
|
var elevation = BASE_ELEVATION + order;
|
|
2971
|
-
var nodeRef =
|
|
2972
|
-
var _React$useState =
|
|
3068
|
+
var nodeRef = React.useRef(null);
|
|
3069
|
+
var _React$useState = React.useState({
|
|
2973
3070
|
x: 0,
|
|
2974
3071
|
y: 0
|
|
2975
3072
|
}),
|
|
2976
3073
|
position = _React$useState[0],
|
|
2977
3074
|
setPosition = _React$useState[1];
|
|
2978
|
-
var _React$useState2 =
|
|
3075
|
+
var _React$useState2 = React.useState(startSize),
|
|
2979
3076
|
size = _React$useState2[0],
|
|
2980
3077
|
setSize = _React$useState2[1];
|
|
2981
|
-
var _React$useState3 =
|
|
3078
|
+
var _React$useState3 = React.useState(false),
|
|
2982
3079
|
isDragging = _React$useState3[0],
|
|
2983
3080
|
setIsDragging = _React$useState3[1];
|
|
2984
3081
|
var isRightAligned = startPosition && startPosition.right !== null && startPosition.right !== undefined;
|
|
2985
|
-
var onStopDrag =
|
|
3082
|
+
var onStopDrag = React.useCallback(function (_event, position) {
|
|
2986
3083
|
setPosition(position);
|
|
2987
3084
|
onDragEnd(position, size);
|
|
2988
3085
|
}, [setPosition, onDragEnd, size]);
|
|
2989
|
-
var _React$useState4 =
|
|
3086
|
+
var _React$useState4 = React.useState(defaultInitialMaxHeight),
|
|
2990
3087
|
initialMaxHeight = _React$useState4[0],
|
|
2991
3088
|
setInitialMaxHeight = _React$useState4[1];
|
|
2992
3089
|
var onStartResize = function onStartResize() {
|
|
2993
3090
|
setIsDragging(true);
|
|
2994
3091
|
setInitialMaxHeight('initial');
|
|
2995
3092
|
};
|
|
2996
|
-
var onResize =
|
|
3093
|
+
var onResize = React.useCallback(function (_event, handle, node, delta) {
|
|
2997
3094
|
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
2998
3095
|
width = _node$getBoundingClie.width,
|
|
2999
3096
|
height = _node$getBoundingClie.height;
|
|
@@ -3010,8 +3107,8 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3010
3107
|
setPosition(calculateNewPosition(position, isRightAligned, direction, delta));
|
|
3011
3108
|
onResizeStop(_event, direction, node, delta);
|
|
3012
3109
|
};
|
|
3013
|
-
var toolcontainerId =
|
|
3014
|
-
var headerClassName = "header-" + (className
|
|
3110
|
+
var toolcontainerId = React.useRef(Date.now().toString()).current;
|
|
3111
|
+
var headerClassName = "header-" + (className != null ? className : toolcontainerId);
|
|
3015
3112
|
useHandleSizeFromOutsideComponent({
|
|
3016
3113
|
nodeRef: nodeRef,
|
|
3017
3114
|
bounds: bounds,
|
|
@@ -3024,7 +3121,7 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3024
3121
|
}
|
|
3025
3122
|
});
|
|
3026
3123
|
return isOpen ? jsxs(Fragment, {
|
|
3027
|
-
children: [isDragging
|
|
3124
|
+
children: [isDragging ? jsx(Box, {
|
|
3028
3125
|
"data-testid": "dragging-overlay",
|
|
3029
3126
|
sx: {
|
|
3030
3127
|
top: 0,
|
|
@@ -3034,51 +3131,51 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3034
3131
|
position: 'absolute',
|
|
3035
3132
|
zIndex: 999
|
|
3036
3133
|
}
|
|
3037
|
-
}), jsx(DraggableComponent$1, {
|
|
3038
|
-
nodeRef: nodeRef,
|
|
3134
|
+
}) : null, jsx(DraggableComponent$1, {
|
|
3039
3135
|
bounds: bounds,
|
|
3040
3136
|
cancel: cancel,
|
|
3041
|
-
position: position,
|
|
3042
|
-
onStop: onStopDrag,
|
|
3043
3137
|
handle: "." + headerClassName,
|
|
3138
|
+
nodeRef: nodeRef,
|
|
3044
3139
|
onMouseDown: onMouseDown,
|
|
3140
|
+
onStop: onStopDrag,
|
|
3141
|
+
position: position,
|
|
3045
3142
|
setIsDragging: setIsDragging,
|
|
3046
3143
|
children: jsx(Box, {
|
|
3047
|
-
|
|
3144
|
+
"aria-label": title,
|
|
3145
|
+
className: "toolContainerDraggable",
|
|
3146
|
+
ref: nodeRef,
|
|
3147
|
+
role: "dialog",
|
|
3048
3148
|
sx: Object.assign({
|
|
3049
3149
|
position: 'absolute',
|
|
3050
3150
|
pointerEvents: 'all',
|
|
3051
3151
|
zIndex: zIndex
|
|
3052
|
-
}, startPosition, sx, {
|
|
3152
|
+
}, startPosition, Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx, {
|
|
3053
3153
|
'&:hover .resizableHandle': {
|
|
3054
3154
|
display: 'inline'
|
|
3055
3155
|
}
|
|
3056
3156
|
}),
|
|
3057
|
-
|
|
3058
|
-
className: "toolContainerDraggable",
|
|
3059
|
-
role: "dialog",
|
|
3060
|
-
"aria-label": title,
|
|
3157
|
+
tabIndex: -1,
|
|
3061
3158
|
children: jsx(ResizeComponent, Object.assign({}, props, {
|
|
3062
|
-
|
|
3063
|
-
|
|
3159
|
+
nodeRef: nodeRef,
|
|
3160
|
+
onResize: onResize,
|
|
3064
3161
|
onResizeStart: onStartResize,
|
|
3065
3162
|
onResizeStop: onStopResize,
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
children: jsx(ToolContainer, {
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
size: headerSize,
|
|
3073
|
-
isDraggable: true,
|
|
3074
|
-
isResizable: true,
|
|
3163
|
+
setSize: setSize,
|
|
3164
|
+
size: size,
|
|
3165
|
+
children: jsx(ToolContainer, {
|
|
3166
|
+
className: className,
|
|
3167
|
+
closeIcon: closeIcon,
|
|
3168
|
+
dragHandleIcon: dragHandleIcon,
|
|
3075
3169
|
elevation: elevation,
|
|
3076
3170
|
headerClassName: headerClassName,
|
|
3171
|
+
isDraggable: true,
|
|
3172
|
+
isResizable: true,
|
|
3077
3173
|
leftHeaderComponent: leftHeaderComponent,
|
|
3174
|
+
maxHeight: initialMaxHeight,
|
|
3175
|
+
onClose: onClose,
|
|
3078
3176
|
rightHeaderComponent: rightHeaderComponent,
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
className: className,
|
|
3177
|
+
size: headerSize,
|
|
3178
|
+
title: title,
|
|
3082
3179
|
children: children
|
|
3083
3180
|
})
|
|
3084
3181
|
}))
|
|
@@ -3118,32 +3215,32 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
|
|
|
3118
3215
|
children = _ref.children;
|
|
3119
3216
|
if (type === 'divider') {
|
|
3120
3217
|
return jsx(Typography, {
|
|
3121
|
-
sx: styles$2.divider,
|
|
3122
|
-
"data-testid": "segment-divider",
|
|
3123
3218
|
component: "span",
|
|
3219
|
+
"data-testid": "segment-divider",
|
|
3220
|
+
sx: styles$2.divider,
|
|
3124
3221
|
children: children
|
|
3125
3222
|
});
|
|
3126
3223
|
}
|
|
3127
3224
|
if (type === 'icon') {
|
|
3128
3225
|
return jsx(Typography, {
|
|
3129
|
-
sx: styles$2.icon,
|
|
3130
|
-
"data-testid": "segment-icon",
|
|
3131
3226
|
component: "span",
|
|
3227
|
+
"data-testid": "segment-icon",
|
|
3228
|
+
sx: styles$2.icon,
|
|
3132
3229
|
children: children
|
|
3133
3230
|
});
|
|
3134
3231
|
}
|
|
3135
3232
|
if (type === 'connect') {
|
|
3136
3233
|
return jsx(Typography, {
|
|
3137
|
-
sx: styles$2.connect,
|
|
3138
|
-
"data-testid": "segment-connect",
|
|
3139
3234
|
component: "span",
|
|
3235
|
+
"data-testid": "segment-connect",
|
|
3236
|
+
sx: styles$2.connect,
|
|
3140
3237
|
children: children
|
|
3141
3238
|
});
|
|
3142
3239
|
}
|
|
3143
3240
|
return jsx(Typography, {
|
|
3144
|
-
sx: segmentStyle,
|
|
3145
|
-
"data-testid": "segment-text",
|
|
3146
3241
|
component: "span",
|
|
3242
|
+
"data-testid": "segment-text",
|
|
3243
|
+
sx: segmentStyle,
|
|
3147
3244
|
children: children
|
|
3148
3245
|
});
|
|
3149
3246
|
};
|
|
@@ -3472,15 +3569,15 @@ var ShortcutList = function ShortcutList(_ref) {
|
|
|
3472
3569
|
"data-testid": "list-" + platform,
|
|
3473
3570
|
children: shortcuts.map(function (shortcut, index) {
|
|
3474
3571
|
return jsx(ListItem, {
|
|
3572
|
+
divider: index !== shortcuts.length - 1,
|
|
3475
3573
|
sx: {
|
|
3476
3574
|
minHeight: 56
|
|
3477
3575
|
},
|
|
3478
|
-
divider: index !== shortcuts.length - 1,
|
|
3479
3576
|
children: jsxs(Grid, {
|
|
3577
|
+
alignItems: "center",
|
|
3480
3578
|
container: true,
|
|
3481
3579
|
direction: "row",
|
|
3482
3580
|
justifyContent: "space-between",
|
|
3483
|
-
alignItems: "center",
|
|
3484
3581
|
size: "grow",
|
|
3485
3582
|
children: [jsx(Grid, {
|
|
3486
3583
|
sx: {
|
|
@@ -3509,10 +3606,10 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
3509
3606
|
value = _ref.value,
|
|
3510
3607
|
index = _ref.index;
|
|
3511
3608
|
return jsx("div", {
|
|
3512
|
-
|
|
3609
|
+
"aria-labelledby": "tab-" + index,
|
|
3513
3610
|
hidden: value !== index,
|
|
3514
3611
|
id: "tabpanel-" + index,
|
|
3515
|
-
|
|
3612
|
+
role: "tabpanel",
|
|
3516
3613
|
children: value === index && children
|
|
3517
3614
|
});
|
|
3518
3615
|
};
|
|
@@ -3526,32 +3623,32 @@ var styles$1 = {
|
|
|
3526
3623
|
}
|
|
3527
3624
|
};
|
|
3528
3625
|
var CheatSheet = function CheatSheet() {
|
|
3529
|
-
var _React$useState =
|
|
3626
|
+
var _React$useState = React.useState(0),
|
|
3530
3627
|
activeTab = _React$useState[0],
|
|
3531
|
-
|
|
3628
|
+
setActiveTab = _React$useState[1];
|
|
3532
3629
|
var onChangeTab = function onChangeTab(_event, newValue) {
|
|
3533
|
-
|
|
3630
|
+
setActiveTab(newValue);
|
|
3534
3631
|
};
|
|
3535
3632
|
return jsxs(Box, {
|
|
3536
3633
|
sx: styles$1.container,
|
|
3537
3634
|
children: [jsxs(Tabs, {
|
|
3538
|
-
value: activeTab,
|
|
3539
|
-
onChange: onChangeTab,
|
|
3540
3635
|
"aria-label": "platform",
|
|
3636
|
+
onChange: onChangeTab,
|
|
3637
|
+
value: activeTab,
|
|
3541
3638
|
children: [jsx(Tab, {
|
|
3542
|
-
|
|
3543
|
-
|
|
3639
|
+
label: "Windows",
|
|
3640
|
+
sx: styles$1.tab
|
|
3544
3641
|
}), jsx(Tab, {
|
|
3545
|
-
|
|
3546
|
-
|
|
3642
|
+
label: "Mac",
|
|
3643
|
+
sx: styles$1.tab
|
|
3547
3644
|
})]
|
|
3548
3645
|
}), jsx(TabPanel, {
|
|
3549
|
-
value: activeTab,
|
|
3550
3646
|
index: 0,
|
|
3647
|
+
value: activeTab,
|
|
3551
3648
|
children: jsx(ShortcutList, {})
|
|
3552
3649
|
}), jsx(TabPanel, {
|
|
3553
|
-
value: activeTab,
|
|
3554
3650
|
index: 1,
|
|
3651
|
+
value: activeTab,
|
|
3555
3652
|
children: jsx(ShortcutList, {
|
|
3556
3653
|
platform: "mac"
|
|
3557
3654
|
})
|
|
@@ -3560,7 +3657,7 @@ var CheatSheet = function CheatSheet() {
|
|
|
3560
3657
|
};
|
|
3561
3658
|
|
|
3562
3659
|
var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
3563
|
-
var _React$useState =
|
|
3660
|
+
var _React$useState = React.useState(false),
|
|
3564
3661
|
open = _React$useState[0],
|
|
3565
3662
|
setOpen = _React$useState[1];
|
|
3566
3663
|
var onClose = function onClose() {
|
|
@@ -3574,8 +3671,8 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
|
3574
3671
|
return jsxs(Fragment, {
|
|
3575
3672
|
children: [jsx(MenuItem, {
|
|
3576
3673
|
"data-testid": "cheatsheet-btn",
|
|
3577
|
-
onClick: onOpen,
|
|
3578
3674
|
divider: true,
|
|
3675
|
+
onClick: onOpen,
|
|
3579
3676
|
children: jsx(Grid, {
|
|
3580
3677
|
container: true,
|
|
3581
3678
|
children: jsx(Grid, {
|
|
@@ -3589,15 +3686,15 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
|
3589
3686
|
zIndex: 1
|
|
3590
3687
|
},
|
|
3591
3688
|
children: jsx(DraggableComponent, {
|
|
3689
|
+
bounds: "parent",
|
|
3690
|
+
isOpen: true,
|
|
3691
|
+
minHeight: 300,
|
|
3692
|
+
minWidth: 500,
|
|
3693
|
+
onClose: onClose,
|
|
3592
3694
|
startSize: {
|
|
3593
3695
|
width: 700
|
|
3594
3696
|
},
|
|
3595
|
-
minHeight: 300,
|
|
3596
|
-
minWidth: 500,
|
|
3597
3697
|
title: t('shared-cheat-sheet'),
|
|
3598
|
-
isOpen: true,
|
|
3599
|
-
onClose: onClose,
|
|
3600
|
-
bounds: "parent",
|
|
3601
3698
|
children: jsx(CheatSheet, {})
|
|
3602
3699
|
})
|
|
3603
3700
|
})]
|
|
@@ -3607,13 +3704,13 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
|
3607
3704
|
var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
3608
3705
|
var recordButtonEnabled = _ref.recordButtonEnabled,
|
|
3609
3706
|
setRecordButtonEnabled = _ref.setRecordButtonEnabled;
|
|
3610
|
-
var _React$useState =
|
|
3707
|
+
var _React$useState = React.useState(false),
|
|
3611
3708
|
open = _React$useState[0],
|
|
3612
3709
|
setOpen = _React$useState[1];
|
|
3613
|
-
var _React$useState2 =
|
|
3710
|
+
var _React$useState2 = React.useState(false),
|
|
3614
3711
|
canvasIntegrationEnabled = _React$useState2[0],
|
|
3615
3712
|
setCanvasIntegrationEnabled = _React$useState2[1];
|
|
3616
|
-
var _React$useState3 =
|
|
3713
|
+
var _React$useState3 = React.useState(false),
|
|
3617
3714
|
htmlRecordingEnabled = _React$useState3[0],
|
|
3618
3715
|
setHTMLRecordingEnabled = _React$useState3[1];
|
|
3619
3716
|
var _useTranslation = useTranslation(SHARED_NAMESPACE),
|
|
@@ -3648,11 +3745,11 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3648
3745
|
case 7:
|
|
3649
3746
|
_yield$import = _context.sent;
|
|
3650
3747
|
replayIntegration = _yield$import.replayIntegration;
|
|
3651
|
-
|
|
3748
|
+
addIntegration(replayIntegration({
|
|
3652
3749
|
maskAllText: false,
|
|
3653
3750
|
blockAllMedia: false
|
|
3654
3751
|
}));
|
|
3655
|
-
setRecordButtonEnabled
|
|
3752
|
+
setRecordButtonEnabled == null || setRecordButtonEnabled(!recordButtonEnabled);
|
|
3656
3753
|
setHTMLRecordingEnabled(true);
|
|
3657
3754
|
_context.next = 17;
|
|
3658
3755
|
break;
|
|
@@ -3690,13 +3787,13 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3690
3787
|
_yield$import2 = _context2.sent;
|
|
3691
3788
|
replayIntegration = _yield$import2.replayIntegration;
|
|
3692
3789
|
replayCanvasIntegration = _yield$import2.replayCanvasIntegration;
|
|
3693
|
-
|
|
3790
|
+
addIntegration(replayIntegration({
|
|
3694
3791
|
maskAllText: false,
|
|
3695
3792
|
blockAllMedia: false
|
|
3696
3793
|
}));
|
|
3697
|
-
|
|
3794
|
+
addIntegration(replayCanvasIntegration());
|
|
3698
3795
|
setCanvasIntegrationEnabled(!canvasIntegrationEnabled);
|
|
3699
|
-
setRecordButtonEnabled
|
|
3796
|
+
setRecordButtonEnabled == null || setRecordButtonEnabled(!recordButtonEnabled);
|
|
3700
3797
|
_context2.next = 17;
|
|
3701
3798
|
break;
|
|
3702
3799
|
case 14:
|
|
@@ -3717,8 +3814,8 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3717
3814
|
return jsxs(ErrorBoundary, {
|
|
3718
3815
|
children: [jsx(MenuItem, {
|
|
3719
3816
|
"data-testid": "sentryRecording-btn",
|
|
3720
|
-
onClick: onOpen,
|
|
3721
3817
|
divider: true,
|
|
3818
|
+
onClick: onOpen,
|
|
3722
3819
|
children: jsx(Grid, {
|
|
3723
3820
|
container: true,
|
|
3724
3821
|
children: jsx(Grid, {
|
|
@@ -3732,15 +3829,15 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3732
3829
|
zIndex: 1
|
|
3733
3830
|
},
|
|
3734
3831
|
children: jsx(DraggableComponent, {
|
|
3832
|
+
bounds: "parent",
|
|
3833
|
+
isOpen: true,
|
|
3834
|
+
minHeight: 300,
|
|
3835
|
+
minWidth: 500,
|
|
3836
|
+
onClose: onClose,
|
|
3735
3837
|
startSize: {
|
|
3736
3838
|
width: 700
|
|
3737
3839
|
},
|
|
3738
|
-
minHeight: 300,
|
|
3739
|
-
minWidth: 500,
|
|
3740
3840
|
title: t('shared-sentry-recording'),
|
|
3741
|
-
isOpen: true,
|
|
3742
|
-
onClose: onClose,
|
|
3743
|
-
bounds: "parent",
|
|
3744
3841
|
children: jsxs(Grid, {
|
|
3745
3842
|
container: true,
|
|
3746
3843
|
spacing: 4,
|
|
@@ -3767,25 +3864,25 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3767
3864
|
children: t('shared-sentry-enable-message')
|
|
3768
3865
|
})
|
|
3769
3866
|
}), jsxs(Grid, {
|
|
3770
|
-
container: true,
|
|
3771
3867
|
alignItems: "center",
|
|
3868
|
+
container: true,
|
|
3772
3869
|
direction: "column",
|
|
3773
3870
|
children: [jsx(Switch, {
|
|
3774
|
-
checked: recordButtonEnabled
|
|
3775
|
-
|
|
3776
|
-
|
|
3871
|
+
checked: recordButtonEnabled ? !canvasIntegrationEnabled : undefined,
|
|
3872
|
+
disabled: htmlRecordingEnabled,
|
|
3873
|
+
onChange: enableHTMLRecording
|
|
3777
3874
|
}), recordButtonEnabled && !canvasIntegrationEnabled ? jsxs(Typography, {
|
|
3778
3875
|
children: [" ", t('shared-sentry-disable')]
|
|
3779
3876
|
}) : jsxs(Typography, {
|
|
3780
3877
|
children: [" ", t('shared-sentry-enable')]
|
|
3781
3878
|
})]
|
|
3782
3879
|
}), jsxs(Grid, {
|
|
3783
|
-
container: true,
|
|
3784
3880
|
alignItems: "center",
|
|
3881
|
+
container: true,
|
|
3785
3882
|
direction: "column",
|
|
3786
3883
|
children: [jsx(Switch, {
|
|
3787
|
-
disabled: true,
|
|
3788
3884
|
checked: canvasIntegrationEnabled,
|
|
3885
|
+
disabled: true,
|
|
3789
3886
|
onChange: enableHTMLAndCanvasRecording
|
|
3790
3887
|
}), canvasIntegrationEnabled ? jsx(Typography, {
|
|
3791
3888
|
children: t('shared-sentry-disable-both')
|
|
@@ -3796,10 +3893,10 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3796
3893
|
},
|
|
3797
3894
|
children: t('shared-sentry-enable-both')
|
|
3798
3895
|
}), jsxs(Typography, {
|
|
3799
|
-
textAlign: "center",
|
|
3800
3896
|
sx: {
|
|
3801
3897
|
color: 'gray'
|
|
3802
3898
|
},
|
|
3899
|
+
textAlign: "center",
|
|
3803
3900
|
children: ["(", t('shared-sentry-cors-wait'), ")"]
|
|
3804
3901
|
})]
|
|
3805
3902
|
})]
|
|
@@ -3841,14 +3938,14 @@ var useUserMenu = function useUserMenu(open) {
|
|
|
3841
3938
|
if (open === void 0) {
|
|
3842
3939
|
open = false;
|
|
3843
3940
|
}
|
|
3844
|
-
var _React$useState =
|
|
3941
|
+
var _React$useState = React.useState(open),
|
|
3845
3942
|
isOpen = _React$useState[0],
|
|
3846
|
-
|
|
3943
|
+
setIsOpen = _React$useState[1];
|
|
3847
3944
|
var onClose = function onClose() {
|
|
3848
|
-
return
|
|
3945
|
+
return setIsOpen(false);
|
|
3849
3946
|
};
|
|
3850
3947
|
var onToggle = function onToggle() {
|
|
3851
|
-
return
|
|
3948
|
+
return setIsOpen(!isOpen);
|
|
3852
3949
|
};
|
|
3853
3950
|
return {
|
|
3854
3951
|
isOpen: isOpen,
|
|
@@ -3978,10 +4075,8 @@ var CustomSlider = function CustomSlider(_ref) {
|
|
|
3978
4075
|
}, []);
|
|
3979
4076
|
var mergedStyles = merge(extraStyles, sliderStyle);
|
|
3980
4077
|
return jsx(Slider, Object.assign({
|
|
3981
|
-
sx: mergedStyles,
|
|
3982
|
-
ref: element,
|
|
3983
|
-
value: value,
|
|
3984
4078
|
orientation: orientation,
|
|
4079
|
+
ref: element,
|
|
3985
4080
|
role: "slider",
|
|
3986
4081
|
slotProps: {
|
|
3987
4082
|
thumb: {
|
|
@@ -3990,7 +4085,9 @@ var CustomSlider = function CustomSlider(_ref) {
|
|
|
3990
4085
|
mark: {
|
|
3991
4086
|
role: 'listitem'
|
|
3992
4087
|
}
|
|
3993
|
-
}
|
|
4088
|
+
},
|
|
4089
|
+
sx: mergedStyles,
|
|
4090
|
+
value: value
|
|
3994
4091
|
}, props));
|
|
3995
4092
|
};
|
|
3996
4093
|
|
|
@@ -4004,8 +4101,8 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4004
4101
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
4005
4102
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
4006
4103
|
return jsx(ToggleButton, Object.assign({
|
|
4007
|
-
ref: ref,
|
|
4008
4104
|
className: variant + " " + className,
|
|
4105
|
+
ref: ref,
|
|
4009
4106
|
value: value
|
|
4010
4107
|
}, props));
|
|
4011
4108
|
});
|
|
@@ -4076,23 +4173,23 @@ var TooltipSelect = function TooltipSelect(_ref) {
|
|
|
4076
4173
|
onWheel: onWheel
|
|
4077
4174
|
});
|
|
4078
4175
|
return jsx(CustomTooltip, {
|
|
4079
|
-
title: tooltip,
|
|
4080
|
-
placement: "top",
|
|
4081
4176
|
open: tooltipOpen,
|
|
4177
|
+
placement: "top",
|
|
4178
|
+
title: tooltip,
|
|
4082
4179
|
children: jsx(StyledSelect, Object.assign({
|
|
4083
|
-
|
|
4084
|
-
variant: variant,
|
|
4180
|
+
additionalStyling: additionalStyling,
|
|
4085
4181
|
disableUnderline: true,
|
|
4086
|
-
|
|
4182
|
+
hasBackgroundColor: hasBackgroundColor,
|
|
4183
|
+
isEnabled: isEnabled,
|
|
4184
|
+
onBlur: onBlur,
|
|
4087
4185
|
onClose: onClose,
|
|
4186
|
+
onFocus: onFocus,
|
|
4088
4187
|
onMouseEnter: onMouseEnter,
|
|
4089
4188
|
onMouseLeave: onMouseLeave,
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
additionalStyling: additionalStyling,
|
|
4095
|
-
skipLocalStyling: skipLocalStyling
|
|
4189
|
+
onOpen: onOpen,
|
|
4190
|
+
ref: scrollInIsolationRef,
|
|
4191
|
+
skipLocalStyling: skipLocalStyling,
|
|
4192
|
+
variant: variant
|
|
4096
4193
|
}, props))
|
|
4097
4194
|
});
|
|
4098
4195
|
};
|
|
@@ -4130,8 +4227,8 @@ var StyledSelect = styled(/*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
4130
4227
|
}
|
|
4131
4228
|
}
|
|
4132
4229
|
},
|
|
4133
|
-
|
|
4134
|
-
|
|
4230
|
+
ref: ref,
|
|
4231
|
+
sx: additionalStyling
|
|
4135
4232
|
}));
|
|
4136
4233
|
}))(function (_ref4) {
|
|
4137
4234
|
var theme = _ref4.theme;
|
|
@@ -4257,18 +4354,20 @@ var CustomAccordion = function CustomAccordion(_ref) {
|
|
|
4257
4354
|
var iconColor = theme.palette.geowebColors.buttons.icon["default"].color;
|
|
4258
4355
|
return jsxs(Accordion, Object.assign({}, props, {
|
|
4259
4356
|
defaultExpanded: defaultExpanded,
|
|
4357
|
+
disableGutters: disableGutters,
|
|
4260
4358
|
elevation: expanded ? expandedElevation : collapsedElevation,
|
|
4261
4359
|
onChange: function onChange(_event, expanded) {
|
|
4262
4360
|
return setExpanded(expanded);
|
|
4263
4361
|
},
|
|
4264
|
-
disableGutters: disableGutters,
|
|
4265
4362
|
slotProps: {
|
|
4266
4363
|
transition: {
|
|
4267
4364
|
timeout: transitionDuration
|
|
4268
4365
|
}
|
|
4269
4366
|
},
|
|
4270
4367
|
children: [jsx(AccordionSummary, {
|
|
4368
|
+
"aria-label": expanded ? 'Drawer opened' : 'Drawer closed',
|
|
4271
4369
|
component: "div",
|
|
4370
|
+
"data-testid": title && amountOfItems ? title + " " + amountOfItems : title,
|
|
4272
4371
|
expandIcon: CustomExpandIcon ? jsx(CustomExpandIcon, {
|
|
4273
4372
|
style: {
|
|
4274
4373
|
fill: "" + iconColor
|
|
@@ -4346,8 +4445,8 @@ var SearchHighlight = function SearchHighlight(_ref) {
|
|
|
4346
4445
|
return part.toLocaleLowerCase().includes(search);
|
|
4347
4446
|
})) {
|
|
4348
4447
|
return jsx("mark", {
|
|
4349
|
-
style: highlightStyle,
|
|
4350
4448
|
"data-testid": "mark",
|
|
4449
|
+
style: highlightStyle,
|
|
4351
4450
|
children: part
|
|
4352
4451
|
}, key);
|
|
4353
4452
|
}
|
|
@@ -4376,8 +4475,8 @@ var SwitchButton = function SwitchButton(_ref) {
|
|
|
4376
4475
|
tooltip = _ref$tooltip === void 0 ? 'Switch mode' : _ref$tooltip,
|
|
4377
4476
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
4378
4477
|
return jsx(CustomTooltip, {
|
|
4379
|
-
title: tooltip,
|
|
4380
4478
|
className: "switch-button",
|
|
4479
|
+
title: tooltip,
|
|
4381
4480
|
children: jsxs("span", {
|
|
4382
4481
|
role: "button",
|
|
4383
4482
|
children: [jsx(FormLabel, {
|
|
@@ -4401,9 +4500,9 @@ var ClearButton$1 = function ClearButton(_ref) {
|
|
|
4401
4500
|
var _useSharedTranslation = useSharedTranslation(),
|
|
4402
4501
|
t = _useSharedTranslation.t;
|
|
4403
4502
|
return jsx(CustomIconButton, {
|
|
4404
|
-
tooltipTitle: t('shared-clear'),
|
|
4405
|
-
sx: buttonStyle,
|
|
4406
4503
|
onClick: onClick,
|
|
4504
|
+
sx: buttonStyle,
|
|
4505
|
+
tooltipTitle: t('shared-clear'),
|
|
4407
4506
|
children: jsx(Clear, {})
|
|
4408
4507
|
});
|
|
4409
4508
|
};
|
|
@@ -4432,10 +4531,10 @@ var SearchFieldButton = function SearchFieldButton(_ref2) {
|
|
|
4432
4531
|
}
|
|
4433
4532
|
})
|
|
4434
4533
|
}), jsx(Button, {
|
|
4435
|
-
variant: "tertiary",
|
|
4436
4534
|
onClick: function onClick() {
|
|
4437
4535
|
return setPopupIsOpen(true);
|
|
4438
4536
|
},
|
|
4537
|
+
variant: "tertiary",
|
|
4439
4538
|
children: t('shared-save')
|
|
4440
4539
|
})]
|
|
4441
4540
|
});
|
|
@@ -4448,8 +4547,8 @@ var SearchFieldButton = function SearchFieldButton(_ref2) {
|
|
|
4448
4547
|
});
|
|
4449
4548
|
}
|
|
4450
4549
|
return jsx(CustomIconButton, {
|
|
4451
|
-
tooltipTitle: t('shared-search'),
|
|
4452
4550
|
sx: buttonStyle,
|
|
4551
|
+
tooltipTitle: t('shared-search'),
|
|
4453
4552
|
children: jsx(Search, {})
|
|
4454
4553
|
});
|
|
4455
4554
|
};
|
|
@@ -4489,7 +4588,7 @@ var SearchField$1 = function SearchField(_ref) {
|
|
|
4489
4588
|
setUrlIsValid = _React$useState2[1];
|
|
4490
4589
|
var _useTranslation = useTranslation(SHARED_NAMESPACE),
|
|
4491
4590
|
t = _useTranslation.t;
|
|
4492
|
-
var translatedLabel = label
|
|
4591
|
+
var translatedLabel = label != null ? label : onOpenServicePopup ? t('shared-search-services') : t('shared-search');
|
|
4493
4592
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4494
4593
|
var setSearchFilterDebounced = React.useCallback(debounce(setSearchFilter, 300), []);
|
|
4495
4594
|
var handleChange = function handleChange(text) {
|
|
@@ -4529,34 +4628,34 @@ var SearchField$1 = function SearchField(_ref) {
|
|
|
4529
4628
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4530
4629
|
}, [searchFilter]);
|
|
4531
4630
|
return jsx(TextField, {
|
|
4532
|
-
|
|
4631
|
+
autoFocus: true,
|
|
4632
|
+
fullWidth: true,
|
|
4533
4633
|
label: translatedLabel,
|
|
4534
|
-
value: localSearchString,
|
|
4535
4634
|
onChange: function onChange(e) {
|
|
4536
4635
|
handleChange(e.target.value);
|
|
4537
4636
|
},
|
|
4538
|
-
autoFocus: true,
|
|
4539
|
-
fullWidth: true,
|
|
4540
4637
|
slotProps: {
|
|
4541
4638
|
input: {
|
|
4542
4639
|
endAdornment: jsx(InputAdornment, {
|
|
4543
4640
|
position: "end",
|
|
4544
4641
|
children: jsx(SearchFieldButton, {
|
|
4545
|
-
setPopupIsOpen: onOpenServicePopup ? function () {
|
|
4546
|
-
onOpenServicePopup(localSearchString);
|
|
4547
|
-
setLocalSearchString('');
|
|
4548
|
-
} : undefined,
|
|
4549
4642
|
localSearchString: localSearchString,
|
|
4550
4643
|
onClickClear: function onClickClear() {
|
|
4551
4644
|
setLocalSearchString('');
|
|
4552
4645
|
setSearchFilterDebounced('');
|
|
4553
4646
|
setUrlIsValid(false);
|
|
4554
|
-
}
|
|
4647
|
+
},
|
|
4648
|
+
setPopupIsOpen: onOpenServicePopup ? function () {
|
|
4649
|
+
onOpenServicePopup(localSearchString);
|
|
4650
|
+
setLocalSearchString('');
|
|
4651
|
+
} : undefined
|
|
4555
4652
|
})
|
|
4556
4653
|
})
|
|
4557
4654
|
}
|
|
4558
4655
|
},
|
|
4559
|
-
sx: small ? stylesSmall : {}
|
|
4656
|
+
sx: small ? stylesSmall : {},
|
|
4657
|
+
value: localSearchString,
|
|
4658
|
+
variant: "filled"
|
|
4560
4659
|
});
|
|
4561
4660
|
};
|
|
4562
4661
|
|
|
@@ -4584,15 +4683,15 @@ var LastUpdateTime = function LastUpdateTime(_ref) {
|
|
|
4584
4683
|
justifyContent: 'flex-end'
|
|
4585
4684
|
},
|
|
4586
4685
|
children: [!hideLabel && jsx(Typography, {
|
|
4686
|
+
"data-testid": dataTestId,
|
|
4587
4687
|
sx: {
|
|
4588
4688
|
color: 'geowebColors.captions.captionStatus.rgba',
|
|
4589
4689
|
fontSize: '10px',
|
|
4590
4690
|
lineHeight: '1.6',
|
|
4591
4691
|
letterSpacing: '0.33px'
|
|
4592
4692
|
},
|
|
4593
|
-
"data-testid": dataTestId,
|
|
4594
4693
|
children: getLastUpdateTitle(lastUpdateTime, t)
|
|
4595
|
-
}), showRefreshButton
|
|
4694
|
+
}), showRefreshButton ? jsx(CustomIconButton, {
|
|
4596
4695
|
"data-testid": "refresh-button",
|
|
4597
4696
|
onClick: onPressRefresh,
|
|
4598
4697
|
sx: {
|
|
@@ -4605,7 +4704,7 @@ var LastUpdateTime = function LastUpdateTime(_ref) {
|
|
|
4605
4704
|
tooltipTitle: t('shared-click-to-refresh'),
|
|
4606
4705
|
variant: "tool",
|
|
4607
4706
|
children: jsx(Cached, {})
|
|
4608
|
-
})]
|
|
4707
|
+
}) : null]
|
|
4609
4708
|
});
|
|
4610
4709
|
};
|
|
4611
4710
|
|
|
@@ -4641,14 +4740,15 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4641
4740
|
_this._documentKeyDown = _this._documentKeyDown.bind(_this);
|
|
4642
4741
|
_this._isFocussed = false;
|
|
4643
4742
|
_this.canvas = null;
|
|
4644
|
-
_this.canvascontaineroutside = /*#__PURE__*/
|
|
4645
|
-
_this.canvascontainer = /*#__PURE__*/
|
|
4743
|
+
_this.canvascontaineroutside = /*#__PURE__*/React.createRef();
|
|
4744
|
+
_this.canvascontainer = /*#__PURE__*/React.createRef();
|
|
4646
4745
|
return _this;
|
|
4647
4746
|
}
|
|
4648
4747
|
_inheritsLoose(CanvasComponent, _Component);
|
|
4649
4748
|
var _proto = CanvasComponent.prototype;
|
|
4650
4749
|
_proto.componentDidMount = function componentDidMount() {
|
|
4651
|
-
var
|
|
4750
|
+
var _this$canvascontainer,
|
|
4751
|
+
_this2 = this;
|
|
4652
4752
|
this.mounted = true;
|
|
4653
4753
|
if (this.canvas) {
|
|
4654
4754
|
this.canvas.addEventListener('mousemove', this.handleMouseMoveEvent);
|
|
@@ -4670,7 +4770,7 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4670
4770
|
window.addEventListener('keyup', this.onKeyUp);
|
|
4671
4771
|
}
|
|
4672
4772
|
window.addEventListener('resize', this._handleWindowResize);
|
|
4673
|
-
if (this.canvascontaineroutside &&
|
|
4773
|
+
if ((_this$canvascontainer = this.canvascontaineroutside) != null && _this$canvascontainer.current && onKeyUp) {
|
|
4674
4774
|
this.canvascontaineroutside.current.focus();
|
|
4675
4775
|
}
|
|
4676
4776
|
this.timer = setInterval(function () {
|
|
@@ -4741,16 +4841,19 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4741
4841
|
onTouchEnd();
|
|
4742
4842
|
};
|
|
4743
4843
|
_proto.handleTouchMoveEvent = function handleTouchMoveEvent(event) {
|
|
4844
|
+
var _event$touches, _touch$target, _target$offsetLeft;
|
|
4744
4845
|
var _this$props3 = this.props,
|
|
4745
4846
|
onTouchMove = _this$props3.onTouchMove,
|
|
4746
4847
|
onCanvasClick = _this$props3.onCanvasClick;
|
|
4747
|
-
var
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4848
|
+
var touch = (_event$touches = event.touches) == null ? void 0 : _event$touches[0];
|
|
4849
|
+
var target = (_touch$target = touch == null ? void 0 : touch.target) != null ? _touch$target : null;
|
|
4850
|
+
// Use ?? so 0 is allowed, and optional chaining for safety
|
|
4851
|
+
var x = touch ? touch.clientX - ((_target$offsetLeft = target == null ? void 0 : target.offsetLeft) != null ? _target$offsetLeft : 0) : undefined;
|
|
4852
|
+
var y = touch == null ? void 0 : touch.clientY;
|
|
4853
|
+
if (x != null && y != null) {
|
|
4854
|
+
onCanvasClick == null || onCanvasClick(x, y, this.currentWidth, this.currentHeight);
|
|
4752
4855
|
}
|
|
4753
|
-
onTouchMove(event, this.currentWidth);
|
|
4856
|
+
onTouchMove == null || onTouchMove(event, this.currentWidth);
|
|
4754
4857
|
};
|
|
4755
4858
|
_proto.handleClickEvent = function handleClickEvent(event) {
|
|
4756
4859
|
var onCanvasClick = this.props.onCanvasClick;
|
|
@@ -4783,11 +4886,12 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4783
4886
|
}
|
|
4784
4887
|
};
|
|
4785
4888
|
_proto.onKeyUp = function onKeyUp(event) {
|
|
4889
|
+
var _this$canvascontainer2;
|
|
4786
4890
|
var onKeyUp = this.props.onKeyUp;
|
|
4787
4891
|
if (onKeyUp) {
|
|
4788
4892
|
onKeyUp(event);
|
|
4789
4893
|
}
|
|
4790
|
-
if (this.canvascontaineroutside &&
|
|
4894
|
+
if ((_this$canvascontainer2 = this.canvascontaineroutside) != null && _this$canvascontainer2.current && onKeyUp) {
|
|
4791
4895
|
if (event.code === 'Escape') {
|
|
4792
4896
|
this.canvascontaineroutside.current.focus();
|
|
4793
4897
|
}
|
|
@@ -4806,7 +4910,7 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4806
4910
|
};
|
|
4807
4911
|
_proto.startLoop = function startLoop() {
|
|
4808
4912
|
var onRenderCanvas = this.props.onRenderCanvas;
|
|
4809
|
-
if (this.mounted
|
|
4913
|
+
if (!this.mounted || !this.loopHasStarted) {
|
|
4810
4914
|
return;
|
|
4811
4915
|
}
|
|
4812
4916
|
if (this.canvas) {
|
|
@@ -4834,7 +4938,7 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4834
4938
|
if (loop !== true) {
|
|
4835
4939
|
this.loopHasStarted = false;
|
|
4836
4940
|
onRenderCanvas(this.ctx, this.currentWidth, this.currentHeight, this.canvas);
|
|
4837
|
-
} else if (this.loopHasStarted
|
|
4941
|
+
} else if (!this.loopHasStarted) {
|
|
4838
4942
|
this.loopHasStarted = true;
|
|
4839
4943
|
this.startLoop();
|
|
4840
4944
|
}
|
|
@@ -4842,14 +4946,14 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4842
4946
|
_proto.resize = function resize() {
|
|
4843
4947
|
var canvascontainer = this.canvascontainer,
|
|
4844
4948
|
resizeCallback = this.props.resizeCallback;
|
|
4845
|
-
if (canvascontainer && canvascontainer.current) {
|
|
4949
|
+
if (canvascontainer != null && canvascontainer.current) {
|
|
4846
4950
|
var newWidth = canvascontainer.current.clientWidth;
|
|
4847
4951
|
var newHeight = canvascontainer.current.clientHeight;
|
|
4848
4952
|
if (newWidth !== undefined && newHeight !== undefined && (this.currentWidth !== newWidth || this.currentHeight !== newHeight)) {
|
|
4849
4953
|
this.currentWidth = newWidth;
|
|
4850
4954
|
this.currentHeight = newHeight;
|
|
4851
4955
|
this.updateCanvas();
|
|
4852
|
-
resizeCallback
|
|
4956
|
+
resizeCallback == null || resizeCallback(newWidth);
|
|
4853
4957
|
}
|
|
4854
4958
|
}
|
|
4855
4959
|
};
|
|
@@ -4858,11 +4962,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4858
4962
|
this.updateCanvas();
|
|
4859
4963
|
this._handleWindowResize();
|
|
4860
4964
|
return jsx("div", {
|
|
4861
|
-
role: "button",
|
|
4862
|
-
ref: this.canvascontaineroutside,
|
|
4863
|
-
tabIndex: 0,
|
|
4864
|
-
onFocus: this.onFocus,
|
|
4865
4965
|
onBlur: this.onBlur,
|
|
4966
|
+
onFocus: this.onFocus,
|
|
4967
|
+
ref: this.canvascontaineroutside,
|
|
4968
|
+
role: "button",
|
|
4866
4969
|
style: {
|
|
4867
4970
|
height: '100%',
|
|
4868
4971
|
width: '100%',
|
|
@@ -4870,7 +4973,9 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4870
4973
|
display: 'block',
|
|
4871
4974
|
overflow: 'hidden'
|
|
4872
4975
|
},
|
|
4976
|
+
tabIndex: 0,
|
|
4873
4977
|
children: jsx("div", {
|
|
4978
|
+
"data-testid": "canvas-container",
|
|
4874
4979
|
ref: this.canvascontainer,
|
|
4875
4980
|
style: {
|
|
4876
4981
|
minWidth: 'inherit',
|
|
@@ -4881,15 +4986,14 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
4881
4986
|
display: 'block',
|
|
4882
4987
|
border: 'none'
|
|
4883
4988
|
},
|
|
4884
|
-
"data-testid": "canvas-container",
|
|
4885
4989
|
children: jsx("div", {
|
|
4990
|
+
"aria-label": "canvas",
|
|
4991
|
+
role: "presentation",
|
|
4886
4992
|
style: {
|
|
4887
4993
|
overflow: 'visible',
|
|
4888
4994
|
width: 0,
|
|
4889
4995
|
height: 0
|
|
4890
4996
|
},
|
|
4891
|
-
role: "presentation",
|
|
4892
|
-
"aria-label": "canvas",
|
|
4893
4997
|
children: jsx("canvas", {
|
|
4894
4998
|
"data-testid": "canvas",
|
|
4895
4999
|
ref: function ref(canvas) {
|
|
@@ -4955,13 +5059,15 @@ var FilterChip = function FilterChip(_ref) {
|
|
|
4955
5059
|
return onClickIcon == null ? void 0 : onClickIcon(chipRef.current, event);
|
|
4956
5060
|
};
|
|
4957
5061
|
return jsx(Chip, {
|
|
4958
|
-
|
|
4959
|
-
|
|
5062
|
+
color: isSelected ? 'secondary' : 'default',
|
|
5063
|
+
deleteIcon: actionIcon,
|
|
5064
|
+
disabled: isDisabled,
|
|
4960
5065
|
id: id,
|
|
4961
5066
|
label: label,
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
5067
|
+
onClick: clickHandler,
|
|
5068
|
+
onDelete: onClickIcon ? clickIconHandler : undefined,
|
|
5069
|
+
ref: chipRef,
|
|
5070
|
+
size: size,
|
|
4965
5071
|
sx: {
|
|
4966
5072
|
borderColor: isDisabled ? 'none' : theme.palette.geowebColors.buttons.tertiary["default"].borderColor,
|
|
4967
5073
|
padding: '0px 4px',
|
|
@@ -4979,9 +5085,7 @@ var FilterChip = function FilterChip(_ref) {
|
|
|
4979
5085
|
borderColor: 'transparent'
|
|
4980
5086
|
}
|
|
4981
5087
|
},
|
|
4982
|
-
|
|
4983
|
-
deleteIcon: actionIcon,
|
|
4984
|
-
onDelete: onClickIcon ? clickIconHandler : undefined
|
|
5088
|
+
variant: isSelected ? 'filled' : 'outlined'
|
|
4985
5089
|
});
|
|
4986
5090
|
};
|
|
4987
5091
|
|
|
@@ -4995,32 +5099,32 @@ var FilterList = function FilterList(_ref) {
|
|
|
4995
5099
|
var _useSharedTranslation = useSharedTranslation(),
|
|
4996
5100
|
t = _useSharedTranslation.t;
|
|
4997
5101
|
return jsxs(Stack, {
|
|
4998
|
-
direction: "row",
|
|
4999
|
-
"data-testid": "filterList",
|
|
5000
5102
|
className: "filter-list",
|
|
5103
|
+
"data-testid": "filterList",
|
|
5104
|
+
direction: "row",
|
|
5001
5105
|
flexWrap: "wrap",
|
|
5002
5106
|
sx: {
|
|
5003
5107
|
gap: 1,
|
|
5004
5108
|
rowGap: 1
|
|
5005
5109
|
},
|
|
5006
5110
|
children: [jsx(FilterChip, {
|
|
5007
|
-
id: "all",
|
|
5008
|
-
label: t('shared-filter-all'),
|
|
5009
|
-
isSelected: isAllSelected,
|
|
5010
5111
|
handleClick: function handleClick(key) {
|
|
5011
5112
|
return onChipClick(key, !isAllSelected);
|
|
5012
|
-
}
|
|
5113
|
+
},
|
|
5114
|
+
id: "all",
|
|
5115
|
+
isSelected: isAllSelected,
|
|
5116
|
+
label: t('shared-filter-all')
|
|
5013
5117
|
}), filters.map(function (filter) {
|
|
5014
5118
|
return jsx(FilterChip, {
|
|
5015
|
-
id: filter.id,
|
|
5016
|
-
label: t(filter.label),
|
|
5017
|
-
isSelected: isAllSelected ? false : filter.isSelected,
|
|
5018
|
-
isDisabled: filter.isDisabled,
|
|
5019
5119
|
handleClick: function handleClick(key) {
|
|
5020
5120
|
// If they are all isSelected ensure that if one is clicked that one will be the only one set to selected
|
|
5021
5121
|
var selected = isAllSelected ? true : !filter.isSelected;
|
|
5022
5122
|
onChipClick(key, selected);
|
|
5023
|
-
}
|
|
5123
|
+
},
|
|
5124
|
+
id: filter.id,
|
|
5125
|
+
isDisabled: filter.isDisabled,
|
|
5126
|
+
isSelected: isAllSelected ? false : filter.isSelected,
|
|
5127
|
+
label: t(filter.label)
|
|
5024
5128
|
}, filter.id);
|
|
5025
5129
|
})]
|
|
5026
5130
|
});
|
|
@@ -5030,19 +5134,19 @@ var DEBOUNCE_TIMEOUT = 300;
|
|
|
5030
5134
|
var SearchButton = function SearchButton(_ref) {
|
|
5031
5135
|
var label = _ref.label;
|
|
5032
5136
|
return jsx(CustomIconButton, {
|
|
5033
|
-
tooltipTitle: label,
|
|
5034
5137
|
edge: "end",
|
|
5035
5138
|
size: "large",
|
|
5139
|
+
tooltipTitle: label,
|
|
5036
5140
|
children: jsx(Search, {})
|
|
5037
5141
|
});
|
|
5038
5142
|
};
|
|
5039
5143
|
var ClearButton = function ClearButton(_ref2) {
|
|
5040
5144
|
var onClick = _ref2.onClick;
|
|
5041
5145
|
return jsx(CustomIconButton, {
|
|
5042
|
-
tooltipTitle: "Clear",
|
|
5043
5146
|
edge: "end",
|
|
5044
5147
|
onClick: onClick,
|
|
5045
5148
|
size: "large",
|
|
5149
|
+
tooltipTitle: "Clear",
|
|
5046
5150
|
children: jsx(Clear, {})
|
|
5047
5151
|
});
|
|
5048
5152
|
};
|
|
@@ -5059,21 +5163,14 @@ var SearchField = function SearchField(_ref3) {
|
|
|
5059
5163
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5060
5164
|
var handleValueChangeDebounced = React.useCallback(debounce$1(valueChanged, DEBOUNCE_TIMEOUT), []);
|
|
5061
5165
|
return jsx(TextField, {
|
|
5062
|
-
variant: "filled",
|
|
5063
|
-
size: "small",
|
|
5064
|
-
sx: {
|
|
5065
|
-
'& input': {
|
|
5066
|
-
paddingTop: '18px'
|
|
5067
|
-
}
|
|
5068
|
-
},
|
|
5069
|
-
label: label,
|
|
5070
|
-
value: localValue,
|
|
5071
5166
|
autoFocus: true,
|
|
5072
5167
|
fullWidth: true,
|
|
5168
|
+
label: label,
|
|
5073
5169
|
onChange: function onChange(e) {
|
|
5074
5170
|
handleValueChangeDebounced(e.target.value);
|
|
5075
5171
|
setLocalValue(e.target.value);
|
|
5076
5172
|
},
|
|
5173
|
+
size: "small",
|
|
5077
5174
|
slotProps: {
|
|
5078
5175
|
input: {
|
|
5079
5176
|
endAdornment: jsx(InputAdornment, {
|
|
@@ -5088,7 +5185,14 @@ var SearchField = function SearchField(_ref3) {
|
|
|
5088
5185
|
})
|
|
5089
5186
|
})
|
|
5090
5187
|
}
|
|
5091
|
-
}
|
|
5188
|
+
},
|
|
5189
|
+
sx: {
|
|
5190
|
+
'& input': {
|
|
5191
|
+
paddingTop: '18px'
|
|
5192
|
+
}
|
|
5193
|
+
},
|
|
5194
|
+
value: localValue,
|
|
5195
|
+
variant: "filled"
|
|
5092
5196
|
});
|
|
5093
5197
|
};
|
|
5094
5198
|
|
|
@@ -5104,11 +5208,11 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5104
5208
|
searchQuery = _ref.searchQuery,
|
|
5105
5209
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
5106
5210
|
return jsx(Box, {
|
|
5211
|
+
ref: ref,
|
|
5107
5212
|
sx: Object.assign({
|
|
5108
5213
|
marginBottom: '8px',
|
|
5109
5214
|
width: '100%'
|
|
5110
|
-
}, props.sx),
|
|
5111
|
-
ref: ref,
|
|
5215
|
+
}, Array.isArray(props.sx) ? Object.assign.apply(Object, [{}].concat(props.sx)) : props.sx),
|
|
5112
5216
|
children: jsxs(Stack, {
|
|
5113
5217
|
spacing: 1,
|
|
5114
5218
|
children: [jsx(SearchField, {
|
|
@@ -5116,8 +5220,8 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5116
5220
|
valueChanged: onSearch
|
|
5117
5221
|
}), jsx(FilterList, {
|
|
5118
5222
|
filters: filters,
|
|
5119
|
-
|
|
5120
|
-
|
|
5223
|
+
isAllSelected: isAllSelected,
|
|
5224
|
+
onChipClick: onClickFilterChip
|
|
5121
5225
|
})]
|
|
5122
5226
|
})
|
|
5123
5227
|
});
|
|
@@ -5138,30 +5242,23 @@ var FilterOption = function FilterOption(_ref) {
|
|
|
5138
5242
|
return setShowOnly(show);
|
|
5139
5243
|
}, 100);
|
|
5140
5244
|
return jsx(ListItem, {
|
|
5141
|
-
disablePadding: true,
|
|
5142
5245
|
dense: true,
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
minWidth: '300px',
|
|
5146
|
-
paddingRight: '0px',
|
|
5147
|
-
marginLeft: '-12px',
|
|
5148
|
-
fontSize: '12px'
|
|
5149
|
-
},
|
|
5150
|
-
secondaryAction: showOnly && jsx(CustomIconButton, {
|
|
5246
|
+
disablePadding: true,
|
|
5247
|
+
secondaryAction: showOnly ? jsx(CustomIconButton, {
|
|
5151
5248
|
"aria-label": "Only " + label,
|
|
5152
|
-
style: {
|
|
5153
|
-
backgroundColor: 'transparent',
|
|
5154
|
-
width: 'auto'
|
|
5155
|
-
},
|
|
5156
5249
|
edge: "end",
|
|
5157
5250
|
onClick: function onClick() {
|
|
5158
5251
|
return _onClick(!checked, true);
|
|
5159
5252
|
},
|
|
5253
|
+
onMouseOut: function onMouseOut() {
|
|
5254
|
+
return updateShowOnly(false);
|
|
5255
|
+
},
|
|
5160
5256
|
onMouseOver: function onMouseOver() {
|
|
5161
5257
|
return updateShowOnly(true);
|
|
5162
5258
|
},
|
|
5163
|
-
|
|
5164
|
-
|
|
5259
|
+
style: {
|
|
5260
|
+
backgroundColor: 'transparent',
|
|
5261
|
+
width: 'auto'
|
|
5165
5262
|
},
|
|
5166
5263
|
children: jsx(Typography, {
|
|
5167
5264
|
sx: {
|
|
@@ -5171,20 +5268,27 @@ var FilterOption = function FilterOption(_ref) {
|
|
|
5171
5268
|
},
|
|
5172
5269
|
children: t('shared-only')
|
|
5173
5270
|
})
|
|
5174
|
-
}),
|
|
5271
|
+
}) : null,
|
|
5272
|
+
sx: {
|
|
5273
|
+
width: '100%',
|
|
5274
|
+
minWidth: '300px',
|
|
5275
|
+
paddingRight: '0px',
|
|
5276
|
+
marginLeft: '-12px',
|
|
5277
|
+
fontSize: '12px'
|
|
5278
|
+
},
|
|
5175
5279
|
children: jsxs(ListItemButton, {
|
|
5176
|
-
|
|
5280
|
+
dense: true,
|
|
5281
|
+
disableGutters: true,
|
|
5177
5282
|
onClick: function onClick() {
|
|
5178
5283
|
return _onClick(!checked);
|
|
5179
5284
|
},
|
|
5180
|
-
onMouseOver: function onMouseOver() {
|
|
5181
|
-
return updateShowOnly(true);
|
|
5182
|
-
},
|
|
5183
5285
|
onMouseOut: function onMouseOut() {
|
|
5184
5286
|
return updateShowOnly(false);
|
|
5185
5287
|
},
|
|
5186
|
-
|
|
5187
|
-
|
|
5288
|
+
onMouseOver: function onMouseOver() {
|
|
5289
|
+
return updateShowOnly(true);
|
|
5290
|
+
},
|
|
5291
|
+
role: undefined,
|
|
5188
5292
|
sx: {
|
|
5189
5293
|
padding: 0
|
|
5190
5294
|
},
|
|
@@ -5194,20 +5298,20 @@ var FilterOption = function FilterOption(_ref) {
|
|
|
5194
5298
|
},
|
|
5195
5299
|
children: jsx(Checkbox, {
|
|
5196
5300
|
checked: checked,
|
|
5197
|
-
tabIndex: -1,
|
|
5198
5301
|
disableRipple: true,
|
|
5302
|
+
name: optionId,
|
|
5199
5303
|
slotProps: {
|
|
5200
5304
|
input: {
|
|
5201
5305
|
'aria-labelledby': optionId,
|
|
5202
5306
|
'aria-label': optionId
|
|
5203
5307
|
}
|
|
5204
5308
|
},
|
|
5205
|
-
|
|
5309
|
+
tabIndex: -1
|
|
5206
5310
|
})
|
|
5207
5311
|
}), jsx(ListItemText, {
|
|
5208
5312
|
id: optionId,
|
|
5209
5313
|
primary: jsx(Box, {
|
|
5210
|
-
sx:
|
|
5314
|
+
sx: labelStyle,
|
|
5211
5315
|
children: label
|
|
5212
5316
|
})
|
|
5213
5317
|
})]
|
|
@@ -5215,18 +5319,21 @@ var FilterOption = function FilterOption(_ref) {
|
|
|
5215
5319
|
});
|
|
5216
5320
|
};
|
|
5217
5321
|
|
|
5218
|
-
var _excluded = ["isDark", "children"];
|
|
5322
|
+
var _excluded = ["isDark", "children", "sx"];
|
|
5219
5323
|
var StorybookDocsWrapper = function StorybookDocsWrapper(_ref) {
|
|
5220
5324
|
var _ref$isDark = _ref.isDark,
|
|
5221
5325
|
isDark = _ref$isDark === void 0 ? false : _ref$isDark,
|
|
5222
5326
|
children = _ref.children,
|
|
5327
|
+
_ref$sx = _ref.sx,
|
|
5328
|
+
sx = _ref$sx === void 0 ? [] : _ref$sx,
|
|
5223
5329
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
5224
|
-
return jsx(Box, {
|
|
5225
|
-
sx:
|
|
5330
|
+
return jsx(Box, Object.assign({
|
|
5331
|
+
sx: [].concat(isDark ? [{
|
|
5226
5332
|
backgroundColor: 'geowebColors.background.surfaceBrowser'
|
|
5227
|
-
},
|
|
5333
|
+
}] : [], Array.isArray(sx) ? sx : [sx])
|
|
5334
|
+
}, props, {
|
|
5228
5335
|
children: children
|
|
5229
|
-
});
|
|
5336
|
+
}));
|
|
5230
5337
|
};
|
|
5231
5338
|
|
|
5232
5339
|
/* *
|
|
@@ -5263,7 +5370,7 @@ var getAxiosErrorMessage = function getAxiosErrorMessage(error) {
|
|
|
5263
5370
|
if (data && typeof data === 'string') {
|
|
5264
5371
|
return data;
|
|
5265
5372
|
}
|
|
5266
|
-
if (data && data.message && typeof data.message === 'string') {
|
|
5373
|
+
if (data != null && data.message && typeof data.message === 'string') {
|
|
5267
5374
|
return data.message;
|
|
5268
5375
|
}
|
|
5269
5376
|
if (error.message) {
|
|
@@ -5279,7 +5386,7 @@ var getErrorMessage = function getErrorMessage(error) {
|
|
|
5279
5386
|
};
|
|
5280
5387
|
var getAxiosWarningMessage = function getAxiosWarningMessage(error) {
|
|
5281
5388
|
var data = error.response && error.response.data;
|
|
5282
|
-
if (data && data.WarningMessage && typeof data.WarningMessage === 'string') {
|
|
5389
|
+
if (data != null && data.WarningMessage && typeof data.WarningMessage === 'string') {
|
|
5283
5390
|
return data.WarningMessage;
|
|
5284
5391
|
}
|
|
5285
5392
|
return '';
|
|
@@ -5289,8 +5396,9 @@ var getWarningMessage = function getWarningMessage(error) {
|
|
|
5289
5396
|
return getAxiosWarningMessage(error);
|
|
5290
5397
|
}
|
|
5291
5398
|
try {
|
|
5399
|
+
var _message$WarningMessa;
|
|
5292
5400
|
var message = JSON.parse(error.message);
|
|
5293
|
-
return message.WarningMessage
|
|
5401
|
+
return (_message$WarningMessa = message.WarningMessage) != null ? _message$WarningMessa : '';
|
|
5294
5402
|
} catch (_unused) {
|
|
5295
5403
|
return '';
|
|
5296
5404
|
}
|
|
@@ -5314,6 +5422,7 @@ var getWarningMessage = function getWarningMessage(error) {
|
|
|
5314
5422
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5315
5423
|
* */
|
|
5316
5424
|
var DATE_FORMAT_DATEPICKER = 'dd/MM/yyyy HH:mm';
|
|
5425
|
+
var DATE_FORMAT_DATEPICKER_NO_YEAR = 'dd/MM HH:mm';
|
|
5317
5426
|
var DATE_FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
|
5318
5427
|
var DATE_FORMAT_YEAR = 'yyyy-MM-dd';
|
|
5319
5428
|
var DATE_FORMAT_HOURS = 'HH:mm';
|
|
@@ -5539,7 +5648,7 @@ var isBetween = function isBetween(date, from, to, inclusivity) {
|
|
|
5539
5648
|
if (!['()', '[]', '(]', '[)'].includes(inclusivity)) {
|
|
5540
5649
|
throw new Error('Inclusivity parameter must be one of (), [], (], [)');
|
|
5541
5650
|
}
|
|
5542
|
-
var isBeforeEqual = inclusivity
|
|
5651
|
+
var isBeforeEqual = inclusivity.startsWith('[');
|
|
5543
5652
|
var isAfterEqual = inclusivity[1] === ']';
|
|
5544
5653
|
return (isBeforeEqual ? isEqual(from, date) || isBefore(from, date) : isBefore(from, date)) && (isAfterEqual ? isEqual(to, date) || isAfter(to, date) : isAfter(to, date));
|
|
5545
5654
|
};
|
|
@@ -5701,13 +5810,15 @@ var isAfter = function isAfter(date, dateToCompare) {
|
|
|
5701
5810
|
* @returns {Date} - Date in UTC, or current date when something invalid is passed.
|
|
5702
5811
|
*/
|
|
5703
5812
|
var utc = function utc(dateStr) {
|
|
5813
|
+
var _isoStringToDate2;
|
|
5704
5814
|
if (!dateStr) {
|
|
5705
5815
|
return createDate();
|
|
5706
5816
|
}
|
|
5707
5817
|
if (hasOffset(dateStr)) {
|
|
5708
|
-
|
|
5818
|
+
var _isoStringToDate;
|
|
5819
|
+
return (_isoStringToDate = isoStringToDate(dateStr, false)) != null ? _isoStringToDate : createDate();
|
|
5709
5820
|
}
|
|
5710
|
-
return isoStringToDate(dateStr)
|
|
5821
|
+
return (_isoStringToDate2 = isoStringToDate(dateStr)) != null ? _isoStringToDate2 : createDate();
|
|
5711
5822
|
};
|
|
5712
5823
|
/**
|
|
5713
5824
|
* Parsing string to a date. Stricter check, will return undefined when dateString is invalid.
|
|
@@ -5728,7 +5839,7 @@ var hasOffset = function hasOffset(dateStr) {
|
|
|
5728
5839
|
};
|
|
5729
5840
|
var getOffsetStr = function getOffsetStr(dateStr) {
|
|
5730
5841
|
var offsetMatcher = /T.*([+-]\d{2}(:?\d{2})?|Z)$/;
|
|
5731
|
-
var groups =
|
|
5842
|
+
var groups = offsetMatcher.exec(dateStr);
|
|
5732
5843
|
return groups ? groups[1] : null;
|
|
5733
5844
|
};
|
|
5734
5845
|
/**
|
|
@@ -5941,7 +6052,7 @@ var convertNOWFormatToUTC = function convertNOWFormatToUTC(timeValue) {
|
|
|
5941
6052
|
var now = new Date();
|
|
5942
6053
|
var today = startOfDay(now);
|
|
5943
6054
|
var regex = /(NOW|TODAY)([+-])PT(\d+)H(\d+)M/;
|
|
5944
|
-
var matches =
|
|
6055
|
+
var matches = regex.exec(timeValue);
|
|
5945
6056
|
if (matches) {
|
|
5946
6057
|
var base = matches[1] === 'NOW' ? now : today;
|
|
5947
6058
|
var sign = matches[2] === '+' ? 1 : -1;
|
|
@@ -5960,7 +6071,7 @@ var convertNOWandTODAYFormatsToUTC = function convertNOWandTODAYFormatsToUTC(tim
|
|
|
5960
6071
|
var now = new Date();
|
|
5961
6072
|
var today = startOfDayUTC(now);
|
|
5962
6073
|
var regex = /(NOW|TODAY)([+-])PT(\d+)H(\d+)M/;
|
|
5963
|
-
var matches =
|
|
6074
|
+
var matches = regex.exec(timeValue);
|
|
5964
6075
|
if (matches) {
|
|
5965
6076
|
var base = matches[1] === 'NOW' ? now : today;
|
|
5966
6077
|
var sign = matches[2] === '+' ? 1 : -1;
|
|
@@ -6015,6 +6126,7 @@ var setSeconds = function setSeconds(date, seconds) {
|
|
|
6015
6126
|
var index = /*#__PURE__*/Object.freeze({
|
|
6016
6127
|
__proto__: null,
|
|
6017
6128
|
DATE_FORMAT_DATEPICKER: DATE_FORMAT_DATEPICKER,
|
|
6129
|
+
DATE_FORMAT_DATEPICKER_NO_YEAR: DATE_FORMAT_DATEPICKER_NO_YEAR,
|
|
6018
6130
|
DATE_FORMAT_HOURS: DATE_FORMAT_HOURS,
|
|
6019
6131
|
DATE_FORMAT_NAME_OF_DAY: DATE_FORMAT_NAME_OF_DAY,
|
|
6020
6132
|
DATE_FORMAT_NAME_OF_DAY_MONTH: DATE_FORMAT_NAME_OF_DAY_MONTH,
|
|
@@ -6208,7 +6320,8 @@ var RenderCounter = /*#__PURE__*/function () {
|
|
|
6208
6320
|
// console.log('numRenders', id, this.get(id));
|
|
6209
6321
|
};
|
|
6210
6322
|
_proto.get = function get(id) {
|
|
6211
|
-
|
|
6323
|
+
var _this$numRenders$get;
|
|
6324
|
+
return (_this$numRenders$get = this.numRenders.get(id)) != null ? _this$numRenders$get : 0;
|
|
6212
6325
|
};
|
|
6213
6326
|
return RenderCounter;
|
|
6214
6327
|
}();
|
|
@@ -6245,7 +6358,8 @@ var sessionStorageProvider = {
|
|
|
6245
6358
|
return sessionStorage.setItem(SessionStorageKey.CONFIG, JSON.stringify(value));
|
|
6246
6359
|
},
|
|
6247
6360
|
getConfig: function getConfig() {
|
|
6248
|
-
|
|
6361
|
+
var _sessionStorage$getIt;
|
|
6362
|
+
return JSON.parse((_sessionStorage$getIt = sessionStorage.getItem(SessionStorageKey.CONFIG)) != null ? _sessionStorage$getIt : '{}');
|
|
6249
6363
|
},
|
|
6250
6364
|
setOauthState: function setOauthState(value) {
|
|
6251
6365
|
return sessionStorage.setItem(SessionStorageKey.OAUTH_STATE, value);
|
|
@@ -6314,4 +6428,4 @@ var SystemScope = {
|
|
|
6314
6428
|
system: 'system'
|
|
6315
6429
|
};
|
|
6316
6430
|
|
|
6317
|
-
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, 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, UserMenuItemSentryRecording, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
|
6431
|
+
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, 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, UserMenuItemSentryRecording, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|