mimir-ui-kit 1.45.0 → 1.47.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.
- package/dist/assets/CheckboxMimir.css +1 -1
 - package/dist/assets/SelectSearch.css +1 -1
 - package/dist/assets/useNestedSelection.css +1 -0
 - package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +2 -0
 - package/dist/components/CheckboxMimir/CheckboxMimir.js +42 -41
 - package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +5 -1
 - package/dist/components/MultiSelectSearch/MultiSelectSearch.js +277 -467
 - package/dist/components/MultiSelectSearch/hooks/useChips.d.ts +18 -0
 - package/dist/components/MultiSelectSearch/hooks/useChips.js +101 -0
 - package/dist/components/MultiSelectSearch/hooks/useDataLoading.d.ts +10 -0
 - package/dist/components/MultiSelectSearch/hooks/useDataLoading.js +21 -0
 - package/dist/components/MultiSelectSearch/hooks/useEventHandling.d.ts +12 -0
 - package/dist/components/MultiSelectSearch/hooks/useEventHandling.js +31 -0
 - package/dist/components/MultiSelectSearch/hooks/useMenuPlacement.d.ts +19 -0
 - package/dist/components/MultiSelectSearch/hooks/useMenuPlacement.js +38 -0
 - package/dist/components/MultiSelectSearch/hooks/useMultiSelectState.d.ts +21 -0
 - package/dist/components/MultiSelectSearch/hooks/useMultiSelectState.js +31 -0
 - package/dist/components/MultiSelectSearch/hooks/useNestedSelection.d.ts +26 -0
 - package/dist/components/MultiSelectSearch/hooks/useNestedSelection.js +12 -0
 - package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.d.ts +30 -0
 - package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.js +226 -0
 - package/dist/components/MultiSelectSearch/hooks/useSearch.d.ts +17 -0
 - package/dist/components/MultiSelectSearch/hooks/useSearch.js +68 -0
 - package/dist/components/MultiSelectSearch/hooks/useVirtualization.d.ts +18 -0
 - package/dist/components/MultiSelectSearch/hooks/useVirtualization.js +38 -0
 - package/dist/components/MultiSelectSearch/types.d.ts +26 -0
 - package/dist/components/MultiSelectSearch/utils.d.ts +32 -0
 - package/dist/components/MultiSelectSearch/utils.js +145 -59
 - package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
 - package/dist/components/SelectSearch/SelectSearch.js +304 -324
 - package/dist/components/SelectSearch/types.d.ts +5 -0
 - package/dist/components/SelectSearch/utils.js +18 -17
 - package/dist/useNestedSelection-bo9wXvE-.js +181 -0
 - package/package.json +1 -1
 - package/dist/assets/MultiSelectSearch.css +0 -1
 
| 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Dispatch, ReactNode, SetStateAction } from 'react';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { EChipVariant } from '../../Chip';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { EMultiSelectSearchSize } from '../constants';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { TMultiSelectOption } from '../types';
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            type TUseChipsProps = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                selectedItems: TMultiSelectOption[];
         
     | 
| 
      
 8 
     | 
    
         
            +
                enableNestedSelection: boolean;
         
     | 
| 
      
 9 
     | 
    
         
            +
                size: EMultiSelectSearchSize;
         
     | 
| 
      
 10 
     | 
    
         
            +
                chipVariant: EChipVariant | `${EChipVariant}`;
         
     | 
| 
      
 11 
     | 
    
         
            +
                items: TMultiSelectOption[];
         
     | 
| 
      
 12 
     | 
    
         
            +
                displayValue: string;
         
     | 
| 
      
 13 
     | 
    
         
            +
                setSelectedItems: Dispatch<SetStateAction<TMultiSelectOption[]>>;
         
     | 
| 
      
 14 
     | 
    
         
            +
                onChange?: (value: TMultiSelectOption[]) => void;
         
     | 
| 
      
 15 
     | 
    
         
            +
                setInputValue: Dispatch<SetStateAction<string>>;
         
     | 
| 
      
 16 
     | 
    
         
            +
            };
         
     | 
| 
      
 17 
     | 
    
         
            +
            export declare const useChips: ({ selectedItems, enableNestedSelection, size, chipVariant, items, displayValue, setSelectedItems, onChange, setInputValue }: TUseChipsProps) => ReactNode;
         
     | 
| 
      
 18 
     | 
    
         
            +
            export {};
         
     | 
| 
         @@ -0,0 +1,101 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { jsx as m } from "react/jsx-runtime";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { Chip as N } from "../../Chip/Chip.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { EChipSize as E } from "../../Chip/constants.js";
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { EMultiSelectSearchSize as O } from "../constants.js";
         
     | 
| 
      
 5 
     | 
    
         
            +
            import { getSelectedChildrenCount as R, getAllChildrenIds as j, formatOptionWithCount as w, joinSelectedItems as W } from "../utils.js";
         
     | 
