@opengeoweb/shared 2.5.0 → 2.6.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.
Files changed (29) hide show
  1. package/index.esm.js +306 -70
  2. package/index.umd.js +332 -78
  3. package/lib/components/AlertBanner/AlertBanner.d.ts +1 -0
  4. package/lib/components/AlertIcon/AlertIcon.d.ts +8 -0
  5. package/lib/components/AlertIcon/index.d.ts +1 -0
  6. package/lib/components/{Manager/EnableButton → EnableButton}/EnableButton.d.ts +0 -0
  7. package/lib/components/{Manager/EnableButton → EnableButton}/EnableButton.spec.d.ts +0 -0
  8. package/lib/components/{Manager/EnableButton → EnableButton}/EnableButton.stories.d.ts +0 -0
  9. package/lib/components/{Manager/EnableButton → EnableButton}/index.d.ts +0 -0
  10. package/lib/components/{Manager/ManagerButton → ManagerButton}/ManagerButton.d.ts +5 -0
  11. package/lib/components/{Manager/ManagerButton → ManagerButton}/ManagerButton.spec.d.ts +0 -0
  12. package/lib/components/{Manager/ManagerButton → ManagerButton}/ManagerButton.stories.d.ts +0 -0
  13. package/lib/components/{Manager/ManagerButton → ManagerButton}/index.d.ts +0 -0
  14. package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/ManagerDeleteButton.d.ts +0 -0
  15. package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/ManagerDeleteButton.spec.d.ts +0 -0
  16. package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/ManagerDeleteButton.stories.d.ts +0 -0
  17. package/lib/components/{Manager/ManagerDeleteButton → ManagerDeleteButton}/index.d.ts +0 -0
  18. package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +1 -0
  19. package/lib/components/ToolContainer/types.d.ts +1 -0
  20. package/lib/components/TooltipSelect/TooltipSelect.d.ts +16 -0
  21. package/lib/components/TooltipSelect/TooltipSelect.spec.d.ts +1 -0
  22. package/lib/components/TooltipSelect/TooltipSelect.stories.d.ts +13 -0
  23. package/lib/components/TooltipSelect/index.d.ts +2 -0
  24. package/lib/components/TooltipSelect/tooltipContainerStyles.d.ts +2 -0
  25. package/lib/components/index.d.ts +5 -1
  26. package/lib/hooks/useDraftFormHelpers/useDraftFormHelpers.d.ts +1 -1
  27. package/package.json +3 -3
  28. package/lib/components/Manager/index.d.ts +0 -4
  29. package/lib/components/Manager/styles.d.ts +0 -5
package/index.umd.js CHANGED
@@ -402,12 +402,20 @@
402
402
  };
403
403
 
404
404
  var HIDDEN_INPUT_HELPER_IS_DRAFT = 'IS_DRAFT';
