@bwg-ui/core 1.3.5 → 1.3.6
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/{CMSearchIntfGwP01-DBpDpgQr.js → CMSearchIntfGwP01-BBdPmalj.js} +1 -1
- package/dist/chunks/{CMSearchIntfGwP01-CuGDAfFM.cjs → CMSearchIntfGwP01-Cs78BtE7.cjs} +1 -1
- package/dist/chunks/{MenuReport-yw8tZDUk.cjs → MenuReport-BCO-gXwk.cjs} +1 -1
- package/dist/chunks/{MenuReport-CCbCy7yt.js → MenuReport-CYK_Eaqa.js} +1 -1
- package/dist/chunks/{common-components-DtzVj5lz.js → common-components-C61ER0qC.js} +12846 -13367
- package/dist/chunks/common-components-mXgJEMpT.cjs +1109 -0
- package/dist/chunks/layout-components-D7I6VhXN.cjs +38 -0
- package/dist/chunks/{layout-components-ljht1sHh.js → layout-components-gqu1pmfr.js} +486 -438
- package/dist/components/common/BwgGrid.d.ts +31 -8
- package/dist/components/common/BwgGrid.d.ts.map +1 -1
- package/dist/components/common/BwgView.d.ts.map +1 -1
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgEmpSearch.d.ts +2 -2
- package/dist/components/core/BwgEmpSearch.d.ts.map +1 -1
- package/dist/components/core/BwgMaskedDate.d.ts.map +1 -1
- package/dist/components/core/BwgMaskedRange.d.ts.map +1 -1
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +210 -207
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.js +1 -1
- package/dist/components/layout/BwgCoreLogin.d.ts.map +1 -1
- package/dist/components/layout/BwgPortal01.d.ts.map +1 -1
- package/dist/components/layout/extension/ContentWrapper.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/pages/board/CMMyBoardM01.d.ts.map +1 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts.map +1 -1
- package/dist/components/popup/SearchOrganizationP02.d.ts.map +1 -1
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/public/realgrid/css/realgrid-style-custom.css +6 -10
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.js +1 -1
- package/dist/styles/assets/images/backgrounds/kiam_login_bg.png +0 -0
- package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
- package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
- package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
- package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
- package/dist/styles/components_02.css +35 -0
- package/dist/styles/global.css +9 -1
- package/dist/styles/index.css +3 -0
- package/dist/styles/layout.css +14 -4
- package/dist/styles/layout_02.css +99 -0
- package/dist/styles/login.css +7 -44
- package/dist/styles/login_02.css +35 -0
- package/dist/utils/apiUtils.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +67 -66
- package/package.json +1 -1
- package/dist/chunks/common-components-CbkWoYfX.cjs +0 -1111
- package/dist/chunks/layout-components-BzLAGXiu.cjs +0 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormInstance } from 'antd';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSProperties, MutableRefObject, Ref } from 'react';
|
|
3
3
|
import { default as RealGrid, CellIndex, ClickData, ColumnHeaderItemLocation, DataColumn, DataProviderBase, GridBase, GridColumn, GridExportOptions, GridFitStyle, GridView, LocalDataProvider, LocalTreeDataProvider, SelectionStyle, TreeView, ValidationError, ValueType } from 'realgrid';
|
|
4
4
|
import { RealGridReact, RealTreeReact } from 'realgrid-react';
|
|
5
5
|
interface BwgGridDataLoadOption {
|
|
@@ -242,7 +242,7 @@ interface BwgGridEventList {
|
|
|
242
242
|
*/
|
|
243
243
|
onLayoutPropertyChanged?: (grid: GridBase, layout: any, property: string, oldValue: any, newValue: any) => void;
|
|
244
244
|
}
|
|
245
|
-
interface
|
|
245
|
+
interface BwgGridRefBase {
|
|
246
246
|
/** 데이터 추가 */
|
|
247
247
|
addAllData: (data: any, option?: BwgGridDataLoadOption) => void;
|
|
248
248
|
/** 그리드 인스턴스 직접 접근 */
|
|
@@ -270,11 +270,23 @@ interface BwgGridRef {
|
|
|
270
270
|
* 그리드 데이터 삭제
|
|
271
271
|
*/
|
|
272
272
|
deleteGridData: () => void;
|
|
273
|
+
/**
|
|
274
|
+
* 그리드 변경상태 체크
|
|
275
|
+
* */
|
|
276
|
+
isUpdate: () => boolean;
|
|
273
277
|
/** 데이터 프로바이더 직접 접근 */
|
|
274
278
|
dp: LocalDataProvider | LocalTreeDataProvider | null;
|
|
275
279
|
/** 그리드 뷰 직접 접근 */
|
|
276
280
|
vw: GridView | TreeView | null;
|
|
277
281
|
}
|
|
282
|
+
export type BwgGridRef = Omit<BwgGridRefBase, 'dp' | 'vw'> & {
|
|
283
|
+
dp: LocalDataProvider;
|
|
284
|
+
vw: GridView;
|
|
285
|
+
};
|
|
286
|
+
export type BwgGridRefTree = Omit<BwgGridRefBase, 'dp' | 'vw'> & {
|
|
287
|
+
dp: LocalTreeDataProvider;
|
|
288
|
+
vw: TreeView;
|
|
289
|
+
};
|
|
278
290
|
interface BwgGridProps {
|
|
279
291
|
/** 그리드 렌더 타입 */
|
|
280
292
|
type?: 'nrml' | 'tree';
|
|
@@ -306,12 +318,16 @@ interface BwgGridProps {
|
|
|
306
318
|
};
|
|
307
319
|
}[];
|
|
308
320
|
/** 그리드 초기화 콜백 */
|
|
309
|
-
gridInitCallback?: (grid?:
|
|
321
|
+
gridInitCallback?: (grid?: BwgGridRefBase | null) => void;
|
|
310
322
|
/** 그리드 ID (레이아웃 저장/로드를 위한 고유 식별자) */
|
|
311
323
|
gridId?: string;
|
|
312
|
-
/** ref prop for forwardRef */
|
|
313
|
-
ref?: Ref<BwgGridRef>;
|
|
314
324
|
}
|
|
325
|
+
type BwgGridPropsNrml = Omit<BwgGridProps, 'type'> & {
|
|
326
|
+
type?: 'nrml';
|
|
327
|
+
};
|
|
328
|
+
type BwgGridPropsTree = Omit<BwgGridProps, 'type'> & {
|
|
329
|
+
type: 'tree';
|
|
330
|
+
};
|
|
315
331
|
/**
|
|
316
332
|
* BWG 그리드 옵션
|
|
317
333
|
* @remark 리얼그리드 기본 옵션 중 커스터마이징 가능한 옵션 제공
|
|
@@ -536,7 +552,14 @@ interface BwgGridExcelOption {
|
|
|
536
552
|
/** 꼬리말 */
|
|
537
553
|
tailTitle?: string;
|
|
538
554
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
555
|
+
declare const BwgGrid: {
|
|
556
|
+
(props: BwgGridPropsNrml & {
|
|
557
|
+
ref?: Ref<BwgGridRef>;
|
|
558
|
+
}): JSX.Element;
|
|
559
|
+
(props: BwgGridPropsTree & {
|
|
560
|
+
ref?: Ref<BwgGridRefTree>;
|
|
561
|
+
}): JSX.Element;
|
|
562
|
+
};
|
|
563
|
+
export type { BwgGridColHeaderProps, BwgGridColProps, BwgGridDataLoadOption, BwgGridEventList, BwgGridOptions, BwgGridProps, };
|
|
564
|
+
export default BwgGrid;
|
|
542
565
|
//# sourceMappingURL=BwgGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BwgGrid.d.ts","sourceRoot":"","sources":["../../../src/components/common/BwgGrid.tsx"],"names":[],"mappings":"AAUA,OAAO,EAKL,YAAY,EAGb,MAAM,MAAM,CAAC;AACd,OAAO,EAEL,aAAa,
|
|
1
|
+
{"version":3,"file":"BwgGrid.d.ts","sourceRoot":"","sources":["../../../src/components/common/BwgGrid.tsx"],"names":[],"mappings":"AAUA,OAAO,EAKL,YAAY,EAGb,MAAM,MAAM,CAAC;AACd,OAAO,EAEL,aAAa,EAGb,gBAAgB,EAEhB,GAAG,EAQJ,MAAM,OAAO,CA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AAE,MAAM,CAAC;IAClB,UAAU;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAk5DD,QAAA,MAAM,OAAO,EAA6B;IACxC,CAAC,KAAK,EAAE,gBAAgB,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;KAAE,GAAG,GAAG,CAAC,OAAO,CAAC;IACnE,CAAC,KAAK,EAAE,gBAAgB,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;KAAE,GAAG,GAAG,CAAC,OAAO,CAAC;CACxE,CAAC;AAEF,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,YAAY,GACb,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BwgView.d.ts","sourceRoot":"","sources":["../../../src/components/common/BwgView.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAkB,MAAM,QAAQ,CAAC;AAqBlE;;;;;;GAMG;AACH,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"BwgView.d.ts","sourceRoot":"","sources":["../../../src/components/common/BwgView.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAkB,MAAM,QAAQ,CAAC;AAqBlE;;;;;;GAMG;AACH,QAAA,MAAM,OAAO,qGAihBZ,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/common-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../chunks/common-components-mXgJEMpT.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-
|
|
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-C61ER0qC.js";
|
|
2
2
|
import { createBwgGridRenderer as h, realFormat as k } from "../../utils/index.js";
|
|
3
3
|
export {
|
|
4
4
|
o as ButtonAccessController,
|
|
@@ -14,9 +14,9 @@ export interface BwgEmpSearchProps {
|
|
|
14
14
|
empNoFieldName?: string;
|
|
15
15
|
/** Employee 객체를 저장할 필드명 (디폴트: employee)*/
|
|
16
16
|
employeeFieldName?: string;
|
|
17
|
-
/** 표시할 필드 1 (디폴트:
|
|
17
|
+
/** 표시할 필드 1 (디폴트: 부서명) */
|
|
18
18
|
field1?: EmpSearchField;
|
|
19
|
-
/** 표시할 필드 2 (디폴트:
|
|
19
|
+
/** 표시할 필드 2 (디폴트: 사원명) */
|
|
20
20
|
field2?: EmpSearchField;
|
|
21
21
|
/** 읽기 전용 */
|
|
22
22
|
readOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BwgEmpSearch.d.ts","sourceRoot":"","sources":["../../../src/components/core/BwgEmpSearch.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,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,
|
|
1
|
+
{"version":3,"file":"BwgEmpSearch.d.ts","sourceRoot":"","sources":["../../../src/components/core/BwgEmpSearch.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC;IACvB,iBAAiB;IACjB,SAAS,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{"version":3,"file":"BwgMaskedDate.d.ts","sourceRoot":"","sources":["../../../src/components/core/BwgMaskedDate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAIxD,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AACxD,OAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG9D,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAkBjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE3C,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAgSzC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BwgMaskedRange.d.ts","sourceRoot":"","sources":["../../../src/components/core/BwgMaskedRange.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AACxD,OAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAI9D,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAkBjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE3C,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"BwgMaskedRange.d.ts","sourceRoot":"","sources":["../../../src/components/core/BwgMaskedRange.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AACxD,OAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAI9D,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAkBjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE3C,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAk3B3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("antd"),x=require("react"),ae=require("../../stores/index.cjs"),E=require("dayjs"),P=require("@ant-design/icons"),T=require("../../utils/index.cjs"),ie=require("jszip"),Z=require("imask"),X=require("../../chunks/provider-r4mkv5Zs.cjs"),G=require("lodash"),J=require("react-dnd"),ce=require("react-dnd-html5-backend"),ue=e=>{const{componentSize:r}=ae.useUserStore(),m=x.useMemo(()=>e.size?e.size:{0:"small",1:"middle",2:"large"}[r],[r,e.size]),i=x.useMemo(()=>({0:12,1:14,2:16})[r],[r]);return n.jsx(a.Button,{...e,size:m,className:"bwg-btn",style:{fontSize:`${i}px`,...e.style},children:e.children})},$=x.memo(({children:e,label:r,name:m,rules:i,initialValue:t,style:l,required:p,...c})=>{const F={fontWeight:"bold"};(i==null||i==null)&&p&&(i=[{required:!0,message:`${r}을(를) 입력해주세요.`}]);const u=Array.isArray(i)&&i.some(j=>j.required===!0),d=()=>typeof r=="string"?n.jsxs("span",{style:F,children:[r,u&&n.jsx("span",{style:{color:"#ff4d4f",marginLeft:"4px"},children:"*"})]}):n.jsx("span",{style:F,children:r});return n.jsx(a.Form.Item,{className:"bwg-form-item",label:r?d():void 0,labelAlign:c.labelAlign||"left",name:m,rules:i,colon:!1,initialValue:t,style:l,...c,children:e})}),de=({itemProps:e,inputProps:r={format:"YN"}})=>{const m=a.Form.useFormInstance(),i=t=>{r.format==="boolean"?m.setFieldValue(e?.name,t.target.checked):m.setFieldValue(e?.name,t.target.checked?"Y":"N"),r.onChange&&r.onChange(t)};return n.jsx($,{...e,getValueProps:t=>({checked:r.format==="boolean"?!!t:t==="Y"}),normalize:t=>typeof t=="boolean"?r.format==="boolean"?t:t?"Y":"N":r.format==="boolean"?!!t:t?"Y":"N",children:n.jsx(a.Checkbox,{...r,onChange:i,children:r?.title})})},fe=({itemProps:e,inputProps:r})=>{const m=a.Form.useFormInstance(),[i,t]=x.useState(e?.initialValue??[]),[l,p]=x.useState([]),c=l.length>0&&l.length==i?.length,F=i?.length>0&&i.length<l.length;x.useEffect(()=>{p(u(r?.options))},[r?.options]),x.useEffect(()=>{t(i)},[i]);const u=C=>{const L=[];return(C||[]).map((k,U)=>{L.push(k.value)}),L},d=C=>{t(C.target.checked?l:[]),m.setFieldValue(e?.name,C.target.checked?l:[])},j=C=>{t(C),m.setFieldValue(e?.name,C),r?.onChange&&typeof r?.onChange=="function"&&r?.onChange(C)};return n.jsx($,{...e,children:n.jsxs(a.ConfigProvider,{theme:{components:{Checkbox:{colorPrimary:"var(--check-primary)",colorPrimaryBorder:"var(--check-primary)",colorPrimaryHover:"var(--check-primary-active)"}}},children:[r?.allCheck&&n.jsx(a.Checkbox,{indeterminate:F,checked:c,onChange:d,children:"전체선택"}),n.jsx(a.Checkbox.Group,{options:r?.options,value:i,onChange:j})]})})},ee={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:e,inputProps:r,type:m="date",returnType:i="string"})=>{const{displayFormat:t,outputFormat:l}=x.useMemo(()=>ee[m],[m]),p=x.useMemo(()=>Object.values(ee).map(c=>c.outputFormat).sort((c,F)=>{if(c.length===F.length){if(c===l)return-1;if(F===l)return 1}return F.length-c.length}),[l]);return n.jsx($,{...e,getValueProps:c=>({value:c?E.isDayjs(c)?c:E(c,p):null}),normalize:c=>c?i==="dayjs"?c:c.format(l):null,children:n.jsx(a.DatePicker,{...r,picker:m==="datetime"?"date":m,showTime:r?.showTime??(m==="datetime"||m==="time"),format:r?.format??t})})},ge=({fileGrpKey:e,onFetchFilesTrxCd:r="SCMFILE00101",readOnly:m=!1,appCd:i=__APP_CD__})=>{const[t,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:e}).then(u=>{if(u?.sub){const d=u.sub.map(j=>({uid:j.fileKey,name:j.lgclFileNm,filePath:j.filePath}));l(d)}}).catch(u=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",u),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")})}else T.callService(r,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:e}).then(c=>{if(c?.sub){const F=c.sub.map(u=>({uid:u.fileKey,name:u.lgclFileNm,filePath:u.filePath}));l(F)}}).catch(c=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",c),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")});else l([])},[e,r,i]);const p=async c=>{try{const u=T.getApiDeps().findSystemByAppCd?.(i??__APP_CD__);if(!u||!u.sysCd){console.error("해당 앱코드는 존재하지 않습니다.",i);return}const j=await fetch("/api/download",{method:"POST",headers:{SYSCD:u.sysCd,"Content-Type":"application/json"},body:JSON.stringify({filePath:c.filePath,logicalName:c.name,fileKey:c.uid})});if(!j.ok){const V=(await j.json().catch(()=>null))?.message||"파일 다운로드에 실패했습니다.";throw new Error(V)}const C=await j.blob(),L=window.URL.createObjectURL(C),k=document.createElement("a");k.href=L,k.setAttribute("download",c.name),document.body.appendChild(k),k.click(),document.body.removeChild(k),window.URL.revokeObjectURL(L)}catch(F){console.error(F),a.message.error(F.message||"파일을 다운로드하는 중 오류가 발생했습니다.")}};return n.jsx(a.Card,{title:"파일 목록",children:n.jsx(a.List,{dataSource:t,renderItem:c=>n.jsx(a.List.Item,{actions:m?[]:[n.jsx(a.Button,{type:"text",icon:n.jsx(P.DownloadOutlined,{}),onClick:()=>p(c)},"download")],children:n.jsx(a.List.Item.Meta,{avatar:n.jsx(P.PaperClipOutlined,{}),title:c.name})})})})},oe=x.forwardRef(({children:e,labelCol:r,style:m,className:i,...t},l)=>n.jsx(a.ConfigProvider,{form:{},children:n.jsx(a.Form,{ref:l,...t,requiredMark:!1,labelCol:r||{flex:"100px"},style:{padding:"10px",...m},className:`bwg-form ${i??""}`,children:e})}));oe.displayName="BwgForm";const pe=({itemProps:e,inputProps:r})=>n.jsx($,{...e,children:n.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=(e,r=2)=>{if(e===0)return"0 Bytes";const m=1024,i=r<0?0:r,t=["Bytes","KB","MB","GB","TB"],l=Math.floor(Math.log(e)/Math.log(m));return parseFloat((e/Math.pow(m,l)).toFixed(i))+" "+t[l]},Fe=({title:e="첨부파일",fileGrpKey:r,onUploadComplete:m,onSuccessTrxCd:i="SCMFILE00102",anotherServiceTrxCd:t="SCMFILE00105",allowedExtensions:l=ye,maxFileSize:p=2048})=>{const[c,F]=x.useState([]),[u,d]=x.useState(!1),[j,C]=x.useState(!1),[L,k]=x.useState(0),U=h=>{if(l&&l.length>0){const D=(R=>{const o=R.lastIndexOf(".");return o===-1?"":R.substring(o).toLowerCase()})(h.name);if(!l.includes(D))return a.message.error(`${h.name} 파일은 허용되지 않는 확장자입니다. (${l.join(", ")}만 가능)`),!1}return!0},V=async()=>{const h=c.filter(S=>S.status!=="done"),v=h.reduce((S,I)=>S+(I.size||0),0),D=2*1024*1024*1024;if(v>D){a.notification.error({message:"업로드 용량 초과",description:"한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."});return}if(h.length===0){a.message.warning("업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다.");return}C(!0);let R;try{const S=new ie;h.forEach(I=>{I.originFileObj&&S.file(I.name,I.originFileObj)}),R=await S.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}})}catch(S){C(!1),a.message.error("파일을 압축하는 중 오류가 발생했습니다."),console.error("Zipping error:",S);return}C(!1);const o=new FormData;o.append("file",R,"upload.zip"),d(!0),k(0);try{const S=await new Promise((N,_)=>{const O=new XMLHttpRequest;O.open("POST","/api/upload-large",!0),O.upload.onprogress=z=>{if(z.lengthComputable){const K=Math.round(z.loaded/z.total*100);k(K)}},O.onload=()=>{if(O.status>=200&&O.status<300)try{const z=JSON.parse(O.responseText);z.success?N(z):_(new Error(z.message||"파일 업로드에 실패했습니다."))}catch{_(new Error("잘못된 서버 응답입니다."))}else try{const z=JSON.parse(O.responseText);_(new Error(z.message||`서버 오류: ${O.status}`))}catch{_(new Error(`서버 오류: ${O.status}`))}},O.onerror=()=>{_(new Error("네트워크 오류가 발생했습니다."))},O.send(o)});a.message.success(S.message||"압축 파일이 성공적으로 업로드되었습니다.");const I=c.map(N=>h.find(_=>_.uid===N.uid)?{...N,status:"done"}:N);if(F(I),i&&S.uploadedFiles&&Array.isArray(S.uploadedFiles)){const N=T.getUserInfo();S.uploadedFiles.forEach(_=>{const O={crprCd:N?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r,sub:[{crprCd:N?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r,physFileNm:_.fileNameP,lgclFileNm:_.fileNameL,filePath:_.filePath,fileExtn:_.fileExt,fileSize:_.fileSize,mltpYn:"Y"}]};T.callService(i,O).then(z=>{const K=c.map(q=>({crprCd:N?.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(t,{sub:K})}).catch(z=>{console.error("후처리 서비스 호출 실패:",z),a.message.error(`${_.fileNameL} 파일의 후처리 작업에 실패했습니다.`)}),m&&m({fileNameP:_.fileNameP,fileNameL:_.fileNameL})})}}catch(S){a.message.error(S.message||"파일 업로드 중 오류가 발생했습니다.");const I=c.map(N=>h.find(_=>_.uid===N.uid)?{...N,status:"error",response:S.message||"파일 업로드 중 오류가 발생했습니다."}:N);F(I)}finally{d(!1)}},B={multiple:!0,fileList:c,beforeUpload:h=>U(h)?p&&h.size>=p*1024*1024?(a.message.error(`대용량 첨부 파일 최대 크기는 ${(p/1024).toFixed(1)}GB입니다.`),a.Upload.LIST_IGNORE):!1:a.Upload.LIST_IGNORE,onChange:({fileList:h})=>{const v=new Map(c.map(D=>[D.uid,D]));h.forEach(D=>{v.set(D.uid,D)}),F(Array.from(v.values()))},onRemove:h=>{const v=c.filter(D=>D.uid!==h.uid);F(v)},showUploadList:!1};return n.jsx(a.Spin,{spinning:u||j,tip:j?"파일 압축 중...":`파일 업로드 중... ${L}%`,children:n.jsxs("div",{className:"bwg-large-uploader-container",children:[n.jsx(a.Card,{title:n.jsx(W,{strong:!0,children:e}),extra:n.jsx(a.Upload,{...B,children:n.jsx(a.Button,{icon:n.jsx(P.UploadOutlined,{}),children:"파일 선택"})}),style:{padding:0},children:n.jsx(he,{...B,style:{border:"none",background:"transparent",padding:0},children:n.jsx("div",{className:"upload-list-container",children:c.length>0?n.jsx(a.List,{style:{textAlign:"left"},dataSource:c,renderItem:h=>{const v=h.status==="done",D=h.status==="error";let R;return v?R=n.jsx(P.CheckCircleOutlined,{style:{color:"#52c41a",fontSize:14}}):D?R=n.jsx(a.Tooltip,{title:typeof h.response=="string"?h.response:"업로드 실패",children:n.jsx(P.CloseCircleOutlined,{style:{color:"#ff4d4f",fontSize:14}})}):R=n.jsx(P.FileTextOutlined,{style:{fontSize:14}}),n.jsx(a.List.Item,{actions:[n.jsx(W,{type:"secondary",children:xe(h.size||0)},"size"),n.jsx(a.Button,{type:"text",icon:n.jsx(P.DeleteOutlined,{}),onClick:o=>{o.stopPropagation(),B.onRemove?.(h)},disabled:u||j},"delete")],children:n.jsx(a.List.Item.Meta,{avatar:R,title:n.jsx(W,{type:D?"danger":void 0,children:h.name})})},h.uid)}}):n.jsxs(a.Flex,{gap:"middle",align:"center",justify:"center",vertical:!0,style:{padding:"20px 0",minHeight:"120px"},children:[n.jsx(P.InboxOutlined,{style:{fontSize:"32px",color:"#999"}}),n.jsx(W,{type:"secondary",children:"업로드할 파일을 선택하거나 이 영역으로 드래그하세요."})]})})})}),c.length>0&&n.jsxs(a.Flex,{justify:"flex-end",align:"center",gap:"large",style:{marginTop:16},children:[u&&n.jsx("div",{style:{width:"250px"},children:n.jsx(a.Progress,{percent:L,size:"small"})}),n.jsx(a.Button,{type:"primary",onClick:V,disabled:u||j||c.filter(h=>h.status!=="done").length===0,icon:n.jsx(P.CloudUploadOutlined,{}),children:"일괄 업로드"})]})]})})},Ce=e=>{if(typeof e=="string")return e.replace(/0/g,"_");if(Array.isArray(e))return e[0].replace(/0/g,"_");if(typeof e=="object"&&"mask"in e&&"blocks"in e){const{mask:r,blocks:m}=e;return r.split(".").map(i=>{const l=m?.[i]?.maxLength??3;return"_".repeat(l)}).join(".")}return""},Se=({itemProps:e,inputProps:r,mask:m})=>{const i=x.useRef(null),t=a.Form.useFormInstance(),l=x.useMemo(()=>Ce(m),[m]);return x.useEffect(()=>{if(!i.current?.input)return;const p=typeof m=="string"||Array.isArray(m)?{mask:m}:m,c=Z(i.current.input,p);return c.on("accept",()=>{t&&e?.name&&t.setFieldValue(e.name,c.value)}),()=>{c.destroy()}},[m,t,e?.name]),n.jsx($,{...e,children:n.jsx(a.Input,{...r,ref:i,placeholder:l})})},je=e=>{switch(e){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"}}},ke=({type:e="date",itemProps:r={name:"calendar"},inputProps:m,pickerProps:i})=>{const{format:t,mask:l,outputFormat:p}=je(e),c=x.useRef(null),F=x.useRef(null),u=x.useRef(null),d=a.Form.useFormInstance(),[j,C]=x.useState(!1),[L,k]=x.useState(!1),U=r?.name,[V,B]=x.useState(null),h=a.Form.useWatch(U,d),v=X.useSizeConfig();x.useEffect(()=>{if(!c.current?.input)return;const o=Z(c.current.input,{mask:l,lazy:!1});return F.current=o,o.on("accept",()=>{const S=o.value;S.length>0&&C(!0);const I=E(S,t,!0);S.length===t.length&&I.isValid()&&(d.setFieldValue(U,I.format(p)),B(I),F.current?.updateValue())}),()=>{o.destroy()}},[t,l]),x.useEffect(()=>{if(!h){B(null);return}let o=null;if(typeof h=="string"&&h.length===p.length&&/^\d+$/.test(h))if(e==="date"){const S=h.substring(0,4),I=h.substring(4,6),N=h.substring(6,8);o=E(`${S}-${I}-${N}`,t,!0)}else if(e==="month"){const S=h.substring(0,4),I=h.substring(4,6);o=E(`${S}-${I}`,t,!0)}else e==="year"&&(o=E(h,t,!0));else o=E(h,t,!0);o&&o.isValid()?B(o):B(null),k(!1)},[h,t,p,e]);const D=o=>{if(!o){d.setFieldValue(U,void 0),B(null),F.current?.updateValue();return}B(o);const S=o.format(p);d.setFieldValue(U,S),F.current&&(F.current.value=o.format(t),F.current.updateValue()),k(!1)},R=o=>{setTimeout(()=>{const S=document.activeElement,I=u.current,N=I?.querySelector(".ant-picker-dropdown");!(I&&(I.contains(S)||I===S||N?.contains(S)))&&!(o!==void 0?o:j)&&console.log("✅ Input과 DatePicker 모두 포커스가 없습니다")},0)};return n.jsx($,{...r,name:void 0,validateStatus:L?"warning":void 0,children:n.jsxs(a.ConfigProvider,{componentSize:v.componentSize,theme:{components:{Input:{addonBg:"#fff"}}},children:[n.jsx(a.Form.Item,{name:U,getValueProps:o=>({value:o?E(o).format(t):void 0}),normalize:o=>o?E(o).format(p):void 0,noStyle:!0,children:n.jsx(a.Input,{...m,ref:c,onFocus:()=>{C(!j),F.current?.updateValue()},onBlur:()=>{R()},onKeyDown:o=>{if(o.key==="Backspace"&&C(!0),o.key==="Tab"&&C(!1),o.key==="Enter")if(j){const S=F.current?.value||"",I=E(S,t,!0);S.length===t.length&&I.isValid()?(C(!1),k(!1)):k(!0)}else C(!0)},style:{width:"65%"},allowClear:!0,placeholder:l.replace(/0/g,"_"),suffix:n.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})}),n.jsx(a.DatePicker,{...i,open:j,picker:e,format:{format:t,type:"mask"},showNow:!0,value:V,onChange:D,onOpenChange:o=>{C(o),o||R(!1)},renderExtraFooter:()=>L?n.jsxs("div",{style:{color:"#faad14",paddingLeft:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"6px",borderTop:"1px solid #f0f0f0",backgroundColor:"#fffbe6"},children:[n.jsx(P.ExclamationCircleOutlined,{}),n.jsx("span",{children:"유효하지 않은 날짜입니다"})]}):null,getPopupContainer:o=>o.parentElement,style:{position:"absolute",top:0,left:0,pointerEvents:"none",opacity:0,width:"100%"}})]})})},{RangePicker:Ye}=a.DatePicker,be=e=>{switch(e){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:e="date",itemProps:r={name:"dateRange"},inputProps:m,pickerProps:i})=>{const{format:t,mask:l,outputFormat:p}=be(e),c=x.useRef(null),F=x.useRef(null),u=x.useRef(null),d=x.useRef(null),j=x.useRef(null),C=a.Form.useFormInstance(),[L,k]=x.useState(!1),[U,V]=x.useState(!1),[B,h]=x.useState(null),[v,D]=x.useState(!1),R=x.useRef(!1),o=r?.name,[S,I]=x.useState([null,null]),N=a.Form.useWatch(o?Array.isArray(o)?[...o,0]:[o,0]:void 0,C),_=a.Form.useWatch(o?Array.isArray(o)?[...o,1]:[o,1]:void 0,C),O=a.Form.useWatch(o,C),z=X.useSizeConfig();x.useEffect(()=>{if(!c.current?.input)return;const s=Z(c.current.input,{mask:l,lazy:!1});return u.current=s,s.on("accept",()=>{const g=s.value,y=s.unmaskedValue||"";if(console.log("🔵 [시작일] accept 이벤트:",{maskValue:g,unmaskedValue:y,length:g.length,formatLength:t.length}),g.length>0&&(h("start"),k(!0),D(!1)),y.length===p.length){const f=E(g,t,!0);if(f.isValid()){console.log("🔵 [시작일] 입력 완료 및 검증 통과:",{parsed:f.format(t)});const M=f.format(p);R.current=!0;const b=Array.isArray(o)?[...o,0]:[o,0];C.setFieldValue(b,M),I([f,S[1]]),u.current&&u.current.updateValue(),V(!1),setTimeout(()=>{d.current&&(d.current.value="",d.current.unmaskedValue="",d.current.updateValue());const Y=Array.isArray(o)?[...o,1]:[o,1];C.getFieldValue(Y)||C.setFieldValue(Y,void 0),F.current?.focus(),setTimeout(()=>{if(d.current){const A=d.current.value||"";!(d.current.unmaskedValue||"")&&!A.replace(/[^0-9]/g,"")&&(d.current.value="",d.current.updateValue())}},10),h("end"),k(!0),R.current=!1},0)}else i?.allowEmpty?V(!1):(console.log("🔵 [시작일] 검증 실패:",{val:g,parsed:f}),V(!0))}}),()=>{s.destroy()}},[t,l,o]),x.useEffect(()=>{if(!F.current?.input)return;const s=Z(F.current.input,{mask:l,lazy:!1});return d.current=s,s.on("accept",()=>{const g=s.value,y=s.unmaskedValue||"";if(console.log("🟢 [종료일] accept 이벤트:",{maskValue:g,unmaskedValue:y,length:g.length,formatLength:t.length}),y===""||y.length===0){const f=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(f,void 0),I([S[0],null]),d.current&&(d.current.value="",d.current.updateValue()),setTimeout(()=>{c.current?.focus(),h("start"),k(!0)},0);return}if(g.length>0&&(h("end"),k(!0)),g.length<t.length){V(!1);return}if(y.length===p.length){const f=E(g,t,!0);if(f.isValid()){const M=f.format(p);console.log("🟢 [종료일] 입력 완료:",{parsed:f.format(t),formatted:M}),R.current=!0;const b=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(b,M),I([S[0],f]),d.current?.updateValue(),setTimeout(()=>{R.current=!1},0)}else i?.allowEmpty?V(!1):(console.log("🟢 [종료일] 검증 실패:",{val:g,parsed:f}),V(!0))}}),()=>{s.destroy()}},[t,l,o]),x.useEffect(()=>{console.log("🟡 [useEffect] form 값 변경 감지:",{startFormValue:N,endFormValue:_,formValue:O});const s=N??(Array.isArray(O)?O[0]:null),g=_??(Array.isArray(O)?O[1]:null);if(s===void 0&&g===void 0&&(!O||!Array.isArray(O))){I([null,null]);return}const y=b=>{if(!b)return null;let Y=null;if(typeof b=="string"&&b.length===p.length&&/^\d+$/.test(b))if(e==="date"){const w=b.substring(0,4),A=b.substring(4,6),H=b.substring(6,8);Y=E(`${w}-${A}-${H}`,t,!0)}else if(e==="month"){const w=b.substring(0,4),A=b.substring(4,6);Y=E(`${w}-${A}`,t,!0)}else e==="year"&&(Y=E(b,t,!0));else Y=E(b,t,!0);return Y&&Y.isValid()?Y:null},f=y(s),M=y(g);if(console.log("🟡 [useEffect] 파싱 결과:",{startParsed:f?f.format(t):null,endParsed:M?M.format(t):null,isStartDateFromPicker:v}),I([f,M]),R.current){console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"),V(!1);return}if(!v&&u.current){const b=u.current.value||"",Y=f?f.format(t):"",w=u.current.unmaskedValue||"",A=f?f.format(p):"";console.log("🟡 [useEffect] 시작일 마스크 값 체크:",{currentMaskValue:b,expectedMaskValue:Y,unmaskedValue:w,expectedUnmasked:A,shouldUpdate:b===""||b!==Y,canUpdate:w===""||w===A}),(b===""||b!==Y)&&(w===""||w===A?(console.log("🟡 [useEffect] 시작일 마스크 값 업데이트:",{before:b,after:f?f.format(t):""}),f?(u.current.value=f.format(t),u.current.updateValue()):(u.current.value="",u.current.updateValue())):console.log("🟡 [useEffect] 시작일 마스크 값 업데이트 스킵 (사용자 입력 중)"))}if(d.current){const b=d.current.value||"",Y=M?M.format(t):"",w=d.current.unmaskedValue||"",A=M?M.format(p):"";console.log("🟡 [useEffect] 종료일 마스크 값 체크:",{currentMaskValue:b,expectedMaskValue:Y,unmaskedValue:w,expectedUnmasked:A,shouldUpdate:b===""||b!==Y,canUpdate:w===""||w===A}),(b===""||b!==Y)&&(w===""||w===A?(console.log("🟡 [useEffect] 종료일 마스크 값 업데이트:",{before:b,after:Y}),M?(d.current.value=M.format(t),d.current.updateValue()):(d.current.value="",d.current.updateValue())):console.log("🟡 [useEffect] 종료일 마스크 값 업데이트 스킵 (사용자 입력 중)"))}V(!1)},[N,_,O,t,p,e]);const K=s=>{if(console.log("🔴 [RangePicker] 날짜 변경:",{dates:s?[s[0]?s[0].format(t):null,s[1]?s[1].format(t):null]:null,prevRange:[S[0]?S[0].format(t):null,S[1]?S[1].format(t):null]}),!s){I([null,null]);const Y=Array.isArray(o)?[...o,0]:[o,0],w=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(Y,void 0),C.setFieldValue(w,void 0),u.current?.updateValue(),d.current?.updateValue();return}const[g,y]=s,f=S[0],M=g&&(!f||!g.isSame(f,e==="year"?"year":e==="month"?"month":"day"));if(console.log("🔴 [RangePicker] 시작일 변경 여부:",{isStartDateChanged:M,startDate:g?g.format(t):null,prevStartDate:f?f.format(t):null}),I([g,y]),M){console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"),D(!0),u.current&&(u.current.value="",u.current.updateValue());const Y=g.format(p);console.log("🔴 [RangePicker] form 값 업데이트:",{formatted:Y});const w=Array.isArray(o)?[...o,0]:[o,0];C.setFieldValue(w,Y)}else if(!g&&u.current){D(!1),u.current.value="",u.current.updateValue();const Y=Array.isArray(o)?[...o,0]:[o,0];C.setFieldValue(Y,void 0)}else D(!1);const b=Array.isArray(o)?[...o,1]:[o,1];if(y){const Y=y.format(p);C.setFieldValue(b,Y),d.current&&(d.current.value=y.format(t),d.current.updateValue())}else C.setFieldValue(b,void 0),d.current&&(d.current.value="",d.current.updateValue());V(!1)},q=s=>{setTimeout(()=>{const g=document.activeElement,y=j.current,f=y?.querySelector(".ant-picker-dropdown");!(y&&(y.contains(g)||y===g||f?.contains(g)))&&!(s!==void 0?s:L)&&(console.log("✅ Input과 RangePicker 모두 포커스가 없습니다"),k(!1))},0)};return n.jsx($,{...r,name:void 0,validateStatus:U?"warning":void 0,children:n.jsxs(a.ConfigProvider,{componentSize:z.componentSize,theme:{components:{Input:{addonBg:"#fff"}}},children:[n.jsxs("div",{ref:j,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%"},children:[n.jsx(a.Form.Item,{name:o?Array.isArray(o)?[...o,0]:[o,0]:void 0,getValueProps:s=>{if(!s)return{value:void 0};if(typeof s=="string"&&s.length===p.length&&/^\d+$/.test(s)){if(e==="date"){const g=s.substring(0,4),y=s.substring(4,6),f=s.substring(6,8);return{value:`${g}-${y}-${f}`}}else if(e==="month"){const g=s.substring(0,4),y=s.substring(4,6);return{value:`${g}-${y}`}}else if(e==="year")return{value:s}}return{value:E(s).format(t)}},normalize:s=>s?E(s).format(p):(i?.allowEmpty,void 0),noStyle:!0,children:n.jsx(a.Input,{...m,value:void 0,ref:c,onFocus:()=>{if(h("start"),k(!L),D(!1),u.current){const s=Array.isArray(o)?[...o,0]:[o,0];C.getFieldValue(s)||(u.current.value="",u.current.unmaskedValue=""),u.current.updateValue()}},onBlur:()=>{q()},onKeyDown:s=>{if(s.key==="Backspace"&&(h("start"),k(!0)),s.key==="Enter")if(L&&B==="start"){const g=u.current?.value||"";g.length===t.length?E(g,t,!0).isValid()?(k(!1),V(!1)):i?.allowEmpty?V(!1):V(!0):V(!1)}else h("start"),k(!0)},style:{flex:1},allowClear:!0,placeholder:l.replace(/0/g,"_"),suffix:n.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})}),n.jsx("span",{style:{color:"#d9d9d9",userSelect:"none"},children:"~"}),n.jsx(a.Form.Item,{name:o?Array.isArray(o)?[...o,1]:[o,1]:void 0,getValueProps:s=>{if(!s)return{value:void 0};if(typeof s=="string"&&s.length===p.length&&/^\d+$/.test(s)){if(e==="date"){const g=s.substring(0,4),y=s.substring(4,6),f=s.substring(6,8);return{value:`${g}-${y}-${f}`}}else if(e==="month"){const g=s.substring(0,4),y=s.substring(4,6);return{value:`${g}-${y}`}}else if(e==="year")return{value:s}}return{value:E(s).format(t)}},normalize:s=>s?E(s).format(p):(i?.allowEmpty,void 0),noStyle:!0,children:n.jsx(a.Input,{...m,ref:F,onFocus:()=>{if(h("end"),k(!L),d.current){d.current.updateValue();const s=d.current.value||"";!(d.current.unmaskedValue||"")&&!s.replace(/[^0-9]/g,"")&&(d.current.value="",d.current.updateValue())}},onBlur:()=>{q()},onKeyDown:s=>{if(s.key==="Backspace"){const g=d.current?.value||"",y=d.current?.unmaskedValue||"";if(g===""||y===""||g.replace(/[^0-9]/g,"").length<=1){s.preventDefault();const f=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(f,void 0),I([S[0],null]),d.current&&(d.current.value="",d.current.updateValue()),setTimeout(()=>{c.current?.focus(),h("start"),k(!0)},0);return}h("end"),k(!0)}if(s.key==="Tab"&&k(!1),s.key==="Enter")if(L&&B==="end"){const g=d.current?.value||"";g.length===t.length?E(g,t,!0).isValid()?(k(!1),V(!1)):i?.allowEmpty?V(!1):V(!0):V(!1)}else h("end"),k(!0)},style:{flex:1},allowClear:!0,onClear:()=>{const s=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(s,void 0),I([S[0],null]),d.current&&(d.current.value="",d.current.updateValue()),setTimeout(()=>{c.current?.focus(),h("start"),k(!0)},0)},placeholder:l.replace(/0/g,"_"),suffix:n.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})})]}),n.jsx(Ye,{...i,open:L,picker:e,format:{format:t,type:"mask"},showNow:!0,value:S,onChange:K,onOpenChange:s=>{k(s),s||q(!1)},renderExtraFooter:()=>U?n.jsxs("div",{style:{color:"#faad14",paddingLeft:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"6px",borderTop:"1px solid #f0f0f0",backgroundColor:"#fffbe6"},children:[n.jsx(P.ExclamationCircleOutlined,{}),n.jsx("span",{children:"유효하지 않은 날짜입니다"})]}):null,getPopupContainer:s=>s.parentElement,style:{position:"absolute",top:0,left:0,pointerEvents:"none",opacity:0,width:"100%"}})]})})},{Option:te}=a.Select,Ve=({itemProps:e,inputProps:r})=>{const[m,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]),n.jsx($,{...e,getValueProps:t=>t?{value:t&&t.indexOf(",")>0?t.split(","):[t]}:{value:[]},normalize:t=>t!=null&&t!=null&&t.length>0?t.toString():"",children:n.jsx(a.Select,{...r,mode:"multiple",children:m.map(t=>{const{value:l,label:p}=t;return r?.printCode?n.jsx(te,{value:l,label:p,children:n.jsx(a.Space,{children:`[${l}] ${p}`})},l):n.jsx(te,{value:l,label:p,children:n.jsx(a.Space,{children:`${p}`})},l)})})})},Ie=({itemProps:e,inputProps:r})=>{const m=t=>{let l=t.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=t=>{let l=t.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 n.jsx($,{...e,children:n.jsx(a.InputNumber,{...r,formatter:t=>m(t),parser:t=>i(t)})})},Ne=({itemProps:e,inputProps:r})=>n.jsx($,{...e,children:n.jsx(a.Radio.Group,{...r})}),{RangePicker:ve}=a.DatePicker,re={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"}},Le=({itemProps:e,inputProps:r,type:m="date",minDate:i,maxDate:t,returnType:l="string"})=>{const{displayFormat:p,outputFormat:c}=x.useMemo(()=>re[m],[m]),F=x.useMemo(()=>Object.values(re).map(u=>u.outputFormat).sort((u,d)=>{if(u.length===d.length){if(u===c)return-1;if(d===c)return 1}return d.length-u.length}),[c]);return n.jsx($,{...e,getValueProps:u=>({value:u&&u.length>0?[u[0]?E.isDayjs(u[0])?u[0]:E(u[0],F):null,u[1]?E.isDayjs(u[1])?u[1]:E(u[1],F):null]:null}),normalize:u=>u?l==="dayjs"?[u[0]??void 0,u[1]??void 0]:[u[0]?u[0].format(c):void 0,u[1]?u[1].format(c):void 0]:[void 0,void 0],children:n.jsx(ve,{...r,order:!0,minDate:i?E(i,F):void 0,maxDate:t?E(t,F):void 0,picker:m==="datetime"?"date":m,showTime:r?.showTime??(m==="datetime"||m==="time"),format:p})})},ne=a.Input.Search,Me=e=>{const r=a.Form.useFormInstance(),{openPopup:m}=ae.usePopupStore(),i=e.itemProps?.name||[],t=e.popupConfig||{callback(p){Array.isArray(i)&&i.length>1?(r.setFieldValue(i[0],p.code),r.setFieldValue(i[1],p.name)):r.setFieldValue(i,p.code)}},l={...e,placeholder:typeof e.placeholder=="string"?e.placeholder:e.placeholder?.[0]||"",onChange:p=>{Array.isArray(i)&&i.length>1&&r.setFieldValue(i[0],""),e.onChange?.(p)},onSearch:p=>{e.popuCd?m(e.popuCd,e.popupParams,t):e.onSearch?.(p)}};return Array.isArray(i)&&i.length>1?n.jsx($,{...e.itemProps,name:void 0,children:n.jsxs(a.Space.Compact,{block:!0,children:[n.jsx(a.Form.Item,{name:i[0],rules:e.itemProps?.rules,style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:n.jsx(a.Input,{style:{color:"#999",backgroundColor:"#f5f5f5"},placeholder:e.placeholder?.[0]||"",readOnly:!0})}),n.jsx(a.Form.Item,{name:i[1],style:{width:"60%",marginBottom:0},children:n.jsx(ne,{readOnly:e.readOnly,enterButton:n.jsx(a.Button,{icon:n.jsx(P.SearchOutlined,{}),disabled:e.readOnly}),...l})})]})}):n.jsx($,{...e.itemProps,children:n.jsx(ne,{...l})})},Be=({itemProps:e,selectProps:r={options:[],allowClear:!0}})=>{const m=a.Form.useFormInstance(),i=!!m,t=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)},p={...r,allowClear:r.allowClear??!0,options:t,onChange:l,variant:r.variant},c=n.jsx(a.Select,{...p,disabled:r.disabled});return r.copyable&&!i&&console.warn("BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."),r.copyable?n.jsx($,{...e,name:void 0,children:n.jsxs(a.Space.Compact,{block:!0,children:[n.jsx(a.Form.Item,{name:e?.name,rules:e?.rules,style:{width:"100%",marginBottom:0},validateStatus:"",help:"",children:c}),n.jsx(a.Typography.Paragraph,{copyable:{text:i&&m?.getFieldValue(e?.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"}})]})}):n.jsx($,{...e,children:c})},Ee=({itemProps:e,inputProps:r={format:"YN"}})=>{const m=a.Form.useFormInstance(),i=(t,l)=>{r.format==="boolean"?m.setFieldValue(e?.name,t):m.setFieldValue(e?.name,t?"Y":"N"),r.onChange&&r.onChange(t,l)};return n.jsx($,{...e,getValueProps:t=>({checked:r.format==="boolean"?!!t:t==="Y"}),normalize:t=>typeof t=="boolean"?r.format==="boolean"?t:t?"Y":"N":r.format==="boolean"?!!t:t?"Y":"N",children:n.jsx(a.Switch,{...r,onChange:(t,l)=>i(t,l)})})},{TextArea:De}=a.Input,Ae=({itemProps:e,inputProps:r})=>n.jsx($,{...e,children:n.jsx(De,{...r})}),_e=[".pdf",".xlsx",".xls",".docx",".doc",".pptx",".ppt",".hwp",".txt",".csv",".jpg",".jpeg",".png",".gif",".zip"],se={FILE:"file"},Oe=({originNode:e,file:r,fileList:m,moveFile:i,onDrop:t})=>{const l=x.useRef(null),[{handlerId:p},c]=J.useDrop({accept:se.FILE,collect:j=>({handlerId:j.getHandlerId()}),hover(j,C){if(!l.current)return;const L=j.uid,k=r.uid;if(L===k)return;const U=G.findIndex(m,{uid:k}),V=G.findIndex(m,{uid:L});if(V===-1||U===-1)return;const B=l.current.getBoundingClientRect(),h=C.getClientOffset();if(!h)return;const v=(B.bottom-B.top)/2,D=h.y-B.top;V<U&&D<v||V>U&&D>v||i(L,k)},drop(){t()}}),[{isDragging:F},u]=J.useDrag({type:se.FILE,item:()=>({uid:r.uid,index:G.findIndex(m,{uid:r.uid})}),collect:j=>({isDragging:j.isDragging()})}),d=F?0:1;return u(c(l)),n.jsx("div",{ref:l,style:{opacity:d},"data-handler-id":p,children:e})},Re=({itemProps:e,fileGrpKey:r,onUploadComplete:m,onFetchFilesTrxCd:i="SCMFILE00101",onSuccessTrxCd:t="SCMFILE00102",onDeleteFileTrxCd:l="SCMFILE00103",onReorderFilesTrxCd:p="SCMFILE00104",allowedExtensions:c=_e,maxFileSize:F=200,showButton:u=!0,multiple:d=!1,newFileGrpKeyonModify:j=!1,buttonText:C="파일 선택",localOnly:L=!1,onFilesChange:k})=>{const[U,V]=x.useState([]),B=x.useRef(r),h=x.useRef([]),v=a.Form.useFormInstance(),D=()=>{if(L||h.current.length===0)return;const s=[...h.current];if(h.current=[],t){const g=s.map(y=>({crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:B.current,physFileNm:y.fileNameP,lgclFileNm:y.fileNameL,filePath:y.filePath,fileExtn:y.fileExt,fileSize:y.fileSize,mltpYn:"N"}));console.log("newFileGrpKeyonModify",j),console.log("newFileGrpKeyonModify",j?0:B.current),T.callService(t,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:j?0:B.current,oldFileGrpKey:B.current,newFileGrpKeyonModify:j,sub:g}).then(y=>{if(y?.sub&&y.sub.length>0){const f=y.sub[0].fileGrpKey;(!B.current||j)&&(B.current=f);const M=new Map;y.sub.forEach(w=>{const A=s.find(H=>H.fileNameL===w.lgclFileNm);A&&M.set(A.tempId,w)});const b=e?.name;(w=>{if(N){const A=v?.getFieldValue(b)||[],H=w(A);v?.setFieldValue(b,H)}else V(A=>w(A))})(w=>w.map(A=>{const H=M.get(A.uid);if(H){const Q=s.find(le=>le.tempId===A.uid);return m&&Q&&m({...Q,fileGrpKey:f,fileKey:H.fileKey}),{...A,name:H.lgclFileNm,fileGrpKey:f,fileKey:H.fileKey,uid:H.fileKey,status:"done",url:`/api/download?filePath=${H.filePath}&logicalName=${H.lgclFileNm}`}}return A}))}}).catch(y=>{console.error("업로드 후처리 서비스 호출 실패:",y),a.message.error("파일 후처리 중 오류가 발생했습니다.");const f=new Set(s.map(Y=>Y.tempId)),M=e?.name;(Y=>{if(N){const w=v?.getFieldValue(M)||[],A=Y(w);v?.setFieldValue(M,A)}else V(w=>Y(w))})(Y=>Y.map(w=>f.has(w.uid)?{...w,status:"error",error:"후처리 실패"}:w))})}},R=x.useRef(G.debounce(D,500)).current;x.useEffect(()=>()=>{R.cancel()},[R]),x.useEffect(()=>{B.current=r},[r]),x.useEffect(()=>{L||r&&i&&T.callService(i,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r}).then(s=>{if(s?.sub){const g=s.sub.map(f=>({uid:f.fileKey,name:f.lgclFileNm,status:"done",url:`/api/download?filePath=${f.filePath}&logicalName=${f.lgclFileNm}`})),y=e?.name;N?v?.setFieldValue(y,g):V(g)}else{const g=e?.name;N?v?.setFieldValue(g,[]):V([])}}).catch(s=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",s),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")})},[r,i]);const o=(s,g)=>{const y=e?.name,f=N?v?.getFieldValue(y)||[]:U,M=G.findIndex(f,{uid:s}),b=G.findIndex(f,{uid:g});if(M<0||b<0)return;const Y=[...f],[w]=Y.splice(M,1);Y.splice(b,0,w),N?v?.setFieldValue(y,Y):V(Y)},S=()=>{if(!L&&r&&p){const s=e?.name,y=(N?v?.getFieldValue(s)||[]:U).map(f=>f.uid);T.callService(p,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:r,reorderedFileKeys:y}).then(()=>{a.message.success("파일 순서가 성공적으로 저장되었습니다.")}).catch(f=>{console.error("파일 순서 저장 서비스 호출 실패:",f),a.message.error("파일 순서 저장 중 오류가 발생했습니다.")})}},I=s=>{const g=e?.name,y=N?v?.getFieldValue(g)||[]:U;if(!d&&y.length>0)return a.message.error("하나의 파일만 업로드할 수 있습니다."),a.Upload.LIST_IGNORE;if(c&&c.length>0){const f=`.${s.name.split(".").pop()?.toLowerCase()}`;if(!c.includes(f))return a.message.error(`${s.name} 파일은 허용되지 않는 확장자입니다. (${c.join(", ")})`),a.Upload.LIST_IGNORE}return F&&!(s.size/1024/1024<F)?(a.message.error(`일반업로드의 최대용량은 ${F}MB입니다.`),a.Upload.LIST_IGNORE):!L},N=!!e?.name,_={name:"file",multiple:d,action:L?void 0:"/api/upload",beforeUpload:I,showUploadList:{showRemoveIcon:u},onChange(s){const{status:g,uid:y}=s.file;if(g==="removed"){if(!L&&l)T.callService(l,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:j?0:B.current,fileKey:y,oldFileGrpKey:B.current,newFileGrpKeyonModify:j}).then(f=>{if(a.message.success("파일이 성공적으로 삭제되었습니다."),j&&(B.current=f.fileGrpKey),N){const M=e?.name;v?.setFieldValue(M,s.fileList)}else V(s.fileList);k?.(s.fileList),m?.({fileGrpKey:f.fileGrpKey})}).catch(f=>{console.error("파일 삭제 서비스 호출에 실패했습니다.",f),a.message.error("파일 삭제 중 오류가 발생했습니다.")});else{if(N){const f=e?.name;v?.setFieldValue(f,s.fileList)}else V(s.fileList);k?.(s.fileList)}return}if(N){const f=e?.name;v?.setFieldValue(f,s.fileList)}else V(s.fileList);if(k?.(s.fileList),g==="done")if(!L&&s.file.response?.success){const{uploadedFiles:f}=s.file.response;f&&Array.isArray(f)&&f.length>0&&(f.forEach(M=>{M.tempId=s.file.uid,h.current.push(M)}),R()),a.message.success(s.file.response.message||`${s.file.name} 파일이 성공적으로 업로드되었습니다.`)}else a.message.error(s.file.response?.message||`${s.file.name} 파일 업로드에 실패했습니다.`);else g==="error"&&a.message.error(s.file.response?.message||`${s.file.name} 파일 업로드 중 오류가 발생했습니다.`)},itemRender(s,g,y){const f=x.cloneElement(s,{href:g.url||void 0,title:void 0});return n.jsx(Oe,{originNode:f,file:g,fileList:y,moveFile:o,onDrop:S},g.uid)}};N||(_.fileList=U);const O=s=>Array.isArray(s)?s:s&&s.fileList,z=e?.name,K=N?a.Form.useWatch?.(z,v):void 0,q=N?K||[]:U;return n.jsx(J.DndProvider,{backend:ce.HTML5Backend,children:n.jsx($,{valuePropName:"fileList",getValueFromEvent:O,...e,children:n.jsx(a.Upload,{headers:{SYSCD:__SYS_CD__},..._,listType:"picture",children:u&&(d||q.length===0)&&n.jsx(a.Button,{icon:n.jsx(P.UploadOutlined,{}),children:C})})})})},Ue=a.Input.Search,ze=e=>{const r=a.Form.useFormInstance(),{openCorePopup:m}=X.usePopup(),i={value:"empNm",fieldName:"empNm",placeholder:"사원명"},t={value:"deptNm",fieldName:"deptNm",placeholder:"부서"},l=e.field1||i,p=e.field2||t,c=x.useCallback(d=>{r.setFieldValue(e.employeeFieldName||"employee",d),r.setFieldValue(e.empNoFieldName||"empNo",d.empNo??""),r.setFieldValue(l.fieldName,d[l.value||"empNm"]??""),r.setFieldValue(p.fieldName,d[p.value||"deptNm"]??""),e.onFinish?.()},[r,l,p,e.employeeFieldName]),F=x.useCallback(d=>{m("CORE_ORGANIZATION_01",{onSelect:j=>{c(j)},defaultParams:{keyword:d}})},[c,m]),u=x.useCallback(async d=>{const j=d?.trim();if(j)try{const C=await T.callService("SCMUTIL00101",{keyword:j},{showLoading:!1}),L=C?.empList||[];if(C?.empCnt===0){a.message.warning("일치하는 사원을 찾을 수 없어 팝업을 열립니다. 사원을 선택해주세요."),F();return}if(C?.empCnt>1){a.message.info("여러 건이 검색되어 팝업이 열립니다. 사원을 선택해주세요."),F(j);return}const k=L[0];c(k)}catch(C){console.error("사원 검색 서비스 실패:",C),a.message.error("사원 검색 중 오류가 발생했습니다.")}},[c,F]);return n.jsx($,{label:e.label||"사원",name:void 0,children:n.jsxs(a.Space.Compact,{block:!0,children:[n.jsx(a.Form.Item,{name:l.fieldName,style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:n.jsx(a.Input,{style:{color:"#999",backgroundColor:"#f5f5f5"},placeholder:l.placeholder,readOnly:!0})}),n.jsx(a.Form.Item,{name:e.employeeFieldName||"employee",hidden:!0}),n.jsx(a.Form.Item,{name:e.empNoFieldName||"empNo",hidden:!0}),n.jsx(a.Form.Item,{name:p.fieldName,style:{width:"60%",marginBottom:0},children:n.jsx(Ue,{allowClear:!0,readOnly:e.readOnly,placeholder:p.placeholder,enterButton:n.jsx(a.Button,{icon:n.jsx(P.SearchOutlined,{}),disabled:e.readOnly,onClick:()=>{F()}}),onSearch:u,onChange:d=>{r.setFieldValue(e.empNoFieldName||"empNo",""),r.setFieldValue(l.fieldName,""),r.setFieldValue(p.fieldName,d.target.value),r.setFieldValue(e.employeeFieldName||"employee",null)}})})]})})};exports.BwgButton=ue;exports.BwgCheck=de;exports.BwgCheckList=fe;exports.BwgDatePicker=me;exports.BwgDownload=ge;exports.BwgEmpSearch=ze;exports.BwgForm=oe;exports.BwgFormItem=$;exports.BwgInput=pe;exports.BwgLargeUploader=Fe;exports.BwgMaskedDate=ke;exports.BwgMaskedInput=Se;exports.BwgMaskedRange=we;exports.BwgMultiSelect=Ve;exports.BwgNumber=Ie;exports.BwgRadio=Ne;exports.BwgRangePicker=Le;exports.BwgSearch=Me;exports.BwgSelect=Be;exports.BwgSwitch=Ee;exports.BwgTextArea=Ae;exports.BwgUploader=Re;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("antd"),x=require("react"),ae=require("../../stores/index.cjs"),E=require("dayjs"),P=require("@ant-design/icons"),T=require("../../utils/index.cjs"),ie=require("jszip"),Z=require("imask"),X=require("../../chunks/provider-r4mkv5Zs.cjs"),G=require("lodash"),J=require("react-dnd"),ce=require("react-dnd-html5-backend"),ue=e=>{const{componentSize:t}=ae.useUserStore(),m=x.useMemo(()=>e.size?e.size:{0:"small",1:"middle",2:"large"}[t],[t,e.size]),i=x.useMemo(()=>({0:12,1:14,2:16})[t],[t]);return n.jsx(a.Button,{...e,size:m,className:"bwg-btn",style:{fontSize:`${i}px`,...e.style},children:e.children})},$=x.memo(({children:e,label:t,name:m,rules:i,initialValue:r,style:l,required:h,...c})=>{const F={fontWeight:"bold"};(i==null||i==null)&&h&&(i=[{required:!0,message:`${t}을(를) 입력해주세요.`}]);const u=Array.isArray(i)&&i.some(j=>j.required===!0),d=()=>typeof t=="string"?n.jsxs("span",{style:F,children:[t,u&&n.jsx("span",{style:{color:"#ff4d4f",marginLeft:"4px"},children:"*"})]}):n.jsx("span",{style:F,children:t});return n.jsx(a.Form.Item,{className:"bwg-form-item",label:t?d():void 0,labelAlign:c.labelAlign||"left",name:m,rules:i,colon:!1,initialValue:r,style:l,...c,children:e})}),de=({itemProps:e,inputProps:t={format:"YN"}})=>{const m=a.Form.useFormInstance(),i=r=>{t.format==="boolean"?m.setFieldValue(e?.name,r.target.checked):m.setFieldValue(e?.name,r.target.checked?"Y":"N"),t.onChange&&t.onChange(r)};return n.jsx($,{...e,getValueProps:r=>({checked:t.format==="boolean"?!!r:r==="Y"}),normalize:r=>typeof r=="boolean"?t.format==="boolean"?r:r?"Y":"N":t.format==="boolean"?!!r:r?"Y":"N",children:n.jsx(a.Checkbox,{...t,onChange:i,children:t?.title})})},fe=({itemProps:e,inputProps:t})=>{const m=a.Form.useFormInstance(),[i,r]=x.useState(e?.initialValue??[]),[l,h]=x.useState([]),c=l.length>0&&l.length==i?.length,F=i?.length>0&&i.length<l.length;x.useEffect(()=>{h(u(t?.options))},[t?.options]),x.useEffect(()=>{r(i)},[i]);const u=C=>{const L=[];return(C||[]).map((k,U)=>{L.push(k.value)}),L},d=C=>{r(C.target.checked?l:[]),m.setFieldValue(e?.name,C.target.checked?l:[])},j=C=>{r(C),m.setFieldValue(e?.name,C),t?.onChange&&typeof t?.onChange=="function"&&t?.onChange(C)};return n.jsx($,{...e,children:n.jsxs(a.ConfigProvider,{theme:{components:{Checkbox:{colorPrimary:"var(--check-primary)",colorPrimaryBorder:"var(--check-primary)",colorPrimaryHover:"var(--check-primary-active)"}}},children:[t?.allCheck&&n.jsx(a.Checkbox,{indeterminate:F,checked:c,onChange:d,children:"전체선택"}),n.jsx(a.Checkbox.Group,{options:t?.options,value:i,onChange:j})]})})},ee={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:e,inputProps:t,type:m="date",returnType:i="string"})=>{const{displayFormat:r,outputFormat:l}=x.useMemo(()=>ee[m],[m]),h=x.useMemo(()=>Object.values(ee).map(c=>c.outputFormat).sort((c,F)=>{if(c.length===F.length){if(c===l)return-1;if(F===l)return 1}return F.length-c.length}),[l]);return n.jsx($,{...e,getValueProps:c=>({value:c?E.isDayjs(c)?c:E(c,h):null}),normalize:c=>c?i==="dayjs"?c:c.format(l):null,children:n.jsx(a.DatePicker,{...t,picker:m==="datetime"?"date":m,showTime:t?.showTime??(m==="datetime"||m==="time"),format:t?.format??r})})},ge=({fileGrpKey:e,onFetchFilesTrxCd:t="SCMFILE00101",readOnly:m=!1,appCd:i=__APP_CD__})=>{const[r,l]=x.useState([]);x.useEffect(()=>{if(t)if(i!=__APP_CD__){const F=T.getApiDeps().findSystemByAppCd?.(i??__APP_CD__);if(!F||!F.sysCd){console.error("해당 앱코드는 존재하지 않습니다.",i);return}T.callServiceByAppCd({trxCd:t,appCd:i},{crprCd:T.getCrprCd(),sysCd:F.sysCd,fileGrpKey:e}).then(u=>{if(u?.sub){const d=u.sub.map(j=>({uid:j.fileKey,name:j.lgclFileNm,filePath:j.filePath}));l(d)}}).catch(u=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",u),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")})}else T.callService(t,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:e}).then(c=>{if(c?.sub){const F=c.sub.map(u=>({uid:u.fileKey,name:u.lgclFileNm,filePath:u.filePath}));l(F)}}).catch(c=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",c),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")});else l([])},[e,t,i]);const h=async c=>{try{const u=T.getApiDeps().findSystemByAppCd?.(i??__APP_CD__);if(!u||!u.sysCd){console.error("해당 앱코드는 존재하지 않습니다.",i);return}const j=await fetch("/api/download",{method:"POST",headers:{SYSCD:u.sysCd,"Content-Type":"application/json"},body:JSON.stringify({filePath:c.filePath,logicalName:c.name,fileKey:c.uid})});if(!j.ok){const V=(await j.json().catch(()=>null))?.message||"파일 다운로드에 실패했습니다.";throw new Error(V)}const C=await j.blob(),L=window.URL.createObjectURL(C),k=document.createElement("a");k.href=L,k.setAttribute("download",c.name),document.body.appendChild(k),k.click(),document.body.removeChild(k),window.URL.revokeObjectURL(L)}catch(F){console.error(F),a.message.error(F.message||"파일을 다운로드하는 중 오류가 발생했습니다.")}};return n.jsx(a.Card,{title:"파일 목록",children:n.jsx(a.List,{dataSource:r,renderItem:c=>n.jsx(a.List.Item,{actions:m?[]:[n.jsx(a.Button,{type:"text",icon:n.jsx(P.DownloadOutlined,{}),onClick:()=>h(c)},"download")],children:n.jsx(a.List.Item.Meta,{avatar:n.jsx(P.PaperClipOutlined,{}),title:c.name})})})})},oe=x.forwardRef(({children:e,labelCol:t,style:m,className:i,...r},l)=>n.jsx(a.ConfigProvider,{form:{},children:n.jsx(a.Form,{ref:l,...r,requiredMark:!1,labelCol:t||{flex:"100px"},style:{padding:"10px",...m},className:`bwg-form ${i??""}`,children:e})}));oe.displayName="BwgForm";const he=({itemProps:e,inputProps:t})=>n.jsx($,{...e,children:n.jsx(a.Input,{...t})}),{Text:W}=a.Typography,{Dragger:pe}=a.Upload,ye=[".pdf",".xlsx",".xls",".docx",".doc",".pptx",".ppt",".hwp",".txt",".csv",".jpg",".jpeg",".png",".gif",".zip"],xe=(e,t=2)=>{if(e===0)return"0 Bytes";const m=1024,i=t<0?0:t,r=["Bytes","KB","MB","GB","TB"],l=Math.floor(Math.log(e)/Math.log(m));return parseFloat((e/Math.pow(m,l)).toFixed(i))+" "+r[l]},Fe=({title:e="첨부파일",fileGrpKey:t,onUploadComplete:m,onSuccessTrxCd:i="SCMFILE00102",anotherServiceTrxCd:r="SCMFILE00105",allowedExtensions:l=ye,maxFileSize:h=2048})=>{const[c,F]=x.useState([]),[u,d]=x.useState(!1),[j,C]=x.useState(!1),[L,k]=x.useState(0),U=p=>{if(l&&l.length>0){const D=(R=>{const o=R.lastIndexOf(".");return o===-1?"":R.substring(o).toLowerCase()})(p.name);if(!l.includes(D))return a.message.error(`${p.name} 파일은 허용되지 않는 확장자입니다. (${l.join(", ")}만 가능)`),!1}return!0},V=async()=>{const p=c.filter(S=>S.status!=="done"),v=p.reduce((S,I)=>S+(I.size||0),0),D=2*1024*1024*1024;if(v>D){a.notification.error({message:"업로드 용량 초과",description:"한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."});return}if(p.length===0){a.message.warning("업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다.");return}C(!0);let R;try{const S=new ie;p.forEach(I=>{I.originFileObj&&S.file(I.name,I.originFileObj)}),R=await S.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}})}catch(S){C(!1),a.message.error("파일을 압축하는 중 오류가 발생했습니다."),console.error("Zipping error:",S);return}C(!1);const o=new FormData;o.append("file",R,"upload.zip"),d(!0),k(0);try{const S=await new Promise((N,_)=>{const O=new XMLHttpRequest;O.open("POST","/api/upload-large",!0),O.upload.onprogress=z=>{if(z.lengthComputable){const K=Math.round(z.loaded/z.total*100);k(K)}},O.onload=()=>{if(O.status>=200&&O.status<300)try{const z=JSON.parse(O.responseText);z.success?N(z):_(new Error(z.message||"파일 업로드에 실패했습니다."))}catch{_(new Error("잘못된 서버 응답입니다."))}else try{const z=JSON.parse(O.responseText);_(new Error(z.message||`서버 오류: ${O.status}`))}catch{_(new Error(`서버 오류: ${O.status}`))}},O.onerror=()=>{_(new Error("네트워크 오류가 발생했습니다."))},O.send(o)});a.message.success(S.message||"압축 파일이 성공적으로 업로드되었습니다.");const I=c.map(N=>p.find(_=>_.uid===N.uid)?{...N,status:"done"}:N);if(F(I),i&&S.uploadedFiles&&Array.isArray(S.uploadedFiles)){const N=T.getUserInfo();S.uploadedFiles.forEach(_=>{const O={crprCd:N?.crprCd,sysCd:__SYS_CD__,fileGrpKey:t,sub:[{crprCd:N?.crprCd,sysCd:__SYS_CD__,fileGrpKey:t,physFileNm:_.fileNameP,lgclFileNm:_.fileNameL,filePath:_.filePath,fileExtn:_.fileExt,fileSize:_.fileSize,mltpYn:"Y"}]};T.callService(i,O).then(z=>{const K=c.map(q=>({crprCd:N?.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(r,{sub:K})}).catch(z=>{console.error("후처리 서비스 호출 실패:",z),a.message.error(`${_.fileNameL} 파일의 후처리 작업에 실패했습니다.`)}),m&&m({fileNameP:_.fileNameP,fileNameL:_.fileNameL})})}}catch(S){a.message.error(S.message||"파일 업로드 중 오류가 발생했습니다.");const I=c.map(N=>p.find(_=>_.uid===N.uid)?{...N,status:"error",response:S.message||"파일 업로드 중 오류가 발생했습니다."}:N);F(I)}finally{d(!1)}},B={multiple:!0,fileList:c,beforeUpload:p=>U(p)?h&&p.size>=h*1024*1024?(a.message.error(`대용량 첨부 파일 최대 크기는 ${(h/1024).toFixed(1)}GB입니다.`),a.Upload.LIST_IGNORE):!1:a.Upload.LIST_IGNORE,onChange:({fileList:p})=>{const v=new Map(c.map(D=>[D.uid,D]));p.forEach(D=>{v.set(D.uid,D)}),F(Array.from(v.values()))},onRemove:p=>{const v=c.filter(D=>D.uid!==p.uid);F(v)},showUploadList:!1};return n.jsx(a.Spin,{spinning:u||j,tip:j?"파일 압축 중...":`파일 업로드 중... ${L}%`,children:n.jsxs("div",{className:"bwg-large-uploader-container",children:[n.jsx(a.Card,{title:n.jsx(W,{strong:!0,children:e}),extra:n.jsx(a.Upload,{...B,children:n.jsx(a.Button,{icon:n.jsx(P.UploadOutlined,{}),children:"파일 선택"})}),style:{padding:0},children:n.jsx(pe,{...B,style:{border:"none",background:"transparent",padding:0},children:n.jsx("div",{className:"upload-list-container",children:c.length>0?n.jsx(a.List,{style:{textAlign:"left"},dataSource:c,renderItem:p=>{const v=p.status==="done",D=p.status==="error";let R;return v?R=n.jsx(P.CheckCircleOutlined,{style:{color:"#52c41a",fontSize:14}}):D?R=n.jsx(a.Tooltip,{title:typeof p.response=="string"?p.response:"업로드 실패",children:n.jsx(P.CloseCircleOutlined,{style:{color:"#ff4d4f",fontSize:14}})}):R=n.jsx(P.FileTextOutlined,{style:{fontSize:14}}),n.jsx(a.List.Item,{actions:[n.jsx(W,{type:"secondary",children:xe(p.size||0)},"size"),n.jsx(a.Button,{type:"text",icon:n.jsx(P.DeleteOutlined,{}),onClick:o=>{o.stopPropagation(),B.onRemove?.(p)},disabled:u||j},"delete")],children:n.jsx(a.List.Item.Meta,{avatar:R,title:n.jsx(W,{type:D?"danger":void 0,children:p.name})})},p.uid)}}):n.jsxs(a.Flex,{gap:"middle",align:"center",justify:"center",vertical:!0,style:{padding:"20px 0",minHeight:"120px"},children:[n.jsx(P.InboxOutlined,{style:{fontSize:"32px",color:"#999"}}),n.jsx(W,{type:"secondary",children:"업로드할 파일을 선택하거나 이 영역으로 드래그하세요."})]})})})}),c.length>0&&n.jsxs(a.Flex,{justify:"flex-end",align:"center",gap:"large",style:{marginTop:16},children:[u&&n.jsx("div",{style:{width:"250px"},children:n.jsx(a.Progress,{percent:L,size:"small"})}),n.jsx(a.Button,{type:"primary",onClick:V,disabled:u||j||c.filter(p=>p.status!=="done").length===0,icon:n.jsx(P.CloudUploadOutlined,{}),children:"일괄 업로드"})]})]})})},Ce=e=>{if(typeof e=="string")return e.replace(/0/g,"_");if(Array.isArray(e))return e[0].replace(/0/g,"_");if(typeof e=="object"&&"mask"in e&&"blocks"in e){const{mask:t,blocks:m}=e;return t.split(".").map(i=>{const l=m?.[i]?.maxLength??3;return"_".repeat(l)}).join(".")}return""},Se=({itemProps:e,inputProps:t,mask:m})=>{const i=x.useRef(null),r=a.Form.useFormInstance(),l=x.useMemo(()=>Ce(m),[m]);return x.useEffect(()=>{if(!i.current?.input)return;const h=typeof m=="string"||Array.isArray(m)?{mask:m}:m,c=Z(i.current.input,h);return c.on("accept",()=>{r&&e?.name&&r.setFieldValue(e.name,c.value)}),()=>{c.destroy()}},[m,r,e?.name]),n.jsx($,{...e,children:n.jsx(a.Input,{...t,ref:i,placeholder:l})})},je=e=>{switch(e){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"}}},ke=({type:e="date",itemProps:t={name:"calendar"},inputProps:m,pickerProps:i})=>{const{format:r,mask:l,outputFormat:h}=je(e),c=x.useRef(null),F=x.useRef(null),u=x.useRef(null),d=a.Form.useFormInstance(),[j,C]=x.useState(!1),[L,k]=x.useState(!1),U=t?.name,[V,B]=x.useState(null),p=a.Form.useWatch(U,d),v=X.useSizeConfig();x.useEffect(()=>{if(!c.current?.input)return;const o=Z(c.current.input,{mask:l,lazy:!1});return F.current=o,o.on("accept",()=>{const S=o.value;S.length>0&&C(!0);const I=E(S,r,!0);S.length===r.length&&I.isValid()&&(d.setFieldValue(U,I.format(h)),B(I),F.current?.updateValue())}),()=>{o.destroy()}},[r,l]),x.useEffect(()=>{if(!p){B(null);return}let o=null;if(typeof p=="string"&&p.length===h.length&&/^\d+$/.test(p))if(e==="date"){const S=p.substring(0,4),I=p.substring(4,6),N=p.substring(6,8);o=E(`${S}-${I}-${N}`,r,!0)}else if(e==="month"){const S=p.substring(0,4),I=p.substring(4,6);o=E(`${S}-${I}`,r,!0)}else e==="year"&&(o=E(p,r,!0));else o=E(p,r,!0);o&&o.isValid()?B(o):B(null),k(!1)},[p,r,h,e]);const D=o=>{if(!o){d.setFieldValue(U,void 0),B(null),F.current?.updateValue();return}B(o);const S=o.format(h);d.setFieldValue(U,S),F.current&&(F.current.value=o.format(r),F.current.updateValue()),k(!1)},R=o=>{setTimeout(()=>{const S=document.activeElement,I=u.current,N=I?.querySelector(".ant-picker-dropdown");!(I&&(I.contains(S)||I===S||N?.contains(S)))&&!(o!==void 0?o:j)&&console.log("✅ Input과 DatePicker 모두 포커스가 없습니다")},0)};return n.jsx($,{...t,name:void 0,validateStatus:L?"warning":void 0,children:n.jsxs(a.ConfigProvider,{componentSize:v.componentSize,theme:{components:{Input:{addonBg:"#fff"}}},children:[n.jsx(a.Form.Item,{name:U,getValueProps:o=>({value:o?E(o).format(r):void 0}),normalize:o=>o?E(o).format(h):void 0,noStyle:!0,rules:t?.rules??[],children:n.jsx(a.Input,{...m,ref:c,onFocus:()=>{C(!j),F.current?.updateValue()},onBlur:()=>{R()},onKeyDown:o=>{if(o.key==="Backspace"&&C(!0),o.key==="Tab"&&C(!1),o.key==="Enter")if(j){const S=F.current?.value||"",I=E(S,r,!0);S.length===r.length&&I.isValid()?(C(!1),k(!1)):k(!0)}else C(!0)},style:{width:"65%"},allowClear:!0,placeholder:l.replace(/0/g,"_"),suffix:n.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})}),n.jsx(a.DatePicker,{...i,open:j,picker:e,format:{format:r,type:"mask"},showNow:!0,value:V,onChange:D,onOpenChange:o=>{C(o),o||R(!1)},renderExtraFooter:()=>L?n.jsxs("div",{style:{color:"#faad14",paddingLeft:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"6px",borderTop:"1px solid #f0f0f0",backgroundColor:"#fffbe6"},children:[n.jsx(P.ExclamationCircleOutlined,{}),n.jsx("span",{children:"유효하지 않은 날짜입니다"})]}):null,getPopupContainer:o=>o.parentElement,style:{position:"absolute",top:0,left:0,pointerEvents:"none",opacity:0,width:"100%"}})]})})},{RangePicker:Ye}=a.DatePicker,be=e=>{switch(e){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:e="date",itemProps:t={name:"dateRange"},inputProps:m,pickerProps:i})=>{const{format:r,mask:l,outputFormat:h}=be(e),c=x.useRef(null),F=x.useRef(null),u=x.useRef(null),d=x.useRef(null),j=x.useRef(null),C=a.Form.useFormInstance(),[L,k]=x.useState(!1),[U,V]=x.useState(!1),[B,p]=x.useState(null),[v,D]=x.useState(!1),R=x.useRef(!1),o=t?.name,[S,I]=x.useState([null,null]),N=a.Form.useWatch(o?Array.isArray(o)?[...o,0]:[o,0]:void 0,C),_=a.Form.useWatch(o?Array.isArray(o)?[...o,1]:[o,1]:void 0,C),O=a.Form.useWatch(o,C),z=X.useSizeConfig();x.useEffect(()=>{if(!c.current?.input)return;const s=Z(c.current.input,{mask:l,lazy:!1});return u.current=s,s.on("accept",()=>{const g=s.value,y=s.unmaskedValue||"";if(console.log("🔵 [시작일] accept 이벤트:",{maskValue:g,unmaskedValue:y,length:g.length,formatLength:r.length}),g.length>0&&(p("start"),k(!0),D(!1)),y.length===h.length){const f=E(g,r,!0);if(f.isValid()){console.log("🔵 [시작일] 입력 완료 및 검증 통과:",{parsed:f.format(r)});const M=f.format(h);R.current=!0;const b=Array.isArray(o)?[...o,0]:[o,0];C.setFieldValue(b,M),I([f,S[1]]),u.current&&u.current.updateValue(),V(!1),setTimeout(()=>{d.current&&(d.current.value="",d.current.unmaskedValue="",d.current.updateValue());const Y=Array.isArray(o)?[...o,1]:[o,1];C.getFieldValue(Y)||C.setFieldValue(Y,void 0),F.current?.focus(),setTimeout(()=>{if(d.current){const A=d.current.value||"";!(d.current.unmaskedValue||"")&&!A.replace(/[^0-9]/g,"")&&(d.current.value="",d.current.updateValue())}},10),p("end"),k(!0),R.current=!1},0)}else i?.allowEmpty?V(!1):(console.log("🔵 [시작일] 검증 실패:",{val:g,parsed:f}),V(!0))}}),()=>{s.destroy()}},[r,l,o]),x.useEffect(()=>{if(!F.current?.input)return;const s=Z(F.current.input,{mask:l,lazy:!1});return d.current=s,s.on("accept",()=>{const g=s.value,y=s.unmaskedValue||"";if(console.log("🟢 [종료일] accept 이벤트:",{maskValue:g,unmaskedValue:y,length:g.length,formatLength:r.length}),y===""||y.length===0){const f=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(f,void 0),I([S[0],null]),d.current&&(d.current.value="",d.current.updateValue()),setTimeout(()=>{c.current?.focus(),p("start"),k(!0)},0);return}if(g.length>0&&(p("end"),k(!0)),g.length<r.length){V(!1);return}if(y.length===h.length){const f=E(g,r,!0);if(f.isValid()){const M=f.format(h);console.log("🟢 [종료일] 입력 완료:",{parsed:f.format(r),formatted:M}),R.current=!0;const b=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(b,M),I([S[0],f]),d.current?.updateValue(),setTimeout(()=>{R.current=!1},0)}else i?.allowEmpty?V(!1):(console.log("🟢 [종료일] 검증 실패:",{val:g,parsed:f}),V(!0))}}),()=>{s.destroy()}},[r,l,o]),x.useEffect(()=>{console.log("🟡 [useEffect] form 값 변경 감지:",{startFormValue:N,endFormValue:_,formValue:O});const s=N??(Array.isArray(O)?O[0]:null),g=_??(Array.isArray(O)?O[1]:null);if(s===void 0&&g===void 0&&(!O||!Array.isArray(O))){I([null,null]);return}const y=b=>{if(!b)return null;let Y=null;if(typeof b=="string"&&b.length===h.length&&/^\d+$/.test(b))if(e==="date"){const w=b.substring(0,4),A=b.substring(4,6),H=b.substring(6,8);Y=E(`${w}-${A}-${H}`,r,!0)}else if(e==="month"){const w=b.substring(0,4),A=b.substring(4,6);Y=E(`${w}-${A}`,r,!0)}else e==="year"&&(Y=E(b,r,!0));else Y=E(b,r,!0);return Y&&Y.isValid()?Y:null},f=y(s),M=y(g);if(console.log("🟡 [useEffect] 파싱 결과:",{startParsed:f?f.format(r):null,endParsed:M?M.format(r):null,isStartDateFromPicker:v}),I([f,M]),R.current){console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"),V(!1);return}if(!v&&u.current){const b=u.current.value||"",Y=f?f.format(r):"",w=u.current.unmaskedValue||"",A=f?f.format(h):"";console.log("🟡 [useEffect] 시작일 마스크 값 체크:",{currentMaskValue:b,expectedMaskValue:Y,unmaskedValue:w,expectedUnmasked:A,shouldUpdate:b===""||b!==Y,canUpdate:w===""||w===A}),(b===""||b!==Y)&&(w===""||w===A?(console.log("🟡 [useEffect] 시작일 마스크 값 업데이트:",{before:b,after:f?f.format(r):""}),f?(u.current.value=f.format(r),u.current.updateValue()):(u.current.value="",u.current.updateValue())):console.log("🟡 [useEffect] 시작일 마스크 값 업데이트 스킵 (사용자 입력 중)"))}if(d.current){const b=d.current.value||"",Y=M?M.format(r):"",w=d.current.unmaskedValue||"",A=M?M.format(h):"";console.log("🟡 [useEffect] 종료일 마스크 값 체크:",{currentMaskValue:b,expectedMaskValue:Y,unmaskedValue:w,expectedUnmasked:A,shouldUpdate:b===""||b!==Y,canUpdate:w===""||w===A}),(b===""||b!==Y)&&(w===""||w===A?(console.log("🟡 [useEffect] 종료일 마스크 값 업데이트:",{before:b,after:Y}),M?(d.current.value=M.format(r),d.current.updateValue()):(d.current.value="",d.current.updateValue())):console.log("🟡 [useEffect] 종료일 마스크 값 업데이트 스킵 (사용자 입력 중)"))}V(!1)},[N,_,O,r,h,e]);const K=s=>{if(console.log("🔴 [RangePicker] 날짜 변경:",{dates:s?[s[0]?s[0].format(r):null,s[1]?s[1].format(r):null]:null,prevRange:[S[0]?S[0].format(r):null,S[1]?S[1].format(r):null]}),!s){I([null,null]);const Y=Array.isArray(o)?[...o,0]:[o,0],w=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(Y,void 0),C.setFieldValue(w,void 0),u.current?.updateValue(),d.current?.updateValue();return}const[g,y]=s,f=S[0],M=g&&(!f||!g.isSame(f,e==="year"?"year":e==="month"?"month":"day"));if(console.log("🔴 [RangePicker] 시작일 변경 여부:",{isStartDateChanged:M,startDate:g?g.format(r):null,prevStartDate:f?f.format(r):null}),I([g,y]),M){console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"),D(!0),u.current&&(u.current.value="",u.current.updateValue());const Y=g.format(h);console.log("🔴 [RangePicker] form 값 업데이트:",{formatted:Y});const w=Array.isArray(o)?[...o,0]:[o,0];C.setFieldValue(w,Y)}else if(!g&&u.current){D(!1),u.current.value="",u.current.updateValue();const Y=Array.isArray(o)?[...o,0]:[o,0];C.setFieldValue(Y,void 0)}else D(!1);const b=Array.isArray(o)?[...o,1]:[o,1];if(y){const Y=y.format(h);C.setFieldValue(b,Y),d.current&&(d.current.value=y.format(r),d.current.updateValue())}else C.setFieldValue(b,void 0),d.current&&(d.current.value="",d.current.updateValue());V(!1)},q=s=>{setTimeout(()=>{const g=document.activeElement,y=j.current,f=y?.querySelector(".ant-picker-dropdown");!(y&&(y.contains(g)||y===g||f?.contains(g)))&&!(s!==void 0?s:L)&&(console.log("✅ Input과 RangePicker 모두 포커스가 없습니다"),k(!1))},0)};return n.jsx($,{...t,name:void 0,validateStatus:U?"warning":void 0,children:n.jsxs(a.ConfigProvider,{componentSize:z.componentSize,theme:{components:{Input:{addonBg:"#fff"}}},children:[n.jsxs("div",{ref:j,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%"},children:[n.jsx(a.Form.Item,{name:o?Array.isArray(o)?[...o,0]:[o,0]:void 0,getValueProps:s=>{if(!s)return{value:void 0};if(typeof s=="string"&&s.length===h.length&&/^\d+$/.test(s)){if(e==="date"){const g=s.substring(0,4),y=s.substring(4,6),f=s.substring(6,8);return{value:`${g}-${y}-${f}`}}else if(e==="month"){const g=s.substring(0,4),y=s.substring(4,6);return{value:`${g}-${y}`}}else if(e==="year")return{value:s}}return{value:E(s).format(r)}},normalize:s=>s?E(s).format(h):(i?.allowEmpty,void 0),noStyle:!0,rules:t?.rules??[],children:n.jsx(a.Input,{...m,value:void 0,ref:c,onFocus:()=>{if(p("start"),k(!L),D(!1),u.current){const s=Array.isArray(o)?[...o,0]:[o,0];C.getFieldValue(s)||(u.current.value="",u.current.unmaskedValue=""),u.current.updateValue()}},onBlur:()=>{q()},onKeyDown:s=>{if(s.key==="Backspace"&&(p("start"),k(!0)),s.key==="Enter")if(L&&B==="start"){const g=u.current?.value||"";g.length===r.length?E(g,r,!0).isValid()?(k(!1),V(!1)):i?.allowEmpty?V(!1):V(!0):V(!1)}else p("start"),k(!0)},style:{flex:1},allowClear:!0,placeholder:l.replace(/0/g,"_"),suffix:n.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})}),n.jsx("span",{style:{color:"#d9d9d9",userSelect:"none"},children:"~"}),n.jsx(a.Form.Item,{name:o?Array.isArray(o)?[...o,1]:[o,1]:void 0,getValueProps:s=>{if(!s)return{value:void 0};if(typeof s=="string"&&s.length===h.length&&/^\d+$/.test(s)){if(e==="date"){const g=s.substring(0,4),y=s.substring(4,6),f=s.substring(6,8);return{value:`${g}-${y}-${f}`}}else if(e==="month"){const g=s.substring(0,4),y=s.substring(4,6);return{value:`${g}-${y}`}}else if(e==="year")return{value:s}}return{value:E(s).format(r)}},normalize:s=>s?E(s).format(h):(i?.allowEmpty,void 0),noStyle:!0,rules:t?.rules??[],children:n.jsx(a.Input,{...m,ref:F,onFocus:()=>{if(p("end"),k(!L),d.current){d.current.updateValue();const s=d.current.value||"";!(d.current.unmaskedValue||"")&&!s.replace(/[^0-9]/g,"")&&(d.current.value="",d.current.updateValue())}},onBlur:()=>{q()},onKeyDown:s=>{if(s.key==="Backspace"){const g=d.current?.value||"",y=d.current?.unmaskedValue||"";if(g===""||y===""||g.replace(/[^0-9]/g,"").length<=1){s.preventDefault();const f=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(f,void 0),I([S[0],null]),d.current&&(d.current.value="",d.current.updateValue()),setTimeout(()=>{c.current?.focus(),p("start"),k(!0)},0);return}p("end"),k(!0)}if(s.key==="Tab"&&k(!1),s.key==="Enter")if(L&&B==="end"){const g=d.current?.value||"";g.length===r.length?E(g,r,!0).isValid()?(k(!1),V(!1)):i?.allowEmpty?V(!1):V(!0):V(!1)}else p("end"),k(!0)},style:{flex:1},allowClear:!0,onClear:()=>{const s=Array.isArray(o)?[...o,1]:[o,1];C.setFieldValue(s,void 0),I([S[0],null]),d.current&&(d.current.value="",d.current.updateValue()),setTimeout(()=>{c.current?.focus(),p("start"),k(!0)},0)},placeholder:l.replace(/0/g,"_"),suffix:n.jsx(P.CalendarOutlined,{style:{color:"#d9d9d9"}}),autoComplete:"off"})})]}),n.jsx(Ye,{...i,open:L,picker:e,format:{format:r,type:"mask"},showNow:!0,value:S,onChange:K,onOpenChange:s=>{k(s),s||q(!1)},renderExtraFooter:()=>U?n.jsxs("div",{style:{color:"#faad14",paddingLeft:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"6px",borderTop:"1px solid #f0f0f0",backgroundColor:"#fffbe6"},children:[n.jsx(P.ExclamationCircleOutlined,{}),n.jsx("span",{children:"유효하지 않은 날짜입니다"})]}):null,getPopupContainer:s=>s.parentElement,style:{position:"absolute",top:0,left:0,pointerEvents:"none",opacity:0,width:"100%"}})]})})},{Option:te}=a.Select,Ve=({itemProps:e,inputProps:t})=>{const[m,i]=x.useState([]);return x.useEffect(()=>{t?.addField==="ALL"?i([{label:"전체",value:""},...t?.list||[]]):t?.addField==="NULL"?i([{label:"",value:""},...t?.list||[]]):i(t?.list||[])},[t?.list]),n.jsx($,{...e,getValueProps:r=>r?{value:r&&r.indexOf(",")>0?r.split(","):[r]}:{value:[]},normalize:r=>r!=null&&r!=null&&r.length>0?r.toString():"",children:n.jsx(a.Select,{...t,mode:"multiple",children:m.map(r=>{const{value:l,label:h}=r;return t?.printCode?n.jsx(te,{value:l,label:h,children:n.jsx(a.Space,{children:`[${l}] ${h}`})},l):n.jsx(te,{value:l,label:h,children:n.jsx(a.Space,{children:`${h}`})},l)})})})},Ie=({itemProps:e,inputProps:t})=>{const m=r=>{let l=r.toString().split(".");return t?.decimalPoint!=null&&l[1]!=null&&t?.decimalPoint>0?l[1].length>t?.decimalPoint?l[1]="."+l[1].substring(0,t?.decimalPoint):l[1]="."+l[1]:l[1]="",l[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")+l[1]},i=r=>{let l=r.toString().split(".");return t?.decimalPoint!=null&&l[1]!=null&&t?.decimalPoint>0?l[1].length>t?.decimalPoint?l[1]="."+l[1].substring(0,t?.decimalPoint):l[1]="."+l[1]:l[1]="",l[0].replace(/\$\s?|(,*)/g,"")+l[1]};return n.jsx($,{...e,children:n.jsx(a.InputNumber,{...t,formatter:r=>m(r),parser:r=>i(r)})})},Ne=({itemProps:e,inputProps:t})=>n.jsx($,{...e,children:n.jsx(a.Radio.Group,{...t})}),{RangePicker:ve}=a.DatePicker,re={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"}},Le=({itemProps:e,inputProps:t,type:m="date",minDate:i,maxDate:r,returnType:l="string"})=>{const{displayFormat:h,outputFormat:c}=x.useMemo(()=>re[m],[m]),F=x.useMemo(()=>Object.values(re).map(u=>u.outputFormat).sort((u,d)=>{if(u.length===d.length){if(u===c)return-1;if(d===c)return 1}return d.length-u.length}),[c]);return n.jsx($,{...e,getValueProps:u=>({value:u&&u.length>0?[u[0]?E.isDayjs(u[0])?u[0]:E(u[0],F):null,u[1]?E.isDayjs(u[1])?u[1]:E(u[1],F):null]:null}),normalize:u=>u?l==="dayjs"?[u[0]??void 0,u[1]??void 0]:[u[0]?u[0].format(c):void 0,u[1]?u[1].format(c):void 0]:[void 0,void 0],children:n.jsx(ve,{...t,order:!0,minDate:i?E(i,F):void 0,maxDate:r?E(r,F):void 0,picker:m==="datetime"?"date":m,showTime:t?.showTime??(m==="datetime"||m==="time"),format:h})})},ne=a.Input.Search,Me=e=>{const t=a.Form.useFormInstance(),{openPopup:m}=ae.usePopupStore(),i=e.itemProps?.name||[],r=e.popupConfig||{callback(h){Array.isArray(i)&&i.length>1?(t.setFieldValue(i[0],h.code),t.setFieldValue(i[1],h.name)):t.setFieldValue(i,h.code)}},l={...e,placeholder:typeof e.placeholder=="string"?e.placeholder:e.placeholder?.[0]||"",onChange:h=>{Array.isArray(i)&&i.length>1&&t.setFieldValue(i[0],""),e.onChange?.(h)},onSearch:h=>{e.popuCd?m(e.popuCd,e.popupParams,r):e.onSearch?.(h)}};return Array.isArray(i)&&i.length>1?n.jsx($,{...e.itemProps,name:void 0,children:n.jsxs(a.Space.Compact,{block:!0,children:[n.jsx(a.Form.Item,{name:i[0],rules:e.itemProps?.rules,style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:n.jsx(a.Input,{style:{color:"#999",backgroundColor:"#f5f5f5"},placeholder:e.placeholder?.[0]||"",readOnly:!0})}),n.jsx(a.Form.Item,{name:i[1],style:{width:"60%",marginBottom:0},children:n.jsx(ne,{readOnly:e.readOnly,enterButton:n.jsx(a.Button,{icon:n.jsx(P.SearchOutlined,{}),disabled:e.readOnly}),...l})})]})}):n.jsx($,{...e.itemProps,children:n.jsx(ne,{...l})})},Be=({itemProps:e,selectProps:t={options:[],allowClear:!0}})=>{const m=a.Form.useFormInstance(),i=!!m,r=x.useMemo(()=>t?.addField==="ALL"?[{label:"전체",value:""},...t?.options||[]]:t?.addField==="NULL"?[{label:"",value:""},...t?.options||[]]:t?.options||[],[t.options,t.addField]),l=F=>{t.onChange?.(F)},h={...t,allowClear:t.allowClear??!0,options:r,onChange:l,variant:t.variant},c=n.jsx(a.Select,{...h,disabled:t.disabled});return t.copyable&&!i&&console.warn("BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."),t.copyable?n.jsx($,{...e,name:void 0,children:n.jsxs(a.Space.Compact,{block:!0,children:[n.jsx(a.Form.Item,{name:e?.name,rules:e?.rules,style:{width:"100%",marginBottom:0},validateStatus:"",help:"",children:c}),n.jsx(a.Typography.Paragraph,{copyable:{text:i&&m?.getFieldValue(e?.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"}})]})}):n.jsx($,{...e,children:c})},Ee=({itemProps:e,inputProps:t={format:"YN"}})=>{const m=a.Form.useFormInstance(),i=(r,l)=>{t.format==="boolean"?m.setFieldValue(e?.name,r):m.setFieldValue(e?.name,r?"Y":"N"),t.onChange&&t.onChange(r,l)};return n.jsx($,{...e,getValueProps:r=>({checked:t.format==="boolean"?!!r:r==="Y"}),normalize:r=>typeof r=="boolean"?t.format==="boolean"?r:r?"Y":"N":t.format==="boolean"?!!r:r?"Y":"N",children:n.jsx(a.Switch,{...t,onChange:(r,l)=>i(r,l)})})},{TextArea:De}=a.Input,Ae=({itemProps:e,inputProps:t})=>n.jsx($,{...e,children:n.jsx(De,{...t})}),_e=[".pdf",".xlsx",".xls",".docx",".doc",".pptx",".ppt",".hwp",".txt",".csv",".jpg",".jpeg",".png",".gif",".zip"],se={FILE:"file"},Oe=({originNode:e,file:t,fileList:m,moveFile:i,onDrop:r})=>{const l=x.useRef(null),[{handlerId:h},c]=J.useDrop({accept:se.FILE,collect:j=>({handlerId:j.getHandlerId()}),hover(j,C){if(!l.current)return;const L=j.uid,k=t.uid;if(L===k)return;const U=G.findIndex(m,{uid:k}),V=G.findIndex(m,{uid:L});if(V===-1||U===-1)return;const B=l.current.getBoundingClientRect(),p=C.getClientOffset();if(!p)return;const v=(B.bottom-B.top)/2,D=p.y-B.top;V<U&&D<v||V>U&&D>v||i(L,k)},drop(){r()}}),[{isDragging:F},u]=J.useDrag({type:se.FILE,item:()=>({uid:t.uid,index:G.findIndex(m,{uid:t.uid})}),collect:j=>({isDragging:j.isDragging()})}),d=F?0:1;return u(c(l)),n.jsx("div",{ref:l,style:{opacity:d},"data-handler-id":h,children:e})},Re=({itemProps:e,fileGrpKey:t,onUploadComplete:m,onFetchFilesTrxCd:i="SCMFILE00101",onSuccessTrxCd:r="SCMFILE00102",onDeleteFileTrxCd:l="SCMFILE00103",onReorderFilesTrxCd:h="SCMFILE00104",allowedExtensions:c=_e,maxFileSize:F=200,showButton:u=!0,multiple:d=!1,newFileGrpKeyonModify:j=!1,buttonText:C="파일 선택",localOnly:L=!1,onFilesChange:k})=>{const[U,V]=x.useState([]),B=x.useRef(t),p=x.useRef([]),v=a.Form.useFormInstance(),D=()=>{if(L||p.current.length===0)return;const s=[...p.current];if(p.current=[],r){const g=s.map(y=>({crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:B.current,physFileNm:y.fileNameP,lgclFileNm:y.fileNameL,filePath:y.filePath,fileExtn:y.fileExt,fileSize:y.fileSize,mltpYn:"N"}));console.log("newFileGrpKeyonModify",j),console.log("newFileGrpKeyonModify",j?0:B.current),T.callService(r,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:j?0:B.current,oldFileGrpKey:B.current,newFileGrpKeyonModify:j,sub:g}).then(y=>{if(y?.sub&&y.sub.length>0){const f=y.sub[0].fileGrpKey;(!B.current||j)&&(B.current=f);const M=new Map;y.sub.forEach(w=>{const A=s.find(H=>H.fileNameL===w.lgclFileNm);A&&M.set(A.tempId,w)});const b=e?.name;(w=>{if(N){const A=v?.getFieldValue(b)||[],H=w(A);v?.setFieldValue(b,H)}else V(A=>w(A))})(w=>w.map(A=>{const H=M.get(A.uid);if(H){const Q=s.find(le=>le.tempId===A.uid);return m&&Q&&m({...Q,fileGrpKey:f,fileKey:H.fileKey}),{...A,name:H.lgclFileNm,fileGrpKey:f,fileKey:H.fileKey,uid:H.fileKey,status:"done",url:`/api/download?filePath=${H.filePath}&logicalName=${H.lgclFileNm}`}}return A}))}}).catch(y=>{console.error("업로드 후처리 서비스 호출 실패:",y),a.message.error("파일 후처리 중 오류가 발생했습니다.");const f=new Set(s.map(Y=>Y.tempId)),M=e?.name;(Y=>{if(N){const w=v?.getFieldValue(M)||[],A=Y(w);v?.setFieldValue(M,A)}else V(w=>Y(w))})(Y=>Y.map(w=>f.has(w.uid)?{...w,status:"error",error:"후처리 실패"}:w))})}},R=x.useRef(G.debounce(D,500)).current;x.useEffect(()=>()=>{R.cancel()},[R]),x.useEffect(()=>{B.current=t},[t]),x.useEffect(()=>{L||t&&i&&T.callService(i,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:t}).then(s=>{if(s?.sub){const g=s.sub.map(f=>({uid:f.fileKey,name:f.lgclFileNm,status:"done",url:`/api/download?filePath=${f.filePath}&logicalName=${f.lgclFileNm}`})),y=e?.name;N?v?.setFieldValue(y,g):V(g)}else{const g=e?.name;N?v?.setFieldValue(g,[]):V([])}}).catch(s=>{console.error("파일 목록 조회 서비스 호출에 실패했습니다.",s),a.message.error("파일 목록을 불러오는 중 오류가 발생했습니다.")})},[t,i]);const o=(s,g)=>{const y=e?.name,f=N?v?.getFieldValue(y)||[]:U,M=G.findIndex(f,{uid:s}),b=G.findIndex(f,{uid:g});if(M<0||b<0)return;const Y=[...f],[w]=Y.splice(M,1);Y.splice(b,0,w),N?v?.setFieldValue(y,Y):V(Y)},S=()=>{if(!L&&t&&h){const s=e?.name,y=(N?v?.getFieldValue(s)||[]:U).map(f=>f.uid);T.callService(h,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:t,reorderedFileKeys:y}).then(()=>{a.message.success("파일 순서가 성공적으로 저장되었습니다.")}).catch(f=>{console.error("파일 순서 저장 서비스 호출 실패:",f),a.message.error("파일 순서 저장 중 오류가 발생했습니다.")})}},I=s=>{const g=e?.name,y=N?v?.getFieldValue(g)||[]:U;if(!d&&y.length>0)return a.message.error("하나의 파일만 업로드할 수 있습니다."),a.Upload.LIST_IGNORE;if(c&&c.length>0){const f=`.${s.name.split(".").pop()?.toLowerCase()}`;if(!c.includes(f))return a.message.error(`${s.name} 파일은 허용되지 않는 확장자입니다. (${c.join(", ")})`),a.Upload.LIST_IGNORE}return F&&!(s.size/1024/1024<F)?(a.message.error(`일반업로드의 최대용량은 ${F}MB입니다.`),a.Upload.LIST_IGNORE):!L},N=!!e?.name,_={name:"file",multiple:d,action:L?void 0:"/api/upload",beforeUpload:I,showUploadList:{showRemoveIcon:u},onChange(s){const{status:g,uid:y}=s.file;if(g==="removed"){if(!L&&l)T.callService(l,{crprCd:T.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:j?0:B.current,fileKey:y,oldFileGrpKey:B.current,newFileGrpKeyonModify:j}).then(f=>{if(a.message.success("파일이 성공적으로 삭제되었습니다."),j&&(B.current=f.fileGrpKey),N){const M=e?.name;v?.setFieldValue(M,s.fileList)}else V(s.fileList);k?.(s.fileList),m?.({fileGrpKey:f.fileGrpKey})}).catch(f=>{console.error("파일 삭제 서비스 호출에 실패했습니다.",f),a.message.error("파일 삭제 중 오류가 발생했습니다.")});else{if(N){const f=e?.name;v?.setFieldValue(f,s.fileList)}else V(s.fileList);k?.(s.fileList)}return}if(N){const f=e?.name;v?.setFieldValue(f,s.fileList)}else V(s.fileList);if(k?.(s.fileList),g==="done")if(!L&&s.file.response?.success){const{uploadedFiles:f}=s.file.response;f&&Array.isArray(f)&&f.length>0&&(f.forEach(M=>{M.tempId=s.file.uid,p.current.push(M)}),R()),a.message.success(s.file.response.message||`${s.file.name} 파일이 성공적으로 업로드되었습니다.`)}else a.message.error(s.file.response?.message||`${s.file.name} 파일 업로드에 실패했습니다.`);else g==="error"&&a.message.error(s.file.response?.message||`${s.file.name} 파일 업로드 중 오류가 발생했습니다.`)},itemRender(s,g,y){const f=x.cloneElement(s,{href:g.url||void 0,title:void 0});return n.jsx(Oe,{originNode:f,file:g,fileList:y,moveFile:o,onDrop:S},g.uid)}};N||(_.fileList=U);const O=s=>Array.isArray(s)?s:s&&s.fileList,z=e?.name,K=N?a.Form.useWatch?.(z,v):void 0,q=N?K||[]:U;return n.jsx(J.DndProvider,{backend:ce.HTML5Backend,children:n.jsx($,{valuePropName:"fileList",getValueFromEvent:O,...e,children:n.jsx(a.Upload,{headers:{SYSCD:__SYS_CD__},..._,listType:"picture",children:u&&(d||q.length===0)&&n.jsx(a.Button,{icon:n.jsx(P.UploadOutlined,{}),children:C})})})})},Ue=a.Input.Search,ze=e=>{const t=a.Form.useFormInstance(),{openCorePopup:m}=X.usePopup(),i={value:"deptNm",fieldName:"deptNm",placeholder:"부서명"},r={value:"empNm",fieldName:"empNm",placeholder:"사원명 입력"},l=e.field1||i,h=e.field2||r,c=x.useCallback(d=>{t.setFieldValue(e.employeeFieldName||"employee",d),t.setFieldValue(e.empNoFieldName||"empNo",d.empNo??""),t.setFieldValue(l.fieldName,d[l.value||"deptNm"]??""),t.setFieldValue(h.fieldName,d[h.value||"empNm"]??""),e.onFinish?.()},[t,l,h,e.employeeFieldName]),F=x.useCallback(d=>{m("CORE_ORGANIZATION_01",{onSelect:j=>{c(j)},defaultParams:{keyword:d}})},[c,m]),u=x.useCallback(async d=>{const j=d?.trim();if(j)try{const C=await T.callService("SCMUTIL00101",{keyword:j},{showLoading:!1}),L=C?.empList||[];if(C?.empCnt===0){a.message.warning("일치하는 사원을 찾을 수 없어 팝업을 열립니다. 사원을 선택해주세요."),F();return}if(C?.empCnt>1){a.message.info("여러 건이 검색되어 팝업이 열립니다. 사원을 선택해주세요."),F(j);return}const k=L[0];c(k)}catch(C){console.error("사원 검색 서비스 실패:",C),a.message.error("사원 검색 중 오류가 발생했습니다.")}},[c,F]);return n.jsx($,{label:e.label||"사원",name:void 0,children:n.jsxs(a.Space.Compact,{block:!0,children:[n.jsx(a.Form.Item,{name:l.fieldName,style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:n.jsx(a.Input,{style:{color:"#999",backgroundColor:"#f5f5f5"},placeholder:l.placeholder,readOnly:!0})}),n.jsx(a.Form.Item,{name:e.employeeFieldName||"employee",hidden:!0}),n.jsx(a.Form.Item,{name:e.empNoFieldName||"empNo",hidden:!0}),n.jsx(a.Form.Item,{name:h.fieldName,style:{width:"60%",marginBottom:0},children:n.jsx(Ue,{allowClear:!0,readOnly:e.readOnly,placeholder:h.placeholder,enterButton:n.jsx(a.Button,{icon:n.jsx(P.SearchOutlined,{}),disabled:e.readOnly,onClick:()=>{F()}}),onSearch:u,onChange:d=>{t.setFieldValue(l.fieldName,""),t.setFieldValue(e.employeeFieldName||"employee",null),t.setFieldValue(e.empNoFieldName||"empNo","")}})})]})})};exports.BwgButton=ue;exports.BwgCheck=de;exports.BwgCheckList=fe;exports.BwgDatePicker=me;exports.BwgDownload=ge;exports.BwgEmpSearch=ze;exports.BwgForm=oe;exports.BwgFormItem=$;exports.BwgInput=he;exports.BwgLargeUploader=Fe;exports.BwgMaskedDate=ke;exports.BwgMaskedInput=Se;exports.BwgMaskedRange=we;exports.BwgMultiSelect=Ve;exports.BwgNumber=Ie;exports.BwgRadio=Ne;exports.BwgRangePicker=Le;exports.BwgSearch=Me;exports.BwgSelect=Be;exports.BwgSwitch=Ee;exports.BwgTextArea=Ae;exports.BwgUploader=Re;
|