@homecode/ui 4.30.10 → 4.30.11

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.
@@ -18,7 +18,7 @@ import useEvent from '../../hooks/useEvent.js';
18
18
  import S from './Select.styl.js';
19
19
 
20
20
  function Select2(props) {
21
- const { className, value, onChange, onChipClick, onSearchChange, disableTriggerArrow, inputProps, popupProps, scrollProps, size = 'm', round, optionClassName, additionalOptions = [], options, variant, label, additionalLabel, error, blur, disabled, trigger, required, hideRequiredStar, isSearchable, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, selectedChipRemoveTooltip, } = props;
21
+ const { className, value, onChange, onChipClick, onSearchChange, disableTriggerArrow, inputProps, popupProps, scrollProps, size = 'm', round, optionClassName, additionalOptions = [], options, variant, label, additionalLabel, error, blur, disabled, trigger, required, hideRequiredStar, isSearchable, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, selectedChipRemoveTooltip, selectedChipIds, } = props;
22
22
  const isMultiple$1 = isMultiple(value);
23
23
  const closeOnSelect = props.closeOnSelect ?? !isMultiple$1;
24
24
  const contentRef = useRef(null);
@@ -180,7 +180,7 @@ function Select2(props) {
180
180
  const label = getLabel(id);
181
181
  if (!label)
182
182
  return null;
183
- return (jsx(Chip, { className: S.chip, size: size, onRemove: () => onItemToggle(id), onClick: () => onChipClick?.(id), removeTooltip: selectedChipRemoveTooltip, children: label }, id));
183
+ return (jsx(Chip, { className: S.chip, size: size, selected: selectedChipIds?.includes(id), onRemove: () => onItemToggle(id), onClick: () => onChipClick?.(id), removeTooltip: selectedChipRemoveTooltip, children: label }, id));
184
184
  });
185
185
  };
186
186
  const triggerArrow = useMemo(() => {
@@ -63,6 +63,7 @@ export type Props = FormControl<Value> & InheritedInputProps & {
63
63
  popupProps?: SelectPopupProps;
64
64
  hideRequiredStar?: boolean;
65
65
  selectedChipRemoveTooltip?: ReactNode;
66
+ selectedChipIds?: Id[];
66
67
  };
67
68
  export type State = {
68
69
  isFocused: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "4.30.10",
3
+ "version": "4.30.11",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "tests": "jest",