@opengeoweb/shared 9.25.0 → 9.25.2

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
@@ -8326,12 +8326,12 @@ const FilterChip = ({
8326
8326
  isDisabled: _isDisabled = false,
8327
8327
  handleClick: _handleClick = () => {},
8328
8328
  onAction,
8329
- actionIcon
8329
+ actionIcon,
8330
+ size: _size = 'small'
8330
8331
  }) => {
8331
8332
  const theme = useTheme();
8332
- const size = actionIcon && onAction ? 'medium' : 'small';
8333
8333
  return jsx(Chip, {
8334
- size: size,
8334
+ size: _size,
8335
8335
  id: id,
8336
8336
  label: label,
8337
8337
  disabled: _isDisabled,
@@ -8342,8 +8342,7 @@ const FilterChip = ({
8342
8342
  padding: '0px 4px',
8343
8343
  '& .MuiSvgIcon-root, .MuiChip-deleteIcon': {
8344
8344
  fill: _isSelected ? theme.palette.geowebColors.buttons.secondary.active.color : theme.palette.geowebColors.buttons.flat.default.color,
8345
- color: _isSelected ? theme.palette.geowebColors.buttons.secondary.active.color : theme.palette.geowebColors.buttons.flat.default.color,
8346
- paddingLeft: _isSelected ? 0 : '2px'
8345
+ color: _isSelected ? theme.palette.geowebColors.buttons.secondary.active.color : theme.palette.geowebColors.buttons.flat.default.color
8347
8346
  },
8348
8347
  '& .MuiChip-filled': {
8349
8348
  border: '1px solid transparent'
@@ -8352,7 +8351,7 @@ const FilterChip = ({
8352
8351
  overflow: 'visible'
8353
8352
  }
8354
8353
  },
8355
- onClick: () => _handleClick(id),
8354
+ onClick: () => _handleClick(id, _isSelected),
8356
8355
  deleteIcon: actionIcon,
8357
8356
  onDelete: onAction
8358
8357
  });
@@ -8490,8 +8489,8 @@ const Filter = /*#__PURE__*/React.forwardRef((_a, ref) => {
8490
8489
 
8491
8490
  const FilterListItem = ({
8492
8491
  filter,
8493
- toggleFilter,
8494
- enableOnlyOneFilter
8492
+ toggleFilter: _toggleFilter = () => {},
8493
+ enableOnlyOneFilter: _enableOnlyOneFilter = () => {}
8495
8494
  }) => {
8496
8495
  const {
8497
8496
  t
@@ -8504,10 +8503,10 @@ const FilterListItem = ({
8504
8503
  setIsHovering(false);
8505
8504
  }, []);
8506
8505
  const selectOnlyOne = filterId => {
8507
- enableOnlyOneFilter(filterId);
8506
+ _enableOnlyOneFilter(filterId);
8508
8507
  };
8509
8508
  const toggleCheckbox = filterId => {
8510
- toggleFilter([filterId]);
8509
+ _toggleFilter([filterId]);
8511
8510
  };
8512
8511
  const mouseMoveRef = React.useRef(null);
8513
8512
  React.useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "9.25.0",
3
+ "version": "9.25.2",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -4,9 +4,10 @@ export interface FilterChipProps {
4
4
  label: string;
5
5
  isSelected?: boolean;
6
6
  isDisabled?: boolean;
7
- handleClick?: (label: string) => void;
7
+ handleClick?: (label: string, isSelected?: boolean) => void;
8
8
  onAction?: React.MouseEventHandler;
9
9
  actionIcon?: React.ReactElement;
10
+ size?: 'small' | 'medium';
10
11
  }
11
12
  declare const FilterChip: React.FC<FilterChipProps>;
12
13
  export default FilterChip;
@@ -7,7 +7,7 @@ export interface Filter {
7
7
  }
8
8
  export interface FilterListItemProps {
9
9
  filter: Filter;
10
- toggleFilter: (filterIds: string[]) => void;
11
- enableOnlyOneFilter: (filterId: string) => void;
10
+ toggleFilter?: (filterIds: string[]) => void;
11
+ enableOnlyOneFilter?: (filterId: string) => void;
12
12
  }
13
13
  export declare const FilterListItem: React.FC<FilterListItemProps>;