@bwg-ui/core 1.3.2 → 1.3.3

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.
Files changed (60) hide show
  1. package/dist/chunks/{CMSearchIntfGwP01-Bx5cpkhH.js → CMSearchIntfGwP01-Co6lrDf9.js} +9 -9
  2. package/dist/chunks/CMSearchIntfGwP01-Do_ZDjmX.cjs +1 -0
  3. package/dist/chunks/{MenuReport-DxJIaW8D.js → MenuReport-BTtoDFz-.js} +146 -141
  4. package/dist/chunks/MenuReport-Bn5NyNel.cjs +1 -0
  5. package/dist/chunks/{common-components-dzN5Nuq0.js → common-components-0IMhPxxg.js} +11521 -10978
  6. package/dist/chunks/common-components-Csd3OioX.cjs +1109 -0
  7. package/dist/chunks/core-components-CX6NGtTh.cjs +1 -0
  8. package/dist/chunks/core-components-Ckwf4Rd7.js +1969 -0
  9. package/dist/chunks/layout-components-BMLp8YAy.cjs +38 -0
  10. package/dist/chunks/{layout-components-B25FFvXj.js → layout-components-DphZY34c.js} +942 -741
  11. package/dist/components/common/index.cjs +1 -1
  12. package/dist/components/common/index.js +1 -1
  13. package/dist/components/core/BwgEmpSearch.d.ts +28 -0
  14. package/dist/components/core/BwgEmpSearch.d.ts.map +1 -0
  15. package/dist/components/core/index.cjs +1 -1
  16. package/dist/components/core/index.js +22 -1846
  17. package/dist/components/guide/index.cjs +1 -1
  18. package/dist/components/guide/index.js +13 -13
  19. package/dist/components/layout/AppWrapper.d.ts +2 -1
  20. package/dist/components/layout/AppWrapper.d.ts.map +1 -1
  21. package/dist/components/layout/BwgCoreLogin.d.ts +1 -2
  22. package/dist/components/layout/BwgCoreLogin.d.ts.map +1 -1
  23. package/dist/components/layout/BwgSessionNotice.d.ts +15 -0
  24. package/dist/components/layout/BwgSessionNotice.d.ts.map +1 -0
  25. package/dist/components/layout/BwgSsoLogin.d.ts +19 -0
  26. package/dist/components/layout/BwgSsoLogin.d.ts.map +1 -0
  27. package/dist/components/layout/custom/ConfigurableHeader.d.ts.map +1 -1
  28. package/dist/components/layout/index.cjs +1 -1
  29. package/dist/components/layout/index.d.ts +2 -0
  30. package/dist/components/layout/index.d.ts.map +1 -1
  31. package/dist/components/layout/index.js +16 -14
  32. package/dist/components/pages/board/CMAdminBoardM01.d.ts.map +1 -1
  33. package/dist/components/pages/board/CMMyBoardM01.d.ts.map +1 -1
  34. package/dist/components/popup/MenuReport.d.ts.map +1 -1
  35. package/dist/components/popup/SearchOrganizationP01.d.ts +1 -1
  36. package/dist/components/popup/SearchOrganizationP01.d.ts.map +1 -1
  37. package/dist/components/popup/index.cjs +1 -1
  38. package/dist/components/popup/index.js +1 -1
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.js +160 -157
  41. package/dist/stores/index.cjs +2 -2
  42. package/dist/stores/index.d.ts +2 -1
  43. package/dist/stores/index.d.ts.map +1 -1
  44. package/dist/stores/index.js +368 -335
  45. package/dist/stores/loginStore.d.ts +55 -10
  46. package/dist/stores/loginStore.d.ts.map +1 -1
  47. package/dist/stores/userStore.d.ts +1 -2
  48. package/dist/stores/userStore.d.ts.map +1 -1
  49. package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
  50. package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
  51. package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
  52. package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
  53. package/dist/utils/index.cjs +1 -1
  54. package/dist/utils/index.d.ts.map +1 -1
  55. package/dist/utils/index.js +455 -454
  56. package/package.json +1 -1
  57. package/dist/chunks/CMSearchIntfGwP01-Uhl4uqiV.cjs +0 -1
  58. package/dist/chunks/MenuReport-CPwq8w-z.cjs +0 -1
  59. package/dist/chunks/common-components-Dd_AsKs7.cjs +0 -1109
  60. package/dist/chunks/layout-components-Cz7Zets7.cjs +0 -35
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/common-components-Dd_AsKs7.cjs"),o=require("../../utils/index.cjs");exports.ButtonAccessController=e.ButtonAccessController;exports.BwgButtonGroup=e.BwgButtonGroup;exports.BwgCmptArea=e.BwgCmptArea;exports.BwgCol=e.BwgCol;exports.BwgConfigProvider=e.BwgConfigProvider;exports.BwgDetail=e.BwgDetail;exports.BwgDrawer=e.BwgDrawer;exports.BwgEditor=e.BwgEditor;exports.BwgGrid=e.BwgGrid;exports.BwgInfoArea=e.BwgInfoArea;exports.BwgPagination=e.BwgPagination;exports.BwgPopup=e.BwgPopup;exports.BwgRow=e.BwgRow;exports.BwgSpace=e.BwgSpace;exports.BwgTable=e.BwgTable;exports.BwgTabs=e.BwgTabs;exports.BwgTitleBox=e.BwgTitleBox;exports.BwgView=e.BwgView;exports.ContentBox=e.ContentBox;exports.ContentLayOut=e.ContentLayOut;exports.GlobalConfigProvider=e.GlobalConfigProvider;exports.QuickServiceToggle=e.QuickServiceToggle;exports.SSOHandler=e.SSOHandler;exports.SearchBox=e.SearchBox;exports.createBwgGridRenderer=o.createBwgGridRenderer;exports.realFormat=o.realFormat;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/common-components-Csd3OioX.cjs"),o=require("../../utils/index.cjs");exports.ButtonAccessController=e.ButtonAccessController;exports.BwgButtonGroup=e.BwgButtonGroup;exports.BwgCmptArea=e.BwgCmptArea;exports.BwgCol=e.BwgCol;exports.BwgConfigProvider=e.BwgConfigProvider;exports.BwgDetail=e.BwgDetail;exports.BwgDrawer=e.BwgDrawer;exports.BwgEditor=e.BwgEditor;exports.BwgGrid=e.BwgGrid;exports.BwgInfoArea=e.BwgInfoArea;exports.BwgPagination=e.BwgPagination;exports.BwgPopup=e.BwgPopup;exports.BwgRow=e.BwgRow;exports.BwgSpace=e.BwgSpace;exports.BwgTable=e.BwgTable;exports.BwgTabs=e.BwgTabs;exports.BwgTitleBox=e.BwgTitleBox;exports.BwgView=e.BwgView;exports.ContentBox=e.ContentBox;exports.ContentLayOut=e.ContentLayOut;exports.GlobalConfigProvider=e.GlobalConfigProvider;exports.QuickServiceToggle=e.QuickServiceToggle;exports.SSOHandler=e.SSOHandler;exports.SearchBox=e.SearchBox;exports.createBwgGridRenderer=o.createBwgGridRenderer;exports.realFormat=o.realFormat;
@@ -1,4 +1,4 @@
1
- import { f as o, p as s, q as r, j as B, B as g, r as w, s as t, o as i, h as n, t as l, n as d, m as p, i as C, b as c, u, l as f, e as S, k as m, d as x, C as G, G as b, Q as v, v as P, S as T } from "../../chunks/common-components-dzN5Nuq0.js";
1
+ import { f as o, p as s, q as r, j as B, B as g, r as w, s as t, o as i, h as n, t as l, n as d, m as p, i as C, b as c, u, l as f, e as S, k as m, d as x, C as G, G as b, Q as v, v as P, S as T } from "../../chunks/common-components-0IMhPxxg.js";
2
2
  import { createBwgGridRenderer as h, realFormat as k } from "../../utils/index.js";
