fone-design-system_v2 1.0.340 → 1.0.341
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, e as o, z as i, a as r, ai as t, aj as l, ak as n, b as d, B as u, c as C, d as S, f as c, h as p, i as T, j as g, Y as h, aA as D, C as B, X as O, a4 as E, k as b, l as F, aG as L, aB as P, m, n as A, o as k, q as x, D as I, s as M, t as w, u as H, ag as R, a5 as _, a6 as y, aO as G, aM as v, aK as V, F as f, v as N, a7 as U, G as q, w as z, al as J, am as X, I as j, as as K, aF as Z, an as Q, aH as W, a3 as Y, ar as $, ao as aa, M as sa, a8 as ea, a9 as oa, ap as ia, x as ra, N as ta, aD as la, aC as na, P as da, y as ua, aa as Ca, aq as Sa, E as ca, R as pa, r as Ta, p as ga, K as ha, H as Da, J as Ba, ah as Oa, U as Ea, V as ba, ab as Fa, S as La, ac as Pa, aI as ma, L as Aa, O as ka, ad as xa, aL as Ia, Q as Ma, ay as wa, ax as Ha, W as Ra, Z as _a, _ as ya, aE as Ga, T as va, az as Va, $ as fa, a0 as Na, a1 as Ua, at as qa, a2 as za, ae as Ja, af as Xa, au as ja, aJ as Ka, av as Za, aN as Qa, aw as Wa } from "./index-
|
|
1
|
+
import { A as e, e as o, z as i, a as r, ai as t, aj as l, ak as n, b as d, B as u, c as C, d as S, f as c, h as p, i as T, j as g, Y as h, aA as D, C as B, X as O, a4 as E, k as b, l as F, aG as L, aB as P, m, n as A, o as k, q as x, D as I, s as M, t as w, u as H, ag as R, a5 as _, a6 as y, aO as G, aM as v, aK as V, F as f, v as N, a7 as U, G as q, w as z, al as J, am as X, I as j, as as K, aF as Z, an as Q, aH as W, a3 as Y, ar as $, ao as aa, M as sa, a8 as ea, a9 as oa, ap as ia, x as ra, N as ta, aD as la, aC as na, P as da, y as ua, aa as Ca, aq as Sa, E as ca, R as pa, r as Ta, p as ga, K as ha, H as Da, J as Ba, ah as Oa, U as Ea, V as ba, ab as Fa, S as La, ac as Pa, aI as ma, L as Aa, O as ka, ad as xa, aL as Ia, Q as Ma, ay as wa, ax as Ha, W as Ra, Z as _a, _ as ya, aE as Ga, T as va, az as Va, $ as fa, a0 as Na, a1 as Ua, at as qa, a2 as za, ae as Ja, af as Xa, au as ja, aJ as Ka, av as Za, aN as Qa, aw as Wa } from "./index-D91k7MUb.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Accordion,
|
|
4
4
|
o as AntBarChart,
|
|
@@ -1298,7 +1298,7 @@ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:ibe(18,`(${t})`));retur
|
|
|
1298
1298
|
outline: none !important;
|
|
1299
1299
|
box-shadow: none !important;
|
|
1300
1300
|
}
|
|
1301
|
-
`,pDt=({accessorKey:e,formData:t,setField:n,icon:r,disabled:o,readOnly:i,maxLength:a})=>U.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:U.jsx(Wh,{value:t[e],name:t[e],disabled:o,readOnly:i,sx:{width:"100%",height:"2.532rem","& .MuiInputBase-input":{padding:r?"0.27rem 1rem 0.2rem 3rem !important":"0.27rem 1rem 0.2rem 1rem !important"},"& .MuiOutlinedInput-root":{"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#9ca3af"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{outline:"none !important",boxShadow:"none",border:"2px solid #0084FE"}},"& legend":{display:"none"}},spellCheck:!1,onChange:s=>{let l=s.currentTarget.value;typeof a=="number"&&(l=l.slice(0,a)),n(e,l)}})}),hDt=({accessorKey:e,formData:t,setField:n,icon:r,disabled:o,readOnly:i})=>U.jsx(Wh,{value:t[e],name:t[e],disabled:o,readOnly:i,sx:{width:"100%",height:"2.532rem","& .MuiInputBase-input":{padding:r?"0.27rem 1rem 0.2rem 3rem !important":"0.27rem 1rem 0.2rem 1rem !important"},"& .MuiOutlinedInput-root":{"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#9ca3af"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{outline:"none !important",boxShadow:"none",border:"2px solid #0084FE"}}},onChange:a=>{const s=a.currentTarget.value.replace(/[^0-9]/g,"");n(e,s)}}),gDt=({formData:e,cellItem:t,setField:n})=>U.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:U.jsx(jT,{menuItems:t==null?void 0:t.menuItems,value:e[t.accessorKey],name:t.accessorKey,displayEmpty:!0,renderValue:r=>{var a;const o=r,i=(a=t==null?void 0:t.menuItems)==null?void 0:a.find(s=>s.value===o);return i?i.label:""},onChange:r=>{n(t.accessorKey,r.target.value)},sx:{width:"100%",height:"2.7rem","& .MuiSelect-select":{padding:"0.1rem 1rem 0 1rem !important"},"&:hover .MuiOutlinedInput-notchedOutline":{border:"1px solid #9ca3af !important"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"2px solid #0084FE !important"}}})}),Ibe=({value:e,icon:t})=>U.jsx("span",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",padding:t?"0 3rem":"0 1rem"},children:e}),vDt=({value:e,vSpan:t,buttons:n,cellItem:r,formData:o,setField:i})=>{const a=(()=>{var s,l,c,u;switch(r.type){case"text":return U.jsx(Ibe,{value:r.value??"",icon:(s=r.startIcon)==null?void 0:s.icon});case"input":return U.jsx(pDt,{accessorKey:r.accessorKey,formData:o,setField:i,icon:(l=r.startIcon)==null?void 0:l.icon,disabled:r==null?void 0:r.disabled,readOnly:r==null?void 0:r.readOnly,maxLength:r==null?void 0:r.maxLength});case"inputNum":return U.jsx(hDt,{accessorKey:r.accessorKey,formData:o,setField:i,icon:(c=r.startIcon)==null?void 0:c.icon,disabled:r==null?void 0:r.disabled,readOnly:r==null?void 0:r.readOnly});case"select":return U.jsx(gDt,{formData:o,cellItem:r,setField:i});case"checkbox":return U.jsx(lDt,{accessorKey:r.accessorKey,formData:o,setField:i});case"datepicker":return U.jsx(cDt,{accessorKey:r.accessorKey,formData:o,setField:i});case"dateRangePicker":return U.jsx(fDt,{accessorKey:r.accessorKey,formData:o,setField:i});case void 0:return r==null?void 0:r.value;default:return U.jsx(Ibe,{value:(r==null?void 0:r.value)??"",icon:(u=r.startIcon)==null?void 0:u.icon})}})();return U.jsx(U.Fragment,{children:e!==void 0&&U.jsx(aDt,{colSpan:t,style:{verticalAlign:"middle"},children:(()=>{var h,g;const s=Array.isArray(n)&&n.length>0,c={display:"flex",height:"100%",alignItems:"center",justifyContent:"space-between",paddingLeft:typeof a=="string"?"1rem":"0"},u={display:"flex",flexShrink:0},A={width:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},f={position:"absolute",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",height:"100%",zIndex:2},d=()=>{const v=(r==null?void 0:r.type)===void 0,m=(r==null?void 0:r.type)==="checkbox",b=!!(r!=null&&r.startIcon||r!=null&&r.endIcon),w=typeof(r==null?void 0:r.value)=="string";return v?b?A:w?{padding:"0 1rem"}:{}:b?A:m?{display:"flex",height:"100%",alignItems:"center"}:{}};if(s)return U.jsxs("div",{style:c,children:[a,U.jsx("div",{style:u,children:n.map((v,m)=>U.jsx(ya,{size:"xsmall",variant:v==null?void 0:v.variant,disabled:v==null?void 0:v.disabled,sx:{marginLeft:"0.2rem",flex:"0 0 auto"},onClick:v==null?void 0:v.onClick,type:"button",children:v==null?void 0:v.title},`${v==null?void 0:v.title}-${m}`))})]});const p=d();return U.jsxs("div",{style:p,children:[(r==null?void 0:r.startIcon)&&U.jsx("button",{onClick:(h=r.startIcon)==null?void 0:h.onClick,style:{...f,left:"0.4rem"},type:"button",children:r.startIcon.icon}),a,(r==null?void 0:r.endIcon)&&U.jsx("button",{onClick:(g=r.endIcon)==null?void 0:g.onClick,style:{...f,right:"1.4rem"},type:"button",children:r.endIcon.icon})]})})()})})},mDt=({title:e,required:t,colGroup:n,tSpan:r})=>U.jsx(U.Fragment,{children:e&&U.jsxs(iDt,{style:{width:n?"auto":"11rem",verticalAlign:"middle"},colSpan:r,children:[e,t&&U.jsx("span",{style:{color:"#ec193a",fontSize:"2rem",lineHeight:"1.2rem"},children:"*"})]})}),yDt=({formData:e,setField:t,row:n,rowIdx:r,getSpan:o,colGroup:i})=>U.jsx("tr",{children:n==null?void 0:n.map((a,s)=>{if(!a||typeof a!="object")return null;if(a.kind==="title"){const l=o("th",a.accessorKey);return U.jsx(mDt,{title:a.title,required:a.required,colGroup:i,tSpan:l},s)}if(a.kind==="value"){const l=o("td",a.accessorKey);return U.jsx(vDt,{value:a.value,vSpan:l,buttons:a.buttons,cellItem:a,formData:e,setField:t},s)}return null})},r),bDt=({formData:e,setField:t,rows:n,getSpan:r,colGroup:o})=>U.jsx(U.Fragment,{children:n==null?void 0:n.map((i,a)=>U.jsx(yDt,{formData:e,setField:t,row:i,rowIdx:a,getSpan:r,colGroup:o},a))}),wDt=({formData:e,setField:t,rows:n,getSpan:r,colGroup:o})=>U.jsx(rDt,{children:U.jsxs(oDt,{border:1,children:[U.jsx(sDt,{colGroup:o}),U.jsx("tbody",{children:U.jsx(bDt,{formData:e,setField:t,rows:n,getSpan:r,colGroup:o})})]})}),CDt=({onSave:e,formData:t,items:n})=>{const[r,o]=V.useState({open:!1,type:"confirm",message:""}),i=()=>{if(n.filter(l=>l.required).map(l=>l.accessorKey).filter(l=>{const c=t[l];return c==null||c===""||Array.isArray(c)&&c.length===0}).length>0){o({open:!0,type:"error",message:"모든 필수 항목을 입력해주세요"});return}o({open:!0,type:"confirm",message:"저장하시겠습니까?"})};return U.jsxs(U.Fragment,{children:[e&&U.jsx(ya,{onClick:i,startIcon:U.jsx($Ee,{sx:{"&":{fontSize:"1.4rem !important"}}}),size:"xxsmall",variant:"contained",type:"button",children:"저장"}),U.jsx(HT,{open:r.open,onClose:()=>o({...r,open:!1}),type:r.type,content:r.message,onOk:()=>{e==null||e(t),o({...r,open:!1})}})]})},xDt=({title:e})=>U.jsx(U.Fragment,{children:e&&U.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[U.jsxs("svg",{width:"22",height:"24",viewBox:"0 0 22 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[U.jsx("path",{d:"M7.08211 23.8664L1.01485 21.1144C0.396482 20.8315 0 20.2342 0 19.5777V7.8955C0 6.89667 1.08396 6.23659 2.02243 6.66616L8.08969 9.41819C8.70806 9.70109 9.10454 10.2983 9.10454 10.9548V22.6371C9.10454 23.6359 8.02058 24.296 7.08211 23.8664Z",fill:"#F83A3A","fill-opacity":"0.6"}),U.jsx("path",{d:"M13.5282 20.6013L7.46089 17.8493C6.84254 17.5664 6.44604 16.9692 6.44604 16.3126V4.62694C6.44604 3.6281 7.53001 2.96804 8.46847 3.3976L14.5358 6.14964C15.1541 6.43252 15.5506 7.02973 15.5506 7.68632V19.3685C15.5506 20.3673 14.4666 21.0274 13.5282 20.5978V20.6013Z",fill:"#4A6DFD"}),U.jsx("path",{d:"M19.9776 17.3372L13.9103 14.5851C13.292 14.3023 12.8954 13.7051 12.8954 13.0485V1.36277C12.8954 0.363945 13.9794 -0.296125 14.9178 0.133443L20.9851 2.88548C21.6035 3.16837 22 3.76558 22 4.42215V16.1043C22 17.1032 20.916 17.7633 19.9776 17.3337V17.3372Z",fill:"#1D3475","fill-opacity":"0.8"}),U.jsx("path",{d:"M8.0899 9.41368L6.4494 8.6698V16.3077C6.4494 16.9643 6.84588 17.565 7.46425 17.8444L9.10475 18.5883V10.9539C9.10475 10.2973 8.70827 9.69657 8.0899 9.41717V9.41368Z",fill:"#5652FF"}),U.jsx("path",{d:"M14.536 6.14941L12.8954 5.40552V13.0434C12.8954 13.7 13.292 14.3007 13.9103 14.5801L15.5507 15.324V7.68956C15.5507 7.03299 15.1543 6.43229 14.536 6.1529V6.14941Z",fill:"#365DEA"})]}),U.jsx("h2",{style:{fontWeight:600,lineHeight:1,margin:0,padding:0,boxSizing:"border-box",fontSize:"var(--ds-table-title-font-size)"},children:e})]})}),SDt=({title:e,onSave:t,formData:n,items:r})=>U.jsxs(_w,{justifyContent:e?"space-between":"flex-end",alignItems:"flex-end",style:{display:!e&&!t?"none":"flex",marginBottom:"1rem",minHeight:"2.6rem"},children:[U.jsx(xDt,{title:e}),U.jsx(CDt,{onSave:t,formData:n,items:r})]}),Tbe=V.forwardRef(({items:e,data:t,title:n,totalColumns:r=4,colGroup:o,onSave:i,onTableChange:a},s)=>{const[l,c]=V.useState([]),{thSpanMap:u,tdSpanMap:A}=V.useMemo(()=>{const m=new Map,b=new Map;return e==null||e.forEach(w=>{var C,x,S,O;w!=null&&w.colSpan&&(((C=w==null?void 0:w.colSpan)==null?void 0:C.target)==="th"&&m.set(w.accessorKey,(x=w==null?void 0:w.colSpan)==null?void 0:x.span),((S=w==null?void 0:w.colSpan)==null?void 0:S.target)==="td"&&b.set(w.accessorKey,(O=w==null?void 0:w.colSpan)==null?void 0:O.span))}),{thSpanMap:m,tdSpanMap:b}},[e]),f=(m,b)=>(m==="th"?u:A).get(b)??1;V.useMemo(()=>{const m=[];let b=[],w=0;e.forEach(C=>{const x=f("th",C.accessorKey),S=f("td",C.accessorKey),O=x+S,T={kind:"title",accessorKey:C.accessorKey,title:C.title,span:x,required:C.required},B={kind:"value",accessorKey:C.accessorKey,type:C.type,value:Array.isArray(t==null?void 0:t[C.accessorKey])?(t==null?void 0:t[C.accessorKey]).join(", "):(t==null?void 0:t[C.accessorKey])??C.value??"",span:S,required:C.required,menuItems:C.menuItems,textAlign:C.textAlign,buttons:C.buttons,onClick:C.onClick,startIcon:C.startIcon,endIcon:C.endIcon,disabled:C.disabled,readOnly:C.readOnly,maxLength:C.maxLength};b.push(T,B),w+=O,w===r&&(m.push(b),b=[],w=0)}),b.length&&m.push(b),c(m)},[e,r]);const[d,p]=V.useState(()=>({...t})),h=V.useRef(!1),g=V.useRef(null);V.useEffect(()=>{p(m=>{const b={...m,...t};return JSON.stringify(m)===JSON.stringify(b)?m:(h.current=!0,b)})},[t]),V.useEffect(()=>{const m=setTimeout(()=>{const b=JSON.stringify(d);if(h.current){h.current=!1,g.current=b;return}g.current!==b&&(g.current=b,a==null||a(d))},100);return()=>clearTimeout(m)},[d,a]);const v=V.useCallback((m,b)=>{p(w=>({...w,[m]:b}))},[]);return U.jsxs(nDt,{ref:s,children:[U.jsx(SDt,{title:n,onSave:i,formData:d,items:e}),U.jsx(wDt,{formData:d,setField:v,rows:l,getSpan:f,colGroup:o})]})});Tbe.displayName="VerticalTable",Dn.extend(pT);const _M=e=>e?mc.css(e):void 0,EDt=mc.createGlobalStyle`
|
|
1301
|
+
`,pDt=({accessorKey:e,formData:t,setField:n,icon:r,disabled:o,readOnly:i,maxLength:a})=>U.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:U.jsx(Wh,{value:t[e],name:t[e],disabled:o,readOnly:i,sx:{width:"100%",height:"2.532rem","& .MuiInputBase-input":{padding:r?"0.27rem 1rem 0.2rem 3rem !important":"0.27rem 1rem 0.2rem 1rem !important"},"& .MuiOutlinedInput-root":{"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#9ca3af"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{outline:"none !important",boxShadow:"none",border:"2px solid #0084FE"}},"& legend":{display:"none"}},spellCheck:!1,onChange:s=>{let l=s.currentTarget.value;typeof a=="number"&&(l=l.slice(0,a)),n(e,l)}})}),hDt=({accessorKey:e,formData:t,setField:n,icon:r,disabled:o,readOnly:i})=>U.jsx(Wh,{value:t[e],name:t[e],disabled:o,readOnly:i,sx:{width:"100%",height:"2.532rem","& .MuiInputBase-input":{padding:r?"0.27rem 1rem 0.2rem 3rem !important":"0.27rem 1rem 0.2rem 1rem !important"},"& .MuiOutlinedInput-root":{"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#9ca3af"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{outline:"none !important",boxShadow:"none",border:"2px solid #0084FE"}}},onChange:a=>{const s=a.currentTarget.value.replace(/[^0-9]/g,"");n(e,s)}}),gDt=({formData:e,cellItem:t,setField:n})=>U.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:U.jsx(jT,{menuItems:t==null?void 0:t.menuItems,value:e[t.accessorKey],name:t.accessorKey,disabled:t==null?void 0:t.disabled,displayEmpty:!0,renderValue:r=>{var a;const o=r,i=(a=t==null?void 0:t.menuItems)==null?void 0:a.find(s=>s.value===o);return i?i.label:""},onChange:r=>{n(t.accessorKey,r.target.value)},sx:{width:"100%",height:"2.7rem","& .MuiSelect-select":{padding:"0.1rem 1rem 0 1rem !important"},"&:hover .MuiOutlinedInput-notchedOutline":{border:"1px solid #9ca3af !important"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"2px solid #0084FE !important"}}})}),Ibe=({value:e,icon:t})=>U.jsx("span",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",padding:t?"0 3rem":"0 1rem"},children:e}),vDt=({value:e,vSpan:t,buttons:n,cellItem:r,formData:o,setField:i})=>{const a=(()=>{var s,l,c,u;switch(r.type){case"text":return U.jsx(Ibe,{value:r.value??"",icon:(s=r.startIcon)==null?void 0:s.icon});case"input":return U.jsx(pDt,{accessorKey:r.accessorKey,formData:o,setField:i,icon:(l=r.startIcon)==null?void 0:l.icon,disabled:r==null?void 0:r.disabled,readOnly:r==null?void 0:r.readOnly,maxLength:r==null?void 0:r.maxLength});case"inputNum":return U.jsx(hDt,{accessorKey:r.accessorKey,formData:o,setField:i,icon:(c=r.startIcon)==null?void 0:c.icon,disabled:r==null?void 0:r.disabled,readOnly:r==null?void 0:r.readOnly});case"select":return U.jsx(gDt,{formData:o,cellItem:r,setField:i});case"checkbox":return U.jsx(lDt,{accessorKey:r.accessorKey,formData:o,setField:i});case"datepicker":return U.jsx(cDt,{accessorKey:r.accessorKey,formData:o,setField:i});case"dateRangePicker":return U.jsx(fDt,{accessorKey:r.accessorKey,formData:o,setField:i});case void 0:return r==null?void 0:r.value;default:return U.jsx(Ibe,{value:(r==null?void 0:r.value)??"",icon:(u=r.startIcon)==null?void 0:u.icon})}})();return U.jsx(U.Fragment,{children:e!==void 0&&U.jsx(aDt,{colSpan:t,style:{verticalAlign:"middle"},children:(()=>{var h,g;const s=Array.isArray(n)&&n.length>0,c={display:"flex",height:"100%",alignItems:"center",justifyContent:"space-between",paddingLeft:typeof a=="string"?"1rem":"0"},u={display:"flex",flexShrink:0},A={width:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},f={position:"absolute",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",height:"100%",zIndex:2},d=()=>{const v=(r==null?void 0:r.type)===void 0,m=(r==null?void 0:r.type)==="checkbox",b=!!(r!=null&&r.startIcon||r!=null&&r.endIcon),w=typeof(r==null?void 0:r.value)=="string";return v?b?A:w?{padding:"0 1rem"}:{}:b?A:m?{display:"flex",height:"100%",alignItems:"center"}:{}};if(s)return U.jsxs("div",{style:c,children:[a,U.jsx("div",{style:u,children:n.map((v,m)=>U.jsx(ya,{size:"xsmall",variant:v==null?void 0:v.variant,disabled:v==null?void 0:v.disabled,sx:{marginLeft:"0.2rem",flex:"0 0 auto"},onClick:v==null?void 0:v.onClick,type:"button",children:v==null?void 0:v.title},`${v==null?void 0:v.title}-${m}`))})]});const p=d();return U.jsxs("div",{style:p,children:[(r==null?void 0:r.startIcon)&&U.jsx("button",{onClick:(h=r.startIcon)==null?void 0:h.onClick,style:{...f,left:"0.4rem"},type:"button",children:r.startIcon.icon}),a,(r==null?void 0:r.endIcon)&&U.jsx("button",{onClick:(g=r.endIcon)==null?void 0:g.onClick,style:{...f,right:"1.4rem"},type:"button",children:r.endIcon.icon})]})})()})})},mDt=({title:e,required:t,colGroup:n,tSpan:r})=>U.jsx(U.Fragment,{children:e&&U.jsxs(iDt,{style:{width:n?"auto":"11rem",verticalAlign:"middle"},colSpan:r,children:[e,t&&U.jsx("span",{style:{color:"#ec193a",fontSize:"2rem",lineHeight:"1.2rem"},children:"*"})]})}),yDt=({formData:e,setField:t,row:n,rowIdx:r,getSpan:o,colGroup:i})=>U.jsx("tr",{children:n==null?void 0:n.map((a,s)=>{if(!a||typeof a!="object")return null;if(a.kind==="title"){const l=o("th",a.accessorKey);return U.jsx(mDt,{title:a.title,required:a.required,colGroup:i,tSpan:l},s)}if(a.kind==="value"){const l=o("td",a.accessorKey);return U.jsx(vDt,{value:a.value,vSpan:l,buttons:a.buttons,cellItem:a,formData:e,setField:t},s)}return null})},r),bDt=({formData:e,setField:t,rows:n,getSpan:r,colGroup:o})=>U.jsx(U.Fragment,{children:n==null?void 0:n.map((i,a)=>U.jsx(yDt,{formData:e,setField:t,row:i,rowIdx:a,getSpan:r,colGroup:o},a))}),wDt=({formData:e,setField:t,rows:n,getSpan:r,colGroup:o})=>U.jsx(rDt,{children:U.jsxs(oDt,{border:1,children:[U.jsx(sDt,{colGroup:o}),U.jsx("tbody",{children:U.jsx(bDt,{formData:e,setField:t,rows:n,getSpan:r,colGroup:o})})]})}),CDt=({onSave:e,formData:t,items:n})=>{const[r,o]=V.useState({open:!1,type:"confirm",message:""}),i=()=>{if(n.filter(l=>l.required).map(l=>l.accessorKey).filter(l=>{const c=t[l];return c==null||c===""||Array.isArray(c)&&c.length===0}).length>0){o({open:!0,type:"error",message:"모든 필수 항목을 입력해주세요"});return}o({open:!0,type:"confirm",message:"저장하시겠습니까?"})};return U.jsxs(U.Fragment,{children:[e&&U.jsx(ya,{onClick:i,startIcon:U.jsx($Ee,{sx:{"&":{fontSize:"1.4rem !important"}}}),size:"xxsmall",variant:"contained",type:"button",children:"저장"}),U.jsx(HT,{open:r.open,onClose:()=>o({...r,open:!1}),type:r.type,content:r.message,onOk:()=>{e==null||e(t),o({...r,open:!1})}})]})},xDt=({title:e})=>U.jsx(U.Fragment,{children:e&&U.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[U.jsxs("svg",{width:"22",height:"24",viewBox:"0 0 22 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[U.jsx("path",{d:"M7.08211 23.8664L1.01485 21.1144C0.396482 20.8315 0 20.2342 0 19.5777V7.8955C0 6.89667 1.08396 6.23659 2.02243 6.66616L8.08969 9.41819C8.70806 9.70109 9.10454 10.2983 9.10454 10.9548V22.6371C9.10454 23.6359 8.02058 24.296 7.08211 23.8664Z",fill:"#F83A3A","fill-opacity":"0.6"}),U.jsx("path",{d:"M13.5282 20.6013L7.46089 17.8493C6.84254 17.5664 6.44604 16.9692 6.44604 16.3126V4.62694C6.44604 3.6281 7.53001 2.96804 8.46847 3.3976L14.5358 6.14964C15.1541 6.43252 15.5506 7.02973 15.5506 7.68632V19.3685C15.5506 20.3673 14.4666 21.0274 13.5282 20.5978V20.6013Z",fill:"#4A6DFD"}),U.jsx("path",{d:"M19.9776 17.3372L13.9103 14.5851C13.292 14.3023 12.8954 13.7051 12.8954 13.0485V1.36277C12.8954 0.363945 13.9794 -0.296125 14.9178 0.133443L20.9851 2.88548C21.6035 3.16837 22 3.76558 22 4.42215V16.1043C22 17.1032 20.916 17.7633 19.9776 17.3337V17.3372Z",fill:"#1D3475","fill-opacity":"0.8"}),U.jsx("path",{d:"M8.0899 9.41368L6.4494 8.6698V16.3077C6.4494 16.9643 6.84588 17.565 7.46425 17.8444L9.10475 18.5883V10.9539C9.10475 10.2973 8.70827 9.69657 8.0899 9.41717V9.41368Z",fill:"#5652FF"}),U.jsx("path",{d:"M14.536 6.14941L12.8954 5.40552V13.0434C12.8954 13.7 13.292 14.3007 13.9103 14.5801L15.5507 15.324V7.68956C15.5507 7.03299 15.1543 6.43229 14.536 6.1529V6.14941Z",fill:"#365DEA"})]}),U.jsx("h2",{style:{fontWeight:600,lineHeight:1,margin:0,padding:0,boxSizing:"border-box",fontSize:"var(--ds-table-title-font-size)"},children:e})]})}),SDt=({title:e,onSave:t,formData:n,items:r})=>U.jsxs(_w,{justifyContent:e?"space-between":"flex-end",alignItems:"flex-end",style:{display:!e&&!t?"none":"flex",marginBottom:"1rem",minHeight:"2.6rem"},children:[U.jsx(xDt,{title:e}),U.jsx(CDt,{onSave:t,formData:n,items:r})]}),Tbe=V.forwardRef(({items:e,data:t,title:n,totalColumns:r=4,colGroup:o,onSave:i,onTableChange:a},s)=>{const[l,c]=V.useState([]),{thSpanMap:u,tdSpanMap:A}=V.useMemo(()=>{const m=new Map,b=new Map;return e==null||e.forEach(w=>{var C,x,S,O;w!=null&&w.colSpan&&(((C=w==null?void 0:w.colSpan)==null?void 0:C.target)==="th"&&m.set(w.accessorKey,(x=w==null?void 0:w.colSpan)==null?void 0:x.span),((S=w==null?void 0:w.colSpan)==null?void 0:S.target)==="td"&&b.set(w.accessorKey,(O=w==null?void 0:w.colSpan)==null?void 0:O.span))}),{thSpanMap:m,tdSpanMap:b}},[e]),f=(m,b)=>(m==="th"?u:A).get(b)??1;V.useMemo(()=>{const m=[];let b=[],w=0;e.forEach(C=>{const x=f("th",C.accessorKey),S=f("td",C.accessorKey),O=x+S,T={kind:"title",accessorKey:C.accessorKey,title:C.title,span:x,required:C.required},B={kind:"value",accessorKey:C.accessorKey,type:C.type,value:Array.isArray(t==null?void 0:t[C.accessorKey])?(t==null?void 0:t[C.accessorKey]).join(", "):(t==null?void 0:t[C.accessorKey])??C.value??"",span:S,required:C.required,menuItems:C.menuItems,textAlign:C.textAlign,buttons:C.buttons,onClick:C.onClick,startIcon:C.startIcon,endIcon:C.endIcon,disabled:C.disabled,readOnly:C.readOnly,maxLength:C.maxLength};b.push(T,B),w+=O,w===r&&(m.push(b),b=[],w=0)}),b.length&&m.push(b),c(m)},[e,r]);const[d,p]=V.useState(()=>({...t})),h=V.useRef(!1),g=V.useRef(null);V.useEffect(()=>{p(m=>{const b={...m,...t};return JSON.stringify(m)===JSON.stringify(b)?m:(h.current=!0,b)})},[t]),V.useEffect(()=>{const m=setTimeout(()=>{const b=JSON.stringify(d);if(h.current){h.current=!1,g.current=b;return}g.current!==b&&(g.current=b,a==null||a(d))},100);return()=>clearTimeout(m)},[d,a]);const v=V.useCallback((m,b)=>{p(w=>({...w,[m]:b}))},[]);return U.jsxs(nDt,{ref:s,children:[U.jsx(SDt,{title:n,onSave:i,formData:d,items:e}),U.jsx(wDt,{formData:d,setField:v,rows:l,getSpan:f,colGroup:o})]})});Tbe.displayName="VerticalTable",Dn.extend(pT);const _M=e=>e?mc.css(e):void 0,EDt=mc.createGlobalStyle`
|
|
1302
1302
|
.${({$cls:e})=>e} {
|
|
1303
1303
|
${({$style:e})=>_M(e)}
|
|
1304
1304
|
}
|
|
@@ -55754,7 +55754,7 @@ function nlt() {
|
|
|
55754
55754
|
];
|
|
55755
55755
|
bX = !0, o.label = 1;
|
|
55756
55756
|
case 1:
|
|
55757
|
-
return o.trys.push([1, 6, , 7]), e = I.version || "", t = parseInt(e.split(".")[0], 10), t >= 18 ? [4, import("./client-
|
|
55757
|
+
return o.trys.push([1, 6, , 7]), e = I.version || "", t = parseInt(e.split(".")[0], 10), t >= 18 ? [4, import("./client-RdQwxhf_.js").then((a) => a.c)] : [3, 3];
|
|
55758
55758
|
case 2:
|
|
55759
55759
|
return n = o.sent(), D6 = n.createRoot, [3, 5];
|
|
55760
55760
|
case 3:
|
|
@@ -132295,6 +132295,7 @@ const jCe = {
|
|
|
132295
132295
|
menuItems: t == null ? void 0 : t.menuItems,
|
|
132296
132296
|
value: e[t.accessorKey],
|
|
132297
132297
|
name: t.accessorKey,
|
|
132298
|
+
disabled: t == null ? void 0 : t.disabled,
|
|
132298
132299
|
displayEmpty: !0,
|
|
132299
132300
|
renderValue: (r) => {
|
|
132300
132301
|
var a;
|
package/package.json
CHANGED