@opengeoweb/shared 8.0.0 → 8.2.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 (149) hide show
  1. package/README.md +0 -0
  2. package/index.esm.d.ts +0 -0
  3. package/index.esm.js +70 -22
  4. package/package.json +2 -2
  5. package/src/index.d.ts +0 -0
  6. package/src/lib/components/AlertBanner/AlertBanner.d.ts +0 -0
  7. package/src/lib/components/AlertBanner/AlertBanner.spec.d.ts +0 -0
  8. package/src/lib/components/AlertBanner/AlertBanner.stories.d.ts +0 -0
  9. package/src/lib/components/AlertBanner/index.d.ts +0 -0
  10. package/src/lib/components/AlertIcon/AlertIcon.d.ts +0 -0
  11. package/src/lib/components/AlertIcon/index.d.ts +0 -0
  12. package/src/lib/components/AppHeader/AppHeader.d.ts +0 -0
  13. package/src/lib/components/AppHeader/AppHeader.spec.d.ts +0 -0
  14. package/src/lib/components/AppHeader/AppHeader.stories.d.ts +0 -0
  15. package/src/lib/components/AppHeader/index.d.ts +0 -0
  16. package/src/lib/components/AppLayout/AppLayout.d.ts +0 -0
  17. package/src/lib/components/AppLayout/AppLayout.spec.d.ts +0 -0
  18. package/src/lib/components/AppLayout/AppLayout.stories.d.ts +0 -0
  19. package/src/lib/components/AppLayout/index.d.ts +0 -0
  20. package/src/lib/components/Avatar/Avatar.d.ts +0 -0
  21. package/src/lib/components/Avatar/Avatar.stories.d.ts +0 -0
  22. package/src/lib/components/Avatar/index.d.ts +0 -0
  23. package/src/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +0 -0
  24. package/src/lib/components/ConfirmationDialog/ConfirmationDialog.spec.d.ts +0 -0
  25. package/src/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +0 -0
  26. package/src/lib/components/ConfirmationDialog/ConfirmationService.d.ts +0 -0
  27. package/src/lib/components/ConfirmationDialog/ConfirmationService.spec.d.ts +0 -0
  28. package/src/lib/components/ConfirmationDialog/index.d.ts +0 -0
  29. package/src/lib/components/CustomAccordion/CustomAccordion.d.ts +0 -0
  30. package/src/lib/components/CustomAccordion/CustomAccordion.spec.d.ts +0 -0
  31. package/src/lib/components/CustomAccordion/CustomAccordion.stories.d.ts +0 -0
  32. package/src/lib/components/CustomAccordion/index.d.ts +0 -0
  33. package/src/lib/components/CustomDialog/CustomDialog.d.ts +0 -0
  34. package/src/lib/components/CustomDialog/CustomDialog.spec.d.ts +0 -0
  35. package/src/lib/components/CustomDialog/CustomDialog.stories.d.ts +0 -0
  36. package/src/lib/components/CustomDialog/index.d.ts +0 -0
  37. package/src/lib/components/CustomIconButton/CustomIconButton.d.ts +0 -0
  38. package/src/lib/components/CustomIconButton/CustomIconButton.spec.d.ts +0 -0
  39. package/src/lib/components/CustomIconButton/CustomIconButton.stories.d.ts +0 -0
  40. package/src/lib/components/CustomIconButton/index.d.ts +0 -0
  41. package/src/lib/components/CustomSlider/CustomSlider.d.ts +1 -1
  42. package/src/lib/components/CustomSlider/CustomSlider.spec.d.ts +0 -0
  43. package/src/lib/components/CustomSlider/CustomSlider.stories.d.ts +0 -0
  44. package/src/lib/components/CustomSlider/index.d.ts +0 -0
  45. package/src/lib/components/CustomToggleButton/CustomToggleButton.d.ts +0 -0
  46. package/src/lib/components/CustomToggleButton/CustomToggleButton.spec.d.ts +0 -0
  47. package/src/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +0 -0
  48. package/src/lib/components/CustomToggleButton/index.d.ts +0 -0
  49. package/src/lib/components/CustomTooltip/CustomTooltip.d.ts +0 -0
  50. package/src/lib/components/CustomTooltip/CustomTooltip.spec.d.ts +0 -0
  51. package/src/lib/components/CustomTooltip/index.d.ts +0 -0
  52. package/src/lib/components/DraggableResizable/Draggable.d.ts +2 -1
  53. package/src/lib/components/DraggableResizable/Draggable.spec.d.ts +0 -0
  54. package/src/lib/components/DraggableResizable/Resizable.d.ts +0 -0
  55. package/src/lib/components/DraggableResizable/Resizable.spec.d.ts +0 -0
  56. package/src/lib/components/DraggableResizable/index.d.ts +0 -0
  57. package/src/lib/components/DraggableResizable/types.d.ts +4 -0
  58. package/src/lib/components/ErrorBoundary/ErrorBoundary.d.ts +0 -0
  59. package/src/lib/components/ErrorBoundary/ErrorBoundary.spec.d.ts +0 -0
  60. package/src/lib/components/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -0
  61. package/src/lib/components/ErrorBoundary/index.d.ts +0 -0
  62. package/src/lib/components/Providers/Providers.d.ts +0 -0
  63. package/src/lib/components/Providers/index.d.ts +0 -0
  64. package/src/lib/components/SearchHighlight/SearchHighlight.d.ts +0 -0
  65. package/src/lib/components/SearchHighlight/SearchHighlight.spec.d.ts +0 -0
  66. package/src/lib/components/SearchHighlight/SearchHighlight.stories.d.ts +0 -0
  67. package/src/lib/components/SearchHighlight/index.d.ts +0 -0
  68. package/src/lib/components/StatusTag/StatusTag.d.ts +0 -0
  69. package/src/lib/components/StatusTag/StatusTag.spec.d.ts +0 -0
  70. package/src/lib/components/StatusTag/StatusTag.stories.d.ts +0 -0
  71. package/src/lib/components/StatusTag/index.d.ts +0 -0
  72. package/src/lib/components/SwitchButton/SwitchButton.d.ts +4 -0
  73. package/src/lib/components/SwitchButton/SwitchButton.spec.d.ts +1 -0
  74. package/src/lib/components/SwitchButton/index.d.ts +1 -0
  75. package/src/lib/components/ToggleMenu/ToggleMenu.d.ts +1 -0
  76. package/src/lib/components/ToggleMenu/ToggleMenu.spec.d.ts +0 -0
  77. package/src/lib/components/ToggleMenu/ToggleMenu.stories.d.ts +0 -0
  78. package/src/lib/components/ToggleMenu/index.d.ts +0 -0
  79. package/src/lib/components/ToolContainer/ToolContainer.d.ts +0 -0
  80. package/src/lib/components/ToolContainer/ToolContainer.spec.d.ts +0 -0
  81. package/src/lib/components/ToolContainer/ToolContainer.stories.d.ts +0 -0
  82. package/src/lib/components/ToolContainer/ToolContainerDraggable.d.ts +2 -1
  83. package/src/lib/components/ToolContainer/ToolContainerDraggable.spec.d.ts +0 -0
  84. package/src/lib/components/ToolContainer/ToolContainerDraggable.stories.d.ts +0 -0
  85. package/src/lib/components/ToolContainer/ToolContainerSnapShots.stories.d.ts +0 -0
  86. package/src/lib/components/ToolContainer/ToolFooter.d.ts +0 -0
  87. package/src/lib/components/ToolContainer/ToolFooter.spec.d.ts +0 -0
  88. package/src/lib/components/ToolContainer/ToolHeader.d.ts +0 -0
  89. package/src/lib/components/ToolContainer/ToolHeader.spec.d.ts +0 -0
  90. package/src/lib/components/ToolContainer/ToolHeader.stories.d.ts +0 -0
  91. package/src/lib/components/ToolContainer/index.d.ts +1 -1
  92. package/src/lib/components/ToolContainer/types.d.ts +0 -0
  93. package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.d.ts +0 -0
  94. package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.spec.d.ts +0 -0
  95. package/src/lib/components/TooltipSelect/TooltipSelect.d.ts +0 -0
  96. package/src/lib/components/TooltipSelect/TooltipSelect.spec.d.ts +0 -0
  97. package/src/lib/components/TooltipSelect/TooltipSelect.stories.d.ts +0 -0
  98. package/src/lib/components/TooltipSelect/index.d.ts +0 -0
  99. package/src/lib/components/TooltipSelect/tooltipContainerStyles.d.ts +0 -0
  100. package/src/lib/components/UserMenu/CheatSheet/CheatSheet.d.ts +0 -0
  101. package/src/lib/components/UserMenu/CheatSheet/CheatSheet.spec.d.ts +0 -0
  102. package/src/lib/components/UserMenu/CheatSheet/CheatSheet.stories.d.ts +0 -0
  103. package/src/lib/components/UserMenu/CheatSheet/ShortcutList.d.ts +0 -0
  104. package/src/lib/components/UserMenu/CheatSheet/ShortcutList.spec.d.ts +0 -0
  105. package/src/lib/components/UserMenu/CheatSheet/ShortcutSegment.d.ts +0 -0
  106. package/src/lib/components/UserMenu/CheatSheet/ShortcutSegment.spec.d.ts +0 -0
  107. package/src/lib/components/UserMenu/UserMenu.d.ts +0 -0
  108. package/src/lib/components/UserMenu/UserMenu.spec.d.ts +0 -0
  109. package/src/lib/components/UserMenu/UserMenu.stories.d.ts +0 -0
  110. package/src/lib/components/UserMenu/UserMenuItemCheatSheet.d.ts +0 -0
  111. package/src/lib/components/UserMenu/UserMenuItemCheatSheet.spec.d.ts +0 -0
  112. package/src/lib/components/UserMenu/UserMenuItemTheme.d.ts +0 -0
  113. package/src/lib/components/UserMenu/UserMenuItemTheme.spec.d.ts +0 -0
  114. package/src/lib/components/UserMenu/index.d.ts +0 -0
  115. package/src/lib/components/UserMenu/useUserMenu.d.ts +0 -0
  116. package/src/lib/components/UserMenu/useUserMenu.spec.d.ts +0 -0
  117. package/src/lib/components/UserMenu/utils.d.ts +0 -0
  118. package/src/lib/components/WithEggs/WithEggs.d.ts +0 -0
  119. package/src/lib/components/WithEggs/WithEggs.spec.d.ts +0 -0
  120. package/src/lib/components/WithEggs/index.d.ts +0 -0
  121. package/src/lib/components/components.stories.d.ts +0 -0
  122. package/src/lib/components/index.d.ts +1 -0
  123. package/src/lib/hooks/index.d.ts +0 -0
  124. package/src/lib/hooks/useIsMounted/useIsMounted.d.ts +0 -0
  125. package/src/lib/hooks/useIsMounted/useIsMounted.spec.d.ts +0 -0
  126. package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +0 -0
  127. package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.spec.d.ts +0 -0
  128. package/src/lib/hooks/usePoller/usePoller.d.ts +0 -0
  129. package/src/lib/hooks/usePoller/usePoller.spec.d.ts +0 -0
  130. package/src/lib/hooks/usePoller/usePoller.stories.d.ts +0 -0
  131. package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.d.ts +0 -0
  132. package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.spec.d.ts +0 -0
  133. package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.stories.d.ts +0 -0
  134. package/src/lib/hooks/usePrevious/usePrevious.d.ts +0 -0
  135. package/src/lib/hooks/usePrevious/usePrevious.spec.d.ts +0 -0
  136. package/src/lib/hooks/usePrevious/usePrevious.stories.d.ts +0 -0
  137. package/src/lib/storyshots/Storyshots.spec.d.ts +0 -0
  138. package/src/lib/types/index.d.ts +0 -0
  139. package/src/lib/types/types.d.ts +0 -0
  140. package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.d.ts +0 -0
  141. package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.spec.d.ts +0 -0
  142. package/src/lib/utils/axiosErrorUtils/index.d.ts +0 -0
  143. package/src/lib/utils/dateUtils/dateUtils.d.ts +0 -0
  144. package/src/lib/utils/dateUtils/dateUtils.spec.d.ts +0 -0
  145. package/src/lib/utils/dateUtils/index.d.ts +0 -0
  146. package/src/lib/utils/index.d.ts +0 -0
  147. package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.d.ts +0 -0
  148. package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.spec.d.ts +0 -0
  149. package/src/lib/utils/reduxTestUtils/index.d.ts +0 -0
