@adamosuiteservices/ui 1.7.12 → 1.7.13
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/combobox.cjs +2 -2
- package/dist/combobox.js +256 -247
- package/package.json +1 -1
package/dist/combobox.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./jsx-runtime-BB_1_6y_.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./jsx-runtime-BB_1_6y_.cjs"),oe=require("react"),$=require("./index-DoxiiusW.cjs"),Ie=require("./button-DEQVHMrX.cjs"),ie=require("./index-BFyr34mw.cjs"),L=require("./index-CocSS1YK.cjs"),B=require("./index-WIv2ndLu.cjs"),ee=require("./index-_XxjJPRD.cjs"),Ce=require("./createLucideIcon-CAtnV-yz.cjs"),se=require("./popover-FCKBtFo-.cjs"),Ae=require("./checkbox-YWAnswaW.cjs"),Ne=require("./check-CLxNVljQ.cjs"),Pe=require("./chevron-down-BqEHzml5.cjs");function $e(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const p=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,p.get?p:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const a=$e(oe);/**
|
|
2
2
|
* @license lucide-react v0.546.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const qe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Me=Ce.createLucideIcon("search",qe);var ve=1,De=.9,Le=.8,Oe=.17,se=.1,ce=.999,Fe=.9999,Te=.99,ze=/[\\\/_+.#"@\[\(\{&]/,Ve=/[\\\/_+.#"@\[\(\{&]/g,Ke=/[\s-]/,be=/[\s-]/g;function fe(e,n,r,p,i,s,m){if(s===n.length)return i===e.length?ve:Te;var d=`${i},${s}`;if(m[d]!==void 0)return m[d];for(var b=p.charAt(s),o=r.indexOf(b,i),g=0,u,R,k,P;o>=0;)u=fe(e,n,r,p,o+1,s+1,m),u>g&&(o===i?u*=ve:ze.test(e.charAt(o-1))?(u*=Le,k=e.slice(i,o-1).match(Ve),k&&i>0&&(u*=Math.pow(ce,k.length))):Ke.test(e.charAt(o-1))?(u*=De,P=e.slice(i,o-1).match(be),P&&i>0&&(u*=Math.pow(ce,P.length))):(u*=Oe,i>0&&(u*=Math.pow(ce,o-i))),e.charAt(o)!==n.charAt(s)&&(u*=Fe)),(u<se&&r.charAt(o-1)===p.charAt(s+1)||p.charAt(s+1)===p.charAt(s)&&r.charAt(o-1)!==p.charAt(s))&&(R=fe(e,n,r,p,o+1,s+2,m),R*se>u&&(u=R*se)),u>g&&(g=u),o=r.indexOf(b,o+1);return m[d]=g,g}function xe(e){return e.toLowerCase().replace(be," ")}function _e(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,fe(e,n,xe(e),xe(n),0,0,{})}var ee='[cmdk-group=""]',de='[cmdk-group-items=""]',Be='[cmdk-group-heading=""]',ye='[cmdk-item=""]',ge=`${ye}:not([aria-disabled="true"])`,pe="cmdk-item-select",_="data-value",Ge=(e,n,r)=>_e(e,n,r),je=a.createContext(void 0),re=()=>a.useContext(je),Ee=a.createContext(void 0),he=()=>a.useContext(Ee),Re=a.createContext(void 0),ke=a.forwardRef((e,n)=>{let r=B(()=>{var t,c;return{search:"",value:(c=(t=e.value)!=null?t:e.defaultValue)!=null?c:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),p=B(()=>new Set),i=B(()=>new Map),s=B(()=>new Map),m=B(()=>new Set),d=we(e),{label:b,children:o,value:g,onValueChange:u,filter:R,shouldFilter:k,loop:P,disablePointerSelection:H=!1,vimBindings:x=!0,...W}=e,A=G.useId(),J=G.useId(),L=G.useId(),I=a.useRef(null),j=rt();T(()=>{if(g!==void 0){let t=g.trim();r.current.value=t,w.emit()}},[g]),T(()=>{j(6,ne)},[]);let w=a.useMemo(()=>({subscribe:t=>(m.current.add(t),()=>m.current.delete(t)),snapshot:()=>r.current,setState:(t,c,v)=>{var l,y,E,C;if(!Object.is(r.current[t],c)){if(r.current[t]=c,t==="search")V(),O(),j(1,Y);else if(t==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let S=document.getElementById(L);S?S.focus():(l=document.getElementById(A))==null||l.focus()}if(j(7,()=>{var S;r.current.selectedItemId=(S=q())==null?void 0:S.id,w.emit()}),v||j(5,ne),((y=d.current)==null?void 0:y.value)!==void 0){let S=c??"";(C=(E=d.current).onValueChange)==null||C.call(E,S);return}}w.emit()}},emit:()=>{m.current.forEach(t=>t())}}),[]),z=a.useMemo(()=>({value:(t,c,v)=>{var l;c!==((l=s.current.get(t))==null?void 0:l.value)&&(s.current.set(t,{value:c,keywords:v}),r.current.filtered.items.set(t,X(c,v)),j(2,()=>{O(),w.emit()}))},item:(t,c)=>(p.current.add(t),c&&(i.current.has(c)?i.current.get(c).add(t):i.current.set(c,new Set([t]))),j(3,()=>{V(),O(),r.current.value||Y(),w.emit()}),()=>{s.current.delete(t),p.current.delete(t),r.current.filtered.items.delete(t);let v=q();j(4,()=>{V(),v?.getAttribute("id")===t&&Y(),w.emit()})}),group:t=>(i.current.has(t)||i.current.set(t,new Set),()=>{s.current.delete(t),i.current.delete(t)}),filter:()=>d.current.shouldFilter,label:b||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:A,inputId:L,labelId:J,listInnerRef:I}),[]);function X(t,c){var v,l;let y=(l=(v=d.current)==null?void 0:v.filter)!=null?l:Ge;return t?y(t,r.current.search,c):0}function O(){if(!r.current.search||d.current.shouldFilter===!1)return;let t=r.current.filtered.items,c=[];r.current.filtered.groups.forEach(l=>{let y=i.current.get(l),E=0;y.forEach(C=>{let S=t.get(C);E=Math.max(S,E)}),c.push([l,E])});let v=I.current;F().sort((l,y)=>{var E,C;let S=l.getAttribute("id"),le=y.getAttribute("id");return((E=t.get(le))!=null?E:0)-((C=t.get(S))!=null?C:0)}).forEach(l=>{let y=l.closest(de);y?y.appendChild(l.parentElement===y?l:l.closest(`${de} > *`)):v.appendChild(l.parentElement===v?l:l.closest(`${de} > *`))}),c.sort((l,y)=>y[1]-l[1]).forEach(l=>{var y;let E=(y=I.current)==null?void 0:y.querySelector(`${ee}[${_}="${encodeURIComponent(l[0])}"]`);E?.parentElement.appendChild(E)})}function Y(){let t=F().find(v=>v.getAttribute("aria-disabled")!=="true"),c=t?.getAttribute(_);w.setState("value",c||void 0)}function V(){var t,c,v,l;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=p.current.size;return}r.current.filtered.groups=new Set;let y=0;for(let E of p.current){let C=(c=(t=s.current.get(E))==null?void 0:t.value)!=null?c:"",S=(l=(v=s.current.get(E))==null?void 0:v.keywords)!=null?l:[],le=X(C,S);r.current.filtered.items.set(E,le),le>0&&y++}for(let[E,C]of i.current)for(let S of C)if(r.current.filtered.items.get(S)>0){r.current.filtered.groups.add(E);break}r.current.filtered.count=y}function ne(){var t,c,v;let l=q();l&&(((t=l.parentElement)==null?void 0:t.firstChild)===l&&((v=(c=l.closest(ee))==null?void 0:c.querySelector(Be))==null||v.scrollIntoView({block:"nearest"})),l.scrollIntoView({block:"nearest"}))}function q(){var t;return(t=I.current)==null?void 0:t.querySelector(`${ye}[aria-selected="true"]`)}function F(){var t;return Array.from(((t=I.current)==null?void 0:t.querySelectorAll(ge))||[])}function Q(t){let c=F()[t];c&&w.setState("value",c.getAttribute(_))}function Z(t){var c;let v=q(),l=F(),y=l.findIndex(C=>C===v),E=l[y+t];(c=d.current)!=null&&c.loop&&(E=y+t<0?l[l.length-1]:y+t===l.length?l[0]:l[y+t]),E&&w.setState("value",E.getAttribute(_))}function ae(t){let c=q(),v=c?.closest(ee),l;for(;v&&!l;)v=t>0?et(v,ee):tt(v,ee),l=v?.querySelector(ge);l?w.setState("value",l.getAttribute(_)):Z(t)}let f=()=>Q(F().length-1),N=t=>{t.preventDefault(),t.metaKey?f():t.altKey?ae(1):Z(1)},K=t=>{t.preventDefault(),t.metaKey?Q(0):t.altKey?ae(-1):Z(-1)};return a.createElement(D.Primitive.div,{ref:n,tabIndex:-1,...W,"cmdk-root":"",onKeyDown:t=>{var c;(c=W.onKeyDown)==null||c.call(W,t);let v=t.nativeEvent.isComposing||t.keyCode===229;if(!(t.defaultPrevented||v))switch(t.key){case"n":case"j":{x&&t.ctrlKey&&N(t);break}case"ArrowDown":{N(t);break}case"p":case"k":{x&&t.ctrlKey&&K(t);break}case"ArrowUp":{K(t);break}case"Home":{t.preventDefault(),Q(0);break}case"End":{t.preventDefault(),f();break}case"Enter":{t.preventDefault();let l=q();if(l){let y=new Event(pe);l.dispatchEvent(y)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:at},b),oe(e,t=>a.createElement(Ee.Provider,{value:w},a.createElement(je.Provider,{value:z},t))))}),Ue=a.forwardRef((e,n)=>{var r,p;let i=G.useId(),s=a.useRef(null),m=a.useContext(Re),d=re(),b=we(e),o=(p=(r=b.current)==null?void 0:r.forceMount)!=null?p:m?.forceMount;T(()=>{if(!o)return d.item(i,m?.id)},[o]);let g=Se(i,s,[e.value,e.children,s],e.keywords),u=he(),R=M(j=>j.value&&j.value===g.current),k=M(j=>o||d.filter()===!1?!0:j.search?j.filtered.items.get(i)>0:!0);a.useEffect(()=>{let j=s.current;if(!(!j||e.disabled))return j.addEventListener(pe,P),()=>j.removeEventListener(pe,P)},[k,e.onSelect,e.disabled]);function P(){var j,w;H(),(w=(j=b.current).onSelect)==null||w.call(j,g.current)}function H(){u.setState("value",g.current,!0)}if(!k)return null;let{disabled:x,value:W,onSelect:A,forceMount:J,keywords:L,...I}=e;return a.createElement(D.Primitive.div,{ref:te.composeRefs(s,n),...I,id:i,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!R,"data-disabled":!!x,"data-selected":!!R,onPointerMove:x||d.getDisablePointerSelection()?void 0:H,onClick:x?void 0:P},e.children)}),He=a.forwardRef((e,n)=>{let{heading:r,children:p,forceMount:i,...s}=e,m=G.useId(),d=a.useRef(null),b=a.useRef(null),o=G.useId(),g=re(),u=M(k=>i||g.filter()===!1?!0:k.search?k.filtered.groups.has(m):!0);T(()=>g.group(m),[]),Se(m,d,[e.value,e.heading,b]);let R=a.useMemo(()=>({id:m,forceMount:i}),[i]);return a.createElement(D.Primitive.div,{ref:te.composeRefs(d,n),...s,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},r&&a.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:o},r),oe(e,k=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?o:void 0},a.createElement(Re.Provider,{value:R},k))))}),We=a.forwardRef((e,n)=>{let{alwaysRender:r,...p}=e,i=a.useRef(null),s=M(m=>!m.search);return!r&&!s?null:a.createElement(D.Primitive.div,{ref:te.composeRefs(i,n),...p,"cmdk-separator":"",role:"separator"})}),Je=a.forwardRef((e,n)=>{let{onValueChange:r,...p}=e,i=e.value!=null,s=he(),m=M(o=>o.search),d=M(o=>o.selectedItemId),b=re();return a.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),a.createElement(D.Primitive.input,{ref:n,...p,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":d,id:b.inputId,type:"text",value:i?e.value:m,onChange:o=>{i||s.setState("search",o.target.value),r?.(o.target.value)}})}),Xe=a.forwardRef((e,n)=>{let{children:r,label:p="Suggestions",...i}=e,s=a.useRef(null),m=a.useRef(null),d=M(o=>o.selectedItemId),b=re();return a.useEffect(()=>{if(m.current&&s.current){let o=m.current,g=s.current,u,R=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let k=o.offsetHeight;g.style.setProperty("--cmdk-list-height",k.toFixed(1)+"px")})});return R.observe(o),()=>{cancelAnimationFrame(u),R.unobserve(o)}}},[]),a.createElement(D.Primitive.div,{ref:te.composeRefs(s,n),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":p,id:b.listId},oe(e,o=>a.createElement("div",{ref:te.composeRefs(m,b.listInnerRef),"cmdk-list-sizer":""},o)))}),Ye=a.forwardRef((e,n)=>{let{open:r,onOpenChange:p,overlayClassName:i,contentClassName:s,container:m,...d}=e;return a.createElement(ie.Root,{open:r,onOpenChange:p},a.createElement(ie.Portal,{container:m},a.createElement(ie.Overlay,{"cmdk-overlay":"",className:i}),a.createElement(ie.Content,{"aria-label":e.label,"cmdk-dialog":"",className:s},a.createElement(ke,{ref:n,...d}))))}),Qe=a.forwardRef((e,n)=>M(r=>r.filtered.count===0)?a.createElement(D.Primitive.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),Ze=a.forwardRef((e,n)=>{let{progress:r,children:p,label:i="Loading...",...s}=e;return a.createElement(D.Primitive.div,{ref:n,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},oe(e,m=>a.createElement("div",{"aria-hidden":!0},m)))}),U=Object.assign(ke,{List:Xe,Item:Ue,Input:Je,Group:He,Separator:We,Dialog:Ye,Empty:Qe,Loading:Ze});function et(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function tt(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function we(e){let n=a.useRef(e);return T(()=>{n.current=e}),n}var T=typeof window>"u"?a.useEffect:a.useLayoutEffect;function B(e){let n=a.useRef();return n.current===void 0&&(n.current=e()),n}function M(e){let n=he(),r=()=>e(n.snapshot());return a.useSyncExternalStore(n.subscribe,r,r)}function Se(e,n,r,p=[]){let i=a.useRef(),s=re();return T(()=>{var m;let d=(()=>{var o;for(let g of r){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(o=g.current.textContent)==null?void 0:o.trim():i.current}})(),b=p.map(o=>o.trim());s.value(e,d,b),(m=n.current)==null||m.setAttribute(_,d),i.current=d}),i}var rt=()=>{let[e,n]=a.useState(),r=B(()=>new Map);return T(()=>{r.current.forEach(p=>p()),r.current=new Map},[e]),(p,i)=>{r.current.set(p,i),n({})}};function nt(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function oe({asChild:e,children:n},r){return e&&a.isValidElement(n)?a.cloneElement(nt(n),{ref:n.ref},r(n.props.children)):r(n)}var at={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function lt({className:e,...n}){return h.jsxRuntimeExports.jsx(U,{"data-slot":"command",className:$.cn("adm:bg-popover adm:text-popover-foreground adm:flex adm:h-full adm:w-full adm:flex-col adm:overflow-hidden adm:rounded-md",e),...n})}function it({className:e,...n}){return h.jsxRuntimeExports.jsxs("div",{"data-slot":"command-input-wrapper",className:"adm:flex adm:h-9 adm:items-center adm:gap-2 adm:border-b adm:px-3",children:[h.jsxRuntimeExports.jsx(Me,{className:"adm:size-4 adm:shrink-0 adm:opacity-50"}),h.jsxRuntimeExports.jsx(U.Input,{"data-slot":"command-input",className:$.cn("adm:placeholder:text-muted-foreground adm:flex adm:h-10 adm:w-full adm:rounded-md adm:bg-transparent adm:py-3 adm:text-sm adm:outline-hidden adm:disabled:cursor-not-allowed adm:disabled:opacity-50",e),...n})]})}function ot({className:e,...n}){return h.jsxRuntimeExports.jsx(U.List,{"data-slot":"command-list",className:$.cn("adm:max-h-[300px] adm:scroll-py-1 adm:overflow-x-hidden adm:overflow-y-auto",e),...n})}function ut({className:e,...n}){return h.jsxRuntimeExports.jsx(U.Empty,{"data-slot":"command-empty",className:$.cn("adm:py-6 adm:text-center adm:text-sm",e),...n})}function st({className:e,...n}){return h.jsxRuntimeExports.jsx(U.Group,{"data-slot":"command-group",className:$.cn("adm:text-foreground adm:overflow-hidden adm:p-1 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-muted-foreground adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:px-2 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:py-1.5 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-xs adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:font-medium",e),...n})}function ct({className:e,...n}){return h.jsxRuntimeExports.jsx(U.Item,{"data-slot":"command-item",className:$.cn("adm:data-[selected=true]:bg-accent adm:data-[selected=true]:text-accent-foreground adm:[&_svg:not([class*=text-])]:text-muted-foreground adm:relative adm:flex adm:cursor-default adm:items-center adm:gap-2 adm:rounded-sm adm:px-2 adm:py-1.5 adm:text-sm adm:outline-hidden adm:select-none adm:data-[disabled=true]:pointer-events-none adm:data-[disabled=true]:opacity-50 adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0 adm:[&_svg:not([class*=size-])]:size-4",e),...n})}function dt({searchable:e,multiple:n,icon:r,value:p,onValueChange:i,labels:s,options:m,classNames:d,selectedFeedback:b="checkbox",alwaysShowPlaceholder:o=!1,valuePosition:g="right",renders:u}){const[R,k]=me.useState(!1),[P,H]=me.useState(n?[]:""),x=p!==void 0?p:P,A={...{placeholder:"Select options...",searchPlaceholder:"Search options...",noItemsFound:"No options found.",multipleSelected:f=>`${f} options selected`},...s},J=f=>{i?i(f):H(f)},L=()=>n&&Array.isArray(x)?x.length===0?null:x.length===1?m.find(f=>f.value===x[0])?.label:A.multipleSelected?.(x.length)||`${x.length} options selected`:!n&&typeof x=="string"&&x?m.find(f=>f.value===x)?.label:null,I=()=>n&&Array.isArray(x)?x.length>0:typeof x=="string"&&x!=="",j=f=>n&&Array.isArray(x)?x.includes(f):x===f,w=f=>{if(n){const N=Array.isArray(x)?x:[],K=N.includes(f)?N.filter(t=>t!==f):[...N,f];J(K)}else J(f===x?"":f),k(!1)},z=f=>{const N=j(f),K=m.find(t=>t.value===f);return u?.selectedFeedback?u.selectedFeedback({option:K,isSelected:N,type:b}):b==="check"?h.jsxRuntimeExports.jsx("span",{className:$.cn("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center",d?.check),children:N&&h.jsxRuntimeExports.jsx(Ne.Check,{className:"adm:size-4"})}):h.jsxRuntimeExports.jsx(Ae.Checkbox,{checked:N,className:d?.checkbox})},X=()=>u?.placeholder?u.placeholder({text:A.placeholder||"",hasValue:I()}):h.jsxRuntimeExports.jsx("span",{className:"adm:opacity-70",children:A.placeholder}),O=()=>u?.displayValue?u.displayValue({text:L()??null,value:x}):h.jsxRuntimeExports.jsx("span",{children:L()}),Y=()=>o?h.jsxRuntimeExports.jsxs("span",{className:"adm:flex adm:items-center adm:gap-2",children:[r&&h.jsxRuntimeExports.jsx(r,{className:"adm:opacity-50"}),X(),I()&&g==="left"&&O()]}):h.jsxRuntimeExports.jsxs("span",{className:"adm:flex adm:items-center adm:gap-2",children:[r&&h.jsxRuntimeExports.jsx(r,{className:"adm:opacity-50"}),I()?O():X()]}),V=()=>u?.triggerIcon?u.triggerIcon({open:R}):h.jsxRuntimeExports.jsx(Pe.ChevronDown,{className:"adm:size-4 adm:opacity-50"}),ne=()=>o&&I()&&g==="right"?h.jsxRuntimeExports.jsxs("span",{className:"adm:flex adm:items-center adm:gap-2",children:[O(),V()]}):h.jsxRuntimeExports.jsx("span",{className:"adm:flex adm:items-center adm:gap-2",children:V()}),q=()=>u?.trigger?u.trigger({open:R,value:x,displayText:L()??null,placeholder:A.placeholder||"",hasValue:I(),icon:r}):h.jsxRuntimeExports.jsxs(Ie.Button,{variant:"outline",role:"combobox","aria-expanded":R,className:$.cn("adm:justify-between adm:font-normal",d?.trigger),children:[Y(),ne()]}),F=()=>e?u?.searchInput?u.searchInput({placeholder:A.searchPlaceholder||""}):h.jsxRuntimeExports.jsx(it,{placeholder:A.searchPlaceholder,className:d?.input}):null,Q=()=>u?.empty?u.empty({text:A.noItemsFound||""}):h.jsxRuntimeExports.jsx(h.jsxRuntimeExports.Fragment,{children:A.noItemsFound}),Z=f=>u?.optionLabel?u.optionLabel({option:f}):h.jsxRuntimeExports.jsx(h.jsxRuntimeExports.Fragment,{children:f.label}),ae=f=>u?.option?h.jsxRuntimeExports.jsx("div",{children:u.option({option:f,isSelected:j(f.value),selectedFeedback:b})},f.value):h.jsxRuntimeExports.jsxs(ct,{value:f.value,onSelect:w,disabled:f.disabled,className:$.cn(d?.item,b==="check"&&"adm:pr-8"),children:[b==="checkbox"&&z(f.value),Z(f),b==="check"&&z(f.value)]},f.value);return h.jsxRuntimeExports.jsxs(ue.Popover,{open:R,onOpenChange:k,children:[h.jsxRuntimeExports.jsx(ue.PopoverTrigger,{asChild:!0,children:q()}),h.jsxRuntimeExports.jsx(ue.PopoverContent,{align:"start",className:$.cn("adm:p-0",d?.popover),children:h.jsxRuntimeExports.jsxs(lt,{className:d?.command,children:[F(),h.jsxRuntimeExports.jsxs(ot,{className:d?.list,children:[h.jsxRuntimeExports.jsx(ut,{className:d?.empty,children:Q()}),h.jsxRuntimeExports.jsx(st,{className:d?.group,children:m.map(f=>ae(f))})]})]})})]})}exports.Combobox=dt;
|
|
6
|
+
*/const qe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Me=Ce.createLucideIcon("search",qe);var ve=1,De=.9,Le=.8,Oe=.17,ce=.1,de=.999,Fe=.9999,Te=.99,ze=/[\\\/_+.#"@\[\(\{&]/,Ve=/[\\\/_+.#"@\[\(\{&]/g,Ke=/[\s-]/,be=/[\s-]/g;function fe(e,n,r,p,i,c,m){if(c===n.length)return i===e.length?ve:Te;var d=`${i},${c}`;if(m[d]!==void 0)return m[d];for(var g=p.charAt(c),o=r.indexOf(g,i),x=0,s,w,R,C;o>=0;)s=fe(e,n,r,p,o+1,c+1,m),s>x&&(o===i?s*=ve:ze.test(e.charAt(o-1))?(s*=Le,R=e.slice(i,o-1).match(Ve),R&&i>0&&(s*=Math.pow(de,R.length))):Ke.test(e.charAt(o-1))?(s*=De,C=e.slice(i,o-1).match(be),C&&i>0&&(s*=Math.pow(de,C.length))):(s*=Oe,i>0&&(s*=Math.pow(de,o-i))),e.charAt(o)!==n.charAt(c)&&(s*=Fe)),(s<ce&&r.charAt(o-1)===p.charAt(c+1)||p.charAt(c+1)===p.charAt(c)&&r.charAt(o-1)!==p.charAt(c))&&(w=fe(e,n,r,p,o+1,c+2,m),w*ce>s&&(s=w*ce)),s>x&&(x=s),o=r.indexOf(g,o+1);return m[d]=x,x}function xe(e){return e.toLowerCase().replace(be," ")}function _e(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,fe(e,n,xe(e),xe(n),0,0,{})}var Z='[cmdk-group=""]',me='[cmdk-group-items=""]',Be='[cmdk-group-heading=""]',ye='[cmdk-item=""]',ge=`${ye}:not([aria-disabled="true"])`,pe="cmdk-item-select",K="data-value",We=(e,n,r)=>_e(e,n,r),je=a.createContext(void 0),te=()=>a.useContext(je),Ee=a.createContext(void 0),he=()=>a.useContext(Ee),Re=a.createContext(void 0),ke=a.forwardRef((e,n)=>{let r=_(()=>{var t,u;return{search:"",value:(u=(t=e.value)!=null?t:e.defaultValue)!=null?u:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),p=_(()=>new Set),i=_(()=>new Map),c=_(()=>new Map),m=_(()=>new Set),d=we(e),{label:g,children:o,value:x,onValueChange:s,filter:w,shouldFilter:R,loop:C,disablePointerSelection:G=!1,vimBindings:q=!0,...y}=e,re=B.useId(),A=B.useId(),z=B.useId(),N=a.useRef(null),j=rt();T(()=>{if(x!==void 0){let t=x.trim();r.current.value=t,k.emit()}},[x]),T(()=>{j(6,X)},[]);let k=a.useMemo(()=>({subscribe:t=>(m.current.add(t),()=>m.current.delete(t)),snapshot:()=>r.current,setState:(t,u,v)=>{var l,b,E,I;if(!Object.is(r.current[t],u)){if(r.current[t]=u,t==="search")J(),V(),j(1,O);else if(t==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let S=document.getElementById(z);S?S.focus():(l=document.getElementById(re))==null||l.focus()}if(j(7,()=>{var S;r.current.selectedItemId=(S=M())==null?void 0:S.id,k.emit()}),v||j(5,X),((b=d.current)==null?void 0:b.value)!==void 0){let S=u??"";(I=(E=d.current).onValueChange)==null||I.call(E,S);return}}k.emit()}},emit:()=>{m.current.forEach(t=>t())}}),[]),U=a.useMemo(()=>({value:(t,u,v)=>{var l;u!==((l=c.current.get(t))==null?void 0:l.value)&&(c.current.set(t,{value:u,keywords:v}),r.current.filtered.items.set(t,H(u,v)),j(2,()=>{V(),k.emit()}))},item:(t,u)=>(p.current.add(t),u&&(i.current.has(u)?i.current.get(u).add(t):i.current.set(u,new Set([t]))),j(3,()=>{J(),V(),r.current.value||O(),k.emit()}),()=>{c.current.delete(t),p.current.delete(t),r.current.filtered.items.delete(t);let v=M();j(4,()=>{J(),v?.getAttribute("id")===t&&O(),k.emit()})}),group:t=>(i.current.has(t)||i.current.set(t,new Set),()=>{c.current.delete(t),i.current.delete(t)}),filter:()=>d.current.shouldFilter,label:g||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:re,inputId:z,labelId:A,listInnerRef:N}),[]);function H(t,u){var v,l;let b=(l=(v=d.current)==null?void 0:v.filter)!=null?l:We;return t?b(t,r.current.search,u):0}function V(){if(!r.current.search||d.current.shouldFilter===!1)return;let t=r.current.filtered.items,u=[];r.current.filtered.groups.forEach(l=>{let b=i.current.get(l),E=0;b.forEach(I=>{let S=t.get(I);E=Math.max(S,E)}),u.push([l,E])});let v=N.current;F().sort((l,b)=>{var E,I;let S=l.getAttribute("id"),le=b.getAttribute("id");return((E=t.get(le))!=null?E:0)-((I=t.get(S))!=null?I:0)}).forEach(l=>{let b=l.closest(me);b?b.appendChild(l.parentElement===b?l:l.closest(`${me} > *`)):v.appendChild(l.parentElement===v?l:l.closest(`${me} > *`))}),u.sort((l,b)=>b[1]-l[1]).forEach(l=>{var b;let E=(b=N.current)==null?void 0:b.querySelector(`${Z}[${K}="${encodeURIComponent(l[0])}"]`);E?.parentElement.appendChild(E)})}function O(){let t=F().find(v=>v.getAttribute("aria-disabled")!=="true"),u=t?.getAttribute(K);k.setState("value",u||void 0)}function J(){var t,u,v,l;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=p.current.size;return}r.current.filtered.groups=new Set;let b=0;for(let E of p.current){let I=(u=(t=c.current.get(E))==null?void 0:t.value)!=null?u:"",S=(l=(v=c.current.get(E))==null?void 0:v.keywords)!=null?l:[],le=H(I,S);r.current.filtered.items.set(E,le),le>0&&b++}for(let[E,I]of i.current)for(let S of I)if(r.current.filtered.items.get(S)>0){r.current.filtered.groups.add(E);break}r.current.filtered.count=b}function X(){var t,u,v;let l=M();l&&(((t=l.parentElement)==null?void 0:t.firstChild)===l&&((v=(u=l.closest(Z))==null?void 0:u.querySelector(Be))==null||v.scrollIntoView({block:"nearest"})),l.scrollIntoView({block:"nearest"}))}function M(){var t;return(t=N.current)==null?void 0:t.querySelector(`${ye}[aria-selected="true"]`)}function F(){var t;return Array.from(((t=N.current)==null?void 0:t.querySelectorAll(ge))||[])}function Y(t){let u=F()[t];u&&k.setState("value",u.getAttribute(K))}function Q(t){var u;let v=M(),l=F(),b=l.findIndex(I=>I===v),E=l[b+t];(u=d.current)!=null&&u.loop&&(E=b+t<0?l[l.length-1]:b+t===l.length?l[0]:l[b+t]),E&&k.setState("value",E.getAttribute(K))}function ne(t){let u=M(),v=u?.closest(Z),l;for(;v&&!l;)v=t>0?et(v,Z):tt(v,Z),l=v?.querySelector(ge);l?k.setState("value",l.getAttribute(K)):Q(t)}let ae=()=>Y(F().length-1),f=t=>{t.preventDefault(),t.metaKey?ae():t.altKey?ne(1):Q(1)},P=t=>{t.preventDefault(),t.metaKey?Y(0):t.altKey?ne(-1):Q(-1)};return a.createElement(L.Primitive.div,{ref:n,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:t=>{var u;(u=y.onKeyDown)==null||u.call(y,t);let v=t.nativeEvent.isComposing||t.keyCode===229;if(!(t.defaultPrevented||v))switch(t.key){case"n":case"j":{q&&t.ctrlKey&&f(t);break}case"ArrowDown":{f(t);break}case"p":case"k":{q&&t.ctrlKey&&P(t);break}case"ArrowUp":{P(t);break}case"Home":{t.preventDefault(),Y(0);break}case"End":{t.preventDefault(),ae();break}case"Enter":{t.preventDefault();let l=M();if(l){let b=new Event(pe);l.dispatchEvent(b)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:at},g),ue(e,t=>a.createElement(Ee.Provider,{value:k},a.createElement(je.Provider,{value:U},t))))}),Ge=a.forwardRef((e,n)=>{var r,p;let i=B.useId(),c=a.useRef(null),m=a.useContext(Re),d=te(),g=we(e),o=(p=(r=g.current)==null?void 0:r.forceMount)!=null?p:m?.forceMount;T(()=>{if(!o)return d.item(i,m?.id)},[o]);let x=Se(i,c,[e.value,e.children,c],e.keywords),s=he(),w=D(j=>j.value&&j.value===x.current),R=D(j=>o||d.filter()===!1?!0:j.search?j.filtered.items.get(i)>0:!0);a.useEffect(()=>{let j=c.current;if(!(!j||e.disabled))return j.addEventListener(pe,C),()=>j.removeEventListener(pe,C)},[R,e.onSelect,e.disabled]);function C(){var j,k;G(),(k=(j=g.current).onSelect)==null||k.call(j,x.current)}function G(){s.setState("value",x.current,!0)}if(!R)return null;let{disabled:q,value:y,onSelect:re,forceMount:A,keywords:z,...N}=e;return a.createElement(L.Primitive.div,{ref:ee.composeRefs(c,n),...N,id:i,"cmdk-item":"",role:"option","aria-disabled":!!q,"aria-selected":!!w,"data-disabled":!!q,"data-selected":!!w,onPointerMove:q||d.getDisablePointerSelection()?void 0:G,onClick:q?void 0:C},e.children)}),Ue=a.forwardRef((e,n)=>{let{heading:r,children:p,forceMount:i,...c}=e,m=B.useId(),d=a.useRef(null),g=a.useRef(null),o=B.useId(),x=te(),s=D(R=>i||x.filter()===!1?!0:R.search?R.filtered.groups.has(m):!0);T(()=>x.group(m),[]),Se(m,d,[e.value,e.heading,g]);let w=a.useMemo(()=>({id:m,forceMount:i}),[i]);return a.createElement(L.Primitive.div,{ref:ee.composeRefs(d,n),...c,"cmdk-group":"",role:"presentation",hidden:s?void 0:!0},r&&a.createElement("div",{ref:g,"cmdk-group-heading":"","aria-hidden":!0,id:o},r),ue(e,R=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?o:void 0},a.createElement(Re.Provider,{value:w},R))))}),He=a.forwardRef((e,n)=>{let{alwaysRender:r,...p}=e,i=a.useRef(null),c=D(m=>!m.search);return!r&&!c?null:a.createElement(L.Primitive.div,{ref:ee.composeRefs(i,n),...p,"cmdk-separator":"",role:"separator"})}),Je=a.forwardRef((e,n)=>{let{onValueChange:r,...p}=e,i=e.value!=null,c=he(),m=D(o=>o.search),d=D(o=>o.selectedItemId),g=te();return a.useEffect(()=>{e.value!=null&&c.setState("search",e.value)},[e.value]),a.createElement(L.Primitive.input,{ref:n,...p,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":g.listId,"aria-labelledby":g.labelId,"aria-activedescendant":d,id:g.inputId,type:"text",value:i?e.value:m,onChange:o=>{i||c.setState("search",o.target.value),r?.(o.target.value)}})}),Xe=a.forwardRef((e,n)=>{let{children:r,label:p="Suggestions",...i}=e,c=a.useRef(null),m=a.useRef(null),d=D(o=>o.selectedItemId),g=te();return a.useEffect(()=>{if(m.current&&c.current){let o=m.current,x=c.current,s,w=new ResizeObserver(()=>{s=requestAnimationFrame(()=>{let R=o.offsetHeight;x.style.setProperty("--cmdk-list-height",R.toFixed(1)+"px")})});return w.observe(o),()=>{cancelAnimationFrame(s),w.unobserve(o)}}},[]),a.createElement(L.Primitive.div,{ref:ee.composeRefs(c,n),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":p,id:g.listId},ue(e,o=>a.createElement("div",{ref:ee.composeRefs(m,g.listInnerRef),"cmdk-list-sizer":""},o)))}),Ye=a.forwardRef((e,n)=>{let{open:r,onOpenChange:p,overlayClassName:i,contentClassName:c,container:m,...d}=e;return a.createElement(ie.Root,{open:r,onOpenChange:p},a.createElement(ie.Portal,{container:m},a.createElement(ie.Overlay,{"cmdk-overlay":"",className:i}),a.createElement(ie.Content,{"aria-label":e.label,"cmdk-dialog":"",className:c},a.createElement(ke,{ref:n,...d}))))}),Qe=a.forwardRef((e,n)=>D(r=>r.filtered.count===0)?a.createElement(L.Primitive.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),Ze=a.forwardRef((e,n)=>{let{progress:r,children:p,label:i="Loading...",...c}=e;return a.createElement(L.Primitive.div,{ref:n,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ue(e,m=>a.createElement("div",{"aria-hidden":!0},m)))}),W=Object.assign(ke,{List:Xe,Item:Ge,Input:Je,Group:Ue,Separator:He,Dialog:Ye,Empty:Qe,Loading:Ze});function et(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function tt(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function we(e){let n=a.useRef(e);return T(()=>{n.current=e}),n}var T=typeof window>"u"?a.useEffect:a.useLayoutEffect;function _(e){let n=a.useRef();return n.current===void 0&&(n.current=e()),n}function D(e){let n=he(),r=()=>e(n.snapshot());return a.useSyncExternalStore(n.subscribe,r,r)}function Se(e,n,r,p=[]){let i=a.useRef(),c=te();return T(()=>{var m;let d=(()=>{var o;for(let x of r){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(o=x.current.textContent)==null?void 0:o.trim():i.current}})(),g=p.map(o=>o.trim());c.value(e,d,g),(m=n.current)==null||m.setAttribute(K,d),i.current=d}),i}var rt=()=>{let[e,n]=a.useState(),r=_(()=>new Map);return T(()=>{r.current.forEach(p=>p()),r.current=new Map},[e]),(p,i)=>{r.current.set(p,i),n({})}};function nt(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function ue({asChild:e,children:n},r){return e&&a.isValidElement(n)?a.cloneElement(nt(n),{ref:n.ref},r(n.props.children)):r(n)}var at={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function lt({className:e,...n}){return h.jsxRuntimeExports.jsx(W,{"data-slot":"command",className:$.cn("adm:bg-popover adm:text-popover-foreground adm:flex adm:h-full adm:w-full adm:flex-col adm:overflow-hidden adm:rounded-md",e),...n})}function it({className:e,...n}){return h.jsxRuntimeExports.jsxs("div",{"data-slot":"command-input-wrapper",className:"adm:flex adm:h-9 adm:items-center adm:gap-2 adm:border-b adm:px-3",children:[h.jsxRuntimeExports.jsx(Me,{className:"adm:size-4 adm:shrink-0 adm:opacity-50"}),h.jsxRuntimeExports.jsx(W.Input,{"data-slot":"command-input",className:$.cn("adm:placeholder:text-muted-foreground adm:flex adm:h-10 adm:w-full adm:rounded-md adm:bg-transparent adm:py-3 adm:text-sm adm:outline-hidden adm:disabled:cursor-not-allowed adm:disabled:opacity-50",e),...n})]})}function ot({className:e,...n}){return h.jsxRuntimeExports.jsx(W.List,{"data-slot":"command-list",className:$.cn("adm:max-h-[300px] adm:scroll-py-1 adm:overflow-x-hidden adm:overflow-y-auto",e),...n})}function ut({className:e,...n}){return h.jsxRuntimeExports.jsx(W.Empty,{"data-slot":"command-empty",className:$.cn("adm:py-6 adm:text-center adm:text-sm",e),...n})}function st({className:e,...n}){return h.jsxRuntimeExports.jsx(W.Group,{"data-slot":"command-group",className:$.cn("adm:text-foreground adm:overflow-hidden adm:p-1 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-muted-foreground adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:px-2 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:py-1.5 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-xs adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:font-medium",e),...n})}function ct({className:e,...n}){return h.jsxRuntimeExports.jsx(W.Item,{"data-slot":"command-item",className:$.cn("adm:data-[selected=true]:bg-accent adm:data-[selected=true]:text-accent-foreground adm:[&_svg:not([class*=text-])]:text-muted-foreground adm:relative adm:flex adm:cursor-default adm:items-center adm:gap-2 adm:rounded-sm adm:px-2 adm:py-1.5 adm:text-sm adm:outline-hidden adm:select-none adm:data-[disabled=true]:pointer-events-none adm:data-[disabled=true]:opacity-50 adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0 adm:[&_svg:not([class*=size-])]:size-4",e),...n})}function dt({searchable:e,multiple:n,icon:r,value:p,onValueChange:i,labels:c,options:m,classNames:d,selectedFeedback:g="checkbox",alwaysShowPlaceholder:o=!1,valuePosition:x="right",renders:s}){const w=oe.useRef(null),[R,C]=oe.useState(!1),[G,q]=oe.useState(n?[]:""),y=p!==void 0?p:G,A={...{placeholder:"Select options...",searchPlaceholder:"Search options...",noItemsFound:"No options found.",multipleSelected:f=>`${f} options selected`},...c},z=f=>{i?i(f):q(f)},N=()=>n&&Array.isArray(y)?y.length===0?null:y.length===1?m.find(f=>f.value===y[0])?.label:A.multipleSelected?.(y.length)||`${y.length} options selected`:!n&&typeof y=="string"&&y?m.find(f=>f.value===y)?.label:null,j=()=>n&&Array.isArray(y)?y.length>0:typeof y=="string"&&y!=="",k=f=>n&&Array.isArray(y)?y.includes(f):y===f,U=f=>{if(n){const P=Array.isArray(y)?y:[],t=P.includes(f)?P.filter(u=>u!==f):[...P,f];z(t)}else z(f===y?"":f),C(!1)},H=f=>{const P=k(f),t=m.find(u=>u.value===f);return s?.selectedFeedback?s.selectedFeedback({option:t,isSelected:P,type:g}):g==="check"?h.jsxRuntimeExports.jsx("span",{className:$.cn("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center",d?.check),children:P&&h.jsxRuntimeExports.jsx(Ne.Check,{className:"adm:size-4"})}):h.jsxRuntimeExports.jsx(Ae.Checkbox,{checked:P,className:d?.checkbox})},V=()=>s?.placeholder?s.placeholder({text:A.placeholder||"",hasValue:j()}):h.jsxRuntimeExports.jsx("span",{className:"adm:opacity-70",children:A.placeholder}),O=()=>s?.displayValue?s.displayValue({text:N()??null,value:y}):h.jsxRuntimeExports.jsx("span",{children:N()}),J=()=>o?h.jsxRuntimeExports.jsxs("span",{className:"adm:flex adm:items-center adm:gap-2",children:[r&&h.jsxRuntimeExports.jsx(r,{className:"adm:opacity-50"}),V(),j()&&x==="left"&&O()]}):h.jsxRuntimeExports.jsxs("span",{className:"adm:flex adm:items-center adm:gap-2",children:[r&&h.jsxRuntimeExports.jsx(r,{className:"adm:opacity-50"}),j()?O():V()]}),X=()=>s?.triggerIcon?s.triggerIcon({open:R}):h.jsxRuntimeExports.jsx(Pe.ChevronDown,{className:"adm:size-4 adm:opacity-50"}),M=()=>o&&j()&&x==="right"?h.jsxRuntimeExports.jsxs("span",{className:"adm:flex adm:items-center adm:gap-2",children:[O(),X()]}):h.jsxRuntimeExports.jsx("span",{className:"adm:flex adm:items-center adm:gap-2",children:X()}),F=()=>s?.trigger?s.trigger({open:R,value:y,displayText:N()??null,placeholder:A.placeholder||"",hasValue:j(),icon:r}):h.jsxRuntimeExports.jsxs(Ie.Button,{ref:w,variant:"outline",role:"combobox","aria-expanded":R,className:$.cn("adm:justify-between adm:font-normal",d?.trigger),children:[J(),M()]}),Y=()=>e?s?.searchInput?s.searchInput({placeholder:A.searchPlaceholder||""}):h.jsxRuntimeExports.jsx(it,{placeholder:A.searchPlaceholder,className:d?.input}):null,Q=()=>s?.empty?s.empty({text:A.noItemsFound||""}):h.jsxRuntimeExports.jsx(h.jsxRuntimeExports.Fragment,{children:A.noItemsFound}),ne=f=>s?.optionLabel?s.optionLabel({option:f}):h.jsxRuntimeExports.jsx(h.jsxRuntimeExports.Fragment,{children:f.label}),ae=f=>s?.option?h.jsxRuntimeExports.jsx("div",{children:s.option({option:f,isSelected:k(f.value),selectedFeedback:g})},f.value):h.jsxRuntimeExports.jsxs(ct,{value:f.value,onSelect:U,disabled:f.disabled,className:$.cn(d?.item,g==="check"&&"adm:pr-8"),children:[g==="checkbox"&&H(f.value),ne(f),g==="check"&&H(f.value)]},f.value);return h.jsxRuntimeExports.jsxs(se.Popover,{open:R,onOpenChange:C,children:[h.jsxRuntimeExports.jsx(se.PopoverTrigger,{asChild:!0,children:F()}),h.jsxRuntimeExports.jsx(se.PopoverContent,{align:"start",className:$.cn("adm:p-0",d?.popover),style:{minWidth:w.current?.offsetWidth},children:h.jsxRuntimeExports.jsxs(lt,{className:d?.command,children:[Y(),h.jsxRuntimeExports.jsxs(ot,{className:d?.list,children:[h.jsxRuntimeExports.jsx(ut,{className:d?.empty,children:Q()}),h.jsxRuntimeExports.jsx(st,{className:d?.group,children:m.map(f=>ae(f))})]})]})})]})}exports.Combobox=dt;
|
package/dist/combobox.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { j as p } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { useState as fe } from "react";
|
|
3
|
+
import { useRef as je, useState as fe } from "react";
|
|
4
4
|
import { c as M } from "./index-CRiPKpXj.js";
|
|
5
|
-
import { B as
|
|
6
|
-
import { R as
|
|
7
|
-
import { P } from "./index-BMWt1NBG.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { c as
|
|
10
|
-
import { c as
|
|
11
|
-
import { P as
|
|
12
|
-
import { C as
|
|
13
|
-
import { C as
|
|
14
|
-
import { C as
|
|
5
|
+
import { B as Ce } from "./button-2GdKenQI.js";
|
|
6
|
+
import { R as Ie, P as Re, O as Ae, a as Ne } from "./index-DniCthJA.js";
|
|
7
|
+
import { P as F } from "./index-BMWt1NBG.js";
|
|
8
|
+
import { u as W } from "./index-Cv867SGx.js";
|
|
9
|
+
import { c as ee } from "./index-DLcqcWxM.js";
|
|
10
|
+
import { c as $e } from "./createLucideIcon-B_8CJpcQ.js";
|
|
11
|
+
import { P as Me, a as Le, b as De } from "./popover-3rIoNCXs.js";
|
|
12
|
+
import { C as Pe } from "./checkbox-Dr487kAg.js";
|
|
13
|
+
import { C as Fe } from "./check-Ci0GjV-B.js";
|
|
14
|
+
import { C as Oe } from "./chevron-down-CpVS2Z7w.js";
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.546.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
const
|
|
21
|
+
const Ve = [
|
|
22
22
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
23
23
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
24
|
-
],
|
|
25
|
-
var pe = 1,
|
|
26
|
-
function ce(e, n, r, h, o,
|
|
27
|
-
if (
|
|
28
|
-
var s = `${o},${
|
|
24
|
+
], ze = $e("search", Ve);
|
|
25
|
+
var pe = 1, Ke = 0.9, Te = 0.8, qe = 0.17, ie = 0.1, de = 0.999, Be = 0.9999, We = 0.99, _e = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, ge = /[\s-]/g;
|
|
26
|
+
function ce(e, n, r, h, o, c, m) {
|
|
27
|
+
if (c === n.length) return o === e.length ? pe : We;
|
|
28
|
+
var s = `${o},${c}`;
|
|
29
29
|
if (m[s] !== void 0) return m[s];
|
|
30
|
-
for (var
|
|
31
|
-
return m[s] =
|
|
30
|
+
for (var x = h.charAt(c), i = r.indexOf(x, o), g = 0, u, j, S, R; i >= 0; ) u = ce(e, n, r, h, i + 1, c + 1, m), u > g && (i === o ? u *= pe : _e.test(e.charAt(i - 1)) ? (u *= Te, S = e.slice(o, i - 1).match(Ge), S && o > 0 && (u *= Math.pow(de, S.length))) : Ue.test(e.charAt(i - 1)) ? (u *= Ke, R = e.slice(o, i - 1).match(ge), R && o > 0 && (u *= Math.pow(de, R.length))) : (u *= qe, o > 0 && (u *= Math.pow(de, i - o))), e.charAt(i) !== n.charAt(c) && (u *= Be)), (u < ie && r.charAt(i - 1) === h.charAt(c + 1) || h.charAt(c + 1) === h.charAt(c) && r.charAt(i - 1) !== h.charAt(c)) && (j = ce(e, n, r, h, i + 1, c + 2, m), j * ie > u && (u = j * ie)), u > g && (g = u), i = r.indexOf(x, i + 1);
|
|
31
|
+
return m[s] = g, g;
|
|
32
32
|
}
|
|
33
33
|
function he(e) {
|
|
34
34
|
return e.toLowerCase().replace(ge, " ");
|
|
@@ -36,247 +36,247 @@ function he(e) {
|
|
|
36
36
|
function He(e, n, r) {
|
|
37
37
|
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, ce(e, n, he(e), he(n), 0, 0, {});
|
|
38
38
|
}
|
|
39
|
-
var
|
|
40
|
-
let r =
|
|
41
|
-
var t,
|
|
42
|
-
return { search: "", value: (
|
|
43
|
-
}), h =
|
|
39
|
+
var Z = '[cmdk-group=""]', ue = '[cmdk-group-items=""]', Je = '[cmdk-group-heading=""]', xe = '[cmdk-item=""]', ve = `${xe}:not([aria-disabled="true"])`, se = "cmdk-item-select", q = "data-value", Xe = (e, n, r) => He(e, n, r), be = a.createContext(void 0), te = () => a.useContext(be), ye = a.createContext(void 0), me = () => a.useContext(ye), ke = a.createContext(void 0), we = a.forwardRef((e, n) => {
|
|
40
|
+
let r = B(() => {
|
|
41
|
+
var t, d;
|
|
42
|
+
return { search: "", value: (d = (t = e.value) != null ? t : e.defaultValue) != null ? d : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
43
|
+
}), h = B(() => /* @__PURE__ */ new Set()), o = B(() => /* @__PURE__ */ new Map()), c = B(() => /* @__PURE__ */ new Map()), m = B(() => /* @__PURE__ */ new Set()), s = Se(e), { label: x, children: i, value: g, onValueChange: u, filter: j, shouldFilter: S, loop: R, disablePointerSelection: G = !1, vimBindings: L = !0, ...y } = e, re = W(), A = W(), K = W(), N = a.useRef(null), k = it();
|
|
44
44
|
z(() => {
|
|
45
|
-
if (
|
|
46
|
-
let t =
|
|
47
|
-
r.current.value = t,
|
|
45
|
+
if (g !== void 0) {
|
|
46
|
+
let t = g.trim();
|
|
47
|
+
r.current.value = t, E.emit();
|
|
48
48
|
}
|
|
49
|
-
}, [
|
|
50
|
-
k(6,
|
|
49
|
+
}, [g]), z(() => {
|
|
50
|
+
k(6, X);
|
|
51
51
|
}, []);
|
|
52
|
-
let
|
|
53
|
-
var l,
|
|
54
|
-
if (!Object.is(r.current[t],
|
|
55
|
-
if (r.current[t] =
|
|
52
|
+
let E = a.useMemo(() => ({ subscribe: (t) => (m.current.add(t), () => m.current.delete(t)), snapshot: () => r.current, setState: (t, d, v) => {
|
|
53
|
+
var l, b, w, I;
|
|
54
|
+
if (!Object.is(r.current[t], d)) {
|
|
55
|
+
if (r.current[t] = d, t === "search") J(), T(), k(1, O);
|
|
56
56
|
else if (t === "value") {
|
|
57
57
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
58
|
-
let C = document.getElementById(
|
|
59
|
-
C ? C.focus() : (l = document.getElementById(
|
|
58
|
+
let C = document.getElementById(K);
|
|
59
|
+
C ? C.focus() : (l = document.getElementById(re)) == null || l.focus();
|
|
60
60
|
}
|
|
61
61
|
if (k(7, () => {
|
|
62
62
|
var C;
|
|
63
|
-
r.current.selectedItemId = (C =
|
|
64
|
-
}), v || k(5,
|
|
65
|
-
let C =
|
|
66
|
-
(
|
|
63
|
+
r.current.selectedItemId = (C = D()) == null ? void 0 : C.id, E.emit();
|
|
64
|
+
}), v || k(5, X), ((b = s.current) == null ? void 0 : b.value) !== void 0) {
|
|
65
|
+
let C = d ?? "";
|
|
66
|
+
(I = (w = s.current).onValueChange) == null || I.call(w, C);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
E.emit();
|
|
71
71
|
}
|
|
72
72
|
}, emit: () => {
|
|
73
73
|
m.current.forEach((t) => t());
|
|
74
|
-
} }), []),
|
|
74
|
+
} }), []), U = a.useMemo(() => ({ value: (t, d, v) => {
|
|
75
75
|
var l;
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
d !== ((l = c.current.get(t)) == null ? void 0 : l.value) && (c.current.set(t, { value: d, keywords: v }), r.current.filtered.items.set(t, H(d, v)), k(2, () => {
|
|
77
|
+
T(), E.emit();
|
|
78
78
|
}));
|
|
79
|
-
}, item: (t,
|
|
80
|
-
|
|
79
|
+
}, item: (t, d) => (h.current.add(t), d && (o.current.has(d) ? o.current.get(d).add(t) : o.current.set(d, /* @__PURE__ */ new Set([t]))), k(3, () => {
|
|
80
|
+
J(), T(), r.current.value || O(), E.emit();
|
|
81
81
|
}), () => {
|
|
82
|
-
|
|
83
|
-
let v =
|
|
82
|
+
c.current.delete(t), h.current.delete(t), r.current.filtered.items.delete(t);
|
|
83
|
+
let v = D();
|
|
84
84
|
k(4, () => {
|
|
85
|
-
|
|
85
|
+
J(), v?.getAttribute("id") === t && O(), E.emit();
|
|
86
86
|
});
|
|
87
87
|
}), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
|
|
88
|
-
|
|
89
|
-
}), filter: () => s.current.shouldFilter, label:
|
|
90
|
-
function
|
|
88
|
+
c.current.delete(t), o.current.delete(t);
|
|
89
|
+
}), filter: () => s.current.shouldFilter, label: x || e["aria-label"], getDisablePointerSelection: () => s.current.disablePointerSelection, listId: re, inputId: K, labelId: A, listInnerRef: N }), []);
|
|
90
|
+
function H(t, d) {
|
|
91
91
|
var v, l;
|
|
92
|
-
let
|
|
93
|
-
return t ?
|
|
92
|
+
let b = (l = (v = s.current) == null ? void 0 : v.filter) != null ? l : Xe;
|
|
93
|
+
return t ? b(t, r.current.search, d) : 0;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function T() {
|
|
96
96
|
if (!r.current.search || s.current.shouldFilter === !1) return;
|
|
97
|
-
let t = r.current.filtered.items,
|
|
97
|
+
let t = r.current.filtered.items, d = [];
|
|
98
98
|
r.current.filtered.groups.forEach((l) => {
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
let C = t.get(
|
|
99
|
+
let b = o.current.get(l), w = 0;
|
|
100
|
+
b.forEach((I) => {
|
|
101
|
+
let C = t.get(I);
|
|
102
102
|
w = Math.max(C, w);
|
|
103
|
-
}),
|
|
103
|
+
}), d.push([l, w]);
|
|
104
104
|
});
|
|
105
|
-
let v =
|
|
106
|
-
V().sort((l,
|
|
107
|
-
var w,
|
|
108
|
-
let C = l.getAttribute("id"), le =
|
|
109
|
-
return ((w = t.get(le)) != null ? w : 0) - ((
|
|
105
|
+
let v = N.current;
|
|
106
|
+
V().sort((l, b) => {
|
|
107
|
+
var w, I;
|
|
108
|
+
let C = l.getAttribute("id"), le = b.getAttribute("id");
|
|
109
|
+
return ((w = t.get(le)) != null ? w : 0) - ((I = t.get(C)) != null ? I : 0);
|
|
110
110
|
}).forEach((l) => {
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
var
|
|
115
|
-
let w = (
|
|
111
|
+
let b = l.closest(ue);
|
|
112
|
+
b ? b.appendChild(l.parentElement === b ? l : l.closest(`${ue} > *`)) : v.appendChild(l.parentElement === v ? l : l.closest(`${ue} > *`));
|
|
113
|
+
}), d.sort((l, b) => b[1] - l[1]).forEach((l) => {
|
|
114
|
+
var b;
|
|
115
|
+
let w = (b = N.current) == null ? void 0 : b.querySelector(`${Z}[${q}="${encodeURIComponent(l[0])}"]`);
|
|
116
116
|
w?.parentElement.appendChild(w);
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let t = V().find((v) => v.getAttribute("aria-disabled") !== "true"),
|
|
121
|
-
|
|
119
|
+
function O() {
|
|
120
|
+
let t = V().find((v) => v.getAttribute("aria-disabled") !== "true"), d = t?.getAttribute(q);
|
|
121
|
+
E.setState("value", d || void 0);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
var t,
|
|
123
|
+
function J() {
|
|
124
|
+
var t, d, v, l;
|
|
125
125
|
if (!r.current.search || s.current.shouldFilter === !1) {
|
|
126
126
|
r.current.filtered.count = h.current.size;
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
130
|
-
let
|
|
130
|
+
let b = 0;
|
|
131
131
|
for (let w of h.current) {
|
|
132
|
-
let
|
|
133
|
-
r.current.filtered.items.set(w, le), le > 0 &&
|
|
132
|
+
let I = (d = (t = c.current.get(w)) == null ? void 0 : t.value) != null ? d : "", C = (l = (v = c.current.get(w)) == null ? void 0 : v.keywords) != null ? l : [], le = H(I, C);
|
|
133
|
+
r.current.filtered.items.set(w, le), le > 0 && b++;
|
|
134
134
|
}
|
|
135
|
-
for (let [w,
|
|
135
|
+
for (let [w, I] of o.current) for (let C of I) if (r.current.filtered.items.get(C) > 0) {
|
|
136
136
|
r.current.filtered.groups.add(w);
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
|
-
r.current.filtered.count =
|
|
139
|
+
r.current.filtered.count = b;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
var t,
|
|
143
|
-
let l =
|
|
144
|
-
l && (((t = l.parentElement) == null ? void 0 : t.firstChild) === l && ((v = (
|
|
141
|
+
function X() {
|
|
142
|
+
var t, d, v;
|
|
143
|
+
let l = D();
|
|
144
|
+
l && (((t = l.parentElement) == null ? void 0 : t.firstChild) === l && ((v = (d = l.closest(Z)) == null ? void 0 : d.querySelector(Je)) == null || v.scrollIntoView({ block: "nearest" })), l.scrollIntoView({ block: "nearest" }));
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function D() {
|
|
147
147
|
var t;
|
|
148
|
-
return (t =
|
|
148
|
+
return (t = N.current) == null ? void 0 : t.querySelector(`${xe}[aria-selected="true"]`);
|
|
149
149
|
}
|
|
150
150
|
function V() {
|
|
151
151
|
var t;
|
|
152
|
-
return Array.from(((t =
|
|
152
|
+
return Array.from(((t = N.current) == null ? void 0 : t.querySelectorAll(ve)) || []);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let
|
|
156
|
-
|
|
154
|
+
function Y(t) {
|
|
155
|
+
let d = V()[t];
|
|
156
|
+
d && E.setState("value", d.getAttribute(q));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
-
let v =
|
|
161
|
-
(
|
|
158
|
+
function Q(t) {
|
|
159
|
+
var d;
|
|
160
|
+
let v = D(), l = V(), b = l.findIndex((I) => I === v), w = l[b + t];
|
|
161
|
+
(d = s.current) != null && d.loop && (w = b + t < 0 ? l[l.length - 1] : b + t === l.length ? l[0] : l[b + t]), w && E.setState("value", w.getAttribute(q));
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
let
|
|
165
|
-
for (; v && !l; ) v = t > 0 ?
|
|
166
|
-
l ?
|
|
163
|
+
function ne(t) {
|
|
164
|
+
let d = D(), v = d?.closest(Z), l;
|
|
165
|
+
for (; v && !l; ) v = t > 0 ? lt(v, Z) : ot(v, Z), l = v?.querySelector(ve);
|
|
166
|
+
l ? E.setState("value", l.getAttribute(q)) : Q(t);
|
|
167
167
|
}
|
|
168
|
-
let
|
|
169
|
-
t.preventDefault(), t.metaKey ?
|
|
170
|
-
},
|
|
171
|
-
t.preventDefault(), t.metaKey ?
|
|
168
|
+
let ae = () => Y(V().length - 1), f = (t) => {
|
|
169
|
+
t.preventDefault(), t.metaKey ? ae() : t.altKey ? ne(1) : Q(1);
|
|
170
|
+
}, $ = (t) => {
|
|
171
|
+
t.preventDefault(), t.metaKey ? Y(0) : t.altKey ? ne(-1) : Q(-1);
|
|
172
172
|
};
|
|
173
|
-
return a.createElement(
|
|
174
|
-
var
|
|
175
|
-
(
|
|
173
|
+
return a.createElement(F.div, { ref: n, tabIndex: -1, ...y, "cmdk-root": "", onKeyDown: (t) => {
|
|
174
|
+
var d;
|
|
175
|
+
(d = y.onKeyDown) == null || d.call(y, t);
|
|
176
176
|
let v = t.nativeEvent.isComposing || t.keyCode === 229;
|
|
177
177
|
if (!(t.defaultPrevented || v)) switch (t.key) {
|
|
178
178
|
case "n":
|
|
179
179
|
case "j": {
|
|
180
|
-
|
|
180
|
+
L && t.ctrlKey && f(t);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "ArrowDown": {
|
|
184
|
-
|
|
184
|
+
f(t);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "p":
|
|
188
188
|
case "k": {
|
|
189
|
-
|
|
189
|
+
L && t.ctrlKey && $(t);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
case "ArrowUp": {
|
|
193
|
-
|
|
193
|
+
$(t);
|
|
194
194
|
break;
|
|
195
195
|
}
|
|
196
196
|
case "Home": {
|
|
197
|
-
t.preventDefault(),
|
|
197
|
+
t.preventDefault(), Y(0);
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
200
|
case "End": {
|
|
201
|
-
t.preventDefault(),
|
|
201
|
+
t.preventDefault(), ae();
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "Enter": {
|
|
205
205
|
t.preventDefault();
|
|
206
|
-
let l =
|
|
206
|
+
let l = D();
|
|
207
207
|
if (l) {
|
|
208
|
-
let
|
|
209
|
-
l.dispatchEvent(
|
|
208
|
+
let b = new Event(se);
|
|
209
|
+
l.dispatchEvent(b);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
} }, a.createElement("label", { "cmdk-label": "", htmlFor:
|
|
214
|
-
}),
|
|
213
|
+
} }, a.createElement("label", { "cmdk-label": "", htmlFor: U.inputId, id: U.labelId, style: ut }, x), oe(e, (t) => a.createElement(ye.Provider, { value: E }, a.createElement(be.Provider, { value: U }, t))));
|
|
214
|
+
}), Ye = a.forwardRef((e, n) => {
|
|
215
215
|
var r, h;
|
|
216
|
-
let o =
|
|
216
|
+
let o = W(), c = a.useRef(null), m = a.useContext(ke), s = te(), x = Se(e), i = (h = (r = x.current) == null ? void 0 : r.forceMount) != null ? h : m?.forceMount;
|
|
217
217
|
z(() => {
|
|
218
218
|
if (!i) return s.item(o, m?.id);
|
|
219
219
|
}, [i]);
|
|
220
|
-
let
|
|
220
|
+
let g = Ee(o, c, [e.value, e.children, c], e.keywords), u = me(), j = P((k) => k.value && k.value === g.current), S = P((k) => i || s.filter() === !1 ? !0 : k.search ? k.filtered.items.get(o) > 0 : !0);
|
|
221
221
|
a.useEffect(() => {
|
|
222
|
-
let k =
|
|
223
|
-
if (!(!k || e.disabled)) return k.addEventListener(se,
|
|
224
|
-
}, [
|
|
225
|
-
function
|
|
226
|
-
var k,
|
|
227
|
-
|
|
222
|
+
let k = c.current;
|
|
223
|
+
if (!(!k || e.disabled)) return k.addEventListener(se, R), () => k.removeEventListener(se, R);
|
|
224
|
+
}, [S, e.onSelect, e.disabled]);
|
|
225
|
+
function R() {
|
|
226
|
+
var k, E;
|
|
227
|
+
G(), (E = (k = x.current).onSelect) == null || E.call(k, g.current);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
229
|
+
function G() {
|
|
230
|
+
u.setState("value", g.current, !0);
|
|
231
231
|
}
|
|
232
|
-
if (!
|
|
233
|
-
let { disabled:
|
|
234
|
-
return a.createElement(
|
|
235
|
-
}), Ye = a.forwardRef((e, n) => {
|
|
236
|
-
let { heading: r, children: h, forceMount: o, ...u } = e, m = G(), s = a.useRef(null), b = a.useRef(null), i = G(), x = re(), d = D((E) => o || x.filter() === !1 ? !0 : E.search ? E.filtered.groups.has(m) : !0);
|
|
237
|
-
z(() => x.group(m), []), Ee(m, s, [e.value, e.heading, b]);
|
|
238
|
-
let S = a.useMemo(() => ({ id: m, forceMount: o }), [o]);
|
|
239
|
-
return a.createElement(P.div, { ref: te(s, n), ...u, "cmdk-group": "", role: "presentation", hidden: d ? void 0 : !0 }, r && a.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: i }, r), oe(e, (E) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? i : void 0 }, a.createElement(ke.Provider, { value: S }, E))));
|
|
232
|
+
if (!S) return null;
|
|
233
|
+
let { disabled: L, value: y, onSelect: re, forceMount: A, keywords: K, ...N } = e;
|
|
234
|
+
return a.createElement(F.div, { ref: ee(c, n), ...N, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!L, "aria-selected": !!j, "data-disabled": !!L, "data-selected": !!j, onPointerMove: L || s.getDisablePointerSelection() ? void 0 : G, onClick: L ? void 0 : R }, e.children);
|
|
240
235
|
}), Qe = a.forwardRef((e, n) => {
|
|
241
|
-
let {
|
|
242
|
-
|
|
236
|
+
let { heading: r, children: h, forceMount: o, ...c } = e, m = W(), s = a.useRef(null), x = a.useRef(null), i = W(), g = te(), u = P((S) => o || g.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(m) : !0);
|
|
237
|
+
z(() => g.group(m), []), Ee(m, s, [e.value, e.heading, x]);
|
|
238
|
+
let j = a.useMemo(() => ({ id: m, forceMount: o }), [o]);
|
|
239
|
+
return a.createElement(F.div, { ref: ee(s, n), ...c, "cmdk-group": "", role: "presentation", hidden: u ? void 0 : !0 }, r && a.createElement("div", { ref: x, "cmdk-group-heading": "", "aria-hidden": !0, id: i }, r), oe(e, (S) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? i : void 0 }, a.createElement(ke.Provider, { value: j }, S))));
|
|
243
240
|
}), Ze = a.forwardRef((e, n) => {
|
|
244
|
-
let {
|
|
241
|
+
let { alwaysRender: r, ...h } = e, o = a.useRef(null), c = P((m) => !m.search);
|
|
242
|
+
return !r && !c ? null : a.createElement(F.div, { ref: ee(o, n), ...h, "cmdk-separator": "", role: "separator" });
|
|
243
|
+
}), et = a.forwardRef((e, n) => {
|
|
244
|
+
let { onValueChange: r, ...h } = e, o = e.value != null, c = me(), m = P((i) => i.search), s = P((i) => i.selectedItemId), x = te();
|
|
245
245
|
return a.useEffect(() => {
|
|
246
|
-
e.value != null &&
|
|
247
|
-
}, [e.value]), a.createElement(
|
|
248
|
-
o ||
|
|
246
|
+
e.value != null && c.setState("search", e.value);
|
|
247
|
+
}, [e.value]), a.createElement(F.input, { ref: n, ...h, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": x.listId, "aria-labelledby": x.labelId, "aria-activedescendant": s, id: x.inputId, type: "text", value: o ? e.value : m, onChange: (i) => {
|
|
248
|
+
o || c.setState("search", i.target.value), r?.(i.target.value);
|
|
249
249
|
} });
|
|
250
|
-
}),
|
|
251
|
-
let { children: r, label: h = "Suggestions", ...o } = e,
|
|
250
|
+
}), tt = a.forwardRef((e, n) => {
|
|
251
|
+
let { children: r, label: h = "Suggestions", ...o } = e, c = a.useRef(null), m = a.useRef(null), s = P((i) => i.selectedItemId), x = te();
|
|
252
252
|
return a.useEffect(() => {
|
|
253
|
-
if (m.current &&
|
|
254
|
-
let i = m.current,
|
|
255
|
-
|
|
256
|
-
let
|
|
257
|
-
|
|
253
|
+
if (m.current && c.current) {
|
|
254
|
+
let i = m.current, g = c.current, u, j = new ResizeObserver(() => {
|
|
255
|
+
u = requestAnimationFrame(() => {
|
|
256
|
+
let S = i.offsetHeight;
|
|
257
|
+
g.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
|
|
258
258
|
});
|
|
259
259
|
});
|
|
260
|
-
return
|
|
261
|
-
cancelAnimationFrame(
|
|
260
|
+
return j.observe(i), () => {
|
|
261
|
+
cancelAnimationFrame(u), j.unobserve(i);
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
}, []), a.createElement(
|
|
265
|
-
}),
|
|
266
|
-
let { open: r, onOpenChange: h, overlayClassName: o, contentClassName:
|
|
267
|
-
return a.createElement(
|
|
268
|
-
}),
|
|
269
|
-
let { progress: r, children: h, label: o = "Loading...", ...
|
|
270
|
-
return a.createElement(
|
|
271
|
-
}),
|
|
272
|
-
function
|
|
264
|
+
}, []), a.createElement(F.div, { ref: ee(c, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": s, "aria-label": h, id: x.listId }, oe(e, (i) => a.createElement("div", { ref: ee(m, x.listInnerRef), "cmdk-list-sizer": "" }, i)));
|
|
265
|
+
}), rt = a.forwardRef((e, n) => {
|
|
266
|
+
let { open: r, onOpenChange: h, overlayClassName: o, contentClassName: c, container: m, ...s } = e;
|
|
267
|
+
return a.createElement(Ie, { open: r, onOpenChange: h }, a.createElement(Re, { container: m }, a.createElement(Ae, { "cmdk-overlay": "", className: o }), a.createElement(Ne, { "aria-label": e.label, "cmdk-dialog": "", className: c }, a.createElement(we, { ref: n, ...s }))));
|
|
268
|
+
}), nt = a.forwardRef((e, n) => P((r) => r.filtered.count === 0) ? a.createElement(F.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), at = a.forwardRef((e, n) => {
|
|
269
|
+
let { progress: r, children: h, label: o = "Loading...", ...c } = e;
|
|
270
|
+
return a.createElement(F.div, { ref: n, ...c, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, oe(e, (m) => a.createElement("div", { "aria-hidden": !0 }, m)));
|
|
271
|
+
}), _ = Object.assign(we, { List: tt, Item: Ye, Input: et, Group: Qe, Separator: Ze, Dialog: rt, Empty: nt, Loading: at });
|
|
272
|
+
function lt(e, n) {
|
|
273
273
|
let r = e.nextElementSibling;
|
|
274
274
|
for (; r; ) {
|
|
275
275
|
if (r.matches(n)) return r;
|
|
276
276
|
r = r.nextElementSibling;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function ot(e, n) {
|
|
280
280
|
let r = e.previousElementSibling;
|
|
281
281
|
for (; r; ) {
|
|
282
282
|
if (r.matches(n)) return r;
|
|
@@ -290,50 +290,50 @@ function Se(e) {
|
|
|
290
290
|
}), n;
|
|
291
291
|
}
|
|
292
292
|
var z = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
|
|
293
|
-
function
|
|
293
|
+
function B(e) {
|
|
294
294
|
let n = a.useRef();
|
|
295
295
|
return n.current === void 0 && (n.current = e()), n;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function P(e) {
|
|
298
298
|
let n = me(), r = () => e(n.snapshot());
|
|
299
299
|
return a.useSyncExternalStore(n.subscribe, r, r);
|
|
300
300
|
}
|
|
301
301
|
function Ee(e, n, r, h = []) {
|
|
302
|
-
let o = a.useRef(),
|
|
302
|
+
let o = a.useRef(), c = te();
|
|
303
303
|
return z(() => {
|
|
304
304
|
var m;
|
|
305
305
|
let s = (() => {
|
|
306
306
|
var i;
|
|
307
|
-
for (let
|
|
308
|
-
if (typeof
|
|
309
|
-
if (typeof
|
|
307
|
+
for (let g of r) {
|
|
308
|
+
if (typeof g == "string") return g.trim();
|
|
309
|
+
if (typeof g == "object" && "current" in g) return g.current ? (i = g.current.textContent) == null ? void 0 : i.trim() : o.current;
|
|
310
310
|
}
|
|
311
|
-
})(),
|
|
312
|
-
|
|
311
|
+
})(), x = h.map((i) => i.trim());
|
|
312
|
+
c.value(e, s, x), (m = n.current) == null || m.setAttribute(q, s), o.current = s;
|
|
313
313
|
}), o;
|
|
314
314
|
}
|
|
315
|
-
var
|
|
316
|
-
let [e, n] = a.useState(), r =
|
|
315
|
+
var it = () => {
|
|
316
|
+
let [e, n] = a.useState(), r = B(() => /* @__PURE__ */ new Map());
|
|
317
317
|
return z(() => {
|
|
318
318
|
r.current.forEach((h) => h()), r.current = /* @__PURE__ */ new Map();
|
|
319
319
|
}, [e]), (h, o) => {
|
|
320
320
|
r.current.set(h, o), n({});
|
|
321
321
|
};
|
|
322
322
|
};
|
|
323
|
-
function
|
|
323
|
+
function dt(e) {
|
|
324
324
|
let n = e.type;
|
|
325
325
|
return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
|
|
326
326
|
}
|
|
327
327
|
function oe({ asChild: e, children: n }, r) {
|
|
328
|
-
return e && a.isValidElement(n) ? a.cloneElement(
|
|
328
|
+
return e && a.isValidElement(n) ? a.cloneElement(dt(n), { ref: n.ref }, r(n.props.children)) : r(n);
|
|
329
329
|
}
|
|
330
|
-
var
|
|
331
|
-
function
|
|
330
|
+
var ut = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
331
|
+
function ct({
|
|
332
332
|
className: e,
|
|
333
333
|
...n
|
|
334
334
|
}) {
|
|
335
335
|
return /* @__PURE__ */ p.jsx(
|
|
336
|
-
|
|
336
|
+
_,
|
|
337
337
|
{
|
|
338
338
|
"data-slot": "command",
|
|
339
339
|
className: M(
|
|
@@ -344,7 +344,7 @@ function ut({
|
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function st({
|
|
348
348
|
className: e,
|
|
349
349
|
...n
|
|
350
350
|
}) {
|
|
@@ -354,9 +354,9 @@ function ct({
|
|
|
354
354
|
"data-slot": "command-input-wrapper",
|
|
355
355
|
className: "adm:flex adm:h-9 adm:items-center adm:gap-2 adm:border-b adm:px-3",
|
|
356
356
|
children: [
|
|
357
|
-
/* @__PURE__ */ p.jsx(
|
|
357
|
+
/* @__PURE__ */ p.jsx(ze, { className: "adm:size-4 adm:shrink-0 adm:opacity-50" }),
|
|
358
358
|
/* @__PURE__ */ p.jsx(
|
|
359
|
-
|
|
359
|
+
_.Input,
|
|
360
360
|
{
|
|
361
361
|
"data-slot": "command-input",
|
|
362
362
|
className: M(
|
|
@@ -370,12 +370,12 @@ function ct({
|
|
|
370
370
|
}
|
|
371
371
|
);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function mt({
|
|
374
374
|
className: e,
|
|
375
375
|
...n
|
|
376
376
|
}) {
|
|
377
377
|
return /* @__PURE__ */ p.jsx(
|
|
378
|
-
|
|
378
|
+
_.List,
|
|
379
379
|
{
|
|
380
380
|
"data-slot": "command-list",
|
|
381
381
|
className: M(
|
|
@@ -386,12 +386,12 @@ function st({
|
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function ft({
|
|
390
390
|
className: e,
|
|
391
391
|
...n
|
|
392
392
|
}) {
|
|
393
393
|
return /* @__PURE__ */ p.jsx(
|
|
394
|
-
|
|
394
|
+
_.Empty,
|
|
395
395
|
{
|
|
396
396
|
"data-slot": "command-empty",
|
|
397
397
|
className: M("adm:py-6 adm:text-center adm:text-sm", e),
|
|
@@ -399,12 +399,12 @@ function mt({
|
|
|
399
399
|
}
|
|
400
400
|
);
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function pt({
|
|
403
403
|
className: e,
|
|
404
404
|
...n
|
|
405
405
|
}) {
|
|
406
406
|
return /* @__PURE__ */ p.jsx(
|
|
407
|
-
|
|
407
|
+
_.Group,
|
|
408
408
|
{
|
|
409
409
|
"data-slot": "command-group",
|
|
410
410
|
className: M(
|
|
@@ -415,12 +415,12 @@ function ft({
|
|
|
415
415
|
}
|
|
416
416
|
);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function ht({
|
|
419
419
|
className: e,
|
|
420
420
|
...n
|
|
421
421
|
}) {
|
|
422
422
|
return /* @__PURE__ */ p.jsx(
|
|
423
|
-
|
|
423
|
+
_.Item,
|
|
424
424
|
{
|
|
425
425
|
"data-slot": "command-item",
|
|
426
426
|
className: M(
|
|
@@ -431,128 +431,137 @@ function pt({
|
|
|
431
431
|
}
|
|
432
432
|
);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function At({
|
|
435
435
|
searchable: e,
|
|
436
436
|
multiple: n,
|
|
437
437
|
icon: r,
|
|
438
438
|
value: h,
|
|
439
439
|
onValueChange: o,
|
|
440
|
-
labels:
|
|
440
|
+
labels: c,
|
|
441
441
|
options: m,
|
|
442
442
|
classNames: s,
|
|
443
|
-
selectedFeedback:
|
|
443
|
+
selectedFeedback: x = "checkbox",
|
|
444
444
|
alwaysShowPlaceholder: i = !1,
|
|
445
|
-
valuePosition:
|
|
446
|
-
renders:
|
|
445
|
+
valuePosition: g = "right",
|
|
446
|
+
renders: u
|
|
447
447
|
}) {
|
|
448
|
-
const [S,
|
|
448
|
+
const j = je(null), [S, R] = fe(!1), [G, L] = fe(n ? [] : ""), y = h !== void 0 ? h : G, A = { ...{
|
|
449
449
|
placeholder: "Select options...",
|
|
450
450
|
searchPlaceholder: "Search options...",
|
|
451
451
|
noItemsFound: "No options found.",
|
|
452
452
|
multipleSelected: (f) => `${f} options selected`
|
|
453
|
-
}, ...
|
|
454
|
-
o ? o(f) :
|
|
455
|
-
},
|
|
453
|
+
}, ...c }, K = (f) => {
|
|
454
|
+
o ? o(f) : L(f);
|
|
455
|
+
}, N = () => n && Array.isArray(y) ? y.length === 0 ? null : y.length === 1 ? m.find((f) => f.value === y[0])?.label : A.multipleSelected?.(y.length) || `${y.length} options selected` : !n && typeof y == "string" && y ? m.find((f) => f.value === y)?.label : null, k = () => n && Array.isArray(y) ? y.length > 0 : typeof y == "string" && y !== "", E = (f) => n && Array.isArray(y) ? y.includes(f) : y === f, U = (f) => {
|
|
456
456
|
if (n) {
|
|
457
|
-
const
|
|
458
|
-
|
|
457
|
+
const $ = Array.isArray(y) ? y : [], t = $.includes(f) ? $.filter((d) => d !== f) : [...$, f];
|
|
458
|
+
K(t);
|
|
459
459
|
} else
|
|
460
|
-
|
|
461
|
-
},
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
option:
|
|
465
|
-
isSelected:
|
|
466
|
-
type:
|
|
467
|
-
}) :
|
|
468
|
-
|
|
460
|
+
K(f === y ? "" : f), R(!1);
|
|
461
|
+
}, H = (f) => {
|
|
462
|
+
const $ = E(f), t = m.find((d) => d.value === f);
|
|
463
|
+
return u?.selectedFeedback ? u.selectedFeedback({
|
|
464
|
+
option: t,
|
|
465
|
+
isSelected: $,
|
|
466
|
+
type: x
|
|
467
|
+
}) : x === "check" ? /* @__PURE__ */ p.jsx("span", { className: M("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", s?.check), children: $ && /* @__PURE__ */ p.jsx(Fe, { className: "adm:size-4" }) }) : /* @__PURE__ */ p.jsx(
|
|
468
|
+
Pe,
|
|
469
469
|
{
|
|
470
|
-
checked:
|
|
470
|
+
checked: $,
|
|
471
471
|
className: s?.checkbox
|
|
472
472
|
}
|
|
473
473
|
);
|
|
474
|
-
},
|
|
474
|
+
}, T = () => u?.placeholder ? u.placeholder({
|
|
475
475
|
text: A.placeholder || "",
|
|
476
|
-
hasValue:
|
|
477
|
-
}) : /* @__PURE__ */ p.jsx("span", { className: "adm:opacity-70", children: A.placeholder }), O = () =>
|
|
478
|
-
text:
|
|
479
|
-
value:
|
|
480
|
-
}) : /* @__PURE__ */ p.jsx("span", { children:
|
|
476
|
+
hasValue: k()
|
|
477
|
+
}) : /* @__PURE__ */ p.jsx("span", { className: "adm:opacity-70", children: A.placeholder }), O = () => u?.displayValue ? u.displayValue({
|
|
478
|
+
text: N() ?? null,
|
|
479
|
+
value: y
|
|
480
|
+
}) : /* @__PURE__ */ p.jsx("span", { children: N() }), J = () => i ? /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
481
481
|
r && /* @__PURE__ */ p.jsx(r, { className: "adm:opacity-50" }),
|
|
482
|
-
|
|
483
|
-
|
|
482
|
+
T(),
|
|
483
|
+
k() && g === "left" && O()
|
|
484
484
|
] }) : /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
485
485
|
r && /* @__PURE__ */ p.jsx(r, { className: "adm:opacity-50" }),
|
|
486
|
-
|
|
487
|
-
] }),
|
|
486
|
+
k() ? O() : T()
|
|
487
|
+
] }), X = () => u?.triggerIcon ? u.triggerIcon({
|
|
488
488
|
open: S
|
|
489
|
-
}) : /* @__PURE__ */ p.jsx(
|
|
489
|
+
}) : /* @__PURE__ */ p.jsx(Oe, { className: "adm:size-4 adm:opacity-50" }), D = () => i && k() && g === "right" ? /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
490
490
|
O(),
|
|
491
|
-
|
|
492
|
-
] }) : /* @__PURE__ */ p.jsx("span", { className: "adm:flex adm:items-center adm:gap-2", children:
|
|
491
|
+
X()
|
|
492
|
+
] }) : /* @__PURE__ */ p.jsx("span", { className: "adm:flex adm:items-center adm:gap-2", children: X() }), V = () => u?.trigger ? u.trigger({
|
|
493
493
|
open: S,
|
|
494
|
-
value:
|
|
495
|
-
displayText:
|
|
494
|
+
value: y,
|
|
495
|
+
displayText: N() ?? null,
|
|
496
496
|
placeholder: A.placeholder || "",
|
|
497
|
-
hasValue:
|
|
497
|
+
hasValue: k(),
|
|
498
498
|
icon: r
|
|
499
499
|
}) : /* @__PURE__ */ p.jsxs(
|
|
500
|
-
|
|
500
|
+
Ce,
|
|
501
501
|
{
|
|
502
|
+
ref: j,
|
|
502
503
|
variant: "outline",
|
|
503
504
|
role: "combobox",
|
|
504
505
|
"aria-expanded": S,
|
|
505
506
|
className: M("adm:justify-between adm:font-normal", s?.trigger),
|
|
506
507
|
children: [
|
|
507
|
-
|
|
508
|
-
|
|
508
|
+
J(),
|
|
509
|
+
D()
|
|
509
510
|
]
|
|
510
511
|
}
|
|
511
|
-
),
|
|
512
|
+
), Y = () => e ? u?.searchInput ? u.searchInput({
|
|
512
513
|
placeholder: A.searchPlaceholder || ""
|
|
513
514
|
}) : /* @__PURE__ */ p.jsx(
|
|
514
|
-
|
|
515
|
+
st,
|
|
515
516
|
{
|
|
516
517
|
placeholder: A.searchPlaceholder,
|
|
517
518
|
className: s?.input
|
|
518
519
|
}
|
|
519
|
-
) : null, Q = () =>
|
|
520
|
+
) : null, Q = () => u?.empty ? u.empty({
|
|
520
521
|
text: A.noItemsFound || ""
|
|
521
|
-
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: A.noItemsFound }),
|
|
522
|
+
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: A.noItemsFound }), ne = (f) => u?.optionLabel ? u.optionLabel({
|
|
522
523
|
option: f
|
|
523
|
-
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: f.label }), ae = (f) =>
|
|
524
|
+
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: f.label }), ae = (f) => u?.option ? /* @__PURE__ */ p.jsx("div", { children: u.option({
|
|
524
525
|
option: f,
|
|
525
|
-
isSelected:
|
|
526
|
-
selectedFeedback:
|
|
526
|
+
isSelected: E(f.value),
|
|
527
|
+
selectedFeedback: x
|
|
527
528
|
}) }, f.value) : /* @__PURE__ */ p.jsxs(
|
|
528
|
-
|
|
529
|
+
ht,
|
|
529
530
|
{
|
|
530
531
|
value: f.value,
|
|
531
|
-
onSelect:
|
|
532
|
+
onSelect: U,
|
|
532
533
|
disabled: f.disabled,
|
|
533
534
|
className: M(
|
|
534
535
|
s?.item,
|
|
535
|
-
|
|
536
|
+
x === "check" && "adm:pr-8"
|
|
536
537
|
),
|
|
537
538
|
children: [
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
x === "checkbox" && H(f.value),
|
|
540
|
+
ne(f),
|
|
541
|
+
x === "check" && H(f.value)
|
|
541
542
|
]
|
|
542
543
|
},
|
|
543
544
|
f.value
|
|
544
545
|
);
|
|
545
|
-
return /* @__PURE__ */ p.jsxs(
|
|
546
|
-
/* @__PURE__ */ p.jsx(
|
|
547
|
-
/* @__PURE__ */ p.jsx(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
546
|
+
return /* @__PURE__ */ p.jsxs(Me, { open: S, onOpenChange: R, children: [
|
|
547
|
+
/* @__PURE__ */ p.jsx(Le, { asChild: !0, children: V() }),
|
|
548
|
+
/* @__PURE__ */ p.jsx(
|
|
549
|
+
De,
|
|
550
|
+
{
|
|
551
|
+
align: "start",
|
|
552
|
+
className: M("adm:p-0", s?.popover),
|
|
553
|
+
style: { minWidth: j.current?.offsetWidth },
|
|
554
|
+
children: /* @__PURE__ */ p.jsxs(ct, { className: s?.command, children: [
|
|
555
|
+
Y(),
|
|
556
|
+
/* @__PURE__ */ p.jsxs(mt, { className: s?.list, children: [
|
|
557
|
+
/* @__PURE__ */ p.jsx(ft, { className: s?.empty, children: Q() }),
|
|
558
|
+
/* @__PURE__ */ p.jsx(pt, { className: s?.group, children: m.map((f) => ae(f)) })
|
|
559
|
+
] })
|
|
560
|
+
] })
|
|
561
|
+
}
|
|
562
|
+
)
|
|
554
563
|
] });
|
|
555
564
|
}
|
|
556
565
|
export {
|
|
557
|
-
|
|
566
|
+
At as Combobox
|
|
558
567
|
};
|