PageSourceSearch

https://tcgcrew.com/assets/QuantityControl-BIKKcbkt.js

js tcgcrew.com collected 2026-10-02 16:07:45 UTC 3,915 bytes, 1 lines download raw bytes

1import{j as n,K as l,a0 as A,t as D}from"./index-PXpjhCaY.js";import{r as u}from"./vendor-react-SfNqDmFq.js";import{aa as f,aF as E}from"./vendor-icons-Dq2TnJO2.js";function M({quantity:o,onChange:s,disabled:r,variant:j="tile"}){const[k,c]=u.useState(!1),[p,m]=u.useState(""),g=u.useRef(null),i=u.useRef(null),a=j==="inline",t=e=>{e.stopPropagation()};function b(){m(String(o)),c(!0),D(),setTimeout(()=>{var e;return(e=g.current)==null?void 0:e.select()},0)}function x(){const e=parseInt(p,10);c(!1),Number.isFinite(e)&&e!==o&&(s(Math.min(99,Math.max(0,e))),A())}function w(){r||o>=99||(l(),s(o+1))}function y(){r||(l(),s(o-1))}function P(e){t(e),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>b(),500)}function d(){i.current&&(clearTimeout(i.current),i.current=null)}const h=a?"relative w-10 h-10 rounded-full hover:bg-lab-void/20 active:bg-lab-void/30 flex items-center justify-center transition-colors touch-manipulation":'relative w-9 h-9 rounded-full hover:bg-lab-void/20 active:bg-lab-void/30 flex items-center justify-center transition-colors touch-manipulation after:absolute after:inset-[-6px] after:content-[""]',v=a?16:14,C=a?"min-w-[40px] px-2 text-base h-10":"min-w-[36px] px-1.5 text-sm h-9",z=a?"w-14 h-10 text-base":"w-11 h-9 text-sm";if(o===0)return a?n.jsxs("button",{type:"button",onClick:e=>{t(e),l(),s(1)},disabled:r,title:"Ajouter à mon classeur","aria-label":"Ajouter à mon classeur",className:"inline-flex items-center gap-1.5 px-4 h-11 rounded-full text-sm font-bold bg-orange-500 text-lab-void ring-1 ring-orange-300/50 shadow-md active:bg-orange-600 transition-colors touch-manipulation",children:[n.jsx(f,{size:16,strokeWidth:2.5})," Ajouter"]}):n.jsx("button",{type:"button",onClick:e=>{t(e),l(),s(1)},onPointerDown:t,disabled:r,title:"Ajouter à mon classeur","aria-label":"Ajouter à mon classeur",className:"absolute top-2 right-2 z-20 w-9 h-9 rounded-full bg-lab-void/75 backdrop-blur-sm border border-lab-border-subtle text-lab-text-secondary hover:bg-orange-500 hover:text-lab-void hover:border-orange-500 active:bg-orange-600 transition-all flex items-center justify-center touch-manipulation after:absolute after:inset-[-6px] after:content-[''] shadow-md",children:n.jsx(f,{size:17,strokeWidth:2.5})});const N=a?"inline-flex items-center gap-0.5 bg-orange-500 text-lab-void rounded-full px-1 py-0.5 shadow-lg ring-1 ring-orange-300/50":"absolute top-2 right-2 z-20 flex items-center gap-0 bg-orange-500 text-lab-void rounded-full pl-0.5 pr-0.5 py-0.5 shadow-lg ring-1 ring-orange-300/50";return n.jsxs("div",{className:N,onPointerDown:t,onClick:t,children:[n.jsx("button",{type:"button",onClick:e=>{t(e),y()},disabled:r,title:"Retirer une copie","aria-label":"Retirer une copie",className:h,children:n.jsx(E,{size:v,strokeWidth:3})}),k?n.jsx("input",{ref:g,type:"text",inputMode:"numeric",enterKeyHint:"done",pattern:"[0-9]*",maxLength:2,value:p,onChange:e=>m(e.target.value.replace(/[^0-9]/g,"")),onBlur:x,onKeyDown:e=>{t(e),e.key==="Enter"&&x(),e.key==="Escape"&&c(!1)},onClick:t,autoFocus:!0,"aria-label":"Quantité",className:`${z} bg-lab-void/30 text-lab-void font-mono font-bold text-center rounded outline-none focus:ring-2 focus:ring-lab-void/40 tabular-nums`}):n.jsx("button",{type:"button",onClick:e=>{t(e),b()},onDoubleClick:e=>{t(e),b()},onPointerDown:P,onPointerUp:d,onPointerLeave:d,onPointerCancel:d,title:"Modifier la quantité (click, double-click ou long-press)","aria-label":`Quantité ${o}, appuyer pour modifier`,className:`${C} text-center font-mono font-bold tabular-nums hover:bg-lab-void/10 active:bg-lab-void/20 rounded-full transition-colors touch-manipulation flex items-center justify-center`,children:o}),n.jsx("button",{type:"button",onClick:e=>{t(e),w()},disabled:r||o>=99,title:"Ajouter une copie","aria-label":"Ajouter une copie",className:`${h} disabled:opacity-40`,children:n.jsx(f,{size:v,strokeWidth:3})})]})}export{M as Q};

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.