| 
      
 6 
     | 
    
         
            +
            const F = ({
         
     | 
| 
      
 7 
     | 
    
         
            +
              selectedItems: c,
         
     | 
| 
      
 8 
     | 
    
         
            +
              enableNestedSelection: l,
         
     | 
| 
      
 9 
     | 
    
         
            +
              size: z,
         
     | 
| 
      
 10 
     | 
    
         
            +
              chipVariant: A,
         
     | 
| 
      
 11 
     | 
    
         
            +
              items: h,
         
     | 
| 
      
 12 
     | 
    
         
            +
              displayValue: t,
         
     | 
| 
      
 13 
     | 
    
         
            +
              setSelectedItems: p,
         
     | 
| 
      
 14 
     | 
    
         
            +
              onChange: s,
         
     | 
| 
      
 15 
     | 
    
         
            +
              setInputValue: a
         
     | 
| 
      
 16 
     | 
    
         
            +
            }) => {
         
     | 
| 
      
 17 
     | 
    
         
            +
              const f = (r) => {
         
     | 
| 
      
 18 
     | 
    
         
            +
                if (l) {
         
     | 
| 
      
 19 
     | 
    
         
            +
                  const o = /* @__PURE__ */ new Set();
         
     | 
| 
      
 20 
     | 
    
         
            +
                  for (const n of r)
         
     | 
| 
      
 21 
     | 
    
         
            +
                    if (n.children && n.children.length > 0)
         
     | 
| 
      
 22 
     | 
    
         
            +
                      o.add(n);
         
     | 
| 
      
 23 
     | 
    
         
            +
                    else {
         
     | 
| 
      
 24 
     | 
    
         
            +
                      const d = h.find(
         
     | 
| 
      
 25 
     | 
    
         
            +
                        (e) => {
         
     | 
| 
      
 26 
     | 
    
         
            +
                          var S;
         
     | 
| 
      
 27 
     | 
    
         
            +
                          return (S = e.children) == null ? void 0 : S.some((M) => M.id === n.id);
         
     | 
| 
      
 28 
     | 
    
         
            +
                        }
         
     | 
| 
      
 29 
     | 
    
         
            +
                      );
         
     | 
| 
      
 30 
     | 
    
         
            +
                      d ? o.add(d) : o.add(n);
         
     | 
| 
      
 31 
     | 
    
         
            +
                    }
         
     | 
| 
      
 32 
     | 
    
         
            +
                  const i = Array.from(o).map(
         
     | 
| 
      
 33 
     | 
    
         
            +
                    (n) => w(
         
     | 
| 
      
 34 
     | 
    
         
            +
                      n,
         
     | 
| 
      
 35 
     | 
    
         
            +
                      r.map((d) => d.id),
         
     | 
| 
      
 36 
     | 
    
         
            +
                      t
         
     | 
| 
      
 37 
     | 
    
         
            +
                    )
         
     | 
| 
      
 38 
     | 
    
         
            +
                  ).join(", ");
         
     | 
| 
      
 39 
     | 
    
         
            +
                  a(i);
         
     | 
| 
      
 40 
     | 
    
         
            +
                } else
         
     | 
| 
      
 41 
     | 
    
         
            +
                  a(W(r, t));
         
     | 
| 
      
 42 
     | 
    
         
            +
              }, P = (r) => {
         
     | 
| 
      
 43 
     | 
    
         
            +
                const o = c.filter(
         
     | 
| 
      
 44 
     | 
    
         
            +
                  (i) => i.id !== r.id
         
     | 
| 
      
 45 
     | 
    
         
            +
                );
         
     | 
| 
      
 46 
     | 
    
         
            +
                p(o), s == null || s(o), f(o);
         
     | 
| 
      
 47 
     | 
    
         
            +
              }, v = (r) => {
         
     | 
| 
      
 48 
     | 
    
         
            +
                const o = j(r), i = [r.id, ...o], n = c.filter((d) => !i.includes(d.id));
         
     | 
| 
      
 49 
     | 
    
         
            +
                p(n), s == null || s(n), f(n);
         
     | 
| 
      
 50 
     | 
    
         
            +
              }, x = (r) => ({
         
     | 
| 
      
 51 
     | 
    
         
            +
                id: r.id,
         
     | 
| 
      
 52 
     | 
    
         
            +
                name: w(
         
     | 
| 
      
 53 
     | 
    
         
            +
                  r,
         
     | 
| 
      
 54 
     | 
    
         
            +
                  c.map((o) => o.id),
         
     | 
| 
      
 55 
     | 
    
         
            +
                  t
         
     | 
| 
      
 56 
     | 
    
         
            +
                ),
         
     | 
| 
      
 57 
     | 
    
         
            +
                onClose: () => v(r)
         
     | 
| 
      
 58 
     | 
    
         
            +
              }), u = (r) => ({
         
     | 
| 
      
 59 
     | 
    
         
            +
                id: r.id,
         
     | 
| 
      
 60 
     | 
    
         
            +
                name: String(r[t] || ""),
         
     | 
| 
      
 61 
     | 
    
         
            +
                onClose: () => P(r)
         
     | 
| 
      
 62 
     | 
    
         
            +
              }), L = (r) => h.some(
         
     | 
| 
      
 63 
     | 
    
         
            +
                (o) => {
         
     | 
| 
      
 64 
     | 
    
         
            +
                  var i;
         
     | 
| 
      
 65 
     | 
    
         
            +
                  return (i = o.children) == null ? void 0 : i.some((n) => n.id === r.id);
         
     | 
| 
      
 66 
     | 
    
         
            +
                }
         
     | 
| 
      
 67 
     | 
    
         
            +
              ), C = (r) => /* @__PURE__ */ m(
         
     | 
| 
      
 68 
     | 
    
         
            +
                N,
         
     | 
| 
      
 69 
     | 
    
         
            +
                {
         
     | 
| 
      
 70 
     | 
    
         
            +
                  size: z === O.L ? E.S : E.XS,
         
     | 
| 
      
 71 
     | 
    
         
            +
                  variant: A,
         
     | 
| 
      
 72 
     | 
    
         
            +
                  className: "chip-root",
         
     | 
| 
      
 73 
     | 
    
         
            +
                  withAction: !0,
         
     | 
| 
      
 74 
     | 
    
         
            +
                  onClose: r.onClose,
         
     | 
| 
      
 75 
     | 
    
         
            +
                  children: /* @__PURE__ */ m("span", { className: "chip", children: r.name })
         
     | 
| 
      
 76 
     | 
    
         
            +
                },
         
     | 
| 
      
 77 
     | 
    
         
            +
                r.id
         
     | 
| 
      
 78 
     | 
    
         
            +
              );
         
     | 
| 
      
 79 
     | 
    
         
            +
              if (!c.length)
         
     | 
| 
      
 80 
     | 
    
         
            +
                return null;
         
     | 
| 
      
 81 
     | 
    
         
            +
              if (l) {
         
     | 
| 
      
 82 
     | 
    
         
            +
                const r = /* @__PURE__ */ new Set(), o = [];
         
     | 
| 
      
 83 
     | 
    
         
            +
                return c.forEach((i) => {
         
     | 
| 
      
 84 
     | 
    
         
            +
                  if (!r.has(i.id))
         
     | 
| 
      
 85 
     | 
    
         
            +
                    if (i.children && i.children.length > 0) {
         
     | 
| 
      
 86 
     | 
    
         
            +
                      if (R(
         
     | 
| 
      
 87 
     | 
    
         
            +
                        i,
         
     | 
| 
      
 88 
     | 
    
         
            +
                        c.map((d) => d.id)
         
     | 
| 
      
 89 
     | 
    
         
            +
                      ) > 0) {
         
     | 
| 
      
 90 
     | 
    
         
            +
                        o.push(x(i));
         
     | 
| 
      
 91 
     | 
    
         
            +
                        const d = j(i);
         
     | 
| 
      
 92 
     | 
    
         
            +
                        r.add(i.id), d.forEach((e) => r.add(e));
         
     | 
| 
      
 93 
     | 
    
         
            +
                      }
         
     | 
| 
      
 94 
     | 
    
         
            +
                    } else L(i) || (o.push(u(i)), r.add(i.id));
         
     | 
| 
      
 95 
     | 
    
         
            +
                }), o.map(C);
         
     | 
| 
      
 96 
     | 
    
         
            +
              }
         
     | 
| 
      
 97 
     | 
    
         
            +
              return c.map((r) => C(u(r)));
         
     | 
| 
      
 98 
     | 
    
         
            +
            };
         
     | 
