@opengeoweb/shared 12.1.2 → 12.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +611 -405
- package/package.json +3 -4
- package/src/index.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationButtons.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +1 -1
- package/src/lib/components/CustomDialog/CustomDialog.d.ts +3 -1
- package/src/lib/components/CustomDialog/CustomDialog.stories.d.ts +3 -0
- package/src/lib/components/CustomDialog/CustomDialogHeader.d.ts +13 -0
- package/src/lib/components/CustomDialog/CustomDialogHeader.spec.d.ts +1 -0
- package/src/lib/components/CustomDialog/CustomDialogHeader.stories.d.ts +11 -0
- package/src/lib/components/CustomDialog/index.d.ts +1 -0
- package/src/lib/components/CustomDialog/types.d.ts +1 -0
- package/src/lib/components/LastUpdateTime/LastUpdateTime.d.ts +2 -1
- package/src/lib/components/TooltipSelect/TooltipSelect.d.ts +4 -0
- package/src/lib/types/types.d.ts +8 -6
- package/src/lib/utils/i18n.d.ts +7 -0
- package/src/lib/utils/i18n.spec.d.ts +1 -0
- package/src/lib/utils/index.d.ts +2 -1
- package/src/lib/utils/sessionStorage.d.ts +28 -0
- package/src/lib/utils/sessionStorage.spec.d.ts +1 -0
- package/src/lib/utils/reduxTestUtils/createMockStore.d.ts +0 -2
- package/src/lib/utils/reduxTestUtils/index.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Typography, Tooltip, IconButton,
|
|
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
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, Component, useState } from 'react';
|
|
5
|
-
import { Resize, Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
|
|
6
5
|
import Draggable from 'react-draggable';
|
|
7
6
|
import { Resizable } from 're-resizable';
|
|
7
|
+
import { Resize, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, KeyOption, ArrowLeft, ArrowRight, KeyCommand, ArrowUp, ArrowDown, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
|
|
8
8
|
import 'i18next';
|
|
9
|
-
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
10
10
|
import { throttle, escapeRegExp, debounce } from 'lodash';
|
|
11
11
|
import * as Sentry from '@sentry/react';
|
|
12
12
|
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$1, getHours as getHours$1, startOfDay, addMinutes, addHours, setSeconds as setSeconds$1, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
13
|
-
import { configureStore } from '@reduxjs/toolkit';
|
|
14
13
|
|
|
15
14
|
var en = {
|
|
16
15
|
"shared-choose-app-mode": "Choose your default app mode",
|
|
@@ -72,7 +71,8 @@ var en = {
|
|
|
72
71
|
"shared-filter-system-presets": "System presets",
|
|
73
72
|
"shared-filter-shared-presets": "Shared presets",
|
|
74
73
|
"shared-filter-search": "Search",
|
|
75
|
-
"shared-only": "ONLY"
|
|
74
|
+
"shared-only": "ONLY",
|
|
75
|
+
"shared-customdialog-back": "Back"
|
|
76
76
|
};
|
|
77
77
|
var fi = {
|
|
78
78
|
"shared-choose-app-mode": "Sovelluksen väriteema",
|
|
@@ -134,7 +134,8 @@ var fi = {
|
|
|
134
134
|
"shared-filter-system-presets": "Järestelmä presetit",
|
|
135
135
|
"shared-filter-shared-presets": "ei käännetty",
|
|
136
136
|
"shared-filter-search": "Etsi",
|
|
137
|
-
"shared-only": "Pelkästään"
|
|
137
|
+
"shared-only": "Pelkästään",
|
|
138
|
+
"shared-customdialog-back": "PALAA TAKAISIN"
|
|
138
139
|
};
|
|
139
140
|
var no = {
|
|
140
141
|
"shared-choose-app-mode": "Velg din standardmodus",
|
|
@@ -196,7 +197,8 @@ var no = {
|
|
|
196
197
|
"shared-filter-system-presets": "System presets",
|
|
197
198
|
"shared-filter-shared-presets": "Delte arbeidsflater",
|
|
198
199
|
"shared-filter-search": "Søk",
|
|
199
|
-
"shared-only": "BARE"
|
|
200
|
+
"shared-only": "BARE",
|
|
201
|
+
"shared-customdialog-back": "Tilbake"
|
|
200
202
|
};
|
|
201
203
|
var nl = {
|
|
202
204
|
"shared-choose-app-mode": "Kies je standaard app-modus",
|
|
@@ -258,7 +260,8 @@ var nl = {
|
|
|
258
260
|
"shared-filter-system-presets": "Systeem presets",
|
|
259
261
|
"shared-filter-shared-presets": "Gedeelde presets",
|
|
260
262
|
"shared-filter-search": "Zoeken",
|
|
261
|
-
"shared-only": "ALLEEN"
|
|
263
|
+
"shared-only": "ALLEEN",
|
|
264
|
+
"shared-customdialog-back": "Terug"
|
|
262
265
|
};
|
|
263
266
|
var sharedTranslations = {
|
|
264
267
|
en: en,
|
|
@@ -299,7 +302,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
299
302
|
if (null == r) return {};
|
|
300
303
|
var t = {};
|
|
301
304
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
302
|
-
if (e.indexOf(n)
|
|
305
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
303
306
|
t[n] = r[n];
|
|
304
307
|
}
|
|
305
308
|
return t;
|
|
@@ -322,9 +325,9 @@ function _regeneratorRuntime() {
|
|
|
322
325
|
function define(t, e, r) {
|
|
323
326
|
return Object.defineProperty(t, e, {
|
|
324
327
|
value: r,
|
|
325
|
-
enumerable:
|
|
326
|
-
configurable:
|
|
327
|
-
writable:
|
|
328
|
+
enumerable: true,
|
|
329
|
+
configurable: true,
|
|
330
|
+
writable: true
|
|
328
331
|
}), t[e];
|
|
329
332
|
}
|
|
330
333
|
try {
|
|
@@ -417,7 +420,7 @@ function _regeneratorRuntime() {
|
|
|
417
420
|
if ("throw" === i) throw a;
|
|
418
421
|
return {
|
|
419
422
|
value: t,
|
|
420
|
-
done:
|
|
423
|
+
done: true
|
|
421
424
|
};
|
|
422
425
|
}
|
|
423
426
|
for (n.method = i, n.arg = a;;) {
|
|
@@ -468,7 +471,7 @@ function _regeneratorRuntime() {
|
|
|
468
471
|
function Context(t) {
|
|
469
472
|
this.tryEntries = [{
|
|
470
473
|
tryLoc: "root"
|
|
471
|
-
}], t.forEach(pushTryEntry, this), this.reset(
|
|
474
|
+
}], t.forEach(pushTryEntry, this), this.reset(true);
|
|
472
475
|
}
|
|
473
476
|
function values(e) {
|
|
474
477
|
if (e || "" === e) {
|
|
@@ -478,8 +481,8 @@ function _regeneratorRuntime() {
|
|
|
478
481
|
if (!isNaN(e.length)) {
|
|
479
482
|
var o = -1,
|
|
480
483
|
i = function next() {
|
|
481
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done =
|
|
482
|
-
return next.value = t, next.done =
|
|
484
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
|
|
485
|
+
return next.value = t, next.done = true, next;
|
|
483
486
|
};
|
|
484
487
|
return i.next = i;
|
|
485
488
|
}
|
|
@@ -488,10 +491,10 @@ function _regeneratorRuntime() {
|
|
|
488
491
|
}
|
|
489
492
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
490
493
|
value: GeneratorFunctionPrototype,
|
|
491
|
-
configurable:
|
|
494
|
+
configurable: true
|
|
492
495
|
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
493
496
|
value: GeneratorFunction,
|
|
494
|
-
configurable:
|
|
497
|
+
configurable: true
|
|
495
498
|
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
496
499
|
var e = "function" == typeof t && t.constructor;
|
|
497
500
|
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
@@ -520,17 +523,17 @@ function _regeneratorRuntime() {
|
|
|
520
523
|
return r.reverse(), function next() {
|
|
521
524
|
for (; r.length;) {
|
|
522
525
|
var t = r.pop();
|
|
523
|
-
if (t in e) return next.value = t, next.done =
|
|
526
|
+
if (t in e) return next.value = t, next.done = false, next;
|
|
524
527
|
}
|
|
525
|
-
return next.done =
|
|
528
|
+
return next.done = true, next;
|
|
526
529
|
};
|
|
527
530
|
}, e.values = values, Context.prototype = {
|
|
528
531
|
constructor: Context,
|
|
529
532
|
reset: function (e) {
|
|
530
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done =
|
|
533
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
531
534
|
},
|
|
532
535
|
stop: function () {
|
|
533
|
-
this.done =
|
|
536
|
+
this.done = true;
|
|
534
537
|
var t = this.tryEntries[0].completion;
|
|
535
538
|
if ("throw" === t.type) throw t.arg;
|
|
536
539
|
return this.rval;
|
|
@@ -549,10 +552,10 @@ function _regeneratorRuntime() {
|
|
|
549
552
|
var c = n.call(i, "catchLoc"),
|
|
550
553
|
u = n.call(i, "finallyLoc");
|
|
551
554
|
if (c && u) {
|
|
552
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
555
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
553
556
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
554
557
|
} else if (c) {
|
|
555
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
558
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
556
559
|
} else {
|
|
557
560
|
if (!u) throw Error("try statement without catch or finally");
|
|
558
561
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
@@ -674,96 +677,14 @@ var StatusTag = function StatusTag(_ref) {
|
|
|
674
677
|
});
|
|
675
678
|
};
|
|
676
679
|
|
|
677
|
-
var
|
|
678
|
-
var useControlledTooltip = function useControlledTooltip() {
|
|
679
|
-
var _React$useState = React.useState(false),
|
|
680
|
-
tooltipOpen = _React$useState[0],
|
|
681
|
-
setTooltipOpen = _React$useState[1];
|
|
682
|
-
var _React$useState2 = React.useState(false),
|
|
683
|
-
delayedTooltip = _React$useState2[0],
|
|
684
|
-
setDelayedTooltip = _React$useState2[1];
|
|
685
|
-
React.useEffect(function () {
|
|
686
|
-
if (tooltipOpen === true) {
|
|
687
|
-
var timer = setTimeout(function () {
|
|
688
|
-
return setDelayedTooltip(true);
|
|
689
|
-
}, defaultDelay);
|
|
690
|
-
return function () {
|
|
691
|
-
clearTimeout(timer);
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
|
-
setDelayedTooltip(false);
|
|
695
|
-
return function () {};
|
|
696
|
-
}, [tooltipOpen]);
|
|
697
|
-
return [delayedTooltip, setTooltipOpen];
|
|
698
|
-
};
|
|
699
|
-
var CustomTooltip = function CustomTooltip(props) {
|
|
700
|
-
return jsx(Tooltip, Object.assign({}, props, {
|
|
701
|
-
enterDelay: defaultDelay,
|
|
702
|
-
enterNextDelay: defaultDelay,
|
|
703
|
-
disableInteractive: true
|
|
704
|
-
}));
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
var _excluded$d = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps"];
|
|
708
|
-
var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
709
|
-
var _ref$tooltipTitle = _ref.tooltipTitle,
|
|
710
|
-
defaultTooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
|
|
711
|
-
_ref$variant = _ref.variant,
|
|
712
|
-
variant = _ref$variant === void 0 ? 'flat' : _ref$variant,
|
|
713
|
-
_ref$isSelected = _ref.isSelected,
|
|
714
|
-
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
715
|
-
_ref$shouldShowAsDisa = _ref.shouldShowAsDisabled,
|
|
716
|
-
shouldShowAsDisabled = _ref$shouldShowAsDisa === void 0 ? false : _ref$shouldShowAsDisa,
|
|
717
|
-
_ref$size = _ref.size,
|
|
718
|
-
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
719
|
-
children = _ref.children,
|
|
720
|
-
className = _ref.className,
|
|
721
|
-
defaultTooltipProps = _ref.tooltipProps,
|
|
722
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
723
|
-
var classNames = [].concat(className ? [className] : [], isSelected ? ['Mui-selected'] : [], [variant]).join(' ');
|
|
724
|
-
var tooltipTitle = (defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) || defaultTooltipTitle;
|
|
725
|
-
var tooltipProps = React.useMemo(function () {
|
|
726
|
-
return Object.assign({}, defaultTooltipProps, {
|
|
727
|
-
title: tooltipTitle,
|
|
728
|
-
placement: (defaultTooltipProps == null ? void 0 : defaultTooltipProps.placement) || 'top',
|
|
729
|
-
sx: {
|
|
730
|
-
pointerEvents: 'none'
|
|
731
|
-
}
|
|
732
|
-
});
|
|
733
|
-
}, [defaultTooltipProps, tooltipTitle]);
|
|
734
|
-
var renderIconButton = function renderIconButton() {
|
|
735
|
-
return jsx(IconButton, Object.assign({
|
|
736
|
-
"aria-label": tooltipTitle
|
|
737
|
-
}, props, {
|
|
738
|
-
size: size,
|
|
739
|
-
className: classNames,
|
|
740
|
-
ref: ref,
|
|
741
|
-
"aria-pressed": isSelected,
|
|
742
|
-
sx: Object.assign({}, props.sx, shouldShowAsDisabled && {
|
|
743
|
-
'&.MuiIconButton-root': {
|
|
744
|
-
color: "geowebColors.iconButtons." + variant + ".disabled.color"
|
|
745
|
-
},
|
|
746
|
-
'&.Mui-focusVisible': {
|
|
747
|
-
color: "geowebColors.iconButtons." + variant + ".default.color"
|
|
748
|
-
}
|
|
749
|
-
}),
|
|
750
|
-
children: children
|
|
751
|
-
}));
|
|
752
|
-
};
|
|
753
|
-
return tooltipTitle && !props.disabled ? jsx(CustomTooltip, Object.assign({}, tooltipProps, {
|
|
754
|
-
children: renderIconButton()
|
|
755
|
-
})) : renderIconButton();
|
|
756
|
-
});
|
|
757
|
-
var CustomIconButton = /*#__PURE__*/React.memo(CustomIconButtonNoMemo);
|
|
758
|
-
|
|
759
|
-
var _excluded$c = ["bounds", "setIsDragging", "children", "onStop"];
|
|
680
|
+
var _excluded$d = ["bounds", "setIsDragging", "children", "onStop"];
|
|
760
681
|
var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
761
682
|
var _ref$bounds = _ref.bounds,
|
|
762
683
|
bounds = _ref$bounds === void 0 ? 'body' : _ref$bounds,
|
|
763
684
|
setIsDragging = _ref.setIsDragging,
|
|
764
685
|
children = _ref.children,
|
|
765
686
|
onStop = _ref.onStop,
|
|
766
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
687
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
767
688
|
var onDragStart = function onDragStart(e) {
|
|
768
689
|
// This makes sure that nothing is selected during drag
|
|
769
690
|
setIsDragging && setIsDragging(true);
|
|
@@ -785,7 +706,7 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
|
785
706
|
}));
|
|
786
707
|
};
|
|
787
708
|
|
|
788
|
-
var _excluded$
|
|
709
|
+
var _excluded$c = ["children", "onResizeStart", "onResizeStop", "size", "setSize", "minHeight", "minWidth", "enable", "nodeRef"];
|
|
789
710
|
var isDraggingClassName = 'is-dragging';
|
|
790
711
|
var useBoundsProps = function useBoundsProps(nodeRef) {
|
|
791
712
|
var _React$useState = React__default.useState({}),
|
|
@@ -828,7 +749,7 @@ var ResizeComponent = function ResizeComponent(_ref) {
|
|
|
828
749
|
topLeft: true
|
|
829
750
|
} : _ref$enable,
|
|
830
751
|
nodeRef = _ref.nodeRef,
|
|
831
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
752
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
832
753
|
var theme = useTheme();
|
|
833
754
|
var onStartResize = React__default.useCallback(function (event, _direction, node) {
|
|
834
755
|
event.stopPropagation();
|
|
@@ -893,8 +814,444 @@ var ResizeComponent = function ResizeComponent(_ref) {
|
|
|
893
814
|
}));
|
|
894
815
|
};
|
|
895
816
|
|
|
817
|
+
var defaultDelay = 1000;
|
|
818
|
+
var useControlledTooltip = function useControlledTooltip() {
|
|
819
|
+
var _React$useState = React.useState(false),
|
|
820
|
+
tooltipOpen = _React$useState[0],
|
|
821
|
+
setTooltipOpen = _React$useState[1];
|
|
822
|
+
var _React$useState2 = React.useState(false),
|
|
823
|
+
delayedTooltip = _React$useState2[0],
|
|
824
|
+
setDelayedTooltip = _React$useState2[1];
|
|
825
|
+
React.useEffect(function () {
|
|
826
|
+
if (tooltipOpen === true) {
|
|
827
|
+
var timer = setTimeout(function () {
|
|
828
|
+
return setDelayedTooltip(true);
|
|
829
|
+
}, defaultDelay);
|
|
830
|
+
return function () {
|
|
831
|
+
clearTimeout(timer);
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
setDelayedTooltip(false);
|
|
835
|
+
return function () {};
|
|
836
|
+
}, [tooltipOpen]);
|
|
837
|
+
return [delayedTooltip, setTooltipOpen];
|
|
838
|
+
};
|
|
839
|
+
var CustomTooltip = function CustomTooltip(props) {
|
|
840
|
+
return jsx(Tooltip, Object.assign({}, props, {
|
|
841
|
+
enterDelay: defaultDelay,
|
|
842
|
+
enterNextDelay: defaultDelay,
|
|
843
|
+
disableInteractive: true
|
|
844
|
+
}));
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
var _excluded$b = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps"];
|
|
848
|
+
var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
849
|
+
var _ref$tooltipTitle = _ref.tooltipTitle,
|
|
850
|
+
defaultTooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
|
|
851
|
+
_ref$variant = _ref.variant,
|
|
852
|
+
variant = _ref$variant === void 0 ? 'flat' : _ref$variant,
|
|
853
|
+
_ref$isSelected = _ref.isSelected,
|
|
854
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
855
|
+
_ref$shouldShowAsDisa = _ref.shouldShowAsDisabled,
|
|
856
|
+
shouldShowAsDisabled = _ref$shouldShowAsDisa === void 0 ? false : _ref$shouldShowAsDisa,
|
|
857
|
+
_ref$size = _ref.size,
|
|
858
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
859
|
+
children = _ref.children,
|
|
860
|
+
className = _ref.className,
|
|
861
|
+
defaultTooltipProps = _ref.tooltipProps,
|
|
862
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
863
|
+
var classNames = [].concat(className ? [className] : [], isSelected ? ['Mui-selected'] : [], [variant]).join(' ');
|
|
864
|
+
var tooltipTitle = (defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) || defaultTooltipTitle;
|
|
865
|
+
var tooltipProps = React.useMemo(function () {
|
|
866
|
+
return Object.assign({}, defaultTooltipProps, {
|
|
867
|
+
title: tooltipTitle,
|
|
868
|
+
placement: (defaultTooltipProps == null ? void 0 : defaultTooltipProps.placement) || 'top',
|
|
869
|
+
sx: {
|
|
870
|
+
pointerEvents: 'none'
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}, [defaultTooltipProps, tooltipTitle]);
|
|
874
|
+
var renderIconButton = function renderIconButton() {
|
|
875
|
+
return jsx(IconButton, Object.assign({
|
|
876
|
+
"aria-label": tooltipTitle
|
|
877
|
+
}, props, {
|
|
878
|
+
size: size,
|
|
879
|
+
className: classNames,
|
|
880
|
+
ref: ref,
|
|
881
|
+
"aria-pressed": isSelected,
|
|
882
|
+
sx: Object.assign({}, props.sx, shouldShowAsDisabled && {
|
|
883
|
+
'&.MuiIconButton-root': {
|
|
884
|
+
color: "geowebColors.iconButtons." + variant + ".disabled.color"
|
|
885
|
+
},
|
|
886
|
+
'&.Mui-focusVisible': {
|
|
887
|
+
color: "geowebColors.iconButtons." + variant + ".default.color"
|
|
888
|
+
}
|
|
889
|
+
}),
|
|
890
|
+
children: children
|
|
891
|
+
}));
|
|
892
|
+
};
|
|
893
|
+
return tooltipTitle && !props.disabled ? jsx(CustomTooltip, Object.assign({}, tooltipProps, {
|
|
894
|
+
children: renderIconButton()
|
|
895
|
+
})) : renderIconButton();
|
|
896
|
+
});
|
|
897
|
+
var CustomIconButton = /*#__PURE__*/React.memo(CustomIconButtonNoMemo);
|
|
898
|
+
|
|
899
|
+
var getPosition = function getPosition(menuPosition) {
|
|
900
|
+
switch (menuPosition) {
|
|
901
|
+
case 'bottom':
|
|
902
|
+
return {
|
|
903
|
+
anchorOrigin: {
|
|
904
|
+
vertical: 'bottom',
|
|
905
|
+
horizontal: 'center'
|
|
906
|
+
},
|
|
907
|
+
transformOrigin: {
|
|
908
|
+
vertical: 'top',
|
|
909
|
+
horizontal: 'center'
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
// eslint-disable-next-line default-case-last
|
|
913
|
+
default:
|
|
914
|
+
case 'left':
|
|
915
|
+
return {
|
|
916
|
+
anchorOrigin: {
|
|
917
|
+
vertical: 'center',
|
|
918
|
+
horizontal: 'left'
|
|
919
|
+
},
|
|
920
|
+
transformOrigin: {
|
|
921
|
+
vertical: 'center',
|
|
922
|
+
horizontal: 'right'
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
case 'right':
|
|
926
|
+
return {
|
|
927
|
+
anchorOrigin: {
|
|
928
|
+
vertical: 'center',
|
|
929
|
+
horizontal: 'right'
|
|
930
|
+
},
|
|
931
|
+
transformOrigin: {
|
|
932
|
+
vertical: 'center',
|
|
933
|
+
horizontal: 'left'
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
var ToggleMenu = function ToggleMenu(_ref) {
|
|
939
|
+
var _ref$buttonTestId = _ref.buttonTestId,
|
|
940
|
+
buttonTestId = _ref$buttonTestId === void 0 ? 'toggleMenuButton' : _ref$buttonTestId,
|
|
941
|
+
_ref$menuPosition = _ref.menuPosition,
|
|
942
|
+
menuPosition = _ref$menuPosition === void 0 ? 'left' : _ref$menuPosition,
|
|
943
|
+
menuItems = _ref.menuItems,
|
|
944
|
+
children = _ref.children,
|
|
945
|
+
buttonSx = _ref.buttonSx,
|
|
946
|
+
_ref$tooltipTitle = _ref.tooltipTitle,
|
|
947
|
+
tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
|
|
948
|
+
_ref$menuTitle = _ref.menuTitle,
|
|
949
|
+
menuTitle = _ref$menuTitle === void 0 ? '' : _ref$menuTitle,
|
|
950
|
+
_ref$variant = _ref.variant,
|
|
951
|
+
variant = _ref$variant === void 0 ? 'tool' : _ref$variant,
|
|
952
|
+
_ref$isDefaultOpen = _ref.isDefaultOpen,
|
|
953
|
+
isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen,
|
|
954
|
+
_ref$buttonIcon = _ref.buttonIcon,
|
|
955
|
+
buttonIcon = _ref$buttonIcon === void 0 ? jsx(Options, {}) : _ref$buttonIcon,
|
|
956
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
957
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
958
|
+
var _React$useState = React.useState(null),
|
|
959
|
+
anchorEl = _React$useState[0],
|
|
960
|
+
setAnchorEl = _React$useState[1];
|
|
961
|
+
var isOpen = Boolean(anchorEl);
|
|
962
|
+
var _getPosition = getPosition(menuPosition),
|
|
963
|
+
anchorOrigin = _getPosition.anchorOrigin,
|
|
964
|
+
transformOrigin = _getPosition.transformOrigin;
|
|
965
|
+
var handleClick = function handleClick(event) {
|
|
966
|
+
event.stopPropagation();
|
|
967
|
+
setAnchorEl(event.currentTarget);
|
|
968
|
+
};
|
|
969
|
+
var handleClose = function handleClose(event) {
|
|
970
|
+
event.stopPropagation();
|
|
971
|
+
setAnchorEl(null);
|
|
972
|
+
};
|
|
973
|
+
React.useEffect(function () {
|
|
974
|
+
if (isDefaultOpen) {
|
|
975
|
+
setAnchorEl(document.getElementById(buttonTestId));
|
|
976
|
+
}
|
|
977
|
+
}, [isDefaultOpen, buttonTestId]);
|
|
978
|
+
return jsxs(Fragment, {
|
|
979
|
+
children: [jsx(CustomIconButton, {
|
|
980
|
+
tooltipProps: {
|
|
981
|
+
placement: 'top',
|
|
982
|
+
title: tooltipTitle
|
|
983
|
+
},
|
|
984
|
+
isSelected: isOpen,
|
|
985
|
+
sx: buttonSx,
|
|
986
|
+
onClick: handleClick,
|
|
987
|
+
"data-testid": buttonTestId,
|
|
988
|
+
variant: variant,
|
|
989
|
+
id: buttonTestId,
|
|
990
|
+
disabled: isDisabled,
|
|
991
|
+
children: buttonIcon
|
|
992
|
+
}), jsxs(Menu, {
|
|
993
|
+
anchorEl: anchorEl,
|
|
994
|
+
open: isOpen,
|
|
995
|
+
onClose: function onClose(event, reason) {
|
|
996
|
+
if (reason === 'tabKeyDown') {
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
handleClose(event);
|
|
1000
|
+
},
|
|
1001
|
+
anchorOrigin: anchorOrigin,
|
|
1002
|
+
transformOrigin: transformOrigin,
|
|
1003
|
+
BackdropProps: {
|
|
1004
|
+
style: {
|
|
1005
|
+
opacity: 0,
|
|
1006
|
+
transition: 'none'
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
MenuListProps: Object.assign({}, children && {
|
|
1010
|
+
style: {
|
|
1011
|
+
padding: '0px'
|
|
1012
|
+
}
|
|
1013
|
+
}),
|
|
1014
|
+
children: [menuTitle && jsx(ListSubheader, {
|
|
1015
|
+
"data-testid": "toggleMenuTitle",
|
|
1016
|
+
children: jsx(Typography, {
|
|
1017
|
+
sx: {
|
|
1018
|
+
fontSize: '12px'
|
|
1019
|
+
},
|
|
1020
|
+
children: menuTitle
|
|
1021
|
+
})
|
|
1022
|
+
}), menuItems && menuItems.length ? menuItems.map(function (menuItem) {
|
|
1023
|
+
var text = menuItem.text,
|
|
1024
|
+
icon = menuItem.icon,
|
|
1025
|
+
action = menuItem.action,
|
|
1026
|
+
isDisabled = menuItem.isDisabled;
|
|
1027
|
+
return jsx(MenuItem, {
|
|
1028
|
+
onClick: function onClick(event) {
|
|
1029
|
+
action(event);
|
|
1030
|
+
handleClose(event);
|
|
1031
|
+
},
|
|
1032
|
+
disabled: isDisabled,
|
|
1033
|
+
selected: menuItem.isSelected,
|
|
1034
|
+
children: jsxs(Grid, {
|
|
1035
|
+
container: true,
|
|
1036
|
+
spacing: 2,
|
|
1037
|
+
justifyContent: "space-between",
|
|
1038
|
+
size: "grow",
|
|
1039
|
+
children: [jsx(Grid, {
|
|
1040
|
+
children: jsx(ListItemText, {
|
|
1041
|
+
children: text
|
|
1042
|
+
})
|
|
1043
|
+
}), icon && jsx(Grid, {
|
|
1044
|
+
alignItems: "flex-end",
|
|
1045
|
+
children: jsx(ListItemIcon, {
|
|
1046
|
+
sx: {
|
|
1047
|
+
'&.MuiListItemIcon-root': {
|
|
1048
|
+
minWidth: '24px'
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
children: icon
|
|
1052
|
+
})
|
|
1053
|
+
})]
|
|
1054
|
+
})
|
|
1055
|
+
}, text);
|
|
1056
|
+
}) : jsx("div", {}) // Needed to make the menu work without any menuItems
|
|
1057
|
+
, children]
|
|
1058
|
+
})]
|
|
1059
|
+
});
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
/* *
|
|
1063
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1064
|
+
* you may not use this file except in compliance with the License.
|
|
1065
|
+
* You may obtain a copy of the License at
|
|
1066
|
+
*
|
|
1067
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1068
|
+
*
|
|
1069
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1070
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1071
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1072
|
+
* See the License for the specific language governing permissions and
|
|
1073
|
+
* limitations under the License.
|
|
1074
|
+
*
|
|
1075
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1076
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
1077
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
1078
|
+
* */
|
|
1079
|
+
var SHARED_NAMESPACE = 'shared';
|
|
1080
|
+
var geowebLanguages = ['en', 'fi', 'no', 'nl'];
|
|
1081
|
+
var loadAllTranslations = function loadAllTranslations(i18nInstance, translationsToLoad) {
|
|
1082
|
+
translationsToLoad.forEach(function (_ref) {
|
|
1083
|
+
var ns = _ref.ns,
|
|
1084
|
+
translations = _ref.translations;
|
|
1085
|
+
geowebLanguages.forEach(function (lang) {
|
|
1086
|
+
i18nInstance.addResourceBundle(lang, ns, translations[lang]);
|
|
1087
|
+
});
|
|
1088
|
+
});
|
|
1089
|
+
};
|
|
1090
|
+
var safelyInitI18nForTestsAndStories = function safelyInitI18nForTestsAndStories(i18nInstance, namespace, translationsToLoad, initLanguage) {
|
|
1091
|
+
// This check ensures that we don't init the library many times.
|
|
1092
|
+
// - in tests, the init is done globally, so this should not init
|
|
1093
|
+
// - in stories, this function should init, but only once if called many times
|
|
1094
|
+
if (!i18nInstance.isInitialized && !i18nInstance.isInitializing) {
|
|
1095
|
+
void i18nInstance.use(initReactI18next).init({
|
|
1096
|
+
lng: initLanguage != null ? initLanguage : 'en',
|
|
1097
|
+
ns: namespace,
|
|
1098
|
+
interpolation: {
|
|
1099
|
+
escapeValue: false
|
|
1100
|
+
},
|
|
1101
|
+
resources: {}
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
loadAllTranslations(i18nInstance, translationsToLoad);
|
|
1105
|
+
};
|
|
1106
|
+
var useSharedTranslation = function useSharedTranslation() {
|
|
1107
|
+
return useTranslation([SHARED_NAMESPACE]);
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
var Title = function Title(_ref) {
|
|
1111
|
+
var title = _ref.title;
|
|
1112
|
+
return jsx(Typography, {
|
|
1113
|
+
sx: {
|
|
1114
|
+
fontSize: '16px',
|
|
1115
|
+
fontWeight: 500,
|
|
1116
|
+
height: 24,
|
|
1117
|
+
textOverflow: 'ellipsis',
|
|
1118
|
+
overflow: 'hidden',
|
|
1119
|
+
whiteSpace: 'nowrap',
|
|
1120
|
+
color: 'geowebColors.typographyAndIcons.text'
|
|
1121
|
+
},
|
|
1122
|
+
"data-testid": "customDialog-title",
|
|
1123
|
+
component: "span",
|
|
1124
|
+
children: title
|
|
1125
|
+
});
|
|
1126
|
+
};
|
|
1127
|
+
var CustomDialogHeader = function CustomDialogHeader(_ref2) {
|
|
1128
|
+
var headerActions = _ref2.headerActions,
|
|
1129
|
+
title = _ref2.title,
|
|
1130
|
+
onClose = _ref2.onClose;
|
|
1131
|
+
var _useSharedTranslation = useSharedTranslation(),
|
|
1132
|
+
t = _useSharedTranslation.t;
|
|
1133
|
+
return !headerActions ? jsxs(DialogTitle, {
|
|
1134
|
+
id: "dialog-title",
|
|
1135
|
+
sx: {
|
|
1136
|
+
zIndex: 1,
|
|
1137
|
+
padding: 2,
|
|
1138
|
+
display: 'flex',
|
|
1139
|
+
justifyContent: 'space-between',
|
|
1140
|
+
alignItems: 'center'
|
|
1141
|
+
},
|
|
1142
|
+
children: [title && jsx(Title, {
|
|
1143
|
+
title: title
|
|
1144
|
+
}), jsx(CustomIconButton, {
|
|
1145
|
+
"data-testid": "customDialog-close",
|
|
1146
|
+
"aria-label": "close",
|
|
1147
|
+
onClick: function onClick() {
|
|
1148
|
+
return onClose('CLOSED');
|
|
1149
|
+
},
|
|
1150
|
+
sx: {
|
|
1151
|
+
'&.MuiIconButton-root': {
|
|
1152
|
+
color: 'geowebColors.greys.accessible'
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
children: jsx(Close, {
|
|
1156
|
+
"data-testid": "CloseIcon"
|
|
1157
|
+
})
|
|
1158
|
+
})]
|
|
1159
|
+
}) : jsxs(Grid, {
|
|
1160
|
+
container: true,
|
|
1161
|
+
"data-testid": "dialog-action-header",
|
|
1162
|
+
alignItems: "center",
|
|
1163
|
+
sx: {
|
|
1164
|
+
boxShadow: 1,
|
|
1165
|
+
py: 0.5,
|
|
1166
|
+
px: 1,
|
|
1167
|
+
zIndex: 1
|
|
1168
|
+
},
|
|
1169
|
+
"aria-label": "Dialog options header",
|
|
1170
|
+
children: [jsx(Grid, {
|
|
1171
|
+
size: 4,
|
|
1172
|
+
children: jsx(Button, {
|
|
1173
|
+
onClick: function onClick() {
|
|
1174
|
+
return onClose('CLOSED');
|
|
1175
|
+
},
|
|
1176
|
+
variant: "flat",
|
|
1177
|
+
"aria-label": "close",
|
|
1178
|
+
startIcon: jsx(ChevronLeft, {}),
|
|
1179
|
+
"data-testid": "contentdialog-close",
|
|
1180
|
+
sx: {
|
|
1181
|
+
textTransform: 'uppercase'
|
|
1182
|
+
},
|
|
1183
|
+
children: t('shared-customdialog-back')
|
|
1184
|
+
})
|
|
1185
|
+
}), jsx(Grid, {
|
|
1186
|
+
sx: {
|
|
1187
|
+
display: 'flex',
|
|
1188
|
+
justifyContent: 'center',
|
|
1189
|
+
textAlign: 'center'
|
|
1190
|
+
},
|
|
1191
|
+
size: 4,
|
|
1192
|
+
children: title && jsx(Title, {
|
|
1193
|
+
title: title
|
|
1194
|
+
})
|
|
1195
|
+
}), jsx(Grid, {
|
|
1196
|
+
size: 4,
|
|
1197
|
+
children: jsx(Box, {
|
|
1198
|
+
sx: {
|
|
1199
|
+
display: 'flex',
|
|
1200
|
+
justifyContent: 'flex-end',
|
|
1201
|
+
'button:not(:first-of-type)': {
|
|
1202
|
+
marginLeft: 1
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
children: jsxs(Box, {
|
|
1206
|
+
children: [jsx(Box, {
|
|
1207
|
+
display: {
|
|
1208
|
+
xs: 'none',
|
|
1209
|
+
lg: 'flex'
|
|
1210
|
+
},
|
|
1211
|
+
children: headerActions.map(function (_ref3) {
|
|
1212
|
+
var action = _ref3.action,
|
|
1213
|
+
text = _ref3.text,
|
|
1214
|
+
variant = _ref3.variant,
|
|
1215
|
+
_ref3$isDisabled = _ref3.isDisabled,
|
|
1216
|
+
isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled;
|
|
1217
|
+
return jsx(Button, {
|
|
1218
|
+
onClick: action,
|
|
1219
|
+
variant: variant || 'flat',
|
|
1220
|
+
sx: {
|
|
1221
|
+
minWidth: 96
|
|
1222
|
+
},
|
|
1223
|
+
disabled: isDisabled,
|
|
1224
|
+
children: text
|
|
1225
|
+
}, text + "-" + variant);
|
|
1226
|
+
})
|
|
1227
|
+
}), jsx(Box, {
|
|
1228
|
+
display: {
|
|
1229
|
+
sm: 'block',
|
|
1230
|
+
lg: 'none'
|
|
1231
|
+
},
|
|
1232
|
+
children: headerActions.length > 0 && jsx(ToggleMenu, {
|
|
1233
|
+
menuItems: headerActions.map(function (_ref4) {
|
|
1234
|
+
var text = _ref4.text,
|
|
1235
|
+
action = _ref4.action,
|
|
1236
|
+
isDisabled = _ref4.isDisabled,
|
|
1237
|
+
isSelected = _ref4.isSelected;
|
|
1238
|
+
return {
|
|
1239
|
+
text: text,
|
|
1240
|
+
action: action,
|
|
1241
|
+
isDisabled: isDisabled,
|
|
1242
|
+
isSelected: isSelected
|
|
1243
|
+
};
|
|
1244
|
+
})
|
|
1245
|
+
})
|
|
1246
|
+
})]
|
|
1247
|
+
})
|
|
1248
|
+
})
|
|
1249
|
+
})]
|
|
1250
|
+
});
|
|
1251
|
+
};
|
|
1252
|
+
|
|
896
1253
|
var _excluded$a = ["defaultSize", "onResizeStop", "hasLayout"],
|
|
897
|
-
_excluded2$2 = ["title", "onClose", "description", "actions", "children", "sx", "resizableDefaultSize", "isResizable", "hasLayout", "shouldRenderInline", "slotProps", "disableRestoreFocus"];
|
|
1254
|
+
_excluded2$2 = ["title", "onClose", "description", "actions", "children", "sx", "resizableDefaultSize", "isResizable", "hasLayout", "shouldRenderInline", "slotProps", "disableRestoreFocus", "headerActions"];
|
|
898
1255
|
var PaperComponent = function PaperComponent(_ref) {
|
|
899
1256
|
var _ref$defaultSize = _ref.defaultSize,
|
|
900
1257
|
defaultSize = _ref$defaultSize === void 0 ? {
|
|
@@ -968,25 +1325,28 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
968
1325
|
slotProps = _ref2.slotProps,
|
|
969
1326
|
_ref2$disableRestoreF = _ref2.disableRestoreFocus,
|
|
970
1327
|
disableRestoreFocus = _ref2$disableRestoreF === void 0 ? true : _ref2$disableRestoreF,
|
|
1328
|
+
headerActions = _ref2.headerActions,
|
|
971
1329
|
other = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
972
1330
|
var _React$useState = React.useState(resizableDefaultSize),
|
|
973
1331
|
size = _React$useState[0],
|
|
974
1332
|
setSize = _React$useState[1];
|
|
975
1333
|
return jsx(Dialog, Object.assign({
|
|
976
1334
|
"data-testid": "customDialog",
|
|
977
|
-
PaperProps: {
|
|
978
|
-
sx: Object.assign({
|
|
979
|
-
width: '560px',
|
|
980
|
-
margin: 2.5
|
|
981
|
-
}, sx)
|
|
982
|
-
},
|
|
983
1335
|
// fix for briefly showing default options when closing dialog
|
|
984
1336
|
transitionDuration: 0,
|
|
985
1337
|
onClose: function onClose() {
|
|
986
1338
|
_onClose('CLOSED');
|
|
987
1339
|
},
|
|
988
1340
|
"aria-labelledby": "dialog-title",
|
|
989
|
-
slotProps: Object.assign({}, slotProps,
|
|
1341
|
+
slotProps: Object.assign({}, slotProps, {
|
|
1342
|
+
paper: {
|
|
1343
|
+
sx: Object.assign({}, !other.fullWidth && !other.maxWidth && {
|
|
1344
|
+
maxWidth: '560px'
|
|
1345
|
+
}, other.maxWidth && {
|
|
1346
|
+
maxWidth: other.maxWidth
|
|
1347
|
+
}, sx)
|
|
1348
|
+
}
|
|
1349
|
+
}, isResizable && {
|
|
990
1350
|
paper: {
|
|
991
1351
|
defaultSize: size,
|
|
992
1352
|
onResizeStop: setSize,
|
|
@@ -1004,51 +1364,23 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
1004
1364
|
}
|
|
1005
1365
|
}
|
|
1006
1366
|
})
|
|
1007
|
-
}, isResizable && {
|
|
1008
|
-
PaperComponent: PaperComponent
|
|
1009
|
-
}, shouldRenderInline && {
|
|
1010
|
-
disablePortal: true
|
|
1011
|
-
}, {
|
|
1012
|
-
sx: Object.assign({}, sx, isResizable && {
|
|
1013
|
-
'.custom-dialog-resize': {
|
|
1014
|
-
height: 'initial'
|
|
1015
|
-
}
|
|
1016
|
-
}),
|
|
1017
|
-
disableRestoreFocus: disableRestoreFocus
|
|
1018
|
-
}, other, {
|
|
1019
|
-
children: hasLayout ? jsxs(Fragment, {
|
|
1020
|
-
children: [
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
padding: 2,
|
|
1025
|
-
display: 'flex',
|
|
1026
|
-
justifyContent: 'space-between',
|
|
1027
|
-
alignItems: 'center'
|
|
1028
|
-
},
|
|
1029
|
-
children: [jsx(Typography, {
|
|
1030
|
-
sx: {
|
|
1031
|
-
fontSize: '16px',
|
|
1032
|
-
fontWeight: 500
|
|
1033
|
-
},
|
|
1034
|
-
"data-testid": "customDialog-title",
|
|
1035
|
-
component: "span",
|
|
1036
|
-
children: title
|
|
1037
|
-
}), jsx(CustomIconButton, {
|
|
1038
|
-
"data-testid": "customDialog-close",
|
|
1039
|
-
"aria-label": "close",
|
|
1040
|
-
onClick: function onClick() {
|
|
1041
|
-
return _onClose('CLOSED');
|
|
1042
|
-
},
|
|
1043
|
-
sx: {
|
|
1044
|
-
'&.MuiIconButton-root': {
|
|
1045
|
-
color: 'geowebColors.greys.accessible'
|
|
1046
|
-
}
|
|
1047
|
-
},
|
|
1048
|
-
children: jsx(Close, {
|
|
1049
|
-
"data-testid": "CloseIcon"
|
|
1050
|
-
})
|
|
1051
|
-
})]
|
|
1367
|
+
}, isResizable && {
|
|
1368
|
+
PaperComponent: PaperComponent
|
|
1369
|
+
}, shouldRenderInline && {
|
|
1370
|
+
disablePortal: true
|
|
1371
|
+
}, {
|
|
1372
|
+
sx: Object.assign({}, sx, isResizable && {
|
|
1373
|
+
'.custom-dialog-resize': {
|
|
1374
|
+
height: 'initial'
|
|
1375
|
+
}
|
|
1376
|
+
}),
|
|
1377
|
+
disableRestoreFocus: disableRestoreFocus
|
|
1378
|
+
}, other, {
|
|
1379
|
+
children: hasLayout ? jsxs(Fragment, {
|
|
1380
|
+
children: [jsx(CustomDialogHeader, {
|
|
1381
|
+
title: title,
|
|
1382
|
+
headerActions: headerActions,
|
|
1383
|
+
onClose: _onClose
|
|
1052
1384
|
}), jsxs(DialogContent, {
|
|
1053
1385
|
sx: {
|
|
1054
1386
|
padding: '8px 16px'
|
|
@@ -1057,7 +1389,7 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
1057
1389
|
variant: "body1",
|
|
1058
1390
|
children: description
|
|
1059
1391
|
}), children]
|
|
1060
|
-
}), jsx(DialogActions, {
|
|
1392
|
+
}), !headerActions && jsx(DialogActions, {
|
|
1061
1393
|
sx: {
|
|
1062
1394
|
padding: 2,
|
|
1063
1395
|
flexDirection: {
|
|
@@ -1071,28 +1403,6 @@ var CustomDialog = function CustomDialog(_ref2) {
|
|
|
1071
1403
|
}));
|
|
1072
1404
|
};
|
|
1073
1405
|
|
|
1074
|
-
/* *
|
|
1075
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1076
|
-
* you may not use this file except in compliance with the License.
|
|
1077
|
-
* You may obtain a copy of the License at
|
|
1078
|
-
*
|
|
1079
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1080
|
-
*
|
|
1081
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1082
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1083
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1084
|
-
* See the License for the specific language governing permissions and
|
|
1085
|
-
* limitations under the License.
|
|
1086
|
-
*
|
|
1087
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1088
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1089
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1090
|
-
* */
|
|
1091
|
-
var SHARED_NAMESPACE = 'shared';
|
|
1092
|
-
var useSharedTranslation = function useSharedTranslation() {
|
|
1093
|
-
return useTranslation([SHARED_NAMESPACE]);
|
|
1094
|
-
};
|
|
1095
|
-
|
|
1096
1406
|
var confirmStyle = {
|
|
1097
1407
|
width: {
|
|
1098
1408
|
xs: '100%',
|
|
@@ -2025,6 +2335,8 @@ var styles$4 = {
|
|
|
2025
2335
|
backgroundColor: 'geowebColors.background.surface'
|
|
2026
2336
|
},
|
|
2027
2337
|
userMenu: {
|
|
2338
|
+
maxHeight: 'calc(100vh - 40px)',
|
|
2339
|
+
overflowY: 'auto',
|
|
2028
2340
|
padding: 0,
|
|
2029
2341
|
'& > li': {
|
|
2030
2342
|
paddingTop: 3,
|
|
@@ -2045,8 +2357,10 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2045
2357
|
initials = _ref.initials,
|
|
2046
2358
|
_ref$isAdmin = _ref.isAdmin,
|
|
2047
2359
|
isAdmin = _ref$isAdmin === void 0 ? false : _ref$isAdmin;
|
|
2360
|
+
var toggleRef = useRef(null);
|
|
2048
2361
|
return jsxs(Fragment, {
|
|
2049
2362
|
children: [jsx(CustomIconButton, {
|
|
2363
|
+
ref: toggleRef,
|
|
2050
2364
|
"data-testid": "userButton",
|
|
2051
2365
|
onClick: onToggle,
|
|
2052
2366
|
sx: {
|
|
@@ -2082,7 +2396,13 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
2082
2396
|
sx: styles$4.container,
|
|
2083
2397
|
"data-testid": "userMenu",
|
|
2084
2398
|
children: jsx(ClickAwayListener, {
|
|
2085
|
-
onClickAway:
|
|
2399
|
+
onClickAway: function onClickAway(event) {
|
|
2400
|
+
var _toggleRef$current;
|
|
2401
|
+
if ((_toggleRef$current = toggleRef.current) != null && _toggleRef$current.contains(event.target)) {
|
|
2402
|
+
return; // don't close here if clicking the toggle
|
|
2403
|
+
}
|
|
2404
|
+
onClose();
|
|
2405
|
+
},
|
|
2086
2406
|
mouseEvent: "onMouseDown",
|
|
2087
2407
|
children: jsx(MenuList, {
|
|
2088
2408
|
sx: styles$4.userMenu,
|
|
@@ -2103,11 +2423,11 @@ var MenuItemTheme = function MenuItemTheme(_ref) {
|
|
|
2103
2423
|
t = _useTranslation.t;
|
|
2104
2424
|
return jsx(MenuItem, {
|
|
2105
2425
|
divider: true,
|
|
2106
|
-
children: jsxs(
|
|
2426
|
+
children: jsxs(Grid, {
|
|
2107
2427
|
container: true,
|
|
2108
|
-
children: [jsx(
|
|
2428
|
+
children: [jsx(Grid, {
|
|
2109
2429
|
children: t('shared-choose-app-mode')
|
|
2110
|
-
}), jsx(
|
|
2430
|
+
}), jsx(Grid, {
|
|
2111
2431
|
children: jsxs(RadioGroup, {
|
|
2112
2432
|
onChange: function onChange(event, value) {
|
|
2113
2433
|
if (value && setThemeName) {
|
|
@@ -2258,7 +2578,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2258
2578
|
}),
|
|
2259
2579
|
role: "heading",
|
|
2260
2580
|
"aria-label": "toolheader",
|
|
2261
|
-
children: jsxs(
|
|
2581
|
+
children: jsxs(Grid, {
|
|
2262
2582
|
container: true,
|
|
2263
2583
|
alignItems: "center",
|
|
2264
2584
|
sx: {
|
|
@@ -2266,14 +2586,14 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2266
2586
|
height: styles.height
|
|
2267
2587
|
},
|
|
2268
2588
|
justifyContent: "space-between",
|
|
2269
|
-
children: [jsx(
|
|
2589
|
+
children: [jsx(Grid, {
|
|
2270
2590
|
className: "header-left",
|
|
2271
2591
|
sx: {
|
|
2272
2592
|
paddingRight: 1
|
|
2273
2593
|
},
|
|
2274
2594
|
size: columnSizeLeft,
|
|
2275
2595
|
children: leftHeaderComponent && leftHeaderComponent
|
|
2276
|
-
}), jsx(
|
|
2596
|
+
}), jsx(Grid, {
|
|
2277
2597
|
className: "header-title",
|
|
2278
2598
|
size: title ? columnSizeTitle : 0,
|
|
2279
2599
|
container: true,
|
|
@@ -2295,7 +2615,7 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
2295
2615
|
role: "heading",
|
|
2296
2616
|
children: title
|
|
2297
2617
|
})
|
|
2298
|
-
}), jsxs(
|
|
2618
|
+
}), jsxs(Grid, {
|
|
2299
2619
|
className: "header-right",
|
|
2300
2620
|
container: true,
|
|
2301
2621
|
justifyContent: "flex-end",
|
|
@@ -3135,13 +3455,13 @@ var ShortcutList = function ShortcutList(_ref) {
|
|
|
3135
3455
|
minHeight: 56
|
|
3136
3456
|
},
|
|
3137
3457
|
divider: index !== shortcuts.length - 1,
|
|
3138
|
-
children: jsxs(
|
|
3458
|
+
children: jsxs(Grid, {
|
|
3139
3459
|
container: true,
|
|
3140
3460
|
direction: "row",
|
|
3141
3461
|
justifyContent: "space-between",
|
|
3142
3462
|
alignItems: "center",
|
|
3143
3463
|
size: "grow",
|
|
3144
|
-
children: [jsx(
|
|
3464
|
+
children: [jsx(Grid, {
|
|
3145
3465
|
sx: {
|
|
3146
3466
|
fontSize: 12,
|
|
3147
3467
|
fontWeight: 300,
|
|
@@ -3149,7 +3469,7 @@ var ShortcutList = function ShortcutList(_ref) {
|
|
|
3149
3469
|
opacity: 0.67
|
|
3150
3470
|
},
|
|
3151
3471
|
children: t(shortcut.titleKey)
|
|
3152
|
-
}), jsx(
|
|
3472
|
+
}), jsx(Grid, {
|
|
3153
3473
|
children: jsx(Box, {
|
|
3154
3474
|
sx: {
|
|
3155
3475
|
alignItems: 'center'
|
|
@@ -3235,9 +3555,9 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
|
|
|
3235
3555
|
"data-testid": "cheatsheet-btn",
|
|
3236
3556
|
onClick: onOpen,
|
|
3237
3557
|
divider: true,
|
|
3238
|
-
children: jsx(
|
|
3558
|
+
children: jsx(Grid, {
|
|
3239
3559
|
container: true,
|
|
3240
|
-
children: jsx(
|
|
3560
|
+
children: jsx(Grid, {
|
|
3241
3561
|
children: t('shared-cheat-sheet')
|
|
3242
3562
|
})
|
|
3243
3563
|
})
|
|
@@ -3378,9 +3698,9 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3378
3698
|
"data-testid": "sentryRecording-btn",
|
|
3379
3699
|
onClick: onOpen,
|
|
3380
3700
|
divider: true,
|
|
3381
|
-
children: jsx(
|
|
3701
|
+
children: jsx(Grid, {
|
|
3382
3702
|
container: true,
|
|
3383
|
-
children: jsx(
|
|
3703
|
+
children: jsx(Grid, {
|
|
3384
3704
|
children: t('shared-sentry-recording')
|
|
3385
3705
|
})
|
|
3386
3706
|
})
|
|
@@ -3400,14 +3720,14 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3400
3720
|
isOpen: true,
|
|
3401
3721
|
onClose: onClose,
|
|
3402
3722
|
bounds: "parent",
|
|
3403
|
-
children: jsxs(
|
|
3723
|
+
children: jsxs(Grid, {
|
|
3404
3724
|
container: true,
|
|
3405
3725
|
spacing: 4,
|
|
3406
3726
|
sx: {
|
|
3407
3727
|
paddingLeft: '70px',
|
|
3408
3728
|
paddingRight: '70px'
|
|
3409
3729
|
},
|
|
3410
|
-
children: [jsx(
|
|
3730
|
+
children: [jsx(Grid, {
|
|
3411
3731
|
container: true,
|
|
3412
3732
|
justifyContent: "center",
|
|
3413
3733
|
sx: {
|
|
@@ -3416,7 +3736,7 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3416
3736
|
children: jsx(Typography, {
|
|
3417
3737
|
children: t('shared-sentry-information')
|
|
3418
3738
|
})
|
|
3419
|
-
}), jsx(
|
|
3739
|
+
}), jsx(Grid, {
|
|
3420
3740
|
container: true,
|
|
3421
3741
|
justifyContent: "center",
|
|
3422
3742
|
sx: {
|
|
@@ -3425,7 +3745,7 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3425
3745
|
children: jsx(Typography, {
|
|
3426
3746
|
children: t('shared-sentry-enable-message')
|
|
3427
3747
|
})
|
|
3428
|
-
}), jsxs(
|
|
3748
|
+
}), jsxs(Grid, {
|
|
3429
3749
|
container: true,
|
|
3430
3750
|
alignItems: "center",
|
|
3431
3751
|
direction: "column",
|
|
@@ -3438,7 +3758,7 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3438
3758
|
}) : jsxs(Typography, {
|
|
3439
3759
|
children: [" ", t('shared-sentry-enable')]
|
|
3440
3760
|
})]
|
|
3441
|
-
}), jsxs(
|
|
3761
|
+
}), jsxs(Grid, {
|
|
3442
3762
|
container: true,
|
|
3443
3763
|
alignItems: "center",
|
|
3444
3764
|
direction: "column",
|
|
@@ -3462,7 +3782,7 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
|
|
|
3462
3782
|
children: ["(", t('shared-sentry-cors-wait'), ")"]
|
|
3463
3783
|
})]
|
|
3464
3784
|
})]
|
|
3465
|
-
}), jsx(
|
|
3785
|
+
}), jsx(Grid, {
|
|
3466
3786
|
container: true,
|
|
3467
3787
|
justifyContent: "center",
|
|
3468
3788
|
children: jsx(Typography, {
|
|
@@ -3666,169 +3986,6 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3666
3986
|
}, props));
|
|
3667
3987
|
});
|
|
3668
3988
|
|
|
3669
|
-
var getPosition = function getPosition(menuPosition) {
|
|
3670
|
-
switch (menuPosition) {
|
|
3671
|
-
case 'bottom':
|
|
3672
|
-
return {
|
|
3673
|
-
anchorOrigin: {
|
|
3674
|
-
vertical: 'bottom',
|
|
3675
|
-
horizontal: 'center'
|
|
3676
|
-
},
|
|
3677
|
-
transformOrigin: {
|
|
3678
|
-
vertical: 'top',
|
|
3679
|
-
horizontal: 'center'
|
|
3680
|
-
}
|
|
3681
|
-
};
|
|
3682
|
-
// eslint-disable-next-line default-case-last
|
|
3683
|
-
default:
|
|
3684
|
-
case 'left':
|
|
3685
|
-
return {
|
|
3686
|
-
anchorOrigin: {
|
|
3687
|
-
vertical: 'center',
|
|
3688
|
-
horizontal: 'left'
|
|
3689
|
-
},
|
|
3690
|
-
transformOrigin: {
|
|
3691
|
-
vertical: 'center',
|
|
3692
|
-
horizontal: 'right'
|
|
3693
|
-
}
|
|
3694
|
-
};
|
|
3695
|
-
case 'right':
|
|
3696
|
-
return {
|
|
3697
|
-
anchorOrigin: {
|
|
3698
|
-
vertical: 'center',
|
|
3699
|
-
horizontal: 'right'
|
|
3700
|
-
},
|
|
3701
|
-
transformOrigin: {
|
|
3702
|
-
vertical: 'center',
|
|
3703
|
-
horizontal: 'left'
|
|
3704
|
-
}
|
|
3705
|
-
};
|
|
3706
|
-
}
|
|
3707
|
-
};
|
|
3708
|
-
var ToggleMenu = function ToggleMenu(_ref) {
|
|
3709
|
-
var _ref$buttonTestId = _ref.buttonTestId,
|
|
3710
|
-
buttonTestId = _ref$buttonTestId === void 0 ? 'toggleMenuButton' : _ref$buttonTestId,
|
|
3711
|
-
_ref$menuPosition = _ref.menuPosition,
|
|
3712
|
-
menuPosition = _ref$menuPosition === void 0 ? 'left' : _ref$menuPosition,
|
|
3713
|
-
menuItems = _ref.menuItems,
|
|
3714
|
-
children = _ref.children,
|
|
3715
|
-
buttonSx = _ref.buttonSx,
|
|
3716
|
-
_ref$tooltipTitle = _ref.tooltipTitle,
|
|
3717
|
-
tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
|
|
3718
|
-
_ref$menuTitle = _ref.menuTitle,
|
|
3719
|
-
menuTitle = _ref$menuTitle === void 0 ? '' : _ref$menuTitle,
|
|
3720
|
-
_ref$variant = _ref.variant,
|
|
3721
|
-
variant = _ref$variant === void 0 ? 'tool' : _ref$variant,
|
|
3722
|
-
_ref$isDefaultOpen = _ref.isDefaultOpen,
|
|
3723
|
-
isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen,
|
|
3724
|
-
_ref$buttonIcon = _ref.buttonIcon,
|
|
3725
|
-
buttonIcon = _ref$buttonIcon === void 0 ? jsx(Options, {}) : _ref$buttonIcon,
|
|
3726
|
-
_ref$isDisabled = _ref.isDisabled,
|
|
3727
|
-
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
3728
|
-
var _React$useState = React.useState(null),
|
|
3729
|
-
anchorEl = _React$useState[0],
|
|
3730
|
-
setAnchorEl = _React$useState[1];
|
|
3731
|
-
var isOpen = Boolean(anchorEl);
|
|
3732
|
-
var _getPosition = getPosition(menuPosition),
|
|
3733
|
-
anchorOrigin = _getPosition.anchorOrigin,
|
|
3734
|
-
transformOrigin = _getPosition.transformOrigin;
|
|
3735
|
-
var handleClick = function handleClick(event) {
|
|
3736
|
-
event.stopPropagation();
|
|
3737
|
-
setAnchorEl(event.currentTarget);
|
|
3738
|
-
};
|
|
3739
|
-
var handleClose = function handleClose(event) {
|
|
3740
|
-
event.stopPropagation();
|
|
3741
|
-
setAnchorEl(null);
|
|
3742
|
-
};
|
|
3743
|
-
React.useEffect(function () {
|
|
3744
|
-
if (isDefaultOpen) {
|
|
3745
|
-
setAnchorEl(document.getElementById(buttonTestId));
|
|
3746
|
-
}
|
|
3747
|
-
}, [isDefaultOpen, buttonTestId]);
|
|
3748
|
-
return jsxs(Fragment, {
|
|
3749
|
-
children: [jsx(CustomIconButton, {
|
|
3750
|
-
tooltipProps: {
|
|
3751
|
-
placement: 'top',
|
|
3752
|
-
title: tooltipTitle
|
|
3753
|
-
},
|
|
3754
|
-
isSelected: isOpen,
|
|
3755
|
-
sx: buttonSx,
|
|
3756
|
-
onClick: handleClick,
|
|
3757
|
-
"data-testid": buttonTestId,
|
|
3758
|
-
variant: variant,
|
|
3759
|
-
id: buttonTestId,
|
|
3760
|
-
disabled: isDisabled,
|
|
3761
|
-
children: buttonIcon
|
|
3762
|
-
}), jsxs(Menu, {
|
|
3763
|
-
anchorEl: anchorEl,
|
|
3764
|
-
open: isOpen,
|
|
3765
|
-
onClose: function onClose(event, reason) {
|
|
3766
|
-
if (reason === 'tabKeyDown') {
|
|
3767
|
-
return;
|
|
3768
|
-
}
|
|
3769
|
-
handleClose(event);
|
|
3770
|
-
},
|
|
3771
|
-
anchorOrigin: anchorOrigin,
|
|
3772
|
-
transformOrigin: transformOrigin,
|
|
3773
|
-
BackdropProps: {
|
|
3774
|
-
style: {
|
|
3775
|
-
opacity: 0,
|
|
3776
|
-
transition: 'none'
|
|
3777
|
-
}
|
|
3778
|
-
},
|
|
3779
|
-
MenuListProps: Object.assign({}, children && {
|
|
3780
|
-
style: {
|
|
3781
|
-
padding: '0px'
|
|
3782
|
-
}
|
|
3783
|
-
}),
|
|
3784
|
-
children: [menuTitle && jsx(ListSubheader, {
|
|
3785
|
-
"data-testid": "toggleMenuTitle",
|
|
3786
|
-
children: jsx(Typography, {
|
|
3787
|
-
sx: {
|
|
3788
|
-
fontSize: '12px'
|
|
3789
|
-
},
|
|
3790
|
-
children: menuTitle
|
|
3791
|
-
})
|
|
3792
|
-
}), menuItems && menuItems.length ? menuItems.map(function (menuItem) {
|
|
3793
|
-
var text = menuItem.text,
|
|
3794
|
-
icon = menuItem.icon,
|
|
3795
|
-
action = menuItem.action,
|
|
3796
|
-
isDisabled = menuItem.isDisabled;
|
|
3797
|
-
return jsx(MenuItem, {
|
|
3798
|
-
onClick: function onClick(event) {
|
|
3799
|
-
action(event);
|
|
3800
|
-
handleClose(event);
|
|
3801
|
-
},
|
|
3802
|
-
disabled: isDisabled,
|
|
3803
|
-
selected: menuItem.isSelected,
|
|
3804
|
-
children: jsxs(Grid2, {
|
|
3805
|
-
container: true,
|
|
3806
|
-
spacing: 2,
|
|
3807
|
-
justifyContent: "space-between",
|
|
3808
|
-
size: "grow",
|
|
3809
|
-
children: [jsx(Grid2, {
|
|
3810
|
-
children: jsx(ListItemText, {
|
|
3811
|
-
children: text
|
|
3812
|
-
})
|
|
3813
|
-
}), icon && jsx(Grid2, {
|
|
3814
|
-
alignItems: "flex-end",
|
|
3815
|
-
children: jsx(ListItemIcon, {
|
|
3816
|
-
sx: {
|
|
3817
|
-
'&.MuiListItemIcon-root': {
|
|
3818
|
-
minWidth: '24px'
|
|
3819
|
-
}
|
|
3820
|
-
},
|
|
3821
|
-
children: icon
|
|
3822
|
-
})
|
|
3823
|
-
})]
|
|
3824
|
-
})
|
|
3825
|
-
}, text);
|
|
3826
|
-
}) : jsx("div", {}) // Needed to make the menu work without any menuItems
|
|
3827
|
-
, children]
|
|
3828
|
-
})]
|
|
3829
|
-
});
|
|
3830
|
-
};
|
|
3831
|
-
|
|
3832
3989
|
var _excluded$4 = ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange", "isEnabled", "hasBackgroundColor", "variant", "additionalStyling", "skipLocalStyling"],
|
|
3833
3990
|
_excluded2 = ["className", "additionalStyling"];
|
|
3834
3991
|
var TooltipSelect = function TooltipSelect(_ref) {
|
|
@@ -4364,7 +4521,9 @@ var LastUpdateTime = function LastUpdateTime(_ref) {
|
|
|
4364
4521
|
var _ref$onPressRefresh = _ref.onPressRefresh,
|
|
4365
4522
|
onPressRefresh = _ref$onPressRefresh === void 0 ? function () {} : _ref$onPressRefresh,
|
|
4366
4523
|
lastUpdateTime = _ref.lastUpdateTime,
|
|
4367
|
-
dataTestId = _ref.dataTestId
|
|
4524
|
+
dataTestId = _ref.dataTestId,
|
|
4525
|
+
_ref$hideLabel = _ref.hideLabel,
|
|
4526
|
+
hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel;
|
|
4368
4527
|
var _useTranslation = useTranslation(SHARED_NAMESPACE),
|
|
4369
4528
|
t = _useTranslation.t;
|
|
4370
4529
|
return jsxs(Box, {
|
|
@@ -4374,7 +4533,7 @@ var LastUpdateTime = function LastUpdateTime(_ref) {
|
|
|
4374
4533
|
height: '100%',
|
|
4375
4534
|
justifyContent: 'flex-end'
|
|
4376
4535
|
},
|
|
4377
|
-
children: [jsx(Typography, {
|
|
4536
|
+
children: [!hideLabel && jsx(Typography, {
|
|
4378
4537
|
sx: {
|
|
4379
4538
|
color: 'geowebColors.captions.captionStatus.rgba',
|
|
4380
4539
|
fontSize: '10px',
|
|
@@ -4889,7 +5048,8 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4889
5048
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
4890
5049
|
return jsx(Box, {
|
|
4891
5050
|
sx: Object.assign({
|
|
4892
|
-
marginBottom: '8px'
|
|
5051
|
+
marginBottom: '8px',
|
|
5052
|
+
width: '100%'
|
|
4893
5053
|
}, props.sx),
|
|
4894
5054
|
ref: ref,
|
|
4895
5055
|
children: jsxs(Stack, {
|
|
@@ -5834,33 +5994,6 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
5834
5994
|
utc: utc
|
|
5835
5995
|
});
|
|
5836
5996
|
|
|
5837
|
-
/* *
|
|
5838
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5839
|
-
* you may not use this file except in compliance with the License.
|
|
5840
|
-
* You may obtain a copy of the License at
|
|
5841
|
-
*
|
|
5842
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5843
|
-
*
|
|
5844
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
5845
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5846
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5847
|
-
* See the License for the specific language governing permissions and
|
|
5848
|
-
* limitations under the License.
|
|
5849
|
-
*
|
|
5850
|
-
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5851
|
-
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5852
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5853
|
-
* */
|
|
5854
|
-
var createToolkitMockStore = function createToolkitMockStore(storeConfig) {
|
|
5855
|
-
var reducer = storeConfig.reducer,
|
|
5856
|
-
preloadedState = storeConfig.preloadedState;
|
|
5857
|
-
var store = configureStore(Object.assign({}, storeConfig, {
|
|
5858
|
-
reducer: reducer,
|
|
5859
|
-
preloadedState: preloadedState
|
|
5860
|
-
}));
|
|
5861
|
-
return store;
|
|
5862
|
-
};
|
|
5863
|
-
|
|
5864
5997
|
/* *
|
|
5865
5998
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5866
5999
|
* you may not use this file except in compliance with the License.
|
|
@@ -6005,6 +6138,83 @@ var RenderCounter = /*#__PURE__*/function () {
|
|
|
6005
6138
|
}();
|
|
6006
6139
|
var renderCounter = new RenderCounter();
|
|
6007
6140
|
|
|
6141
|
+
/* *
|
|
6142
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6143
|
+
* you may not use this file except in compliance with the License.
|
|
6144
|
+
* You may obtain a copy of the License at
|
|
6145
|
+
*
|
|
6146
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6147
|
+
*
|
|
6148
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6149
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6150
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6151
|
+
* See the License for the specific language governing permissions and
|
|
6152
|
+
* limitations under the License.
|
|
6153
|
+
*
|
|
6154
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6155
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
6156
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6157
|
+
* */
|
|
6158
|
+
var SessionStorageKey;
|
|
6159
|
+
(function (SessionStorageKey) {
|
|
6160
|
+
SessionStorageKey["CONFIG"] = "config";
|
|
6161
|
+
SessionStorageKey["OAUTH_STATE"] = "oauth_state";
|
|
6162
|
+
SessionStorageKey["OAUTH_CODE_VERIFIER"] = "code_verifier";
|
|
6163
|
+
SessionStorageKey["OAUTH_CODE_CHALLENGE"] = "code_challenge";
|
|
6164
|
+
SessionStorageKey["HAS_AUTHENTICATED"] = "has_authenticated";
|
|
6165
|
+
SessionStorageKey["CALLBACK_URL"] = "callback_url";
|
|
6166
|
+
})(SessionStorageKey || (SessionStorageKey = {}));
|
|
6167
|
+
var sessionStorageProvider = {
|
|
6168
|
+
setConfig: function setConfig(value) {
|
|
6169
|
+
return sessionStorage.setItem(SessionStorageKey.CONFIG, JSON.stringify(value));
|
|
6170
|
+
},
|
|
6171
|
+
getConfig: function getConfig() {
|
|
6172
|
+
return JSON.parse(sessionStorage.getItem(SessionStorageKey.CONFIG) || '{}');
|
|
6173
|
+
},
|
|
6174
|
+
setOauthState: function setOauthState(value) {
|
|
6175
|
+
return sessionStorage.setItem(SessionStorageKey.OAUTH_STATE, value);
|
|
6176
|
+
},
|
|
6177
|
+
getOauthState: function getOauthState() {
|
|
6178
|
+
return sessionStorage.getItem(SessionStorageKey.OAUTH_STATE);
|
|
6179
|
+
},
|
|
6180
|
+
removeOauthState: function removeOauthState() {
|
|
6181
|
+
return sessionStorage.removeItem(SessionStorageKey.OAUTH_STATE);
|
|
6182
|
+
},
|
|
6183
|
+
setOauthCodeVerifier: function setOauthCodeVerifier(value) {
|
|
6184
|
+
return sessionStorage.setItem(SessionStorageKey.OAUTH_CODE_VERIFIER, value);
|
|
6185
|
+
},
|
|
6186
|
+
getOauthCodeVerifier: function getOauthCodeVerifier() {
|
|
6187
|
+
return sessionStorage.getItem(SessionStorageKey.OAUTH_CODE_VERIFIER);
|
|
6188
|
+
},
|
|
6189
|
+
removeOauthCodeVerifier: function removeOauthCodeVerifier() {
|
|
6190
|
+
return sessionStorage.removeItem(SessionStorageKey.OAUTH_CODE_VERIFIER);
|
|
6191
|
+
},
|
|
6192
|
+
setOauthCodeChallenge: function setOauthCodeChallenge(value) {
|
|
6193
|
+
return sessionStorage.setItem(SessionStorageKey.OAUTH_CODE_CHALLENGE, value);
|
|
6194
|
+
},
|
|
6195
|
+
getOauthCodeChallenge: function getOauthCodeChallenge() {
|
|
6196
|
+
return sessionStorage.getItem(SessionStorageKey.OAUTH_CODE_CHALLENGE);
|
|
6197
|
+
},
|
|
6198
|
+
removeOauthCodeChallenge: function removeOauthCodeChallenge() {
|
|
6199
|
+
return sessionStorage.removeItem(SessionStorageKey.OAUTH_CODE_CHALLENGE);
|
|
6200
|
+
},
|
|
6201
|
+
setHasAuthenticated: function setHasAuthenticated(value) {
|
|
6202
|
+
return sessionStorage.setItem(SessionStorageKey.HAS_AUTHENTICATED, value);
|
|
6203
|
+
},
|
|
6204
|
+
getHasAuthenticated: function getHasAuthenticated() {
|
|
6205
|
+
return sessionStorage.getItem(SessionStorageKey.HAS_AUTHENTICATED);
|
|
6206
|
+
},
|
|
6207
|
+
removeHasAuthenticated: function removeHasAuthenticated() {
|
|
6208
|
+
return sessionStorage.removeItem(SessionStorageKey.HAS_AUTHENTICATED);
|
|
6209
|
+
},
|
|
6210
|
+
getCallbackUrl: function getCallbackUrl() {
|
|
6211
|
+
return sessionStorage.getItem(SessionStorageKey.CALLBACK_URL);
|
|
6212
|
+
},
|
|
6213
|
+
setCallbackUrl: function setCallbackUrl(value) {
|
|
6214
|
+
return sessionStorage.setItem(SessionStorageKey.CALLBACK_URL, value);
|
|
6215
|
+
}
|
|
6216
|
+
};
|
|
6217
|
+
|
|
6008
6218
|
/* *
|
|
6009
6219
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6010
6220
|
* you may not use this file except in compliance with the License.
|
|
@@ -6027,9 +6237,5 @@ var SystemScope = {
|
|
|
6027
6237
|
user: 'user',
|
|
6028
6238
|
system: 'system'
|
|
6029
6239
|
};
|
|
6030
|
-
// eslint-disable-next-line no-redeclare
|
|
6031
|
-
var PresetScope = Object.assign({}, SystemScope, {
|
|
6032
|
-
shared: 'shared'
|
|
6033
|
-
});
|
|
6034
6240
|
|
|
6035
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, PROJECTION,
|
|
6241
|
+
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, useUserMenu, useWheelStopPropagation };
|