PageSourceSearch

https://cdn.vos.intellsys.ai/neptune_assets/PillsInput-DNV9P6fY.js

js intellsys.ai collected 2026-10-05 12:08:13 UTC 7,548 bytes, 2 lines download raw bytes

1import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{N as r,O as i,i as a,j as o,l as s,n as c,u as l}from"./UnstyledButton-Bgqi24Hy.js";import{r as u}from"./use-merged-ref-DIcahOiL.js";import{t as d}from"./CloseButton-DY5hXlMU.js";import{n as f}from"./Input-CeOtcwvH.js";import{t as p}from"./InputBase-CuV15YIl.js";function m(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t<n?n-1:n;return r===`after`&&(o+=1),i.splice(o,0,a),i}var h=e(t(),1),g=e=>{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},_=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0};function v({value:e,onChange:t,enabled:n}){let r=(0,h.useRef)({draggedIndex:null,currentDropTarget:null}),i=(0,h.useRef)(null),a=(0,h.useRef)(null),o=(0,h.useRef)(e);o.current=e,(0,h.useEffect)(()=>{let e=i.current;e&&(i.current=null,_(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,h.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o<a.width/2)?`before`:`after`;t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=`move`;let c=r.current.currentDropTarget;c&&c!==i&&c.removeAttribute(`data-drag-over`),i.setAttribute(`data-drag-over`,s),r.current.currentDropTarget=i},onDragLeave:e=>{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=m(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=m(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>
1=o.current.length){g(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}var y=(0,h.createContext)(null),b={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},x=n(),S=(0,h.createContext)(null),C=i((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?r(n,`pg-gap`):r(t)}})),w=a(e=>{let t=l(`PillGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:u,size:d,disabled:f,attributes:p,...m}=t,g=(0,h.use)(y)?.size||d||void 0,_=s({name:`PillGroup`,classes:b,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:u,varsResolver:C,stylesCtx:{size:g},rootSelector:`group`});return(0,x.jsx)(S,{value:{size:g,disabled:f},children:(0,x.jsx)(c,{size:g,..._(`group`),...m})})});w.classes=b,w.varsResolver=C,w.displayName=`@mantine/core/PillGroup`;var T={variant:`default`},E=i((e,{radius:t},{size:n})=>({root:{"--pill-fz":r(n,`pill-fz`),"--pill-height":r(n,`pill-height`),"--pill-radius":t===void 0?void 0:o(t)}})),D=a(e=>{let t=l(`Pill`,T,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:u,variant:f,children:p,withRemoveButton:m,onRemove:g,removeButtonProps:_,radius:v,size:C,disabled:w,mod:D,attributes:O,...k}=t,A=(0,h.use)(S),j=(0,h.use)(y),M=C||A?.size||void 0,N=j?.variant===`filled`?`contrast`:f||`default`,P=s({name:`Pill`,classes:b,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:O,vars:u,varsResolver:E,stylesCtx:{size:M}});return(0,x.jsxs)(c,{component:`span`,variant:N,size:M,...P(`root`,{variant:N}),mod:[{"with-remove":m&&!w,disabled:w||A?.disabled},D],...k,children:[(0,x.jsx)(`span`,{...P(`label`),children:p}),m&&(0,x.jsx)(d,{variant:`transparent`,radius:v,tabIndex:-1,"aria-hidden":!0,unstyled:o,..._,...P(`remove`,{className:_?.className,style:_?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),_?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),g?.(),_?.onClick?.(e)}})]})});D.classes=b,D.varsResolver=E,D.displayName=`@mantine/core/Pill`,D.Group=w;var O={field:`m_45c4369d`},k={type:`visible`},A=a(e=>{let t=l(`PillsInputField`,k,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:d,type:p,disabled:m,id:g,pointer:_,mod:v,attributes:b,ref:S,...C}=t,w=(0,h.use)(y),T=(0,h.use)(f),E=s({name:`PillsInputField`,classes:O,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:b,rootSelector:`field`}),D=m||w?.disabled;return(0,x.jsx)(c,{component:`input`,ref:u(S,w?.fieldRef),"data-type":p,disabled:D,mod:[{disabled:D,pointer:_},v],...E(`field`),...C,id:T?.inputId||g,"aria-invalid":w?.hasError,"aria-describedby":T?.describedBy,type:`text`,onMouseDown:e=>!_&&e.stopPropagation()})});A.classes=O,A.displayName=`@mantine/core/PillsInputField`;var j={size:`sm`},M=a(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:o,error:s,variant:c,...u}=l([`Input`,`InputWrapper`,`PillsInput`],j,e),d=(0,h.useRef)(null);return(0,x.jsx)(y,{value:{fieldRef:d,size:i,disabled:a,hasError:!!s,variant:c},children:(0,x.jsx)(p,{size:i,error:s,variant:c,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...u,multiline:!0,disabled:a,__staticSelector:o||`PillsInput`,withAria:!1,children:t})})});M.displayName=`@mantine/core/PillsInput`,M.classes=p.classes,M.Field=A;export{D as n,v as r,M as t};
2//# sourceMappingURL=PillsInput-DNV9P6fY.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.