| 
      
 99 
     | 
    
         
            +
            export {
         
     | 
| 
      
 100 
     | 
    
         
            +
              F as useChips
         
     | 
| 
      
 101 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,10 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            type TUseDataLoadingProps = {
         
     | 
| 
      
 2 
     | 
    
         
            +
                loadOnOpen?: () => void;
         
     | 
| 
      
 3 
     | 
    
         
            +
                loading?: boolean;
         
     | 
| 
      
 4 
     | 
    
         
            +
            };
         
     | 
| 
      
 5 
     | 
    
         
            +
            type TUseDataLoadingReturn = {
         
     | 
| 
      
 6 
     | 
    
         
            +
                isLoading: boolean;
         
     | 
| 
      
 7 
     | 
    
         
            +
                handleDataLoading: () => Promise<void>;
         
     | 
| 
      
 8 
     | 
    
         
            +
            };
         
     | 
| 
      
 9 
     | 
    
         
            +
            export declare const useDataLoading: ({ loadOnOpen, loading }: TUseDataLoadingProps) => TUseDataLoadingReturn;
         
     | 
| 
      
 10 
     | 
    
         
            +
            export {};
         
     | 
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { useState as o } from "react";
         
     | 
| 
      
 2 
     | 
    
         
            +
            const d = ({
         
     | 
| 
      
 3 
     | 
    
         
            +
              loadOnOpen: a,
         
     | 
| 
      
 4 
     | 
    
         
            +
              loading: t
         
     | 
| 
      
 5 
     | 
    
         
            +
            }) => {
         
     | 
| 
      
 6 
     | 
    
         
            +
              const [i, n] = o(!1);
         
     | 
| 
      
 7 
     | 
    
         
            +
              return {
         
     | 
| 
      
 8 
     | 
    
         
            +
                isLoading: t !== void 0 ? t : i,
         
     | 
| 
      
 9 
     | 
    
         
            +
                handleDataLoading: async () => {
         
     | 
| 
      
 10 
     | 
    
         
            +
                  if (a)
         
     | 
| 
      
 11 
     | 
    
         
            +
                    try {
         
     | 
| 
      
 12 
     | 
    
         
            +
                      n(!0), await a();
         
     | 
| 
      
 13 
     | 
    
         
            +
                    } finally {
         
     | 
| 
      
 14 
     | 
    
         
            +
                      n(!1);
         
     | 
| 
      
 15 
     | 
    
         
            +
                    }
         
     | 
| 
      
 16 
     | 
    
         
            +
                }
         
     | 
| 
      
 17 
     | 
    
         
            +
              };
         
     | 
| 
      
 18 
     | 
    
         
            +
            };
         
     | 
| 
      
 19 
     | 
    
         
            +
            export {
         
     | 
| 
      
 20 
     | 
    
         
            +
              d as useDataLoading
         
     | 
| 
      
 21 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Dispatch, MutableRefObject, RefObject, SetStateAction } from 'react';
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            type TUseEventHandlingProps = {
         
     | 
| 
      
 4 
     | 
    
         
            +
                isOpen: boolean;
         
     | 
| 
      
 5 
     | 
    
         
            +
                setIsOpen: Dispatch<SetStateAction<boolean>>;
         
     | 
| 
      
 6 
     | 
    
         
            +
                onIsOpen?: (value: boolean) => void;
         
     | 
| 
      
 7 
     | 
    
         
            +
                id: string;
         
     | 
| 
      
 8 
     | 
    
         
            +
                selectSearchRef: RefObject<HTMLDivElement>;
         
     | 
| 
      
 9 
     | 
    
         
            +
                isHandlingRef: MutableRefObject<boolean>;
         
     | 
| 
      
 10 
     | 
    
         
            +
            };
         
     | 
| 
      
 11 
     | 
    
         
            +
            export declare const useEventHandling: ({ isOpen, setIsOpen, onIsOpen, id, selectSearchRef, isHandlingRef }: TUseEventHandlingProps) => void;
         
     | 
| 
      
 12 
     | 
    
         
            +
            export {};
         
     | 
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { useEffect as E } from "react";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { MULTISELECT_OPEN_EVENT as i } from "../utils.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            const v = ({
         
     | 
| 
      
 4 
     | 
    
         
            +
              isOpen: e,
         
     | 
| 
      
 5 
     | 
    
         
            +
              setIsOpen: u,
         
     | 
| 
      
 6 
     | 
    
         
            +
              onIsOpen: t,
         
     | 
| 
      
 7 
     | 
    
         
            +
              id: l,
         
     | 
| 
      
 8 
     | 
    
         
            +
              selectSearchRef: c,
         
     | 
| 
      
 9 
     | 
    
         
            +
              isHandlingRef: d
         
     | 
| 
      
 10 
     | 
    
         
            +
            }) => {
         
     | 
| 
      
 11 
     | 
    
         
            +
              E(() => {
         
     | 
| 
      
 12 
     | 
    
         
            +
                if (e) {
         
     | 
| 
      
 13 
     | 
    
         
            +
                  const a = (r) => {
         
     | 
| 
      
 14 
     | 
    
         
            +
                    c.current && !c.current.contains(r.target) && !r.defaultPrevented && (u(!1), t == null || t(!1));
         
     | 
| 
      
 15 
     | 
    
         
            +
                  };
         
     | 
| 
      
 16 
     | 
    
         
            +
                  return document.addEventListener("mousedown", a), () => {
         
     | 
| 
      
 17 
     | 
    
         
            +
                    document.removeEventListener("mousedown", a);
         
     | 
| 
      
 18 
     | 
    
         
            +
                  };
         
     | 
| 
      
 19 
     | 
    
         
            +
                }
         
     | 
| 
      
 20 
     | 
    
         
            +
              }, [e, u, t, c]), E(() => {
         
     | 
| 
      
 21 
     | 
    
         
            +
                const r = (m) => {
         
     | 
| 
      
 22 
     | 
    
         
            +
                  m.detail === l || !e || d.current || (d.current = !0, u(!1), t == null || t(!1), queueMicrotask(() => {
         
     | 
| 
      
 23 
     | 
    
         
            +
                    d.current = !1;
         
     | 
| 
      
 24 
     | 
    
         
            +
                  }));
         
     | 
| 
      
 25 
     | 
    
         
            +
                };
         
     | 
| 
      
 26 
     | 
    
         
            +
                return window.addEventListener(i, r), () => window.removeEventListener(i, r);
         
     | 
| 
      
 27 
     | 
    
         
            +
              }, [l, u, t, e, d]);
         
     | 
| 
      
 28 
     | 
    
         
            +
            };
         
     | 
