@bwg-ui/core 1.0.0 → 1.1.1
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.
- package/dist/chunks/AuthContext-CXng9fj0.cjs +1 -0
- package/dist/chunks/AuthContext-Ei2P-z4d.js +52 -0
- package/dist/chunks/BwgLargeUploader-BOf905_l.cjs +2 -0
- package/dist/chunks/BwgLargeUploader-BeI8oV8y.js +3315 -0
- package/dist/chunks/FileUtils-BcnoJ2zn.js +140 -0
- package/dist/chunks/FileUtils-CCBueCSG.cjs +1 -0
- package/dist/chunks/PublicLayout-BiTPwkVq.cjs +35 -0
- package/dist/chunks/PublicLayout-g9WMtoZ0.js +138 -0
- package/dist/chunks/{QuickServiceToggle-y7esp1kp.js → SSOHandler-DVa4JKKb.js} +14831 -14630
- package/dist/chunks/SSOHandler-DiwKoTdN.cjs +183 -0
- package/dist/chunks/ScreenProtectContext-ofv2QgMp.cjs +1 -0
- package/dist/chunks/ScreenProtectContext-zByHldrr.js +114 -0
- package/dist/chunks/SearchBoxContext-B1nxG-Wd.cjs +1 -0
- package/dist/chunks/{ServiceCodeContext-CDZMr3Mm.js → SearchBoxContext-DhKP2pQj.js} +39 -39
- package/dist/chunks/{UtilsContext-B16Gh9LL.cjs → UtilsContext-CLJwXO1Q.cjs} +1 -1
- package/dist/chunks/{UtilsContext-BbfZYiMR.js → UtilsContext-CwVwmfrg.js} +9 -9
- package/dist/chunks/{codeStore-bxk_q1sl.js → codeStore-9alVvK1W.js} +1 -1
- package/dist/chunks/{codeStore-Dt6j826J.cjs → codeStore-B_4WPxpS.cjs} +1 -1
- package/dist/chunks/envUtils-C9Gf5aek.js +29 -0
- package/dist/chunks/envUtils-CduTHoHu.cjs +1 -0
- package/dist/chunks/menuStore-BwLORbDu.cjs +1 -0
- package/dist/chunks/{favoriteStore-CguRSEcH.js → menuStore-DXn19Xnr.js} +136 -123
- package/dist/chunks/{popupStore-CVD8SPTa.cjs → popupStore-D_-Wpcao.cjs} +1 -1
- package/dist/chunks/{popupStore-Dp_fqtim.js → popupStore-JBIRLYTL.js} +1 -1
- package/dist/chunks/{serviceConfig-BJBsdee_.js → serviceConfig-4iBLfLzF.js} +176 -205
- package/dist/chunks/serviceConfig-B5UJqk4b.cjs +2 -0
- package/dist/components/common/BwgCmptArea.d.ts +84 -6
- package/dist/components/common/BwgCol.d.ts +19 -0
- package/dist/components/common/BwgConfigProvider.d.ts +2 -1
- package/dist/components/common/BwgGrid.d.ts +9 -4
- package/dist/components/common/BwgInfoArea.d.ts +2 -1
- package/dist/components/common/BwgRow.d.ts +19 -0
- package/dist/components/common/BwgTitleBox.d.ts +5 -1
- package/dist/components/common/BwgView.d.ts +2 -13
- package/dist/components/common/SSOHandler.d.ts +2 -0
- package/dist/components/common/SearchBox.d.ts +59 -7
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.d.ts +19 -16
- package/dist/components/common/index.js +20 -17
- package/dist/components/core/BwgLargeUploader.d.ts +4 -1
- package/dist/components/core/BwgSearch.d.ts +4 -0
- package/dist/components/core/BwgUploader.d.ts +30 -7
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +1 -1
- package/dist/components/layout/ProgressOverlay.d.ts +10 -0
- package/dist/components/layout/ProtectLayout.d.ts +6 -0
- package/dist/components/layout/PublicLayout.d.ts +6 -0
- package/dist/components/layout/index.cjs +1 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +304 -289
- package/dist/provider/contexts/AuthContext.d.ts +12 -0
- package/dist/provider/contexts/ScreenProtectContext.d.ts +21 -0
- package/dist/provider/contexts/index.d.ts +2 -0
- package/dist/provider/index.cjs +1 -1
- package/dist/provider/index.js +25 -19
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.js +5 -5
- package/dist/styles/assets/images/backgrounds/krx_login_bg.png +0 -0
- package/dist/styles/assets/images/contents/icon/ico-lockscreen.svg +44 -0
- package/dist/styles/assets/images/logos/krx-logo-full.svg +35 -0
- package/dist/styles/components.css +130 -17
- package/dist/styles/global.css +19 -0
- package/dist/styles/layout.css +108 -35
- package/dist/styles/login.css +39 -33
- package/dist/styles/variables.css +221 -5
- package/dist/types/global.d.ts +2 -0
- package/dist/utils/FileUtils.d.ts +7 -0
- package/dist/utils/envUtils.d.ts +8 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +105 -103
- package/package.json +32 -5
- package/dist/chunks/BwgLargeUploader-ByN1XWV4.js +0 -809
- package/dist/chunks/BwgLargeUploader-CU0-MVk4.cjs +0 -1
- package/dist/chunks/QuickServiceToggle-CiCuWfCF.cjs +0 -183
- package/dist/chunks/ServiceCodeContext--ZnMtjzD.cjs +0 -1
- package/dist/chunks/favoriteStore-TgeeY32l.cjs +0 -1
- package/dist/chunks/messageUtils-9DXOwada.js +0 -117
- package/dist/chunks/messageUtils-RjJD_ArW.cjs +0 -1
- package/dist/chunks/serviceConfig-Cr2P4yr4.cjs +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./jsx-runtime-CeSfJrVB.cjs"),r=require("antd"),g=require("react"),v=require("./popupStore-CVD8SPTa.cjs"),M=require("imask"),C=require("dayjs"),B=require("@ant-design/icons"),E=g.memo(({children:s,label:e,name:l,rules:a,initialValue:n,style:o})=>{const i={fontWeight:"bold"},c=Array.isArray(a)&&a.some(f=>f.required===!0),u=()=>typeof e=="string"?t.jsxRuntimeExports.jsxs("span",{style:i,children:[e,c&&t.jsxRuntimeExports.jsx("span",{style:{color:"#ff4d4f",marginLeft:"4px"},children:"*"})]}):t.jsxRuntimeExports.jsx("span",{style:i,children:e});return t.jsxRuntimeExports.jsx(r.Form.Item,{label:u(),labelAlign:"left",name:l,rules:a,colon:!1,initialValue:n,style:o,children:s})}),L=g.forwardRef(({children:s,labelCol:e,style:l,className:a,...n},o)=>t.jsxRuntimeExports.jsx(r.Form,{ref:o,...n,requiredMark:!1,labelCol:e||{flex:"100px"},style:{padding:"10px",...l},className:`bwg-form ${a??""}`,children:s}));L.displayName="BwgForm";const D=({itemProps:s,selectProps:e={options:[],allowClear:!0}})=>{const l=r.Form.useFormInstance(),a=!!l,n=g.useMemo(()=>e?.addField==="ALL"?[{label:"전체",value:""},...e?.options||[]]:e?.addField==="NULL"?[{label:"",value:""},...e?.options||[]]:e?.options||[],[e.options,e.addField]),o=u=>{e.onChange?.(u)},i={...e,allowClear:e.allowClear??!0,options:n,onChange:o,variant:e.variant};console.log("selectComponentProps :: ",i);const c=t.jsxRuntimeExports.jsx(r.Select,{...i,disabled:e.disabled});return e.copyable&&!a&&console.warn("BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."),e.copyable?t.jsxRuntimeExports.jsx(E,{...s,children:t.jsxRuntimeExports.jsxs(r.Space.Compact,{block:!0,children:[t.jsxRuntimeExports.jsx(r.Form.Item,{name:s?.name,rules:s?.rules,style:{width:"100%",marginBottom:0},validateStatus:"",help:"",children:c}),t.jsxRuntimeExports.jsx(r.Typography.Paragraph,{copyable:{text:a&&l?.getFieldValue(s?.name)?.toString()||"",tooltips:["코드복사","코드복사됨"]},style:{margin:0,backgroundColor:"#f5f5f5",borderRadius:"4px",border:"1px solid #d9d9d9",fontSize:"12px",color:"#666",display:"flex",alignItems:"center",height:"30px",padding:"0 8px"}})]})}):t.jsxRuntimeExports.jsx(E,{...s,children:c})},b=r.Input.Search,N=s=>{const e=r.Form.useFormInstance(),{openPopup:l}=v.usePopupStore(),a=s.itemProps?.name||[],n=s.popupConfig||{callback(i){console.log("callback data :: ",i),a.length>1?(e.setFieldValue(a[0],i.code),e.setFieldValue(a[1],i.name)):e.setFieldValue(a,i.code)}},o={...s,placeholder:typeof s.placeholder=="string"?s.placeholder:s.placeholder?.[0]||"",onSearch:i=>{s.popuCd&&l(s.popuCd,s.popupParams,n)}};return a.length>1?t.jsxRuntimeExports.jsx(E,{...s.itemProps,name:void 0,children:t.jsxRuntimeExports.jsxs(r.Space.Compact,{block:!0,children:[t.jsxRuntimeExports.jsx(r.Form.Item,{name:a[0],rules:s.itemProps?.rules,style:{width:"40%",marginBottom:0},validateStatus:"",help:"",children:t.jsxRuntimeExports.jsx(r.Input,{style:{color:"#999",backgroundColor:"#f5f5f5"},placeholder:s.placeholder?.[0]||"",readOnly:!0})}),t.jsxRuntimeExports.jsx(r.Form.Item,{name:a[1],style:{width:"60%",marginBottom:0},children:t.jsxRuntimeExports.jsx(b,{...o,disabled:s.disabled})})]})}):t.jsxRuntimeExports.jsx(E,{...s.itemProps,children:t.jsxRuntimeExports.jsx(b,{...o})})},O=s=>{if(typeof s=="string")return s.replace(/0/g,"_");if(Array.isArray(s))return s[0].replace(/0/g,"_");if(typeof s=="object"&&"mask"in s&&"blocks"in s){const{mask:e,blocks:l}=s;return e.split(".").map(a=>{const o=l?.[a]?.maxLength??3;return"_".repeat(o)}).join(".")}return""},T=({itemProps:s,inputProps:e,mask:l})=>{const a=g.useRef(null),n=r.Form.useFormInstance(),o=g.useMemo(()=>O(l),[l]);return g.useEffect(()=>{if(!a.current?.input)return;const i=typeof l=="string"||Array.isArray(l)?{mask:l}:l,c=M(a.current.input,i);return c.on("accept",()=>{n&&s?.name&&n.setFieldValue(s.name,c.value)}),()=>{c.destroy()}},[l,n,s?.name]),t.jsxRuntimeExports.jsx(E,{...s,children:t.jsxRuntimeExports.jsx(r.Input,{...e,ref:a,placeholder:o})})},U=s=>{switch(s){case"year":return{format:"YYYY",mask:"0000",outputFormat:"YYYY"};case"month":return{format:"YYYY-MM",mask:"0000-00",outputFormat:"YYYYMM"};case"date":default:return{format:"YYYY-MM-DD",mask:"0000-00-00",outputFormat:"YYYYMMDD"}}},A=({type:s="date",itemProps:e={name:"calendar"},inputProps:l})=>{const{format:a,mask:n,outputFormat:o}=U(s),i=g.useRef(null),c=g.useRef(null),u=r.Form.useFormInstance(),[f,d]=g.useState(!1),[F,h]=g.useState(!1),x=e?.name,[R,p]=g.useState(null);g.useEffect(()=>{if(!i.current?.input)return;const m=M(i.current.input,{mask:n,lazy:!1});return c.current=m,m.on("accept",()=>{console.log("input :: ",m.value);const y=m.value,j=C(y,a,!0);console.log("input :: ",j),y.length===a.length&&j.isValid()&&(console.log("parsed :: ",j.format(o)),u.setFieldValue(x,j.format(o)),c.current.updateValue(),d(!1))}),()=>{m.destroy()}},[a,n]),g.useEffect(()=>{p(C(u.getFieldValue(x)))},[u.getFieldValue(x)]);const Y=m=>{if(!m){c.current?.updateValue();return}const y=m.format(o);console.log("formatted :: ",y),c.current&&(c.current.value=y,c.current.updateValue()),h(!1)};return t.jsxRuntimeExports.jsx(E,{...e,name:void 0,validateStatus:F?"warning":void 0,help:F?"유효하지 않은 날짜입니다":void 0,children:t.jsxRuntimeExports.jsxs("div",{style:{position:"relative"},children:[t.jsxRuntimeExports.jsx(r.Form.Item,{name:x,getValueProps:m=>({value:m?C(m).format(a):void 0}),normalize:m=>m?C(m).format(o):void 0,noStyle:!0,children:t.jsxRuntimeExports.jsx(r.Input,{...l,ref:i,onFocus:()=>{d(!f),c.current?.updateValue()},onKeyDown:m=>{m.key==="Backspace"&&d(!0),m.key==="Tab"&&d(!1)},allowClear:!0,placeholder:n.replace(/0/g,"_"),autoComplete:"off"})}),t.jsxRuntimeExports.jsx(r.DatePicker,{open:f,picker:s,format:a,value:R,onChange:Y,getPopupContainer:m=>m.parentElement,style:{position:"absolute",top:0,left:0,pointerEvents:"none",opacity:0,width:"100%"}})]})})},V=({itemProps:s,inputProps:e})=>t.jsxRuntimeExports.jsx(E,{...s,children:t.jsxRuntimeExports.jsx(r.Input,{...e})}),$=({itemProps:s,inputProps:e,type:l="date",useMask:a=!1})=>{const n={year:{displayFormat:"YYYY",outputFormat:"YYYY"},month:{displayFormat:"YYYY-MM",outputFormat:"YYYYMM"},date:{displayFormat:"YYYY-MM-DD",outputFormat:"YYYYMMDD"}},{displayFormat:o,outputFormat:i}=n[l],c=(u,f)=>{if(e.onChange&&typeof e.onChange=="function"){let d;u instanceof C?d=u.format(i):(d=[],u&&u.map(F=>{d.push(F.format(i))})),e.onChange(d,f)}};return t.jsxRuntimeExports.jsx(E,{...s,getValueProps:u=>({value:u&&C(u)}),normalize:u=>u&&`${C(u).format(i)}`,children:t.jsxRuntimeExports.jsx(r.DatePicker,{...e,format:a?{format:o,type:"mask"}:void 0,onChange:c})})},{RangePicker:z}=r.DatePicker,q=({itemProps:s,inputProps:e,type:l="date",minDate:a,maxDate:n,useMask:o=!1})=>{const i={year:{displayFormat:"YYYY",outputFormat:"YYYY"},month:{displayFormat:"YYYY-MM",outputFormat:"YYYYMM"},date:{displayFormat:"YYYY-MM-DD",outputFormat:"YYYYMMDD"}},{displayFormat:c,outputFormat:u}=i[l],f=(d,F)=>{if(e.onChange&&typeof e.onChange=="function"){let h;d instanceof C?h=d.format(u):(h=[],d&&d.map(x=>{h.push(x.format(u))})),e.onChange(h,F)}};return t.jsxRuntimeExports.jsx(E,{...s,getValueProps:d=>({value:d&&[d[0]?C(d[0]):null,d[1]?C(d[1]):null]}),normalize:d=>[d?.[0]?C(d[0]).format(u):void 0,d?.[1]?C(d[1]).format(u):void 0],children:t.jsxRuntimeExports.jsx(z,{...e,format:o?{format:c,type:"mask"}:void 0,picker:l,order:!0,minDate:a?C(a,u):void 0,maxDate:n?C(n,u):void 0,onChange:f})})},G=({itemProps:s,inputProps:e})=>t.jsxRuntimeExports.jsx(E,{...s,children:t.jsxRuntimeExports.jsx(r.ConfigProvider,{theme:{components:{Radio:{colorPrimary:"#6377D1",colorPrimaryActive:"#6449FC",colorPrimaryHover:"#6449FC"}}},children:t.jsxRuntimeExports.jsx(r.Radio.Group,{...e})})}),H=({itemProps:s,inputProps:e={format:"YN"}})=>{const l=r.Form.useFormInstance(),a=n=>{e.format==="boolean"?l.setFieldValue(s?.name,n.target.checked):l.setFieldValue(s?.name,n.target.checked?"Y":"N"),e.onChange&&e.onChange(n)};return t.jsxRuntimeExports.jsx(E,{...s,getValueProps:n=>(console.log("getValueProps :: ",n),{checked:e.format==="boolean"?!!n:n==="Y"}),normalize:n=>(console.log("normalize :: ",n),typeof n=="boolean"?e.format==="boolean"?n:n?"Y":"N":e.format==="boolean"?!!n:n?"Y":"N"),children:t.jsxRuntimeExports.jsx(r.ConfigProvider,{theme:{components:{Checkbox:{colorPrimary:"#6377D1",colorPrimaryBorder:"#6377D1",colorPrimaryHover:"#6449FC"}}},children:t.jsxRuntimeExports.jsx(r.Checkbox,{...e,onChange:a,children:e?.title})})})},_=({itemProps:s,inputProps:e})=>{const l=r.Form.useFormInstance(),[a,n]=g.useState(s?.initialValue??[]),[o,i]=g.useState([]),c=o.length>0&&o.length==a?.length,u=a?.length>0&&a.length<o.length;g.useEffect(()=>{i(f(e?.options))},[e?.options]),g.useEffect(()=>{n(a)},[a]);const f=h=>{const x=[];return(h||[]).map((R,p)=>{x.push(R.value)}),x},d=h=>{n(h.target.checked?o:[]),l.setFieldValue(s?.name,h.target.checked?o:[])},F=h=>{n(h),l.setFieldValue(s?.name,h),e?.onChange&&typeof e?.onChange=="function"&&e?.onChange(h)};return t.jsxRuntimeExports.jsx(E,{...s,children:t.jsxRuntimeExports.jsxs(r.ConfigProvider,{theme:{components:{Checkbox:{colorPrimary:"#6377D1",colorPrimaryBorder:"#6377D1",colorPrimaryHover:"#6449FC"}}},children:[e?.allCheck&&t.jsxRuntimeExports.jsx(r.Checkbox,{indeterminate:u,checked:c,onChange:d,children:"전체선택"}),t.jsxRuntimeExports.jsx(r.Checkbox.Group,{options:e?.options,value:a,onChange:F})]})})},{TextArea:K}=r.Input,W=({itemProps:s,inputProps:e})=>t.jsxRuntimeExports.jsx(E,{...s,children:t.jsxRuntimeExports.jsx(K,{...e})}),X=({itemProps:s,inputProps:e})=>{const l=n=>{let o=n.toString().split(".");return e?.decimalPoint!=null&&o[1]!=null&&e?.decimalPoint>0?o[1].length>e?.decimalPoint?o[1]="."+o[1].substring(0,e?.decimalPoint):o[1]="."+o[1]:o[1]="",o[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")+o[1]},a=n=>{let o=n.toString().split(".");return e?.decimalPoint!=null&&o[1]!=null&&e?.decimalPoint>0?o[1].length>e?.decimalPoint?o[1]="."+o[1].substring(0,e?.decimalPoint):o[1]="."+o[1]:o[1]="",o[0].replace(/\$\s?|(,*)/g,"")+o[1]};return t.jsxRuntimeExports.jsx(E,{...s,children:t.jsxRuntimeExports.jsx(r.InputNumber,{...e,formatter:n=>l(n),parser:n=>a(n)})})},{Option:S}=r.Select,J=({itemProps:s,inputProps:e})=>{const[l,a]=g.useState([]);return g.useEffect(()=>{e?.addField==="ALL"?a([{label:"전체",value:""},...e?.list||[]]):e?.addField==="NULL"?a([{label:"",value:""},...e?.list||[]]):a(e?.list||[])},[e?.list]),t.jsxRuntimeExports.jsx(E,{...s,getValueProps:n=>n?{value:n&&n.indexOf(",")>0?n.split(","):[n]}:{value:[]},normalize:n=>n!=null&&n!=null&&n.length>0?n.toString():"",children:t.jsxRuntimeExports.jsx(r.Select,{...e,mode:"multiple",children:l.map(n=>{const{value:o,label:i}=n;return e?.printCode?t.jsxRuntimeExports.jsx(S,{value:o,label:i,children:t.jsxRuntimeExports.jsx(r.Space,{children:`[${o}] ${i}`})},o):t.jsxRuntimeExports.jsx(S,{value:o,label:i,children:t.jsxRuntimeExports.jsx(r.Space,{children:`${i}`})},o)})})})},P=s=>t.jsxRuntimeExports.jsx(r.Button,{...s}),Q=[".pdf",".xlsx",".xls",".docx",".doc",".pptx",".ppt",".hwp",".txt",".csv",".jpg",".jpeg",".png",".gif",".zip"],Z=({onUploadComplete:s,trxCd:e,allowedExtensions:l=Q,maxFileSize:a})=>{const o={name:"file",multiple:!0,action:"/api/upload",beforeUpload:i=>{if(l&&l.length>0){const u=(f=>{const d=f.lastIndexOf(".");return d===-1?"":f.substring(d).toLowerCase()})(i.name);if(!l.includes(u))return r.message.error(`${i.name} 파일은 허용되지 않는 확장자입니다. (${l.join(", ")}만 가능)`),r.Upload.LIST_IGNORE}return a&&!(i.size/1024/1024<a)?(r.message.error(`${i.name} 파일 크기는 ${a}MB를 초과할 수 없습니다.`),r.Upload.LIST_IGNORE):!0},data:i=>(console.log("[BwgUploader] Uploading with trxCd:",e),e?{trxCd:e}:{}),onChange(i){const{status:c}=i.file;if(c==="done")if(i.file.response&&i.file.response.success!==void 0)if(i.file.response.success){const{uploadedFiles:u}=i.file.response;u&&Array.isArray(u)&&u.forEach(f=>{const d=f.fileKey,F=f.fileName;s&&s({fileNameP:d,fileNameL:F})}),r.message.success(i.file.response.message||`${i.file.name} 파일이 성공적으로 업로드되었습니다.`)}else r.message.error(i.file.response.message||`${i.file.name} 파일 업로드에 실패했습니다.`);else r.message.success(`${i.file.name} 파일이 성공적으로 업로드되었습니다.`);else c==="error"&&(i.file.response&&i.file.response.message?r.message.error(i.file.response.message):r.message.error(`${i.file.name} 파일 업로드에 실패했습니다.`))},itemRender(i,c,u,f){let d=c.name;c.status==="error"&&(d=`업로드 실패: ${c.response?.message||"알 수 없는 오류"}`);const F=g.cloneElement(i,{href:c.url&&c.url!==""?c.url:void 0,title:void 0});return t.jsxRuntimeExports.jsx(r.Tooltip,{title:d,children:F})}};return t.jsxRuntimeExports.jsx(r.Upload,{...o,listType:"picture",children:t.jsxRuntimeExports.jsx(r.Button,{icon:t.jsxRuntimeExports.jsx(B.UploadOutlined,{}),children:"파일 선택"})})},{Text:k,Link:re}=r.Typography,{Dragger:ee}=r.Upload,te=[".pdf",".xlsx",".xls",".docx",".doc",".pptx",".ppt",".hwp",".txt",".csv",".jpg",".jpeg",".png",".gif",".zip"],se=(s,e=2)=>{if(s===0)return"0 Bytes";const l=1024,a=e<0?0:e,n=["Bytes","KB","MB","GB","TB"],o=Math.floor(Math.log(s)/Math.log(l));return parseFloat((s/Math.pow(l,o)).toFixed(a))+" "+n[o]},ne=({title:s="첨부파일",onUploadComplete:e,trxCd:l,allowedExtensions:a=te})=>{const[n,o]=g.useState([]),[i,c]=g.useState(!1),[u,f]=g.useState(0),d=x=>{if(a&&a.length>0){const p=(Y=>{const m=Y.lastIndexOf(".");return m===-1?"":Y.substring(m).toLowerCase()})(x.name);if(!a.includes(p))return r.message.error(`${x.name} 파일은 허용되지 않는 확장자입니다. (${a.join(", ")}만 가능)`),!1}return!0},F=async()=>{const x=n.filter(p=>p.status!=="done");if(x.length===0){r.message.warning("업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다.");return}const R=new FormData;l&&R.append("trxCd",l),x.forEach(p=>{R.append("files",p.originFileObj)}),c(!0),f(0);try{const p=await new Promise((m,y)=>{const j=new XMLHttpRequest;j.open("POST","/api/upload-large",!0),j.upload.onprogress=w=>{if(w.lengthComputable){const I=Math.round(w.loaded/w.total*100);f(I)}},j.onload=()=>{if(j.status>=200&&j.status<300)try{const w=JSON.parse(j.responseText);w.success?m(w):y(new Error(w.message||"파일 업로드에 실패했습니다."))}catch{y(new Error("잘못된 서버 응답입니다."))}else try{const w=JSON.parse(j.responseText);y(new Error(w.message||`서버 오류: ${j.status}`))}catch{y(new Error(`서버 오류: ${j.status}`))}},j.onerror=()=>{y(new Error("네트워크 오류가 발생했습니다."))},j.send(R)});r.message.success(p.message||"모든 파일이 성공적으로 업로드되었습니다.");const Y=n.map(m=>x.find(y=>y.uid===m.uid)?{...m,status:"done"}:m);o(Y),e&&p.uploadedFiles&&p.uploadedFiles.forEach(m=>{e({fileNameP:m.fileKey,fileNameL:m.fileName})})}catch(p){r.message.error(p.message||"파일 업로드 중 오류가 발생했습니다.");const Y=n.map(m=>x.find(y=>y.uid===m.uid)?{...m,status:"error",response:p.message||"파일 업로드 중 오류가 발생했습니다."}:m);o(Y)}finally{c(!1)}},h={multiple:!0,fileList:n,beforeUpload:x=>d(x)?!1:r.Upload.LIST_IGNORE,onChange:({fileList:x})=>{const R=new Map(n.map(p=>[p.uid,p]));x.forEach(p=>{R.set(p.uid,p)}),o(Array.from(R.values()))},onRemove:x=>{const R=n.filter(p=>p.uid!==x.uid);o(R)},showUploadList:!1};return t.jsxRuntimeExports.jsx(r.Spin,{spinning:i,tip:`파일 업로드 중... ${u}%`,children:t.jsxRuntimeExports.jsxs("div",{className:"bwg-large-uploader-container",children:[t.jsxRuntimeExports.jsx(r.Card,{title:t.jsxRuntimeExports.jsx(k,{strong:!0,children:s}),extra:t.jsxRuntimeExports.jsx(r.Upload,{...h,children:t.jsxRuntimeExports.jsx(r.Button,{icon:t.jsxRuntimeExports.jsx(B.UploadOutlined,{}),children:"파일 선택"})}),bodyStyle:{padding:0},children:t.jsxRuntimeExports.jsx(ee,{...h,style:{border:"none",background:"transparent",padding:0},children:t.jsxRuntimeExports.jsx("div",{className:"upload-list-container",children:n.length>0?t.jsxRuntimeExports.jsx(r.List,{style:{textAlign:"left"},dataSource:n,renderItem:x=>{const R=x.status==="done",p=x.status==="error";let Y;return R?Y=t.jsxRuntimeExports.jsx(B.CheckCircleOutlined,{style:{color:"#52c41a",fontSize:14}}):p?Y=t.jsxRuntimeExports.jsx(r.Tooltip,{title:typeof x.response=="string"?x.response:"업로드 실패",children:t.jsxRuntimeExports.jsx(B.CloseCircleOutlined,{style:{color:"#ff4d4f",fontSize:14}})}):Y=t.jsxRuntimeExports.jsx(B.FileTextOutlined,{style:{fontSize:14}}),t.jsxRuntimeExports.jsx(r.List.Item,{actions:[t.jsxRuntimeExports.jsx(k,{type:"secondary",children:se(x.size||0)},"size"),t.jsxRuntimeExports.jsx(r.Button,{type:"text",icon:t.jsxRuntimeExports.jsx(B.DeleteOutlined,{}),onClick:()=>h.onRemove?.(x),disabled:i},"delete")],children:t.jsxRuntimeExports.jsx(r.List.Item.Meta,{avatar:Y,title:t.jsxRuntimeExports.jsx(k,{type:p?"danger":void 0,children:x.name})})},x.uid)}}):t.jsxRuntimeExports.jsxs(r.Flex,{gap:"middle",align:"center",justify:"center",vertical:!0,style:{padding:"20px 0",minHeight:"120px"},children:[t.jsxRuntimeExports.jsx(B.InboxOutlined,{style:{fontSize:"32px",color:"#999"}}),t.jsxRuntimeExports.jsx(k,{type:"secondary",children:"업로드할 파일을 선택하거나 이 영역으로 드래그하세요."})]})})})}),n.length>0&&t.jsxRuntimeExports.jsxs(r.Flex,{justify:"flex-end",align:"center",gap:"large",style:{marginTop:16},children:[i&&t.jsxRuntimeExports.jsx("div",{style:{width:"250px"},children:t.jsxRuntimeExports.jsx(r.Progress,{percent:u,size:"small"})}),t.jsxRuntimeExports.jsx(r.Button,{type:"primary",onClick:F,disabled:i||n.filter(x=>x.status!=="done").length===0,icon:t.jsxRuntimeExports.jsx(B.CloudUploadOutlined,{}),children:"일괄 업로드"})]})]})})};exports.BwgButton=P;exports.BwgCheck=H;exports.BwgCheckList=_;exports.BwgDatePicker=$;exports.BwgForm=L;exports.BwgFormItem=E;exports.BwgInput=V;exports.BwgLargeUploader=ne;exports.BwgMaskedInput=T;exports.BwgMaskedPicker=A;exports.BwgMultiSelect=J;exports.BwgNumber=X;exports.BwgRadio=G;exports.BwgRangePicker=q;exports.BwgSearch=N;exports.BwgSelect=D;exports.BwgTextArea=W;exports.BwgUploader=Z;
|