@opengeoweb/shared 9.29.0 → 9.29.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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- 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, Switch, Slider, ToggleButton, Menu, ListSubheader, ListItemText, ListItemIcon, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, Checkbox, ListItemSecondaryAction } from '@mui/material';
2
+ import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid2, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Switch, Slider, ToggleButton, Menu, ListSubheader, ListItemText, ListItemIcon, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, Checkbox } from '@mui/material';
3
3
  import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, Admin, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
4
4
  import * as React from 'react';
5
5
  import React__default, { useRef, Component } from 'react';
@@ -4835,16 +4835,12 @@ const MenuItemTheme = () => {
4835
4835
  return jsx(MenuItem, Object.assign({
4836
4836
  divider: true
4837
4837
  }, {
4838
- children: jsxs(Grid, Object.assign({
4838
+ children: jsxs(Grid2, Object.assign({
4839
4839
  container: true
4840
4840
  }, {
4841
- children: [jsx(Grid, Object.assign({
4842
- item: true
4843
- }, {
4841
+ children: [jsx(Grid2, {
4844
4842
  children: t('shared-choose-app-mode')
4845
- })), jsx(Grid, Object.assign({
4846
- item: true
4847
- }, {
4843
+ }), jsx(Grid2, {
4848
4844
  children: jsxs(RadioGroup, Object.assign({
4849
4845
  onChange: toggleTheme
4850
4846
  }, {
@@ -4862,7 +4858,7 @@ const MenuItemTheme = () => {
4862
4858
  label: t('shared-dark')
4863
4859
  })]
4864
4860
  }))
4865
- }))]
4861
+ })]
4866
4862
  }))
4867
4863
  }));
4868
4864
  };
@@ -4975,7 +4971,7 @@ const ToolHeader = ({
4975
4971
  role: "heading",
4976
4972
  "aria-label": "toolheader"
4977
4973
  }, {
4978
- children: jsxs(Grid, Object.assign({
4974
+ children: jsxs(Grid2, Object.assign({
4979
4975
  container: true,
4980
4976
  alignItems: "center",
4981
4977
  sx: {
@@ -4983,17 +4979,19 @@ const ToolHeader = ({
4983
4979
  height: styles.height
4984
4980
  }
4985
4981
  }, {
4986
- children: [jsxs(Grid, Object.assign({
4982
+ children: [jsxs(Grid2, Object.assign({
4987
4983
  className: "header-left",
4988
- item: true,
4989
- xs: columnSizeLeft,
4990
4984
  sx: {
4991
4985
  paddingRight: 1
4986
+ },
4987
+ size: {
4988
+ sm: columnSizeLeft
4992
4989
  }
4993
4990
  }, {
4994
- children: [_isDraggable && size !== 'xxs' && !_leftHeaderComponent && jsx(Grid, Object.assign({
4991
+ children: [_isDraggable && size !== 'xxs' && !_leftHeaderComponent && jsx(Grid2, Object.assign({
4995
4992
  container: true,
4996
- justifyContent: "flex-start"
4993
+ justifyContent: "flex-start",
4994
+ size: "grow"
4997
4995
  }, {
4998
4996
  children: jsx(CustomIconButton, Object.assign({
4999
4997
  "data-testid": "dragBtn",
@@ -5006,48 +5004,45 @@ const ToolHeader = ({
5006
5004
  children: _dragHandleIcon
5007
5005
  }))
5008
5006
  })), _leftHeaderComponent && _leftHeaderComponent]
5009
- })), jsx(Grid, Object.assign({
5007
+ })), jsxs(Grid2, Object.assign({
5010
5008
  className: "header-title",
5011
- item: true,
5012
- xs: title ? columnSizeTitle : 0
5009
+ size: title ? columnSizeTitle : 0,
5010
+ container: true,
5011
+ justifyContent: "center",
5012
+ alignItems: "center"
5013
5013
  }, {
5014
- children: jsxs(Grid, Object.assign({
5015
- container: true,
5016
- justifyContent: "center",
5017
- alignItems: "center"
5014
+ children: [title && jsx(Typography, Object.assign({
5015
+ variant: "h2",
5016
+ noWrap: true,
5017
+ sx: {
5018
+ fontSize: styles.fontSize,
5019
+ fontWeight: styles.fontWeight,
5020
+ lineHeight: styles.lineHeight,
5021
+ marginTop: styles.marginTop,
5022
+ textAlign: 'center'
5023
+ },
5024
+ role: "heading"
5018
5025
  }, {
5019
- children: [title && jsx(Typography, Object.assign({
5020
- variant: "h2",
5021
- noWrap: true,
5022
- sx: {
5023
- fontSize: styles.fontSize,
5024
- fontWeight: styles.fontWeight,
5025
- lineHeight: styles.lineHeight,
5026
- marginTop: styles.marginTop
5027
- },
5028
- role: "heading"
5029
- }, {
5030
- children: title
5031
- })), size === 'xxs' && jsx(CustomIconButton, Object.assign({
5032
- "data-testid": "dragBtn-xxs",
5033
- disableRipple: true,
5034
- sx: {
5035
- pointerEvents: 'none',
5036
- transform: 'rotate(90deg)',
5037
- '&.MuiButtonBase-root.MuiIconButton-root': Object.assign(Object.assign({}, iconStyle), {
5038
- height: 12
5039
- })
5040
- }
5041
- }, {
5042
- children: _dragHandleIcon
5043
- }))]
5044
- }))
5045
- })), jsxs(Grid, Object.assign({
5026
+ children: title
5027
+ })), size === 'xxs' && jsx(CustomIconButton, Object.assign({
5028
+ "data-testid": "dragBtn-xxs",
5029
+ disableRipple: true,
5030
+ sx: {
5031
+ pointerEvents: 'none',
5032
+ right: -12,
5033
+ transform: 'rotate(90deg)',
5034
+ '&.MuiButtonBase-root.MuiIconButton-root': Object.assign(Object.assign({}, iconStyle), {
5035
+ height: 12
5036
+ })
5037
+ }
5038
+ }, {
5039
+ children: _dragHandleIcon
5040
+ }))]
5041
+ })), jsxs(Grid2, Object.assign({
5046
5042
  className: "header-right",
5047
- item: true,
5048
- xs: columnSizeIcon,
5049
5043
  container: true,
5050
- justifyContent: "flex-end"
5044
+ justifyContent: "flex-end",
5045
+ size: columnSizeIcon
5051
5046
  }, {
5052
5047
  children: [_rightHeaderComponent && _rightHeaderComponent, _onClose && jsx(CustomTooltip, Object.assign({
5053
5048
  title: t('shared-close'),
@@ -5915,14 +5910,14 @@ const ShortcutList = ({
5915
5910
  },
5916
5911
  divider: index !== shortcuts.length - 1
5917
5912
  }, {
5918
- children: jsxs(Grid, Object.assign({
5913
+ children: jsxs(Grid2, Object.assign({
5919
5914
  container: true,
5920
5915
  direction: "row",
5921
5916
  justifyContent: "space-between",
5922
- alignItems: "center"
5917
+ alignItems: "center",
5918
+ size: "grow"
5923
5919
  }, {
5924
- children: [jsx(Grid, Object.assign({
5925
- item: true,
5920
+ children: [jsx(Grid2, Object.assign({
5926
5921
  sx: {
5927
5922
  fontSize: 12,
5928
5923
  fontWeight: 300,
@@ -5931,9 +5926,7 @@ const ShortcutList = ({
5931
5926
  }
5932
5927
  }, {
5933
5928
  children: t(shortcut.titleKey)
5934
- })), jsx(Grid, Object.assign({
5935
- item: true
5936
- }, {
5929
+ })), jsx(Grid2, {
5937
5930
  children: jsx(Box, Object.assign({
5938
5931
  sx: {
5939
5932
  alignItems: 'center'
@@ -5941,7 +5934,7 @@ const ShortcutList = ({
5941
5934
  }, {
5942
5935
  children: _platform === 'mac' && shortcut.descriptionMac ? shortcut.descriptionMac : shortcut.description
5943
5936
  }))
5944
- }))]
5937
+ })]
5945
5938
  }))
5946
5939
  }), shortcut.titleKey))
5947
5940
  }));
@@ -6021,14 +6014,12 @@ const UserMenuItemCheatSheet = () => {
6021
6014
  onClick: onOpen,
6022
6015
  divider: true
6023
6016
  }, {
6024
- children: jsx(Grid, Object.assign({
6017
+ children: jsx(Grid2, Object.assign({
6025
6018
  container: true
6026
6019
  }, {
6027
- children: jsx(Grid, Object.assign({
6028
- item: true
6029
- }, {
6020
+ children: jsx(Grid2, {
6030
6021
  children: t('shared-cheat-sheet')
6031
- }))
6022
+ })
6032
6023
  }))
6033
6024
  })), jsx(Backdrop, Object.assign({
6034
6025
  "data-testid": "cheatsheet-content",
@@ -6119,14 +6110,12 @@ const UserMenuItemSentryRecording = ({
6119
6110
  onClick: onOpen,
6120
6111
  divider: true
6121
6112
  }, {
6122
- children: jsx(Grid, Object.assign({
6113
+ children: jsx(Grid2, Object.assign({
6123
6114
  container: true
6124
6115
  }, {
6125
- children: jsx(Grid, Object.assign({
6126
- item: true
6127
- }, {
6116
+ children: jsx(Grid2, {
6128
6117
  children: t('shared-sentry-recording')
6129
- }))
6118
+ })
6130
6119
  }))
6131
6120
  })), jsx(Backdrop, Object.assign({
6132
6121
  "data-testid": "sentryRecording-content",
@@ -6146,7 +6135,7 @@ const UserMenuItemSentryRecording = ({
6146
6135
  onClose: onClose,
6147
6136
  bounds: "parent"
6148
6137
  }, {
6149
- children: jsxs(Grid, Object.assign({
6138
+ children: jsxs(Grid2, Object.assign({
6150
6139
  container: true,
6151
6140
  spacing: 4,
6152
6141
  sx: {
@@ -6154,9 +6143,8 @@ const UserMenuItemSentryRecording = ({
6154
6143
  paddingRight: '70px'
6155
6144
  }
6156
6145
  }, {
6157
- children: [jsx(Grid, Object.assign({
6146
+ children: [jsx(Grid2, Object.assign({
6158
6147
  container: true,
6159
- item: true,
6160
6148
  justifyContent: "center",
6161
6149
  sx: {
6162
6150
  textAlign: 'center'
@@ -6165,9 +6153,8 @@ const UserMenuItemSentryRecording = ({
6165
6153
  children: jsx(Typography, {
6166
6154
  children: t('shared-sentry-information')
6167
6155
  })
6168
- })), jsx(Grid, Object.assign({
6156
+ })), jsx(Grid2, Object.assign({
6169
6157
  container: true,
6170
- item: true,
6171
6158
  justifyContent: "center",
6172
6159
  sx: {
6173
6160
  textAlign: 'center'
@@ -6176,9 +6163,8 @@ const UserMenuItemSentryRecording = ({
6176
6163
  children: jsx(Typography, {
6177
6164
  children: t('shared-sentry-enable-message')
6178
6165
  })
6179
- })), jsxs(Grid, Object.assign({
6166
+ })), jsxs(Grid2, Object.assign({
6180
6167
  container: true,
6181
- item: true,
6182
6168
  alignItems: "center",
6183
6169
  direction: "column"
6184
6170
  }, {
@@ -6191,9 +6177,8 @@ const UserMenuItemSentryRecording = ({
6191
6177
  }) : jsxs(Typography, {
6192
6178
  children: [" ", t('shared-sentry-enable')]
6193
6179
  })]
6194
- })), jsxs(Grid, Object.assign({
6180
+ })), jsxs(Grid2, Object.assign({
6195
6181
  container: true,
6196
- item: true,
6197
6182
  alignItems: "center",
6198
6183
  direction: "column"
6199
6184
  }, {
@@ -6219,9 +6204,8 @@ const UserMenuItemSentryRecording = ({
6219
6204
  children: ["(", t('shared-sentry-cors-wait'), ")"]
6220
6205
  }))]
6221
6206
  })]
6222
- })), jsx(Grid, Object.assign({
6207
+ })), jsx(Grid2, Object.assign({
6223
6208
  container: true,
6224
- item: true,
6225
6209
  justifyContent: "center"
6226
6210
  }, {
6227
6211
  children: jsx(Typography, Object.assign({
@@ -6547,19 +6531,17 @@ const ToggleMenu = ({
6547
6531
  disabled: isDisabled,
6548
6532
  selected: menuItem.isSelected
6549
6533
  }, {
6550
- children: jsxs(Grid, Object.assign({
6534
+ children: jsxs(Grid2, Object.assign({
6551
6535
  container: true,
6552
6536
  spacing: 2,
6553
- justifyContent: "space-between"
6537
+ justifyContent: "space-between",
6538
+ size: "grow"
6554
6539
  }, {
6555
- children: [jsx(Grid, Object.assign({
6556
- item: true
6557
- }, {
6540
+ children: [jsx(Grid2, {
6558
6541
  children: jsx(ListItemText, {
6559
6542
  children: text
6560
6543
  })
6561
- })), icon && jsx(Grid, Object.assign({
6562
- item: true,
6544
+ }), icon && jsx(Grid2, Object.assign({
6563
6545
  alignItems: "flex-end"
6564
6546
  }, {
6565
6547
  children: jsx(ListItemIcon, Object.assign({
@@ -8383,12 +8365,15 @@ const FilterChip = ({
8383
8365
  isSelected: _isSelected = false,
8384
8366
  isDisabled: _isDisabled = false,
8385
8367
  handleClick: _handleClick = () => {},
8386
- onAction,
8368
+ onClick,
8387
8369
  actionIcon,
8388
8370
  size: _size = 'small'
8389
8371
  }) => {
8390
8372
  const theme = useTheme();
8373
+ const chipRef = useRef(null);
8374
+ const clickHandler = () => onClick ? onClick(chipRef.current) : _handleClick(id, _isSelected);
8391
8375
  return jsx(Chip, {
8376
+ ref: chipRef,
8392
8377
  size: _size,
8393
8378
  id: id,
8394
8379
  label: label,
@@ -8405,13 +8390,13 @@ const FilterChip = ({
8405
8390
  '& .MuiChip-filled': {
8406
8391
  border: '1px solid transparent'
8407
8392
  },
8408
- '& .MuiChip-labelMedium': {
8393
+ '&.MuiChip-sizeMedium > .MuiChip-label': {
8409
8394
  overflow: 'visible'
8410
8395
  }
8411
8396
  },
8412
- onClick: () => _handleClick(id, _isSelected),
8397
+ onClick: clickHandler,
8413
8398
  deleteIcon: actionIcon,
8414
- onDelete: onAction
8399
+ onDelete: actionIcon ? clickHandler : undefined
8415
8400
  });
8416
8401
  };
8417
8402
 
@@ -8617,7 +8602,29 @@ const FilterListItem = ({
8617
8602
  paddingLeft: '0px',
8618
8603
  paddingRight: '50px',
8619
8604
  fontSize: '12px'
8620
- }
8605
+ },
8606
+ secondaryAction: jsx(CustomIconButton, Object.assign({
8607
+ "aria-label": `Only ${filter.name}`,
8608
+ style: {
8609
+ backgroundColor: 'transparent',
8610
+ width: 'auto',
8611
+ display: isHovering ? 'block' : 'none'
8612
+ },
8613
+ edge: "end",
8614
+ onClick: () => {
8615
+ selectOnlyOne(filter.id);
8616
+ }
8617
+ }, {
8618
+ children: jsx(Typography, Object.assign({
8619
+ sx: {
8620
+ color: 'geowebColors.buttons.primary.default.fill',
8621
+ fontSize: '14px',
8622
+ fontWeight: 500
8623
+ }
8624
+ }, {
8625
+ children: t('shared-only')
8626
+ }))
8627
+ }))
8621
8628
  }, {
8622
8629
  children: [jsx(ListItemIcon, Object.assign({
8623
8630
  sx: {
@@ -8626,8 +8633,10 @@ const FilterListItem = ({
8626
8633
  }, {
8627
8634
  children: jsx(Checkbox, {
8628
8635
  inputProps: {
8629
- 'aria-label': filter.name
8636
+ 'aria-label': filter.name,
8637
+ checked: filter.checked
8630
8638
  },
8639
+ className: filter.checked ? 'is-checked' : '',
8631
8640
  color: "secondary",
8632
8641
  checked: filter.checked,
8633
8642
  onChange: () => {
@@ -8643,27 +8652,7 @@ const FilterListItem = ({
8643
8652
  })
8644
8653
  })), children || jsx(FilterLabel, {
8645
8654
  name: name
8646
- }), isHovering ? jsx(ListItemSecondaryAction, {
8647
- children: jsx(CustomIconButton, Object.assign({
8648
- "aria-label": `Only ${filter.name}`,
8649
- style: {
8650
- backgroundColor: 'transparent',
8651
- width: 'auto'
8652
- },
8653
- edge: "end",
8654
- onClick: () => selectOnlyOne(filter.id)
8655
- }, {
8656
- children: jsx(Typography, Object.assign({
8657
- sx: {
8658
- color: 'geowebColors.buttons.primary.default.fill',
8659
- fontSize: '14px',
8660
- fontWeight: 500
8661
- }
8662
- }, {
8663
- children: t('shared-only')
8664
- }))
8665
- }))
8666
- }) : null]
8655
+ })]
8667
8656
  }))
8668
8657
  }));
8669
8658
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "9.29.0",
3
+ "version": "9.29.1",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -5,8 +5,8 @@ export interface FilterChipProps {
5
5
  isSelected?: boolean;
6
6
  isDisabled?: boolean;
7
7
  handleClick?: (label: string, isSelected?: boolean) => void;
8
- onAction?: React.MouseEventHandler;
9
8
  actionIcon?: React.ReactElement;
9
+ onClick?: (ref: HTMLElement | null) => void;
10
10
  size?: 'small' | 'medium';
11
11
  }
12
12
  declare const FilterChip: React.FC<FilterChipProps>;