405
- var useDraftFormHelpers = function useDraftFormHelpers() {
405
+ var useDraftFormHelpers = function useDraftFormHelpers(isDefaultDraft) {
406
+ if (isDefaultDraft === void 0) {
407
+ isDefaultDraft = false;
408
+ }
409
+
406
410
  var _a = reactHookForm.useFormContext(),
407
411
  getValues = _a.getValues,
408
412
  setValue = _a.setValue,
409
413
  register = _a.register;
410
414
 
415
+ React__namespace.useEffect(function () {
416
+ setValue(HIDDEN_INPUT_HELPER_IS_DRAFT, isDefaultDraft); // eslint-disable-next-line react-hooks/exhaustive-deps
417
+ }, []);
418
+
411
419
  var isDraft = function isDraft() {
412
420
  return getValues(HIDDEN_INPUT_HELPER_IS_DRAFT) === true;
413
421
  };
@@ -425,9 +433,7 @@
425
433
  };
426
434
 
427
435
  var DraftFieldHelper = function DraftFieldHelper() {
428
- return /*#__PURE__*/React__namespace.createElement("input", __assign({
429
- defaultValue: "false"
430
- }, register(HIDDEN_INPUT_HELPER_IS_DRAFT), {
436
+ return /*#__PURE__*/React__namespace.createElement("input", __assign({}, register(HIDDEN_INPUT_HELPER_IS_DRAFT), {
431
437
  type: "hidden"
432
438
  }));
433
439
  };
@@ -534,24 +540,21 @@
534
540
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
535
541
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
536
542
  * */
537
- var useStyles$a = makeStyles__default["default"](function () {
538
- return {
539
- title: {
540
- fontSize: '14px',
541
- fontWeight: 'normal',
542
- marginTop: '0px!important',
543
- paddingTop: '0px!important'
544
- },
545
- info: {
546
- fontSize: '16px'
547
- }
548
- };
549
- });
550
543
 
551
- var getIcon = function getIcon(severity) {
544
+ var AlertIcon = function AlertIcon(_a) {
545
+ var _b = _a.severity,
546
+ severity = _b === void 0 ? 'error' : _b,
547
+ _c = _a.dataTestId,
548
+ dataTestId = _c === void 0 ? 'alert-icon' : _c;
549
+
552
550
  switch (severity) {
553
551
  case 'info':
554
- return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
552
+ return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
553
+ sx: {
554
+ color: 'geowebColors.functional.notification'
555
+ },
556
+ "data-testid": dataTestId
557
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
555
558
  width: 24,
556
559
  height: 24,
557
560
  fill: "transparent"
@@ -561,7 +564,12 @@
561
564
  }));
562
565
 
563
566
  case 'success':
564
- return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
567
+ return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
568
+ sx: {
569
+ color: 'geowebColors.functional.success'
570
+ },
571
+ "data-testid": dataTestId
572
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
565
573
  width: 24,
566
574
  height: 24,
567
575
  fill: "transparent"
@@ -571,7 +579,12 @@
571
579
  }));
572
580
 
573
581
  case 'warning':
574
- return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
582
+ return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
583
+ sx: {
584
+ color: 'geowebColors.functional.warning'
585
+ },
586
+ "data-testid": dataTestId
587
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
575
588
  width: 24,
576
589
  height: 24,
577
590
  fill: "transparent"
@@ -582,7 +595,12 @@
582
595
 
583
596
  case 'error':
584
597
  default:
585
- return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
598
+ return /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
599
+ sx: {
600
+ color: 'geowebColors.functional.error'
601
+ },
602
+ "data-testid": dataTestId
603
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
586
604
  width: 24,
587
605
  height: 24,
588
606
  fill: "transparent"
@@ -602,12 +620,29 @@
602
620
  _d = _a.dataTestId,
603
621
  dataTestId = _d === void 0 ? 'alert-banner' : _d,
604
622
  _e = _a.isCompact,
605
- isCompact = _e === void 0 ? false : _e;
606
- var classes = useStyles$a();
607
- return /*#__PURE__*/React__namespace.createElement(material.Alert, {
623
+ isCompact = _e === void 0 ? false : _e,
624
+ _f = _a.shouldClose,
625
+ shouldClose = _f === void 0 ? false : _f;
626
+
627
+ var _g = __read(React__namespace.useState(true), 2),
628
+ isOpen = _g[0],
629
+ setIsOpen = _g[1];
630
+
631
+ return isOpen && /*#__PURE__*/React__namespace.createElement(material.Alert, {
608
632
  "data-testid": dataTestId,
609
633
  severity: severity,
610
- icon: getIcon(severity),
634
+ icon: /*#__PURE__*/React__namespace.createElement(AlertIcon, {
635
+ severity: severity
636
+ }),
637
+ action: shouldClose ? /*#__PURE__*/React__namespace.createElement(material.Button, {
638
+ variant: "flat",
639
+ onClick: function onClick() {
640
+ return setIsOpen(false);
641
+ },
642
+ sx: {
643
+ backgroundColor: 'transparent!important'
644
+ }
645
+ }, "CLOSE") : undefined,
611
646
  sx: isCompact ? {
612
647
  height: '32px',
613
648
  boxSizing: 'border-box',
@@ -624,11 +659,31 @@
624
659
  margin: '-3px 10px 0px 0px',
625
660
  padding: '0px'
626
661
  }
627
- } : {}
662
+ } : {
663
+ padding: '3px 16px',
664
+ '& .MuiAlert-message': {
665
+ padding: '8px 0'
666
+ },
667
+ '& .MuiAlert-icon': {
668
+ padding: '8px 0'
669
+ },
670
+ '& .MuiAlert-action': {
671
+ padding: 0
672
+ }
673
+ }
628
674
  }, /*#__PURE__*/React__namespace.createElement(material.AlertTitle, {
629
- className: classes.title
630
- }, title), info && /*#__PURE__*/React__namespace.createElement("div", {
631
- className: classes.info
675
+ sx: {
676
+ fontSize: '14px',
677
+ fontWeight: 'normal',
678
+ marginTop: '0px!important',
679
+ paddingTop: '0px!important',
680
+ marginBottom: '0px!important'
681
+ }
682
+ }, title), info && /*#__PURE__*/React__namespace.createElement(material.Box, {
683
+ sx: {
684
+ fontSize: '16px',
685
+ marginTop: 1
686
+ }
632
687
  }, info));
633
688
  };