3
3
  export {
4
4
  o as ButtonAccessController,
@@ -0,0 +1,28 @@
1
+ import { Employee } from '../popup/SearchOrganizationP01';
2
+ export interface EmpSearchField {
3
+ /** 연결할 Employee 객체의 속성명 (예: 'deptNm', 'empNm') */
4
+ value?: keyof Employee;
5
+ /** 폼에 저장할 필드명 */
6
+ fieldName?: string;
7
+ /** placeholder */
8
+ placeholder?: string;
9
+ }
10
+ export interface BwgEmpSearchProps {
11
+ /** 라벨 */
12
+ label?: string;
13
+ /** 사번 필드명 (디폴트: empNo)*/
14
+ empNoFieldName?: string;
15
+ /** Employee 객체를 저장할 필드명 (디폴트: employee)*/
16
+ employeeFieldName?: string;
17
+ /** 표시할 필드 1 (디폴트: 사원명) */
18
+ field1?: EmpSearchField;
19
+ /** 표시할 필드 2 (디폴트: 부서명) */
20
+ field2?: EmpSearchField;
21
+ /** 읽기 전용 */
22
+ readOnly?: boolean;
23
+ /** 완료 함수 */
24
+ onFinish?: () => void;
25
+ }
26
+ declare const BwgEmpSearch: (props: BwgEmpSearchProps) => import("react/jsx-runtime").JSX.Element;
27
+ export default BwgEmpSearch;
28
+ //# sourceMappingURL=BwgEmpSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BwgEmpSearch.d.ts","sourceRoot":"","sources":["../../../src/components/core/BwgEmpSearch.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC;IACvB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,YAAY;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY;IACZ,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAID,QAAA,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CA6I7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("antd"),x=require("react"),se=require("../../stores/index.cjs"),E=require("dayjs"),P=require("@ant-design/icons"),T=require("../../utils/index.cjs"),ie=require("jszip"),J=require("imask"),ae=require("../../chunks/provider-DrboIg2C.cjs"),G=require("lodash"),X=require("react-dnd"),ce=require("react-dnd-html5-backend"),ue=t=>{const{componentSize:r}=se.useUserStore(),f=x.useMemo(()=>t.size?t.size:{0:"small",1:"middle",2:"large"}[r],[r,t.size]),i=x.useMemo(()=>({0:12,1:14,2:16})[r],[r]);return s.jsx(a.Button,{...t,size:f,className:"bwg-btn",style:{fontSize:`${i}px`,...t.style},children:t.children})},$=x.memo(({children:t,label:r,name:f,rules:i,initialValue:e,style:l,required:y,...u})=>{const F={fontWeight:"bold"};(i==null||i==null)&&y&&(i=[{required:!0,message:`${r}을(를) 입력해주세요.`}]);const c=Array.isArray(i)&&i.some(Y=>Y.required===!0),m=()=>typeof r=="string"?s.jsxs("span",{style:F,children:[r,c&&s.jsx("span",{style:{color:"#ff4d4f",marginLeft:"4px"},children:"*"})]}):s.jsx("span",{style:F,children:r});return s.jsx(a.Form.Item,{className:"bwg-form-item",label:r?m():void 0,labelAlign:u.labelAlign||"left",name:f,rules:i,colon:!1,initialValue:e,style:l,...u,children:t})}),de=({itemProps:t,inputProps:r={format:"YN"}})=>{const f=a.Form.useFormInstance(),i=e=>{r.format==="boolean"?f.setFieldValue(t?.name,e.target.checked):f.setFieldValue(t?.name,e.target.checked?"Y":"N"),r.onChange&&r.onChange(e)};return s.jsx($,{...t,getValueProps:e=>({checked:r.format==="boolean"?!!e:e==="Y"}),normalize:e=>typeof e=="boolean"?r.format==="boolean"?e:e?"Y":"N":r.format==="boolean"?!!e:e?"Y":"N",children:s.jsx(a.Checkbox,{...r,onChange:i,children:r?.title})})},fe=({itemProps:t,inputProps:r})=>{const f=a.Form.useFormInstance(),[i,e]=x.useState(t?.initialValue??[]),[l,y]=x.useState([]),u=l.length>0&&l.length==i?.length,F=i?.length>0&&i.length<l.length;x.useEffect(()=>{y(c(r?.options))},[r?.options]),x.useEffect(()=>{e(i)},[i]);const c=k=>{const D=[];return(k||[]).map((j,O)=>{D.push(j.value)}),D},m=k=>{e(k.target.checked?l:[]),f.setFieldValue(t?.name,k.target.checked?l:[])},Y=k=>{e(k),f.setFieldValue(t?.name,k),r?.onChange&&typeof r?.onChange=="function"&&r?.onChange(k)};return s.jsx($,{...t,children:s.jsxs(a.ConfigProvider,{theme:{components:{Checkbox:{colorPrimary:"var(--check-primary)",colorPrimaryBorder:"var(--check-primary)",colorPrimaryHover:"var(--check-primary-active)"}}},children:[r?.allCheck&&s.jsx(a.Checkbox,{indeterminate:F,checked:u,onChange:m,children:"전체선택"}),s.jsx(a.Checkbox.Group,{options:r?.options,value:i,onChange:Y})]})})},Q={year:{displayFormat:"YYYY",outputFormat:"YYYY"},month:{displayFormat:"YYYY-MM",outputFormat:"YYYYMM"},date:{displayFormat:"YYYY-MM-DD",outputFormat:"YYYYMMDD"},time:{displayFormat:"HH:mm",outputFormat:"HHmm"},datetime:{displayFormat:"YYYY-MM-DD HH:mm",outputFormat:"YYYYMMDDHHmm"}},me=({itemProps:t,inputProps:r,type:f="date",returnType:i="string"})=>{const{displayFormat:e,outputFormat:l}=x.useMemo(()=>Q[f],[f]),y=x.useMemo(()=>Object.values(Q).map(u=>u.outputFormat).sort((u,F)=>{if(u.length===F.length){if(u===l)return-1;if(F===l)return 1}return F.length-u.length}),[l]);return s.jsx($,{...t,getValueProps:u=>({value:u?E.isDayjs(u)?u:E(u,y):null}),normalize:u=>u?i==="dayjs"?u:u.format(l):null,children:s.jsx(a.DatePicker,{...r,picker:f==="datetime"?"date":f,showTime:r?.showTime??(f==="datetime"||f==="time"),format:r?.format?{format:r?.format?.format,type:"mask"}:e})})},ge=({fileGrpKey:t,onFetchFilesTrxCd:r="SCMFILE00101",readOnly:f=!1,appCd:i=__APP_CD__})=>{const[e,l]=x.useState([]);x.useEffect(()=>{if(r)if(i!=__APP_CD__){const F=T.getApiDeps().findSystemByAppCd?.(i??__APP_CD__);if(!F||!F.sysCd){console.error("해당 앱코드는 존재하지 않습니다.",i);return}T.callServiceByAppCd({trxCd:r,appCd:i},{crprCd:T.getCrprCd(),sysCd:F.sysCd,fileGrpKey:t}).then(c=>{if(c?.sub){const m=c.sub.map(Y=>({uid:Y.fileKey,name:Y.lgclFileNm,filePath:Y.filePath}));l(m)}}).catch(c=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",c),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")})}else T.callService(r,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:t}).then(u=>{if(u?.sub){const F=u.sub.map(c=>({uid:c.fileKey,name:c.lgclFileNm,filePath:c.filePath}));l(F)}}).catch(u=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",u),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")});else l([])},[t,r,i]);const y=async u=>{try{const c=T.getApiDeps().findSystemByAppCd?.(i??__APP_CD__);if(!c||!c.sysCd){console.error("해당 앱코드는 존재하지 않습니다.",i);return}const Y=await fetch("/api/download",{method:"POST",headers:{SYSCD:c.sysCd,"Content-Type":"application/json"},body:JSON.stringify({filePath:u.filePath,logicalName:u.name,fileKey:u.uid})});if(!Y.ok){const b=(await Y.json().catch(()=>null))?.message||"파일 다운로드에 실패했습니다.";throw new Error(b)}const k=await Y.blob(),D=window.URL.createObjectURL(k),j=document.createElement("a");j.href=D,j.setAttribute("download",u.name),document.body.appendChild(j),j.click(),document.body.removeChild(j),window.URL.revokeObjectURL(D)}catch(F){console.error(F),a.message.error(F.message||"파일을 다운로드하는 중 오류가 발생했습니다.")}};return s.jsx(a.Card,{title:"파일 목록",children:s.jsx(a.List,{dataSource:e,renderItem:u=>s.jsx(a.List.Item,{actions:f?[]:[s.jsx(a.Button,{type:"text",icon:s.jsx(P.DownloadOutlined,{}),onClick:()=>y(u)},"download")],children:s.jsx(a.List.Item.Meta,{avatar:s.jsx(P.PaperClipOutlined,{}),title:u.name})})})})},oe=x.forwardRef(({children:t,labelCol:r,style:f,className:i,...e},l)=>s.jsx(a.ConfigProvider,{form:{},children:s.jsx(a.Form,{ref:l,...e,requiredMark:!1,labelCol:r||{flex:"100px"},style:{padding:"10px",...f},className:`bwg-form ${i??""}`,children:t})}));oe.displayName="BwgForm";const pe=({itemProps:t,inputProps:r})=>s.jsx($,{...t,children:s.jsx(a.Input,{...r})}),{Text:W}=a.Typography,{Dragger:he}=a.Upload,ye=[".pdf",".xlsx",".xls",".docx",".doc",".pptx",".ppt",".hwp",".txt",".csv",".jpg",".jpeg",".png",".gif",".zip"],xe=(t,r=2)=>{if(t===0)return"0 Bytes";const f=1024,i=r<0?0:r,e=["Bytes","KB","MB","GB","TB"],l=Math.floor(Math.log(t)/Math.log(f));return parseFloat((t/Math.pow(f,l)).toFixed(i))+" "+e[l]},Fe=({title:t="첨부파일",fileGrpKey:r,onUploadComplete:f,onSuccessTrxCd:i="SCMFILE00102",anotherServiceTrxCd:e="SCMFILE00105",allowedExtensions:l=ye,maxFileSize:y=2048})=>{const[u,F]=x.useState([]),[c,m]=x.useState(!1),[Y,k]=x.useState(!1),[D,j]=x.useState(0),O=p=>{if(l&&l.length>0){const _=(U=>{const o=U.lastIndexOf(".");return o===-1?"":U.substring(o).toLowerCase()})(p.name);if(!l.includes(_))return a.message.error(`${p.name} 파일은 허용되지 않는 확장자입니다. (${l.join(", ")}만 가능)`),!1}return!0},b=async()=>{const p=u.filter(C=>C.status!=="done"),v=p.reduce((C,V)=>C+(V.size||0),0),_=2*1024*1024*1024;if(v>_){a.notification.error({message:"업로드 용량 초과",description:"한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."});return}if(p.length===0){a.message.warning("업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다.");return}k(!0);let U;try{const C=new ie;p.forEach(V=>{V.originFileObj&&C.file(V.name,V.originFileObj)}),U=await C.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}})}catch(C){k(!1),a.message.error("파일을 압축하는 중 오류가 발생했습니다."),console.error("Zipping error:",C);return}k(!1);const o=new FormData;o.append("file",U,"upload.zip"),m(!0),j(0);try{const C=await new Promise((w,A)=>{const R=new XMLHttpRequest;R.open("POST","/api/upload-large",!0),R.upload.onprogress=z=>{if(z.lengthComputable){const K=Math.round(z.loaded/z.total*100);j(K)}},R.onload=()=>{if(R.status>=200&&R.status<300)try{const z=JSON.parse(R.responseText);z.success?w(z):A(new Error(z.message||"파일 업로드에 실패했습니다."))}catch{A(new Error("잘못된 서버 응답입니다."))}else try{const z=JSON.parse(R.responseText);A(new Error(z.message||`서버 오류: ${R.status}`))}catch{A(new Error(`서버 오류: ${R.status}`))}},R.onerror=()=>{A(new Error("네트워크 오류가 발생했습니다."))},R.send(o)});a.message.success(C.message||"압축 파일이 성공적으로 업로드되었습니다.");const V=u.map(w=>p.find(A=>A.uid===w.uid)?{...w,status:"done"}:w);if(F(V),i&&C.uploadedFiles&&Array.isArray(C.uploadedFiles)){const w=T.getUserInfo();C.uploadedFiles.forEach(A=>{const R={crprCd:w?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r,sub:[{crprCd:w?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r,physFileNm:A.fileNameP,lgclFileNm:A.fileNameL,filePath:A.filePath,fileExtn:A.fileExt,fileSize:A.fileSize,mltpYn:"Y"}]};T.callService(i,R).then(z=>{const K=u.map(q=>({crprCd:w?.crprCd,sysCd:__SYS_CD__,fileGrpKey:z.sub[0].fileGrpKey,fileKey:z.sub[0].fileKey,lgclFileNm:q.name,fileSize:q.size,fileExtn:q.name.split(".").pop(),fileType:q.type}));T.callService(e,{sub:K})}).catch(z=>{console.error("후처리 서비스 호출 실패:",z),a.message.error(`${A.fileNameL} 파일의 후처리 작업에 실패했습니다.`)}),f&&f({fileNameP:A.fileNameP,fileNameL:A.fileNameL})})}}catch(C){a.message.error(C.message||"파일 업로드 중 오류가 발생했습니다.");const V=u.map(w=>p.find(A=>A.uid===w.uid)?{...w,status:"error",response:C.message||"파일 업로드 중 오류가 발생했습니다."}:w);F(V)}finally{m(!1)}},B={multiple:!0,fileList:u,beforeUpload:p=>O(p)?y&&p.size>=y*1024*1024?(a.message.error(`대용량 첨부 파일 최대 크기는 ${(y/1024).toFixed(1)}GB입니다.`),a.Upload.LIST_IGNORE):!1:a.Upload.LIST_IGNORE,onChange:({fileList:p})=>{const v=new Map(u.map(_=>[_.uid,_]));p.forEach(_=>{v.set(_.uid,_)}),F(Array.from(v.values()))},onRemove:p=>{const v=u.filter(_=>_.uid!==p.uid);F(v)},showUploadList:!1};return s.jsx(a.Spin,{spinning:c||Y,tip:Y?"파일 압축 중...":`파일 업로드 중... ${D}%`,children:s.jsxs("div",{className:"bwg-large-uploader-container",children:[s.jsx(a.Card,{title:s.jsx(W,{strong:!0,children:t}),extra:s.jsx(a.Upload,{...B,children:s.jsx(a.Button,{icon:s.jsx(P.UploadOutlined,{}),children:"파일 선택"})}),style:{padding:0},children:s.jsx(he,{...B,style:{border:"none",background:"transparent",padding:0},children:s.jsx("div",{className:"upload-list-container",children:u.length>0?s.jsx(a.List,{style:{textAlign:"left"},dataSource:u,renderItem:p=>{const v=p.status==="done",_=p.status==="error";let U;return v?U=s.jsx(P.CheckCircleOutlined,{style:{color:"#52c41a",fontSize:14}}):_?U=s.jsx(a.Tooltip,{title:typeof p.response=="string"?p.response:"업로드 실패",children:s.jsx(P.CloseCircleOutlined,{style:{color:"#ff4d4f",fontSize:14}})}):U=s.jsx(P.FileTextOutlined,{style:{fontSize:14}}),s.jsx(a.List.Item,{actions:[s.jsx(W,{type:"secondary",children:xe(p.size||0)},"size"),s.jsx(a.Button,{type:"text",icon:s.jsx(P.DeleteOutlined,{}),onClick:o=>{o.stopPropagation(),B.onRemove?.(p)},disabled:c||Y},"delete")],children:s.jsx(a.List.Item.Meta,{avatar:U,title:s.jsx(W,{type:_?"danger":void 0,children:p.name})})},p.uid)}}):s.jsxs(a.Flex,{gap:"middle",align:"center",justify:"center",vertical:!0,style:{padding:"20px 0",minHeight:"120px"},children:[s.jsx(P.InboxOutlined,{style:{fontSize:"32px",color:"#999"}}),s.jsx(W,{type:"secondary",children:"업로드할 파일을 선택하거나 이 영역으로 드래그하세요."})]})})})}),u.length>0&&s.jsxs(a.Flex,{justify:"flex-end",align:"center",gap:"large",style:{marginTop:16},children:[c&&s.jsx("div",{style:{width:"250px"},children:s.jsx(a.Progress,{percent:D,size:"small"})}),s.jsx(a.Button,{type:"primary",onClick:b,disabled:c||Y||u.filter(p=>p.status!=="done").length===0,icon:s.jsx(P.CloudUploadOutlined,{}),children:"일괄 업로드"})]})]})})},Ce=t=>{if(typeof t=="string")return t.replace(/0/g,"_");if(Array.isArray(t))return t[0].replace(/0/g,"_");if(typeof t=="object"&&"mask"in t&&"blocks"in t){const{mask:r,blocks:f}=t;return r.split(".").map(i=>{const l=f?.[i]?.maxLength??3;return"_".repeat(l)}).join(".")}return""},Se=({itemProps:t,inputProps:r,mask:f})=>{const i=x.useRef(null),e=a.Form.useFormInstance(),l=x.useMemo(()=>Ce(f),[f]);return x.useEffect(()=>{if(!i.current?.input)return;const y=typeof f=="string"||Array.isArray(f)?{mask:f}:f,u=J(i.current.input,y);return u.on("accept",()=>{e&&t?.name&&e.setFieldValue(t.name,u.value)}),()=>{u.destroy()}},[f,e,t?.name]),s.jsx($,{...t,children:s.jsx(a.Input,{...r,ref:i,placeholder:l})})},je=t=>{switch(t){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"}}},Ye=({type:t="date",itemProps:r={name:"calendar"},inputProps:f,pickerProps:i})=>{const{format:e,mask:l,outputFormat:y}=je(t),u=x.useRef(null),F=x.useRef(null),c=x.useRef(null),m=a.Form.useFormInstance(),[Y,k]=x.useState(!1),[D,j]=x.useState(!1),O=r?.name,[b,B]=x.useState(null),p=a.Form.useWatch(O,m),v=ae.useSizeConfig();x.useEffect(()=>{if(!u.current?.input)return;const o=J(u.current.input,{mask:l,lazy:!1});return F.current=o,o.on("accept",()=>{const C=o.value;C.length>0&&k(!0);const V=E(C,e,!0);C.length===e.length&&V.isValid()&&(m.setFieldValue(O,o.value),B(V),F.current?.updateValue())}),()=>{o.destroy()}},[e,l]),x.useEffect(()=>{if(!p){B(null);return}let o=null;if(typeof p=="string"&&p.length===y.length&&/^\d+$/.test(p))if(t==="date"){const C=p.substring(0,4),V=p.substring(4,6),w=p.substring(6,8);o=E(`${C}-${V}-${w}`,e,!0)}else if(t==="month"){const C=p.substring(0,4),V=p.substring(4,6);o=E(`${C}-${V}`,e,!0)}else t==="year"&&(o=E(p,e,!0));else o=E(p,e,!0);o&&o.isValid()?B(o):B(null),j(!1)},[p,e,y,t]);const _=o=>{if(!o){B(null),F.current?.updateValue();return}B(o);const C=o.format(y);F.current&&(F.current.value=C,F.current.updateValue()),j(!1)},U=o=>{setTimeout(()=>{const C=document.activeElement,V=c.current,w=V?.querySelector(".ant-picker-dropdown");!(V&&(V.contains(C)||V===C||w?.contains(C)))&&!(o!==void 0?o:Y)&&console.log("✅ Input과 DatePicker 모두 포커스가 없습니다")},0)};return s.jsx($,{...r,name:void 0,validateStatus:D?"warning":void 0,children:s.jsxs(a.ConfigProvider,{componentSize:v.componentSize,theme:{components:{Input:{addonBg:"#fff"}}},children:[s.jsx(a.Form.Item,{name:O,getValueProps:o=>({value:o?E(o).format(e):void 0}),normalize:o=>o?E(o).format(y):void 0,noStyle:!0,children:s.jsx(a.Input,{...f,ref:u,onFocus:()=>{k(!Y),F.current?.updateValue()},onBlur:()=>{U()},onKeyDown:o=>{if(o.key==="Backspace"&&k(!0),o.key==="Tab"&&k(!1),o.key==="Enter")if(Y){const C=F.current?.value||"",V=E(C,e,!0);C.length===e.length&&V.isValid()?(k(!1),j(!1)):j(!0)}else k(!0)},style:{width:"65%"},allowClear:!0,placeholder:l.replace(/0/g,"_"),suffix:s.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})}),s.jsx(a.DatePicker,{...i,open:Y,picker:t,format:{format:e,type:"mask"},showNow:!0,value:b,onChange:_,onOpenChange:o=>{k(o),o||U(!1)},renderExtraFooter:()=>D?s.jsxs("div",{style:{color:"#faad14",paddingLeft:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"6px",borderTop:"1px solid #f0f0f0",backgroundColor:"#fffbe6"},children:[s.jsx(P.ExclamationCircleOutlined,{}),s.jsx("span",{children:"유효하지 않은 날짜입니다"})]}):null,getPopupContainer:o=>o.parentElement,style:{position:"absolute",top:0,left:0,pointerEvents:"none",opacity:0,width:"100%"}})]})})},{RangePicker:ke}=a.DatePicker,be=t=>{switch(t){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"}}},we=({type:t="date",itemProps:r={name:"dateRange"},inputProps:f,pickerProps:i})=>{const{format:e,mask:l,outputFormat:y}=be(t),u=x.useRef(null),F=x.useRef(null),c=x.useRef(null),m=x.useRef(null),Y=x.useRef(null),k=a.Form.useFormInstance(),[D,j]=x.useState(!1),[O,b]=x.useState(!1),[B,p]=x.useState(null),[v,_]=x.useState(!1),U=x.useRef(!1),o=r?.name,[C,V]=x.useState([null,null]),w=a.Form.useWatch(o?Array.isArray(o)?[...o,0]:[o,0]:void 0,k),A=a.Form.useWatch(o?Array.isArray(o)?[...o,1]:[o,1]:void 0,k),R=a.Form.useWatch(o,k),z=ae.useSizeConfig();x.useEffect(()=>{if(!u.current?.input)return;const n=J(u.current.input,{mask:l,lazy:!1});return c.current=n,n.on("accept",()=>{const g=n.value,h=n.unmaskedValue||"";if(console.log("🔵 [시작일] accept 이벤트:",{maskValue:g,unmaskedValue:h,length:g.length,formatLength:e.length}),g.length>0&&(p("start"),j(!0),_(!1)),h.length===y.length){const d=E(g,e,!0);if(d.isValid()){console.log("🔵 [시작일] 입력 완료 및 검증 통과:",{parsed:d.format(e)});const M=d.format(y);U.current=!0;const S=Array.isArray(o)?[...o,0]:[o,0];k.setFieldValue(S,M),V([d,C[1]]),c.current&&c.current.updateValue(),b(!1),setTimeout(()=>{m.current&&(m.current.value="",m.current.unmaskedValue="",m.current.updateValue());const I=Array.isArray(o)?[...o,1]:[o,1];k.getFieldValue(I)||k.setFieldValue(I,void 0),F.current?.focus(),setTimeout(()=>{if(m.current){const N=m.current.value||"";!(m.current.unmaskedValue||"")&&!N.replace(/[^0-9]/g,"")&&(m.current.value="",m.current.updateValue())}},10),p("end"),j(!0),U.current=!1},0)}else i?.allowEmpty?b(!1):(console.log("🔵 [시작일] 검증 실패:",{val:g,parsed:d}),b(!0))}}),()=>{n.destroy()}},[e,l,o]),x.useEffect(()=>{if(!F.current?.input)return;const n=J(F.current.input,{mask:l,lazy:!1});return m.current=n,n.on("accept",()=>{const g=n.value,h=n.unmaskedValue||"";if(console.log("🟢 [종료일] accept 이벤트:",{maskValue:g,unmaskedValue:h,length:g.length,formatLength:e.length}),h===""||h.length===0){const d=Array.isArray(o)?[...o,1]:[o,1];k.setFieldValue(d,void 0),V([C[0],null]),m.current&&(m.current.value="",m.current.updateValue()),setTimeout(()=>{u.current?.focus(),p("start"),j(!0)},0);return}if(g.length>0&&(p("end"),j(!0)),g.length<e.length){b(!1);return}if(h.length===y.length){const d=E(g,e,!0);if(d.isValid()){const M=d.format(y);console.log("🟢 [종료일] 입력 완료:",{parsed:d.format(e),formatted:M}),U.current=!0;const S=Array.isArray(o)?[...o,1]:[o,1];k.setFieldValue(S,M),V([C[0],d]),m.current?.updateValue(),setTimeout(()=>{U.current=!1},0)}else i?.allowEmpty?b(!1):(console.log("🟢 [종료일] 검증 실패:",{val:g,parsed:d}),b(!0))}}),()=>{n.destroy()}},[e,l,o]),x.useEffect(()=>{console.log("🟡 [useEffect] form 값 변경 감지:",{startFormValue:w,endFormValue:A,formValue:R});const n=w??(Array.isArray(R)?R[0]:null),g=A??(Array.isArray(R)?R[1]:null);if(n===void 0&&g===void 0&&(!R||!Array.isArray(R))){V([null,null]);return}const h=S=>{if(!S)return null;let I=null;if(typeof S=="string"&&S.length===y.length&&/^\d+$/.test(S))if(t==="date"){const L=S.substring(0,4),N=S.substring(4,6),H=S.substring(6,8);I=E(`${L}-${N}-${H}`,e,!0)}else if(t==="month"){const L=S.substring(0,4),N=S.substring(4,6);I=E(`${L}-${N}`,e,!0)}else t==="year"&&(I=E(S,e,!0));else I=E(S,e,!0);return I&&I.isValid()?I:null},d=h(n),M=h(g);if(console.log("🟡 [useEffect] 파싱 결과:",{startParsed:d?d.format(e):null,endParsed:M?M.format(e):null,isStartDateFromPicker:v}),V([d,M]),U.current){console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"),b(!1);return}if(!v&&c.current){const S=c.current.value||"",I=d?d.format(e):"",L=c.current.unmaskedValue||"",N=d?d.format(y):"";console.log("🟡 [useEffect] 시작일 마스크 값 체크:",{currentMaskValue:S,expectedMaskValue:I,unmaskedValue:L,expectedUnmasked:N,shouldUpdate:S===""||S!==I,canUpdate:L===""||L===N}),(S===""||S!==I)&&(L===""||L===N?(console.log("🟡 [useEffect] 시작일 마스크 값 업데이트:",{before:S,after:d?d.format(e):""}),d?(c.current.value=d.format(e),c.current.updateValue()):(c.current.value="",c.current.updateValue())):console.log("🟡 [useEffect] 시작일 마스크 값 업데이트 스킵 (사용자 입력 중)"))}if(m.current){const S=m.current.value||"",I=M?M.format(e):"",L=m.current.unmaskedValue||"",N=M?M.format(y):"";console.log("🟡 [useEffect] 종료일 마스크 값 체크:",{currentMaskValue:S,expectedMaskValue:I,unmaskedValue:L,expectedUnmasked:N,shouldUpdate:S===""||S!==I,canUpdate:L===""||L===N}),(S===""||S!==I)&&(L===""||L===N?(console.log("🟡 [useEffect] 종료일 마스크 값 업데이트:",{before:S,after:I}),M?(m.current.value=M.format(e),m.current.updateValue()):(m.current.value="",m.current.updateValue())):console.log("🟡 [useEffect] 종료일 마스크 값 업데이트 스킵 (사용자 입력 중)"))}b(!1)},[w,A,R,e,y,t]);const K=n=>{if(console.log("🔴 [RangePicker] 날짜 변경:",{dates:n?[n[0]?n[0].format(e):null,n[1]?n[1].format(e):null]:null,prevRange:[C[0]?C[0].format(e):null,C[1]?C[1].format(e):null]}),!n){V([null,null]),c.current?.updateValue(),m.current?.updateValue();return}const[g,h]=n,d=C[0],M=g&&(!d||!g.isSame(d,t==="year"?"year":t==="month"?"month":"day"));if(console.log("🔴 [RangePicker] 시작일 변경 여부:",{isStartDateChanged:M,startDate:g?g.format(e):null,prevStartDate:d?d.format(e):null}),V([g,h]),M){console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"),_(!0),c.current&&(c.current.value="",c.current.updateValue());const S=g.format(y);console.log("🔴 [RangePicker] form 값 업데이트:",{formatted:S});const I=Array.isArray(o)?[...o,0]:[o,0];k.setFieldValue(I,S)}else!g&&c.current?(_(!1),c.current.value="",c.current.updateValue()):_(!1);if(h&&m.current){const S=h.format(y);m.current.value=S,m.current.updateValue()}else!h&&m.current&&(m.current.value="",m.current.updateValue());b(!1)},q=n=>{setTimeout(()=>{const g=document.activeElement,h=Y.current,d=h?.querySelector(".ant-picker-dropdown");!(h&&(h.contains(g)||h===g||d?.contains(g)))&&!(n!==void 0?n:D)&&(console.log("✅ Input과 RangePicker 모두 포커스가 없습니다"),j(!1))},0)};return s.jsx($,{...r,name:void 0,validateStatus:O?"warning":void 0,children:s.jsxs(a.ConfigProvider,{componentSize:z.componentSize,theme:{components:{Input:{addonBg:"#fff"}}},children:[s.jsxs("div",{ref:Y,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%"},children:[s.jsx(a.Form.Item,{name:o?Array.isArray(o)?[...o,0]:[o,0]:void 0,getValueProps:n=>{if(!n)return{value:void 0};if(typeof n=="string"&&n.length===y.length&&/^\d+$/.test(n)){if(t==="date"){const g=n.substring(0,4),h=n.substring(4,6),d=n.substring(6,8);return{value:`${g}-${h}-${d}`}}else if(t==="month"){const g=n.substring(0,4),h=n.substring(4,6);return{value:`${g}-${h}`}}else if(t==="year")return{value:n}}return{value:E(n).format(e)}},normalize:n=>n?E(n).format(y):(i?.allowEmpty,void 0),noStyle:!0,children:s.jsx(a.Input,{...f,value:void 0,ref:u,onFocus:()=>{if(p("start"),j(!D),_(!1),c.current){const n=Array.isArray(o)?[...o,0]:[o,0];k.getFieldValue(n)||(c.current.value="",c.current.unmaskedValue=""),c.current.updateValue()}},onBlur:()=>{q()},onKeyDown:n=>{if(n.key==="Backspace"&&(p("start"),j(!0)),n.key==="Enter")if(D&&B==="start"){const g=c.current?.value||"";g.length===e.length?E(g,e,!0).isValid()?(j(!1),b(!1)):i?.allowEmpty?b(!1):b(!0):b(!1)}else p("start"),j(!0)},style:{flex:1},allowClear:!0,placeholder:l.replace(/0/g,"_"),suffix:s.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})}),s.jsx("span",{style:{color:"#d9d9d9",userSelect:"none"},children:"~"}),s.jsx(a.Form.Item,{name:o?Array.isArray(o)?[...o,1]:[o,1]:void 0,getValueProps:n=>{if(!n)return{value:void 0};if(typeof n=="string"&&n.length===y.length&&/^\d+$/.test(n)){if(t==="date"){const g=n.substring(0,4),h=n.substring(4,6),d=n.substring(6,8);return{value:`${g}-${h}-${d}`}}else if(t==="month"){const g=n.substring(0,4),h=n.substring(4,6);return{value:`${g}-${h}`}}else if(t==="year")return{value:n}}return{value:E(n).format(e)}},normalize:n=>n?E(n).format(y):(i?.allowEmpty,void 0),noStyle:!0,children:s.jsx(a.Input,{...f,ref:F,onFocus:()=>{if(p("end"),j(!D),m.current){m.current.updateValue();const n=m.current.value||"";!(m.current.unmaskedValue||"")&&!n.replace(/[^0-9]/g,"")&&(m.current.value="",m.current.updateValue())}},onBlur:()=>{q()},onKeyDown:n=>{if(n.key==="Backspace"){const g=m.current?.value||"",h=m.current?.unmaskedValue||"";if(g===""||h===""||g.replace(/[^0-9]/g,"").length<=1){n.preventDefault();const d=Array.isArray(o)?[...o,1]:[o,1];k.setFieldValue(d,void 0),V([C[0],null]),m.current&&(m.current.value="",m.current.updateValue()),setTimeout(()=>{u.current?.focus(),p("start"),j(!0)},0);return}p("end"),j(!0)}if(n.key==="Tab"&&j(!1),n.key==="Enter")if(D&&B==="end"){const g=m.current?.value||"";g.length===e.length?E(g,e,!0).isValid()?(j(!1),b(!1)):i?.allowEmpty?b(!1):b(!0):b(!1)}else p("end"),j(!0)},style:{flex:1},allowClear:!0,onClear:()=>{const n=Array.isArray(o)?[...o,1]:[o,1];k.setFieldValue(n,void 0),V([C[0],null]),m.current&&(m.current.value="",m.current.updateValue()),setTimeout(()=>{u.current?.focus(),p("start"),j(!0)},0)},placeholder:l.replace(/0/g,"_"),suffix:s.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})})]}),s.jsx(ke,{...i,open:D,picker:t,format:{format:e,type:"mask"},showNow:!0,value:C,onChange:K,onOpenChange:n=>{j(n),n||q(!1)},renderExtraFooter:()=>O?s.jsxs("div",{style:{color:"#faad14",paddingLeft:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"6px",borderTop:"1px solid #f0f0f0",backgroundColor:"#fffbe6"},children:[s.jsx(P.ExclamationCircleOutlined,{}),s.jsx("span",{children:"유효하지 않은 날짜입니다"})]}):null,getPopupContainer:n=>n.parentElement,style:{position:"absolute",top:0,left:0,pointerEvents:"none",opacity:0,width:"100%"}})]})})},{Option:ee}=a.Select,Ve=({itemProps:t,inputProps:r})=>{const[f,i]=x.useState([]);return x.useEffect(()=>{r?.addField==="ALL"?i([{label:"전체",value:""},...r?.list||[]]):r?.addField==="NULL"?i([{label:"",value:""},...r?.list||[]]):i(r?.list||[])},[r?.list]),s.jsx($,{...t,getValueProps:e=>e?{value:e&&e.indexOf(",")>0?e.split(","):[e]}:{value:[]},normalize:e=>e!=null&&e!=null&&e.length>0?e.toString():"",children:s.jsx(a.Select,{...r,mode:"multiple",children:f.map(e=>{const{value:l,label:y}=e;return r?.printCode?s.jsx(ee,{value:l,label:y,children:s.jsx(a.Space,{children:`[${l}] ${y}`})},l):s.jsx(ee,{value:l,label:y,children:s.jsx(a.Space,{children:`${y}`})},l)})})})},Ie=({itemProps:t,inputProps:r})=>{const f=e=>{let l=e.toString().split(".");return r?.decimalPoint!=null&&l[1]!=null&&r?.decimalPoint>0?l[1].length>r?.decimalPoint?l[1]="."+l[1].substring(0,r?.decimalPoint):l[1]="."+l[1]:l[1]="",l[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")+l[1]},i=e=>{let l=e.toString().split(".");return r?.decimalPoint!=null&&l[1]!=null&&r?.decimalPoint>0?l[1].length>r?.decimalPoint?l[1]="."+l[1].substring(0,r?.decimalPoint):l[1]="."+l[1]:l[1]="",l[0].replace(/\$\s?|(,*)/g,"")+l[1]};return s.jsx($,{...t,children:s.jsx(a.InputNumber,{...r,formatter:e=>f(e),parser:e=>i(e)})})},Le=({itemProps:t,inputProps:r})=>s.jsx($,{...t,children:s.jsx(a.Radio.Group,{...r})}),{RangePicker:ve}=a.DatePicker,te={year:{displayFormat:"YYYY",outputFormat:"YYYY"},month:{displayFormat:"YYYY-MM",outputFormat:"YYYYMM"},date:{displayFormat:"YYYY-MM-DD",outputFormat:"YYYYMMDD"},time:{displayFormat:"HH:mm",outputFormat:"HHmm"},datetime:{displayFormat:"YYYY-MM-DD HH:mm",outputFormat:"YYYYMMDDHHmm"}},Me=({itemProps:t,inputProps:r,type:f="date",minDate:i,maxDate:e,returnType:l="string"})=>{const{displayFormat:y,outputFormat:u}=x.useMemo(()=>te[f],[f]),F=x.useMemo(()=>Object.values(te).map(c=>c.outputFormat).sort((c,m)=>{if(c.length===m.length){if(c===u)return-1;if(m===u)return 1}return m.length-c.length}),[u]);return s.jsx($,{...t,getValueProps:c=>({value:c&&c.length>0?[c[0]?E.isDayjs(c[0])?c[0]:E(c[0],F):null,c[1]?E.isDayjs(c[1])?c[1]:E(c[1],F):null]:null}),normalize:c=>c?l==="dayjs"?[c[0]??void 0,c[1]??void 0]:[c[0]?c[0].format(u):void 0,c[1]?c[1].format(u):void 0]:[void 0,void 0],children:s.jsx(ve,{...r,order:!0,minDate:i?E(i,F):void 0,maxDate:e?E(e,F):void 0,picker:f==="datetime"?"date":f,showTime:r?.showTime??(f==="datetime"||f==="time"),format:y})})},re=a.Input.Search,De=t=>{const r=a.Form.useFormInstance(),{openPopup:f}=se.usePopupStore(),i=t.itemProps?.name||[],e=t.popupConfig||{callback(y){Array.isArray(i)&&i.length>1?(r.setFieldValue(i[0],y.code),r.setFieldValue(i[1],y.name)):r.setFieldValue(i,y.code)}},l={...t,placeholder:typeof t.placeholder=="string"?t.placeholder:t.placeholder?.[0]||"",onChange:y=>{Array.isArray(i)&&i.length>1&&r.setFieldValue(i[0],""),t.onChange?.(y)},onSearch:y=>{t.popuCd?f(t.popuCd,t.popupParams,e):t.onSearch?.(y)}};return Array.isArray(i)&&i.length>1?s.jsx($,{...t.itemProps,name:void 0,children:s.jsxs(a.Space.Compact,{block:!0,children:[s.jsx(a.Form.Item,{name:i[0],rules:t.itemProps?.rules,style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:s.jsx(a.Input,{style:{color:"#999",backgroundColor:"#f5f5f5"},placeholder:t.placeholder?.[0]||"",readOnly:!0})}),s.jsx(a.Form.Item,{name:i[1],style:{width:"60%",marginBottom:0},children:s.jsx(re,{readOnly:t.readOnly,enterButton:s.jsx(a.Button,{icon:s.jsx(P.SearchOutlined,{}),disabled:t.readOnly}),...l})})]})}):s.jsx($,{...t.itemProps,children:s.jsx(re,{...l})})},Be=({itemProps:t,selectProps:r={options:[],allowClear:!0}})=>{const f=a.Form.useFormInstance(),i=!!f,e=x.useMemo(()=>r?.addField==="ALL"?[{label:"전체",value:""},...r?.options||[]]:r?.addField==="NULL"?[{label:"",value:""},...r?.options||[]]:r?.options||[],[r.options,r.addField]),l=F=>{r.onChange?.(F)},y={...r,allowClear:r.allowClear??!0,options:e,onChange:l,variant:r.variant},u=s.jsx(a.Select,{...y,disabled:r.disabled});return r.copyable&&!i&&console.warn("BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."),r.copyable?s.jsx($,{...t,name:void 0,children:s.jsxs(a.Space.Compact,{block:!0,children:[s.jsx(a.Form.Item,{name:t?.name,rules:t?.rules,style:{width:"100%",marginBottom:0},validateStatus:"",help:"",children:u}),s.jsx(a.Typography.Paragraph,{copyable:{text:i&&f?.getFieldValue(t?.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"}})]})}):s.jsx($,{...t,children:u})},Ee=({itemProps:t,inputProps:r={format:"YN"}})=>{const f=a.Form.useFormInstance(),i=(e,l)=>{r.format==="boolean"?f.setFieldValue(t?.name,e):f.setFieldValue(t?.name,e?"Y":"N"),r.onChange&&r.onChange(e,l)};return s.jsx($,{...t,getValueProps:e=>({checked:r.format==="boolean"?!!e:e==="Y"}),normalize:e=>typeof e=="boolean"?r.format==="boolean"?e:e?"Y":"N":r.format==="boolean"?!!e:e?"Y":"N",children:s.jsx(a.Switch,{...r,onChange:(e,l)=>i(e,l)})})},{TextArea:_e}=a.Input,Ne=({itemProps:t,inputProps:r})=>s.jsx($,{...t,children:s.jsx(_e,{...r})}),Ae=[".pdf",".xlsx",".xls",".docx",".doc",".pptx",".ppt",".hwp",".txt",".csv",".jpg",".jpeg",".png",".gif",".zip"],ne={FILE:"file"},Re=({originNode:t,file:r,fileList:f,moveFile:i,onDrop:e})=>{const l=x.useRef(null),[{handlerId:y},u]=X.useDrop({accept:ne.FILE,collect:Y=>({handlerId:Y.getHandlerId()}),hover(Y,k){if(!l.current)return;const D=Y.uid,j=r.uid;if(D===j)return;const O=G.findIndex(f,{uid:j}),b=G.findIndex(f,{uid:D});if(b===-1||O===-1)return;const B=l.current.getBoundingClientRect(),p=k.getClientOffset();if(!p)return;const v=(B.bottom-B.top)/2,_=p.y-B.top;b<O&&_<v||b>O&&_>v||i(D,j)},drop(){e()}}),[{isDragging:F},c]=X.useDrag({type:ne.FILE,item:()=>({uid:r.uid,index:G.findIndex(f,{uid:r.uid})}),collect:Y=>({isDragging:Y.isDragging()})}),m=F?0:1;return c(u(l)),s.jsx("div",{ref:l,style:{opacity:m},"data-handler-id":y,children:t})},Ue=({itemProps:t,fileGrpKey:r,onUploadComplete:f,onFetchFilesTrxCd:i="SCMFILE00101",onSuccessTrxCd:e="SCMFILE00102",onDeleteFileTrxCd:l="SCMFILE00103",onReorderFilesTrxCd:y="SCMFILE00104",allowedExtensions:u=Ae,maxFileSize:F=200,showButton:c=!0,multiple:m=!1,newFileGrpKeyonModify:Y=!1,buttonText:k="파일 선택",localOnly:D=!1,onFilesChange:j})=>{const[O,b]=x.useState([]),B=x.useRef(r),p=x.useRef([]),v=a.Form.useFormInstance(),_=()=>{if(D||p.current.length===0)return;const n=[...p.current];if(p.current=[],e){const g=n.map(h=>({crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:B.current,physFileNm:h.fileNameP,lgclFileNm:h.fileNameL,filePath:h.filePath,fileExtn:h.fileExt,fileSize:h.fileSize,mltpYn:"N"}));console.log("newFileGrpKeyonModify",Y),console.log("newFileGrpKeyonModify",Y?0:B.current),T.callService(e,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:Y?0:B.current,oldFileGrpKey:B.current,newFileGrpKeyonModify:Y,sub:g}).then(h=>{if(h?.sub&&h.sub.length>0){const d=h.sub[0].fileGrpKey;(!B.current||Y)&&(B.current=d);const M=new Map;h.sub.forEach(L=>{const N=n.find(H=>H.fileNameL===L.lgclFileNm);N&&M.set(N.tempId,L)});const S=t?.name;(L=>{if(w){const N=v?.getFieldValue(S)||[],H=L(N);v?.setFieldValue(S,H)}else b(N=>L(N))})(L=>L.map(N=>{const H=M.get(N.uid);if(H){const Z=n.find(le=>le.tempId===N.uid);return f&&Z&&f({...Z,fileGrpKey:d,fileKey:H.fileKey}),{...N,name:H.lgclFileNm,fileGrpKey:d,fileKey:H.fileKey,uid:H.fileKey,status:"done",url:`/api/download?filePath=${H.filePath}&logicalName=${H.lgclFileNm}`}}return N}))}}).catch(h=>{console.error("업로드 후처리 서비스 호출 실패:",h),a.message.error("파일 후처리 중 오류가 발생했습니다.");const d=new Set(n.map(I=>I.tempId)),M=t?.name;(I=>{if(w){const L=v?.getFieldValue(M)||[],N=I(L);v?.setFieldValue(M,N)}else b(L=>I(L))})(I=>I.map(L=>d.has(L.uid)?{...L,status:"error",error:"후처리 실패"}:L))})}},U=x.useRef(G.debounce(_,500)).current;x.useEffect(()=>()=>{U.cancel()},[U]),x.useEffect(()=>{B.current=r},[r]),x.useEffect(()=>{D||r&&i&&T.callService(i,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r}).then(n=>{if(n?.sub){const g=n.sub.map(d=>({uid:d.fileKey,name:d.lgclFileNm,status:"done",url:`/api/download?filePath=${d.filePath}&logicalName=${d.lgclFileNm}`})),h=t?.name;w?v?.setFieldValue(h,g):b(g)}else{const g=t?.name;w?v?.setFieldValue(g,[]):b([])}}).catch(n=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",n),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")})},[r,i]);const o=(n,g)=>{const h=t?.name,d=w?v?.getFieldValue(h)||[]:O,M=G.findIndex(d,{uid:n}),S=G.findIndex(d,{uid:g});if(M<0||S<0)return;const I=[...d],[L]=I.splice(M,1);I.splice(S,0,L),w?v?.setFieldValue(h,I):b(I)},C=()=>{if(!D&&r&&y){const n=t?.name,h=(w?v?.getFieldValue(n)||[]:O).map(d=>d.uid);T.callService(y,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r,reorderedFileKeys:h}).then(()=>{a.message.success("파일 순서가 성공적으로 저장되었습니다.")}).catch(d=>{console.error("파일 순서 저장 서비스 호출 실패:",d),a.message.error("파일 순서 저장 중 오류가 발생했습니다.")})}},V=n=>{const g=t?.name,h=w?v?.getFieldValue(g)||[]:O;if(!m&&h.length>0)return a.message.error("하나의 파일만 업로드할 수 있습니다."),a.Upload.LIST_IGNORE;if(u&&u.length>0){const d=`.${n.name.split(".").pop()?.toLowerCase()}`;if(!u.includes(d))return a.message.error(`${n.name} 파일은 허용되지 않는 확장자입니다. (${u.join(", ")})`),a.Upload.LIST_IGNORE}return F&&!(n.size/1024/1024<F)?(a.message.error(`일반업로드의 최대용량은 ${F}MB입니다.`),a.Upload.LIST_IGNORE):!D},w=!!t?.name,A={name:"file",multiple:m,action:D?void 0:"/api/upload",beforeUpload:V,showUploadList:{showRemoveIcon:c},onChange(n){const{status:g,uid:h}=n.file;if(g==="removed"){if(!D&&l)T.callService(l,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:Y?0:B.current,fileKey:h,oldFileGrpKey:B.current,newFileGrpKeyonModify:Y}).then(d=>{if(a.message.success("파일이 성공적으로 삭제되었습니다."),Y&&(B.current=d.fileGrpKey),w){const M=t?.name;v?.setFieldValue(M,n.fileList)}else b(n.fileList);j?.(n.fileList),f?.({fileGrpKey:d.fileGrpKey})}).catch(d=>{console.error("파일 삭제 서비스 호출에 실패했습니다.",d),a.message.error("파일 삭제 중 오류가 발생했습니다.")});else{if(w){const d=t?.name;v?.setFieldValue(d,n.fileList)}else b(n.fileList);j?.(n.fileList)}return}if(w){const d=t?.name;v?.setFieldValue(d,n.fileList)}else b(n.fileList);if(j?.(n.fileList),g==="done")if(!D&&n.file.response?.success){const{uploadedFiles:d}=n.file.response;d&&Array.isArray(d)&&d.length>0&&(d.forEach(M=>{M.tempId=n.file.uid,p.current.push(M)}),U()),a.message.success(n.file.response.message||`${n.file.name} 파일이 성공적으로 업로드되었습니다.`)}else a.message.error(n.file.response?.message||`${n.file.name} 파일 업로드에 실패했습니다.`);else g==="error"&&a.message.error(n.file.response?.message||`${n.file.name} 파일 업로드 중 오류가 발생했습니다.`)},itemRender(n,g,h){const d=x.cloneElement(n,{href:g.url||void 0,title:void 0});return s.jsx(Re,{originNode:d,file:g,fileList:h,moveFile:o,onDrop:C},g.uid)}};w||(A.fileList=O);const R=n=>Array.isArray(n)?n:n&&n.fileList,z=t?.name,K=w?a.Form.useWatch?.(z,v):void 0,q=w?K||[]:O;return s.jsx(X.DndProvider,{backend:ce.HTML5Backend,children:s.jsx($,{valuePropName:"fileList",getValueFromEvent:R,...t,children:s.jsx(a.Upload,{headers:{SYSCD:__SYS_CD__},...A,listType:"picture",children:c&&(m||q.length===0)&&s.jsx(a.Button,{icon:s.jsx(P.UploadOutlined,{}),children:k})})})})};exports.BwgButton=ue;exports.BwgCheck=de;exports.BwgCheckList=fe;exports.BwgDatePicker=me;exports.BwgDownload=ge;exports.BwgForm=oe;exports.BwgFormItem=$;exports.BwgInput=pe;exports.BwgLargeUploader=Fe;exports.BwgMaskedDate=Ye;exports.BwgMaskedInput=Se;exports.BwgMaskedRange=we;exports.BwgMultiSelect=Ve;exports.BwgNumber=Ie;exports.BwgRadio=Le;exports.BwgRangePicker=Me;exports.BwgSearch=De;exports.BwgSelect=Be;exports.BwgSwitch=Ee;exports.BwgTextArea=Ne;exports.BwgUploader=Ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/core-components-CX6NGtTh.cjs");exports.BwgButton=e.BwgButton;exports.BwgCheck=e.BwgCheck;exports.BwgCheckList=e.BwgCheckList;exports.BwgDatePicker=e.BwgDatePicker;exports.BwgDownload=e.BwgDownload;exports.BwgForm=e.BwgForm;exports.BwgFormItem=e.BwgFormItem;exports.BwgInput=e.BwgInput;exports.BwgLargeUploader=e.BwgLargeUploader;exports.BwgMaskedDate=e.BwgMaskedDate;exports.BwgMaskedInput=e.BwgMaskedInput;exports.BwgMaskedRange=e.BwgMaskedRange;exports.BwgMultiSelect=e.BwgMultiSelect;exports.BwgNumber=e.BwgNumber;exports.BwgRadio=e.BwgRadio;exports.BwgRangePicker=e.BwgRangePicker;exports.BwgSearch=e.BwgSearch;exports.BwgSelect=e.BwgSelect;exports.BwgSwitch=e.BwgSwitch;exports.BwgTextArea=e.BwgTextArea;exports.BwgUploader=e.BwgUploader;