@bwg-ui/core 1.2.5 → 1.2.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/components/popup/SearchDepartmentP01.d.ts +21 -1
- package/dist/components/popup/SearchDepartmentP01.d.ts.map +1 -1
- package/dist/components/popup/SearchDepartmentP02.d.ts +21 -1
- package/dist/components/popup/SearchDepartmentP02.d.ts.map +1 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts +36 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts.map +1 -1
- package/dist/components/popup/SearchOrganizationP02.d.ts +36 -1
- package/dist/components/popup/SearchOrganizationP02.d.ts.map +1 -1
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.d.ts +4 -0
- package/dist/components/popup/index.d.ts.map +1 -1
- package/dist/components/popup/index.js +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +23 -24
- package/dist/provider/hooks/usePopup.d.ts +0 -5
- package/dist/provider/hooks/usePopup.d.ts.map +1 -1
- package/dist/provider/index.cjs +1 -1
- package/dist/provider/index.js +60 -61
- package/package.json +1 -1
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
export interface Department {
|
|
2
|
+
crprCd?: string;
|
|
3
|
+
wkplCd?: string;
|
|
4
|
+
deptCd: string;
|
|
5
|
+
deptNm: string;
|
|
6
|
+
hrnkDeptCd?: string | null;
|
|
7
|
+
hrnkDeptNm?: string | null;
|
|
8
|
+
deptGbCd?: string | null;
|
|
9
|
+
deptLvl?: number | null;
|
|
10
|
+
orgSortOrd?: number | null;
|
|
11
|
+
orgOtptOrd?: number | null;
|
|
12
|
+
deptAbrv?: string | null;
|
|
13
|
+
deptFullNm?: string | null;
|
|
14
|
+
deptEnglNm?: string | null;
|
|
15
|
+
isLeaf?: 'Y' | 'N' | null;
|
|
16
|
+
children?: Department[];
|
|
17
|
+
}
|
|
18
|
+
export interface SearchDepartmentP01Props {
|
|
19
|
+
popup: any;
|
|
20
|
+
}
|
|
21
|
+
declare const SearchDepartmentP01: ({ popup }: SearchDepartmentP01Props) => import("react/jsx-runtime").JSX.Element;
|
|
2
22
|
export default SearchDepartmentP01;
|
|
3
23
|
//# sourceMappingURL=SearchDepartmentP01.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchDepartmentP01.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchDepartmentP01.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchDepartmentP01.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchDepartmentP01.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB;AAsHD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,GAAG,CAAC;CACZ;AAED,QAAA,MAAM,mBAAmB,GAAI,WAAW,wBAAwB,4CAmV/D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
export interface Department {
|
|
2
|
+
crprCd?: string;
|
|
3
|
+
wkplCd?: string;
|
|
4
|
+
deptCd: string;
|
|
5
|
+
deptNm: string;
|
|
6
|
+
hrnkDeptCd?: string | null;
|
|
7
|
+
hrnkDeptNm?: string | null;
|
|
8
|
+
deptGbCd?: string | null;
|
|
9
|
+
deptLvl?: number | null;
|
|
10
|
+
orgSortOrd?: number | null;
|
|
11
|
+
orgOtptOrd?: number | null;
|
|
12
|
+
deptAbrv?: string | null;
|
|
13
|
+
deptFullNm?: string | null;
|
|
14
|
+
deptEnglNm?: string | null;
|
|
15
|
+
isLeaf?: 'Y' | 'N' | null;
|
|
16
|
+
children?: Department[];
|
|
17
|
+
}
|
|
18
|
+
export interface SearchDepartmentP02Props {
|
|
19
|
+
popup: any;
|
|
20
|
+
}
|
|
21
|
+
declare const SearchDepartmentP02: ({ popup }: SearchDepartmentP02Props) => import("react/jsx-runtime").JSX.Element;
|
|
2
22
|
export default SearchDepartmentP02;
|
|
3
23
|
//# sourceMappingURL=SearchDepartmentP02.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchDepartmentP02.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchDepartmentP02.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchDepartmentP02.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchDepartmentP02.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB;AAsHD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,GAAG,CAAC;CACZ;AAED,QAAA,MAAM,mBAAmB,GAAI,WAAW,wBAAwB,4CAqiB/D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
export interface Employee {
|
|
2
|
+
crprCd: string;
|
|
3
|
+
wkplCd: string;
|
|
4
|
+
empNo: string;
|
|
5
|
+
deptCd: string;
|
|
6
|
+
deptNm: string;
|
|
7
|
+
empNm: string;
|
|
8
|
+
jbpsCd: string;
|
|
9
|
+
jbgdCd: string;
|
|
10
|
+
empMarkOrd: number;
|
|
11
|
+
emplyStCd: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Department {
|
|
14
|
+
crprCd: string;
|
|
15
|
+
wkplCd: string;
|
|
16
|
+
deptCd: string;
|
|
17
|
+
orgStrtYmd: string;
|
|
18
|
+
orgEndYmd: string;
|
|
19
|
+
deptNm: string;
|
|
20
|
+
hrnkDeptCd?: string;
|
|
21
|
+
hrnkDeptNm?: string;
|
|
22
|
+
deptGbCd: string;
|
|
23
|
+
deptLvl: number;
|
|
24
|
+
orgSortOrd: number;
|
|
25
|
+
orgOtptOrd: number;
|
|
26
|
+
deptAbrv: string;
|
|
27
|
+
deptFullNm: string;
|
|
28
|
+
deptEnglNm: string;
|
|
29
|
+
emplCnt: number;
|
|
30
|
+
employees?: Employee[];
|
|
31
|
+
children?: Department[];
|
|
32
|
+
}
|
|
33
|
+
export interface SearchOrganizationP01Props {
|
|
34
|
+
popup: any;
|
|
35
|
+
}
|
|
36
|
+
declare const SearchOrganizationP01: ({ popup }: SearchOrganizationP01Props) => import("react/jsx-runtime").JSX.Element;
|
|
2
37
|
export default SearchOrganizationP01;
|
|
3
38
|
//# sourceMappingURL=SearchOrganizationP01.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchOrganizationP01.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchOrganizationP01.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchOrganizationP01.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchOrganizationP01.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,GAAG,CAAC;CACZ;AAED,QAAA,MAAM,qBAAqB,GAAI,WAAW,0BAA0B,4CA0kBnE,CAAC;AAEA,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
export interface Employee {
|
|
2
|
+
crprCd: string;
|
|
3
|
+
wkplCd: string;
|
|
4
|
+
empNo: string;
|
|
5
|
+
deptCd: string;
|
|
6
|
+
deptNm: string;
|
|
7
|
+
empNm: string;
|
|
8
|
+
jbpsCd: string;
|
|
9
|
+
jbgdCd: string;
|
|
10
|
+
empMarkOrd: number;
|
|
11
|
+
emplyStCd: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Department {
|
|
14
|
+
crprCd: string;
|
|
15
|
+
wkplCd: string;
|
|
16
|
+
deptCd: string;
|
|
17
|
+
orgStrtYmd: string;
|
|
18
|
+
orgEndYmd: string;
|
|
19
|
+
deptNm: string;
|
|
20
|
+
hrnkDeptCd?: string;
|
|
21
|
+
hrnkDeptNm?: string;
|
|
22
|
+
deptGbCd: string;
|
|
23
|
+
deptLvl: number;
|
|
24
|
+
orgSortOrd: number;
|
|
25
|
+
orgOtptOrd: number;
|
|
26
|
+
deptAbrv: string;
|
|
27
|
+
deptFullNm: string;
|
|
28
|
+
deptEnglNm: string;
|
|
29
|
+
emplCnt: number;
|
|
30
|
+
employees?: Employee[];
|
|
31
|
+
children?: Department[];
|
|
32
|
+
}
|
|
33
|
+
export interface SearchOrganizationP02Props {
|
|
34
|
+
popup: any;
|
|
35
|
+
}
|
|
36
|
+
declare const SearchOrganizationP02: ({ popup }: SearchOrganizationP02Props) => import("react/jsx-runtime").JSX.Element;
|
|
2
37
|
export default SearchOrganizationP02;
|
|
3
38
|
//# sourceMappingURL=SearchOrganizationP02.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchOrganizationP02.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchOrganizationP02.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchOrganizationP02.d.ts","sourceRoot":"","sources":["../../../src/components/popup/SearchOrganizationP02.tsx"],"names":[],"mappings":"AAyBA,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,GAAG,CAAC;CACZ;AAED,QAAA,MAAM,qBAAqB,GAAI,WAAW,0BAA0B,4CA+qBnE,CAAC;AAEA,eAAe,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("@ant-design/icons"),p=require("antd"),i=require("react"),G=require("../../utils/index.cjs"),z=require("../../chunks/common-components-Bhr_MU0K.cjs"),Q=o=>{if(o==null)return"";const c=String(o).trim();return!c||c.toUpperCase()==="NULL"?"":c.toUpperCase()},J=(o,c=0)=>{const b=Number(o);return Number.isFinite(b)?b:c};function q(o){return{crprCd:o.crprCd||void 0,wkplCd:o.wkplCd||void 0,deptCd:Q(o.deptCd),deptNm:(o.deptNm??"").toString().trim(),hrnkDeptCd:o.hrnkDeptCd||null,hrnkDeptNm:o.hrnkDeptNm||null,deptGbCd:o.deptGbCd||null,deptLvl:J(o.deptLvl,o.hrnkDeptCd?2:1),orgSortOrd:J(o.orgSortOrd,0),orgOtptOrd:J(o.orgOtptOrd,0),deptAbrv:o.deptAbrv||null,deptFullNm:o.deptFullNm||null,deptEnglNm:o.deptEnglNm||null,isLeaf:o.isLeaf||null}}function V(o){const c=new Set,b=o.map(q).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>c.has(l.deptCd)?!1:(c.add(l.deptCd),!0));b.sort((l,m)=>(l.deptLvl||0)-(m.deptLvl||0)||(l.orgSortOrd||0)-(m.orgSortOrd||0)||l.deptCd.localeCompare(m.deptCd));const x=new Map;for(const l of b)x.set(l.deptCd,{...l,children:[]});const v=[];for(const l of b){const m=x.get(l.deptCd),h=l.hrnkDeptCd;h&&x.has(h)?x.get(h).children.push(m):v.push(m)}const D=l=>{!l||l.length===0||(l.sort((m,h)=>m.deptCd.localeCompare(h.deptCd)),l.forEach(m=>D(m.children)))};D(v);const L=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(L)};if(v.forEach(L),v.length>1){const l=v.find(m=>m.deptCd==="D00");if(l)return[l]}return v}function X(o){const c=o.map(q),b=c.filter(x=>x.isLeaf!=="Y").map(x=>x.deptCd);return b.length>200?c.filter(x=>(x.deptLvl||0)<=2).map(x=>x.deptCd):b}const Z=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState([]),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState(!1),E=i.useCallback(async y=>{try{$(!0);const k=await G.callService("SCMUTIL00103",{...o?.popupParams,...y}),O=Array.isArray(k?.data)?k.data:Array.isArray(k?.deptList)?k.deptList:Array.isArray(k)?k:[],w=V(O);m(w);const P=X(O);v(P);const s=w[0]?.deptCd||q(O.find(f=>q(f).deptLvl===1)||{}).deptCd||q(O[0]||{}).deptCd||"";L(s?[s]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{$(!1)}},[o?.popupParams]);i.useEffect(()=>{E()},[E]);const M=i.useCallback((y,k)=>{for(const O of y){if(O.deptCd===k)return O;if(O.children){const w=M(O.children,k);if(w)return w}}return null},[]),S=i.useMemo(()=>{const y=D[0];return y?M(l,y):null},[D,l,M]),I=i.useMemo(()=>{const y=O=>O.map(w=>({title:w.deptNm,key:w.deptCd,meta:w,children:w.children?y(w.children):void 0}));return y(l)},[l]),F=i.useMemo(()=>{const y=c.trim().toLowerCase();if(!y)return I;const k=O=>O.map(w=>{const P=w.meta,s=(P?.deptNm||"").toLowerCase().includes(y)||(P?.deptCd||"").toLowerCase().includes(y),f=w.children?k(w.children):void 0;return s||f&&f.length?{...w,children:f}:null}).filter(Boolean);return k(I)},[I,c]),U=i.useCallback(y=>{L(y.slice(0,1).map(String))},[]),R=i.useCallback(y=>v(y.map(String)),[]),A=i.useCallback((y,k)=>{if(y.stopPropagation(),!k.children||k.children.length===0)return;const O=x.includes(k.key);v(w=>O?w.filter(P=>P!==k.key):[...w,k.key])},[x]),W=i.useCallback(()=>L([]),[]),B={confirm:()=>{if(!S){p.message.error("부서를 선택해주세요.");return}const y={deptCd:S.deptCd,deptNm:S.deptNm,hrnkDeptCd:S.hrnkDeptCd,hrnkDeptNm:S.hrnkDeptNm,deptLvl:S.deptLvl,orgSortOrd:S.orgSortOrd};o?.config?.callback?.(JSON.stringify(y)),o?.close?.()}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:B,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"70%",min:"70%",max:"75%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx(p.Row,{gutter:[16,16],children:t.jsx(p.Col,{span:24,children:t.jsx(p.Input,{placeholder:"부서명, 부서코드 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:y=>b(y.target.value)})})})]})}),t.jsx("div",{style:{padding:16,overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:h,children:t.jsx(p.Tree,{treeData:F,expandedKeys:x,selectedKeys:D,onSelect:U,onExpand:R,onDoubleClick:A,showLine:!0,showIcon:!1,selectable:!0,style:{overflow:"hidden"},titleRender:y=>{const k=y.meta;return t.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%",fontWeight:D.includes(y.key)?"bold":"normal"},children:[t.jsx("span",{children:k.deptNm}),t.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:k.deptCd})]})}})})})]}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:16,overflowY:"hidden",height:"100%"},children:[t.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:16,fontWeight:700},children:"선택된 부서"}),S?t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:14,border:"1px solid #e0e0e0",borderRadius:12,background:"#fafafa"},children:[t.jsx("div",{style:{width:42,height:42,borderRadius:"50%",border:"1px solid #e6e6e6",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:18,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:t.jsx(T.TeamOutlined,{})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{fontSize:15,fontWeight:700,marginBottom:4},children:[S.deptNm," ",t.jsxs("span",{style:{color:"#8c8c8c",fontSize:12},children:["(",S.deptCd,")"]})]}),t.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:2},children:["상위부서: ",S.hrnkDeptNm||"-"]})]}),t.jsx(p.Button,{type:"text",onClick:W,icon:t.jsx(T.RestOutlined,{style:{fontSize:24,color:"#FF6363"}})})]}):t.jsx("div",{style:{color:"#999",fontSize:14},children:"부서를 선택해주세요."})]})})]})})})})},_=o=>{if(o==null)return"";const c=String(o).trim();return!c||c.toUpperCase()==="NULL"?"":c.toUpperCase()},H=(o,c=0)=>{const b=Number(o);return Number.isFinite(b)?b:c};function Y(o){return{crprCd:o.crprCd||void 0,wkplCd:o.wkplCd||void 0,deptCd:_(o.deptCd),deptNm:(o.deptNm??"").toString().trim(),hrnkDeptCd:o.hrnkDeptCd||null,hrnkDeptNm:o.hrnkDeptNm||null,deptGbCd:o.deptGbCd||null,deptLvl:H(o.deptLvl,o.hrnkDeptCd?2:1),orgSortOrd:H(o.orgSortOrd,0),orgOtptOrd:H(o.orgOtptOrd,0),deptAbrv:o.deptAbrv||null,deptFullNm:o.deptFullNm||null,deptEnglNm:o.deptEnglNm||null,isLeaf:o.isLeaf||null}}function ee(o){const c=new Set,b=o.map(Y).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>c.has(l.deptCd)?!1:(c.add(l.deptCd),!0));b.sort((l,m)=>(l.deptLvl||0)-(m.deptLvl||0)||(l.orgSortOrd||0)-(m.orgSortOrd||0)||l.deptCd.localeCompare(m.deptCd));const x=new Map;for(const l of b)x.set(l.deptCd,{...l,children:[]});const v=[];for(const l of b){const m=x.get(l.deptCd),h=l.hrnkDeptCd;h&&x.has(h)?x.get(h).children.push(m):v.push(m)}const D=l=>{!l||l.length===0||(l.sort((m,h)=>m.deptCd.localeCompare(h.deptCd)),l.forEach(m=>D(m.children)))};D(v);const L=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(L)};if(v.forEach(L),v.length>1){const l=v.find(m=>m.deptCd==="D00");if(l)return[l]}return v}function te(o){const c=o.map(Y),b=c.filter(x=>x.isLeaf!=="Y").map(x=>x.deptCd);return b.length>200?c.filter(x=>(x.deptLvl||0)<=2).map(x=>x.deptCd):b}const ne=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState(""),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState([]),[E,M]=i.useState(!1),[S,I]=i.useState([]),[F,U]=i.useState(!1),R=i.useCallback(async e=>{try{U(!0);const n=await G.callService("SCMUTIL00103",{...o?.popupParams,...e}),r=Array.isArray(n?.data)?n.data:Array.isArray(n?.deptList)?n.deptList:Array.isArray(n)?n:[],d=ee(r);I(d);const a=te(r);L(a);const u=d[0]?.deptCd||Y(r.find(g=>Y(g).deptLvl===1)||{}).deptCd||Y(r[0]||{}).deptCd||"";m(u?[u]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{U(!1)}},[o?.popupParams]);i.useEffect(()=>{R()},[R]);const A=i.useCallback((e,n)=>{for(const r of e){if(r.deptCd===n)return r;if(r.children){const d=A(r.children,n);if(d)return d}}return null},[S]),W=i.useMemo(()=>h.map(e=>{const n=A(S,e);if(!n)return null;const{children:r,...d}=n;return d}).filter(Boolean),[h,S,A]),B=i.useMemo(()=>{const e=n=>n.map(r=>({title:r.deptNm,key:r.deptCd,meta:r,children:r.children?e(r.children):void 0,isLeaf:!r.children||r.children.length===0}));return e(S)},[S]),y=i.useMemo(()=>{const e=c.trim().toLowerCase();if(!e)return B;const n=r=>r.map(d=>{const a=d.meta,u=(a?.deptNm||"").toLowerCase().includes(e)||(a?.deptCd||"").toLowerCase().includes(e),g=d.children?n(d.children):void 0;return u||g&&g.length>0?{...d,children:g}:null}).filter(Boolean);return n(B)},[B,c]),k=i.useCallback(e=>{const n=[],r=d=>{for(const a of d)if(a.deptCd===e&&a.children){const u=g=>{for(const j of g)n.push(j.deptCd),j.children&&u(j.children)};u(a.children)}else a.children&&r(a.children)};return r(S),n},[S]),O=i.useCallback((e,n)=>{let r=Array.isArray(e)?e:e?.checked??[];if(E&&n?.node?.key){const d=n.node.key,a=k(d);if(n.checked){const u=new Set(r);for(const g of a)u.add(g);r=Array.from(u)}else{const u=new Set([d,...a]);r=r.filter(g=>!u.has(g))}}$(r)},[E,k]),w=i.useCallback(e=>{const n=e.map(String);if(m(n),n.length>0){const r=n[0],d=(u,g)=>{for(const j of u){if(j.deptCd===g)return j.deptNm;if(j.children){const K=d(j.children,g);if(K)return K}}return null},a=d(S,r);a&&v(a)}},[S]),P=i.useCallback(e=>L(e.map(String)),[]),s=i.useCallback((e,n)=>{if(e.stopPropagation(),n.children&&n.children.length>0){const r=D.includes(n.key);L(d=>r?d.filter(a=>a!==n.key):[...d,n.key])}},[D]),f=i.useCallback(e=>{$(n=>n.filter(r=>r!==e))},[]),C=i.useCallback(()=>{$([])},[]),N={confirm:()=>{if(h.length===0){p.message.error("부서를 선택해주세요.");return}const n=Array.from(new Set(h)).map(r=>{const d=A(S,r);return d?{deptCd:d.deptCd,deptNm:d.deptNm,hrnkDeptCd:d.hrnkDeptCd,hrnkDeptNm:d.hrnkDeptNm}:null}).filter(Boolean);o?.config?.callback?.(JSON.stringify(n)),o?.close?.()}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:N,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx("div",{style:{fontSize:14,color:"#666",padding:8,backgroundColor:"#f8f8f8",borderRadius:4},children:x}),t.jsxs(p.Row,{gutter:[16,16],children:[t.jsx(p.Col,{span:18,children:t.jsx(p.Input,{placeholder:"부서명, 부서장명, 부서코드 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:e=>b(e.target.value)})}),t.jsx(p.Col,{span:6,style:{justifyContent:"center",display:"flex",alignItems:"center"},children:t.jsx(p.Checkbox,{checked:E,onChange:e=>M(e.target.checked),children:"하위까지 선택"})})]})]})}),t.jsx("div",{style:{padding:16,overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:F,children:t.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:y,expandedKeys:D,selectedKeys:l,checkedKeys:h,checkable:!0,checkStrictly:!0,showLine:!0,showIcon:!1,selectable:!0,onSelect:w,onExpand:P,onCheck:O,onDoubleClick:s,style:{overflow:"hidden"},titleRender:e=>{const n=e.meta;return t.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%"},children:[t.jsx("span",{style:{fontWeight:l.includes(e.key)?"bold":"normal"},children:n.deptNm}),t.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:n.deptCd})]})}})})})]}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:16,overflowY:"hidden"},children:[t.jsxs("div",{style:{marginBottom:12,display:"flex",alignItems:"center",gap:8},children:[t.jsxs("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:["선택된 부서 (",W.length,"개)"]}),W.length>0&&t.jsx("button",{onClick:C,style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",fontSize:12,padding:4},title:"전체 해제",children:"전체 해제"})]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"flex-start",minHeight:48},children:W.length===0?t.jsx("div",{style:{color:"#999",fontSize:14},children:"선택된 부서가 없습니다."}):W.map(e=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:999,border:"1px solid #e6e6e6",background:"#fafafa",lineHeight:1.1,cursor:"default",maxWidth:260},title:`${e.deptNm}`,children:[t.jsx("span",{style:{width:18,height:18,borderRadius:"50%",border:"1px solid #e6e6e6",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:t.jsx(T.TeamOutlined,{})}),t.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:2,overflow:"hidden"},children:[t.jsx("span",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:e.deptNm}),t.jsx("span",{style:{fontSize:11,color:"#8c8c8c",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:e.deptCd})]}),t.jsx("button",{onClick:()=>f(e.deptCd),style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",padding:2,lineHeight:0},"aria-label":`${e.deptNm} 선택 해제`,title:"선택 해제",children:"×"})]},e.deptCd))})]})})]})})})})},re=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState(""),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState(null),[E,M]=i.useState([]),[S,I]=i.useState(!1),F=i.useCallback(async()=>{try{I(!0);const s=await G.callService("SCMUTIL00105",{...o?.popupParams});console.log("📊 조직도 API 응답:",s);const f=Array.isArray(s?.data)?s.data:Array.isArray(s?.orgnList)?s.orgnList:Array.isArray(s)?s:[];if(f.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const C=U(f);console.log("🌳 구성된 조직도 트리:",C),M(C);const N=f.filter(e=>e.deptLvl<=2).map(e=>e.deptCd);if(L(N),C.length>0){const e=C[0];m([e.deptCd]),v(e.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(s){console.error("❌ 조직도 데이터 로딩 실패:",s),p.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{I(!1)}},[o?.popupParams]),U=i.useCallback(s=>{const f=[...s].sort((n,r)=>n.deptLvl-r.deptLvl||n.orgSortOrd-r.orgSortOrd||n.deptCd.localeCompare(r.deptCd)),C=new Map;for(const n of f)C.set(n.deptCd,{...n,children:[]});const N=[];for(const n of f){const r=C.get(n.deptCd),d=n.hrnkDeptCd;d&&C.has(d)?C.get(d).children.push(r):N.push(r)}const e=n=>{if(!n.children||n.children.length===0){delete n.children;return}n.children.forEach(e)};return N.forEach(e),N},[]);i.useEffect(()=>{F()},[F]);const R=i.useMemo(()=>{const s=N=>{let e=[];return N.forEach(n=>{n.employees&&(e=e.concat(n.employees)),n.children&&(e=e.concat(s(n.children)))}),e},f=s(E),C=f.filter((N,e,n)=>e===n.findIndex(r=>r.empNo===N.empNo));return console.log(`👥 전체 사원 수: ${f.length}, 중복 제거 후: ${C.length}`),C},[E]),A=i.useMemo(()=>{const s=f=>f.map(C=>({title:C.deptNm,key:C.deptCd,children:C.children?s(C.children):void 0,isLeaf:!C.children||C.children.length===0}));return s(E)},[E]),W=i.useMemo(()=>{if(!c.trim())return A;const s=f=>f.map(C=>{const N=C.title.toLowerCase().includes(c.toLowerCase()),e=C.children?s(C.children):void 0;return N||e&&e.length>0?{...C,children:e}:null}).filter(Boolean);return s(A)},[A,c]),B=i.useMemo(()=>{if(!c.trim()){const s=n=>{let r=[];return n.forEach(d=>{d.employees&&(r=r.concat(d.employees)),d.children&&(r=r.concat(s(d.children)))}),r},f=(n,r)=>{for(const d of n){if(d.deptCd===r){let a=[...d.employees||[]];return d.children&&(a=a.concat(s(d.children))),a}if(d.children){const a=f(d.children,r);if(a.length>0)return a}}return[]},C=l[0];if(!C)return[];const N=f(E,C),e=N.filter((n,r,d)=>r===d.findIndex(a=>a.empNo===n.empNo));return console.log(`🔍 선택된 부서: ${C}, 반환된 사원 수: ${N.length}, 중복 제거 후: ${e.length}`),e}return R.filter(s=>s.empNm.toLowerCase().includes(c.toLowerCase())||s.empNo.toLowerCase().includes(c.toLowerCase())||s.deptNm.toLowerCase().includes(c.toLowerCase())||s.jbpsCd.includes(c)||s.jbgdCd.includes(c)||s.emplyStCd.includes(c))},[c,l,R,E]),y=i.useCallback(s=>{$(s)},[]),k=i.useCallback(s=>{const f=s.map(String);if(console.log(`🌳 트리 선택: ${f.join(", ")}`),m(f),f.length>0){const C=f[0],N=(n,r)=>{for(const d of n){if(d.deptCd===r)return d.deptNm;if(d.children){const a=N(d.children,r);if(a)return a}}return null},e=N(E,C);e&&v(e)}},[E]),O=i.useCallback(s=>{L(s.map(String))},[]),w=i.useCallback((s,f)=>{if(s.stopPropagation(),f.children&&f.children.length>0){const C=D.includes(f.key);L(C?N=>N.filter(e=>e!==f.key):N=>[...N,f.key])}},[D]),P={confirm:()=>{h?(o?.popupParams?.onSelect?o.popupParams.onSelect(h):o?.config?.callback&&o.config.callback(JSON.stringify(h,null,2)),o?.close?.()):p.message.error("사원을 선택해주세요.")}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:P,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:"6px"},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx(p.Input,{placeholder:"이름, 소속, 전화번호 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:s=>b(s.target.value)})]})}),t.jsx("div",{style:{padding:"16px",overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:S,children:t.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:W,expandedKeys:D,selectedKeys:l,onSelect:k,onExpand:O,onDoubleClick:w,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:s=>t.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontWeight:l.includes(s.key)?"bold":"normal",display:"inline-block",width:"100%"},children:s.title})})})})]}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:"16px",overflowY:"hidden"},children:[t.jsx("div",{style:{marginBottom:"16px"},children:t.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"bold"},children:c?"검색 결과":x})}),t.jsxs("div",{style:{overflow:"hidden",height:"100%"},children:[B.map(s=>t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:h&&h.crprCd===s.crprCd&&h.wkplCd===s.wkplCd&&h.empNo===s.empNo&&h.jbpsCd===s.jbpsCd&&h.jbgdCd===s.jbgdCd&&h.empMarkOrd===s.empMarkOrd?"#efebff":"white"},onClick:()=>y(s),children:[t.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px"},onClick:f=>{f.stopPropagation(),$(s)},children:h&&h.crprCd===s.crprCd&&h.wkplCd===s.wkplCd&&h.empNo===s.empNo&&h.jbpsCd===s.jbpsCd&&h.jbgdCd===s.jbgdCd&&h.empMarkOrd===s.empMarkOrd?t.jsx(T.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):t.jsx(T.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",fontSize:"18px",color:"#666"},children:t.jsx(T.UserOutlined,{})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px"},children:[s.empNm,t.jsxs("span",{style:{fontSize:"12px",fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",s.empNo,")"]})]}),t.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"2px"},children:[s.deptNm," (",s.deptCd,") | 직급:"," ",s.jbpsCd," | 등급: ",s.jbgdCd]})]})]},`emp-${s.crprCd}-${s.wkplCd}-${s.empNo}-${s.jbpsCd}-${s.jbgdCd}-${s.empMarkOrd}`)),B.length===0&&t.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:c?"검색 결과가 없습니다.":"해당 부서에 직원이 없습니다."})]})]})})]})})})})},le=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState(""),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState([]),[E,M]=i.useState(!1),[S,I]=i.useState({}),F=i.useCallback(async()=>{try{M(!0);const e=await G.callService("SCMUTIL00105",{...o?.popupParams});console.log("📊 조직도 API 응답:",e);const n=Array.isArray(e?.data)?e.data:Array.isArray(e?.orgnList)?e.orgnList:Array.isArray(e)?e:[];if(n.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const r=U(n);console.log("🌳 구성된 조직도 트리:",r),$(r);const d=n.filter(a=>a.deptLvl<=2).map(a=>a.deptCd);if(L(d),r.length>0){const a=r[0];m([a.deptCd]),v(a.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(e){console.error("❌ 조직도 데이터 로딩 실패:",e),p.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{M(!1)}},[o?.popupParams]),U=i.useCallback(e=>{const n=[...e].sort((u,g)=>u.deptLvl-g.deptLvl||u.orgSortOrd-g.orgSortOrd||u.deptCd.localeCompare(g.deptCd)),r=new Map;for(const u of n)r.set(u.deptCd,{...u,children:[]});const d=[];for(const u of n){const g=r.get(u.deptCd),j=u.hrnkDeptCd;j&&r.has(j)?r.get(j).children.push(g):d.push(g)}const a=u=>{if(!u.children||u.children.length===0){delete u.children;return}u.children.forEach(a)};return d.forEach(a),d},[]);i.useEffect(()=>{F()},[F]);const R=i.useMemo(()=>{const e=d=>{let a=[];return d.forEach(u=>{u.employees&&(a=a.concat(u.employees)),u.children&&(a=a.concat(e(u.children)))}),a},n=e(h),r=n.filter((d,a,u)=>a===u.findIndex(g=>g.empNo===d.empNo));return console.log(`👥 전체 사원 수: ${n.length}, 중복 제거 후: ${r.length}`),r},[h]),A=i.useMemo(()=>{const e=n=>n.map(r=>({title:r.deptNm,key:r.deptCd,children:r.children?e(r.children):void 0,isLeaf:!r.children||r.children.length===0}));return e(h)},[h]),W=i.useMemo(()=>{if(!c.trim())return A;const e=n=>n.map(r=>{const d=r.title.toLowerCase().includes(c.toLowerCase()),a=r.children?e(r.children):void 0;return d||a&&a.length>0?{...r,children:a}:null}).filter(Boolean);return e(A)},[A,c]),B=i.useMemo(()=>{if(!c.trim()){const e=u=>{let g=[];return u.forEach(j=>{j.employees&&(g=g.concat(j.employees)),j.children&&(g=g.concat(e(j.children)))}),g},n=(u,g)=>{for(const j of u){if(j.deptCd===g){let K=[...j.employees||[]];return j.children&&(K=K.concat(e(j.children))),K}if(j.children){const K=n(j.children,g);if(K.length>0)return K}}return[]},r=l[0];if(!r)return[];const d=n(h,r),a=d.filter((u,g,j)=>g===j.findIndex(K=>K.empNo===u.empNo));return console.log(`🔍 선택된 부서: ${r}, 반환된 사원 수: ${d.length}, 중복 제거 후: ${a.length}`),a}return R.filter(e=>e.empNm.toLowerCase().includes(c.toLowerCase())||e.empNo.toLowerCase().includes(c.toLowerCase())||e.deptNm.toLowerCase().includes(c.toLowerCase())||e.jbpsCd.includes(c)||e.jbgdCd.includes(c)||e.emplyStCd.includes(c))},[c,l,R,h]),y=i.useCallback(e=>{I(n=>{const r={...n};return r[e.empNo]?delete r[e.empNo]:r[e.empNo]=e,r})},[]),k=i.useCallback(e=>{I(n=>{const r={...n};return delete r[e],r})},[]),O=i.useCallback(()=>I({}),[]),w=i.useCallback(()=>{I(e=>{const n={...e};for(const r of B)n[r.empNo]=r;return n})},[B]),P=i.useCallback(()=>{I(e=>{const n={...e};for(const r of B)delete n[r.empNo];return n})},[B]),s=i.useCallback(e=>{const n=e.map(String);if(console.log(`🌳 트리 선택: ${n.join(", ")}`),m(n),n.length>0){const r=n[0],d=(u,g)=>{for(const j of u){if(j.deptCd===g)return j.deptNm;if(j.children){const K=d(j.children,g);if(K)return K}}return null},a=d(h,r);a&&v(a)}},[h]),f=i.useCallback(e=>{L(e.map(String))},[]),C=i.useCallback((e,n)=>{if(e.stopPropagation(),!n.children||!n.children.length)return;const r=D.includes(n.key);L(d=>r?d.filter(a=>a!==n.key):[...d,n.key])},[D]),N={confirm:()=>{const e=Object.values(S).map(n=>({crprCd:n.crprCd,wkplCd:n.wkplCd,empNo:n.empNo,deptCd:n.deptCd,deptNm:n.deptNm,empNm:n.empNm,jbpsCd:n.jbpsCd,jbgdCd:n.jbgdCd,empMarkOrd:n.empMarkOrd,emplyStCd:n.emplyStCd}));if(e.length===0){p.message.error("직원을 선택해주세요.");return}o?.config?.callback?.(JSON.stringify(e)),o?.close?.()}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:N,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{style:{height:"100%"},children:[t.jsx(p.Splitter.Panel,{defaultSize:"50%",min:"50%",max:"70%",children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"35%",max:"75%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx(p.Input,{placeholder:"이름, 소속, 직급/직위, 사번 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:e=>b(e.target.value)})]})}),t.jsx("div",{style:{padding:16,overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:E,children:t.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:W,expandedKeys:D,selectedKeys:l,onSelect:s,onExpand:f,onDoubleClick:C,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:e=>t.jsx("span",{style:{padding:"4px 8px",borderRadius:4,fontWeight:l.includes(e.key)?"bold":"normal",display:"inline-block",width:"100%"},children:e.title})})})})]}),t.jsx(p.Splitter.Panel,{children:t.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:c?"검색 결과":`${x} 사용자`}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx(p.Button,{size:"small",onClick:w,children:"현재 목록 전체 선택"}),t.jsx(p.Button,{size:"small",onClick:P,children:"현재 목록 전체 해제"})]})]}),t.jsx(p.Divider,{style:{margin:"8px 0"}}),t.jsxs("div",{style:{overflowY:"auto"},children:[B.map(e=>{const n=!!S[e.empNo];return t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,cursor:"pointer",background:n?"#efebff":"#fff"},onClick:()=>y(e),children:[t.jsx("div",{style:{marginRight:12,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center"},onClick:r=>{r.stopPropagation(),y(e)},children:n?t.jsx(T.CheckCircleFilled,{style:{fontSize:20,color:"#6449fc"}}):t.jsx(T.CheckCircleOutlined,{style:{fontSize:20,color:"#d9d9d9"}})}),t.jsx("div",{style:{width:36,height:36,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:16,color:"#666",flex:"0 0 auto"},children:t.jsx(T.UserOutlined,{})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{fontSize:14,fontWeight:600,marginBottom:2},children:[e.empNm,t.jsxs("span",{style:{fontSize:12,fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",e.empNo,")"]})]}),t.jsxs("div",{style:{fontSize:12,color:"#666"},children:[e.deptNm," (",e.deptCd,") | 직급: ",e.jbpsCd," | 등급: ",e.jbgdCd]})]})]},`emp-${e.crprCd}-${e.wkplCd}-${e.empNo}-${e.jbpsCd}-${e.jbgdCd}-${e.empMarkOrd}`)}),B.length===0&&t.jsx("div",{style:{textAlign:"center",padding:32,color:"#999",fontSize:14},children:c?"검색 결과가 없습니다.":"해당 부서에 사용자 없음"})]})]})})]})}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(z.BwgTitleBox,{title:`선택된 사용자 (${Object.keys(S).length})`}),t.jsx(p.Button,{type:"link",size:"small",onClick:O,children:"전체 해제"})]}),t.jsx(p.Divider,{style:{margin:"8px 0"}}),t.jsxs("div",{style:{overflowY:"auto",flex:1},children:[Object.values(S).map(e=>t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,background:"#fafafa"},children:[t.jsx("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:10,color:"#666"},children:t.jsx(T.UserOutlined,{})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{fontSize:13,fontWeight:600,marginBottom:2},children:[e.empNm,t.jsxs("span",{style:{fontSize:11,fontWeight:"normal",color:"#666",marginLeft:"6px"},children:["(",e.empNo,")"]})]}),t.jsxs("div",{style:{fontSize:12,color:"#666"},children:[e.deptNm," (",e.deptCd,") | 직급: ",e.jbpsCd," | 등급: ",e.jbgdCd]})]}),t.jsx(p.Button,{type:"text",shape:"circle",icon:t.jsx(T.CloseOutlined,{}),onClick:()=>k(e.empNo)})]},`selected-${e.crprCd}-${e.wkplCd}-${e.empNo}-${e.jbpsCd}-${e.jbgdCd}-${e.empMarkOrd}`)),Object.keys(S).length===0&&t.jsx("div",{style:{color:"#999",fontSize:14,textAlign:"center",padding:24},children:"선택된 사용자가 없습니다."})]})]})})]})})})})};exports.SearchDepartmentP01=Z;exports.SearchDepartmentP02=ne;exports.SearchOrganizationP01=re;exports.SearchOrganizationP02=le;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("@ant-design/icons"),p=require("antd"),i=require("react"),G=require("../../utils/index.cjs"),z=require("../../chunks/common-components-Bhr_MU0K.cjs"),Q=o=>{if(o==null)return"";const c=String(o).trim();return!c||c.toUpperCase()==="NULL"?"":c.toUpperCase()},J=(o,c=0)=>{const b=Number(o);return Number.isFinite(b)?b:c};function q(o){return{crprCd:o.crprCd||void 0,wkplCd:o.wkplCd||void 0,deptCd:Q(o.deptCd),deptNm:(o.deptNm??"").toString().trim(),hrnkDeptCd:o.hrnkDeptCd||null,hrnkDeptNm:o.hrnkDeptNm||null,deptGbCd:o.deptGbCd||null,deptLvl:J(o.deptLvl,o.hrnkDeptCd?2:1),orgSortOrd:J(o.orgSortOrd,0),orgOtptOrd:J(o.orgOtptOrd,0),deptAbrv:o.deptAbrv||null,deptFullNm:o.deptFullNm||null,deptEnglNm:o.deptEnglNm||null,isLeaf:o.isLeaf||null}}function V(o){const c=new Set,b=o.map(q).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>c.has(l.deptCd)?!1:(c.add(l.deptCd),!0));b.sort((l,m)=>(l.deptLvl||0)-(m.deptLvl||0)||(l.orgSortOrd||0)-(m.orgSortOrd||0)||l.deptCd.localeCompare(m.deptCd));const x=new Map;for(const l of b)x.set(l.deptCd,{...l,children:[]});const v=[];for(const l of b){const m=x.get(l.deptCd),h=l.hrnkDeptCd;h&&x.has(h)?x.get(h).children.push(m):v.push(m)}const D=l=>{!l||l.length===0||(l.sort((m,h)=>m.deptCd.localeCompare(h.deptCd)),l.forEach(m=>D(m.children)))};D(v);const L=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(L)};if(v.forEach(L),v.length>1){const l=v.find(m=>m.deptCd==="D00");if(l)return[l]}return v}function X(o){const c=o.map(q),b=c.filter(x=>x.isLeaf!=="Y").map(x=>x.deptCd);return b.length>200?c.filter(x=>(x.deptLvl||0)<=2).map(x=>x.deptCd):b}const Z=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState([]),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState(!1),E=i.useCallback(async y=>{try{$(!0);const k=await G.callService("SCMUTIL00103",{...o?.popupParams,...y}),O=Array.isArray(k?.data)?k.data:Array.isArray(k?.deptList)?k.deptList:Array.isArray(k)?k:[],w=V(O);m(w);const P=X(O);v(P);const s=w[0]?.deptCd||q(O.find(f=>q(f).deptLvl===1)||{}).deptCd||q(O[0]||{}).deptCd||"";L(s?[s]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{$(!1)}},[o?.popupParams]);i.useEffect(()=>{E()},[E]);const M=i.useCallback((y,k)=>{for(const O of y){if(O.deptCd===k)return O;if(O.children){const w=M(O.children,k);if(w)return w}}return null},[]),S=i.useMemo(()=>{const y=D[0];return y?M(l,y):null},[D,l,M]),I=i.useMemo(()=>{const y=O=>O.map(w=>({title:w.deptNm,key:w.deptCd,meta:w,children:w.children?y(w.children):void 0}));return y(l)},[l]),F=i.useMemo(()=>{const y=c.trim().toLowerCase();if(!y)return I;const k=O=>O.map(w=>{const P=w.meta,s=(P?.deptNm||"").toLowerCase().includes(y)||(P?.deptCd||"").toLowerCase().includes(y),f=w.children?k(w.children):void 0;return s||f&&f.length?{...w,children:f}:null}).filter(Boolean);return k(I)},[I,c]),U=i.useCallback(y=>{L(y.slice(0,1).map(String))},[]),R=i.useCallback(y=>v(y.map(String)),[]),A=i.useCallback((y,k)=>{if(y.stopPropagation(),!k.children||k.children.length===0)return;const O=x.includes(k.key);v(w=>O?w.filter(P=>P!==k.key):[...w,k.key])},[x]),W=i.useCallback(()=>L([]),[]),B={confirm:()=>{if(!S){p.message.error("부서를 선택해주세요.");return}const y={deptCd:S.deptCd,deptNm:S.deptNm,hrnkDeptCd:S.hrnkDeptCd,hrnkDeptNm:S.hrnkDeptNm,deptLvl:S.deptLvl,orgSortOrd:S.orgSortOrd};o?.config?.callback?.(JSON.stringify(y)),o?.close?.()}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:B,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"70%",min:"70%",max:"75%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx(p.Row,{gutter:[16,16],children:t.jsx(p.Col,{span:24,children:t.jsx(p.Input,{placeholder:"부서명, 부서코드 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:y=>b(y.target.value)})})})]})}),t.jsx("div",{style:{padding:16,overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:h,children:t.jsx(p.Tree,{treeData:F,expandedKeys:x,selectedKeys:D,onSelect:U,onExpand:R,onDoubleClick:A,showLine:!0,showIcon:!1,selectable:!0,style:{overflow:"hidden"},titleRender:y=>{const k=y.meta;return t.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%",fontWeight:D.includes(y.key)?"bold":"normal"},children:[t.jsx("span",{children:k.deptNm}),t.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:k.deptCd})]})}})})})]}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:16,overflowY:"hidden",height:"100%"},children:[t.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:16,fontWeight:700},children:"선택된 부서"}),S?t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:14,border:"1px solid #e0e0e0",borderRadius:12,background:"#fafafa"},children:[t.jsx("div",{style:{width:42,height:42,borderRadius:"50%",border:"1px solid #e6e6e6",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:18,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:t.jsx(T.TeamOutlined,{})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{fontSize:15,fontWeight:700,marginBottom:4},children:[S.deptNm," ",t.jsxs("span",{style:{color:"#8c8c8c",fontSize:12},children:["(",S.deptCd,")"]})]}),t.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:2},children:["상위부서: ",S.hrnkDeptNm||"-"]})]}),t.jsx(p.Button,{type:"text",onClick:W,icon:t.jsx(T.RestOutlined,{style:{fontSize:24,color:"#FF6363"}})})]}):t.jsx("div",{style:{color:"#999",fontSize:14},children:"부서를 선택해주세요."})]})})]})})})})},_=o=>{if(o==null)return"";const c=String(o).trim();return!c||c.toUpperCase()==="NULL"?"":c.toUpperCase()},H=(o,c=0)=>{const b=Number(o);return Number.isFinite(b)?b:c};function Y(o){return{crprCd:o.crprCd||void 0,wkplCd:o.wkplCd||void 0,deptCd:_(o.deptCd),deptNm:(o.deptNm??"").toString().trim(),hrnkDeptCd:o.hrnkDeptCd||null,hrnkDeptNm:o.hrnkDeptNm||null,deptGbCd:o.deptGbCd||null,deptLvl:H(o.deptLvl,o.hrnkDeptCd?2:1),orgSortOrd:H(o.orgSortOrd,0),orgOtptOrd:H(o.orgOtptOrd,0),deptAbrv:o.deptAbrv||null,deptFullNm:o.deptFullNm||null,deptEnglNm:o.deptEnglNm||null,isLeaf:o.isLeaf||null}}function ee(o){const c=new Set,b=o.map(Y).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>c.has(l.deptCd)?!1:(c.add(l.deptCd),!0));b.sort((l,m)=>(l.deptLvl||0)-(m.deptLvl||0)||(l.orgSortOrd||0)-(m.orgSortOrd||0)||l.deptCd.localeCompare(m.deptCd));const x=new Map;for(const l of b)x.set(l.deptCd,{...l,children:[]});const v=[];for(const l of b){const m=x.get(l.deptCd),h=l.hrnkDeptCd;h&&x.has(h)?x.get(h).children.push(m):v.push(m)}const D=l=>{!l||l.length===0||(l.sort((m,h)=>m.deptCd.localeCompare(h.deptCd)),l.forEach(m=>D(m.children)))};D(v);const L=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(L)};if(v.forEach(L),v.length>1){const l=v.find(m=>m.deptCd==="D00");if(l)return[l]}return v}function te(o){const c=o.map(Y),b=c.filter(x=>x.isLeaf!=="Y").map(x=>x.deptCd);return b.length>200?c.filter(x=>(x.deptLvl||0)<=2).map(x=>x.deptCd):b}const ne=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState(""),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState([]),[E,M]=i.useState(!1),[S,I]=i.useState([]),[F,U]=i.useState(!1),R=i.useCallback(async e=>{try{U(!0);const n=await G.callService("SCMUTIL00103",{...o?.popupParams,...e}),r=Array.isArray(n?.data)?n.data:Array.isArray(n?.deptList)?n.deptList:Array.isArray(n)?n:[],d=ee(r);I(d);const a=te(r);L(a);const u=d[0]?.deptCd||Y(r.find(g=>Y(g).deptLvl===1)||{}).deptCd||Y(r[0]||{}).deptCd||"";m(u?[u]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{U(!1)}},[o?.popupParams]);i.useEffect(()=>{R()},[R]);const A=i.useCallback((e,n)=>{for(const r of e){if(r.deptCd===n)return r;if(r.children){const d=A(r.children,n);if(d)return d}}return null},[S]),W=i.useMemo(()=>h.map(e=>{const n=A(S,e);if(!n)return null;const{children:r,...d}=n;return d}).filter(Boolean),[h,S,A]),B=i.useMemo(()=>{const e=n=>n.map(r=>({title:r.deptNm,key:r.deptCd,meta:r,children:r.children?e(r.children):void 0,isLeaf:!r.children||r.children.length===0}));return e(S)},[S]),y=i.useMemo(()=>{const e=c.trim().toLowerCase();if(!e)return B;const n=r=>r.map(d=>{const a=d.meta,u=(a?.deptNm||"").toLowerCase().includes(e)||(a?.deptCd||"").toLowerCase().includes(e),g=d.children?n(d.children):void 0;return u||g&&g.length>0?{...d,children:g}:null}).filter(Boolean);return n(B)},[B,c]),k=i.useCallback(e=>{const n=[],r=d=>{for(const a of d)if(a.deptCd===e&&a.children){const u=g=>{for(const j of g)n.push(j.deptCd),j.children&&u(j.children)};u(a.children)}else a.children&&r(a.children)};return r(S),n},[S]),O=i.useCallback((e,n)=>{let r=Array.isArray(e)?e:e?.checked??[];if(E&&n?.node?.key){const d=n.node.key,a=k(d);if(n.checked){const u=new Set(r);for(const g of a)u.add(g);r=Array.from(u)}else{const u=new Set([d,...a]);r=r.filter(g=>!u.has(g))}}$(r)},[E,k]),w=i.useCallback(e=>{const n=e.map(String);if(m(n),n.length>0){const r=n[0],d=(u,g)=>{for(const j of u){if(j.deptCd===g)return j.deptNm;if(j.children){const K=d(j.children,g);if(K)return K}}return null},a=d(S,r);a&&v(a)}},[S]),P=i.useCallback(e=>L(e.map(String)),[]),s=i.useCallback((e,n)=>{if(e.stopPropagation(),n.children&&n.children.length>0){const r=D.includes(n.key);L(d=>r?d.filter(a=>a!==n.key):[...d,n.key])}},[D]),f=i.useCallback(e=>{$(n=>n.filter(r=>r!==e))},[]),C=i.useCallback(()=>{$([])},[]),N={confirm:()=>{if(h.length===0){p.message.error("부서를 선택해주세요.");return}const n=Array.from(new Set(h)).map(r=>{const d=A(S,r);return d?{deptCd:d.deptCd,deptNm:d.deptNm,hrnkDeptCd:d.hrnkDeptCd,hrnkDeptNm:d.hrnkDeptNm}:null}).filter(Boolean);o?.config?.callback?.(JSON.stringify(n)),o?.close?.()}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:N,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx("div",{style:{fontSize:14,color:"#666",padding:8,backgroundColor:"#f8f8f8",borderRadius:4},children:x}),t.jsxs(p.Row,{gutter:[16,16],children:[t.jsx(p.Col,{span:18,children:t.jsx(p.Input,{placeholder:"부서명, 부서장명, 부서코드 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:e=>b(e.target.value)})}),t.jsx(p.Col,{span:6,style:{justifyContent:"center",display:"flex",alignItems:"center"},children:t.jsx(p.Checkbox,{checked:E,onChange:e=>M(e.target.checked),children:"하위까지 선택"})})]})]})}),t.jsx("div",{style:{padding:16,overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:F,children:t.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:y,expandedKeys:D,selectedKeys:l,checkedKeys:h,checkable:!0,checkStrictly:!0,showLine:!0,showIcon:!1,selectable:!0,onSelect:w,onExpand:P,onCheck:O,onDoubleClick:s,style:{overflow:"hidden"},titleRender:e=>{const n=e.meta;return t.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%"},children:[t.jsx("span",{style:{fontWeight:l.includes(e.key)?"bold":"normal"},children:n.deptNm}),t.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:n.deptCd})]})}})})})]}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:16,overflowY:"hidden"},children:[t.jsxs("div",{style:{marginBottom:12,display:"flex",alignItems:"center",gap:8},children:[t.jsxs("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:["선택된 부서 (",W.length,"개)"]}),W.length>0&&t.jsx("button",{onClick:C,style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",fontSize:12,padding:4},title:"전체 해제",children:"전체 해제"})]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"flex-start",minHeight:48},children:W.length===0?t.jsx("div",{style:{color:"#999",fontSize:14},children:"선택된 부서가 없습니다."}):W.map(e=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:999,border:"1px solid #e6e6e6",background:"#fafafa",lineHeight:1.1,cursor:"default",maxWidth:260},title:`${e.deptNm}`,children:[t.jsx("span",{style:{width:18,height:18,borderRadius:"50%",border:"1px solid #e6e6e6",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:t.jsx(T.TeamOutlined,{})}),t.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:2,overflow:"hidden"},children:[t.jsx("span",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:e.deptNm}),t.jsx("span",{style:{fontSize:11,color:"#8c8c8c",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:e.deptCd})]}),t.jsx("button",{onClick:()=>f(e.deptCd),style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",padding:2,lineHeight:0},"aria-label":`${e.deptNm} 선택 해제`,title:"선택 해제",children:"×"})]},e.deptCd))})]})})]})})})})},re=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState(""),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState(null),[E,M]=i.useState([]),[S,I]=i.useState(!1),F=i.useCallback(async()=>{try{I(!0);const s=await G.callService("SCMUTIL00105",{...o?.popupParams});console.log("📊 조직도 API 응답:",s);const f=Array.isArray(s?.data)?s.data:Array.isArray(s?.orgnList)?s.orgnList:Array.isArray(s)?s:[];if(f.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const C=U(f);console.log("🌳 구성된 조직도 트리:",C),M(C);const N=f.filter(e=>e.deptLvl<=2).map(e=>e.deptCd);if(L(N),C.length>0){const e=C[0];m([e.deptCd]),v(e.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(s){console.error("❌ 조직도 데이터 로딩 실패:",s),p.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{I(!1)}},[o?.popupParams]),U=i.useCallback(s=>{const f=[...s].sort((n,r)=>n.deptLvl-r.deptLvl||n.orgSortOrd-r.orgSortOrd||n.deptCd.localeCompare(r.deptCd)),C=new Map;for(const n of f)C.set(n.deptCd,{...n,children:[]});const N=[];for(const n of f){const r=C.get(n.deptCd),d=n.hrnkDeptCd;d&&C.has(d)?C.get(d).children.push(r):N.push(r)}const e=n=>{if(!n.children||n.children.length===0){delete n.children;return}n.children.forEach(e)};return N.forEach(e),N},[]);i.useEffect(()=>{F()},[F]);const R=i.useMemo(()=>{const s=N=>{let e=[];return N.forEach(n=>{n.employees&&(e=e.concat(n.employees)),n.children&&(e=e.concat(s(n.children)))}),e},f=s(E),C=f.filter((N,e,n)=>e===n.findIndex(r=>r.empNo===N.empNo));return console.log(`👥 전체 사원 수: ${f.length}, 중복 제거 후: ${C.length}`),C},[E]),A=i.useMemo(()=>{const s=f=>f.map(C=>({title:C.deptNm,key:C.deptCd,children:C.children?s(C.children):void 0,isLeaf:!C.children||C.children.length===0}));return s(E)},[E]),W=i.useMemo(()=>{if(!c.trim())return A;const s=f=>f.map(C=>{const N=C.title.toLowerCase().includes(c.toLowerCase()),e=C.children?s(C.children):void 0;return N||e&&e.length>0?{...C,children:e}:null}).filter(Boolean);return s(A)},[A,c]),B=i.useMemo(()=>{if(!c.trim()){const s=n=>{let r=[];return n.forEach(d=>{d.employees&&(r=r.concat(d.employees)),d.children&&(r=r.concat(s(d.children)))}),r},f=(n,r)=>{for(const d of n){if(d.deptCd===r){let a=[...d.employees||[]];return d.children&&(a=a.concat(s(d.children))),a}if(d.children){const a=f(d.children,r);if(a.length>0)return a}}return[]},C=l[0];if(!C)return[];const N=f(E,C),e=N.filter((n,r,d)=>r===d.findIndex(a=>a.empNo===n.empNo));return console.log(`🔍 선택된 부서: ${C}, 반환된 사원 수: ${N.length}, 중복 제거 후: ${e.length}`),e}return R.filter(s=>s.empNm.toLowerCase().includes(c.toLowerCase())||s.empNo.toLowerCase().includes(c.toLowerCase())||s.deptNm.toLowerCase().includes(c.toLowerCase())||s.jbpsCd.includes(c)||s.jbgdCd.includes(c)||s.emplyStCd.includes(c))},[c,l,R,E]),y=i.useCallback(s=>{$(s)},[]),k=i.useCallback(s=>{const f=s.map(String);if(console.log(`🌳 트리 선택: ${f.join(", ")}`),m(f),f.length>0){const C=f[0],N=(n,r)=>{for(const d of n){if(d.deptCd===r)return d.deptNm;if(d.children){const a=N(d.children,r);if(a)return a}}return null},e=N(E,C);e&&v(e)}},[E]),O=i.useCallback(s=>{L(s.map(String))},[]),w=i.useCallback((s,f)=>{if(s.stopPropagation(),f.children&&f.children.length>0){const C=D.includes(f.key);L(C?N=>N.filter(e=>e!==f.key):N=>[...N,f.key])}},[D]),P={confirm:()=>{h?(o?.popupParams?.onSelect?o.popupParams.onSelect(h):o?.config?.callback&&o.config.callback(JSON.stringify(h,null,2)),o?.close?.()):p.message.error("사원을 선택해주세요.")}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:P,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:"6px"},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx(p.Input,{placeholder:"이름, 소속, 전화번호 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:s=>b(s.target.value)})]})}),t.jsx("div",{style:{padding:"16px",overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:S,children:t.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:W,expandedKeys:D,selectedKeys:l,onSelect:k,onExpand:O,onDoubleClick:w,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:s=>t.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontWeight:l.includes(s.key)?"bold":"normal",display:"inline-block",width:"100%"},children:s.title})})})})]}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:"16px",overflowY:"hidden"},children:[t.jsx("div",{style:{marginBottom:"16px"},children:t.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"bold"},children:c?"검색 결과":x})}),t.jsxs("div",{style:{overflow:"hidden",height:"100%"},children:[B.map(s=>t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:h&&h.crprCd===s.crprCd&&h.wkplCd===s.wkplCd&&h.empNo===s.empNo&&h.jbpsCd===s.jbpsCd&&h.jbgdCd===s.jbgdCd&&h.empMarkOrd===s.empMarkOrd?"#efebff":"white"},onClick:()=>y(s),children:[t.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px"},onClick:f=>{f.stopPropagation(),$(s)},children:h&&h.crprCd===s.crprCd&&h.wkplCd===s.wkplCd&&h.empNo===s.empNo&&h.jbpsCd===s.jbpsCd&&h.jbgdCd===s.jbgdCd&&h.empMarkOrd===s.empMarkOrd?t.jsx(T.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):t.jsx(T.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),t.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",fontSize:"18px",color:"#666"},children:t.jsx(T.UserOutlined,{})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px"},children:[s.empNm,t.jsxs("span",{style:{fontSize:"12px",fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",s.empNo,")"]})]}),t.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"2px"},children:[s.deptNm," (",s.deptCd,") | 직급:"," ",s.jbpsCd," | 등급: ",s.jbgdCd]})]})]},`emp-${s.crprCd}-${s.wkplCd}-${s.empNo}-${s.jbpsCd}-${s.jbgdCd}-${s.empMarkOrd}`)),B.length===0&&t.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:c?"검색 결과가 없습니다.":"해당 부서에 직원이 없습니다."})]})]})})]})})})})},le=({popup:o})=>{const[c,b]=i.useState(""),[x,v]=i.useState(""),[D,L]=i.useState([]),[l,m]=i.useState([]),[h,$]=i.useState([]),[E,M]=i.useState(!1),[S,I]=i.useState({}),F=i.useCallback(async()=>{try{M(!0);const e=await G.callService("SCMUTIL00105",{...o?.popupParams});console.log("📊 조직도 API 응답:",e);const n=Array.isArray(e?.data)?e.data:Array.isArray(e?.orgnList)?e.orgnList:Array.isArray(e)?e:[];if(n.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const r=U(n);console.log("🌳 구성된 조직도 트리:",r),$(r);const d=n.filter(a=>a.deptLvl<=2).map(a=>a.deptCd);if(L(d),r.length>0){const a=r[0];m([a.deptCd]),v(a.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(e){console.error("❌ 조직도 데이터 로딩 실패:",e),p.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{M(!1)}},[o?.popupParams]),U=i.useCallback(e=>{const n=[...e].sort((u,g)=>u.deptLvl-g.deptLvl||u.orgSortOrd-g.orgSortOrd||u.deptCd.localeCompare(g.deptCd)),r=new Map;for(const u of n)r.set(u.deptCd,{...u,children:[]});const d=[];for(const u of n){const g=r.get(u.deptCd),j=u.hrnkDeptCd;j&&r.has(j)?r.get(j).children.push(g):d.push(g)}const a=u=>{if(!u.children||u.children.length===0){delete u.children;return}u.children.forEach(a)};return d.forEach(a),d},[]);i.useEffect(()=>{F()},[F]);const R=i.useMemo(()=>{const e=d=>{let a=[];return d.forEach(u=>{u.employees&&(a=a.concat(u.employees)),u.children&&(a=a.concat(e(u.children)))}),a},n=e(h),r=n.filter((d,a,u)=>a===u.findIndex(g=>g.empNo===d.empNo));return console.log(`👥 전체 사원 수: ${n.length}, 중복 제거 후: ${r.length}`),r},[h]),A=i.useMemo(()=>{const e=n=>n.map(r=>({title:r.deptNm,key:r.deptCd,children:r.children?e(r.children):void 0,isLeaf:!r.children||r.children.length===0}));return e(h)},[h]),W=i.useMemo(()=>{if(!c.trim())return A;const e=n=>n.map(r=>{const d=r.title.toLowerCase().includes(c.toLowerCase()),a=r.children?e(r.children):void 0;return d||a&&a.length>0?{...r,children:a}:null}).filter(Boolean);return e(A)},[A,c]),B=i.useMemo(()=>{if(!c.trim()){const e=u=>{let g=[];return u.forEach(j=>{j.employees&&(g=g.concat(j.employees)),j.children&&(g=g.concat(e(j.children)))}),g},n=(u,g)=>{for(const j of u){if(j.deptCd===g){let K=[...j.employees||[]];return j.children&&(K=K.concat(e(j.children))),K}if(j.children){const K=n(j.children,g);if(K.length>0)return K}}return[]},r=l[0];if(!r)return[];const d=n(h,r),a=d.filter((u,g,j)=>g===j.findIndex(K=>K.empNo===u.empNo));return console.log(`🔍 선택된 부서: ${r}, 반환된 사원 수: ${d.length}, 중복 제거 후: ${a.length}`),a}return R.filter(e=>e.empNm.toLowerCase().includes(c.toLowerCase())||e.empNo.toLowerCase().includes(c.toLowerCase())||e.deptNm.toLowerCase().includes(c.toLowerCase())||e.jbpsCd.includes(c)||e.jbgdCd.includes(c)||e.emplyStCd.includes(c))},[c,l,R,h]),y=i.useCallback(e=>{I(n=>{const r={...n};return r[e.empNo]?delete r[e.empNo]:r[e.empNo]=e,r})},[]),k=i.useCallback(e=>{I(n=>{const r={...n};return delete r[e],r})},[]),O=i.useCallback(()=>I({}),[]),w=i.useCallback(()=>{I(e=>{const n={...e};for(const r of B)n[r.empNo]=r;return n})},[B]),P=i.useCallback(()=>{I(e=>{const n={...e};for(const r of B)delete n[r.empNo];return n})},[B]),s=i.useCallback(e=>{const n=e.map(String);if(console.log(`🌳 트리 선택: ${n.join(", ")}`),m(n),n.length>0){const r=n[0],d=(u,g)=>{for(const j of u){if(j.deptCd===g)return j.deptNm;if(j.children){const K=d(j.children,g);if(K)return K}}return null},a=d(h,r);a&&v(a)}},[h]),f=i.useCallback(e=>{L(e.map(String))},[]),C=i.useCallback((e,n)=>{if(e.stopPropagation(),!n.children||!n.children.length)return;const r=D.includes(n.key);L(d=>r?d.filter(a=>a!==n.key):[...d,n.key])},[D]),N={confirm:()=>{const e=Object.values(S).map(n=>({crprCd:n.crprCd,wkplCd:n.wkplCd,empNo:n.empNo,deptCd:n.deptCd,deptNm:n.deptNm,empNm:n.empNm,jbpsCd:n.jbpsCd,jbgdCd:n.jbgdCd,empMarkOrd:n.empMarkOrd,emplyStCd:n.emplyStCd}));if(e.length===0){p.message.error("직원을 선택해주세요.");return}o?.config?.callback?.(JSON.stringify(e)),o?.close?.()}};return t.jsx(z.BwgPopup,{popup:o,popupEvent:N,children:t.jsx(z.ContentLayOut,{children:t.jsx(z.ContentBox,{border:!1,style:{paddingBottom:20},children:t.jsxs(p.Splitter,{style:{height:"100%"},children:[t.jsx(p.Splitter.Panel,{defaultSize:"50%",min:"50%",max:"70%",children:t.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[t.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"35%",max:"75%",children:[t.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:t.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[t.jsx(z.BwgTitleBox,{title:"조직도"}),t.jsx(p.Input,{placeholder:"이름, 소속, 직급/직위, 사번 검색",prefix:t.jsx(T.SearchOutlined,{}),value:c,allowClear:!0,onChange:e=>b(e.target.value)})]})}),t.jsx("div",{style:{padding:16,overflowY:"hidden"},children:t.jsx(p.Spin,{spinning:E,children:t.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:W,expandedKeys:D,selectedKeys:l,onSelect:s,onExpand:f,onDoubleClick:C,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:e=>t.jsx("span",{style:{padding:"4px 8px",borderRadius:4,fontWeight:l.includes(e.key)?"bold":"normal",display:"inline-block",width:"100%"},children:e.title})})})})]}),t.jsx(p.Splitter.Panel,{children:t.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:c?"검색 결과":`${x} 사용자`}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx(p.Button,{size:"small",onClick:w,children:"현재 목록 전체 선택"}),t.jsx(p.Button,{size:"small",onClick:P,children:"현재 목록 전체 해제"})]})]}),t.jsx(p.Divider,{style:{margin:"8px 0"}}),t.jsxs("div",{style:{overflowY:"auto"},children:[B.map(e=>{const n=!!S[e.empNo];return t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,cursor:"pointer",background:n?"#efebff":"#fff"},onClick:()=>y(e),children:[t.jsx("div",{style:{marginRight:12,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center"},onClick:r=>{r.stopPropagation(),y(e)},children:n?t.jsx(T.CheckCircleFilled,{style:{fontSize:20,color:"#6449fc"}}):t.jsx(T.CheckCircleOutlined,{style:{fontSize:20,color:"#d9d9d9"}})}),t.jsx("div",{style:{width:36,height:36,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:16,color:"#666",flex:"0 0 auto"},children:t.jsx(T.UserOutlined,{})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{fontSize:14,fontWeight:600,marginBottom:2},children:[e.empNm,t.jsxs("span",{style:{fontSize:12,fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",e.empNo,")"]})]}),t.jsxs("div",{style:{fontSize:12,color:"#666"},children:[e.deptNm," (",e.deptCd,") | 직급: ",e.jbpsCd," ","| 등급: ",e.jbgdCd]})]})]},`emp-${e.crprCd}-${e.wkplCd}-${e.empNo}-${e.jbpsCd}-${e.jbgdCd}-${e.empMarkOrd}`)}),B.length===0&&t.jsx("div",{style:{textAlign:"center",padding:32,color:"#999",fontSize:14},children:c?"검색 결과가 없습니다.":"해당 부서에 사용자 없음"})]})]})})]})}),t.jsx(p.Splitter.Panel,{collapsible:!0,children:t.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx(z.BwgTitleBox,{title:`선택된 사용자 (${Object.keys(S).length})`}),t.jsx(p.Button,{type:"link",size:"small",onClick:O,children:"전체 해제"})]}),t.jsx(p.Divider,{style:{margin:"8px 0"}}),t.jsxs("div",{style:{overflowY:"auto",flex:1},children:[Object.values(S).map(e=>t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,background:"#fafafa"},children:[t.jsx("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:10,color:"#666"},children:t.jsx(T.UserOutlined,{})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{fontSize:13,fontWeight:600,marginBottom:2},children:[e.empNm,t.jsxs("span",{style:{fontSize:11,fontWeight:"normal",color:"#666",marginLeft:"6px"},children:["(",e.empNo,")"]})]}),t.jsxs("div",{style:{fontSize:12,color:"#666"},children:[e.deptNm," (",e.deptCd,") | 직급: ",e.jbpsCd," | 등급: ",e.jbgdCd]})]}),t.jsx(p.Button,{type:"text",shape:"circle",icon:t.jsx(T.CloseOutlined,{}),onClick:()=>k(e.empNo)})]},`selected-${e.crprCd}-${e.wkplCd}-${e.empNo}-${e.jbpsCd}-${e.jbgdCd}-${e.empMarkOrd}`)),Object.keys(S).length===0&&t.jsx("div",{style:{color:"#999",fontSize:14,textAlign:"center",padding:24},children:"선택된 사용자가 없습니다."})]})]})})]})})})})};exports.SearchDepartmentP01=Z;exports.SearchDepartmentP02=ne;exports.SearchOrganizationP01=re;exports.SearchOrganizationP02=le;
|
|
@@ -2,4 +2,8 @@ export { default as SearchDepartmentP01 } from './SearchDepartmentP01';
|
|
|
2
2
|
export { default as SearchDepartmentP02 } from './SearchDepartmentP02';
|
|
3
3
|
export { default as SearchOrganizationP01 } from './SearchOrganizationP01';
|
|
4
4
|
export { default as SearchOrganizationP02 } from './SearchOrganizationP02';
|
|
5
|
+
export type { Department, SearchDepartmentP01Props } from './SearchDepartmentP01';
|
|
6
|
+
export type { SearchDepartmentP02Props } from './SearchDepartmentP02';
|
|
7
|
+
export type { Employee, Department as OrgDepartment, SearchOrganizationP01Props } from './SearchOrganizationP01';
|
|
8
|
+
export type { SearchOrganizationP02Props } from './SearchOrganizationP02';
|
|
5
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAG3E,YAAY,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAClF,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,YAAY,EAAE,QAAQ,EAAE,UAAU,IAAI,aAAa,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACjH,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils/index.cjs"),t=require("./stores/index.cjs"),o=require("./chunks/common-components-Bhr_MU0K.cjs"),r=require("./components/core/index.cjs"),s=require("./components/layout/index.cjs"),i=require("./provider/index.cjs");exports.ApiError=e.ApiError;exports.THEME_COOKIE_NAME=e.THEME_COOKIE_NAME;exports.apiDelete=e.apiDelete;exports.apiGet=e.apiGet;exports.apiPatch=e.apiPatch;exports.apiPost=e.apiPost;exports.apiPut=e.apiPut;exports.apiUtils=e.apiUtils;exports.arrAverage=e.arrAverage;exports.arrCount=e.arrCount;exports.arrMax=e.arrMax;exports.arrMin=e.arrMin;exports.arrReverse=e.arrReverse;exports.arrSum=e.arrSum;exports.arrUnique=e.arrUnique;exports.bwgUtils=e.bwgUtils;exports.callService=e.callService;exports.callService_SYSCD=e.callService_SYSCD;exports.clamp=e.clamp;exports.clearSessionStorage=e.clearSessionStorage;exports.closeAllMessages=e.closeAllMessages;exports.closeMessage=e.closeMessage;exports.closeNotification=e.closeNotification;exports.commonUtils=e.commonUtils;exports.configureEnvUtils=e.configureEnvUtils;exports.copyToClipboard=e.copyToClipboard;exports.debounce=e.debounce;exports.deleteCookie=e.deleteCookie;exports.destroyNotifications=e.destroyNotifications;exports.downloadByFileKey=e.downloadByFileKey;exports.downloadFile=e.downloadFile;exports.duplicates=e.duplicates;exports.encryptSha256=e.encryptSha256;exports.envUtils=e.envUtils;exports.fileUtils=e.fileUtils;exports.generateRandomColor=e.generateRandomColor;exports.generateRandomString=e.generateRandomString;exports.generateUID=e.generateUID;exports.getAllServiceCodes=e.getAllServiceCodes;exports.getClientIp=e.getClientIp;exports.getCookie=e.getCookie;exports.getCrprCd=e.getCrprCd;exports.getCurrentDate=e.getCurrentDate;exports.getCurrentDateString=e.getCurrentDateString;exports.getDepartmentInfo=e.getDepartmentInfo;exports.getDeviceType=e.getDeviceType;exports.getDisplayName=e.getDisplayName;exports.getDprtCd=e.getDprtCd;exports.getDprtNm=e.getDprtNm;exports.getEmplNo=e.getEmplNo;exports.getEnvCode=e.getEnvCode;exports.getPermissionService=e.getPermissionService;exports.getRoleList=e.getRoleList;exports.getServiceCode=e.getServiceCode;exports.getSessionStorage=e.getSessionStorage;exports.getUserDvsn=e.getUserDvsn;exports.getUserId=e.getUserId;exports.getUserInfo=e.getUserInfo;exports.getUserNm=e.getUserNm;exports.hasAllRoles=e.hasAllRoles;exports.hasAnyRole=e.hasAnyRole;exports.hasRole=e.hasRole;exports.hasUserInfo=e.hasUserInfo;exports.isArray=e.isArray;exports.isBoolean=e.isBoolean;exports.isDesktop=e.isDesktop;exports.isDev=e.isDev;exports.isEmpty=e.isEmpty;exports.isEmptyArray=e.isEmptyArray;exports.isFunction=e.isFunction;exports.isLocal=e.isLocal;exports.isLoggedIn=e.isLoggedIn;exports.isMobile=e.isMobile;exports.isNull=e.isNull;exports.isNullOrUndefined=e.isNullOrUndefined;exports.isNumber=e.isNumber;exports.isObject=e.isObject;exports.isProd=e.isProd;exports.isSafeEmpty=e.isSafeEmpty;exports.isString=e.isString;exports.isTablet=e.isTablet;exports.isUndefined=e.isUndefined;exports.isValidEmail=e.isValidEmail;exports.isValidUrl=e.isValidUrl;exports.logServiceCodeConfig=e.logServiceCodeConfig;exports.messageUtils=e.messageUtils;exports.notiBwgError=e.notiBwgError;exports.notiError=e.notiError;exports.notiInfo=e.notiInfo;exports.notiSuccess=e.notiSuccess;exports.notiWarning=e.notiWarning;exports.notificationService=e.notificationService;exports.notificationUtils=e.notificationUtils;exports.padLeft=e.padLeft;exports.padRight=e.padRight;exports.random=e.random;exports.realFormat=e.realFormat;exports.removeSessionStorage=e.removeSessionStorage;exports.round=e.round;exports.serviceUtils=e.serviceUtils;exports.setClientIp=e.setClientIp;exports.setCookie=e.setCookie;exports.setServiceCodeOverrides=e.setServiceCodeOverrides;exports.setSessionStorage=e.setSessionStorage;exports.showApiError=e.showApiError;exports.showDuplicateError=e.showDuplicateError;exports.showError=e.showError;exports.showInfo=e.showInfo;exports.showLoading=e.showLoading;exports.showRequiredError=e.showRequiredError;exports.showSaveError=e.showSaveError;exports.showSaveSuccess=e.showSaveSuccess;exports.showSuccess=e.showSuccess;exports.showWarning=e.showWarning;exports.throttle=e.throttle;exports.toCamelCase=e.toCamelCase;exports.userUtils=e.userUtils;exports.verifyClientIp=e.verifyClientIp;exports.useCode=t.useCode;exports.useCodeStore=t.useCodeStore;exports.useColorStore=t.useColorStore;exports.useFavorite=t.useFavorite;exports.useFavoriteStore=t.useFavoriteStore;exports.useLoadingStore=t.useLoadingStore;exports.useMenuModel=t.useMenuModel;exports.useMenuModelStore=t.useMenuModelStore;exports.useMenuView=t.useMenuView;exports.useMenuViewStore=t.useMenuViewStore;exports.useOptionStore=t.useOptionStore;exports.usePopupLoadingStore=t.usePopupLoadingStore;exports.usePopupState=t.usePopupState;exports.usePopupStore=t.usePopupStore;exports.useUser=t.useUser;exports.useUserStore=t.useUserStore;exports.BwgButtonGroup=o.BwgButtonGroup;exports.BwgCmptArea=o.BwgCmptArea;exports.BwgCol=o.BwgCol;exports.BwgConfigProvider=o.BwgConfigProvider;exports.BwgDetail=o.BwgDetail;exports.BwgDrawer=o.BwgDrawer;exports.BwgEditor=o.BwgEditor;exports.BwgGrid=o.BwgGrid;exports.BwgInfoArea=o.BwgInfoArea;exports.BwgPagination=o.BwgPagination;exports.BwgPopup=o.BwgPopup;exports.BwgRow=o.BwgRow;exports.BwgSpace=o.BwgSpace;exports.BwgTable=o.BwgTable;exports.BwgTabs=o.BwgTabs;exports.BwgTitleBox=o.BwgTitleBox;exports.BwgView=o.BwgView;exports.ContentBox=o.ContentBox;exports.ContentLayOut=o.ContentLayOut;exports.GlobalConfigProvider=o.GlobalConfigProvider;exports.QuickServiceToggle=o.QuickServiceToggle;exports.SSOHandler=o.SSOHandler;exports.SearchBox=o.SearchBox;exports.createBwgGridRenderer=o.createBwgGridRenderer;exports.BwgButton=r.BwgButton;exports.BwgCheck=r.BwgCheck;exports.BwgCheckList=r.BwgCheckList;exports.BwgDatePicker=r.BwgDatePicker;exports.BwgDownload=r.BwgDownload;exports.BwgForm=r.BwgForm;exports.BwgFormItem=r.BwgFormItem;exports.BwgInput=r.BwgInput;exports.BwgLargeUploader=r.BwgLargeUploader;exports.BwgMaskedInput=r.BwgMaskedInput;exports.BwgMaskedPicker=r.BwgMaskedPicker;exports.BwgMultiSelect=r.BwgMultiSelect;exports.BwgNumber=r.BwgNumber;exports.BwgRadio=r.BwgRadio;exports.BwgRangePicker=r.BwgRangePicker;exports.BwgSearch=r.BwgSearch;exports.BwgSelect=r.BwgSelect;exports.BwgSwitch=r.BwgSwitch;exports.BwgTextArea=r.BwgTextArea;exports.BwgUploader=r.BwgUploader;exports.AppWrapper=s.AppWrapper;exports.BwgPortal01=s.BwgPortal01;exports.BwgPortal02=s.BwgPortal02;exports.ConfigurableContent=s.ConfigurableContent;exports.ConfigurableHeader=s.ConfigurableHeader;exports.ConfigurableMenuTab=s.ConfigurableMenuTab;exports.ConfigurableSidebar=s.ConfigurableSidebar;exports.ContentContainer=s.ContentContainer;exports.LandingContainer=s.LandingContainer;exports.LoadingContainer=s.LoadingContainer;exports.PopupContainer=s.PopupContainer;exports.ProtectWrapper=s.ProtectWrapper;exports.AuthProvider=i.AuthProvider;exports.CommonCodeProvider=i.CommonCodeProvider;exports.ScreenProtectProvider=i.ScreenProtectProvider;exports.SearchBoxProvider=i.SearchBoxProvider;exports.ServiceCodeProvider=i.ServiceCodeProvider;exports.useAllServiceCodes=i.useAllServiceCodes;exports.useAuth=i.useAuth;exports.useCodeColor=i.useCodeColor;exports.useCodeList=i.useCodeList;exports.useCodeListByOption=i.useCodeListByOption;exports.useCodeName=i.useCodeName;exports.useCommonCode=i.useCommonCode;exports.useGridLookup=i.useGridLookup;exports.useLock=i.useLock;exports.useLogServiceCodeConfig=i.useLogServiceCodeConfig;exports.usePopup=i.usePopup;exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils/index.cjs"),t=require("./stores/index.cjs"),o=require("./chunks/common-components-Bhr_MU0K.cjs"),r=require("./components/core/index.cjs"),s=require("./components/layout/index.cjs"),i=require("./provider/index.cjs");exports.ApiError=e.ApiError;exports.THEME_COOKIE_NAME=e.THEME_COOKIE_NAME;exports.apiDelete=e.apiDelete;exports.apiGet=e.apiGet;exports.apiPatch=e.apiPatch;exports.apiPost=e.apiPost;exports.apiPut=e.apiPut;exports.apiUtils=e.apiUtils;exports.arrAverage=e.arrAverage;exports.arrCount=e.arrCount;exports.arrMax=e.arrMax;exports.arrMin=e.arrMin;exports.arrReverse=e.arrReverse;exports.arrSum=e.arrSum;exports.arrUnique=e.arrUnique;exports.bwgUtils=e.bwgUtils;exports.callService=e.callService;exports.callService_SYSCD=e.callService_SYSCD;exports.clamp=e.clamp;exports.clearSessionStorage=e.clearSessionStorage;exports.closeAllMessages=e.closeAllMessages;exports.closeMessage=e.closeMessage;exports.closeNotification=e.closeNotification;exports.commonUtils=e.commonUtils;exports.configureEnvUtils=e.configureEnvUtils;exports.copyToClipboard=e.copyToClipboard;exports.debounce=e.debounce;exports.deleteCookie=e.deleteCookie;exports.destroyNotifications=e.destroyNotifications;exports.downloadByFileKey=e.downloadByFileKey;exports.downloadFile=e.downloadFile;exports.duplicates=e.duplicates;exports.encryptSha256=e.encryptSha256;exports.envUtils=e.envUtils;exports.fileUtils=e.fileUtils;exports.generateRandomColor=e.generateRandomColor;exports.generateRandomString=e.generateRandomString;exports.generateUID=e.generateUID;exports.getAllServiceCodes=e.getAllServiceCodes;exports.getClientIp=e.getClientIp;exports.getCookie=e.getCookie;exports.getCrprCd=e.getCrprCd;exports.getCurrentDate=e.getCurrentDate;exports.getCurrentDateString=e.getCurrentDateString;exports.getDepartmentInfo=e.getDepartmentInfo;exports.getDeviceType=e.getDeviceType;exports.getDisplayName=e.getDisplayName;exports.getDprtCd=e.getDprtCd;exports.getDprtNm=e.getDprtNm;exports.getEmplNo=e.getEmplNo;exports.getEnvCode=e.getEnvCode;exports.getPermissionService=e.getPermissionService;exports.getRoleList=e.getRoleList;exports.getServiceCode=e.getServiceCode;exports.getSessionStorage=e.getSessionStorage;exports.getUserDvsn=e.getUserDvsn;exports.getUserId=e.getUserId;exports.getUserInfo=e.getUserInfo;exports.getUserNm=e.getUserNm;exports.hasAllRoles=e.hasAllRoles;exports.hasAnyRole=e.hasAnyRole;exports.hasRole=e.hasRole;exports.hasUserInfo=e.hasUserInfo;exports.isArray=e.isArray;exports.isBoolean=e.isBoolean;exports.isDesktop=e.isDesktop;exports.isDev=e.isDev;exports.isEmpty=e.isEmpty;exports.isEmptyArray=e.isEmptyArray;exports.isFunction=e.isFunction;exports.isLocal=e.isLocal;exports.isLoggedIn=e.isLoggedIn;exports.isMobile=e.isMobile;exports.isNull=e.isNull;exports.isNullOrUndefined=e.isNullOrUndefined;exports.isNumber=e.isNumber;exports.isObject=e.isObject;exports.isProd=e.isProd;exports.isSafeEmpty=e.isSafeEmpty;exports.isString=e.isString;exports.isTablet=e.isTablet;exports.isUndefined=e.isUndefined;exports.isValidEmail=e.isValidEmail;exports.isValidUrl=e.isValidUrl;exports.logServiceCodeConfig=e.logServiceCodeConfig;exports.messageUtils=e.messageUtils;exports.notiBwgError=e.notiBwgError;exports.notiError=e.notiError;exports.notiInfo=e.notiInfo;exports.notiSuccess=e.notiSuccess;exports.notiWarning=e.notiWarning;exports.notificationService=e.notificationService;exports.notificationUtils=e.notificationUtils;exports.padLeft=e.padLeft;exports.padRight=e.padRight;exports.random=e.random;exports.realFormat=e.realFormat;exports.removeSessionStorage=e.removeSessionStorage;exports.round=e.round;exports.serviceUtils=e.serviceUtils;exports.setClientIp=e.setClientIp;exports.setCookie=e.setCookie;exports.setServiceCodeOverrides=e.setServiceCodeOverrides;exports.setSessionStorage=e.setSessionStorage;exports.showApiError=e.showApiError;exports.showDuplicateError=e.showDuplicateError;exports.showError=e.showError;exports.showInfo=e.showInfo;exports.showLoading=e.showLoading;exports.showRequiredError=e.showRequiredError;exports.showSaveError=e.showSaveError;exports.showSaveSuccess=e.showSaveSuccess;exports.showSuccess=e.showSuccess;exports.showWarning=e.showWarning;exports.throttle=e.throttle;exports.toCamelCase=e.toCamelCase;exports.userUtils=e.userUtils;exports.verifyClientIp=e.verifyClientIp;exports.useCode=t.useCode;exports.useCodeStore=t.useCodeStore;exports.useColorStore=t.useColorStore;exports.useFavorite=t.useFavorite;exports.useFavoriteStore=t.useFavoriteStore;exports.useLoadingStore=t.useLoadingStore;exports.useMenuModel=t.useMenuModel;exports.useMenuModelStore=t.useMenuModelStore;exports.useMenuView=t.useMenuView;exports.useMenuViewStore=t.useMenuViewStore;exports.useOptionStore=t.useOptionStore;exports.usePopupLoadingStore=t.usePopupLoadingStore;exports.usePopupState=t.usePopupState;exports.usePopupStore=t.usePopupStore;exports.useUser=t.useUser;exports.useUserStore=t.useUserStore;exports.BwgButtonGroup=o.BwgButtonGroup;exports.BwgCmptArea=o.BwgCmptArea;exports.BwgCol=o.BwgCol;exports.BwgConfigProvider=o.BwgConfigProvider;exports.BwgDetail=o.BwgDetail;exports.BwgDrawer=o.BwgDrawer;exports.BwgEditor=o.BwgEditor;exports.BwgGrid=o.BwgGrid;exports.BwgInfoArea=o.BwgInfoArea;exports.BwgPagination=o.BwgPagination;exports.BwgPopup=o.BwgPopup;exports.BwgRow=o.BwgRow;exports.BwgSpace=o.BwgSpace;exports.BwgTable=o.BwgTable;exports.BwgTabs=o.BwgTabs;exports.BwgTitleBox=o.BwgTitleBox;exports.BwgView=o.BwgView;exports.ContentBox=o.ContentBox;exports.ContentLayOut=o.ContentLayOut;exports.GlobalConfigProvider=o.GlobalConfigProvider;exports.QuickServiceToggle=o.QuickServiceToggle;exports.SSOHandler=o.SSOHandler;exports.SearchBox=o.SearchBox;exports.createBwgGridRenderer=o.createBwgGridRenderer;exports.BwgButton=r.BwgButton;exports.BwgCheck=r.BwgCheck;exports.BwgCheckList=r.BwgCheckList;exports.BwgDatePicker=r.BwgDatePicker;exports.BwgDownload=r.BwgDownload;exports.BwgForm=r.BwgForm;exports.BwgFormItem=r.BwgFormItem;exports.BwgInput=r.BwgInput;exports.BwgLargeUploader=r.BwgLargeUploader;exports.BwgMaskedInput=r.BwgMaskedInput;exports.BwgMaskedPicker=r.BwgMaskedPicker;exports.BwgMultiSelect=r.BwgMultiSelect;exports.BwgNumber=r.BwgNumber;exports.BwgRadio=r.BwgRadio;exports.BwgRangePicker=r.BwgRangePicker;exports.BwgSearch=r.BwgSearch;exports.BwgSelect=r.BwgSelect;exports.BwgSwitch=r.BwgSwitch;exports.BwgTextArea=r.BwgTextArea;exports.BwgUploader=r.BwgUploader;exports.AppWrapper=s.AppWrapper;exports.BwgPortal01=s.BwgPortal01;exports.BwgPortal02=s.BwgPortal02;exports.ConfigurableContent=s.ConfigurableContent;exports.ConfigurableHeader=s.ConfigurableHeader;exports.ConfigurableMenuTab=s.ConfigurableMenuTab;exports.ConfigurableSidebar=s.ConfigurableSidebar;exports.ContentContainer=s.ContentContainer;exports.LandingContainer=s.LandingContainer;exports.LoadingContainer=s.LoadingContainer;exports.PopupContainer=s.PopupContainer;exports.ProtectWrapper=s.ProtectWrapper;exports.AuthProvider=i.AuthProvider;exports.CommonCodeProvider=i.CommonCodeProvider;exports.ScreenProtectProvider=i.ScreenProtectProvider;exports.SearchBoxProvider=i.SearchBoxProvider;exports.ServiceCodeProvider=i.ServiceCodeProvider;exports.useAllServiceCodes=i.useAllServiceCodes;exports.useAuth=i.useAuth;exports.useCodeColor=i.useCodeColor;exports.useCodeList=i.useCodeList;exports.useCodeListByOption=i.useCodeListByOption;exports.useCodeName=i.useCodeName;exports.useCommonCode=i.useCommonCode;exports.useGridLookup=i.useGridLookup;exports.useLock=i.useLock;exports.useLogServiceCodeConfig=i.useLogServiceCodeConfig;exports.usePopup=i.usePopup;exports.useSearchBox=i.useSearchBox;exports.useServiceCode=i.useServiceCode;exports.useServiceCodeValue=i.useServiceCodeValue;
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ApiError as r, THEME_COOKIE_NAME as
|
|
2
|
-
import { useCode as
|
|
1
|
+
import { ApiError as r, THEME_COOKIE_NAME as i, apiDelete as t, apiGet as s, apiPatch as a, apiPost as n, apiPut as g, apiUtils as l, arrAverage as u, arrCount as d, arrMax as p, arrMin as c, arrReverse as w, arrSum as C, arrUnique as S, bwgUtils as B, callService as m, callService_SYSCD as v, clamp as f, clearSessionStorage as h, closeAllMessages as P, closeMessage as U, closeNotification as E, commonUtils as b, configureEnvUtils as D, copyToClipboard as A, debounce as L, deleteCookie as M, destroyNotifications as y, downloadByFileKey as I, downloadFile as k, duplicates as x, encryptSha256 as R, envUtils as N, fileUtils as T, generateRandomColor as O, generateRandomString as F, generateUID as G, getAllServiceCodes as V, getClientIp as W, getCookie as q, getCrprCd as H, getCurrentDate as _, getCurrentDateString as j, getDepartmentInfo as K, getDeviceType as Q, getDisplayName as Y, getDprtCd as z, getDprtNm as J, getEmplNo as X, getEnvCode as Z, getPermissionService as $, getRoleList as ee, getServiceCode as oe, getSessionStorage as re, getUserDvsn as ie, getUserId as te, getUserInfo as se, getUserNm as ae, hasAllRoles as ne, hasAnyRole as ge, hasRole as le, hasUserInfo as ue, isArray as de, isBoolean as pe, isDesktop as ce, isDev as we, isEmpty as Ce, isEmptyArray as Se, isFunction as Be, isLocal as me, isLoggedIn as ve, isMobile as fe, isNull as he, isNullOrUndefined as Pe, isNumber as Ue, isObject as Ee, isProd as be, isSafeEmpty as De, isString as Ae, isTablet as Le, isUndefined as Me, isValidEmail as ye, isValidUrl as Ie, logServiceCodeConfig as ke, messageUtils as xe, notiBwgError as Re, notiError as Ne, notiInfo as Te, notiSuccess as Oe, notiWarning as Fe, notificationService as Ge, notificationUtils as Ve, padLeft as We, padRight as qe, random as He, realFormat as _e, removeSessionStorage as je, round as Ke, serviceUtils as Qe, setClientIp as Ye, setCookie as ze, setServiceCodeOverrides as Je, setSessionStorage as Xe, showApiError as Ze, showDuplicateError as $e, showError as eo, showInfo as oo, showLoading as ro, showRequiredError as io, showSaveError as to, showSaveSuccess as so, showSuccess as ao, showWarning as no, throttle as go, toCamelCase as lo, userUtils as uo, verifyClientIp as po } from "./utils/index.js";
|
|
2
|
+
import { useCode as wo, useCodeStore as Co, useColorStore as So, useFavorite as Bo, useFavoriteStore as mo, useLoadingStore as vo, useMenuModel as fo, useMenuModelStore as ho, useMenuView as Po, useMenuViewStore as Uo, useOptionStore as Eo, usePopupLoadingStore as bo, usePopupState as Do, usePopupStore as Ao, useUser as Lo, useUserStore as Mo } from "./stores/index.js";
|
|
3
3
|
import { h as Io, i as ko, j as xo, B as Ro, k as No, l as To, m as Oo, n as Fo, o as Go, p as Vo, b as Wo, q as qo, a as Ho, r as _o, s as jo, d as Ko, t as Qo, c as Yo, C as zo, G as Jo, Q as Xo, u as Zo, S as $o, v as er } from "./chunks/common-components-CnAjT_Gi.js";
|
|
4
|
-
import { BwgButton as rr, BwgCheck as
|
|
4
|
+
import { BwgButton as rr, BwgCheck as ir, BwgCheckList as tr, BwgDatePicker as sr, BwgDownload as ar, BwgForm as nr, BwgFormItem as gr, BwgInput as lr, BwgLargeUploader as ur, BwgMaskedInput as dr, BwgMaskedPicker as pr, BwgMultiSelect as cr, BwgNumber as wr, BwgRadio as Cr, BwgRangePicker as Sr, BwgSearch as Br, BwgSelect as mr, BwgSwitch as vr, BwgTextArea as fr, BwgUploader as hr } from "./components/core/index.js";
|
|
5
5
|
import { AppWrapper as Ur, BwgPortal01 as Er, BwgPortal02 as br, ConfigurableContent as Dr, ConfigurableHeader as Ar, ConfigurableMenuTab as Lr, ConfigurableSidebar as Mr, ContentContainer as yr, LandingContainer as Ir, LoadingContainer as kr, PopupContainer as xr, ProtectWrapper as Rr } from "./components/layout/index.js";
|
|
6
|
-
import { AuthProvider as Tr, CommonCodeProvider as Or, ScreenProtectProvider as Fr, SearchBoxProvider as Gr, ServiceCodeProvider as Vr, useAllServiceCodes as Wr, useAuth as qr, useCodeColor as Hr, useCodeList as _r, useCodeListByOption as jr, useCodeName as Kr, useCommonCode as Qr, useGridLookup as Yr, useLock as zr, useLogServiceCodeConfig as Jr, usePopup as Xr,
|
|
6
|
+
import { AuthProvider as Tr, CommonCodeProvider as Or, ScreenProtectProvider as Fr, SearchBoxProvider as Gr, ServiceCodeProvider as Vr, useAllServiceCodes as Wr, useAuth as qr, useCodeColor as Hr, useCodeList as _r, useCodeListByOption as jr, useCodeName as Kr, useCommonCode as Qr, useGridLookup as Yr, useLock as zr, useLogServiceCodeConfig as Jr, usePopup as Xr, useSearchBox as Zr, useServiceCode as $r, useServiceCodeValue as ei } from "./provider/index.js";
|
|
7
7
|
export {
|
|
8
8
|
r as ApiError,
|
|
9
9
|
Ur as AppWrapper,
|
|
10
10
|
Tr as AuthProvider,
|
|
11
11
|
rr as BwgButton,
|
|
12
12
|
Io as BwgButtonGroup,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
ir as BwgCheck,
|
|
14
|
+
tr as BwgCheckList,
|
|
15
15
|
ko as BwgCmptArea,
|
|
16
16
|
xo as BwgCol,
|
|
17
17
|
Ro as BwgConfigProvider,
|
|
@@ -29,12 +29,12 @@ export {
|
|
|
29
29
|
dr as BwgMaskedInput,
|
|
30
30
|
pr as BwgMaskedPicker,
|
|
31
31
|
cr as BwgMultiSelect,
|
|
32
|
-
|
|
32
|
+
wr as BwgNumber,
|
|
33
33
|
Vo as BwgPagination,
|
|
34
34
|
Wo as BwgPopup,
|
|
35
35
|
Er as BwgPortal01,
|
|
36
36
|
br as BwgPortal02,
|
|
37
|
-
|
|
37
|
+
Cr as BwgRadio,
|
|
38
38
|
Sr as BwgRangePicker,
|
|
39
39
|
qo as BwgRow,
|
|
40
40
|
Br as BwgSearch,
|
|
@@ -66,8 +66,8 @@ export {
|
|
|
66
66
|
$o as SearchBox,
|
|
67
67
|
Gr as SearchBoxProvider,
|
|
68
68
|
Vr as ServiceCodeProvider,
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
i as THEME_COOKIE_NAME,
|
|
70
|
+
t as apiDelete,
|
|
71
71
|
s as apiGet,
|
|
72
72
|
a as apiPatch,
|
|
73
73
|
n as apiPost,
|
|
@@ -77,8 +77,8 @@ export {
|
|
|
77
77
|
d as arrCount,
|
|
78
78
|
p as arrMax,
|
|
79
79
|
c as arrMin,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
w as arrReverse,
|
|
81
|
+
C as arrSum,
|
|
82
82
|
S as arrUnique,
|
|
83
83
|
B as bwgUtils,
|
|
84
84
|
m as callService,
|
|
@@ -121,8 +121,8 @@ export {
|
|
|
121
121
|
ee as getRoleList,
|
|
122
122
|
oe as getServiceCode,
|
|
123
123
|
re as getSessionStorage,
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
ie as getUserDvsn,
|
|
125
|
+
te as getUserId,
|
|
126
126
|
se as getUserInfo,
|
|
127
127
|
ae as getUserNm,
|
|
128
128
|
ne as hasAllRoles,
|
|
@@ -132,8 +132,8 @@ export {
|
|
|
132
132
|
de as isArray,
|
|
133
133
|
pe as isBoolean,
|
|
134
134
|
ce as isDesktop,
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
we as isDev,
|
|
136
|
+
Ce as isEmpty,
|
|
137
137
|
Se as isEmptyArray,
|
|
138
138
|
Be as isFunction,
|
|
139
139
|
me as isLocal,
|
|
@@ -175,8 +175,8 @@ export {
|
|
|
175
175
|
eo as showError,
|
|
176
176
|
oo as showInfo,
|
|
177
177
|
ro as showLoading,
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
io as showRequiredError,
|
|
179
|
+
to as showSaveError,
|
|
180
180
|
so as showSaveSuccess,
|
|
181
181
|
ao as showSuccess,
|
|
182
182
|
no as showWarning,
|
|
@@ -184,12 +184,12 @@ export {
|
|
|
184
184
|
lo as toCamelCase,
|
|
185
185
|
Wr as useAllServiceCodes,
|
|
186
186
|
qr as useAuth,
|
|
187
|
-
|
|
187
|
+
wo as useCode,
|
|
188
188
|
Hr as useCodeColor,
|
|
189
189
|
_r as useCodeList,
|
|
190
190
|
jr as useCodeListByOption,
|
|
191
191
|
Kr as useCodeName,
|
|
192
|
-
|
|
192
|
+
Co as useCodeStore,
|
|
193
193
|
So as useColorStore,
|
|
194
194
|
Qr as useCommonCode,
|
|
195
195
|
Bo as useFavorite,
|
|
@@ -204,13 +204,12 @@ export {
|
|
|
204
204
|
Uo as useMenuViewStore,
|
|
205
205
|
Eo as useOptionStore,
|
|
206
206
|
Xr as usePopup,
|
|
207
|
-
Zr as usePopupContext,
|
|
208
207
|
bo as usePopupLoadingStore,
|
|
209
208
|
Do as usePopupState,
|
|
210
209
|
Ao as usePopupStore,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
Zr as useSearchBox,
|
|
211
|
+
$r as useServiceCode,
|
|
212
|
+
ei as useServiceCodeValue,
|
|
214
213
|
Lo as useUser,
|
|
215
214
|
Mo as useUserStore,
|
|
216
215
|
uo as userUtils,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopup.d.ts","sourceRoot":"","sources":["../../../src/provider/hooks/usePopup.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE1E
|
|
1
|
+
{"version":3,"file":"usePopup.d.ts","sourceRoot":"","sources":["../../../src/provider/hooks/usePopup.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;2BAMC,MAAM,cAAc,GAAG,WAAW,WAAW;;CAmBlE,CAAC"}
|
package/dist/provider/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),O=require("../stores/index.cjs"),l=require("react/jsx-runtime"),M=require("antd"),U=require("../utils/index.cjs"),E={AUTH_BTNS:"SCMSIGN00202",AUTH_MENU:"SCMSIGN00201",SRCH_CODE:"SCMSIGN00301",SRCH_POPU:"SCMPOPU00101",AUTH_BMRK:"SCMBMRK00101"},B=n.createContext(null),_=({children:e,serviceCodes:t={}})=>{n.useEffect(()=>{U.setServiceCodeOverrides(t)},[t]);const s={serviceCodes:t,getServiceCode:r=>{if(t[r]&&t[r].trim()!=="")return console.log(`🔧 Provider 설정 사용: ${r} = ${t[r]}`),t[r];const c=E[r];return console.log(`🔧 기본값 사용: ${r} = ${c}`),c}};return l.jsx(B.Provider,{value:s,children:e})},y=()=>{const e=n.useContext(B);if(!e)throw new Error("useServiceCode must be used within a ServiceCodeProvider");return e},G=e=>{const{getServiceCode:t}=y();return t(e)},V=()=>{const{getServiceCode:e}=y(),t={};for(const o of Object.keys(E))t[o]=e(o);return t},$=()=>{const{getServiceCode:e}=y();console.log("🔧 bwg-core 서비스코드 설정:"),console.log("📋 Provider 설정 > 기본값 순서로 확인");for(const t of Object.keys(E)){const o=e(t);console.log(` ${t}: ${o}`)}},A=n.createContext(null),q=({children:e})=>{const t=n.useRef(null),C={searchBoxRef:t,getFormData:()=>t.current?.getFormData()||{},setFormData:a=>{t.current?.setFormData(a)},resetForm:()=>{t.current?.resetForm()},validateForm:async()=>await t.current?.validateForm()||{success:!1,error:null}};return l.jsx(A.Provider,{value:C,children:e})},H=()=>{const e=n.useContext(A);if(!e)throw new Error("useSearchBox must be used within a SearchBoxProvider");return e},I=n.createContext(null),W=()=>{const e=n.useContext(I);if(!e)throw new Error("useAuth must be used within AuthProvider");return e},z=({children:e})=>{const[t,o]=n.useState(!1),[s,r]=n.useState(!1),c=async i=>{const u=(await i.text()).trim().toLowerCase();try{const d=JSON.parse(u);if(typeof d=="object"&&d&&(d.ok===!0||d.success===!0))return!0}catch{}return!!["true","ok","1","y"].includes(u)},C=async i=>{r(!0);try{const u=await fetch("/serviceEndpoint/sso_check.jsp",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"token="+encodeURIComponent(i)}),d=u.ok&&await c(u);return o(d),d}catch{return!1}finally{r(!1)}},a=async i=>{r(!0);try{const u=await fetch("/serviceEndpoint/sso_reauth.jsp",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"pin="+encodeURIComponent(i)});return u.ok&&await c(u)?(o(!0),!0):!1}catch{return!1}finally{r(!1)}},m=()=>{o(!1)},h=n.useMemo(()=>({authed:t,busy:s,verifyWithToken:C,reauthWithPin:a,logout:m}),[t,s]);return l.jsx(I.Provider,{value:h,children:e})},F=n.createContext(void 0),J=({children:e})=>{const{codeData:t,isLoading:o,error:s,lastUpdated:r,getCodeList:c,getCodeListByOption:C,getCodeName:a,getCodeColor:m,getCodeByOption:h,getAvailableGroupCodes:i,getGridLookup:u,fetchCommonCodes:d}=O.useCodeStore(),k={codeData:t,isLoading:o,error:s,lastUpdated:r,getCodeList:c,getCodeListByOption:C,getCodeName:a,getCodeColor:m,getCodeByOption:h,getAvailableGroupCodes:i,getGridLookup:u,refreshCodes:d};return l.jsx(F.Provider,{value:k,children:e})},f=()=>{const e=n.useContext(F);if(e===void 0)throw new Error("useCommonCode must be used within a CommonCodeProvider");return e},Q=()=>{const{getCodeList:e,isLoading:t,error:o}=f();return{getCodeList:e,isLoading:t,error:o}},X=()=>{const{getCodeName:e,isLoading:t,error:o}=f();return{getCodeName:e,isLoading:t,error:o}},Y=()=>{const{getCodeColor:e,isLoading:t,error:o}=f();return{getCodeColor:e,isLoading:t,error:o}},Z=()=>{const{getCodeListByOption:e,isLoading:t,error:o}=f();return{getCodeListByOption:e,isLoading:t,error:o}},K=()=>{const{getGridLookup:e,isLoading:t,error:o}=f();return{getGridLookup:e,isLoading:t,error:o}},N=n.createContext(null),ee=()=>{const e=n.useContext(N);if(!e)throw new Error("useLock must be used within ScreenProtectProvider");return e},te=({children:e,idleMs:t=1e4,onUnlock:o,persistLocked:s=!0,storageKey:r="inactivityLocked",eventTarget:c,overlayScope:C="global",overlayId:a="lock-overlay-root",overlayPosition:m="fixed"})=>{const h=s&&typeof window<"u"&&window.localStorage.getItem(r)==="1",[i,u]=n.useState(h),[d,k]=n.useState(t),P=Number.isFinite(d)&&d>0,w=n.useRef(null),T=()=>{try{s&&window.localStorage.setItem(r,"1")}catch{}u(!0)},b=async v=>{if(!(o&&!await o(v))){try{s&&window.localStorage.removeItem(r)}catch{}u(!1),P&&L()}},R=()=>{try{s&&window.localStorage.setItem(r,"1")}catch{}u(!0)},L=()=>{P&&(w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{R()},d))};n.useEffect(()=>{if(!P)return;const v=()=>{i||L()},x={passive:!0},S=["pointermove","pointerdown","keydown","wheel","touchstart"],g=c??window;return S.forEach(p=>g.addEventListener(p,v,x)),L(),()=>{w.current&&window.clearTimeout(w.current),S.forEach(p=>g.removeEventListener(p,v))}},[d,i,c,P]),n.useEffect(()=>{if(!i)return;const v=p=>{const j=document.getElementById(a);j&&j.contains(p.target)||(p.stopPropagation(),p.preventDefault())},x={capture:!0},S=["pointerdown","pointerup","pointermove","click","wheel","keydown","keyup","touchstart","touchmove"],g=C==="scoped"?c??window:window;return S.forEach(p=>g.addEventListener(p,v,x)),()=>S.forEach(p=>g.removeEventListener(p,v,x))},[i,C,a,c]);const D=n.useMemo(()=>({locked:i,lock:T,unlock:b,setIdleMs:k}),[i]);return l.jsxs(N.Provider,{value:D,children:[l.jsx("div",{style:{width:"100%",height:"100%"},...i?{inert:""}:{},...i?{"aria-hidden":!0}:{},children:e}),i&&l.jsx(oe,{onUnlock:b,overlayId:a,overlayPosition:m})]})},oe=({onUnlock:e,overlayId:t="lock-overlay-root",overlayPosition:o="fixed"})=>{const[s]=n.useState(4),[r,c]=n.useState("");return l.jsx("div",{id:t,"aria-modal":"true",role:"dialog","aria-label":"Locked screen",style:{position:o,inset:0,background:"rgba(12, 14, 18, 0.85)",backdropFilter:"blur(4px)",display:"grid",placeItems:"center",zIndex:9999},children:l.jsxs("div",{className:"lockscreen-form",style:{width:420,maxWidth:"92vw"},children:[l.jsx("div",{className:"lock-icon-wrap",children:l.jsx("span",{className:"lock-icon-box"})}),l.jsx("h2",{children:"잠금됨"}),l.jsx("p",{children:"PIN 번호를 입력하세요"}),l.jsx("div",{className:"lock-ipt-wrap",style:{display:"flex",justifyContent:"center"},children:l.jsx(M.Input.OTP,{mask:"*",autoFocus:!0,length:s,value:r,onChange:C=>{const a=(C??"").replace(/\D/g,"").slice(0,s);c(a),a.length===s&&e(a)}})})]})})},re=()
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),O=require("../stores/index.cjs"),l=require("react/jsx-runtime"),M=require("antd"),U=require("../utils/index.cjs"),E={AUTH_BTNS:"SCMSIGN00202",AUTH_MENU:"SCMSIGN00201",SRCH_CODE:"SCMSIGN00301",SRCH_POPU:"SCMPOPU00101",AUTH_BMRK:"SCMBMRK00101"},B=n.createContext(null),_=({children:e,serviceCodes:t={}})=>{n.useEffect(()=>{U.setServiceCodeOverrides(t)},[t]);const s={serviceCodes:t,getServiceCode:r=>{if(t[r]&&t[r].trim()!=="")return console.log(`🔧 Provider 설정 사용: ${r} = ${t[r]}`),t[r];const c=E[r];return console.log(`🔧 기본값 사용: ${r} = ${c}`),c}};return l.jsx(B.Provider,{value:s,children:e})},y=()=>{const e=n.useContext(B);if(!e)throw new Error("useServiceCode must be used within a ServiceCodeProvider");return e},G=e=>{const{getServiceCode:t}=y();return t(e)},V=()=>{const{getServiceCode:e}=y(),t={};for(const o of Object.keys(E))t[o]=e(o);return t},$=()=>{const{getServiceCode:e}=y();console.log("🔧 bwg-core 서비스코드 설정:"),console.log("📋 Provider 설정 > 기본값 순서로 확인");for(const t of Object.keys(E)){const o=e(t);console.log(` ${t}: ${o}`)}},A=n.createContext(null),q=({children:e})=>{const t=n.useRef(null),C={searchBoxRef:t,getFormData:()=>t.current?.getFormData()||{},setFormData:a=>{t.current?.setFormData(a)},resetForm:()=>{t.current?.resetForm()},validateForm:async()=>await t.current?.validateForm()||{success:!1,error:null}};return l.jsx(A.Provider,{value:C,children:e})},H=()=>{const e=n.useContext(A);if(!e)throw new Error("useSearchBox must be used within a SearchBoxProvider");return e},I=n.createContext(null),W=()=>{const e=n.useContext(I);if(!e)throw new Error("useAuth must be used within AuthProvider");return e},z=({children:e})=>{const[t,o]=n.useState(!1),[s,r]=n.useState(!1),c=async i=>{const u=(await i.text()).trim().toLowerCase();try{const d=JSON.parse(u);if(typeof d=="object"&&d&&(d.ok===!0||d.success===!0))return!0}catch{}return!!["true","ok","1","y"].includes(u)},C=async i=>{r(!0);try{const u=await fetch("/serviceEndpoint/sso_check.jsp",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"token="+encodeURIComponent(i)}),d=u.ok&&await c(u);return o(d),d}catch{return!1}finally{r(!1)}},a=async i=>{r(!0);try{const u=await fetch("/serviceEndpoint/sso_reauth.jsp",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"pin="+encodeURIComponent(i)});return u.ok&&await c(u)?(o(!0),!0):!1}catch{return!1}finally{r(!1)}},m=()=>{o(!1)},h=n.useMemo(()=>({authed:t,busy:s,verifyWithToken:C,reauthWithPin:a,logout:m}),[t,s]);return l.jsx(I.Provider,{value:h,children:e})},F=n.createContext(void 0),J=({children:e})=>{const{codeData:t,isLoading:o,error:s,lastUpdated:r,getCodeList:c,getCodeListByOption:C,getCodeName:a,getCodeColor:m,getCodeByOption:h,getAvailableGroupCodes:i,getGridLookup:u,fetchCommonCodes:d}=O.useCodeStore(),k={codeData:t,isLoading:o,error:s,lastUpdated:r,getCodeList:c,getCodeListByOption:C,getCodeName:a,getCodeColor:m,getCodeByOption:h,getAvailableGroupCodes:i,getGridLookup:u,refreshCodes:d};return l.jsx(F.Provider,{value:k,children:e})},f=()=>{const e=n.useContext(F);if(e===void 0)throw new Error("useCommonCode must be used within a CommonCodeProvider");return e},Q=()=>{const{getCodeList:e,isLoading:t,error:o}=f();return{getCodeList:e,isLoading:t,error:o}},X=()=>{const{getCodeName:e,isLoading:t,error:o}=f();return{getCodeName:e,isLoading:t,error:o}},Y=()=>{const{getCodeColor:e,isLoading:t,error:o}=f();return{getCodeColor:e,isLoading:t,error:o}},Z=()=>{const{getCodeListByOption:e,isLoading:t,error:o}=f();return{getCodeListByOption:e,isLoading:t,error:o}},K=()=>{const{getGridLookup:e,isLoading:t,error:o}=f();return{getGridLookup:e,isLoading:t,error:o}},N=n.createContext(null),ee=()=>{const e=n.useContext(N);if(!e)throw new Error("useLock must be used within ScreenProtectProvider");return e},te=({children:e,idleMs:t=1e4,onUnlock:o,persistLocked:s=!0,storageKey:r="inactivityLocked",eventTarget:c,overlayScope:C="global",overlayId:a="lock-overlay-root",overlayPosition:m="fixed"})=>{const h=s&&typeof window<"u"&&window.localStorage.getItem(r)==="1",[i,u]=n.useState(h),[d,k]=n.useState(t),P=Number.isFinite(d)&&d>0,w=n.useRef(null),T=()=>{try{s&&window.localStorage.setItem(r,"1")}catch{}u(!0)},b=async v=>{if(!(o&&!await o(v))){try{s&&window.localStorage.removeItem(r)}catch{}u(!1),P&&L()}},R=()=>{try{s&&window.localStorage.setItem(r,"1")}catch{}u(!0)},L=()=>{P&&(w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{R()},d))};n.useEffect(()=>{if(!P)return;const v=()=>{i||L()},x={passive:!0},S=["pointermove","pointerdown","keydown","wheel","touchstart"],g=c??window;return S.forEach(p=>g.addEventListener(p,v,x)),L(),()=>{w.current&&window.clearTimeout(w.current),S.forEach(p=>g.removeEventListener(p,v))}},[d,i,c,P]),n.useEffect(()=>{if(!i)return;const v=p=>{const j=document.getElementById(a);j&&j.contains(p.target)||(p.stopPropagation(),p.preventDefault())},x={capture:!0},S=["pointerdown","pointerup","pointermove","click","wheel","keydown","keyup","touchstart","touchmove"],g=C==="scoped"?c??window:window;return S.forEach(p=>g.addEventListener(p,v,x)),()=>S.forEach(p=>g.removeEventListener(p,v,x))},[i,C,a,c]);const D=n.useMemo(()=>({locked:i,lock:T,unlock:b,setIdleMs:k}),[i]);return l.jsxs(N.Provider,{value:D,children:[l.jsx("div",{style:{width:"100%",height:"100%"},...i?{inert:""}:{},...i?{"aria-hidden":!0}:{},children:e}),i&&l.jsx(oe,{onUnlock:b,overlayId:a,overlayPosition:m})]})},oe=({onUnlock:e,overlayId:t="lock-overlay-root",overlayPosition:o="fixed"})=>{const[s]=n.useState(4),[r,c]=n.useState("");return l.jsx("div",{id:t,"aria-modal":"true",role:"dialog","aria-label":"Locked screen",style:{position:o,inset:0,background:"rgba(12, 14, 18, 0.85)",backdropFilter:"blur(4px)",display:"grid",placeItems:"center",zIndex:9999},children:l.jsxs("div",{className:"lockscreen-form",style:{width:420,maxWidth:"92vw"},children:[l.jsx("div",{className:"lock-icon-wrap",children:l.jsx("span",{className:"lock-icon-box"})}),l.jsx("h2",{children:"잠금됨"}),l.jsx("p",{children:"PIN 번호를 입력하세요"}),l.jsx("div",{className:"lock-ipt-wrap",style:{display:"flex",justifyContent:"center"},children:l.jsx(M.Input.OTP,{mask:"*",autoFocus:!0,length:s,value:r,onChange:C=>{const a=(C??"").replace(/\D/g,"").slice(0,s);c(a),a.length===s&&e(a)}})})]})})},re=()=>{const{popups:e,activePopupId:t,setActivePopup:o,closePopup:s,openPopup:r}=O.usePopupStore(),c=n.useCallback(async(C,a,m)=>{try{await r(C,a,m)}catch(h){throw console.error("팝업 열기 실패:",h),h}},[r]);return{popups:e,activePopupId:t,setActivePopup:o,closePopup:s,showPopup:c,isPopup:e.length>0}};exports.AuthProvider=z;exports.CommonCodeProvider=J;exports.ScreenProtectProvider=te;exports.SearchBoxProvider=q;exports.ServiceCodeProvider=_;exports.useAllServiceCodes=V;exports.useAuth=W;exports.useCodeColor=Y;exports.useCodeList=Q;exports.useCodeListByOption=Z;exports.useCodeName=X;exports.useCommonCode=f;exports.useGridLookup=K;exports.useLock=ee;exports.useLogServiceCodeConfig=$;exports.usePopup=re;exports.useSearchBox=H;exports.useServiceCode=y;exports.useServiceCodeValue=G;
|
package/dist/provider/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect as b, createContext as y, useContext as
|
|
1
|
+
import { useEffect as b, createContext as y, useContext as k, useRef as N, useState as w, useMemo as A, useCallback as $ } from "react";
|
|
2
2
|
import { useCodeStore as H, usePopupStore as W } from "../stores/index.js";
|
|
3
3
|
import { jsx as d, jsxs as T } from "react/jsx-runtime";
|
|
4
4
|
import { Input as z } from "antd";
|
|
@@ -35,7 +35,7 @@ const I = {
|
|
|
35
35
|
};
|
|
36
36
|
return /* @__PURE__ */ d(D.Provider, { value: n, children: e });
|
|
37
37
|
}, O = () => {
|
|
38
|
-
const e =
|
|
38
|
+
const e = k(D);
|
|
39
39
|
if (!e)
|
|
40
40
|
throw new Error("useServiceCode must be used within a ServiceCodeProvider");
|
|
41
41
|
return e;
|
|
@@ -58,8 +58,8 @@ const I = {
|
|
|
58
58
|
const t = N(null), l = {
|
|
59
59
|
searchBoxRef: t,
|
|
60
60
|
getFormData: () => t.current?.getFormData() || {},
|
|
61
|
-
setFormData: (
|
|
62
|
-
t.current?.setFormData(
|
|
61
|
+
setFormData: (a) => {
|
|
62
|
+
t.current?.setFormData(a);
|
|
63
63
|
},
|
|
64
64
|
resetForm: () => {
|
|
65
65
|
t.current?.resetForm();
|
|
@@ -71,20 +71,20 @@ const I = {
|
|
|
71
71
|
};
|
|
72
72
|
return /* @__PURE__ */ d(M.Provider, { value: l, children: e });
|
|
73
73
|
}, se = () => {
|
|
74
|
-
const e =
|
|
74
|
+
const e = k(M);
|
|
75
75
|
if (!e)
|
|
76
76
|
throw new Error("useSearchBox must be used within a SearchBoxProvider");
|
|
77
77
|
return e;
|
|
78
78
|
}, R = y(null), ce = () => {
|
|
79
|
-
const e =
|
|
79
|
+
const e = k(R);
|
|
80
80
|
if (!e) throw new Error("useAuth must be used within AuthProvider");
|
|
81
81
|
return e;
|
|
82
82
|
}, ie = ({ children: e }) => {
|
|
83
83
|
const [t, o] = w(!1), [n, r] = w(!1), s = async (c) => {
|
|
84
84
|
const i = (await c.text()).trim().toLowerCase();
|
|
85
85
|
try {
|
|
86
|
-
const
|
|
87
|
-
if (typeof
|
|
86
|
+
const u = JSON.parse(i);
|
|
87
|
+
if (typeof u == "object" && u && (u.ok === !0 || u.success === !0))
|
|
88
88
|
return !0;
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
@@ -96,14 +96,14 @@ const I = {
|
|
|
96
96
|
method: "POST",
|
|
97
97
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
98
98
|
body: "token=" + encodeURIComponent(c)
|
|
99
|
-
}),
|
|
100
|
-
return o(
|
|
99
|
+
}), u = i.ok && await s(i);
|
|
100
|
+
return o(u), u;
|
|
101
101
|
} catch {
|
|
102
102
|
return !1;
|
|
103
103
|
} finally {
|
|
104
104
|
r(!1);
|
|
105
105
|
}
|
|
106
|
-
},
|
|
106
|
+
}, a = async (c) => {
|
|
107
107
|
r(!0);
|
|
108
108
|
try {
|
|
109
109
|
const i = await fetch("/serviceEndpoint/sso_reauth.jsp", {
|
|
@@ -119,14 +119,14 @@ const I = {
|
|
|
119
119
|
}
|
|
120
120
|
}, f = () => {
|
|
121
121
|
o(!1);
|
|
122
|
-
},
|
|
123
|
-
() => ({ authed: t, busy: n, verifyWithToken: l, reauthWithPin:
|
|
122
|
+
}, p = A(
|
|
123
|
+
() => ({ authed: t, busy: n, verifyWithToken: l, reauthWithPin: a, logout: f }),
|
|
124
124
|
[t, n]
|
|
125
125
|
);
|
|
126
|
-
return /* @__PURE__ */ d(R.Provider, { value:
|
|
126
|
+
return /* @__PURE__ */ d(R.Provider, { value: p, children: e });
|
|
127
127
|
}, U = y(
|
|
128
128
|
void 0
|
|
129
|
-
),
|
|
129
|
+
), ae = ({
|
|
130
130
|
children: e
|
|
131
131
|
}) => {
|
|
132
132
|
const {
|
|
@@ -136,12 +136,12 @@ const I = {
|
|
|
136
136
|
lastUpdated: r,
|
|
137
137
|
getCodeList: s,
|
|
138
138
|
getCodeListByOption: l,
|
|
139
|
-
getCodeName:
|
|
139
|
+
getCodeName: a,
|
|
140
140
|
getCodeColor: f,
|
|
141
|
-
getCodeByOption:
|
|
141
|
+
getCodeByOption: p,
|
|
142
142
|
getAvailableGroupCodes: c,
|
|
143
143
|
getGridLookup: i,
|
|
144
|
-
fetchCommonCodes:
|
|
144
|
+
fetchCommonCodes: u
|
|
145
145
|
} = H(), L = {
|
|
146
146
|
codeData: t,
|
|
147
147
|
isLoading: o,
|
|
@@ -149,56 +149,56 @@ const I = {
|
|
|
149
149
|
lastUpdated: r,
|
|
150
150
|
getCodeList: s,
|
|
151
151
|
getCodeListByOption: l,
|
|
152
|
-
getCodeName:
|
|
152
|
+
getCodeName: a,
|
|
153
153
|
getCodeColor: f,
|
|
154
|
-
getCodeByOption:
|
|
154
|
+
getCodeByOption: p,
|
|
155
155
|
getAvailableGroupCodes: c,
|
|
156
156
|
getGridLookup: i,
|
|
157
|
-
refreshCodes:
|
|
157
|
+
refreshCodes: u
|
|
158
158
|
};
|
|
159
159
|
return /* @__PURE__ */ d(U.Provider, { value: L, children: e });
|
|
160
|
-
},
|
|
161
|
-
const e =
|
|
160
|
+
}, P = () => {
|
|
161
|
+
const e = k(U);
|
|
162
162
|
if (e === void 0)
|
|
163
163
|
throw new Error("useCommonCode must be used within a CommonCodeProvider");
|
|
164
164
|
return e;
|
|
165
|
-
},
|
|
166
|
-
const { getCodeList: e, isLoading: t, error: o } =
|
|
165
|
+
}, ue = () => {
|
|
166
|
+
const { getCodeList: e, isLoading: t, error: o } = P();
|
|
167
167
|
return {
|
|
168
168
|
getCodeList: e,
|
|
169
169
|
isLoading: t,
|
|
170
170
|
error: o
|
|
171
171
|
};
|
|
172
172
|
}, de = () => {
|
|
173
|
-
const { getCodeName: e, isLoading: t, error: o } =
|
|
173
|
+
const { getCodeName: e, isLoading: t, error: o } = P();
|
|
174
174
|
return {
|
|
175
175
|
getCodeName: e,
|
|
176
176
|
isLoading: t,
|
|
177
177
|
error: o
|
|
178
178
|
};
|
|
179
179
|
}, le = () => {
|
|
180
|
-
const { getCodeColor: e, isLoading: t, error: o } =
|
|
180
|
+
const { getCodeColor: e, isLoading: t, error: o } = P();
|
|
181
181
|
return {
|
|
182
182
|
getCodeColor: e,
|
|
183
183
|
isLoading: t,
|
|
184
184
|
error: o
|
|
185
185
|
};
|
|
186
|
-
},
|
|
187
|
-
const { getCodeListByOption: e, isLoading: t, error: o } =
|
|
186
|
+
}, me = () => {
|
|
187
|
+
const { getCodeListByOption: e, isLoading: t, error: o } = P();
|
|
188
188
|
return {
|
|
189
189
|
getCodeListByOption: e,
|
|
190
190
|
isLoading: t,
|
|
191
191
|
error: o
|
|
192
192
|
};
|
|
193
|
-
},
|
|
194
|
-
const { getGridLookup: e, isLoading: t, error: o } =
|
|
193
|
+
}, pe = () => {
|
|
194
|
+
const { getGridLookup: e, isLoading: t, error: o } = P();
|
|
195
195
|
return {
|
|
196
196
|
getGridLookup: e,
|
|
197
197
|
isLoading: t,
|
|
198
198
|
error: o
|
|
199
199
|
};
|
|
200
200
|
}, j = y(null), fe = () => {
|
|
201
|
-
const e =
|
|
201
|
+
const e = k(j);
|
|
202
202
|
if (!e)
|
|
203
203
|
throw new Error("useLock must be used within ScreenProtectProvider");
|
|
204
204
|
return e;
|
|
@@ -210,10 +210,10 @@ const I = {
|
|
|
210
210
|
storageKey: r = "inactivityLocked",
|
|
211
211
|
eventTarget: s,
|
|
212
212
|
overlayScope: l = "global",
|
|
213
|
-
overlayId:
|
|
213
|
+
overlayId: a = "lock-overlay-root",
|
|
214
214
|
overlayPosition: f = "fixed"
|
|
215
215
|
}) => {
|
|
216
|
-
const
|
|
216
|
+
const p = n && typeof window < "u" && window.localStorage.getItem(r) === "1", [c, i] = w(p), [u, L] = w(t), x = Number.isFinite(u) && u > 0, v = N(null), _ = () => {
|
|
217
217
|
try {
|
|
218
218
|
n && window.localStorage.setItem(r, "1");
|
|
219
219
|
} catch {
|
|
@@ -234,30 +234,30 @@ const I = {
|
|
|
234
234
|
}
|
|
235
235
|
i(!0);
|
|
236
236
|
}, E = () => {
|
|
237
|
-
x && (
|
|
237
|
+
x && (v.current && window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
238
238
|
G();
|
|
239
|
-
},
|
|
239
|
+
}, u));
|
|
240
240
|
};
|
|
241
241
|
b(() => {
|
|
242
242
|
if (!x) return;
|
|
243
243
|
const h = () => {
|
|
244
244
|
c || E();
|
|
245
|
-
},
|
|
245
|
+
}, C = { passive: !0 }, g = [
|
|
246
246
|
"pointermove",
|
|
247
247
|
"pointerdown",
|
|
248
248
|
"keydown",
|
|
249
249
|
"wheel",
|
|
250
250
|
"touchstart"
|
|
251
251
|
], S = s ?? window;
|
|
252
|
-
return g.forEach((
|
|
253
|
-
|
|
252
|
+
return g.forEach((m) => S.addEventListener(m, h, C)), E(), () => {
|
|
253
|
+
v.current && window.clearTimeout(v.current), g.forEach((m) => S.removeEventListener(m, h));
|
|
254
254
|
};
|
|
255
|
-
}, [
|
|
255
|
+
}, [u, c, s, x]), b(() => {
|
|
256
256
|
if (!c) return;
|
|
257
|
-
const h = (
|
|
258
|
-
const B = document.getElementById(
|
|
259
|
-
B && B.contains(
|
|
260
|
-
},
|
|
257
|
+
const h = (m) => {
|
|
258
|
+
const B = document.getElementById(a);
|
|
259
|
+
B && B.contains(m.target) || (m.stopPropagation(), m.preventDefault());
|
|
260
|
+
}, C = { capture: !0 }, g = [
|
|
261
261
|
"pointerdown",
|
|
262
262
|
"pointerup",
|
|
263
263
|
"pointermove",
|
|
@@ -268,8 +268,8 @@ const I = {
|
|
|
268
268
|
"touchstart",
|
|
269
269
|
"touchmove"
|
|
270
270
|
], S = l === "scoped" ? s ?? window : window;
|
|
271
|
-
return g.forEach((
|
|
272
|
-
}, [c, l,
|
|
271
|
+
return g.forEach((m) => S.addEventListener(m, h, C)), () => g.forEach((m) => S.removeEventListener(m, h, C));
|
|
272
|
+
}, [c, l, a, s]);
|
|
273
273
|
const V = A(
|
|
274
274
|
() => ({ locked: c, lock: _, unlock: F, setIdleMs: L }),
|
|
275
275
|
[c]
|
|
@@ -288,7 +288,7 @@ const I = {
|
|
|
288
288
|
q,
|
|
289
289
|
{
|
|
290
290
|
onUnlock: F,
|
|
291
|
-
overlayId:
|
|
291
|
+
overlayId: a,
|
|
292
292
|
overlayPosition: f
|
|
293
293
|
}
|
|
294
294
|
)
|
|
@@ -332,8 +332,8 @@ const I = {
|
|
|
332
332
|
length: n,
|
|
333
333
|
value: r,
|
|
334
334
|
onChange: (l) => {
|
|
335
|
-
const
|
|
336
|
-
s(
|
|
335
|
+
const a = (l ?? "").replace(/\D/g, "").slice(0, n);
|
|
336
|
+
s(a), a.length === n && e(a);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
)
|
|
@@ -342,13 +342,13 @@ const I = {
|
|
|
342
342
|
] })
|
|
343
343
|
}
|
|
344
344
|
);
|
|
345
|
-
}, we = () =>
|
|
345
|
+
}, we = () => {
|
|
346
346
|
const { popups: e, activePopupId: t, setActivePopup: o, closePopup: n, openPopup: r } = W(), s = $(
|
|
347
|
-
async (l,
|
|
347
|
+
async (l, a, f) => {
|
|
348
348
|
try {
|
|
349
|
-
await r(l,
|
|
350
|
-
} catch (
|
|
351
|
-
throw console.error("팝업 열기 실패:",
|
|
349
|
+
await r(l, a, f);
|
|
350
|
+
} catch (p) {
|
|
351
|
+
throw console.error("팝업 열기 실패:", p), p;
|
|
352
352
|
}
|
|
353
353
|
},
|
|
354
354
|
[r]
|
|
@@ -364,22 +364,21 @@ const I = {
|
|
|
364
364
|
};
|
|
365
365
|
export {
|
|
366
366
|
ie as AuthProvider,
|
|
367
|
-
|
|
367
|
+
ae as CommonCodeProvider,
|
|
368
368
|
he as ScreenProtectProvider,
|
|
369
369
|
ne as SearchBoxProvider,
|
|
370
370
|
ee as ServiceCodeProvider,
|
|
371
371
|
oe as useAllServiceCodes,
|
|
372
372
|
ce as useAuth,
|
|
373
373
|
le as useCodeColor,
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
ue as useCodeList,
|
|
375
|
+
me as useCodeListByOption,
|
|
376
376
|
de as useCodeName,
|
|
377
|
-
|
|
378
|
-
|
|
377
|
+
P as useCommonCode,
|
|
378
|
+
pe as useGridLookup,
|
|
379
379
|
fe as useLock,
|
|
380
380
|
re as useLogServiceCodeConfig,
|
|
381
|
-
|
|
382
|
-
we as usePopupContext,
|
|
381
|
+
we as usePopup,
|
|
383
382
|
se as useSearchBox,
|
|
384
383
|
O as useServiceCode,
|
|
385
384
|
te as useServiceCodeValue
|