You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Application-Web/outputs/public/front/components/Rack.tsx-02c40791.js

2 lines
619 B

import{j as e,r as f}from"../../jsx-runtime-2e2d9038.js";import{D as u}from"../../cjs-ff7eb0e1.js";import"../../index-ca121481.js";function k({id:i,objects:r,onChange:t,canDetach:n,onElementDetached:x,render:a}){return e.jsx("div",{id:i,style:{display:"flex"},children:r.map(o=>e.jsx(l,{item:o,render:a,onTryDetach:(s,d)=>{if(!n(s))return;const c=r.findIndex(p=>p.key===d.key);t(r.toSpliced(c,1)),x(s,d)}},o.key))})}function l({item:i,onTryDetach:r,render:t}){const n=f.useRef(null);return e.jsx(u,{position:{x:0,y:0},nodeRef:n,onStop:()=>r(n.current,i),children:e.jsx("div",{ref:n,children:t(i)})})}export{k as Rack};