| 
      
 29 
     | 
    
         
            +
            export {
         
     | 
| 
      
 30 
     | 
    
         
            +
              v as useEventHandling
         
     | 
| 
      
 31 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { RefObject } from 'react';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { EMultiSelectSearchSize } from '../constants';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { TMenuPlacement } from '../types';
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            type TUseMenuPlacementProps = {
         
     | 
| 
      
 6 
     | 
    
         
            +
                autoPlacement: boolean;
         
     | 
| 
      
 7 
     | 
    
         
            +
                menuPlacement: TMenuPlacement;
         
     | 
| 
      
 8 
     | 
    
         
            +
                size: EMultiSelectSearchSize;
         
     | 
| 
      
 9 
     | 
    
         
            +
                selectSearchRef: RefObject<HTMLDivElement>;
         
     | 
| 
      
 10 
     | 
    
         
            +
                isOpen: boolean;
         
     | 
| 
      
 11 
     | 
    
         
            +
            };
         
     | 
| 
      
 12 
     | 
    
         
            +
            type TUseMenuPlacementReturn = {
         
     | 
| 
      
 13 
     | 
    
         
            +
                actualMenuPlacement: TMenuPlacement;
         
     | 
| 
      
 14 
     | 
    
         
            +
                isVisible: boolean;
         
     | 
| 
      
 15 
     | 
    
         
            +
                isMenuReady: boolean;
         
     | 
| 
      
 16 
     | 
    
         
            +
                updateMenuPlacement: () => void;
         
     | 
| 
      
 17 
     | 
    
         
            +
            };
         
     | 
| 
      
 18 
     | 
    
         
            +
            export declare const useMenuPlacement: ({ autoPlacement, menuPlacement, size, selectSearchRef, isOpen }: TUseMenuPlacementProps) => TUseMenuPlacementReturn;
         
     | 
| 
      
 19 
     | 
    
         
            +
            export {};
         
     | 
| 
         @@ -0,0 +1,38 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { useState as r, useCallback as M, useEffect as p } from "react";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { shouldShowMenuOnTop as v } from "../utils.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            const L = ({
         
     | 
| 
      
 4 
     | 
    
         
            +
              autoPlacement: t,
         
     | 
| 
      
 5 
     | 
    
         
            +
              menuPlacement: s,
         
     | 
| 
      
 6 
     | 
    
         
            +
              size: n,
         
     | 
| 
      
 7 
     | 
    
         
            +
              selectSearchRef: i,
         
     | 
| 
      
 8 
     | 
    
         
            +
              isOpen: a
         
     | 
| 
      
 9 
     | 
    
         
            +
            }) => {
         
     | 
| 
      
 10 
     | 
    
         
            +
              const [c, u] = r(s), [f, l] = r(!1), [w, d] = r(!1), e = M(() => {
         
     | 
| 
      
 11 
     | 
    
         
            +
                if (!t) {
         
     | 
| 
      
 12 
     | 
    
         
            +
                  u(s);
         
     | 
| 
      
 13 
     | 
    
         
            +
                  return;
         
     | 
| 
      
 14 
     | 
    
         
            +
                }
         
     | 
| 
      
 15 
     | 
    
         
            +
                const o = v(i, n);
         
     | 
| 
      
 16 
     | 
    
         
            +
                u(o ? "top" : s);
         
     | 
| 
      
 17 
     | 
    
         
            +
              }, [t, s, n, i]);
         
     | 
| 
      
 18 
     | 
    
         
            +
              return p(() => {
         
     | 
| 
      
 19 
     | 
    
         
            +
                if (a) {
         
     | 
| 
      
 20 
     | 
    
         
            +
                  e(), window.addEventListener("scroll", e), window.addEventListener("resize", e);
         
     | 
| 
      
 21 
     | 
    
         
            +
                  const o = requestAnimationFrame(() => {
         
     | 
| 
      
 22 
     | 
    
         
            +
                    d(!0), l(!0);
         
     | 
| 
      
 23 
     | 
    
         
            +
                  });
         
     | 
| 
      
 24 
     | 
    
         
            +
                  return () => {
         
     | 
| 
      
 25 
     | 
    
         
            +
                    window.removeEventListener("scroll", e), window.removeEventListener("resize", e), cancelAnimationFrame(o);
         
     | 
| 
      
 26 
     | 
    
         
            +
                  };
         
     | 
| 
      
 27 
     | 
    
         
            +
                } else
         
     | 
| 
      
 28 
     | 
    
         
            +
                  l(!1), d(!1);
         
     | 
| 
      
 29 
     | 
    
         
            +
              }, [a, s, t, n, e]), {
         
     | 
| 
      
 30 
     | 
    
         
            +
                actualMenuPlacement: c,
         
     | 
| 
      
 31 
     | 
    
         
            +
                isVisible: f,
         
     | 
| 
      
 32 
     | 
    
         
            +
                isMenuReady: w,
         
     | 
| 
      
 33 
     | 
    
         
            +
                updateMenuPlacement: e
         
     | 
| 
      
 34 
     | 
    
         
            +
              };
         
     | 
| 
      
 35 
     | 
    
         
            +
            };
         
     | 
| 
      
 36 
     | 
    
         
            +
            export {
         
     | 
| 
      
 37 
     | 
    
         
            +
              L as useMenuPlacement
         
     | 
| 
      
 38 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Dispatch, SetStateAction } from 'react';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { TMultiSelectOption } from '../types';
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            type TUseMultiSelectStateProps = {
         
     | 
| 
      
 5 
     | 
    
         
            +
                value?: TMultiSelectOption[] | null;
         
     | 
| 
      
 6 
     | 
    
         
            +
                displayValue: string;
         
     | 
| 
      
 7 
     | 
    
         
            +
            };
         
     | 
| 
      
 8 
     | 
    
         
            +
            type TUseMultiSelectStateReturn = {
         
     | 
| 
      
 9 
     | 
    
         
            +
                isOpen: boolean;
         
     | 
| 
      
 10 
     | 
    
         
            +
                setIsOpen: Dispatch<SetStateAction<boolean>>;
         
     | 
| 
      
 11 
     | 
    
         
            +
                inputValue: string;
         
     | 
| 
      
 12 
     | 
    
         
            +
                setInputValue: Dispatch<SetStateAction<string>>;
         
     | 
| 
      
 13 
     | 
    
         
            +
                selectedItems: TMultiSelectOption[];
         
     | 
| 
      
 14 
     | 
    
         
            +
                setSelectedItems: Dispatch<SetStateAction<TMultiSelectOption[]>>;
         
     | 
| 
      
 15 
     | 
    
         
            +
                expandedOptions: Set<string | number>;
         
     | 
| 
      
 16 
     | 
    
         
            +
                setExpandedOptions: Dispatch<SetStateAction<Set<string | number>>>;
         
     | 
| 
      
 17 
     | 
    
         
            +
                internalSearchQuery: string;
         
     | 
| 
      
 18 
     | 
    
         
            +
                setInternalSearchQuery: Dispatch<SetStateAction<string>>;
         
     | 
| 
      
 19 
     | 
    
         
            +
            };
         
     | 
| 
      
 20 
     | 
    
         
            +
            export declare const useMultiSelectState: ({ value, displayValue }: TUseMultiSelectStateProps) => TUseMultiSelectStateReturn;
         
     | 
| 
      
 21 
     | 
    
         
            +
            export {};
         
     | 
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { useState as e, useEffect as u } from "react";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { getInitialInputValue as o } from "../utils.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            const g = ({
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: t,
         
     | 
| 
      
 5 
     | 
    
         
            +
              displayValue: n
         
     | 
| 
      
 6 
     | 
    
         
            +
            }) => {
         
     | 
| 
      
 7 
     | 
    
         
            +
              const [c, p] = e(!1), [f, r] = e(
         
     | 
| 
      
 8 
     | 
    
         
            +
                () => o(t, n)
         
     | 
| 
      
 9 
     | 
    
         
            +
              ), [s, i] = e(
         
     | 
| 
      
 10 
     | 
    
         
            +
                t || []
         
     | 
| 
      
 11 
     | 
    
         
            +
              ), [S, I] = e(
         
     | 
| 
      
 12 
     | 
    
         
            +
                /* @__PURE__ */ new Set()
         
     | 
| 
      
 13 
     | 
    
         
            +
              ), [m, O] = e("");
         
     | 
| 
      
 14 
     | 
    
         
            +
              return u(() => {
         
     | 
| 
      
 15 
     | 
    
         
            +
                t && (i(t), JSON.stringify(t) !== JSON.stringify(s) && r(o(t, n)));
         
     | 
| 
      
 16 
     | 
    
         
            +
              }, [t, n, s]), {
         
     | 
| 
      
 17 
     | 
    
         
            +
                isOpen: c,
         
     | 
| 
      
 18 
     | 
    
         
            +
                setIsOpen: p,
         
     | 
| 
      
 19 
     | 
    
         
            +
                inputValue: f,
         
     | 
| 
      
 20 
     | 
    
         
            +
                setInputValue: r,
         
     | 
| 
      
 21 
     | 
    
         
            +
                selectedItems: s,
         
     | 
| 
      
 22 
     | 
    
         
            +
                setSelectedItems: i,
         
     | 
| 
      
 23 
     | 
    
         
            +
                expandedOptions: S,
         
     | 
| 
      
 24 
     | 
    
         
            +
                setExpandedOptions: I,
         
     | 
| 
      
 25 
     | 
    
         
            +
                internalSearchQuery: m,
         
     | 
| 
      
 26 
     | 
    
         
            +
                setInternalSearchQuery: O
         
     | 
| 
      
 27 
     | 
    
         
            +
              };
         
     | 
| 
      
 28 
     | 
    
         
            +
            };
         
     | 