634
689
 
@@ -648,7 +703,7 @@
648
703
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
649
704
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
650
705
  * */
651
- var useStyles$9 = makeStyles__default["default"](function () {
706
+ var useStyles$8 = makeStyles__default["default"](function () {
652
707
  return {
653
708
  wrapper: {
654
709
  height: '100vh',
@@ -665,7 +720,7 @@
665
720
  var AppLayout = function AppLayout(_a) {
666
721
  var header = _a.header,
667
722
  children = _a.children;
668
- var classes = useStyles$9();
723
+ var classes = useStyles$8();
669
724
  return /*#__PURE__*/React__default["default"].createElement("div", {
670
725
  className: classes.wrapper
671
726
  }, header, /*#__PURE__*/React__default["default"].createElement("main", {
@@ -691,7 +746,7 @@
691
746
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
692
747
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
693
748
  * */
694
- var useStyles$8 = makeStyles__default["default"](function (theme) {
749
+ var useStyles$7 = makeStyles__default["default"](function (theme) {
695
750
  var _a;
696
751
 
697
752
  return {
@@ -728,7 +783,7 @@
728
783
  userMenu = _a.userMenu,
729
784
  _b = _a.title,
730
785
  title = _b === void 0 ? 'GeoWeb' : _b;
731
- var classes = useStyles$8();
786
+ var classes = useStyles$7();
732
787
  return /*#__PURE__*/React__default["default"].createElement("header", {
733
788
  className: classes.header
734
789
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
@@ -1002,7 +1057,7 @@
1002
1057
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1003
1058
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1004
1059
  * */
1005
- var useStyles$7 = makeStyles__default["default"](function (theme) {
1060
+ var useStyles$6 = makeStyles__default["default"](function (theme) {
1006
1061
  return {
1007
1062
  container: {
1008
1063
  position: 'absolute',
@@ -1050,7 +1105,7 @@
1050
1105
  } : _d,
1051
1106
  children = _a.children,
1052
1107
  initials = _a.initials;
1053
- var classes = useStyles$7();
1108
+ var classes = useStyles$6();
1054
1109
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1055
1110
  "data-testid": "userButton",
1056
1111
  onClick: onToggle,
@@ -1133,7 +1188,7 @@
1133
1188
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1134
1189
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1135
1190
  * */
1136
- var useStyles$6 = makeStyles__default["default"](function (theme) {
1191
+ var useStyles$5 = makeStyles__default["default"](function (theme) {
1137
1192
  return {
1138
1193
  footer: {
1139
1194
  boxShadow: theme.shadows[1],
@@ -1146,7 +1201,7 @@
1146
1201
  }); // drag handles will be handled by DraggableResizable/Resizable
1147
1202
 
1148
1203
  var ToolFooter = function ToolFooter() {
1149
- var classes = useStyles$6();
1204
+ var classes = useStyles$5();
1150
1205
  return /*#__PURE__*/React__default["default"].createElement("footer", {
1151
1206
  className: classes.footer
1152
1207
  });
@@ -1229,13 +1284,17 @@
1229
1284
  _c = _a.isDraggable,
1230
1285
  isDraggable = _c === void 0 ? false : _c,
1231
1286
  _d = _a.className,
1232
- className = _d === void 0 ? '' : _d;
1287
+ className = _d === void 0 ? '' : _d,
1288
+ _e = _a.leftComponent,
1289
+ leftComponent = _e === void 0 ? null : _e;
1233
1290
  var styles = getStyle(size);
1234
1291
 
1235
1292
  var onClickClose = function onClickClose() {
1236
1293
  return onClose();
1237
1294
  };
1238
1295
 
1296
+ var columnSizeIcon = leftComponent ? 3 : 1;
1297
+ var columnSizeTitle = leftComponent ? 6 : 10;
1239
1298
  return /*#__PURE__*/React__default["default"].createElement(material.Box, {
1240
1299
  component: "header",
1241
1300
  className: className,
@@ -1251,26 +1310,27 @@
1251
1310
  alignItems: "center"
1252
1311
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1253
1312
  item: true,
1254
- xs: 1
1255
- }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1313
+ xs: columnSizeIcon
1314
+ }, isDraggable && size !== 'xxs' && !leftComponent && /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1256
1315
  container: true,
1257
1316
  justifyContent: "flex-start"
1258
- }, isDraggable && size !== 'xxs' && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1317
+ }, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1259
1318
  "data-testid": "dragBtn",
1260
1319
  disableRipple: true,
1261
1320
  size: "large",
1262
1321
  sx: __assign(__assign({}, iconStyle), {
1263
1322
  pointerEvents: 'none'
1264
1323
  })
1265
- }, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null)))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1324
+ }, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null))), leftComponent && leftComponent), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1266
1325
  item: true,
1267
- xs: 10
1326
+ xs: columnSizeTitle
1268
1327
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1269
1328
  container: true,
1270
1329
  justifyContent: "center",
1271
1330
  alignItems: "center"
1272
1331
  }, title && /*#__PURE__*/React__default["default"].createElement(material.Typography, {
1273
1332
  variant: "h2",
1333
+ noWrap: true,
1274
1334
  sx: {
1275
1335
  fontSize: styles.fontSize,
1276
1336
  fontWeight: styles.fontWeight
@@ -1286,7 +1346,7 @@
1286
1346
  })
1287
1347
  }, /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null)))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1288
1348
  item: true,
1289
- xs: 1,
1349
+ xs: columnSizeIcon,
1290
1350
  container: true,
1291
1351
  justifyContent: "flex-end"
1292
1352
  }, onClose && /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
@@ -1313,22 +1373,20 @@
1313
1373
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1314
1374
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1315
1375
  * */
1316
- var useStyles$5 = makeStyles__default["default"](function () {
1317
- return {
1318
- container: {
1319
- overflow: 'hidden',
1320
- borderRadius: 0,
1321
- display: 'flex',
1322
- flexDirection: 'column',
1323
- height: '100%'
1324
- },
1325
- content: {
1326
- flex: 1,
1327
- overflowY: 'auto',
1328
- position: 'relative'
1329
- }
1330
- };
1331
- });
1376
+ var styles$1 = {
1377
+ container: {
1378
+ overflow: 'hidden',
1379
+ borderRadius: 0,
1380
+ display: 'flex',
1381
+ flexDirection: 'column',
1382
+ height: '100%'
1383
+ },
1384
+ content: {
1385
+ flex: 1,
1386
+ overflowY: 'auto',
1387
+ position: 'relative'
1388
+ }
1389
+ };
1332
1390
  var BASE_ELEVATION = 5;
1333
1391
 
1334
1392
  var ToolContainer = function ToolContainer(_a) {
@@ -1350,20 +1408,22 @@
1350
1408
  _h = _a.headerClassName,
1351
1409
  // elevation_06
1352
1410
  headerClassName = _h === void 0 ? '' : _h,
1353
- props = __rest(_a, ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName"]);
1411
+ _j = _a.leftComponent,
1412
+ leftComponent = _j === void 0 ? null : _j,
1413
+ props = __rest(_a, ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName", "leftComponent"]);
1354
1414
 
1355
- var classes = useStyles$5();
1356
1415
  return /*#__PURE__*/React__default["default"].createElement(material.Paper, __assign({
1357
1416
  elevation: elevation,
1358
- className: classes.container
1417
+ sx: styles$1.container
1359
1418
  }, props), /*#__PURE__*/React__default["default"].createElement(ToolHeader, {
1360
1419
  title: title,
1361
1420
  size: size,
1362
1421
  isDraggable: isDraggable,
1363
1422
  onClose: onClose,
1364
- className: headerClassName
1365
- }), /*#__PURE__*/React__default["default"].createElement("div", {
1366
- className: classes.content,
1423
+ className: headerClassName,
1424
+ leftComponent: leftComponent
1425
+ }), /*#__PURE__*/React__default["default"].createElement(material.Box, {
1426
+ sx: styles$1.content,
1367
1427
  style: {
1368
1428
  maxHeight: maxHeight
1369
1429
  }
@@ -1439,30 +1499,32 @@
1439
1499
  order = _l === void 0 ? 1 : _l,
1440
1500
  _m = _a.source,
1441
1501
  source = _m === void 0 ? 'app' : _m,
1442
- props = __rest(_a, ["title", "bounds", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "order", "source"]);
1502
+ _o = _a.leftComponent,
1503
+ leftComponent = _o === void 0 ? null : _o,
1504
+ props = __rest(_a, ["title", "bounds", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "order", "source", "leftComponent"]);
1443
1505
 
1444
1506
  var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
1445
1507
  var elevation = BASE_ELEVATION + order;
1446
1508
  var nodeRef = React__default["default"].useRef(null);
1447
1509
 
1448
- var _o = __read(React__default["default"].useState({
1510
+ var _p = __read(React__default["default"].useState({
1449
1511
  x: 0,
1450
1512
  y: 0
1451
1513
  }), 2),
1452
- position = _o[0],
1453
- setPosition = _o[1];
1514
+ position = _p[0],
1515
+ setPosition = _p[1];
1454
1516
 
1455
- var _p = __read(React__default["default"].useState(startSize), 2),
1456
- size = _p[0],
1457
- setSize = _p[1];
1517
+ var _q = __read(React__default["default"].useState(startSize), 2),
1518
+ size = _q[0],
1519
+ setSize = _q[1];
1458
1520
 
1459
1521
  var onStopDrag = React__default["default"].useCallback(function (_event, position) {
1460
1522
  setPosition(position);
1461
1523
  }, [setPosition]);
1462
1524
 
1463
- var _q = __read(React__default["default"].useState(defaultInitialMaxHeight), 2),
1464
- initialMaxHeight = _q[0],
1465
- setInitialMaxHeight = _q[1];
1525
+ var _r = __read(React__default["default"].useState(defaultInitialMaxHeight), 2),
1526
+ initialMaxHeight = _r[0],
1527
+ setInitialMaxHeight = _r[1];
1466
1528
 
1467
1529
  var onStartResize = function onStartResize() {
1468
1530
  setInitialMaxHeight('initial');
@@ -1548,7 +1610,8 @@
1548
1610
  isDraggable: true,
1549
1611
  isResizable: true,
1550
1612
  elevation: elevation,
1551
- headerClassName: headerClassName
1613
+ headerClassName: headerClassName,
1614
+ leftComponent: leftComponent
1552
1615
  }, children)))) : null;
1553
1616
  };
1554
1617
 
@@ -2663,6 +2726,194 @@
2663
2726
  });
2664
2727
  };
2665
2728
 
2729
+ /* *
2730
+ * Licensed under the Apache License, Version 2.0 (the "License");
2731
+ * you may not use this file except in compliance with the License.
2732
+ * You may obtain a copy of the License at
2733
+ *
2734
+ * http://www.apache.org/licenses/LICENSE-2.0
2735
+ *
2736
+ * Unless required by applicable law or agreed to in writing, software
2737
+ * distributed under the License is distributed on an "AS IS" BASIS,
2738
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2739
+ * See the License for the specific language governing permissions and
2740
+ * limitations under the License.
2741
+ *
2742
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2743
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2744
+ * */
2745
+ var tooltipContainerStyles = function tooltipContainerStyles(isEnabled) {
2746
+ return {
2747
+ width: '100%',
2748
+ height: 32,
2749
+ fontWeight: 500,
2750
+ fontSize: function fontSize(theme) {
2751
+ return theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize;
2752
+ },
2753
+ color: isEnabled ? 'geowebColors.layerManager.tableRowDefaultText.rgba' : 'geowebColors.layerManager.tableRowDisabledText.rgba',
2754
+ '& .MuiOutlinedInput-input': {
2755
+ padding: '6px 24px 6px 8px'
2756
+ },
2757
+ '& .MuiOutlinedInput-notchedOutline': {
2758
+ borderColor: 'transparent!important'
2759
+ },
2760
+ '&:hover .MuiSelect-select': {
2761
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
2762
+ },
2763
+ '&.Mui-focused .MuiSelect-select': {
2764
+ outline: function outline(theme) {
2765
+ return theme.palette.geowebColors.buttons.focusDefault.outline;
2766
+ },
2767
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
2768
+ },
2769
+ '&:hover&.MuiButton-root': {
2770
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
2771
+ },
2772
+ '&:focus&.MuiButton-root': {
2773
+ outline: function outline(theme) {
2774
+ return theme.palette.geowebColors.buttons.focusDefault.outline;
2775
+ },
2776
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
2777
+ },
2778
+ '& .MuiSvgIcon-root': {
2779
+ transition: 'none',
2780
+ fill: function fill(theme) {
2781
+ return isEnabled ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color;
2782
+ }
2783
+ },
2784
+ '&>div': {
2785
+ paddingLeft: 1
2786
+ }
2787
+ };
2788
+ };
2789
+
2790
+ /* *
2791
+ * Licensed under the Apache License, Version 2.0 (the "License");
2792
+ * you may not use this file except in compliance with the License.
2793
+ * You may obtain a copy of the License at
2794
+ *
2795
+ * http://www.apache.org/licenses/LICENSE-2.0
2796
+ *
2797
+ * Unless required by applicable law or agreed to in writing, software
2798
+ * distributed under the License is distributed on an "AS IS" BASIS,
2799
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2800
+ * See the License for the specific language governing permissions and
2801
+ * limitations under the License.
2802
+ *
2803
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2804
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
2805
+ * */
2806
+ var TooltipSelect = function TooltipSelect(_a) {
2807
+ var tooltip = _a.tooltip,
2808
+ _b = _a.list,
2809
+ list = _b === void 0 ? [] : _b,
2810
+ _c = _a.currentIndex,
2811
+ currentIndex = _c === void 0 ? -1 : _c,
2812
+ _d = _a.onChangeMouseWheel,
2813
+ onChangeMouseWheel = _d === void 0 ? function () {} : _d,
2814
+ _e = _a.requiresCtrlToChange,
2815
+ requiresCtrlToChange = _e === void 0 ? false : _e,
2816
+ isEnabled = _a.isEnabled,
2817
+ noStyling = _a.noStyling,
2818
+ props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange", "isEnabled", "noStyling"]);
2819
+
2820
+ props.disableUnderline;
2821
+ var otherProps = __rest(props, ["disableUnderline"]);
2822
+
2823
+ var _f = __read(React__namespace.useState(false), 2),
2824
+ selectOpen = _f[0],
2825
+ setSelectOpen = _f[1];
2826
+
2827
+ var _g = __read(React__namespace.useState(false), 2),
2828
+ tooltipOpen = _g[0],
2829
+ setTooltipOpen = _g[1];
2830
+
2831
+ var onWheel = React__namespace.useCallback(function (event) {
2832
+ if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
2833
+ if (selectOpen) return;
2834
+ var direction = event.deltaY < 0 ? 1 : -1;
2835
+ var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
2836
+ onChangeMouseWheel(newValue);
2837
+ }
2838
+ }, [selectOpen, currentIndex, list, onChangeMouseWheel, requiresCtrlToChange]);
2839
+ var onOpen = React__namespace.useCallback(function () {
2840
+ setSelectOpen(true);
2841
+ setTooltipOpen(false);
2842
+ }, []);
2843
+ var onClose = React__namespace.useCallback(function () {
2844
+ setSelectOpen(false);
2845
+ }, []);
2846
+ var onMouseEnter = React__namespace.useCallback(function () {
2847
+ if (!selectOpen) setTooltipOpen(true);
2848
+ }, [selectOpen]);
2849
+ var onMouseLeave = React__namespace.useCallback(function () {
2850
+ setTooltipOpen(false);
2851
+ }, []);
2852
+ var onFocus = React__namespace.useCallback(function () {
2853
+ setTooltipOpen(true);
2854
+ }, []);
2855
+ var onBlur = React__namespace.useCallback(function () {
2856
+ setTooltipOpen(false);
2857
+ }, []);
2858
+ return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
2859
+ title: tooltip,
2860
+ placement: "top",
2861
+ open: tooltipOpen,
2862
+ sx: noStyling ? undefined : tooltipContainerStyles(isEnabled)
2863
+ }, /*#__PURE__*/React__namespace.createElement(material.Select, __assign({
2864
+ onOpen: onOpen,
2865
+ onClose: onClose,
2866
+ onMouseEnter: onMouseEnter,
2867
+ onMouseLeave: onMouseLeave,
2868
+ onFocus: onFocus,
2869
+ onBlur: onBlur,
2870
+ onWheel: onWheel,
2871
+ MenuProps: {
2872
+ BackdropProps: {
2873
+ sx: {
2874
+ '&.MuiBackdrop-root': {
2875
+ backgroundColor: 'transparent'
2876
+ }
2877
+ }
2878
+ },
2879
+ sx: {
2880
+ '& ul': {
2881
+ backgroundColor: 'geowebColors.background.surface'
2882
+ },
2883
+ '& li': {
2884
+ fontSize: '16px',
2885
+ padding: '12px',
2886
+ '&:hover': {
2887
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
2888
+ },
2889
+ '&.Mui-selected': {
2890
+ color: 'geowebColors.buttons.tool.active.color',
2891
+ backgroundColor: 'geowebColors.buttons.tool.active.fill',
2892
+ boxShadow: "none",
2893
+ '&:hover': {
2894
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
2895
+ },
2896
+ '&:focus': {
2897
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
2898
+ }
2899
+ },
2900
+ '&:after': {
2901
+ background: 'none!important'
2902
+ },
2903
+ '&.Mui-disabled': {
2904
+ fontSize: '12px',
2905
+ opacity: 0.67,
2906
+ padding: '0px 12px',
2907
+ '&.MuiMenuItem-root': {
2908
+ minHeight: '30px!important'
2909
+ }
2910
+ }
2911
+ }
2912
+ }
2913
+ }
2914
+ }, otherProps)));
2915
+ };
2916
+
2666
2917
  /* *
2667
2918
  * Licensed under the Apache License, Version 2.0 (the "License");
2668
2919
  * you may not use this file except in compliance with the License.
@@ -2698,6 +2949,7 @@
2698
2949
  };
2699
2950
 
2700
2951
  exports.AlertBanner = AlertBanner;
2952
+ exports.AlertIcon = AlertIcon;
2701
2953
  exports.AppHeader = AppHeader;
2702
2954
  exports.AppLayout = AppLayout;
2703
2955
  exports.ConfirmationDialog = ConfirmationDialog;
@@ -2718,6 +2970,7 @@
2718
2970
  exports.ToolContainerDraggable = DraggableComponent;
2719
2971
  exports.ToolFooter = ToolFooter;
2720
2972
  exports.ToolHeader = ToolHeader;
2973
+ exports.TooltipSelect = TooltipSelect;
2721
2974
  exports.UserMenu = UserMenu;
2722
2975
  exports.UserMenuItemCheatSheet = UserMenuItemCheatSheet;
2723
2976
  exports.UserMenuItemTheme = MenuItemTheme;
@@ -2727,6 +2980,7 @@
2727
2980
  exports.isAxiosError = isAxiosError;
2728
2981
  exports.showPrompt = showPrompt;
2729
2982
  exports.sliderStyles = sliderStyles;
2983
+ exports.tooltipContainerStyles = tooltipContainerStyles;
2730
2984
  exports.useConfirmationDialog = useConfirmationDialog;
2731
2985
  exports.useDialogActions = useDialogActions;
2732
2986
  exports.useDraftFormHelpers = useDraftFormHelpers;
@@ -6,6 +6,7 @@ interface AlertBannerProps {
6
6
  info?: string | React.ReactElement;
7
7
  dataTestId?: string;
8
8
  isCompact?: boolean;
9
+ shouldClose?: boolean;
9
10
  }
10
11
  declare const AlertBanner: React.FC<AlertBannerProps>;
11
12
  export default AlertBanner;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { AlertColor } from '@mui/material';
3
+ interface AlertIconProps {
4
+ severity?: AlertColor;
5
+ dataTestId?: string;
6
+ }
7
+ declare const AlertIcon: React.FC<AlertIconProps>;
8
+ export default AlertIcon;
@@ -0,0 +1 @@
1
+ export { default as AlertIcon } from './AlertIcon';