@opengeoweb/shared 2.2.1 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +534 -200
- package/index.umd.js +557 -203
- package/lib/components/AlertBanner/AlertBanner.d.ts +1 -0
- package/lib/components/AlertBanner/AlertBanner.stories.d.ts +9 -1
- package/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +10 -2
- package/lib/components/CustomToggleButton/CustomToggleButton.d.ts +8 -0
- package/lib/components/{DraggableDialog/DraggableDialog.spec.d.ts → CustomToggleButton/CustomToggleButton.spec.d.ts} +0 -0
- package/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +13 -0
- package/lib/components/CustomToggleButton/index.d.ts +1 -0
- package/lib/components/Manager/EnableButton/EnableButton.d.ts +8 -0
- package/lib/components/Manager/EnableButton/EnableButton.spec.d.ts +1 -0
- package/lib/components/Manager/EnableButton/EnableButton.stories.d.ts +13 -0
- package/lib/components/Manager/EnableButton/index.d.ts +1 -0
- package/lib/components/Manager/ManagerButton/ManagerButton.d.ts +13 -0
- package/lib/components/Manager/ManagerButton/ManagerButton.spec.d.ts +1 -0
- package/lib/components/Manager/ManagerButton/ManagerButton.stories.d.ts +13 -0
- package/lib/components/Manager/ManagerButton/index.d.ts +1 -0
- package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.d.ts +8 -0
- package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.spec.d.ts +1 -0
- package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.stories.d.ts +13 -0
- package/lib/components/Manager/ManagerDeleteButton/index.d.ts +1 -0
- package/lib/components/Manager/index.d.ts +4 -0
- package/lib/components/Manager/styles.d.ts +5 -0
- package/lib/components/ToggleMenu/ToggleMenu.d.ts +17 -0
- package/lib/components/ToggleMenu/ToggleMenu.spec.d.ts +1 -0
- package/lib/components/ToggleMenu/ToggleMenu.stories.d.ts +7 -0
- package/lib/components/ToggleMenu/index.d.ts +1 -0
- package/lib/components/ToolButton/ToolButton.d.ts +11 -0
- package/lib/components/ToolButton/ToolButton.spec.d.ts +1 -0
- package/lib/components/ToolButton/ToolButton.stories.d.ts +13 -0
- package/lib/components/ToolButton/index.d.ts +1 -0
- package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +6 -0
- package/lib/components/ToolContainer/index.d.ts +1 -0
- package/lib/components/components.stories.d.ts +0 -1
- package/lib/components/index.d.ts +4 -1
- package/package.json +3 -3
- package/lib/components/DraggableDialog/DraggableDialog.d.ts +0 -16
- package/lib/components/DraggableDialog/DraggableDialog.stories.d.ts +0 -6
- package/lib/components/DraggableDialog/index.d.ts +0 -1
package/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@mui/
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@mui/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.
|
|
5
|
-
})(this, (function (exports, React, material,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@mui/icons-material/Close'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('@mui/styles/makeStyles'), require('react-draggable'), require('re-resizable'), require('@opengeoweb/theme'), require('@mui/icons-material'), require('lodash'), require('@mui/styles/withStyles'), require('@mui/icons-material/MoreVert'), require('@mui/styles/createStyles')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@mui/icons-material/Close', 'react-hook-form', '@opengeoweb/form-fields', '@mui/styles/makeStyles', 'react-draggable', 're-resizable', '@opengeoweb/theme', '@mui/icons-material', 'lodash', '@mui/styles/withStyles', '@mui/icons-material/MoreVert', '@mui/styles/createStyles'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.Close, global.reactHookForm, global.formFields, global.makeStyles, global.Draggable, global.reResizable, global.theme, global.iconsMaterial, global.lodash, global.withStyles, global.MoreVertIcon, global.createStyles));
|
|
5
|
+
})(this, (function (exports, React, material, Close, reactHookForm, formFields, makeStyles, Draggable, reResizable, theme, iconsMaterial, lodash, withStyles, MoreVertIcon, createStyles) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -26,9 +26,11 @@
|
|
|
26
26
|
|
|
27
27
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
+
var Close__default = /*#__PURE__*/_interopDefaultLegacy(Close);
|
|
29
30
|
var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
|
|
30
31
|
var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
|
|
31
32
|
var withStyles__default = /*#__PURE__*/_interopDefaultLegacy(withStyles);
|
|
33
|
+
var MoreVertIcon__default = /*#__PURE__*/_interopDefaultLegacy(MoreVertIcon);
|
|
32
34
|
var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
|
|
33
35
|
|
|
34
36
|
/*! *****************************************************************************
|
|
@@ -159,20 +161,6 @@
|
|
|
159
161
|
}, content));
|
|
160
162
|
};
|
|
161
163
|
|
|
162
|
-
var useStyles$d = makeStyles__default["default"](function () {
|
|
163
|
-
return {
|
|
164
|
-
dialogHeader: {
|
|
165
|
-
zIndex: 1,
|
|
166
|
-
padding: '8px 20px',
|
|
167
|
-
display: 'flex',
|
|
168
|
-
justifyContent: 'space-between',
|
|
169
|
-
alignItems: 'center'
|
|
170
|
-
},
|
|
171
|
-
dialogContent: {
|
|
172
|
-
padding: '40px 20px 0px 20px !important'
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
164
|
var ConfirmationDialog = function ConfirmationDialog(_a) {
|
|
177
165
|
var open = _a.open,
|
|
178
166
|
title = _a.title,
|
|
@@ -188,8 +176,6 @@
|
|
|
188
176
|
content = _e === void 0 ? null : _e,
|
|
189
177
|
other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content"]);
|
|
190
178
|
|
|
191
|
-
var classes = useStyles$d();
|
|
192
|
-
|
|
193
179
|
other.catchOnCancel;
|
|
194
180
|
var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
|
|
195
181
|
|
|
@@ -197,14 +183,33 @@
|
|
|
197
183
|
return /*#__PURE__*/React__namespace.createElement(material.Dialog, __assign({
|
|
198
184
|
"data-testid": "confirmationDialog",
|
|
199
185
|
open: open,
|
|
200
|
-
|
|
201
|
-
|
|
186
|
+
PaperProps: {
|
|
187
|
+
sx: {
|
|
188
|
+
width: '560px',
|
|
189
|
+
margin: 2.5
|
|
190
|
+
}
|
|
191
|
+
},
|
|
202
192
|
// fix for briefly showing default options when closing dialog
|
|
203
193
|
transitionDuration: 0
|
|
204
194
|
}, rest), /*#__PURE__*/React__namespace.createElement(material.DialogTitle, {
|
|
205
|
-
|
|
195
|
+
sx: {
|
|
196
|
+
zIndex: 1,
|
|
197
|
+
padding: 2,
|
|
198
|
+
display: 'flex',
|
|
199
|
+
justifyContent: 'space-between',
|
|
200
|
+
alignItems: 'center'
|
|
201
|
+
}
|
|
206
202
|
}, /*#__PURE__*/React__namespace.createElement(material.Typography, {
|
|
207
|
-
|
|
203
|
+
sx: {
|
|
204
|
+
fontSize: {
|
|
205
|
+
xs: '16px',
|
|
206
|
+
sm: '34px'
|
|
207
|
+
},
|
|
208
|
+
fontWeight: {
|
|
209
|
+
xs: 500,
|
|
210
|
+
sm: 400
|
|
211
|
+
}
|
|
212
|
+
},
|
|
208
213
|
"data-testid": "confirmationDialog-title",
|
|
209
214
|
component: "span"
|
|
210
215
|
}, title), /*#__PURE__*/React__namespace.createElement(material.IconButton, {
|
|
@@ -214,23 +219,51 @@
|
|
|
214
219
|
return onClose('CLOSED');
|
|
215
220
|
},
|
|
216
221
|
size: "small"
|
|
217
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
218
|
-
|
|
222
|
+
}, /*#__PURE__*/React__namespace.createElement(Close__default["default"], null))), /*#__PURE__*/React__namespace.createElement(material.DialogContent, {
|
|
223
|
+
sx: {
|
|
224
|
+
padding: '8px 16px'
|
|
225
|
+
}
|
|
219
226
|
}, /*#__PURE__*/React__namespace.createElement(material.Typography, {
|
|
220
227
|
variant: "body1"
|
|
221
|
-
}, description), content), /*#__PURE__*/React__namespace.createElement(material.DialogActions,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
228
|
+
}, description), content), /*#__PURE__*/React__namespace.createElement(material.DialogActions, {
|
|
229
|
+
sx: {
|
|
230
|
+
padding: 2,
|
|
231
|
+
flexDirection: {
|
|
232
|
+
xs: 'column',
|
|
233
|
+
sm: 'row'
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
237
|
+
"data-testid": "confirmationDialog-cancel",
|
|
238
|
+
variant: "tertiary",
|
|
239
|
+
sx: {
|
|
240
|
+
width: {
|
|
241
|
+
xs: '100%',
|
|
242
|
+
sm: '150px'
|
|
243
|
+
}
|
|
244
|
+
},
|
|
225
245
|
onClick: function onClick() {
|
|
226
246
|
return onClose('CANCELLED');
|
|
227
247
|
},
|
|
228
248
|
autoFocus: true,
|
|
229
249
|
disableRipple: true
|
|
230
250
|
}, cancelLabel), /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
231
|
-
"data-testid": "
|
|
232
|
-
|
|
233
|
-
|
|
251
|
+
"data-testid": "confirmationDialog-confirm",
|
|
252
|
+
variant: "primary",
|
|
253
|
+
sx: {
|
|
254
|
+
width: {
|
|
255
|
+
xs: '100%',
|
|
256
|
+
sm: '150px'
|
|
257
|
+
},
|
|
258
|
+
marginLeft: {
|
|
259
|
+
xs: '0px!important',
|
|
260
|
+
sm: '8px!important'
|
|
261
|
+
},
|
|
262
|
+
marginTop: {
|
|
263
|
+
xs: 2,
|
|
264
|
+
sm: 0
|
|
265
|
+
}
|
|
266
|
+
},
|
|
234
267
|
onClick: onSubmit
|
|
235
268
|
}, confirmLabel)));
|
|
236
269
|
};
|
|
@@ -501,12 +534,13 @@
|
|
|
501
534
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
502
535
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
503
536
|
* */
|
|
504
|
-
var useStyles$
|
|
537
|
+
var useStyles$a = makeStyles__default["default"](function () {
|
|
505
538
|
return {
|
|
506
539
|
title: {
|
|
507
540
|
fontSize: '14px',
|
|
508
541
|
fontWeight: 'normal',
|
|
509
|
-
marginTop: '0px!important'
|
|
542
|
+
marginTop: '0px!important',
|
|
543
|
+
paddingTop: '0px!important'
|
|
510
544
|
},
|
|
511
545
|
info: {
|
|
512
546
|
fontSize: '16px'
|
|
@@ -523,8 +557,7 @@
|
|
|
523
557
|
fill: "transparent"
|
|
524
558
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
525
559
|
d: "M12 4c4.418 0 8 3.581 8 8 0 4.418-3.582 8-8 8s-8-3.582-8-8c0-4.419 3.582-8 8-8zm1.052 6H10v1.613h.949v3.774H10V17h4v-1.613h-.948V10zM11.99 6c-.837 0-1.491.654-1.491 1.49 0 .837.654 1.51 1.49 1.51.837 0 1.51-.673 1.51-1.51 0-.836-.673-1.49-1.51-1.49z",
|
|
526
|
-
transform: "translate(-946.000000, -368.000000) translate(930.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
527
|
-
fill: "#0062E6"
|
|
560
|
+
transform: "translate(-946.000000, -368.000000) translate(930.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
528
561
|
}));
|
|
529
562
|
|
|
530
563
|
case 'success':
|
|
@@ -534,8 +567,7 @@
|
|
|
534
567
|
fill: "transparent"
|
|
535
568
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
536
569
|
d: "M16.51 10.034l-5.633 5.633-3.387-3.386c-.369-.37-.369-.973 0-1.343.36-.357.983-.357 1.342 0l2.045 2.046 4.292-4.291c.357-.357.983-.359 1.342 0 .368.369.368.97 0 1.341M12 4C7.582 4 4 7.582 4 12s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8",
|
|
537
|
-
transform: "translate(-96.000000, -368.000000) translate(80.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
538
|
-
fill: "#72BB23"
|
|
570
|
+
transform: "translate(-96.000000, -368.000000) translate(80.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
539
571
|
}));
|
|
540
572
|
|
|
541
573
|
case 'warning':
|
|
@@ -545,8 +577,7 @@
|
|
|
545
577
|
fill: "transparent"
|
|
546
578
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
547
579
|
d: "M12.862 16.72c-.22.226-.507.339-.86.339-.364 0-.662-.113-.894-.34-.232-.226-.347-.52-.347-.885 0-.32.118-.59.356-.81.236-.22.531-.331.884-.331.332 0 .613.11.845.33.232.222.347.491.347.811 0 .365-.11.66-.33.886zm.216-9.805l-.134 6.669H11.06l-.15-6.67h2.169zM12 4.5c-4.141 0-7.5 3.359-7.5 7.501s3.359 7.5 7.5 7.5c4.142 0 7.5-3.358 7.5-7.5C19.5 7.86 16.142 4.5 12 4.5z",
|
|
548
|
-
transform: "translate(-521.000000, -368.000000) translate(505.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
549
|
-
fill: "#FFA800"
|
|
580
|
+
transform: "translate(-521.000000, -368.000000) translate(505.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
550
581
|
}));
|
|
551
582
|
|
|
552
583
|
case 'error':
|
|
@@ -557,8 +588,7 @@
|
|
|
557
588
|
fill: "transparent"
|
|
558
589
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
559
590
|
d: "M12.862 16.72c-.22.226-.507.339-.86.339-.364 0-.662-.113-.894-.34-.232-.226-.347-.52-.347-.885 0-.32.118-.59.356-.81.236-.22.531-.331.884-.331.332 0 .613.11.845.33.232.222.347.491.347.811 0 .365-.11.66-.33.886zm.216-9.805l-.134 6.669H11.06l-.15-6.67h2.169zM12 4.5c-4.141 0-7.5 3.359-7.5 7.501s3.359 7.5 7.5 7.5c4.142 0 7.5-3.358 7.5-7.5C19.5 7.86 16.142 4.5 12 4.5z",
|
|
560
|
-
transform: "translate(-1371.000000, -368.000000) translate(1355.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
561
|
-
fill: "#C00000"
|
|
591
|
+
transform: "translate(-1371.000000, -368.000000) translate(1355.000000, 356.000000) translate(16.000000, 12.000000)"
|
|
562
592
|
}));
|
|
563
593
|
}
|
|
564
594
|
};
|
|
@@ -570,12 +600,31 @@
|
|
|
570
600
|
_c = _a.info,
|
|
571
601
|
info = _c === void 0 ? '' : _c,
|
|
572
602
|
_d = _a.dataTestId,
|
|
573
|
-
dataTestId = _d === void 0 ? 'alert-banner' : _d
|
|
574
|
-
|
|
603
|
+
dataTestId = _d === void 0 ? 'alert-banner' : _d,
|
|
604
|
+
_e = _a.isCompact,
|
|
605
|
+
isCompact = _e === void 0 ? false : _e;
|
|
606
|
+
var classes = useStyles$a();
|
|
575
607
|
return /*#__PURE__*/React__namespace.createElement(material.Alert, {
|
|
576
608
|
"data-testid": dataTestId,
|
|
577
609
|
severity: severity,
|
|
578
|
-
icon: getIcon(severity)
|
|
610
|
+
icon: getIcon(severity),
|
|
611
|
+
sx: isCompact ? {
|
|
612
|
+
height: '32px',
|
|
613
|
+
boxSizing: 'border-box',
|
|
614
|
+
'& .MuiAlert-message': {
|
|
615
|
+
padding: '0px',
|
|
616
|
+
whiteSpace: 'nowrap',
|
|
617
|
+
overflow: 'hidden',
|
|
618
|
+
textOverflow: 'ellipsis',
|
|
619
|
+
'& .MuiTypography-root': {
|
|
620
|
+
display: 'inline'
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
'& .MuiAlert-icon': {
|
|
624
|
+
margin: '-3px 10px 0px 0px',
|
|
625
|
+
padding: '0px'
|
|
626
|
+
}
|
|
627
|
+
} : {}
|
|
579
628
|
}, /*#__PURE__*/React__namespace.createElement(material.AlertTitle, {
|
|
580
629
|
className: classes.title
|
|
581
630
|
}, title), info && /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -599,7 +648,7 @@
|
|
|
599
648
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
600
649
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
601
650
|
* */
|
|
602
|
-
var useStyles$
|
|
651
|
+
var useStyles$9 = makeStyles__default["default"](function () {
|
|
603
652
|
return {
|
|
604
653
|
wrapper: {
|
|
605
654
|
height: '100vh',
|
|
@@ -616,7 +665,7 @@
|
|
|
616
665
|
var AppLayout = function AppLayout(_a) {
|
|
617
666
|
var header = _a.header,
|
|
618
667
|
children = _a.children;
|
|
619
|
-
var classes = useStyles$
|
|
668
|
+
var classes = useStyles$9();
|
|
620
669
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
621
670
|
className: classes.wrapper
|
|
622
671
|
}, header, /*#__PURE__*/React__default["default"].createElement("main", {
|
|
@@ -642,7 +691,7 @@
|
|
|
642
691
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
643
692
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
644
693
|
* */
|
|
645
|
-
var useStyles$
|
|
694
|
+
var useStyles$8 = makeStyles__default["default"](function (theme) {
|
|
646
695
|
var _a;
|
|
647
696
|
|
|
648
697
|
return {
|
|
@@ -679,7 +728,7 @@
|
|
|
679
728
|
userMenu = _a.userMenu,
|
|
680
729
|
_b = _a.title,
|
|
681
730
|
title = _b === void 0 ? 'GeoWeb' : _b;
|
|
682
|
-
var classes = useStyles$
|
|
731
|
+
var classes = useStyles$8();
|
|
683
732
|
return /*#__PURE__*/React__default["default"].createElement("header", {
|
|
684
733
|
className: classes.header
|
|
685
734
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
@@ -763,38 +812,29 @@
|
|
|
763
812
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
764
813
|
* */
|
|
765
814
|
|
|
766
|
-
var useStyles$9 = function useStyles(isRightAligned) {
|
|
767
|
-
return makeStyles__default["default"](function () {
|
|
768
|
-
return {
|
|
769
|
-
icon: __assign(__assign({
|
|
770
|
-
width: 20,
|
|
771
|
-
height: 20,
|
|
772
|
-
top: -10,
|
|
773
|
-
position: 'relative'
|
|
774
|
-
}, isRightAligned ? {
|
|
775
|
-
left: -10
|
|
776
|
-
} : {
|
|
777
|
-
left: 10,
|
|
778
|
-
transform: 'rotate(90deg)'
|
|
779
|
-
}), {
|
|
780
|
-
zIndex: 1
|
|
781
|
-
})
|
|
782
|
-
};
|
|
783
|
-
});
|
|
784
|
-
};
|
|
785
|
-
|
|
786
815
|
var ResizeHandle = function ResizeHandle(_a) {
|
|
787
816
|
var isRightAligned = _a.isRightAligned;
|
|
788
817
|
var theme = material.useTheme();
|
|
789
|
-
var styles = useStyles$9(isRightAligned)();
|
|
790
818
|
return /*#__PURE__*/React__default["default"].createElement(material.SvgIcon, {
|
|
791
|
-
|
|
819
|
+
sx: __assign(__assign({
|
|
820
|
+
width: 20,
|
|
821
|
+
height: 20,
|
|
822
|
+
top: -10,
|
|
823
|
+
position: 'relative'
|
|
824
|
+
}, isRightAligned ? {
|
|
825
|
+
left: -10
|
|
826
|
+
} : {
|
|
827
|
+
left: 10,
|
|
828
|
+
transform: 'rotate(90deg)'
|
|
829
|
+
}), {
|
|
830
|
+
zIndex: 1
|
|
831
|
+
}),
|
|
792
832
|
"data-testid": "resizeHandle"
|
|
793
833
|
}, /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
794
834
|
fill: "#ffffff"
|
|
795
835
|
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
796
836
|
d: "M19.687 18.037v1h-6v-1h6zm3.5-3.5v1h-13v-1h13z",
|
|
797
|
-
fill: "" + theme.palette.geowebColors.
|
|
837
|
+
fill: "" + theme.palette.geowebColors.buttons.flat["default"].color,
|
|
798
838
|
transform: "rotate(-45 16.687 16.787)"
|
|
799
839
|
}));
|
|
800
840
|
};
|
|
@@ -962,7 +1002,7 @@
|
|
|
962
1002
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
963
1003
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
964
1004
|
* */
|
|
965
|
-
var useStyles$
|
|
1005
|
+
var useStyles$7 = makeStyles__default["default"](function (theme) {
|
|
966
1006
|
return {
|
|
967
1007
|
container: {
|
|
968
1008
|
position: 'absolute',
|
|
@@ -1010,7 +1050,7 @@
|
|
|
1010
1050
|
} : _d,
|
|
1011
1051
|
children = _a.children,
|
|
1012
1052
|
initials = _a.initials;
|
|
1013
|
-
var classes = useStyles$
|
|
1053
|
+
var classes = useStyles$7();
|
|
1014
1054
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
|
|
1015
1055
|
"data-testid": "userButton",
|
|
1016
1056
|
onClick: onToggle,
|
|
@@ -1052,7 +1092,9 @@
|
|
|
1052
1092
|
isDark = _a.isDark,
|
|
1053
1093
|
toggleTheme = _a.toggleTheme;
|
|
1054
1094
|
|
|
1055
|
-
return /*#__PURE__*/React__default["default"].createElement(material.MenuItem,
|
|
1095
|
+
return /*#__PURE__*/React__default["default"].createElement(material.MenuItem, {
|
|
1096
|
+
divider: true
|
|
1097
|
+
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1056
1098
|
container: true
|
|
1057
1099
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1058
1100
|
item: true
|
|
@@ -1091,7 +1133,7 @@
|
|
|
1091
1133
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1092
1134
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1093
1135
|
* */
|
|
1094
|
-
var useStyles$
|
|
1136
|
+
var useStyles$6 = makeStyles__default["default"](function (theme) {
|
|
1095
1137
|
return {
|
|
1096
1138
|
footer: {
|
|
1097
1139
|
boxShadow: theme.shadows[1],
|
|
@@ -1104,7 +1146,7 @@
|
|
|
1104
1146
|
}); // drag handles will be handled by DraggableResizable/Resizable
|
|
1105
1147
|
|
|
1106
1148
|
var ToolFooter = function ToolFooter() {
|
|
1107
|
-
var classes = useStyles$
|
|
1149
|
+
var classes = useStyles$6();
|
|
1108
1150
|
return /*#__PURE__*/React__default["default"].createElement("footer", {
|
|
1109
1151
|
className: classes.footer
|
|
1110
1152
|
});
|
|
@@ -1142,7 +1184,7 @@
|
|
|
1142
1184
|
return {
|
|
1143
1185
|
fontSize: 16,
|
|
1144
1186
|
fontWeight: 500,
|
|
1145
|
-
padding:
|
|
1187
|
+
padding: '4px'
|
|
1146
1188
|
};
|
|
1147
1189
|
}
|
|
1148
1190
|
|
|
@@ -1151,7 +1193,7 @@
|
|
|
1151
1193
|
return {
|
|
1152
1194
|
fontSize: 20,
|
|
1153
1195
|
fontWeight: 400,
|
|
1154
|
-
padding:
|
|
1196
|
+
padding: '8px'
|
|
1155
1197
|
};
|
|
1156
1198
|
}
|
|
1157
1199
|
|
|
@@ -1160,7 +1202,7 @@
|
|
|
1160
1202
|
return {
|
|
1161
1203
|
fontSize: 16,
|
|
1162
1204
|
fontWeight: 500,
|
|
1163
|
-
padding:
|
|
1205
|
+
padding: '12px'
|
|
1164
1206
|
};
|
|
1165
1207
|
}
|
|
1166
1208
|
|
|
@@ -1171,45 +1213,13 @@
|
|
|
1171
1213
|
}
|
|
1172
1214
|
};
|
|
1173
1215
|
|
|
1174
|
-
var
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
},
|
|
1182
|
-
zIndex: 1,
|
|
1183
|
-
cursor: function cursor(props) {
|
|
1184
|
-
return props.isDraggable ? 'move' : null;
|
|
1185
|
-
}
|
|
1186
|
-
},
|
|
1187
|
-
title: {
|
|
1188
|
-
fontSize: function fontSize(props) {
|
|
1189
|
-
return props.styles.fontSize;
|
|
1190
|
-
},
|
|
1191
|
-
fontWeight: function fontWeight(props) {
|
|
1192
|
-
return props.styles.fontWeight;
|
|
1193
|
-
}
|
|
1194
|
-
},
|
|
1195
|
-
iconClose: {
|
|
1196
|
-
color: theme.palette.geowebColors.greys.accessible,
|
|
1197
|
-
padding: 0
|
|
1198
|
-
},
|
|
1199
|
-
iconDrag: {
|
|
1200
|
-
color: theme.palette.geowebColors.greys.accessible,
|
|
1201
|
-
padding: 0,
|
|
1202
|
-
pointerEvents: 'none'
|
|
1203
|
-
},
|
|
1204
|
-
iconDragHorizontal: {
|
|
1205
|
-
color: theme.palette.geowebColors.greys.accessible,
|
|
1206
|
-
padding: 0,
|
|
1207
|
-
pointerEvents: 'none',
|
|
1208
|
-
transform: 'rotate(90deg)',
|
|
1209
|
-
height: 12
|
|
1210
|
-
}
|
|
1211
|
-
};
|
|
1212
|
-
});
|
|
1216
|
+
var iconStyle = {
|
|
1217
|
+
color: 'geowebColors.greys.accessible',
|
|
1218
|
+
padding: 0,
|
|
1219
|
+
'&:hover': {
|
|
1220
|
+
background: 'action.hover'
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1213
1223
|
|
|
1214
1224
|
var ToolHeader = function ToolHeader(_a) {
|
|
1215
1225
|
var size = _a.size,
|
|
@@ -1221,17 +1231,21 @@
|
|
|
1221
1231
|
_d = _a.className,
|
|
1222
1232
|
className = _d === void 0 ? '' : _d;
|
|
1223
1233
|
var styles = getStyle(size);
|
|
1224
|
-
var classes = useStyles$6({
|
|
1225
|
-
styles: styles,
|
|
1226
|
-
isDraggable: isDraggable
|
|
1227
|
-
});
|
|
1228
1234
|
|
|
1229
1235
|
var onClickClose = function onClickClose() {
|
|
1230
1236
|
return onClose();
|
|
1231
1237
|
};
|
|
1232
1238
|
|
|
1233
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
1234
|
-
|
|
1239
|
+
return /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
1240
|
+
component: "header",
|
|
1241
|
+
className: className,
|
|
1242
|
+
sx: {
|
|
1243
|
+
boxShadow: 1,
|
|
1244
|
+
backgroundColor: 'geowebColors.background.surface',
|
|
1245
|
+
padding: styles.padding,
|
|
1246
|
+
zIndex: 2,
|
|
1247
|
+
cursor: isDraggable ? 'move' : null
|
|
1248
|
+
}
|
|
1235
1249
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1236
1250
|
container: true,
|
|
1237
1251
|
alignItems: "center"
|
|
@@ -1243,9 +1257,11 @@
|
|
|
1243
1257
|
justifyContent: "flex-start"
|
|
1244
1258
|
}, isDraggable && size !== 'xxs' && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
|
|
1245
1259
|
"data-testid": "dragBtn",
|
|
1246
|
-
className: classes.iconDrag,
|
|
1247
1260
|
disableRipple: true,
|
|
1248
|
-
size: "large"
|
|
1261
|
+
size: "large",
|
|
1262
|
+
sx: __assign(__assign({}, iconStyle), {
|
|
1263
|
+
pointerEvents: 'none'
|
|
1264
|
+
})
|
|
1249
1265
|
}, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null)))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1250
1266
|
item: true,
|
|
1251
1267
|
xs: 10
|
|
@@ -1255,12 +1271,19 @@
|
|
|
1255
1271
|
alignItems: "center"
|
|
1256
1272
|
}, title && /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
1257
1273
|
variant: "h2",
|
|
1258
|
-
|
|
1274
|
+
sx: {
|
|
1275
|
+
fontSize: styles.fontSize,
|
|
1276
|
+
fontWeight: styles.fontWeight
|
|
1277
|
+
}
|
|
1259
1278
|
}, title), size === 'xxs' && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
|
|
1260
1279
|
"data-testid": "dragBtn-xxs",
|
|
1261
|
-
className: classes.iconDragHorizontal,
|
|
1262
1280
|
disableRipple: true,
|
|
1263
|
-
size: "small"
|
|
1281
|
+
size: "small",
|
|
1282
|
+
sx: __assign(__assign({}, iconStyle), {
|
|
1283
|
+
pointerEvents: 'none',
|
|
1284
|
+
transform: 'rotate(90deg)',
|
|
1285
|
+
height: 12
|
|
1286
|
+
})
|
|
1264
1287
|
}, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null)))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
1265
1288
|
item: true,
|
|
1266
1289
|
xs: 1,
|
|
@@ -1268,9 +1291,9 @@
|
|
|
1268
1291
|
justifyContent: "flex-end"
|
|
1269
1292
|
}, onClose && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
|
|
1270
1293
|
"data-testid": "closeBtn",
|
|
1271
|
-
className: classes.iconClose,
|
|
1272
1294
|
onClick: onClickClose,
|
|
1273
|
-
size: "large"
|
|
1295
|
+
size: "large",
|
|
1296
|
+
sx: iconStyle
|
|
1274
1297
|
}, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.Close, null)))));
|
|
1275
1298
|
};
|
|
1276
1299
|
|
|
@@ -1302,7 +1325,6 @@
|
|
|
1302
1325
|
content: {
|
|
1303
1326
|
flex: 1,
|
|
1304
1327
|
overflowY: 'auto',
|
|
1305
|
-
zIndex: 2,
|
|
1306
1328
|
position: 'relative'
|
|
1307
1329
|
}
|
|
1308
1330
|
};
|
|
@@ -1364,6 +1386,19 @@
|
|
|
1364
1386
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1365
1387
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1366
1388
|
* */
|
|
1389
|
+
|
|
1390
|
+
var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
|
|
1391
|
+
var width = window.innerWidth * 0.85;
|
|
1392
|
+
var height = window.innerHeight * 0.85;
|
|
1393
|
+
var top = window.innerHeight * 0.15 / 2;
|
|
1394
|
+
var left = window.innerWidth * 0.15 / 2;
|
|
1395
|
+
return {
|
|
1396
|
+
width: width,
|
|
1397
|
+
height: height,
|
|
1398
|
+
top: top,
|
|
1399
|
+
left: left
|
|
1400
|
+
};
|
|
1401
|
+
};
|
|
1367
1402
|
var BASE_Z_INDEX = 100;
|
|
1368
1403
|
|
|
1369
1404
|
var DraggableComponent = function DraggableComponent(_a) {
|
|
@@ -1495,6 +1530,7 @@
|
|
|
1495
1530
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1496
1531
|
style: __assign({
|
|
1497
1532
|
position: 'absolute',
|
|
1533
|
+
pointerEvents: 'all',
|
|
1498
1534
|
zIndex: zIndex
|
|
1499
1535
|
}, startPosition),
|
|
1500
1536
|
ref: nodeRef
|
|
@@ -1881,6 +1917,14 @@
|
|
|
1881
1917
|
}, "+"), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
|
|
1882
1918
|
type: "icon"
|
|
1883
1919
|
}, /*#__PURE__*/React__default["default"].createElement(ArrowLeftIcon, null)))
|
|
1920
|
+
}, {
|
|
1921
|
+
title: 'Change layer manager values by scrolling',
|
|
1922
|
+
description: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
|
|
1923
|
+
type: "icon"
|
|
1924
|
+
}, "Ctrl"), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, null, " + Mouse scroll")),
|
|
1925
|
+
descriptionMac: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
|
|
1926
|
+
type: "icon"
|
|
1927
|
+
}, /*#__PURE__*/React__default["default"].createElement(CommandIcon, null)), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, null, " + Mouse scroll"))
|
|
1884
1928
|
}];
|
|
1885
1929
|
var getShortcutList = function getShortcutList(shortcutList, platform) {
|
|
1886
1930
|
if (platform === void 0) {
|
|
@@ -2024,7 +2068,8 @@
|
|
|
2024
2068
|
|
|
2025
2069
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.MenuItem, {
|
|
2026
2070
|
"data-testid": "cheatsheet-btn",
|
|
2027
|
-
onClick: onOpen
|
|
2071
|
+
onClick: onOpen,
|
|
2072
|
+
divider: true
|
|
2028
2073
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
2029
2074
|
container: true
|
|
2030
2075
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
@@ -2232,83 +2277,388 @@
|
|
|
2232
2277
|
}, props));
|
|
2233
2278
|
};
|
|
2234
2279
|
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2280
|
+
/* *
|
|
2281
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2282
|
+
* you may not use this file except in compliance with the License.
|
|
2283
|
+
* You may obtain a copy of the License at
|
|
2284
|
+
*
|
|
2285
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2286
|
+
*
|
|
2287
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2288
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2289
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2290
|
+
* See the License for the specific language governing permissions and
|
|
2291
|
+
* limitations under the License.
|
|
2292
|
+
*
|
|
2293
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2294
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2295
|
+
* */
|
|
2296
|
+
|
|
2297
|
+
var CustomToggleButton = function CustomToggleButton(_a) {
|
|
2298
|
+
var _b = _a.variant,
|
|
2299
|
+
variant = _b === void 0 ? 'primary' : _b,
|
|
2300
|
+
_c = _a.value,
|
|
2301
|
+
value = _c === void 0 ? 0 : _c,
|
|
2302
|
+
props = __rest(_a, ["variant", "value"]);
|
|
2303
|
+
|
|
2304
|
+
return /*#__PURE__*/React__namespace.createElement(material.ToggleButton, __assign({
|
|
2305
|
+
className: variant,
|
|
2306
|
+
value: value
|
|
2307
|
+
}, props));
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
/* *
|
|
2311
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2312
|
+
* you may not use this file except in compliance with the License.
|
|
2313
|
+
* You may obtain a copy of the License at
|
|
2314
|
+
*
|
|
2315
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2316
|
+
*
|
|
2317
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2318
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2319
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2320
|
+
* See the License for the specific language governing permissions and
|
|
2321
|
+
* limitations under the License.
|
|
2322
|
+
*
|
|
2323
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2324
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2325
|
+
* */
|
|
2326
|
+
var ToolButton = function ToolButton(_a) {
|
|
2327
|
+
var active = _a.active,
|
|
2328
|
+
_b = _a.width,
|
|
2329
|
+
width = _b === void 0 ? '24px' : _b,
|
|
2330
|
+
_c = _a.height,
|
|
2331
|
+
height = _c === void 0 ? '24px' : _c,
|
|
2332
|
+
children = _a.children,
|
|
2333
|
+
_d = _a.value,
|
|
2334
|
+
value = _d === void 0 ? 0 : _d,
|
|
2335
|
+
_e = _a.sx,
|
|
2336
|
+
sx = _e === void 0 ? {} : _e,
|
|
2337
|
+
props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
|
|
2338
|
+
|
|
2339
|
+
return /*#__PURE__*/React__namespace.createElement(CustomToggleButton, __assign({
|
|
2340
|
+
variant: "tool",
|
|
2341
|
+
disableRipple: true,
|
|
2342
|
+
selected: active,
|
|
2343
|
+
value: value,
|
|
2344
|
+
sx: __assign({
|
|
2345
|
+
width: width + "!important",
|
|
2346
|
+
height: height + "!important",
|
|
2347
|
+
textTransform: 'none!important',
|
|
2348
|
+
padding: '11px!important'
|
|
2349
|
+
}, sx)
|
|
2350
|
+
}, props), children);
|
|
2351
|
+
};
|
|
2352
|
+
|
|
2353
|
+
var getPosition = function getPosition(menuPosition) {
|
|
2354
|
+
switch (menuPosition) {
|
|
2355
|
+
case 'bottom':
|
|
2240
2356
|
return {
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
overflow: 'hidden',
|
|
2250
|
-
zIndex: props.zIndex
|
|
2357
|
+
anchorOrigin: {
|
|
2358
|
+
vertical: 'bottom',
|
|
2359
|
+
horizontal: 'center'
|
|
2360
|
+
},
|
|
2361
|
+
transformOrigin: {
|
|
2362
|
+
vertical: 'top',
|
|
2363
|
+
horizontal: 'center'
|
|
2364
|
+
}
|
|
2251
2365
|
};
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
overflowY: 'scroll'
|
|
2256
|
-
},
|
|
2257
|
-
dialogHeader: function dialogHeader(props) {
|
|
2366
|
+
|
|
2367
|
+
default:
|
|
2368
|
+
case 'left':
|
|
2258
2369
|
return {
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2370
|
+
anchorOrigin: {
|
|
2371
|
+
vertical: 'center',
|
|
2372
|
+
horizontal: 'left'
|
|
2373
|
+
},
|
|
2374
|
+
transformOrigin: {
|
|
2375
|
+
vertical: 'center',
|
|
2376
|
+
horizontal: 'right'
|
|
2377
|
+
}
|
|
2267
2378
|
};
|
|
2379
|
+
}
|
|
2380
|
+
};
|
|
2381
|
+
|
|
2382
|
+
var ToggleMenu = function ToggleMenu(_a) {
|
|
2383
|
+
var _b = _a.buttonTestId,
|
|
2384
|
+
buttonTestId = _b === void 0 ? 'toggleMenuButton' : _b,
|
|
2385
|
+
_c = _a.menuPosition,
|
|
2386
|
+
menuPosition = _c === void 0 ? 'left' : _c,
|
|
2387
|
+
menuItems = _a.menuItems,
|
|
2388
|
+
children = _a.children,
|
|
2389
|
+
buttonSx = _a.buttonSx,
|
|
2390
|
+
_d = _a.tooltipTitle,
|
|
2391
|
+
tooltipTitle = _d === void 0 ? '' : _d;
|
|
2392
|
+
|
|
2393
|
+
var _e = __read(React__namespace.useState(null), 2),
|
|
2394
|
+
anchorEl = _e[0],
|
|
2395
|
+
setAnchorEl = _e[1];
|
|
2396
|
+
|
|
2397
|
+
var isOpen = Boolean(anchorEl);
|
|
2398
|
+
|
|
2399
|
+
var _f = getPosition(menuPosition),
|
|
2400
|
+
anchorOrigin = _f.anchorOrigin,
|
|
2401
|
+
transformOrigin = _f.transformOrigin;
|
|
2402
|
+
|
|
2403
|
+
var handleClick = function handleClick(event) {
|
|
2404
|
+
setAnchorEl(event.currentTarget);
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
var handleClose = function handleClose() {
|
|
2408
|
+
setAnchorEl(null);
|
|
2409
|
+
};
|
|
2410
|
+
|
|
2411
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
|
|
2412
|
+
active: isOpen,
|
|
2413
|
+
sx: buttonSx,
|
|
2414
|
+
onClick: handleClick,
|
|
2415
|
+
"data-testid": buttonTestId
|
|
2416
|
+
}, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
|
|
2417
|
+
placement: "top",
|
|
2418
|
+
title: tooltipTitle
|
|
2419
|
+
}, /*#__PURE__*/React__namespace.createElement(MoreVertIcon__default["default"], null))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
|
|
2420
|
+
anchorEl: anchorEl,
|
|
2421
|
+
open: isOpen,
|
|
2422
|
+
onClose: handleClose,
|
|
2423
|
+
anchorOrigin: anchorOrigin,
|
|
2424
|
+
transformOrigin: transformOrigin,
|
|
2425
|
+
BackdropProps: {
|
|
2426
|
+
style: {
|
|
2427
|
+
opacity: 0,
|
|
2428
|
+
transition: 'none'
|
|
2429
|
+
}
|
|
2268
2430
|
},
|
|
2269
|
-
|
|
2270
|
-
|
|
2431
|
+
MenuListProps: children && {
|
|
2432
|
+
style: {
|
|
2433
|
+
padding: '0px'
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
}, menuItems && menuItems.map(function (menuItem) {
|
|
2437
|
+
var text = menuItem.text,
|
|
2438
|
+
icon = menuItem.icon,
|
|
2439
|
+
action = menuItem.action;
|
|
2440
|
+
return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
|
|
2441
|
+
key: text,
|
|
2442
|
+
onClick: function onClick() {
|
|
2443
|
+
action();
|
|
2444
|
+
handleClose();
|
|
2445
|
+
}
|
|
2446
|
+
}, icon && /*#__PURE__*/React__namespace.createElement(material.ListItemIcon, null, icon), /*#__PURE__*/React__namespace.createElement(material.Typography, null, text));
|
|
2447
|
+
}), children));
|
|
2448
|
+
};
|
|
2449
|
+
|
|
2450
|
+
/* *
|
|
2451
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2452
|
+
* you may not use this file except in compliance with the License.
|
|
2453
|
+
* You may obtain a copy of the License at
|
|
2454
|
+
*
|
|
2455
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2456
|
+
*
|
|
2457
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2458
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2459
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2460
|
+
* See the License for the specific language governing permissions and
|
|
2461
|
+
* limitations under the License.
|
|
2462
|
+
*
|
|
2463
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2464
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2465
|
+
* */
|
|
2466
|
+
var useStyles = makeStyles__default["default"](function (theme) {
|
|
2467
|
+
return createStyles__default["default"]({
|
|
2468
|
+
button: {
|
|
2469
|
+
height: 28,
|
|
2470
|
+
width: 28,
|
|
2471
|
+
borderRadius: 5,
|
|
2472
|
+
marginTop: 2,
|
|
2473
|
+
color: function color(_a) {
|
|
2474
|
+
var isActive = _a.isActive,
|
|
2475
|
+
isAccessible = _a.isAccessible,
|
|
2476
|
+
isEnabled = _a.isEnabled;
|
|
2477
|
+
|
|
2478
|
+
if (!isEnabled) {
|
|
2479
|
+
return theme.palette.geowebColors.buttons.flat.disabled.color;
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
if (isAccessible) {
|
|
2483
|
+
return theme.palette.geowebColors.greys.accessible;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
if (isActive) {
|
|
2487
|
+
return theme.palette.common.white;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
return theme.palette.geowebColors.buttons.flat["default"].color;
|
|
2491
|
+
},
|
|
2492
|
+
backgroundColor: function backgroundColor(_a) {
|
|
2493
|
+
var isActive = _a.isActive;
|
|
2494
|
+
return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
|
|
2495
|
+
},
|
|
2496
|
+
'&:focus': {
|
|
2497
|
+
backgroundColor: function backgroundColor(_a) {
|
|
2498
|
+
var isActive = _a.isActive;
|
|
2499
|
+
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2500
|
+
},
|
|
2501
|
+
outline: theme.palette.geowebColors.buttons.focusDefault.outline,
|
|
2502
|
+
borderRadius: 0
|
|
2503
|
+
},
|
|
2504
|
+
'&:hover': {
|
|
2505
|
+
backgroundColor: function backgroundColor(_a) {
|
|
2506
|
+
var isActive = _a.isActive;
|
|
2507
|
+
return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2271
2510
|
},
|
|
2272
|
-
|
|
2273
|
-
|
|
2511
|
+
popper: {
|
|
2512
|
+
pointerEvents: 'none'
|
|
2274
2513
|
}
|
|
2275
2514
|
});
|
|
2276
2515
|
});
|
|
2516
|
+
var ManagerButton = function ManagerButton(_a) {
|
|
2517
|
+
var _b = _a.tooltipTitle,
|
|
2518
|
+
tooltipTitle = _b === void 0 ? '' : _b,
|
|
2519
|
+
_c = _a.onClick,
|
|
2520
|
+
onClick = _c === void 0 ? function () {} : _c,
|
|
2521
|
+
_d = _a.isActive,
|
|
2522
|
+
isActive = _d === void 0 ? false : _d,
|
|
2523
|
+
_e = _a.isEnabled,
|
|
2524
|
+
isEnabled = _e === void 0 ? true : _e,
|
|
2525
|
+
icon = _a.icon,
|
|
2526
|
+
testId = _a.testId,
|
|
2527
|
+
_f = _a.isAccessible,
|
|
2528
|
+
isAccessible = _f === void 0 ? false : _f,
|
|
2529
|
+
className = _a.className,
|
|
2530
|
+
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
|
|
2531
|
+
|
|
2532
|
+
var classes = useStyles({
|
|
2533
|
+
isActive: isActive,
|
|
2534
|
+
isEnabled: isEnabled,
|
|
2535
|
+
isAccessible: isAccessible
|
|
2536
|
+
});
|
|
2537
|
+
|
|
2538
|
+
var handleClick = function handleClick(event) {
|
|
2539
|
+
onClick(event);
|
|
2540
|
+
};
|
|
2541
|
+
|
|
2542
|
+
return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
|
|
2543
|
+
title: tooltipTitle,
|
|
2544
|
+
placement: "top",
|
|
2545
|
+
classes: {
|
|
2546
|
+
popper: classes.popper
|
|
2547
|
+
}
|
|
2548
|
+
}, /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
|
|
2549
|
+
size: "small",
|
|
2550
|
+
onClick: handleClick,
|
|
2551
|
+
"data-testid": testId,
|
|
2552
|
+
className: classes.button + " " + className,
|
|
2553
|
+
disableFocusRipple: true
|
|
2554
|
+
}, props), icon));
|
|
2555
|
+
};
|
|
2556
|
+
|
|
2557
|
+
/* *
|
|
2558
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2559
|
+
* you may not use this file except in compliance with the License.
|
|
2560
|
+
* You may obtain a copy of the License at
|
|
2561
|
+
*
|
|
2562
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2563
|
+
*
|
|
2564
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2565
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2566
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2567
|
+
* See the License for the specific language governing permissions and
|
|
2568
|
+
* limitations under the License.
|
|
2569
|
+
*
|
|
2570
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2571
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2572
|
+
* */
|
|
2573
|
+
var ManagerDeleteButton = function ManagerDeleteButton(_a) {
|
|
2574
|
+
var tooltipTitle = _a.tooltipTitle,
|
|
2575
|
+
onClickDelete = _a.onClickDelete,
|
|
2576
|
+
_b = _a.isEnabled,
|
|
2577
|
+
isEnabled = _b === void 0 ? true : _b;
|
|
2578
|
+
return /*#__PURE__*/React__namespace.createElement(ManagerButton, {
|
|
2579
|
+
tooltipTitle: tooltipTitle,
|
|
2580
|
+
onClick: onClickDelete,
|
|
2581
|
+
icon: /*#__PURE__*/React__namespace.createElement(iconsMaterial.Delete, {
|
|
2582
|
+
sx: {
|
|
2583
|
+
width: 20,
|
|
2584
|
+
height: 20
|
|
2585
|
+
}
|
|
2586
|
+
}),
|
|
2587
|
+
testId: "deleteButton",
|
|
2588
|
+
isEnabled: isEnabled
|
|
2589
|
+
});
|
|
2590
|
+
};
|
|
2277
2591
|
|
|
2278
|
-
|
|
2279
|
-
|
|
2592
|
+
/* *
|
|
2593
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2594
|
+
* you may not use this file except in compliance with the License.
|
|
2595
|
+
* You may obtain a copy of the License at
|
|
2596
|
+
*
|
|
2597
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2598
|
+
*
|
|
2599
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2600
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2601
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2602
|
+
* See the License for the specific language governing permissions and
|
|
2603
|
+
* limitations under the License.
|
|
2604
|
+
*
|
|
2605
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2606
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2607
|
+
* */
|
|
2608
|
+
var EnableButton = function EnableButton(_a) {
|
|
2609
|
+
var isEnabled = _a.isEnabled,
|
|
2280
2610
|
title = _a.title,
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2611
|
+
onChangeEnableLayer = _a.onChangeEnableLayer;
|
|
2612
|
+
|
|
2613
|
+
var onClick = function onClick() {
|
|
2614
|
+
onChangeEnableLayer(!isEnabled);
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2617
|
+
var visibilityIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2618
|
+
width: 24,
|
|
2619
|
+
height: 24,
|
|
2620
|
+
fill: "transparent"
|
|
2621
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2622
|
+
d: "M14.4980749,15.8618431 C15.8661433,15.0851043 16.779689,13.6936347 16.779689,12.1014551 C16.779689,10.5092755 15.8661433,9.11870594 14.4980749,8.34106705 C17.6257313,9.18620931 19.3529176,11.4300215 19.8092405,12.1014551 C19.3529176,12.7719886 17.6266313,15.0167008 14.4980749,15.8618431 L14.4980749,15.8618431 Z M4.18985949,12.1014551 C4.64618231,11.4300215 6.37336867,9.18710936 9.49922496,8.3419671 C8.13295665,9.11870594 7.21851093,10.5101755 7.21851093,12.1014551 C7.21851093,13.6936347 8.13295665,15.0842042 9.49922496,15.8618431 C6.37336867,15.0167008 4.64618231,12.7728886 4.18985949,12.1014551 L4.18985949,12.1014551 Z M11.99955,13.8583429 C10.9950998,13.8583429 10.180559,13.0717036 10.180559,12.1014551 C10.180559,11.1312066 10.9950998,10.3445672 11.99955,10.3445672 C13.0031002,10.3445672 13.8176409,11.1312066 13.8176409,12.1014551 C13.8176409,13.0717036 13.0031002,13.8583429 11.99955,13.8583429 L11.99955,13.8583429 Z M20.7983899,11.7666383 C20.6813841,11.5713286 17.8696435,7 11.99955,7 C6.12945647,7 3.31681584,11.5713286 3.19980999,11.7666383 L3,12.1014551 L3.19980999,12.4362718 C3.31681584,12.6306815 6.12945647,17.2020101 11.99955,17.2020101 C17.8696435,17.2020101 20.6813841,12.6306815 20.7983899,12.4362718 L21,12.1014551 L20.7983899,11.7666383 Z"
|
|
2288
2623
|
}));
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2624
|
+
var visibilityOffIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
|
|
2625
|
+
style: {
|
|
2626
|
+
marginTop: 2
|
|
2627
|
+
}
|
|
2628
|
+
}, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2629
|
+
width: 24,
|
|
2630
|
+
height: 24,
|
|
2631
|
+
fill: "transparent"
|
|
2632
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2633
|
+
d: "M12 15.309c-.755 0-1.45-.088-2.092-.236l.798-.797c.41.124.844.192 1.294.192 2.453 0 4.442-1.988 4.442-4.44 0-.495-.085-.907-.234-1.255l.03-.03c1.72.906 2.781 2.167 3.218 2.766-.724.992-3.151 3.8-7.456 3.8zm-7.456-3.8c.442-.607 1.522-1.89 3.276-2.796-.166.36-.261.79-.261 1.315 0 1.228.499 2.34 1.305 3.144l-1.102 1.104c-1.72-.906-2.78-2.169-3.218-2.767zm5.646-3.524c.818 0 1.482.665 1.482 1.483 0 .818-.664 1.481-1.482 1.481s-1.482-.663-1.482-1.481c0-.818.664-1.483 1.482-1.483zm10.608 3.19c-.073-.125-1.245-2.026-3.603-3.388l2.009-2.01c.406-.406.406-1.065 0-1.473-.407-.405-1.066-.405-1.473 0l-2.58 2.582c-.93-.295-1.98-.478-3.151-.478-5.87 0-8.681 4.57-8.798 4.766L3 11.51l.202.335c.073.124 1.244 2.025 3.603 3.387l-2.009 2.01c-.406.406-.406 1.065 0 1.472.204.203.47.305.737.305.266 0 .532-.102.736-.305l2.58-2.58c.93.293 1.98.476 3.151.476 5.87 0 8.681-4.57 8.798-4.765l.202-.335-.202-.335z"
|
|
2634
|
+
}));
|
|
2635
|
+
return /*#__PURE__*/React__namespace.createElement(ManagerButton, {
|
|
2636
|
+
tooltipTitle: title,
|
|
2637
|
+
onClick: onClick,
|
|
2638
|
+
icon: /*#__PURE__*/React__namespace.createElement(material.Checkbox, {
|
|
2639
|
+
sx: {
|
|
2640
|
+
color: 'inherit',
|
|
2641
|
+
padding: 0.5,
|
|
2642
|
+
borderRadius: 1.25,
|
|
2643
|
+
'&.Mui-focusVisible': {
|
|
2644
|
+
backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
|
|
2645
|
+
},
|
|
2646
|
+
'&:hover': {
|
|
2647
|
+
backgroundColor: 'transparent!important'
|
|
2648
|
+
},
|
|
2649
|
+
'&.Mui-checked': {
|
|
2650
|
+
color: 'inherit'
|
|
2651
|
+
}
|
|
2652
|
+
},
|
|
2653
|
+
icon: visibilityOffIcon,
|
|
2654
|
+
checkedIcon: visibilityIcon,
|
|
2655
|
+
checked: isEnabled,
|
|
2656
|
+
disableFocusRipple: true,
|
|
2657
|
+
tabIndex: -1
|
|
2658
|
+
}),
|
|
2659
|
+
testId: "enableButton",
|
|
2660
|
+
isEnabled: isEnabled
|
|
2661
|
+
});
|
|
2312
2662
|
};
|
|
2313
2663
|
|
|
2314
2664
|
/* *
|
|
@@ -2351,12 +2701,17 @@
|
|
|
2351
2701
|
exports.ConfirmationDialog = ConfirmationDialog;
|
|
2352
2702
|
exports.ConfirmationServiceProvider = ConfirmationServiceProvider;
|
|
2353
2703
|
exports.CustomSlider = CustomSlider;
|
|
2704
|
+
exports.CustomToggleButton = CustomToggleButton;
|
|
2354
2705
|
exports.Draggable = DraggableComponent$1;
|
|
2355
|
-
exports.
|
|
2706
|
+
exports.EnableButton = EnableButton;
|
|
2356
2707
|
exports.ErrorBoundary = ErrorBoundary;
|
|
2357
2708
|
exports.HIDDEN_INPUT_HELPER_IS_DRAFT = HIDDEN_INPUT_HELPER_IS_DRAFT;
|
|
2709
|
+
exports.ManagerButton = ManagerButton;
|
|
2710
|
+
exports.ManagerDeleteButton = ManagerDeleteButton;
|
|
2358
2711
|
exports.Resizable = ResizeComponent;
|
|
2359
2712
|
exports.StatusTag = StatusTag;
|
|
2713
|
+
exports.ToggleMenu = ToggleMenu;
|
|
2714
|
+
exports.ToolButton = ToolButton;
|
|
2360
2715
|
exports.ToolContainer = ToolContainer;
|
|
2361
2716
|
exports.ToolContainerDraggable = DraggableComponent;
|
|
2362
2717
|
exports.ToolFooter = ToolFooter;
|
|
@@ -2364,8 +2719,7 @@
|
|
|
2364
2719
|
exports.UserMenu = UserMenu;
|
|
2365
2720
|
exports.UserMenuItemCheatSheet = UserMenuItemCheatSheet;
|
|
2366
2721
|
exports.UserMenuItemTheme = MenuItemTheme;
|
|
2367
|
-
exports.
|
|
2368
|
-
exports.Z_INDEX_TOP = Z_INDEX_TOP;
|
|
2722
|
+
exports.calculateDialogSizeAndPosition = calculateDialogSizeAndPosition;
|
|
2369
2723
|
exports.getAxiosErrorMessage = getAxiosErrorMessage;
|
|
2370
2724
|
exports.getInitials = getInitials;
|
|
2371
2725
|
exports.isAxiosError = isAxiosError;
|