@opengeoweb/shared 4.17.0 → 4.19.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 +364 -443
- package/index.umd.js +260 -325
- package/lib/components/CustomIconButton/CustomIconButton.d.ts +10 -0
- package/lib/components/CustomIconButton/CustomIconButton.stories.d.ts +25 -0
- package/lib/components/CustomIconButton/index.d.ts +1 -0
- package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +2 -0
- package/lib/components/index.d.ts +1 -3
- package/lib/utils/dateUtils/dateUtils.d.ts +30 -0
- package/package.json +4 -3
- package/lib/components/EnableButton/EnableButton.d.ts +0 -10
- package/lib/components/EnableButton/EnableButton.stories.d.ts +0 -13
- package/lib/components/EnableButton/index.d.ts +0 -1
- package/lib/components/ManagerButton/ManagerButton.d.ts +0 -13
- package/lib/components/ManagerButton/ManagerButton.spec.d.ts +0 -1
- package/lib/components/ManagerButton/ManagerButton.stories.d.ts +0 -13
- package/lib/components/ManagerButton/index.d.ts +0 -1
- package/lib/components/ManagerDeleteButton/ManagerDeleteButton.d.ts +0 -9
- package/lib/components/ManagerDeleteButton/ManagerDeleteButton.spec.d.ts +0 -1
- package/lib/components/ManagerDeleteButton/ManagerDeleteButton.stories.d.ts +0 -13
- package/lib/components/ManagerDeleteButton/index.d.ts +0 -1
- /package/lib/components/{EnableButton/EnableButton.spec.d.ts → CustomIconButton/CustomIconButton.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useRef } from 'react';
|
|
3
|
-
import { Box, Typography, Dialog, DialogTitle,
|
|
4
|
-
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options,
|
|
3
|
+
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
4
|
+
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown } from '@opengeoweb/theme';
|
|
5
5
|
import { throttle } from 'lodash';
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { Resizable } from 're-resizable';
|
|
8
8
|
import { useStore } from 'react-redux';
|
|
9
|
-
import { parseISO, parse, format, isEqual, isBefore, isAfter } from 'date-fns';
|
|
9
|
+
import { parseISO, parse, format, isEqual, isBefore, isAfter, add as add$1, sub as sub$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1 } from 'date-fns';
|
|
10
10
|
|
|
11
11
|
/*! *****************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -87,166 +87,6 @@ var StatusTag = function StatusTag(_a) {
|
|
|
87
87
|
}, content));
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
var CustomDialog = function CustomDialog(_a) {
|
|
91
|
-
var title = _a.title,
|
|
92
|
-
_onClose = _a.onClose,
|
|
93
|
-
_a$description = _a.description,
|
|
94
|
-
description = _a$description === void 0 ? '' : _a$description,
|
|
95
|
-
_a$actions = _a.actions,
|
|
96
|
-
actions = _a$actions === void 0 ? null : _a$actions,
|
|
97
|
-
children = _a.children,
|
|
98
|
-
sx = _a.sx,
|
|
99
|
-
other = __rest(_a, ["title", "onClose", "description", "actions", "children", "sx"]);
|
|
100
|
-
|
|
101
|
-
return /*#__PURE__*/React.createElement(Dialog, Object.assign({
|
|
102
|
-
"data-testid": "customDialog",
|
|
103
|
-
PaperProps: {
|
|
104
|
-
sx: Object.assign({
|
|
105
|
-
width: '560px',
|
|
106
|
-
margin: 2.5
|
|
107
|
-
}, sx)
|
|
108
|
-
},
|
|
109
|
-
// fix for briefly showing default options when closing dialog
|
|
110
|
-
transitionDuration: 0,
|
|
111
|
-
onClose: function onClose() {
|
|
112
|
-
_onClose('CLOSED');
|
|
113
|
-
},
|
|
114
|
-
"aria-labelledby": "dialog-title"
|
|
115
|
-
}, other), /*#__PURE__*/React.createElement(DialogTitle, {
|
|
116
|
-
id: "dialog-title",
|
|
117
|
-
sx: {
|
|
118
|
-
zIndex: 1,
|
|
119
|
-
padding: 2,
|
|
120
|
-
display: 'flex',
|
|
121
|
-
justifyContent: 'space-between',
|
|
122
|
-
alignItems: 'center'
|
|
123
|
-
}
|
|
124
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
125
|
-
sx: {
|
|
126
|
-
fontSize: '16px',
|
|
127
|
-
fontWeight: 500
|
|
128
|
-
},
|
|
129
|
-
"data-testid": "customDialog-title",
|
|
130
|
-
component: "span"
|
|
131
|
-
}, title), /*#__PURE__*/React.createElement(IconButton, {
|
|
132
|
-
"data-testid": "customDialog-close",
|
|
133
|
-
"aria-label": "close",
|
|
134
|
-
onClick: function onClick() {
|
|
135
|
-
return _onClose('CLOSED');
|
|
136
|
-
},
|
|
137
|
-
size: "small"
|
|
138
|
-
}, /*#__PURE__*/React.createElement(Close, {
|
|
139
|
-
"data-testid": "CloseIcon"
|
|
140
|
-
}))), /*#__PURE__*/React.createElement(DialogContent, {
|
|
141
|
-
sx: {
|
|
142
|
-
padding: '8px 16px'
|
|
143
|
-
}
|
|
144
|
-
}, description && /*#__PURE__*/React.createElement(Typography, {
|
|
145
|
-
variant: "body1"
|
|
146
|
-
}, description), children), /*#__PURE__*/React.createElement(DialogActions, {
|
|
147
|
-
sx: {
|
|
148
|
-
padding: 2,
|
|
149
|
-
flexDirection: {
|
|
150
|
-
xs: 'column',
|
|
151
|
-
sm: 'row'
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}, actions));
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
var confirmStyle = {
|
|
158
|
-
width: {
|
|
159
|
-
xs: '100%',
|
|
160
|
-
sm: '150px'
|
|
161
|
-
},
|
|
162
|
-
marginLeft: {
|
|
163
|
-
xs: '0px!important',
|
|
164
|
-
sm: '8px!important'
|
|
165
|
-
},
|
|
166
|
-
marginTop: {
|
|
167
|
-
xs: 2,
|
|
168
|
-
sm: 0
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
172
|
-
var open = _a.open,
|
|
173
|
-
title = _a.title,
|
|
174
|
-
_a$description = _a.description,
|
|
175
|
-
description = _a$description === void 0 ? 'Are you sure?' : _a$description,
|
|
176
|
-
_a$confirmLabel = _a.confirmLabel,
|
|
177
|
-
confirmLabel = _a$confirmLabel === void 0 ? 'Submit' : _a$confirmLabel,
|
|
178
|
-
_a$cancelLabel = _a.cancelLabel,
|
|
179
|
-
cancelLabel = _a$cancelLabel === void 0 ? 'Go back' : _a$cancelLabel,
|
|
180
|
-
onSubmit = _a.onSubmit,
|
|
181
|
-
onClose = _a.onClose,
|
|
182
|
-
_a$content = _a.content,
|
|
183
|
-
content = _a$content === void 0 ? null : _a$content,
|
|
184
|
-
_a$disableAutoFocus = _a.disableAutoFocus,
|
|
185
|
-
disableAutoFocus = _a$disableAutoFocus === void 0 ? false : _a$disableAutoFocus,
|
|
186
|
-
_a$isLoading = _a.isLoading,
|
|
187
|
-
isLoading = _a$isLoading === void 0 ? false : _a$isLoading,
|
|
188
|
-
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"]);
|
|
189
|
-
|
|
190
|
-
other.catchOnCancel;
|
|
191
|
-
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return /*#__PURE__*/React.createElement(CustomDialog, Object.assign({
|
|
195
|
-
"data-testid": "confirmationDialog",
|
|
196
|
-
open: open,
|
|
197
|
-
title: title,
|
|
198
|
-
description: description,
|
|
199
|
-
onClose: onClose,
|
|
200
|
-
actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
201
|
-
"data-testid": "confirmationDialog-cancel",
|
|
202
|
-
variant: "tertiary",
|
|
203
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
204
|
-
sx: function sx(theme) {
|
|
205
|
-
return {
|
|
206
|
-
width: {
|
|
207
|
-
xs: '100%',
|
|
208
|
-
sm: '150px'
|
|
209
|
-
},
|
|
210
|
-
'&:focus': {
|
|
211
|
-
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
212
|
-
borderColor: 'transparent'
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
},
|
|
216
|
-
onClick: function onClick() {
|
|
217
|
-
return onClose('CANCELLED');
|
|
218
|
-
},
|
|
219
|
-
disableFocusRipple: true
|
|
220
|
-
}, cancelLabel), isLoading ? /*#__PURE__*/React.createElement(Box, {
|
|
221
|
-
"data-testid": "confirm-dialog-spinner",
|
|
222
|
-
sx: Object.assign(Object.assign({}, confirmStyle), {
|
|
223
|
-
height: '40px',
|
|
224
|
-
display: 'flex',
|
|
225
|
-
justifyContent: 'center',
|
|
226
|
-
alignItems: 'center'
|
|
227
|
-
})
|
|
228
|
-
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
|
229
|
-
size: 40,
|
|
230
|
-
color: "secondary"
|
|
231
|
-
})) : /*#__PURE__*/React.createElement(Button, {
|
|
232
|
-
"data-testid": "confirmationDialog-confirm",
|
|
233
|
-
variant: "primary",
|
|
234
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
235
|
-
sx: function sx(theme) {
|
|
236
|
-
return Object.assign(Object.assign({}, confirmStyle), {
|
|
237
|
-
'&:focus': {
|
|
238
|
-
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
239
|
-
borderColor: 'transparent'
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
},
|
|
243
|
-
onClick: onSubmit,
|
|
244
|
-
autoFocus: !disableAutoFocus,
|
|
245
|
-
disableFocusRipple: true
|
|
246
|
-
}, confirmLabel))
|
|
247
|
-
}, rest), content);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
90
|
function _classCallCheck(instance, Constructor) {
|
|
251
91
|
if (!(instance instanceof Constructor)) {
|
|
252
92
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -439,6 +279,247 @@ function _nonIterableRest() {
|
|
|
439
279
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
440
280
|
}
|
|
441
281
|
|
|
282
|
+
var defaultDelay = 1000;
|
|
283
|
+
var useControlledTooltip = function useControlledTooltip() {
|
|
284
|
+
var _React$useState = React.useState(false),
|
|
285
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
286
|
+
tooltipOpen = _React$useState2[0],
|
|
287
|
+
setTooltipOpen = _React$useState2[1];
|
|
288
|
+
|
|
289
|
+
var _React$useState3 = React.useState(false),
|
|
290
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
291
|
+
delayedTooltip = _React$useState4[0],
|
|
292
|
+
setDelayedTooltip = _React$useState4[1];
|
|
293
|
+
|
|
294
|
+
React.useEffect(function () {
|
|
295
|
+
if (tooltipOpen === true) {
|
|
296
|
+
var timer = setTimeout(function () {
|
|
297
|
+
return setDelayedTooltip(true);
|
|
298
|
+
}, defaultDelay);
|
|
299
|
+
return function () {
|
|
300
|
+
clearTimeout(timer);
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
setDelayedTooltip(false);
|
|
305
|
+
return function () {};
|
|
306
|
+
}, [tooltipOpen]);
|
|
307
|
+
return [delayedTooltip, setTooltipOpen];
|
|
308
|
+
};
|
|
309
|
+
var CustomTooltip = function CustomTooltip(props) {
|
|
310
|
+
return /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, props, {
|
|
311
|
+
enterDelay: defaultDelay,
|
|
312
|
+
enterNextDelay: defaultDelay,
|
|
313
|
+
disableInteractive: true
|
|
314
|
+
}));
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
var CustomIconButton = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
318
|
+
var _a$tooltipTitle = _a.tooltipTitle,
|
|
319
|
+
tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
|
|
320
|
+
_a$variant = _a.variant,
|
|
321
|
+
variant = _a$variant === void 0 ? 'flat' : _a$variant,
|
|
322
|
+
_a$isSelected = _a.isSelected,
|
|
323
|
+
isSelected = _a$isSelected === void 0 ? false : _a$isSelected,
|
|
324
|
+
_a$shouldShowAsDisabl = _a.shouldShowAsDisabled,
|
|
325
|
+
shouldShowAsDisabled = _a$shouldShowAsDisabl === void 0 ? false : _a$shouldShowAsDisabl,
|
|
326
|
+
_a$size = _a.size,
|
|
327
|
+
size = _a$size === void 0 ? 'small' : _a$size,
|
|
328
|
+
children = _a.children,
|
|
329
|
+
className = _a.className,
|
|
330
|
+
props = __rest(_a, ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className"]);
|
|
331
|
+
|
|
332
|
+
var classNames = [].concat(_toConsumableArray(className ? [className] : []), _toConsumableArray(isSelected ? ['Mui-selected'] : []), [variant]).join(' ');
|
|
333
|
+
|
|
334
|
+
var renderIconButton = function renderIconButton() {
|
|
335
|
+
return /*#__PURE__*/React.createElement(IconButton, Object.assign({
|
|
336
|
+
"aria-label": tooltipTitle
|
|
337
|
+
}, props, {
|
|
338
|
+
size: size,
|
|
339
|
+
className: classNames,
|
|
340
|
+
ref: ref,
|
|
341
|
+
sx: Object.assign(Object.assign({}, props.sx), shouldShowAsDisabled && {
|
|
342
|
+
'&.MuiIconButton-root': {
|
|
343
|
+
color: "geowebColors.iconButtons.".concat(variant, ".disabled.color")
|
|
344
|
+
},
|
|
345
|
+
'&.Mui-focusVisible': {
|
|
346
|
+
color: "geowebColors.iconButtons.".concat(variant, ".default.color")
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
}), children);
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
return tooltipTitle ? /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
353
|
+
title: tooltipTitle,
|
|
354
|
+
placement: "top",
|
|
355
|
+
sx: {
|
|
356
|
+
pointerEvents: 'none'
|
|
357
|
+
}
|
|
358
|
+
}, renderIconButton()) : renderIconButton();
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
var CustomDialog = function CustomDialog(_a) {
|
|
362
|
+
var title = _a.title,
|
|
363
|
+
_onClose = _a.onClose,
|
|
364
|
+
_a$description = _a.description,
|
|
365
|
+
description = _a$description === void 0 ? '' : _a$description,
|
|
366
|
+
_a$actions = _a.actions,
|
|
367
|
+
actions = _a$actions === void 0 ? null : _a$actions,
|
|
368
|
+
children = _a.children,
|
|
369
|
+
sx = _a.sx,
|
|
370
|
+
other = __rest(_a, ["title", "onClose", "description", "actions", "children", "sx"]);
|
|
371
|
+
|
|
372
|
+
return /*#__PURE__*/React.createElement(Dialog, Object.assign({
|
|
373
|
+
"data-testid": "customDialog",
|
|
374
|
+
PaperProps: {
|
|
375
|
+
sx: Object.assign({
|
|
376
|
+
width: '560px',
|
|
377
|
+
margin: 2.5
|
|
378
|
+
}, sx)
|
|
379
|
+
},
|
|
380
|
+
// fix for briefly showing default options when closing dialog
|
|
381
|
+
transitionDuration: 0,
|
|
382
|
+
onClose: function onClose() {
|
|
383
|
+
_onClose('CLOSED');
|
|
384
|
+
},
|
|
385
|
+
"aria-labelledby": "dialog-title"
|
|
386
|
+
}, other), /*#__PURE__*/React.createElement(DialogTitle, {
|
|
387
|
+
id: "dialog-title",
|
|
388
|
+
sx: {
|
|
389
|
+
zIndex: 1,
|
|
390
|
+
padding: 2,
|
|
391
|
+
display: 'flex',
|
|
392
|
+
justifyContent: 'space-between',
|
|
393
|
+
alignItems: 'center'
|
|
394
|
+
}
|
|
395
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
396
|
+
sx: {
|
|
397
|
+
fontSize: '16px',
|
|
398
|
+
fontWeight: 500
|
|
399
|
+
},
|
|
400
|
+
"data-testid": "customDialog-title",
|
|
401
|
+
component: "span"
|
|
402
|
+
}, title), /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
403
|
+
"data-testid": "customDialog-close",
|
|
404
|
+
"aria-label": "close",
|
|
405
|
+
onClick: function onClick() {
|
|
406
|
+
return _onClose('CLOSED');
|
|
407
|
+
},
|
|
408
|
+
sx: {
|
|
409
|
+
'&.MuiIconButton-root': {
|
|
410
|
+
color: 'geowebColors.greys.accessible'
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}, /*#__PURE__*/React.createElement(Close, {
|
|
414
|
+
"data-testid": "CloseIcon"
|
|
415
|
+
}))), /*#__PURE__*/React.createElement(DialogContent, {
|
|
416
|
+
sx: {
|
|
417
|
+
padding: '8px 16px'
|
|
418
|
+
}
|
|
419
|
+
}, description && /*#__PURE__*/React.createElement(Typography, {
|
|
420
|
+
variant: "body1"
|
|
421
|
+
}, description), children), /*#__PURE__*/React.createElement(DialogActions, {
|
|
422
|
+
sx: {
|
|
423
|
+
padding: 2,
|
|
424
|
+
flexDirection: {
|
|
425
|
+
xs: 'column',
|
|
426
|
+
sm: 'row'
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}, actions));
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
var confirmStyle = {
|
|
433
|
+
width: {
|
|
434
|
+
xs: '100%',
|
|
435
|
+
sm: '150px'
|
|
436
|
+
},
|
|
437
|
+
marginLeft: {
|
|
438
|
+
xs: '0px!important',
|
|
439
|
+
sm: '8px!important'
|
|
440
|
+
},
|
|
441
|
+
marginTop: {
|
|
442
|
+
xs: 2,
|
|
443
|
+
sm: 0
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
447
|
+
var open = _a.open,
|
|
448
|
+
title = _a.title,
|
|
449
|
+
_a$description = _a.description,
|
|
450
|
+
description = _a$description === void 0 ? 'Are you sure?' : _a$description,
|
|
451
|
+
_a$confirmLabel = _a.confirmLabel,
|
|
452
|
+
confirmLabel = _a$confirmLabel === void 0 ? 'Submit' : _a$confirmLabel,
|
|
453
|
+
_a$cancelLabel = _a.cancelLabel,
|
|
454
|
+
cancelLabel = _a$cancelLabel === void 0 ? 'Go back' : _a$cancelLabel,
|
|
455
|
+
onSubmit = _a.onSubmit,
|
|
456
|
+
onClose = _a.onClose,
|
|
457
|
+
_a$content = _a.content,
|
|
458
|
+
content = _a$content === void 0 ? null : _a$content,
|
|
459
|
+
_a$disableAutoFocus = _a.disableAutoFocus,
|
|
460
|
+
disableAutoFocus = _a$disableAutoFocus === void 0 ? false : _a$disableAutoFocus,
|
|
461
|
+
_a$isLoading = _a.isLoading,
|
|
462
|
+
isLoading = _a$isLoading === void 0 ? false : _a$isLoading,
|
|
463
|
+
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"]);
|
|
464
|
+
|
|
465
|
+
other.catchOnCancel;
|
|
466
|
+
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
return /*#__PURE__*/React.createElement(CustomDialog, Object.assign({
|
|
470
|
+
"data-testid": "confirmationDialog",
|
|
471
|
+
open: open,
|
|
472
|
+
title: title,
|
|
473
|
+
description: description,
|
|
474
|
+
onClose: onClose,
|
|
475
|
+
actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
476
|
+
"data-testid": "confirmationDialog-cancel",
|
|
477
|
+
variant: "tertiary",
|
|
478
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
479
|
+
sx: function sx(theme) {
|
|
480
|
+
return {
|
|
481
|
+
width: {
|
|
482
|
+
xs: '100%',
|
|
483
|
+
sm: '150px'
|
|
484
|
+
},
|
|
485
|
+
'&:focus': {
|
|
486
|
+
outline: theme.palette.geowebColors.buttons.primary.focus.outline,
|
|
487
|
+
borderColor: 'transparent'
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
},
|
|
491
|
+
onClick: function onClick() {
|
|
492
|
+
return onClose('CANCELLED');
|
|
493
|
+
}
|
|
494
|
+
}, cancelLabel), isLoading ? /*#__PURE__*/React.createElement(Box, {
|
|
495
|
+
"data-testid": "confirm-dialog-spinner",
|
|
496
|
+
sx: Object.assign(Object.assign({}, confirmStyle), {
|
|
497
|
+
height: '40px',
|
|
498
|
+
display: 'flex',
|
|
499
|
+
justifyContent: 'center',
|
|
500
|
+
alignItems: 'center'
|
|
501
|
+
})
|
|
502
|
+
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
|
503
|
+
size: 40,
|
|
504
|
+
color: "secondary"
|
|
505
|
+
})) : /*#__PURE__*/React.createElement(Button, {
|
|
506
|
+
"data-testid": "confirmationDialog-confirm",
|
|
507
|
+
variant: "primary",
|
|
508
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
509
|
+
sx: function sx(theme) {
|
|
510
|
+
return Object.assign(Object.assign({}, confirmStyle), {
|
|
511
|
+
'&:focus': {
|
|
512
|
+
outline: theme.palette.geowebColors.buttons.primary.focus.outline,
|
|
513
|
+
borderColor: 'transparent'
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
},
|
|
517
|
+
onClick: onSubmit,
|
|
518
|
+
autoFocus: !disableAutoFocus
|
|
519
|
+
}, confirmLabel))
|
|
520
|
+
}, rest), content);
|
|
521
|
+
};
|
|
522
|
+
|
|
442
523
|
/* *
|
|
443
524
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
444
525
|
* you may not use this file except in compliance with the License.
|
|
@@ -639,7 +720,10 @@ var adjustPosition = function adjustPosition(bbox, containingView, position, set
|
|
|
639
720
|
};
|
|
640
721
|
var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysInsideWindow(nodeRef, position, setPosition) {
|
|
641
722
|
var onResizeWindow = React__default.useCallback(function () {
|
|
642
|
-
if (!nodeRef.current)
|
|
723
|
+
if (!nodeRef.current) {
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
|
|
643
727
|
var bbox = nodeRef.current.firstChild.getBoundingClientRect();
|
|
644
728
|
var containingView = nodeRef.current.parentElement.getBoundingClientRect();
|
|
645
729
|
adjustPosition(bbox, containingView, position, setPosition);
|
|
@@ -1179,8 +1263,8 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
1179
1263
|
return /*#__PURE__*/React.createElement(Box, {
|
|
1180
1264
|
sx: {
|
|
1181
1265
|
whiteSpace: 'pre-wrap',
|
|
1182
|
-
width: '
|
|
1183
|
-
height: '
|
|
1266
|
+
width: '100%',
|
|
1267
|
+
height: '100%',
|
|
1184
1268
|
overflowY: 'scroll'
|
|
1185
1269
|
}
|
|
1186
1270
|
}, /*#__PURE__*/React.createElement(AlertBanner, {
|
|
@@ -1263,8 +1347,8 @@ var Avatar = function Avatar(_ref) {
|
|
|
1263
1347
|
* See the License for the specific language governing permissions and
|
|
1264
1348
|
* limitations under the License.
|
|
1265
1349
|
*
|
|
1266
|
-
* Copyright
|
|
1267
|
-
* Copyright
|
|
1350
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1351
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1268
1352
|
* */
|
|
1269
1353
|
var styles$3 = {
|
|
1270
1354
|
container: {
|
|
@@ -1284,15 +1368,6 @@ var styles$3 = {
|
|
|
1284
1368
|
paddingLeft: 2,
|
|
1285
1369
|
paddingRight: 2
|
|
1286
1370
|
}
|
|
1287
|
-
},
|
|
1288
|
-
button: {
|
|
1289
|
-
padding: 0,
|
|
1290
|
-
border: 'none',
|
|
1291
|
-
background: 'transparent',
|
|
1292
|
-
'&:hover': {
|
|
1293
|
-
border: 'none',
|
|
1294
|
-
background: 'transparent'
|
|
1295
|
-
}
|
|
1296
1371
|
}
|
|
1297
1372
|
};
|
|
1298
1373
|
|
|
@@ -1305,11 +1380,19 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
1305
1380
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1306
1381
|
children = _ref.children,
|
|
1307
1382
|
initials = _ref.initials;
|
|
1308
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(
|
|
1383
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
1309
1384
|
"data-testid": "userButton",
|
|
1310
1385
|
onClick: onToggle,
|
|
1311
|
-
sx:
|
|
1312
|
-
|
|
1386
|
+
sx: {
|
|
1387
|
+
'&.MuiButtonBase-root': {
|
|
1388
|
+
background: 'transparent',
|
|
1389
|
+
'&:hover': {
|
|
1390
|
+
border: 'none',
|
|
1391
|
+
background: 'transparent'
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
size: "medium"
|
|
1313
1396
|
}, /*#__PURE__*/React__default.createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default.createElement(Paper, {
|
|
1314
1397
|
sx: styles$3.container,
|
|
1315
1398
|
"data-testid": "userMenu"
|
|
@@ -1399,41 +1482,6 @@ var ToolFooter = function ToolFooter() {
|
|
|
1399
1482
|
});
|
|
1400
1483
|
};
|
|
1401
1484
|
|
|
1402
|
-
var defaultDelay = 1000;
|
|
1403
|
-
var useControlledTooltip = function useControlledTooltip() {
|
|
1404
|
-
var _React$useState = React.useState(false),
|
|
1405
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1406
|
-
tooltipOpen = _React$useState2[0],
|
|
1407
|
-
setTooltipOpen = _React$useState2[1];
|
|
1408
|
-
|
|
1409
|
-
var _React$useState3 = React.useState(false),
|
|
1410
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
1411
|
-
delayedTooltip = _React$useState4[0],
|
|
1412
|
-
setDelayedTooltip = _React$useState4[1];
|
|
1413
|
-
|
|
1414
|
-
React.useEffect(function () {
|
|
1415
|
-
if (tooltipOpen === true) {
|
|
1416
|
-
var timer = setTimeout(function () {
|
|
1417
|
-
return setDelayedTooltip(true);
|
|
1418
|
-
}, defaultDelay);
|
|
1419
|
-
return function () {
|
|
1420
|
-
clearTimeout(timer);
|
|
1421
|
-
};
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
setDelayedTooltip(false);
|
|
1425
|
-
return function () {};
|
|
1426
|
-
}, [tooltipOpen]);
|
|
1427
|
-
return [delayedTooltip, setTooltipOpen];
|
|
1428
|
-
};
|
|
1429
|
-
var CustomTooltip = function CustomTooltip(props) {
|
|
1430
|
-
return /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, props, {
|
|
1431
|
-
enterDelay: defaultDelay,
|
|
1432
|
-
enterNextDelay: defaultDelay,
|
|
1433
|
-
disableInteractive: true
|
|
1434
|
-
}));
|
|
1435
|
-
};
|
|
1436
|
-
|
|
1437
1485
|
/* *
|
|
1438
1486
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1439
1487
|
* you may not use this file except in compliance with the License.
|
|
@@ -1447,8 +1495,8 @@ var CustomTooltip = function CustomTooltip(props) {
|
|
|
1447
1495
|
* See the License for the specific language governing permissions and
|
|
1448
1496
|
* limitations under the License.
|
|
1449
1497
|
*
|
|
1450
|
-
* Copyright
|
|
1451
|
-
* Copyright
|
|
1498
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1499
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1452
1500
|
* */
|
|
1453
1501
|
|
|
1454
1502
|
var getStyle = function getStyle(size) {
|
|
@@ -1546,13 +1594,13 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1546
1594
|
}, isDraggable && size !== 'xxs' && !leftHeaderComponent && /*#__PURE__*/React__default.createElement(Grid, {
|
|
1547
1595
|
container: true,
|
|
1548
1596
|
justifyContent: "flex-start"
|
|
1549
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
1597
|
+
}, /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
1550
1598
|
"data-testid": "dragBtn",
|
|
1551
1599
|
disableRipple: true,
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
}
|
|
1600
|
+
sx: {
|
|
1601
|
+
pointerEvents: 'none',
|
|
1602
|
+
'&.MuiIconButton-root': iconStyle
|
|
1603
|
+
}
|
|
1556
1604
|
}, /*#__PURE__*/React__default.createElement(DragHandle, null))), leftHeaderComponent && leftHeaderComponent), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1557
1605
|
className: "header-title",
|
|
1558
1606
|
item: true,
|
|
@@ -1568,15 +1616,16 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1568
1616
|
fontSize: styles.fontSize,
|
|
1569
1617
|
fontWeight: styles.fontWeight
|
|
1570
1618
|
}
|
|
1571
|
-
}, title), size === 'xxs' && /*#__PURE__*/React__default.createElement(
|
|
1619
|
+
}, title), size === 'xxs' && /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
1572
1620
|
"data-testid": "dragBtn-xxs",
|
|
1573
1621
|
disableRipple: true,
|
|
1574
|
-
|
|
1575
|
-
sx: Object.assign(Object.assign({}, iconStyle), {
|
|
1622
|
+
sx: {
|
|
1576
1623
|
pointerEvents: 'none',
|
|
1577
1624
|
transform: 'rotate(90deg)',
|
|
1578
|
-
|
|
1579
|
-
|
|
1625
|
+
'&.MuiButtonBase-root.MuiIconButton-root': Object.assign(Object.assign({}, iconStyle), {
|
|
1626
|
+
height: 12
|
|
1627
|
+
})
|
|
1628
|
+
}
|
|
1580
1629
|
}, /*#__PURE__*/React__default.createElement(DragHandle, null)))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1581
1630
|
className: "header-right",
|
|
1582
1631
|
item: true,
|
|
@@ -1589,12 +1638,13 @@ var ToolHeader = function ToolHeader(_ref) {
|
|
|
1589
1638
|
sx: {
|
|
1590
1639
|
pointerEvents: 'none'
|
|
1591
1640
|
}
|
|
1592
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
1641
|
+
}, /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
1593
1642
|
"data-testid": "closeBtn",
|
|
1594
1643
|
onClick: onClose,
|
|
1595
1644
|
onTouchEnd: onClose,
|
|
1596
|
-
|
|
1597
|
-
|
|
1645
|
+
sx: {
|
|
1646
|
+
'&.MuiButtonBase-root.MuiIconButton-root': iconStyle
|
|
1647
|
+
}
|
|
1598
1648
|
}, /*#__PURE__*/React__default.createElement(Close, {
|
|
1599
1649
|
"data-testid": "CloseIcon"
|
|
1600
1650
|
}))))));
|
|
@@ -1892,6 +1942,10 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1892
1942
|
onResizeStop = _a$onResizeStop === void 0 ? function () {} : _a$onResizeStop,
|
|
1893
1943
|
_a$onDragEnd = _a.onDragEnd,
|
|
1894
1944
|
onDragEnd = _a$onDragEnd === void 0 ? function () {} : _a$onDragEnd,
|
|
1945
|
+
_a$onFocus = _a.onFocus,
|
|
1946
|
+
onFocus = _a$onFocus === void 0 ? function () {} : _a$onFocus,
|
|
1947
|
+
_a$onBlur = _a.onBlur,
|
|
1948
|
+
onBlur = _a$onBlur === void 0 ? function () {} : _a$onBlur,
|
|
1895
1949
|
_a$order = _a.order,
|
|
1896
1950
|
order = _a$order === void 0 ? 1 : _a$order,
|
|
1897
1951
|
_a$source = _a.source,
|
|
@@ -1903,7 +1957,7 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1903
1957
|
className = _a.className,
|
|
1904
1958
|
_a$sx = _a.sx,
|
|
1905
1959
|
sx = _a$sx === void 0 ? {} : _a$sx,
|
|
1906
|
-
props = __rest(_a, ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "className", "sx"]);
|
|
1960
|
+
props = __rest(_a, ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "onFocus", "onBlur", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "className", "sx"]);
|
|
1907
1961
|
|
|
1908
1962
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
1909
1963
|
var elevation = BASE_ELEVATION + order;
|
|
@@ -1978,6 +2032,9 @@ var DraggableComponent = function DraggableComponent(_a) {
|
|
|
1978
2032
|
handle: ".".concat(headerClassName),
|
|
1979
2033
|
onMouseDown: onMouseDown
|
|
1980
2034
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
2035
|
+
tabIndex: -1,
|
|
2036
|
+
onFocus: onFocus,
|
|
2037
|
+
onBlur: onBlur,
|
|
1981
2038
|
sx: Object.assign(Object.assign(Object.assign({
|
|
1982
2039
|
position: 'absolute',
|
|
1983
2040
|
pointerEvents: 'all',
|
|
@@ -2461,7 +2518,10 @@ var useUserMenu = function useUserMenu() {
|
|
|
2461
2518
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2462
2519
|
* */
|
|
2463
2520
|
var getInitials = function getInitials(name) {
|
|
2464
|
-
if (!name)
|
|
2521
|
+
if (!name) {
|
|
2522
|
+
return '';
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2465
2525
|
var nameWithoutEmail = name.split('@')[0];
|
|
2466
2526
|
var array = nameWithoutEmail.split('.');
|
|
2467
2527
|
|
|
@@ -2545,7 +2605,10 @@ var CustomSlider = function CustomSlider(_a) {
|
|
|
2545
2605
|
first = _reverse2[0],
|
|
2546
2606
|
rest = _reverse2.slice(1);
|
|
2547
2607
|
|
|
2548
|
-
if (first)
|
|
2608
|
+
if (first) {
|
|
2609
|
+
first.classList.add('selectedLabel');
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2549
2612
|
rest.forEach(function (element) {
|
|
2550
2613
|
return element.classList.remove('selectedLabel');
|
|
2551
2614
|
});
|
|
@@ -2743,7 +2806,10 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2743
2806
|
anchorEl: anchorEl,
|
|
2744
2807
|
open: isOpen,
|
|
2745
2808
|
onClose: function onClose(event, reason) {
|
|
2746
|
-
if (reason === 'tabKeyDown')
|
|
2809
|
+
if (reason === 'tabKeyDown') {
|
|
2810
|
+
return;
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2747
2813
|
handleClose(event);
|
|
2748
2814
|
},
|
|
2749
2815
|
anchorOrigin: anchorOrigin,
|
|
@@ -2765,7 +2831,7 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2765
2831
|
sx: {
|
|
2766
2832
|
fontSize: '12px'
|
|
2767
2833
|
}
|
|
2768
|
-
}, menuTitle)), menuItems && menuItems.map(function (menuItem) {
|
|
2834
|
+
}, menuTitle)), menuItems && menuItems.length ? menuItems.map(function (menuItem) {
|
|
2769
2835
|
var text = menuItem.text,
|
|
2770
2836
|
icon = menuItem.icon,
|
|
2771
2837
|
action = menuItem.action;
|
|
@@ -2776,207 +2842,8 @@ var ToggleMenu = function ToggleMenu(_ref) {
|
|
|
2776
2842
|
handleClose(event);
|
|
2777
2843
|
}
|
|
2778
2844
|
}, icon && /*#__PURE__*/React.createElement(ListItemIcon, null, icon), /*#__PURE__*/React.createElement(Typography, null, text));
|
|
2779
|
-
}),
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
/* *
|
|
2783
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2784
|
-
* you may not use this file except in compliance with the License.
|
|
2785
|
-
* You may obtain a copy of the License at
|
|
2786
|
-
*
|
|
2787
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2788
|
-
*
|
|
2789
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2790
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2791
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2792
|
-
* See the License for the specific language governing permissions and
|
|
2793
|
-
* limitations under the License.
|
|
2794
|
-
*
|
|
2795
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2796
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2797
|
-
* */
|
|
2798
|
-
|
|
2799
|
-
var makeButtonStyles = function makeButtonStyles(isActive, isEnabled, isAccessible) {
|
|
2800
|
-
return {
|
|
2801
|
-
height: '24px',
|
|
2802
|
-
width: '24px',
|
|
2803
|
-
borderRadius: '5px',
|
|
2804
|
-
marginTop: 'auto',
|
|
2805
|
-
marginBottom: 'auto',
|
|
2806
|
-
color: function color() {
|
|
2807
|
-
if (!isEnabled) {
|
|
2808
|
-
return 'geowebColors.buttons.flat.disabled.color';
|
|
2809
|
-
}
|
|
2810
|
-
|
|
2811
|
-
if (isAccessible) {
|
|
2812
|
-
return 'geowebColors.greys.accessible';
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
if (isActive) {
|
|
2816
|
-
return 'common.white';
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
return 'geowebColors.buttons.flat.default.color';
|
|
2820
|
-
},
|
|
2821
|
-
backgroundColor: function backgroundColor() {
|
|
2822
|
-
return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
|
|
2823
|
-
},
|
|
2824
|
-
'&:focus': {
|
|
2825
|
-
backgroundColor: function backgroundColor() {
|
|
2826
|
-
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2827
|
-
},
|
|
2828
|
-
outline: 'geowebColors.buttons.focusDefault.outline',
|
|
2829
|
-
borderRadius: 0
|
|
2830
|
-
},
|
|
2831
|
-
'&:hover': {
|
|
2832
|
-
backgroundColor: function backgroundColor() {
|
|
2833
|
-
return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
};
|
|
2837
|
-
};
|
|
2838
|
-
|
|
2839
|
-
var ManagerButton = function ManagerButton(_a) {
|
|
2840
|
-
var _a$tooltipTitle = _a.tooltipTitle,
|
|
2841
|
-
tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
|
|
2842
|
-
_a$onClick = _a.onClick,
|
|
2843
|
-
onClick = _a$onClick === void 0 ? function () {} : _a$onClick,
|
|
2844
|
-
_a$isActive = _a.isActive,
|
|
2845
|
-
isActive = _a$isActive === void 0 ? false : _a$isActive,
|
|
2846
|
-
_a$isEnabled = _a.isEnabled,
|
|
2847
|
-
isEnabled = _a$isEnabled === void 0 ? true : _a$isEnabled,
|
|
2848
|
-
icon = _a.icon,
|
|
2849
|
-
testId = _a.testId,
|
|
2850
|
-
_a$isAccessible = _a.isAccessible,
|
|
2851
|
-
isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
|
|
2852
|
-
sx = _a.sx,
|
|
2853
|
-
children = _a.children,
|
|
2854
|
-
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "sx", "children"]);
|
|
2855
|
-
|
|
2856
|
-
var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
|
|
2857
|
-
|
|
2858
|
-
var handleClick = function handleClick(event) {
|
|
2859
|
-
onClick(event);
|
|
2860
|
-
};
|
|
2861
|
-
|
|
2862
|
-
return /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
2863
|
-
title: tooltipTitle,
|
|
2864
|
-
placement: "top",
|
|
2865
|
-
sx: {
|
|
2866
|
-
pointerEvents: 'none'
|
|
2867
|
-
}
|
|
2868
|
-
}, children || /*#__PURE__*/React.createElement(IconButton, Object.assign({
|
|
2869
|
-
size: "small",
|
|
2870
|
-
onClick: handleClick,
|
|
2871
|
-
"data-testid": testId,
|
|
2872
|
-
sx: Object.assign(Object.assign({}, buttonStyles), sx),
|
|
2873
|
-
disableFocusRipple: true
|
|
2874
|
-
}, props), icon));
|
|
2875
|
-
};
|
|
2876
|
-
|
|
2877
|
-
/* *
|
|
2878
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2879
|
-
* you may not use this file except in compliance with the License.
|
|
2880
|
-
* You may obtain a copy of the License at
|
|
2881
|
-
*
|
|
2882
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2883
|
-
*
|
|
2884
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2885
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2886
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2887
|
-
* See the License for the specific language governing permissions and
|
|
2888
|
-
* limitations under the License.
|
|
2889
|
-
*
|
|
2890
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2891
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2892
|
-
* */
|
|
2893
|
-
var ManagerDeleteButton = function ManagerDeleteButton(_ref) {
|
|
2894
|
-
var tooltipTitle = _ref.tooltipTitle,
|
|
2895
|
-
onClickDelete = _ref.onClickDelete,
|
|
2896
|
-
_ref$isEnabled = _ref.isEnabled,
|
|
2897
|
-
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
|
|
2898
|
-
sx = _ref.sx;
|
|
2899
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2900
|
-
tooltipTitle: tooltipTitle,
|
|
2901
|
-
onClick: onClickDelete,
|
|
2902
|
-
testId: "deleteButtonMedium",
|
|
2903
|
-
isEnabled: isEnabled,
|
|
2904
|
-
icon: /*#__PURE__*/React.createElement(Delete, null)
|
|
2905
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
2906
|
-
className: "deleteBtnMedium",
|
|
2907
|
-
variant: "tertiary",
|
|
2908
|
-
onClick: onClickDelete,
|
|
2909
|
-
startIcon: /*#__PURE__*/React.createElement(Delete, null),
|
|
2910
|
-
sx: Object.assign({
|
|
2911
|
-
display: 'none'
|
|
2912
|
-
}, sx)
|
|
2913
|
-
}, "Delete")), /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2914
|
-
tooltipTitle: tooltipTitle,
|
|
2915
|
-
onClick: onClickDelete,
|
|
2916
|
-
icon: /*#__PURE__*/React.createElement(Delete, null),
|
|
2917
|
-
testId: "deleteButton",
|
|
2918
|
-
isEnabled: isEnabled,
|
|
2919
|
-
sx: sx
|
|
2920
|
-
}));
|
|
2921
|
-
};
|
|
2922
|
-
|
|
2923
|
-
/* *
|
|
2924
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2925
|
-
* you may not use this file except in compliance with the License.
|
|
2926
|
-
* You may obtain a copy of the License at
|
|
2927
|
-
*
|
|
2928
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2929
|
-
*
|
|
2930
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2931
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2932
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2933
|
-
* See the License for the specific language governing permissions and
|
|
2934
|
-
* limitations under the License.
|
|
2935
|
-
*
|
|
2936
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2937
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2938
|
-
* */
|
|
2939
|
-
var EnableButton = function EnableButton(_ref) {
|
|
2940
|
-
var isEnabled = _ref.isEnabled,
|
|
2941
|
-
title = _ref.title,
|
|
2942
|
-
onChangeEnableLayer = _ref.onChangeEnableLayer,
|
|
2943
|
-
className = _ref.className,
|
|
2944
|
-
_ref$id = _ref.id,
|
|
2945
|
-
id = _ref$id === void 0 ? 'enableButton' : _ref$id;
|
|
2946
|
-
|
|
2947
|
-
var onClick = function onClick(event) {
|
|
2948
|
-
event.stopPropagation();
|
|
2949
|
-
onChangeEnableLayer(!isEnabled);
|
|
2950
|
-
};
|
|
2951
|
-
|
|
2952
|
-
return /*#__PURE__*/React.createElement(ManagerButton, {
|
|
2953
|
-
tooltipTitle: title,
|
|
2954
|
-
onClick: onClick,
|
|
2955
|
-
icon: /*#__PURE__*/React.createElement(Checkbox, {
|
|
2956
|
-
sx: {
|
|
2957
|
-
color: 'inherit',
|
|
2958
|
-
padding: 0.5,
|
|
2959
|
-
borderRadius: 1.25,
|
|
2960
|
-
'&.Mui-focusVisible': {
|
|
2961
|
-
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2962
|
-
},
|
|
2963
|
-
'&:hover': {
|
|
2964
|
-
backgroundColor: 'transparent!important'
|
|
2965
|
-
},
|
|
2966
|
-
'&.Mui-checked': {
|
|
2967
|
-
color: 'inherit'
|
|
2968
|
-
}
|
|
2969
|
-
},
|
|
2970
|
-
icon: /*#__PURE__*/React.createElement(VisibilityOff, null),
|
|
2971
|
-
checkedIcon: /*#__PURE__*/React.createElement(Visibility, null),
|
|
2972
|
-
checked: isEnabled,
|
|
2973
|
-
disableFocusRipple: true,
|
|
2974
|
-
tabIndex: -1
|
|
2975
|
-
}),
|
|
2976
|
-
testId: id,
|
|
2977
|
-
isEnabled: isEnabled,
|
|
2978
|
-
className: className
|
|
2979
|
-
});
|
|
2845
|
+
}) : /*#__PURE__*/React.createElement("div", null) // Needed to make the menu work without any menuItems
|
|
2846
|
+
, children));
|
|
2980
2847
|
};
|
|
2981
2848
|
|
|
2982
2849
|
/* *
|
|
@@ -3017,7 +2884,7 @@ var tooltipContainerStyles = function tooltipContainerStyles(isEnabled) {
|
|
|
3017
2884
|
},
|
|
3018
2885
|
'&.Mui-focused .MuiSelect-select': {
|
|
3019
2886
|
outline: function outline(theme) {
|
|
3020
|
-
return theme.palette.geowebColors.buttons.
|
|
2887
|
+
return theme.palette.geowebColors.buttons.tool.focus.outline;
|
|
3021
2888
|
},
|
|
3022
2889
|
borderRadius: 0
|
|
3023
2890
|
},
|
|
@@ -3039,7 +2906,7 @@ var backgroundColor = {
|
|
|
3039
2906
|
},
|
|
3040
2907
|
'&.Mui-focused .MuiSelect-select': {
|
|
3041
2908
|
outline: function outline(theme) {
|
|
3042
|
-
return theme.palette.geowebColors.buttons.
|
|
2909
|
+
return theme.palette.geowebColors.buttons.tool.focus.outline;
|
|
3043
2910
|
},
|
|
3044
2911
|
borderRadius: 0,
|
|
3045
2912
|
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
@@ -3049,7 +2916,7 @@ var backgroundColor = {
|
|
|
3049
2916
|
},
|
|
3050
2917
|
'&:focus&.MuiButton-root': {
|
|
3051
2918
|
border: function border(theme) {
|
|
3052
|
-
return theme.palette.geowebColors.buttons.
|
|
2919
|
+
return theme.palette.geowebColors.buttons.tool.focus.outline;
|
|
3053
2920
|
},
|
|
3054
2921
|
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill',
|
|
3055
2922
|
transition: 'border'
|
|
@@ -3083,7 +2950,10 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
3083
2950
|
|
|
3084
2951
|
var onWheel = React.useCallback(function (event) {
|
|
3085
2952
|
if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
|
|
3086
|
-
if (selectOpen)
|
|
2953
|
+
if (selectOpen) {
|
|
2954
|
+
return;
|
|
2955
|
+
}
|
|
2956
|
+
|
|
3087
2957
|
var direction = event.deltaY < 0 ? 1 : -1;
|
|
3088
2958
|
var newIndex = currentIndex - direction;
|
|
3089
2959
|
|
|
@@ -3102,7 +2972,9 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
3102
2972
|
setSelectOpen(false);
|
|
3103
2973
|
}, []);
|
|
3104
2974
|
var onMouseEnter = React.useCallback(function () {
|
|
3105
|
-
if (!selectOpen)
|
|
2975
|
+
if (!selectOpen) {
|
|
2976
|
+
setTooltipOpen(true);
|
|
2977
|
+
}
|
|
3106
2978
|
}, [selectOpen, setTooltipOpen]);
|
|
3107
2979
|
var onMouseLeave = React.useCallback(function () {
|
|
3108
2980
|
setTooltipOpen(false);
|
|
@@ -3154,6 +3026,9 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
3154
3026
|
},
|
|
3155
3027
|
'&:focus': {
|
|
3156
3028
|
backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
|
|
3029
|
+
},
|
|
3030
|
+
'.MuiListItemIcon-root': {
|
|
3031
|
+
color: 'geowebColors.buttons.tool.active.color'
|
|
3157
3032
|
}
|
|
3158
3033
|
},
|
|
3159
3034
|
'&:after': {
|
|
@@ -3509,6 +3384,48 @@ var createDate = function createDate(yearOrIsoString, month, day) {
|
|
|
3509
3384
|
|
|
3510
3385
|
return new Date(yearOrIsoString, month, day, hours, minutes, seconds, milliseconds);
|
|
3511
3386
|
};
|
|
3387
|
+
/**
|
|
3388
|
+
*
|
|
3389
|
+
* @param date
|
|
3390
|
+
* @param duration
|
|
3391
|
+
* @returns {Date} the new Date
|
|
3392
|
+
*/
|
|
3393
|
+
|
|
3394
|
+
var add = function add(date, duration) {
|
|
3395
|
+
return add$1(date, duration);
|
|
3396
|
+
};
|
|
3397
|
+
/**
|
|
3398
|
+
*
|
|
3399
|
+
* @param date
|
|
3400
|
+
* @param duration
|
|
3401
|
+
* @returns {Date} the new Date
|
|
3402
|
+
*/
|
|
3403
|
+
|
|
3404
|
+
var sub = function sub(date, duration) {
|
|
3405
|
+
return sub$1(date, duration);
|
|
3406
|
+
};
|
|
3407
|
+
/**
|
|
3408
|
+
* Finds the number of minuts between to dates
|
|
3409
|
+
*
|
|
3410
|
+
* @param dateLeft - the later date
|
|
3411
|
+
* @param dateRight - the earlier date
|
|
3412
|
+
* @returns {number} the number of minutes
|
|
3413
|
+
*/
|
|
3414
|
+
|
|
3415
|
+
var differenceInMinutes = function differenceInMinutes(dateLeft, dateRight) {
|
|
3416
|
+
return differenceInMinutes$1(dateLeft, dateRight);
|
|
3417
|
+
};
|
|
3418
|
+
/**
|
|
3419
|
+
* Finds the number of hours between to dates
|
|
3420
|
+
*
|
|
3421
|
+
* @param dateLeft - the later date
|
|
3422
|
+
* @param dateRight - the earlier date
|
|
3423
|
+
* @returns {number} the number of hours
|
|
3424
|
+
*/
|
|
3425
|
+
|
|
3426
|
+
var differenceInHours = function differenceInHours(dateLeft, dateRight) {
|
|
3427
|
+
return differenceInHours$1(dateLeft, dateRight);
|
|
3428
|
+
};
|
|
3512
3429
|
|
|
3513
3430
|
/* *
|
|
3514
3431
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -3534,7 +3451,11 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
3534
3451
|
setUTCDate: setUTCDate,
|
|
3535
3452
|
dateToString: dateToString,
|
|
3536
3453
|
isBetween: isBetween,
|
|
3537
|
-
createDate: createDate
|
|
3454
|
+
createDate: createDate,
|
|
3455
|
+
add: add,
|
|
3456
|
+
sub: sub,
|
|
3457
|
+
differenceInMinutes: differenceInMinutes,
|
|
3458
|
+
differenceInHours: differenceInHours
|
|
3538
3459
|
});
|
|
3539
3460
|
|
|
3540
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable,
|
|
3461
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, ResizeComponent as Resizable, StatusTag, ToggleMenu, ToolButton, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
|