@luscii-healthtech/web-ui 38.0.2 → 38.0.4

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.
@@ -8,7 +8,7 @@ export type BaseListItemProps = {
8
8
  itemId: string | number;
9
9
  title: React.ReactNode;
10
10
  subtitle?: React.ReactNode;
11
- icon?: React.FunctionComponent<IconProps> | string;
11
+ icon?: ReactNode | React.FunctionComponent<IconProps>;
12
12
  accessories?: JSX.Element[];
13
13
  onlyShowAccessoriesOnHover?: boolean;
14
14
  onClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
@@ -22,15 +22,15 @@ export interface CheckboxListModalProps {
22
22
  * Accessory component to be rendered above the search input.
23
23
  * For example, a button or any control that fit the use case.
24
24
  */
25
- accessory: React.ReactNode;
25
+ accessory?: React.ReactNode;
26
26
  initialItems: Array<Item>;
27
27
  isLoadingInitialItems?: boolean;
28
- isOpen: boolean;
28
+ isOpen?: boolean;
29
29
  onSave: (newItems: Item[]) => void;
30
30
  onCloseClick: () => void;
31
31
  filterItem: (item: Item, searchQuery: string) => boolean;
32
32
  className?: string;
33
- hasSearch: boolean;
33
+ hasSearch?: boolean;
34
34
  }
35
35
  export declare const CheckboxListModal: ({ texts, accessory, initialItems, isLoadingInitialItems, isOpen, onSave, onCloseClick, filterItem, hasSearch, }: CheckboxListModalProps) => JSX.Element;
36
36
  export {};
@@ -4879,7 +4879,21 @@ const transformToGroups = (items) => {
4879
4879
  }
4880
4880
  return [...groups, restGroup];
4881
4881
  };
4882
- const CheckboxListModal = ({ texts, accessory, initialItems, isLoadingInitialItems, isOpen, onSave, onCloseClick, filterItem = () => true, hasSearch = false }) => {
4882
+ const CheckboxListModal = ({
4883
+ texts,
4884
+ accessory,
4885
+ initialItems,
4886
+ isLoadingInitialItems,
4887
+ isOpen,
4888
+ onSave,
4889
+ onCloseClick,
4890
+ /**
4891
+ * Predicate used in this component to set the visible items
4892
+ * in the list based on the search query.
4893
+ */
4894
+ filterItem = () => true,
4895
+ hasSearch = false
4896
+ }) => {
4883
4897
  const [items, setItems] = React.useState([]);
4884
4898
  const [visibleItems, setVisibleItems] = React.useState([]);
4885
4899
  const [groups, setGroups] = React.useState([]);