| 
      
 29 
     | 
    
         
            +
            export {
         
     | 
| 
      
 30 
     | 
    
         
            +
              g as useMultiSelectState
         
     | 
| 
      
 31 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,26 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { Dispatch, ReactNode, SetStateAction } from 'react';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { EMultiSelectSearchSize } from '../constants';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { TMultiSelectOption } from '../types';
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            type TUseNestedSelectionProps = {
         
     | 
| 
      
 6 
     | 
    
         
            +
                filteredItems: TMultiSelectOption[];
         
     | 
| 
      
 7 
     | 
    
         
            +
                selectedItems: TMultiSelectOption[];
         
     | 
| 
      
 8 
     | 
    
         
            +
                expandedOptions: Set<string | number>;
         
     | 
| 
      
 9 
     | 
    
         
            +
                setExpandedOptions: Dispatch<SetStateAction<Set<string | number>>>;
         
     | 
| 
      
 10 
     | 
    
         
            +
                size: EMultiSelectSearchSize;
         
     | 
| 
      
 11 
     | 
    
         
            +
                classNameOption?: string;
         
     | 
| 
      
 12 
     | 
    
         
            +
                items: TMultiSelectOption[];
         
     | 
| 
      
 13 
     | 
    
         
            +
                enableNestedSelection: boolean;
         
     | 
| 
      
 14 
     | 
    
         
            +
                searchInNestedItems?: boolean;
         
     | 
| 
      
 15 
     | 
    
         
            +
                internalSearchQuery: string;
         
     | 
| 
      
 16 
     | 
    
         
            +
                highlightMatches: boolean;
         
     | 
| 
      
 17 
     | 
    
         
            +
                renderOptionContent: (item: TMultiSelectOption) => ReactNode;
         
     | 
| 
      
 18 
     | 
    
         
            +
                groupBy?: string;
         
     | 
| 
      
 19 
     | 
    
         
            +
                useIconInsteadOfCheckbox?: boolean;
         
     | 
| 
      
 20 
     | 
    
         
            +
            };
         
     | 
| 
      
 21 
     | 
    
         
            +
            type TUseNestedSelectionReturn = {
         
     | 
| 
      
 22 
     | 
    
         
            +
                toggleExpanded: (optionId: string | number) => void;
         
     | 
| 
      
 23 
     | 
    
         
            +
                renderNestedOptions: (options: TMultiSelectOption[], level?: number) => ReactNode[];
         
     | 
| 
      
 24 
     | 
    
         
            +
            };
         
     | 
| 
      
 25 
     | 
    
         
            +
            export declare const useNestedSelection: ({ filteredItems, selectedItems, expandedOptions, setExpandedOptions, size, classNameOption, items, enableNestedSelection, searchInNestedItems, internalSearchQuery, renderOptionContent, groupBy, useIconInsteadOfCheckbox }: TUseNestedSelectionProps) => TUseNestedSelectionReturn;
         
     | 
| 
      
 26 
     | 
    
         
            +
            export {};
         
     | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import "react/jsx-runtime";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import "../../../index-DIxK0V-G.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import "react";
         
     | 
| 
      
 4 
     | 
    
         
            +
            import "../../../icons/Icon.js";
         
     | 
| 
      
 5 
     | 
    
         
            +
            import "../../CheckboxMimir/CheckboxMimir.js";
         
     | 
| 
      
 6 
     | 
    
         
            +
            import "../constants.js";
         
     | 
| 
      
 7 
     | 
    
         
            +
            import { u as c } from "../../../useNestedSelection-bo9wXvE-.js";
         
     | 
| 
      
 8 
     | 
    
         
            +
            import "../utils.js";
         
     | 
| 
      
 9 
     | 
    
         
            +
            import "../../../combobox-fIVOzEhl.js";
         
     | 
| 
      
 10 
     | 
    
         
            +
            export {
         
     | 
| 
      
 11 
     | 
    
         
            +
              c as useNestedSelection
         
     | 
| 
      
 12 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { useVirtualizer } from '@tanstack/react-virtual';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { ReactNode, RefObject } from 'react';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { EMultiSelectSearchSize } from '../constants';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { TMultiSelectOption } from '../types';
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            type TUseRenderVirtualizedListProps = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                items: TMultiSelectOption[];
         
     | 
| 
      
 8 
     | 
    
         
            +
                filteredItems: TMultiSelectOption[];
         
     | 
| 
      
 9 
     | 
    
         
            +
                size: EMultiSelectSearchSize;
         
     | 
| 
      
 10 
     | 
    
         
            +
                actualMenuPlacement: string;
         
     | 
| 
      
 11 
     | 
    
         
            +
                isVisible: boolean;
         
     | 
| 
      
 12 
     | 
    
         
            +
                noOptionsText: ReactNode;
         
     | 
| 
      
 13 
     | 
    
         
            +
                noMatchText: ReactNode;
         
     | 
| 
      
 14 
     | 
    
         
            +
                enableNestedSelection: boolean;
         
     | 
| 
      
 15 
     | 
    
         
            +
                renderNestedOptions: (items: TMultiSelectOption[]) => ReactNode;
         
     | 
| 
      
 16 
     | 
    
         
            +
                groupBy?: string;
         
     | 
| 
      
 17 
     | 
    
         
            +
                parentRef: RefObject<HTMLDivElement>;
         
     | 
| 
      
 18 
     | 
    
         
            +
                virtualItems: TMultiSelectOption[];
         
     | 
| 
      
 19 
     | 
    
         
            +
                virtualizer: ReturnType<typeof useVirtualizer>;
         
     | 
| 
      
 20 
     | 
    
         
            +
                classNameOption?: string;
         
     | 
| 
      
 21 
     | 
    
         
            +
                selectedItems: TMultiSelectOption[];
         
     | 
| 
      
 22 
     | 
    
         
            +
                renderOptionContent: (item: TMultiSelectOption) => ReactNode;
         
     | 
| 
      
 23 
     | 
    
         
            +
                cls: Record<string, string>;
         
     | 
| 
      
 24 
     | 
    
         
            +
                useIconInsteadOfCheckbox?: boolean;
         
     | 
| 
      
 25 
     | 
    
         
            +
                highlightMatches?: boolean;
         
     | 
| 
      
 26 
     | 
    
         
            +
                internalSearchQuery?: string;
         
     | 
| 
      
 27 
     | 
    
         
            +
                searchInHeaderGroupItems?: boolean;
         
     | 
| 
      
 28 
     | 
    
         
            +
            };
         
     | 
| 
      
 29 
     | 
    
         
            +
            export declare const useRenderVirtualizedList: ({ items, filteredItems, size, actualMenuPlacement, isVisible, noOptionsText, noMatchText, enableNestedSelection, renderNestedOptions, groupBy, parentRef, virtualItems, virtualizer, classNameOption, selectedItems, renderOptionContent, cls, useIconInsteadOfCheckbox, highlightMatches, internalSearchQuery, searchInHeaderGroupItems }: TUseRenderVirtualizedListProps) => () => ReactNode;
         
     | 
| 
      
 30 
     | 
    
         
            +
            export {};
         
     | 
| 
         @@ -0,0 +1,226 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { jsx as n, jsxs as $, Fragment as D } from "react/jsx-runtime";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { c } from "../../../index-DIxK0V-G.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { Icon as k } from "../../../icons/Icon.js";
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { CheckboxMimir as b } from "../../CheckboxMimir/CheckboxMimir.js";
         
     | 
| 
      
 5 
     | 
    
         
            +
            import { EMultiSelectSearchSize as j } from "../constants.js";
         
     | 
| 
      
 6 
     | 
    
         
            +
            import { highlightReactNode as I } from "../utils.js";
         
     | 
| 
      
 7 
     | 
    
         
            +
            import { W as E, K } from "../../../combobox-fIVOzEhl.js";
         
     | 
| 
      
 8 
     | 
    
         
            +
            const W = (i, a, o, r, e) => /* @__PURE__ */ n(
         
     | 
| 
      
 9 
     | 
    
         
            +
              "div",
         
     | 
| 
      
 10 
     | 
    
         
            +
              {
         
     | 
| 
      
 11 
     | 
    
         
            +
                className: c(
         
     | 
| 
      
 12 
     | 
    
         
            +
                  e.options,
         
     | 
| 
      
 13 
     | 
    
         
            +
                  e[i],
         
     | 
| 
      
 14 
     | 
    
         
            +
                  e["no-options"],
         
     | 
| 
      
 15 
     | 
    
         
            +
                  e[a],
         
     | 
| 
      
 16 
     | 
    
         
            +
                  { [e.visible]: o }
         
     | 
| 
      
 17 
     | 
    
         
            +
                ),
         
     | 
| 
      
 18 
     | 
    
         
            +
                children: r
         
     | 
| 
      
 19 
     | 
    
         
            +
              }
         
     | 
| 
      
 20 
     | 
    
         
            +
            ), w = (i, a, o, r, e) => /* @__PURE__ */ n(
         
     | 
| 
      
 21 
     | 
    
         
            +
              "div",
         
     | 
| 
      
 22 
     | 
    
         
            +
              {
         
     | 
| 
      
 23 
     | 
    
         
            +
                className: c(
         
     | 
| 
      
 24 
     | 
    
         
            +
                  e.options,
         
     | 
| 
      
 25 
     | 
    
         
            +
                  e[i],
         
     | 
| 
      
 26 
     | 
    
         
            +
                  e["no-options"],
         
     | 
| 
      
 27 
     | 
    
         
            +
                  e[a],
         
     | 
| 
      
 28 
     | 
    
         
            +
                  { [e.visible]: o }
         
     | 
| 
      
 29 
     | 
    
         
            +
                ),
         
     | 
| 
      
 30 
     | 
    
         
            +
                children: r
         
     | 
| 
      
 31 
     | 
    
         
            +
              }
         
     | 
| 
      
 32 
     | 
    
         
            +
            ), F = (i, a, o, r, e, p) => /* @__PURE__ */ n(
         
     | 
| 
      
 33 
     | 
    
         
            +
              "div",
         
     | 
| 
      
 34 
     | 
    
         
            +
              {
         
     | 
| 
      
 35 
     | 
    
         
            +
                className: c(p.options, p[i], p[a], {
         
     | 
| 
      
 36 
     | 
    
         
            +
                  [p.visible]: o
         
     | 
| 
      
 37 
     | 
    
         
            +
                }),
         
     | 
| 
      
 38 
     | 
    
         
            +
                children: e(r)
         
     | 
| 
      
 39 
     | 
    
         
            +
              }
         
     | 
| 
      
 40 
     | 
    
         
            +
            ), H = (i, a, o, r, e, p, d, N, v, t, m, f, x, g, l) => {
         
     | 
| 
      
 41 
     | 
    
         
            +
              const u = new Set(N.map((s) => s.id));
         
     | 
| 
      
 42 
     | 
    
         
            +
              return /* @__PURE__ */ n(
         
     | 
| 
      
 43 
     | 
    
         
            +
                "div",
         
     | 
| 
      
 44 
     | 
    
         
            +
                {
         
     | 
| 
      
 45 
     | 
    
         
            +
                  ref: r,
         
     | 
| 
      
 46 
     | 
    
         
            +
                  className: c(
         
     | 
| 
      
 47 
     | 
    
         
            +
                    t.options,
         
     | 
| 
      
 48 
     | 
    
         
            +
                    t[i],
         
     | 
| 
      
 49 
     | 
    
         
            +
                    t[a],
         
     | 
| 
      
 50 
     | 
    
         
            +
                    t["options-container"],
         
     | 
| 
      
 51 
     | 
    
         
            +
                    { [t.visible]: o }
         
     | 
| 
      
 52 
     | 
    
         
            +
                  ),
         
     | 
| 
      
 53 
     | 
    
         
            +
                  children: /* @__PURE__ */ n(
         
     | 
| 
      
 54 
     | 
    
         
            +
                    "div",
         
     | 
| 
      
 55 
     | 
    
         
            +
                    {
         
     | 
| 
      
 56 
     | 
    
         
            +
                      style: {
         
     | 
| 
      
 57 
     | 
    
         
            +
                        height: `${p.getTotalSize()}px`,
         
     | 
| 
      
 58 
     | 
    
         
            +
                        width: "100%"
         
     | 
| 
      
 59 
     | 
    
         
            +
                      },
         
     | 
| 
      
 60 
     | 
    
         
            +
                      children: p.getVirtualItems().map((s) => {
         
     | 
| 
      
 61 
     | 
    
         
            +
                        const h = e[s.index], S = u.has(h.id);
         
     | 
| 
      
 62 
     | 
    
         
            +
                        return /* @__PURE__ */ n(
         
     | 
| 
      
 63 
     | 
    
         
            +
                          "div",
         
     | 
| 
      
 64 
     | 
    
         
            +
                          {
         
     | 
| 
      
 65 
     | 
    
         
            +
                            "data-index": s.index,
         
     | 
| 
      
 66 
     | 
    
         
            +
                            ref: p.measureElement,
         
     | 
| 
      
 67 
     | 
    
         
            +
                            style: {
         
     | 
| 
      
 68 
     | 
    
         
            +
                              position: "absolute",
         
     | 
| 
      
 69 
     | 
    
         
            +
                              top: 0,
         
     | 
| 
      
 70 
     | 
    
         
            +
                              left: 0,
         
     | 
| 
      
 71 
     | 
    
         
            +
                              width: "100%",
         
     | 
| 
      
 72 
     | 
    
         
            +
                              transform: `translateY(${s.start}px)`
         
     | 
| 
      
 73 
     | 
    
         
            +
                            },
         
     | 
| 
      
 74 
     | 
    
         
            +
                            children: h.isGroupHeader ? /* @__PURE__ */ n(
         
     | 
| 
      
 75 
     | 
    
         
            +
                              "div",
         
     | 
| 
      
 76 
     | 
    
         
            +
                              {
         
     | 
| 
      
 77 
     | 
    
         
            +
                                className: t["group-header"],
         
     | 
| 
      
 78 
     | 
    
         
            +
                                "data-testid": `group-header-${h.name}`,
         
     | 
| 
      
 79 
     | 
    
         
            +
                                children: x && g && l ? I(
         
     | 
| 
      
 80 
     | 
    
         
            +
                                  h.name,
         
     | 
| 
      
 81 
     | 
    
         
            +
                                  g,
         
     | 
| 
      
 82 
     | 
    
         
            +
                                  t["highlighted-text"]
         
     | 
| 
      
 83 
     | 
    
         
            +
                                ) : h.name
         
     | 
| 
      
 84 
     | 
    
         
            +
                              }
         
     | 
| 
      
 85 
     | 
    
         
            +
                            ) : /* @__PURE__ */ n(
         
     | 
| 
      
 86 
     | 
    
         
            +
                              E,
         
     | 
| 
      
 87 
     | 
    
         
            +
                              {
         
     | 
| 
      
 88 
     | 
    
         
            +
                                value: h,
         
     | 
| 
      
 89 
     | 
    
         
            +
                                className: ({ focus: L }) => c(t.option, d, i && t[i], {
         
     | 
| 
      
 90 
     | 
    
         
            +
                                  [t["option-active"]]: L && !m
         
     | 
| 
      
 91 
     | 
    
         
            +
                                }),
         
     | 
| 
      
 92 
     | 
    
         
            +
                                "data-testid": `option-${h.id}`,
         
     | 
| 
      
 93 
     | 
    
         
            +
                                children: /* @__PURE__ */ $(D, { children: [
         
     | 
| 
      
 94 
     | 
    
         
            +
                                  /* @__PURE__ */ n("div", { className: t["option-inner"], children: v(h) }),
         
     | 
| 
      
 95 
     | 
    
         
            +
                                  f ? S && /* @__PURE__ */ n(
         
     | 
| 
      
 96 
     | 
    
         
            +
                                    k,
         
     | 
| 
      
 97 
     | 
    
         
            +
                                    {
         
     | 
| 
      
 98 
     | 
    
         
            +
                                      iconName: i === j.L ? "Done24px" : "Done16px",
         
     | 
| 
      
 99 
     | 
    
         
            +
                                      className: t["selected-icon"]
         
     | 
| 
      
 100 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 101 
     | 
    
         
            +
                                  ) : /* @__PURE__ */ n(
         
     | 
| 
      
 102 
     | 
    
         
            +
                                    b,
         
     | 
| 
      
 103 
     | 
    
         
            +
                                    {
         
     | 
| 
      
 104 
     | 
    
         
            +
                                      isInteractive: !1,
         
     | 
| 
      
 105 
     | 
    
         
            +
                                      checked: S
         
     | 
| 
      
 106 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 107 
     | 
    
         
            +
                                  )
         
     | 
| 
      
 108 
     | 
    
         
            +
                                ] })
         
     | 
| 
      
 109 
     | 
    
         
            +
                              },
         
     | 
| 
      
 110 
     | 
    
         
            +
                              h.id
         
     | 
| 
      
 111 
     | 
    
         
            +
                            )
         
     | 
| 
      
 112 
     | 
    
         
            +
                          },
         
     | 
| 
      
 113 
     | 
    
         
            +
                          s.key
         
     | 
| 
      
 114 
     | 
    
         
            +
                        );
         
     | 
| 
      
 115 
     | 
    
         
            +
                      })
         
     | 
| 
      
 116 
     | 
    
         
            +
                    }
         
     | 
| 
      
 117 
     | 
    
         
            +
                  )
         
     | 
| 
      
 118 
     | 
    
         
            +
                }
         
     | 
| 
      
 119 
     | 
    
         
            +
              );
         
     | 
| 
      
 120 
     | 
    
         
            +
            }, T = (i, a, o, r, e, p, d, N, v) => {
         
     | 
| 
      
 121 
     | 
    
         
            +
              const t = new Set(e.map((m) => m.id));
         
     | 
| 
      
 122 
     | 
    
         
            +
              return /* @__PURE__ */ n(
         
     | 
| 
      
 123 
     | 
    
         
            +
                K,
         
     | 
| 
      
 124 
     | 
    
         
            +
                {
         
     | 
| 
      
 125 
     | 
    
         
            +
                  className: c(d.options, d[i], d[a], {
         
     | 
| 
      
 126 
     | 
    
         
            +
                    [d.visible]: o
         
     | 
| 
      
 127 
     | 
    
         
            +
                  }),
         
     | 
| 
      
 128 
     | 
    
         
            +
                  modal: !1,
         
     | 
| 
      
 129 
     | 
    
         
            +
                  static: !0,
         
     | 
| 
      
 130 
     | 
    
         
            +
                  children: ({ option: m }) => {
         
     | 
| 
      
 131 
     | 
    
         
            +
                    const f = t.has(m.id);
         
     | 
| 
      
 132 
     | 
    
         
            +
                    return /* @__PURE__ */ n(
         
     | 
| 
      
 133 
     | 
    
         
            +
                      E,
         
     | 
| 
      
 134 
     | 
    
         
            +
                      {
         
     | 
| 
      
 135 
     | 
    
         
            +
                        value: m,
         
     | 
| 
      
 136 
     | 
    
         
            +
                        className: ({ focus: x }) => c(d.option, r, i && d[i], {
         
     | 
| 
      
 137 
     | 
    
         
            +
                          [d["option-active"]]: x && !N
         
     | 
| 
      
 138 
     | 
    
         
            +
                        }),
         
     | 
| 
      
 139 
     | 
    
         
            +
                        "data-testid": `option-${m.id}`,
         
     | 
| 
      
 140 
     | 
    
         
            +
                        children: /* @__PURE__ */ $(D, { children: [
         
     | 
| 
      
 141 
     | 
    
         
            +
                          /* @__PURE__ */ n("div", { className: d["option-inner"], children: p(m) }),
         
     | 
| 
      
 142 
     | 
    
         
            +
                          v ? f && /* @__PURE__ */ n(
         
     | 
| 
      
 143 
     | 
    
         
            +
                            k,
         
     | 
| 
      
 144 
     | 
    
         
            +
                            {
         
     | 
| 
      
 145 
     | 
    
         
            +
                              iconName: i === j.L ? "Done24px" : "Done16px",
         
     | 
| 
      
 146 
     | 
    
         
            +
                              className: d["selected-icon"]
         
     | 
| 
      
 147 
     | 
    
         
            +
                            }
         
     | 
| 
      
 148 
     | 
    
         
            +
                          ) : /* @__PURE__ */ n(b, { isInteractive: !1, checked: f })
         
     | 
| 
      
 149 
     | 
    
         
            +
                        ] })
         
     | 
| 
      
 150 
     | 
    
         
            +
                      },
         
     | 
| 
      
 151 
     | 
    
         
            +
                      m.id
         
     | 
| 
      
 152 
     | 
    
         
            +
                    );
         
     | 
| 
      
 153 
     | 
    
         
            +
                  }
         
     | 
| 
      
 154 
     | 
    
         
            +
                }
         
     | 
| 
      
 155 
     | 
    
         
            +
              );
         
     | 
| 
      
 156 
     | 
    
         
            +
            }, Z = ({
         
     | 
| 
      
 157 
     | 
    
         
            +
              items: i,
         
     | 
| 
      
 158 
     | 
    
         
            +
              filteredItems: a,
         
     | 
| 
      
 159 
     | 
    
         
            +
              size: o,
         
     | 
| 
      
 160 
     | 
    
         
            +
              actualMenuPlacement: r,
         
     | 
| 
      
 161 
     | 
    
         
            +
              isVisible: e,
         
     | 
| 
      
 162 
     | 
    
         
            +
              noOptionsText: p,
         
     | 
| 
      
 163 
     | 
    
         
            +
              noMatchText: d,
         
     | 
| 
      
 164 
     | 
    
         
            +
              enableNestedSelection: N,
         
     | 
| 
      
 165 
     | 
    
         
            +
              renderNestedOptions: v,
         
     | 
| 
      
 166 
     | 
    
         
            +
              groupBy: t,
         
     | 
| 
      
 167 
     | 
    
         
            +
              parentRef: m,
         
     | 
| 
      
 168 
     | 
    
         
            +
              virtualItems: f,
         
     | 
| 
      
 169 
     | 
    
         
            +
              virtualizer: x,
         
     | 
| 
      
 170 
     | 
    
         
            +
              classNameOption: g,
         
     | 
| 
      
 171 
     | 
    
         
            +
              selectedItems: l,
         
     | 
| 
      
 172 
     | 
    
         
            +
              renderOptionContent: u,
         
     | 
| 
      
 173 
     | 
    
         
            +
              cls: s,
         
     | 
| 
      
 174 
     | 
    
         
            +
              useIconInsteadOfCheckbox: h = !1,
         
     | 
| 
      
 175 
     | 
    
         
            +
              highlightMatches: S = !1,
         
     | 
| 
      
 176 
     | 
    
         
            +
              internalSearchQuery: L,
         
     | 
| 
      
 177 
     | 
    
         
            +
              searchInHeaderGroupItems: G = !1
         
     | 
| 
      
 178 
     | 
    
         
            +
            }) => () => i.length ? a.length ? N ? F(
         
     | 
| 
      
 179 
     | 
    
         
            +
              o,
         
     | 
| 
      
 180 
     | 
    
         
            +
              r,
         
     | 
| 
      
 181 
     | 
    
         
            +
              e,
         
     | 
| 
      
 182 
     | 
    
         
            +
              a,
         
     | 
| 
      
 183 
     | 
    
         
            +
              v,
         
     | 
| 
      
 184 
     | 
    
         
            +
              s
         
     | 
| 
      
 185 
     | 
    
         
            +
            ) : t ? H(
         
     | 
| 
      
 186 
     | 
    
         
            +
              o,
         
     | 
| 
      
 187 
     | 
    
         
            +
              r,
         
     | 
| 
      
 188 
     | 
    
         
            +
              e,
         
     | 
| 
      
 189 
     | 
    
         
            +
              m,
         
     | 
| 
      
 190 
     | 
    
         
            +
              f,
         
     | 
| 
      
 191 
     | 
    
         
            +
              x,
         
     | 
| 
      
 192 
     | 
    
         
            +
              g,
         
     | 
| 
      
 193 
     | 
    
         
            +
              l,
         
     | 
| 
      
 194 
     | 
    
         
            +
              u,
         
     | 
| 
      
 195 
     | 
    
         
            +
              s,
         
     | 
| 
      
 196 
     | 
    
         
            +
              t,
         
     | 
| 
      
 197 
     | 
    
         
            +
              h,
         
     | 
| 
      
 198 
     | 
    
         
            +
              S,
         
     | 
| 
      
 199 
     | 
    
         
            +
              L,
         
     | 
| 
      
 200 
     | 
    
         
            +
              G
         
     | 
| 
      
 201 
     | 
    
         
            +
            ) : T(
         
     | 
| 
      
 202 
     | 
    
         
            +
              o,
         
     | 
| 
      
 203 
     | 
    
         
            +
              r,
         
     | 
| 
      
 204 
     | 
    
         
            +
              e,
         
     | 
| 
      
 205 
     | 
    
         
            +
              g,
         
     | 
| 
      
 206 
     | 
    
         
            +
              l,
         
     | 
| 
      
 207 
     | 
    
         
            +
              u,
         
     | 
| 
      
 208 
     | 
    
         
            +
              s,
         
     | 
| 
      
 209 
     | 
    
         
            +
              t,
         
     | 
| 
      
 210 
     | 
    
         
            +
              h
         
     | 
| 
      
 211 
     | 
    
         
            +
            ) : w(
         
     | 
| 
      
 212 
     | 
    
         
            +
              o,
         
     | 
| 
      
 213 
     | 
    
         
            +
              r,
         
     | 
| 
      
 214 
     | 
    
         
            +
              e,
         
     | 
| 
      
 215 
     | 
    
         
            +
              d,
         
     | 
| 
      
 216 
     | 
    
         
            +
              s
         
     | 
| 
      
 217 
     | 
    
         
            +
            ) : W(
         
     | 
| 
      
 218 
     | 
    
         
            +
              o,
         
     | 
| 
      
 219 
     | 
    
         
            +
              r,
         
     | 
| 
      
 220 
     | 
    
         
            +
              e,
         
     | 
| 
      
 221 
     | 
    
         
            +
              p,
         
     | 
| 
      
 222 
     | 
    
         
            +
              s
         
     | 
| 
      
 223 
     | 
    
         
            +
            );
         
     | 
| 
      
 224 
     | 
    
         
            +
            export {
         
     | 
| 
      
 225 
     | 
    
         
            +
              Z as useRenderVirtualizedList
         
     | 
| 
      
 226 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,17 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { TMultiSelectOption } from '../types';
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            export type TUseSearchProps = {
         
     | 
| 
      
 4 
     | 
    
         
            +
                filterOnSearch: boolean;
         
     | 
| 
      
 5 
     | 
    
         
            +
                items: TMultiSelectOption[];
         
     | 
| 
      
 6 
     | 
    
         
            +
                internalSearchQuery: string;
         
     | 
| 
      
 7 
     | 
    
         
            +
                selectedItems: TMultiSelectOption[];
         
     | 
| 
      
 8 
     | 
    
         
            +
                enableNestedSelection: boolean;
         
     | 
| 
      
 9 
     | 
    
         
            +
                searchInNestedItems?: boolean;
         
     | 
| 
      
 10 
     | 
    
         
            +
                displayValue: string;
         
     | 
| 
      
 11 
     | 
    
         
            +
                groupBy?: string;
         
     | 
| 
      
 12 
     | 
    
         
            +
                searchInHeaderGroupItems?: boolean;
         
     | 
| 
      
 13 
     | 
    
         
            +
            };
         
     | 
| 
      
 14 
     | 
    
         
            +
            export type TUseSearchReturn = {
         
     | 
| 
      
 15 
     | 
    
         
            +
                filteredItems: TMultiSelectOption[];
         
     | 
| 
      
 16 
     | 
    
         
            +
            };
         
     | 
| 
      
 17 
     | 
    
         
            +
            export declare const useSearch: ({ filterOnSearch, items, internalSearchQuery, selectedItems, enableNestedSelection, searchInNestedItems, displayValue, groupBy, searchInHeaderGroupItems }: TUseSearchProps) => TUseSearchReturn;
         
     |