package/README.md CHANGED
File without changes
package/index.esm.d.ts CHANGED
File without changes
package/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { useRef, useContext } from 'react';
3
- import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, 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';
3
+ import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, 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, FormLabel, Switch } from '@mui/material';
4
4
  import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown } from '@opengeoweb/theme';
5
5
  import require$$2, { flushSync } from 'react-dom';
6
6
  import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, set as set$1 } from 'date-fns';
@@ -21272,7 +21272,7 @@ var edgeBase = {
21272
21272
  height: '20px',
21273
21273
  position: 'absolute',
21274
21274
  };
21275
- var styles$5 = {
21275
+ var styles$6 = {
21276
21276
  top: __assign$1(__assign$1({}, rowSizeBase), { top: '-5px' }),
21277
21277
  right: __assign$1(__assign$1({}, colSizeBase), { left: undefined, right: '-5px' }),
21278
21278
  bottom: __assign$1(__assign$1({}, rowSizeBase), { top: undefined, bottom: '-5px' }),
@@ -21295,7 +21295,7 @@ var Resizer = /** @class */ (function (_super) {
21295
21295
  return _this;
21296
21296
  }
21297
21297
  Resizer.prototype.render = function () {
21298
- return (React$1.createElement("div", { className: this.props.className || '', style: __assign$1(__assign$1({ position: 'absolute', userSelect: 'none' }, styles$5[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
21298
+ return (React$1.createElement("div", { className: this.props.className || '', style: __assign$1(__assign$1({ position: 'absolute', userSelect: 'none' }, styles$6[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
21299
21299
  };
21300
21300
  return Resizer;
21301
21301
  }(React$1.PureComponent));
@@ -22244,7 +22244,7 @@ ErrorBoundary.defaultProps = {
22244
22244
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22245
22245
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
22246
22246
  * */
22247
- var styles$4 = {
22247
+ var styles$5 = {
22248
22248
  small: {
22249
22249
  height: 16,
22250
22250
  width: 16,
@@ -22258,7 +22258,7 @@ var Avatar = function Avatar(_ref) {
22258
22258
  size = _ref$size === void 0 ? 'large' : _ref$size;
22259
22259
  return /*#__PURE__*/React$1.createElement(Avatar$1, {
22260
22260
  "data-testid": "avatar",
22261
- sx: Object.assign({}, styles$4[size])
22261
+ sx: Object.assign({}, styles$5[size])
22262
22262
  }, children);
22263
22263
  };
22264
22264
 
@@ -22278,7 +22278,7 @@ var Avatar = function Avatar(_ref) {
22278
22278
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22279
22279
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
22280
22280
  * */
22281
- var styles$3 = {
22281
+ var styles$4 = {
22282
22282
  container: {
22283
22283
  position: 'absolute',
22284
22284
  top: 38,
@@ -22321,13 +22321,13 @@ var UserMenu = function UserMenu(_ref) {
22321
22321
  },
22322
22322
  size: "medium"
22323
22323
  }, /*#__PURE__*/React__default.createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default.createElement(Paper, {
22324
- sx: styles$3.container,
22324
+ sx: styles$4.container,
22325
22325
  "data-testid": "userMenu"
22326
22326
  }, /*#__PURE__*/React__default.createElement(ClickAwayListener, {
22327
22327
  onClickAway: onClose,
22328
22328
  mouseEvent: "onMouseDown"
22329
22329
  }, /*#__PURE__*/React__default.createElement(MenuList, {
22330
- sx: styles$3.userMenu,
22330
+ sx: styles$4.userMenu,
22331
22331
  variant: "menu"
22332
22332
  }, children))));
22333
22333
  };
@@ -22588,7 +22588,7 @@ var ToolHeader = function ToolHeader(_ref) {
22588
22588
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22589
22589
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
22590
22590
  * */
22591
- var styles$2 = {
22591
+ var styles$3 = {
22592
22592
  container: {
22593
22593
  overflow: 'hidden',
22594
22594
  borderRadius: 0,
@@ -22629,7 +22629,7 @@ var ToolContainer = function ToolContainer(_a) {
22629
22629
  props = __rest(_a, ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon"]);
22630
22630
  return /*#__PURE__*/React__default.createElement(Paper, Object.assign({
22631
22631
  elevation: elevation,
22632
- sx: styles$2.container
22632
+ sx: styles$3.container
22633
22633
  }, props), /*#__PURE__*/React__default.createElement(ErrorBoundary, null, /*#__PURE__*/React__default.createElement(ToolHeader, {
22634
22634
  title: title,
22635
22635
  size: size,
@@ -22641,7 +22641,7 @@ var ToolContainer = function ToolContainer(_a) {
22641
22641
  dragHandleIcon: dragHandleIcon,
22642
22642
  closeIcon: closeIcon
22643
22643
  })), /*#__PURE__*/React__default.createElement(Box, {
22644
- sx: styles$2.content,
22644
+ sx: styles$3.content,
22645
22645
  style: {
22646
22646
  maxHeight: maxHeight
22647
22647
  }
@@ -22794,6 +22794,15 @@ var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
22794
22794
  left: left
22795
22795
  };
22796
22796
  };
22797
+ var calculateStartSize = function calculateStartSize(minSize, prefSize, startPosition) {
22798
+ var _calculateDialogSizeA = calculateDialogSizeAndPosition(),
22799
+ calcWidth = _calculateDialogSizeA.width,
22800
+ calcHeight = _calculateDialogSizeA.height;
22801
+ return {
22802
+ width: Math.max(minSize.width, Math.min(prefSize.width, calcWidth)),
22803
+ height: Math.max(minSize.height, Math.min(prefSize.height, calcHeight - startPosition.top))
22804
+ };
22805
+ };
22797
22806
  var BASE_Z_INDEX = 100;
22798
22807
  var calculateNewPosition = function calculateNewPosition(position, isRightAligned, handle, delta) {
22799
22808
  var x = position.x,
@@ -22997,7 +23006,7 @@ var segmentStyle = {
22997
23006
  letterSpacing: 0.25,
22998
23007
  justifyContent: 'center'
22999
23008
  };
23000
- var styles$1 = {
23009
+ var styles$2 = {
23001
23010
  icon: Object.assign(Object.assign({}, segmentStyle), {
23002
23011
  backgroundColor: 'geowebColors.textInputField.default.rgba',
23003
23012
  width: 40,
@@ -23020,21 +23029,21 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
23020
23029
  children = _ref.children;
23021
23030
  if (type === 'divider') {
23022
23031
  return /*#__PURE__*/React__default.createElement(Typography, {
23023
- sx: styles$1.divider,
23032
+ sx: styles$2.divider,
23024
23033
  "data-testid": "segment-divider",
23025
23034
  component: "span"
23026
23035
  }, children);
23027
23036
  }
23028
23037
  if (type === 'icon') {
23029
23038
  return /*#__PURE__*/React__default.createElement(Typography, {
23030
- sx: styles$1.icon,
23039
+ sx: styles$2.icon,
23031
23040
  "data-testid": "segment-icon",
23032
23041
  component: "span"
23033
23042
  }, children);
23034
23043
  }
23035
23044
  if (type === 'connect') {
23036
23045
  return /*#__PURE__*/React__default.createElement(Typography, {
23037
- sx: styles$1.connect,
23046
+ sx: styles$2.connect,
23038
23047
  "data-testid": "segment-connect",
23039
23048
  component: "span"
23040
23049
  }, children);
@@ -23291,7 +23300,7 @@ var TabPanel = function TabPanel(_ref) {
23291
23300
  "aria-labelledby": "tab-".concat(index)
23292
23301
  }, value === index && children);
23293
23302
  };
23294
- var styles = {
23303
+ var styles$1 = {
23295
23304
  container: {
23296
23305
  margin: '0px 20px',
23297
23306
  maxHeight: '90vh'
@@ -23309,16 +23318,16 @@ var CheatSheet = function CheatSheet() {
23309
23318
  onChangeActiveTab(newValue);
23310
23319
  };
23311
23320
  return /*#__PURE__*/React__default.createElement(Box, {
23312
- sx: styles.container
23321
+ sx: styles$1.container
23313
23322
  }, /*#__PURE__*/React__default.createElement(Tabs, {
23314
23323
  value: activeTab,
23315
23324
  onChange: onChangeTab,
23316
23325
  "aria-label": "platform"
23317
23326
  }, /*#__PURE__*/React__default.createElement(Tab, {
23318
- sx: styles.tab,
23327
+ sx: styles$1.tab,
23319
23328
  label: "Windows"
23320
23329
  }), /*#__PURE__*/React__default.createElement(Tab, {
23321
- sx: styles.tab,
23330
+ sx: styles$1.tab,
23322
23331
  label: "Mac"
23323
23332
  })), /*#__PURE__*/React__default.createElement(TabPanel, {
23324
23333
  value: activeTab,
@@ -23599,7 +23608,9 @@ var ToggleMenu = function ToggleMenu(_ref) {
23599
23608
  _ref$isDefaultOpen = _ref.isDefaultOpen,
23600
23609
  isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen,
23601
23610
  _ref$buttonIcon = _ref.buttonIcon,
23602
- buttonIcon = _ref$buttonIcon === void 0 ? /*#__PURE__*/React$1.createElement(Options, null) : _ref$buttonIcon;
23611
+ buttonIcon = _ref$buttonIcon === void 0 ? /*#__PURE__*/React$1.createElement(Options, null) : _ref$buttonIcon,
23612
+ _ref$isDisabled = _ref.isDisabled,
23613
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
23603
23614
  var _React$useState = React$1.useState(null),
23604
23615
  _React$useState2 = _slicedToArray$1(_React$useState, 2),
23605
23616
  anchorEl = _React$useState2[0],
@@ -23631,7 +23642,8 @@ var ToggleMenu = function ToggleMenu(_ref) {
23631
23642
  onClick: handleClick,
23632
23643
  "data-testid": buttonTestId,
23633
23644
  variant: variant,
23634
- id: buttonTestId
23645
+ id: buttonTestId,
23646
+ disabled: isDisabled
23635
23647
  }, buttonIcon), /*#__PURE__*/React$1.createElement(Menu, {
23636
23648
  anchorEl: anchorEl,
23637
23649
  open: isOpen,
@@ -24970,6 +24982,42 @@ var SearchHighlight = function SearchHighlight(_ref) {
24970
24982
  }));
24971
24983
  };
24972
24984
 
24985
+ /* *
24986
+ * Licensed under the Apache License, Version 2.0 (the "License");
24987
+ * you may not use this file except in compliance with the License.
24988
+ * You may obtain a copy of the License at
24989
+ *
24990
+ * http://www.apache.org/licenses/LICENSE-2.0
24991
+ *
24992
+ * Unless required by applicable law or agreed to in writing, software
24993
+ * distributed under the License is distributed on an "AS IS" BASIS,
24994
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24995
+ * See the License for the specific language governing permissions and
24996
+ * limitations under the License.
24997
+ *
24998
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
24999
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
25000
+ * */
25001
+ var styles = {
25002
+ label: {
25003
+ color: 'geowebColors.buttons.tertiary.default.color',
25004
+ opacity: 1,
25005
+ fontSize: '12px',
25006
+ fontWeight: 500
25007
+ }
25008
+ };
25009
+ var SwitchButton = function SwitchButton(props) {
25010
+ return /*#__PURE__*/React$1.createElement(CustomTooltip, {
25011
+ title: "Switch mode"
25012
+ }, /*#__PURE__*/React$1.createElement("span", null, /*#__PURE__*/React$1.createElement(FormLabel, {
25013
+ sx: styles.label
25014
+ }, "Viewer"), /*#__PURE__*/React$1.createElement(Switch, Object.assign({
25015
+ "data-testid": "switchMode"
25016
+ }, props)), /*#__PURE__*/React$1.createElement(FormLabel, {
25017
+ sx: styles.label
25018
+ }, "Editor")));
25019
+ };
25020
+
24973
25021
  /* *
24974
25022
  * Licensed under the Apache License, Version 2.0 (the "License");
24975
25023
  * you may not use this file except in compliance with the License.
@@ -27223,4 +27271,4 @@ var createToolkitMockStoreWithEggs = function createToolkitMockStoreWithEggs(sto
27223
27271
  return store;
27224
27272
  };
27225
27273
 
27226
- 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, SearchHighlight, StatusTag, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
27274
+ 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, SearchHighlight, StatusTag, SwitchButton, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "8.0.0",
3
+ "version": "8.2.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,7 +13,7 @@
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
15
  "@mui/material": "5.12.0",
16
- "@opengeoweb/theme": "8.0.0",
16
+ "@opengeoweb/theme": "8.2.0",
17
17
  "@redux-eggs/core": "2.2.0",
18
18
  "@reduxjs/toolkit": "1.9.5",
19
19
  "axios": "1.5.0",
package/src/index.d.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -7,7 +7,7 @@ export declare const sliderHeaderStyle: {
7
7
  padding: string;
8
8
  };
9
9
  interface CustomSliderProps extends Omit<SliderProps, 'onChange'> {
10
- onChange: (event: Event, newValue: number) => void;
10
+ onChange: (event: PointerEvent, newValue: number | number[]) => void;
11
11
  shouldAutoFocus?: boolean;
12
12
  }
13
13
  export declare const CustomSlider: React.FC<CustomSliderProps>;
File without changes
File without changes
File without changes
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { DraggableEvent } from 'react-draggable';
2
3
  import { DraggablePosition } from './types';
3
4
  interface DraggableComponentProps {
4
5
  nodeRef?: React.RefObject<HTMLElement>;
@@ -6,7 +7,7 @@ interface DraggableComponentProps {
6
7
  bounds?: 'parent' | string;
7
8
  cancel?: string;
8
9
  position?: DraggablePosition;
9
- onStop?: (event: React.MouseEvent<HTMLElement>, pos: DraggablePosition) => void;
10
+ onStop?: (event: DraggableEvent, pos: DraggablePosition) => void;
10
11
  onMouseDown?: (event: MouseEvent) => void;
11
12
  handle?: string;
12
13
  }
File without changes
@@ -9,6 +9,10 @@ export type Position = {
9
9
  left?: number;
10
10
  right?: number;
11
11
  };
12
+ export type DraggableSize = {
13
+ width: number;
14
+ height: number;
15
+ };
12
16
  export type Size = {
13
17
  width?: number | string;
14
18
  height?: number | string;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,4 @@
1
+ import { SwitchProps } from '@mui/material';
2
+ import * as React from 'react';
3
+ declare const SwitchButton: React.FC<SwitchProps>;
4
+ export default SwitchButton;
@@ -0,0 +1 @@
1
+ export { default as SwitchButton } from './SwitchButton';
@@ -22,6 +22,7 @@ interface ToggleMenuProps {
22
22
  variant?: Variant;
23
23
  isDefaultOpen?: boolean;
24
24
  buttonIcon?: React.ReactNode;
25
+ isDisabled?: boolean;
25
26
  }
26
27
  export declare const ToggleMenu: React.FC<ToggleMenuProps>;
27
28
  export {};
File without changes
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SxProps } from '@mui/material';
3
3
  import { NumberSize } from 're-resizable';
4
- import { DraggablePosition, Position, ResizableComponentProps, Size } from '../DraggableResizable/types';
4
+ import { DraggableSize, DraggablePosition, Position, ResizableComponentProps, Size } from '../DraggableResizable/types';
5
5
  import { HeaderSize } from './types';
6
6
  export declare const calculateDialogSizeAndPosition: () => {
7
7
  width: number;
@@ -9,6 +9,7 @@ export declare const calculateDialogSizeAndPosition: () => {
9
9
  top: number;
10
10
  left: number;
11
11
  };
12
+ export declare const calculateStartSize: (minSize: DraggableSize, prefSize: DraggableSize, startPosition: Position) => DraggableSize;
12
13
  interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'> {
13
14
  startPosition?: Position;
14
15
  onStartResize?: () => void;
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  export { default as ToolContainer } from './ToolContainer';
2
2
  export { default as ToolContainerDraggable } from './ToolContainerDraggable';
3
3
  export type { Source } from './ToolContainerDraggable';
4
- export { calculateDialogSizeAndPosition } from './ToolContainerDraggable';
4
+ export { calculateDialogSizeAndPosition, calculateStartSize, } from './ToolContainerDraggable';
5
5
  export { default as ToolHeader } from './ToolHeader';
6
6
  export { default as ToolFooter } from './ToolFooter';
7
7
  export * from './types';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -19,3 +19,4 @@ export * from './CustomAccordion';
19
19
  export * from './CustomDialog';
20
20
  export * from './CustomIconButton';
21
21
  export * from './SearchHighlight';
22
+ export * from './SwitchButton';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes