import{j as h}from"./index-6605a014.js";import{r as y}from"./react-e45097e1.js";import{y as d,z as f,V as g}from"./Author-826c76c5.js";import"./antd-6dbc138d.js";const s=(i,a=2)=>(100*i).toFixed(2)+"%";function n({children:i}){const a=d(),[r={},t=[1,1],o=0]=f(["layout","size","gutter"]);y.useEffect(()=>{a.children.forEach(m=>{const{dimension:e}=r[m.instanceId]||{dimension:{x:0,y:0,w:1,h:1,z:0}},c=Math.max(1,Math.min(e.w,t[0]-e.x)),p=Math.max(1,Math.min(e.h,t[1]-e.y)),l={position:"absolute",left:s(e.x/t[0]),top:s(e.y/t[1]),width:s(c/t[0]),height:s(p/t[1]),paddingRight:o,paddingBottom:o,touchAction:"none"};m.setOverlayStyle("default",l)})},[a,r,t,o]);const u={position:"absolute",left:o,top:o,right:0,bottom:0};return h.jsx(g,{style:u,children:i})}n.title="网格布局";n.isLayoutable=!0;n.params={size:{type:"size",name:"网格尺寸"},gutter:{type:"number",name:"网格留边"}};export{n as default};
