@bwg-ui/core 1.3.9 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,118 +1,118 @@
1
- import { jsx as t, jsxs as T, Fragment as _e } from "react/jsx-runtime";
2
- import { Button as J, Form as D, Checkbox as ue, ConfigProvider as ie, DatePicker as ce, message as x, Card as Ve, List as ne, Input as X, Spin as Ee, Upload as ee, Typography as fe, Flex as ye, Progress as Ue, notification as ze, Tooltip as Re, Select as he, Space as j, InputNumber as Pe, Radio as $e, Switch as He, Popover as Fe } from "antd";
3
- import { useMemo as q, memo as We, useState as z, useEffect as G, forwardRef as je, useRef as K, useCallback as Q, cloneElement as Ge } from "react";
4
- import { useUserStore as Xe, usePopupStore as Ke } from "../../stores/index.js";
1
+ import { jsx as e, jsxs as O, Fragment as $e } from "react/jsx-runtime";
2
+ import { Button as ee, Form as x, Checkbox as he, ConfigProvider as de, DatePicker as ue, message as w, Card as xe, List as le, Input as K, Spin as ye, Upload as Q, Typography as fe, Flex as Ie, Progress as Ge, notification as We, Tooltip as He, Select as Ce, Space as $, InputNumber as je, Radio as Xe, Switch as Ke, Popover as ie } from "antd";
3
+ import { useMemo as q, memo as qe, useState as P, useEffect as X, forwardRef as Je, useRef as J, useCallback as te, cloneElement as Ze } from "react";
4
+ import { useUserStore as Qe, usePopupStore as et } from "../../stores/index.js";
5
5
  import N from "dayjs";
6
- import { PaperClipOutlined as qe, DownloadOutlined as Je, DeleteOutlined as Ze, InboxOutlined as De, UploadOutlined as ae, CloudUploadOutlined as Qe, CheckCircleOutlined as et, CloseCircleOutlined as tt, FileTextOutlined as nt, CalendarOutlined as me, ExclamationCircleOutlined as Ie, SearchOutlined as ge, PlayCircleOutlined as rt, RedoOutlined as ot, ExclamationCircleFilled as at, FilePdfTwoTone as lt, FileWordTwoTone as st, FileExcelTwoTone as it, FilePptTwoTone as ct, FileTwoTone as dt, LinkOutlined as ut, FileOutlined as mt } from "@ant-design/icons";
7
- import { getApiDeps as Ce, callServiceByAppCd as ft, getCrprCd as Ne, callService as te, getUserInfo as ve } from "../../utils/index.js";
8
- import ht from "jszip";
9
- import se from "imask";
10
- import { d as xe, e as Le, h as Ae } from "../../chunks/provider-ff4RVDYo.js";
11
- import { findIndex as de } from "lodash";
12
- import { useDrop as gt, useDrag as pt, DndProvider as Me } from "react-dnd";
13
- import { HTML5Backend as Oe } from "react-dnd-html5-backend";
14
- import yt from "antd/es/upload/Dragger";
15
- const oe = (e) => {
16
- const { componentSize: r } = Xe(), u = q(() => e.size ? e.size : {
6
+ import { PaperClipOutlined as tt, DownloadOutlined as nt, DeleteOutlined as rt, InboxOutlined as Ve, UploadOutlined as re, CloudUploadOutlined as ot, CheckCircleOutlined as lt, CloseCircleOutlined as at, FileTextOutlined as st, CalendarOutlined as pe, ExclamationCircleOutlined as Ae, SearchOutlined as Fe, FilePdfTwoTone as it, FileWordTwoTone as ct, FileExcelTwoTone as dt, FilePptTwoTone as ut, FileTwoTone as ft, LinkOutlined as mt, FileOutlined as ht, PlayCircleOutlined as ve, RedoOutlined as ge, ExclamationCircleFilled as Oe } from "@ant-design/icons";
7
+ import { getApiDeps as ke, callServiceByAppCd as pt, getCrprCd as Ee, callService as oe, getUserInfo as Me } from "../../utils/index.js";
8
+ import gt from "jszip";
9
+ import ce from "imask";
10
+ import { d as Te, e as Ue, h as Be } from "../../chunks/provider-ff4RVDYo.js";
11
+ import { findIndex as me } from "lodash";
12
+ import { useDrop as yt, useDrag as Ct, DndProvider as Pe } from "react-dnd";
13
+ import { HTML5Backend as _e } from "react-dnd-html5-backend";
14
+ import Ft from "antd/es/upload/Dragger";
15
+ const Z = (t) => {
16
+ const { componentSize: n } = Qe(), u = q(() => t.size ? t.size : {
17
17
  0: "small",
18
18
  1: "middle",
19
19
  2: "large"
20
- }[r], [r, e.size]), l = q(() => ({
20
+ }[n], [n, t.size]), a = q(() => ({
21
21
  0: 12,
22
22
  // 작게
23
23
  1: 14,
24
24
  // 보통
25
25
  2: 16
26
26
  // 크게
27
- })[r], [r]);
28
- return /* @__PURE__ */ t(
29
- J,
27
+ })[n], [n]);
28
+ return /* @__PURE__ */ e(
29
+ ee,
30
30
  {
31
- ...e,
31
+ ...t,
32
32
  size: u,
33
33
  className: "bwg-btn",
34
- style: { fontSize: `${l}px`, ...e.style },
35
- children: e.children
34
+ style: { fontSize: `${a}px`, ...t.style },
35
+ children: t.children
36
36
  }
37
37
  );
38
- }, R = We(
38
+ }, G = qe(
39
39
  ({
40
- children: e,
41
- label: r,
40
+ children: t,
41
+ label: n,
42
42
  name: u,
43
- rules: l,
44
- initialValue: n,
43
+ rules: a,
44
+ initialValue: r,
45
45
  style: o,
46
- required: d,
47
- ...i
46
+ required: i,
47
+ ...c
48
48
  }) => {
49
- const f = {
49
+ const h = {
50
50
  fontWeight: "bold"
51
51
  };
52
- (l == null || l == null) && d && (l = [
52
+ (a == null || a == null) && i && (a = [
53
53
  {
54
54
  required: !0,
55
- message: `${r}을(를) 입력해주세요.`
55
+ message: `${n}을(를) 입력해주세요.`
56
56
  }
57
57
  ]);
58
- const s = Array.isArray(l) && l.some((y) => y.required === !0), c = () => typeof r == "string" ? /* @__PURE__ */ T("span", { style: f, children: [
59
- r,
60
- s && /* @__PURE__ */ t("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
61
- ] }) : /* @__PURE__ */ t("span", { style: f, children: r });
62
- return /* @__PURE__ */ t(
63
- D.Item,
58
+ const s = Array.isArray(a) && a.some((y) => y.required === !0), d = () => typeof n == "string" ? /* @__PURE__ */ O("span", { style: h, children: [
59
+ n,
60
+ s && /* @__PURE__ */ e("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
61
+ ] }) : /* @__PURE__ */ e("span", { style: h, children: n });
62
+ return /* @__PURE__ */ e(
63
+ x.Item,
64
64
  {
65
65
  className: "bwg-form-item",
66
- label: r ? c() : void 0,
67
- labelAlign: i.labelAlign || "left",
66
+ label: n ? d() : void 0,
67
+ labelAlign: c.labelAlign || "left",
68
68
  name: u,
69
- rules: l,
69
+ rules: a,
70
70
  colon: !1,
71
- initialValue: n,
71
+ initialValue: r,
72
72
  style: o,
73
- ...i,
74
- children: e
73
+ ...c,
74
+ children: t
75
75
  }
76
76
  );
77
77
  }
78
- ), jt = ({
79
- itemProps: e,
80
- inputProps: r = {
78
+ ), Kt = ({
79
+ itemProps: t,
80
+ inputProps: n = {
81
81
  format: "YN"
82
82
  }
83
83
  }) => {
84
- const u = D.useFormInstance();
85
- return /* @__PURE__ */ t(
86
- R,
84
+ const u = x.useFormInstance();
85
+ return /* @__PURE__ */ e(
86
+ G,
87
87
  {
88
- ...e,
89
- getValueProps: (n) => ({ checked: r.format === "boolean" ? !!n : n === "Y" }),
90
- normalize: (n) => typeof n == "boolean" ? r.format === "boolean" ? n : n ? "Y" : "N" : r.format === "boolean" ? !!n : n ? "Y" : "N",
91
- children: /* @__PURE__ */ t(ue, { ...r, onChange: (n) => {
92
- r.format === "boolean" ? u.setFieldValue(e?.name, n.target.checked) : u.setFieldValue(e?.name, n.target.checked ? "Y" : "N"), r.onChange && r.onChange(n);
93
- }, children: r?.title })
88
+ ...t,
89
+ getValueProps: (r) => ({ checked: n.format === "boolean" ? !!r : r === "Y" }),
90
+ normalize: (r) => typeof r == "boolean" ? n.format === "boolean" ? r : r ? "Y" : "N" : n.format === "boolean" ? !!r : r ? "Y" : "N",
91
+ children: /* @__PURE__ */ e(he, { ...n, onChange: (r) => {
92
+ n.format === "boolean" ? u.setFieldValue(t?.name, r.target.checked) : u.setFieldValue(t?.name, r.target.checked ? "Y" : "N"), n.onChange && n.onChange(r);
93
+ }, children: n?.title })
94
94
  }
95
95
  );
96
- }, Gt = ({ itemProps: e, inputProps: r }) => {
97
- const u = D.useFormInstance(), [l, n] = z(
98
- e?.initialValue ?? []
99
- ), [o, d] = z([]), i = o.length > 0 && o.length == l?.length, f = l?.length > 0 && l.length < o.length;
100
- G(() => {
101
- d(s(r?.options));
102
- }, [r?.options]), G(() => {
103
- n(l);
104
- }, [l]);
105
- const s = (g) => {
106
- const Y = [];
107
- return (g || []).map((C, O) => {
108
- Y.push(C.value);
109
- }), Y;
110
- }, c = (g) => {
111
- n(g.target.checked ? o : []), u.setFieldValue(e?.name, g.target.checked ? o : []);
112
- }, y = (g) => {
113
- n(g), u.setFieldValue(e?.name, g), r?.onChange && typeof r?.onChange == "function" && r?.onChange(g);
96
+ }, qt = ({ itemProps: t, inputProps: n }) => {
97
+ const u = x.useFormInstance(), [a, r] = P(
98
+ t?.initialValue ?? []
99
+ ), [o, i] = P([]), c = o.length > 0 && o.length == a?.length, h = a?.length > 0 && a.length < o.length;
100
+ X(() => {
101
+ i(s(n?.options));
102
+ }, [n?.options]), X(() => {
103
+ r(a);
104
+ }, [a]);
105
+ const s = (p) => {
106
+ const I = [];
107
+ return (p || []).map((C, T) => {
108
+ I.push(C.value);
109
+ }), I;
110
+ }, d = (p) => {
111
+ r(p.target.checked ? o : []), u.setFieldValue(t?.name, p.target.checked ? o : []);
112
+ }, y = (p) => {
113
+ r(p), u.setFieldValue(t?.name, p), n?.onChange && typeof n?.onChange == "function" && n?.onChange(p);
114
114
  };
115
- return /* @__PURE__ */ t(R, { ...e, children: /* @__PURE__ */ T(ie, { theme: {
115
+ return /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ O(de, { theme: {
116
116
  components: {
117
117
  Checkbox: {
118
118
  colorPrimary: "var(--check-primary)",
@@ -121,25 +121,25 @@ const oe = (e) => {
121
121
  }
122
122
  }
123
123
  }, children: [
124
- r?.allCheck && /* @__PURE__ */ t(
125
- ue,
124
+ n?.allCheck && /* @__PURE__ */ e(
125
+ he,
126
126
  {
127
- indeterminate: f,
128
- checked: i,
129
- onChange: c,
127
+ indeterminate: h,
128
+ checked: c,
129
+ onChange: d,
130
130
  children: "전체선택"
131
131
  }
132
132
  ),
133
- /* @__PURE__ */ t(
134
- ue.Group,
133
+ /* @__PURE__ */ e(
134
+ he.Group,
135
135
  {
136
- options: r?.options,
137
- value: l,
136
+ options: n?.options,
137
+ value: a,
138
138
  onChange: y
139
139
  }
140
140
  )
141
141
  ] }) });
142
- }, ke = {
142
+ }, we = {
143
143
  year: { displayFormat: "YYYY", outputFormat: "YYYY" },
144
144
  month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
145
145
  date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
@@ -148,105 +148,105 @@ const oe = (e) => {
148
148
  displayFormat: "YYYY-MM-DD HH:mm",
149
149
  outputFormat: "YYYYMMDDHHmm"
150
150
  }
151
- }, Xt = ({
152
- itemProps: e,
153
- inputProps: r,
151
+ }, Jt = ({
152
+ itemProps: t,
153
+ inputProps: n,
154
154
  type: u = "date",
155
- returnType: l = "string"
155
+ returnType: a = "string"
156
156
  }) => {
157
- const { displayFormat: n, outputFormat: o } = q(
158
- () => ke[u],
157
+ const { displayFormat: r, outputFormat: o } = q(
158
+ () => we[u],
159
159
  [u]
160
- ), d = q(
161
- () => Object.values(ke).map((i) => i.outputFormat).sort((i, f) => {
162
- if (i.length === f.length) {
163
- if (i === o) return -1;
164
- if (f === o) return 1;
160
+ ), i = q(
161
+ () => Object.values(we).map((c) => c.outputFormat).sort((c, h) => {
162
+ if (c.length === h.length) {
163
+ if (c === o) return -1;
164
+ if (h === o) return 1;
165
165
  }
166
- return f.length - i.length;
166
+ return h.length - c.length;
167
167
  }),
168
168
  [o]
169
169
  // type(outputFormat)이 바뀔 때마다 재정렬
170
170
  );
171
- return /* @__PURE__ */ t(
172
- R,
171
+ return /* @__PURE__ */ e(
172
+ G,
173
173
  {
174
- ...e,
175
- getValueProps: (i) => ({
174
+ ...t,
175
+ getValueProps: (c) => ({
176
176
  // 폼에 저장된 값(문자열 또는 Dayjs)을 DatePicker가 요구하는 Dayjs로 변환
177
- value: i ? N.isDayjs(i) ? i : N(i, d) : null
177
+ value: c ? N.isDayjs(c) ? c : N(c, i) : null
178
178
  }),
179
- normalize: (i) => i ? l === "dayjs" ? i : i.format(o) : null,
180
- children: /* @__PURE__ */ t(
181
- ce,
179
+ normalize: (c) => c ? a === "dayjs" ? c : c.format(o) : null,
180
+ children: /* @__PURE__ */ e(
181
+ ue,
182
182
  {
183
- ...r,
183
+ ...n,
184
184
  picker: u === "datetime" ? "date" : u,
185
- showTime: r?.showTime ?? (u === "datetime" || u === "time"),
186
- format: r?.format ?? n
185
+ showTime: n?.showTime ?? (u === "datetime" || u === "time"),
186
+ format: n?.format ?? r
187
187
  }
188
188
  )
189
189
  }
190
190
  );
191
- }, Kt = ({
192
- fileGrpKey: e,
193
- onFetchFilesTrxCd: r = "SCMFILE00101",
191
+ }, Zt = ({
192
+ fileGrpKey: t,
193
+ onFetchFilesTrxCd: n = "SCMFILE00101",
194
194
  readOnly: u = !1,
195
- appCd: l = __APP_CD__
195
+ appCd: a = __APP_CD__
196
196
  }) => {
197
- const [n, o] = z([]);
198
- G(() => {
199
- if (r)
200
- if (l != __APP_CD__) {
201
- const f = Ce().findSystemByAppCd?.(l ?? __APP_CD__);
202
- if (!f || !f.sysCd) {
203
- console.error("해당 앱코드는 존재하지 않습니다.", l);
197
+ const [r, o] = P([]);
198
+ X(() => {
199
+ if (n)
200
+ if (a != __APP_CD__) {
201
+ const h = ke().findSystemByAppCd?.(a ?? __APP_CD__);
202
+ if (!h || !h.sysCd) {
203
+ console.error("해당 앱코드는 존재하지 않습니다.", a);
204
204
  return;
205
205
  }
206
- ft(
207
- { trxCd: r, appCd: l },
206
+ pt(
207
+ { trxCd: n, appCd: a },
208
208
  {
209
- crprCd: Ne(),
210
- sysCd: f.sysCd,
211
- fileGrpKey: e
209
+ crprCd: Ee(),
210
+ sysCd: h.sysCd,
211
+ fileGrpKey: t
212
212
  }
213
213
  ).then((s) => {
214
214
  if (s?.sub) {
215
- const c = s.sub.map((y) => ({
215
+ const d = s.sub.map((y) => ({
216
216
  uid: y.fileKey,
217
217
  name: y.lgclFileNm,
218
218
  filePath: y.filePath
219
219
  }));
220
- o(c);
220
+ o(d);
221
221
  }
222
222
  }).catch((s) => {
223
- console.error("파일 목록 조회 서비스 호출에 실패했습니다.", s), x.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
223
+ console.error("파일 목록 조회 서비스 호출에 실패했습니다.", s), w.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
224
224
  });
225
225
  } else
226
- te(r, {
227
- crprCd: ve()?.crprCd,
226
+ oe(n, {
227
+ crprCd: Me()?.crprCd,
228
228
  sysCd: __SYS_CD__,
229
- fileGrpKey: e
230
- }).then((i) => {
231
- if (i?.sub) {
232
- const f = i.sub.map((s) => ({
229
+ fileGrpKey: t
230
+ }).then((c) => {
231
+ if (c?.sub) {
232
+ const h = c.sub.map((s) => ({
233
233
  uid: s.fileKey,
234
234
  name: s.lgclFileNm,
235
235
  filePath: s.filePath
236
236
  }));
237
- o(f);
237
+ o(h);
238
238
  }
239
- }).catch((i) => {
240
- console.error("파일 목록 조회 서비스 호출에 실패했습니다.", i), x.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
239
+ }).catch((c) => {
240
+ console.error("파일 목록 조회 서비스 호출에 실패했습니다.", c), w.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
241
241
  });
242
242
  else
243
243
  o([]);
244
- }, [e, r, l]);
245
- const d = async (i) => {
244
+ }, [t, n, a]);
245
+ const i = async (c) => {
246
246
  try {
247
- const s = Ce().findSystemByAppCd?.(l ?? __APP_CD__);
247
+ const s = ke().findSystemByAppCd?.(a ?? __APP_CD__);
248
248
  if (!s || !s.sysCd) {
249
- console.error("해당 앱코드는 존재하지 않습니다.", l);
249
+ console.error("해당 앱코드는 존재하지 않습니다.", a);
250
250
  return;
251
251
  }
252
252
  const y = await fetch("/api/download", {
@@ -257,49 +257,49 @@ const oe = (e) => {
257
257
  // 여기에 필요한 다른 헤더(예: 인증 토큰)를 추가할 수 있습니다.
258
258
  },
259
259
  body: JSON.stringify({
260
- filePath: i.filePath,
261
- logicalName: i.name,
262
- fileKey: i.uid
260
+ filePath: c.filePath,
261
+ logicalName: c.name,
262
+ fileKey: c.uid
263
263
  })
264
264
  });
265
265
  if (!y.ok) {
266
- const p = (await y.json().catch(() => null))?.message || "파일 다운로드에 실패했습니다.";
267
- throw new Error(p);
266
+ const g = (await y.json().catch(() => null))?.message || "파일 다운로드에 실패했습니다.";
267
+ throw new Error(g);
268
268
  }
269
- const g = await y.blob(), Y = window.URL.createObjectURL(g), C = document.createElement("a");
270
- C.href = Y, C.setAttribute("download", i.name), document.body.appendChild(C), C.click(), document.body.removeChild(C), window.URL.revokeObjectURL(Y);
271
- } catch (f) {
272
- console.error(f), x.error(
273
- f.message || "파일을 다운로드하는 중 오류가 발생했습니다."
269
+ const p = await y.blob(), I = window.URL.createObjectURL(p), C = document.createElement("a");
270
+ C.href = I, C.setAttribute("download", c.name), document.body.appendChild(C), C.click(), document.body.removeChild(C), window.URL.revokeObjectURL(I);
271
+ } catch (h) {
272
+ console.error(h), w.error(
273
+ h.message || "파일을 다운로드하는 중 오류가 발생했습니다."
274
274
  );
275
275
  }
276
276
  };
277
- return /* @__PURE__ */ t(Ve, { title: "파일 목록", children: /* @__PURE__ */ t(
278
- ne,
277
+ return /* @__PURE__ */ e(xe, { title: "파일 목록", children: /* @__PURE__ */ e(
278
+ le,
279
279
  {
280
- dataSource: n,
281
- renderItem: (i) => /* @__PURE__ */ t(
282
- ne.Item,
280
+ dataSource: r,
281
+ renderItem: (c) => /* @__PURE__ */ e(
282
+ le.Item,
283
283
  {
284
284
  actions: u ? [] : [
285
- /* @__PURE__ */ t(
286
- J,
285
+ /* @__PURE__ */ e(
286
+ ee,
287
287
  {
288
288
  type: "text",
289
- icon: /* @__PURE__ */ t(Je, {}),
290
- onClick: () => d(i)
289
+ icon: /* @__PURE__ */ e(nt, {}),
290
+ onClick: () => i(c)
291
291
  },
292
292
  "download"
293
293
  )
294
294
  ],
295
- children: /* @__PURE__ */ t(ne.Item.Meta, { avatar: /* @__PURE__ */ t(qe, {}), title: i.name })
295
+ children: /* @__PURE__ */ e(le.Item.Meta, { avatar: /* @__PURE__ */ e(tt, {}), title: c.name })
296
296
  }
297
297
  )
298
298
  }
299
299
  ) });
300
- }, Ft = je(
301
- ({ children: e, labelCol: r, style: u, className: l, ...n }, o) => /* @__PURE__ */ t(
302
- ie,
300
+ }, Et = Je(
301
+ ({ children: t, labelCol: n, style: u, className: a, ...r }, o) => /* @__PURE__ */ e(
302
+ de,
303
303
  {
304
304
  form: {
305
305
  /**
@@ -308,23 +308,23 @@ const oe = (e) => {
308
308
  */
309
309
  // validateMessages: { required: "'${label}을(를) 입력해주세요.'" },
310
310
  },
311
- children: /* @__PURE__ */ t(
312
- D,
311
+ children: /* @__PURE__ */ e(
312
+ x,
313
313
  {
314
314
  ref: o,
315
- ...n,
315
+ ...r,
316
316
  requiredMark: !1,
317
- labelCol: r || { flex: "100px" },
317
+ labelCol: n || { flex: "100px" },
318
318
  style: { padding: "10px", ...u },
319
- className: `bwg-form ${l ?? ""}`,
320
- children: e
319
+ className: `bwg-form ${a ?? ""}`,
320
+ children: t
321
321
  }
322
322
  )
323
323
  }
324
324
  )
325
325
  );
326
- Ft.displayName = "BwgForm";
327
- const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, children: /* @__PURE__ */ t(X, { ...r }) }), { Text: le } = fe, { Dragger: Ct } = ee, kt = [
326
+ Et.displayName = "BwgForm";
327
+ const Qt = ({ itemProps: t, inputProps: n }) => /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(K, { ...n }) }), { Text: se } = fe, { Dragger: Dt } = Q, It = [
328
328
  ".pdf",
329
329
  ".xlsx",
330
330
  ".xls",
@@ -342,60 +342,60 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
342
342
  ".gif",
343
343
  // 압축
344
344
  ".zip"
345
- ], wt = (e, r = 2) => {
346
- if (e === 0) return "0 Bytes";
347
- const u = 1024, l = r < 0 ? 0 : r, n = ["Bytes", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(e) / Math.log(u));
348
- return parseFloat((e / Math.pow(u, o)).toFixed(l)) + " " + n[o];
349
- }, Jt = ({
350
- title: e = "첨부파일",
351
- fileGrpKey: r,
345
+ ], kt = (t, n = 2) => {
346
+ if (t === 0) return "0 Bytes";
347
+ const u = 1024, a = n < 0 ? 0 : n, r = ["Bytes", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(t) / Math.log(u));
348
+ return parseFloat((t / Math.pow(u, o)).toFixed(a)) + " " + r[o];
349
+ }, en = ({
350
+ title: t = "첨부파일",
351
+ fileGrpKey: n,
352
352
  onUploadComplete: u,
353
- onSuccessTrxCd: l = "SCMFILE00102",
353
+ onSuccessTrxCd: a = "SCMFILE00102",
354
354
  // BwgUploader와 동일한 기본 trxCd 설정
355
- anotherServiceTrxCd: n = "SCMFILE00105",
356
- allowedExtensions: o = kt,
357
- maxFileSize: d = 2048
355
+ anotherServiceTrxCd: r = "SCMFILE00105",
356
+ allowedExtensions: o = It,
357
+ maxFileSize: i = 2048
358
358
  // 기본값 2GB
359
359
  }) => {
360
- const [i, f] = z([]), [s, c] = z(!1), [y, g] = z(!1), [Y, C] = z(0), O = (h) => {
360
+ const [c, h] = P([]), [s, d] = P(!1), [y, p] = P(!1), [I, C] = P(0), T = (f) => {
361
361
  if (o && o.length > 0) {
362
- const L = ((U) => {
363
- const a = U.lastIndexOf(".");
364
- return a === -1 ? "" : U.substring(a).toLowerCase();
365
- })(h.name);
366
- if (!o.includes(L))
367
- return x.error(
368
- `${h.name} 파일은 허용되지 않는 확장자입니다. (${o.join(
362
+ const Y = ((_) => {
363
+ const l = _.lastIndexOf(".");
364
+ return l === -1 ? "" : _.substring(l).toLowerCase();
365
+ })(f.name);
366
+ if (!o.includes(Y))
367
+ return w.error(
368
+ `${f.name} 파일은 허용되지 않는 확장자입니다. (${o.join(
369
369
  ", "
370
370
  )}만 가능)`
371
371
  ), !1;
372
372
  }
373
373
  return !0;
374
- }, p = async () => {
375
- const h = i.filter((k) => k.status !== "done"), P = h.reduce(
376
- (k, b) => k + (b.size || 0),
374
+ }, g = async () => {
375
+ const f = c.filter((D) => D.status !== "done"), v = f.reduce(
376
+ (D, S) => D + (S.size || 0),
377
377
  0
378
- ), L = 2 * 1024 * 1024 * 1024;
379
- if (P > L) {
380
- ze.error({
378
+ ), Y = 2 * 1024 * 1024 * 1024;
379
+ if (v > Y) {
380
+ We.error({
381
381
  message: "업로드 용량 초과",
382
382
  description: "한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."
383
383
  });
384
384
  return;
385
385
  }
386
- if (h.length === 0) {
387
- x.warning(
386
+ if (f.length === 0) {
387
+ w.warning(
388
388
  "업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다."
389
389
  );
390
390
  return;
391
391
  }
392
- g(!0);
393
- let U;
392
+ p(!0);
393
+ let _;
394
394
  try {
395
- const k = new ht();
396
- h.forEach((b) => {
397
- b.originFileObj && k.file(b.name, b.originFileObj);
398
- }), U = await k.generateAsync({
395
+ const D = new gt();
396
+ f.forEach((S) => {
397
+ S.originFileObj && D.file(S.name, S.originFileObj);
398
+ }), _ = await D.generateAsync({
399
399
  type: "blob",
400
400
  compression: "DEFLATE",
401
401
  compressionOptions: {
@@ -403,207 +403,207 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
403
403
  // 높은 압축률 설정
404
404
  }
405
405
  });
406
- } catch (k) {
407
- g(!1), x.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", k);
406
+ } catch (D) {
407
+ p(!1), w.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", D);
408
408
  return;
409
409
  }
410
- g(!1);
411
- const a = new FormData();
412
- a.append("file", U, "upload.zip"), c(!0), C(0);
410
+ p(!1);
411
+ const l = new FormData();
412
+ l.append("file", _, "upload.zip"), d(!0), C(0);
413
413
  try {
414
- const k = await new Promise((B, A) => {
415
- const M = new XMLHttpRequest();
416
- M.open("POST", "/api/upload-large", !0), M.upload.onprogress = ($) => {
417
- if ($.lengthComputable) {
418
- const re = Math.round(
419
- $.loaded / $.total * 100
414
+ const D = await new Promise((z, U) => {
415
+ const B = new XMLHttpRequest();
416
+ B.open("POST", "/api/upload-large", !0), B.upload.onprogress = (W) => {
417
+ if (W.lengthComputable) {
418
+ const ae = Math.round(
419
+ W.loaded / W.total * 100
420
420
  );
421
- C(re);
421
+ C(ae);
422
422
  }
423
- }, M.onload = () => {
424
- if (M.status >= 200 && M.status < 300)
423
+ }, B.onload = () => {
424
+ if (B.status >= 200 && B.status < 300)
425
425
  try {
426
- const $ = JSON.parse(M.responseText);
427
- $.success ? B($) : A(
428
- new Error($.message || "파일 업로드에 실패했습니다.")
426
+ const W = JSON.parse(B.responseText);
427
+ W.success ? z(W) : U(
428
+ new Error(W.message || "파일 업로드에 실패했습니다.")
429
429
  );
430
430
  } catch {
431
- A(new Error("잘못된 서버 응답입니다."));
431
+ U(new Error("잘못된 서버 응답입니다."));
432
432
  }
433
433
  else
434
434
  try {
435
- const $ = JSON.parse(M.responseText);
436
- A(new Error($.message || `서버 오류: ${M.status}`));
435
+ const W = JSON.parse(B.responseText);
436
+ U(new Error(W.message || `서버 오류: ${B.status}`));
437
437
  } catch {
438
- A(new Error(`서버 오류: ${M.status}`));
438
+ U(new Error(`서버 오류: ${B.status}`));
439
439
  }
440
- }, M.onerror = () => {
441
- A(new Error("네트워크 오류가 발생했습니다."));
442
- }, M.send(a);
440
+ }, B.onerror = () => {
441
+ U(new Error("네트워크 오류가 발생했습니다."));
442
+ }, B.send(l);
443
443
  });
444
- x.success(
445
- k.message || "압축 파일이 성공적으로 업로드되었습니다."
444
+ w.success(
445
+ D.message || "압축 파일이 성공적으로 업로드되었습니다."
446
446
  );
447
- const b = i.map(
448
- (B) => h.find((A) => A.uid === B.uid) ? { ...B, status: "done" } : B
447
+ const S = c.map(
448
+ (z) => f.find((U) => U.uid === z.uid) ? { ...z, status: "done" } : z
449
449
  );
450
- if (f(b), l && k.uploadedFiles && Array.isArray(k.uploadedFiles)) {
451
- const B = ve();
452
- k.uploadedFiles.forEach((A) => {
453
- const M = {
454
- crprCd: B?.crprCd,
450
+ if (h(S), a && D.uploadedFiles && Array.isArray(D.uploadedFiles)) {
451
+ const z = Me();
452
+ D.uploadedFiles.forEach((U) => {
453
+ const B = {
454
+ crprCd: z?.crprCd,
455
455
  sysCd: __SYS_CD__,
456
- fileGrpKey: r,
456
+ fileGrpKey: n,
457
457
  sub: [
458
458
  {
459
- crprCd: B?.crprCd,
459
+ crprCd: z?.crprCd,
460
460
  sysCd: __SYS_CD__,
461
- fileGrpKey: r,
462
- physFileNm: A.fileNameP,
463
- lgclFileNm: A.fileNameL,
464
- filePath: A.filePath,
465
- fileExtn: A.fileExt,
466
- fileSize: A.fileSize,
461
+ fileGrpKey: n,
462
+ physFileNm: U.fileNameP,
463
+ lgclFileNm: U.fileNameL,
464
+ filePath: U.filePath,
465
+ fileExtn: U.fileExt,
466
+ fileSize: U.fileSize,
467
467
  mltpYn: "Y"
468
468
  }
469
469
  ]
470
470
  };
471
- te(l, M).then(($) => {
472
- const re = i.map((Z) => ({
473
- crprCd: B?.crprCd,
471
+ oe(a, B).then((W) => {
472
+ const ae = c.map((ne) => ({
473
+ crprCd: z?.crprCd,
474
474
  sysCd: __SYS_CD__,
475
- fileGrpKey: $.sub[0].fileGrpKey,
476
- fileKey: $.sub[0].fileKey,
477
- lgclFileNm: Z.name,
478
- fileSize: Z.size,
479
- fileExtn: Z.name.split(".").pop(),
480
- fileType: Z.type
475
+ fileGrpKey: W.sub[0].fileGrpKey,
476
+ fileKey: W.sub[0].fileKey,
477
+ lgclFileNm: ne.name,
478
+ fileSize: ne.size,
479
+ fileExtn: ne.name.split(".").pop(),
480
+ fileType: ne.type
481
481
  }));
482
- te(n, {
482
+ oe(r, {
483
483
  // 파일 목록에 fileKey를 추가합니다.
484
- sub: re
484
+ sub: ae
485
485
  });
486
- }).catch(($) => {
487
- console.error("후처리 서비스 호출 실패:", $), x.error(
488
- `${A.fileNameL} 파일의 후처리 작업에 실패했습니다.`
486
+ }).catch((W) => {
487
+ console.error("후처리 서비스 호출 실패:", W), w.error(
488
+ `${U.fileNameL} 파일의 후처리 작업에 실패했습니다.`
489
489
  );
490
490
  }), u && u({
491
- fileNameP: A.fileNameP,
492
- fileNameL: A.fileNameL
491
+ fileNameP: U.fileNameP,
492
+ fileNameL: U.fileNameL
493
493
  });
494
494
  });
495
495
  }
496
- } catch (k) {
497
- x.error(k.message || "파일 업로드 중 오류가 발생했습니다.");
498
- const b = i.map(
499
- (B) => h.find((A) => A.uid === B.uid) ? {
500
- ...B,
496
+ } catch (D) {
497
+ w.error(D.message || "파일 업로드 중 오류가 발생했습니다.");
498
+ const S = c.map(
499
+ (z) => f.find((U) => U.uid === z.uid) ? {
500
+ ...z,
501
501
  status: "error",
502
- response: k.message || "파일 업로드 중 오류가 발생했습니다."
503
- } : B
502
+ response: D.message || "파일 업로드 중 오류가 발생했습니다."
503
+ } : z
504
504
  );
505
- f(b);
505
+ h(S);
506
506
  } finally {
507
- c(!1);
507
+ d(!1);
508
508
  }
509
- }, E = {
509
+ }, F = {
510
510
  multiple: !0,
511
- fileList: i,
512
- beforeUpload: (h) => O(h) ? d && h.size >= d * 1024 * 1024 ? (x.error(
513
- `대용량 첨부 파일 최대 크기는 ${(d / 1024).toFixed(
511
+ fileList: c,
512
+ beforeUpload: (f) => T(f) ? i && f.size >= i * 1024 * 1024 ? (w.error(
513
+ `대용량 첨부 파일 최대 크기는 ${(i / 1024).toFixed(
514
514
  1
515
515
  )}GB입니다.`
516
- ), ee.LIST_IGNORE) : !1 : ee.LIST_IGNORE,
517
- onChange: ({ fileList: h }) => {
518
- const P = new Map(i.map((L) => [L.uid, L]));
519
- h.forEach((L) => {
520
- P.set(L.uid, L);
521
- }), f(Array.from(P.values()));
516
+ ), Q.LIST_IGNORE) : !1 : Q.LIST_IGNORE,
517
+ onChange: ({ fileList: f }) => {
518
+ const v = new Map(c.map((Y) => [Y.uid, Y]));
519
+ f.forEach((Y) => {
520
+ v.set(Y.uid, Y);
521
+ }), h(Array.from(v.values()));
522
522
  },
523
- onRemove: (h) => {
524
- const P = i.filter((L) => L.uid !== h.uid);
525
- f(P);
523
+ onRemove: (f) => {
524
+ const v = c.filter((Y) => Y.uid !== f.uid);
525
+ h(v);
526
526
  },
527
527
  showUploadList: !1
528
528
  // 수동으로 목록을 렌더링하므로 antd의 기본 목록은 숨깁니다.
529
529
  };
530
- return /* @__PURE__ */ t(
531
- Ee,
530
+ return /* @__PURE__ */ e(
531
+ ye,
532
532
  {
533
533
  spinning: s || y,
534
- tip: y ? "파일 압축 중..." : `파일 업로드 중... ${Y}%`,
535
- children: /* @__PURE__ */ T("div", { className: "bwg-large-uploader-container", children: [
536
- /* @__PURE__ */ t(
537
- Ve,
534
+ tip: y ? "파일 압축 중..." : `파일 업로드 중... ${I}%`,
535
+ children: /* @__PURE__ */ O("div", { className: "bwg-large-uploader-container", children: [
536
+ /* @__PURE__ */ e(
537
+ xe,
538
538
  {
539
- title: /* @__PURE__ */ t(le, { strong: !0, children: e }),
540
- extra: /* @__PURE__ */ t(ee, { ...E, children: /* @__PURE__ */ t(J, { icon: /* @__PURE__ */ t(ae, {}), children: "파일 선택" }) }),
539
+ title: /* @__PURE__ */ e(se, { strong: !0, children: t }),
540
+ extra: /* @__PURE__ */ e(Q, { ...F, children: /* @__PURE__ */ e(ee, { icon: /* @__PURE__ */ e(re, {}), children: "파일 선택" }) }),
541
541
  style: { padding: 0 },
542
- children: /* @__PURE__ */ t(
543
- Ct,
542
+ children: /* @__PURE__ */ e(
543
+ Dt,
544
544
  {
545
- ...E,
545
+ ...F,
546
546
  style: {
547
547
  border: "none",
548
548
  background: "transparent",
549
549
  padding: 0
550
550
  },
551
- children: /* @__PURE__ */ t("div", { className: "upload-list-container", children: i.length > 0 ? /* @__PURE__ */ t(
552
- ne,
551
+ children: /* @__PURE__ */ e("div", { className: "upload-list-container", children: c.length > 0 ? /* @__PURE__ */ e(
552
+ le,
553
553
  {
554
554
  style: { textAlign: "left" },
555
- dataSource: i,
556
- renderItem: (h) => {
557
- const P = h.status === "done", L = h.status === "error";
558
- let U;
559
- return P ? U = /* @__PURE__ */ t(
560
- et,
555
+ dataSource: c,
556
+ renderItem: (f) => {
557
+ const v = f.status === "done", Y = f.status === "error";
558
+ let _;
559
+ return v ? _ = /* @__PURE__ */ e(
560
+ lt,
561
561
  {
562
562
  style: { color: "#52c41a", fontSize: 14 }
563
563
  }
564
- ) : L ? U = /* @__PURE__ */ t(
565
- Re,
564
+ ) : Y ? _ = /* @__PURE__ */ e(
565
+ He,
566
566
  {
567
- title: typeof h.response == "string" ? h.response : "업로드 실패",
568
- children: /* @__PURE__ */ t(
569
- tt,
567
+ title: typeof f.response == "string" ? f.response : "업로드 실패",
568
+ children: /* @__PURE__ */ e(
569
+ at,
570
570
  {
571
571
  style: { color: "#ff4d4f", fontSize: 14 }
572
572
  }
573
573
  )
574
574
  }
575
- ) : U = /* @__PURE__ */ t(nt, { style: { fontSize: 14 } }), /* @__PURE__ */ t(
576
- ne.Item,
575
+ ) : _ = /* @__PURE__ */ e(st, { style: { fontSize: 14 } }), /* @__PURE__ */ e(
576
+ le.Item,
577
577
  {
578
578
  actions: [
579
- /* @__PURE__ */ t(le, { type: "secondary", children: wt(h.size || 0) }, "size"),
580
- /* @__PURE__ */ t(
581
- J,
579
+ /* @__PURE__ */ e(se, { type: "secondary", children: kt(f.size || 0) }, "size"),
580
+ /* @__PURE__ */ e(
581
+ ee,
582
582
  {
583
583
  type: "text",
584
- icon: /* @__PURE__ */ t(Ze, {}),
585
- onClick: (a) => {
586
- a.stopPropagation(), E.onRemove?.(h);
584
+ icon: /* @__PURE__ */ e(rt, {}),
585
+ onClick: (l) => {
586
+ l.stopPropagation(), F.onRemove?.(f);
587
587
  },
588
588
  disabled: s || y
589
589
  },
590
590
  "delete"
591
591
  )
592
592
  ],
593
- children: /* @__PURE__ */ t(
594
- ne.Item.Meta,
593
+ children: /* @__PURE__ */ e(
594
+ le.Item.Meta,
595
595
  {
596
- avatar: U,
597
- title: /* @__PURE__ */ t(le, { type: L ? "danger" : void 0, children: h.name })
596
+ avatar: _,
597
+ title: /* @__PURE__ */ e(se, { type: Y ? "danger" : void 0, children: f.name })
598
598
  }
599
599
  )
600
600
  },
601
- h.uid
601
+ f.uid
602
602
  );
603
603
  }
604
604
  }
605
- ) : /* @__PURE__ */ T(
606
- ye,
605
+ ) : /* @__PURE__ */ O(
606
+ Ie,
607
607
  {
608
608
  gap: "middle",
609
609
  align: "center",
@@ -611,8 +611,8 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
611
611
  vertical: !0,
612
612
  style: { padding: "20px 0", minHeight: "120px" },
613
613
  children: [
614
- /* @__PURE__ */ t(De, { style: { fontSize: "32px", color: "#999" } }),
615
- /* @__PURE__ */ t(le, { type: "secondary", children: "업로드할 파일을 선택하거나 이 영역으로 드래그하세요." })
614
+ /* @__PURE__ */ e(Ve, { style: { fontSize: "32px", color: "#999" } }),
615
+ /* @__PURE__ */ e(se, { type: "secondary", children: "업로드할 파일을 선택하거나 이 영역으로 드래그하세요." })
616
616
  ]
617
617
  }
618
618
  ) })
@@ -620,22 +620,22 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
620
620
  )
621
621
  }
622
622
  ),
623
- i.length > 0 && /* @__PURE__ */ T(
624
- ye,
623
+ c.length > 0 && /* @__PURE__ */ O(
624
+ Ie,
625
625
  {
626
626
  justify: "flex-end",
627
627
  align: "center",
628
628
  gap: "large",
629
629
  style: { marginTop: 16 },
630
630
  children: [
631
- s && /* @__PURE__ */ t("div", { style: { width: "250px" }, children: /* @__PURE__ */ t(Ue, { percent: Y, size: "small" }) }),
632
- /* @__PURE__ */ t(
633
- J,
631
+ s && /* @__PURE__ */ e("div", { style: { width: "250px" }, children: /* @__PURE__ */ e(Ge, { percent: I, size: "small" }) }),
632
+ /* @__PURE__ */ e(
633
+ ee,
634
634
  {
635
635
  type: "primary",
636
- onClick: p,
637
- disabled: s || y || i.filter((h) => h.status !== "done").length === 0,
638
- icon: /* @__PURE__ */ t(Qe, {}),
636
+ onClick: g,
637
+ disabled: s || y || c.filter((f) => f.status !== "done").length === 0,
638
+ icon: /* @__PURE__ */ e(ot, {}),
639
639
  children: "일괄 업로드"
640
640
  }
641
641
  )
@@ -645,36 +645,36 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
645
645
  ] })
646
646
  }
647
647
  );
648
- }, Yt = (e) => {
649
- if (typeof e == "string")
650
- return e.replace(/0/g, "_");
651
- if (Array.isArray(e))
652
- return e[0].replace(/0/g, "_");
653
- if (typeof e == "object" && "mask" in e && "blocks" in e) {
654
- const { mask: r, blocks: u } = e;
655
- return r.split(".").map((l) => {
656
- const o = u?.[l]?.maxLength ?? 3;
648
+ }, wt = (t) => {
649
+ if (typeof t == "string")
650
+ return t.replace(/0/g, "_");
651
+ if (Array.isArray(t))
652
+ return t[0].replace(/0/g, "_");
653
+ if (typeof t == "object" && "mask" in t && "blocks" in t) {
654
+ const { mask: n, blocks: u } = t;
655
+ return n.split(".").map((a) => {
656
+ const o = u?.[a]?.maxLength ?? 3;
657
657
  return "_".repeat(o);
658
658
  }).join(".");
659
659
  }
660
660
  return "";
661
- }, Zt = ({
662
- itemProps: e,
663
- inputProps: r,
661
+ }, tn = ({
662
+ itemProps: t,
663
+ inputProps: n,
664
664
  mask: u
665
665
  }) => {
666
- const l = K(null), n = D.useFormInstance(), o = q(() => Yt(u), [u]);
667
- return G(() => {
668
- if (!l.current?.input) return;
669
- const d = typeof u == "string" || Array.isArray(u) ? { mask: u } : u, i = se(l.current.input, d);
670
- return i.on("accept", () => {
671
- n && e?.name && n.setFieldValue(e.name, i.value);
666
+ const a = J(null), r = x.useFormInstance(), o = q(() => wt(u), [u]);
667
+ return X(() => {
668
+ if (!a.current?.input) return;
669
+ const i = typeof u == "string" || Array.isArray(u) ? { mask: u } : u, c = ce(a.current.input, i);
670
+ return c.on("accept", () => {
671
+ r && t?.name && r.setFieldValue(t.name, c.value);
672
672
  }), () => {
673
- i.destroy();
673
+ c.destroy();
674
674
  };
675
- }, [u, n, e?.name]), /* @__PURE__ */ t(R, { ...e, children: /* @__PURE__ */ t(X, { ...r, ref: l, placeholder: o }) });
676
- }, bt = (e) => {
677
- switch (e) {
675
+ }, [u, r, t?.name]), /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(K, { ...n, ref: a, placeholder: o }) });
676
+ }, St = (t) => {
677
+ switch (t) {
678
678
  case "year":
679
679
  return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
680
680
  case "month":
@@ -687,69 +687,69 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
687
687
  outputFormat: "YYYYMMDD"
688
688
  };
689
689
  }
690
- }, Qt = ({
691
- type: e = "date",
692
- itemProps: r = { name: "calendar" },
690
+ }, nn = ({
691
+ type: t = "date",
692
+ itemProps: n = { name: "calendar" },
693
693
  inputProps: u,
694
- pickerProps: l
694
+ pickerProps: a
695
695
  }) => {
696
- const { format: n, mask: o, outputFormat: d } = bt(e), i = K(null), f = K(null), s = K(null), c = D.useFormInstance(), [y, g] = z(!1), [Y, C] = z(!1), O = r?.name, [p, E] = z(null), h = D.useWatch(O, c), P = xe();
697
- G(() => {
698
- if (!i.current?.input) return;
699
- const a = se(i.current.input, {
696
+ const { format: r, mask: o, outputFormat: i } = St(t), c = J(null), h = J(null), s = J(null), d = x.useFormInstance(), [y, p] = P(!1), [I, C] = P(!1), T = n?.name, [g, F] = P(null), f = x.useWatch(T, d), v = Te();
697
+ X(() => {
698
+ if (!c.current?.input) return;
699
+ const l = ce(c.current.input, {
700
700
  mask: o,
701
701
  lazy: !1
702
702
  });
703
- return f.current = a, a.on("accept", () => {
704
- const k = a.value;
705
- k.length > 0 && g(!0);
706
- const b = N(k, n, !0);
707
- k.length === n.length && b.isValid() && (c.setFieldValue(O, b.format(d)), E(b), f.current?.updateValue());
703
+ return h.current = l, l.on("accept", () => {
704
+ const D = l.value;
705
+ D.length > 0 && p(!0);
706
+ const S = N(D, r, !0);
707
+ D.length === r.length && S.isValid() && (d.setFieldValue(T, S.format(i)), F(S), h.current?.updateValue());
708
708
  }), () => {
709
- a.destroy();
709
+ l.destroy();
710
710
  };
711
- }, [n, o]), G(() => {
712
- if (!h) {
713
- E(null);
711
+ }, [r, o]), X(() => {
712
+ if (!f) {
713
+ F(null);
714
714
  return;
715
715
  }
716
- let a = null;
717
- if (typeof h == "string" && h.length === d.length && /^\d+$/.test(h))
718
- if (e === "date") {
719
- const k = h.substring(0, 4), b = h.substring(4, 6), B = h.substring(6, 8);
720
- a = N(`${k}-${b}-${B}`, n, !0);
721
- } else if (e === "month") {
722
- const k = h.substring(0, 4), b = h.substring(4, 6);
723
- a = N(`${k}-${b}`, n, !0);
724
- } else e === "year" && (a = N(h, n, !0));
716
+ let l = null;
717
+ if (typeof f == "string" && f.length === i.length && /^\d+$/.test(f))
718
+ if (t === "date") {
719
+ const D = f.substring(0, 4), S = f.substring(4, 6), z = f.substring(6, 8);
720
+ l = N(`${D}-${S}-${z}`, r, !0);
721
+ } else if (t === "month") {
722
+ const D = f.substring(0, 4), S = f.substring(4, 6);
723
+ l = N(`${D}-${S}`, r, !0);
724
+ } else t === "year" && (l = N(f, r, !0));
725
725
  else
726
- a = N(h, n, !0);
727
- a && a.isValid() ? E(a) : E(null), C(!1);
728
- }, [h, n, d, e]);
729
- const L = (a) => {
730
- if (!a) {
731
- c.setFieldValue(O, void 0), E(null), f.current?.updateValue();
726
+ l = N(f, r, !0);
727
+ l && l.isValid() ? F(l) : F(null), C(!1);
728
+ }, [f, r, i, t]);
729
+ const Y = (l) => {
730
+ if (!l) {
731
+ d.setFieldValue(T, void 0), F(null), h.current?.updateValue();
732
732
  return;
733
733
  }
734
- E(a);
735
- const k = a.format(d);
736
- c.setFieldValue(O, k), f.current && (f.current.value = a.format(n), f.current.updateValue()), C(!1);
737
- }, U = (a) => {
734
+ F(l);
735
+ const D = l.format(i);
736
+ d.setFieldValue(T, D), h.current && (h.current.value = l.format(r), h.current.updateValue()), C(!1);
737
+ }, _ = (l) => {
738
738
  setTimeout(() => {
739
- const k = document.activeElement, b = s.current, B = b?.querySelector(".ant-picker-dropdown");
740
- !(b && (b.contains(k) || b === k || B?.contains(k))) && !(a !== void 0 ? a : y) && console.log("✅ Input과 DatePicker 모두 포커스가 없습니다");
739
+ const D = document.activeElement, S = s.current, z = S?.querySelector(".ant-picker-dropdown");
740
+ !(S && (S.contains(D) || S === D || z?.contains(D))) && !(l !== void 0 ? l : y) && console.log("✅ Input과 DatePicker 모두 포커스가 없습니다");
741
741
  }, 0);
742
742
  };
743
- return /* @__PURE__ */ t(
744
- R,
743
+ return /* @__PURE__ */ e(
744
+ G,
745
745
  {
746
- ...r,
746
+ ...n,
747
747
  name: void 0,
748
- validateStatus: Y ? "warning" : void 0,
749
- children: /* @__PURE__ */ T(
750
- ie,
748
+ validateStatus: I ? "warning" : void 0,
749
+ children: /* @__PURE__ */ O(
750
+ de,
751
751
  {
752
- componentSize: P.componentSize,
752
+ componentSize: v.componentSize,
753
753
  theme: {
754
754
  components: {
755
755
  Input: {
@@ -758,63 +758,63 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
758
758
  }
759
759
  },
760
760
  children: [
761
- /* @__PURE__ */ t(
762
- D.Item,
761
+ /* @__PURE__ */ e(
762
+ x.Item,
763
763
  {
764
- name: O,
765
- getValueProps: (a) => ({
766
- value: a ? N(a).format(n) : void 0
764
+ name: T,
765
+ getValueProps: (l) => ({
766
+ value: l ? N(l).format(r) : void 0
767
767
  }),
768
- normalize: (a) => a ? N(a).format(d) : void 0,
768
+ normalize: (l) => l ? N(l).format(i) : void 0,
769
769
  noStyle: !0,
770
- rules: r?.rules ?? [],
771
- children: /* @__PURE__ */ t(
772
- X,
770
+ rules: n?.rules ?? [],
771
+ children: /* @__PURE__ */ e(
772
+ K,
773
773
  {
774
774
  ...u,
775
- ref: i,
775
+ ref: c,
776
776
  onFocus: () => {
777
- g(!y), f.current?.updateValue();
777
+ p(!y), h.current?.updateValue();
778
778
  },
779
779
  onBlur: () => {
780
- U();
780
+ _();
781
781
  },
782
- onKeyDown: (a) => {
783
- if (a.key === "Backspace" && g(!0), a.key === "Tab" && g(!1), a.key === "Enter")
782
+ onKeyDown: (l) => {
783
+ if (l.key === "Backspace" && p(!0), l.key === "Tab" && p(!1), l.key === "Enter")
784
784
  if (y) {
785
- const k = f.current?.value || "", b = N(k, n, !0);
786
- k.length === n.length && b.isValid() ? (g(!1), C(!1)) : C(!0);
785
+ const D = h.current?.value || "", S = N(D, r, !0);
786
+ D.length === r.length && S.isValid() ? (p(!1), C(!1)) : C(!0);
787
787
  } else
788
- g(!0);
788
+ p(!0);
789
789
  },
790
790
  style: {
791
791
  width: "65%"
792
792
  },
793
793
  allowClear: !0,
794
794
  placeholder: o.replace(/0/g, "_"),
795
- suffix: /* @__PURE__ */ t(me, { style: { color: "#d9d9d9" } }),
795
+ suffix: /* @__PURE__ */ e(pe, { style: { color: "#d9d9d9" } }),
796
796
  autoComplete: "off"
797
797
  }
798
798
  )
799
799
  }
800
800
  ),
801
- /* @__PURE__ */ t(
802
- ce,
801
+ /* @__PURE__ */ e(
802
+ ue,
803
803
  {
804
- ...l,
804
+ ...a,
805
805
  open: y,
806
- picker: e,
806
+ picker: t,
807
807
  format: {
808
- format: n,
808
+ format: r,
809
809
  type: "mask"
810
810
  },
811
811
  showNow: !0,
812
- value: p,
813
- onChange: L,
814
- onOpenChange: (a) => {
815
- g(a), a || U(!1);
812
+ value: g,
813
+ onChange: Y,
814
+ onOpenChange: (l) => {
815
+ p(l), l || _(!1);
816
816
  },
817
- renderExtraFooter: () => Y ? /* @__PURE__ */ T(
817
+ renderExtraFooter: () => I ? /* @__PURE__ */ O(
818
818
  "div",
819
819
  {
820
820
  style: {
@@ -828,12 +828,12 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
828
828
  backgroundColor: "#fffbe6"
829
829
  },
830
830
  children: [
831
- /* @__PURE__ */ t(Ie, {}),
832
- /* @__PURE__ */ t("span", { children: "유효하지 않은 날짜입니다" })
831
+ /* @__PURE__ */ e(Ae, {}),
832
+ /* @__PURE__ */ e("span", { children: "유효하지 않은 날짜입니다" })
833
833
  ]
834
834
  }
835
835
  ) : null,
836
- getPopupContainer: (a) => a.parentElement,
836
+ getPopupContainer: (l) => l.parentElement,
837
837
  style: {
838
838
  position: "absolute",
839
839
  top: 0,
@@ -849,8 +849,8 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
849
849
  )
850
850
  }
851
851
  );
852
- }, { RangePicker: St } = ce, Vt = (e) => {
853
- switch (e) {
852
+ }, { RangePicker: bt } = ue, Lt = (t) => {
853
+ switch (t) {
854
854
  case "year":
855
855
  return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
856
856
  case "month":
@@ -863,231 +863,231 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
863
863
  outputFormat: "YYYYMMDD"
864
864
  };
865
865
  }
866
- }, en = ({
867
- type: e = "date",
868
- itemProps: r = { name: "dateRange" },
866
+ }, rn = ({
867
+ type: t = "date",
868
+ itemProps: n = { name: "dateRange" },
869
869
  inputProps: u,
870
- pickerProps: l
870
+ pickerProps: a
871
871
  }) => {
872
- const { format: n, mask: o, outputFormat: d } = Vt(e), i = K(null), f = K(null), s = K(null), c = K(null), y = K(null), g = D.useFormInstance(), [Y, C] = z(!1), [O, p] = z(!1), [E, h] = z(null), [P, L] = z(!1), U = K(!1), a = r?.name, [k, b] = z([
872
+ const { format: r, mask: o, outputFormat: i } = Lt(t), c = J(null), h = J(null), s = J(null), d = J(null), y = J(null), p = x.useFormInstance(), [I, C] = P(!1), [T, g] = P(!1), [F, f] = P(null), [v, Y] = P(!1), _ = J(!1), l = n?.name, [D, S] = P([
873
873
  null,
874
874
  null
875
- ]), B = D.useWatch(
876
- a ? Array.isArray(a) ? [...a, 0] : [a, 0] : void 0,
877
- g
878
- ), A = D.useWatch(
879
- a ? Array.isArray(a) ? [...a, 1] : [a, 1] : void 0,
880
- g
881
- ), M = D.useWatch(a, g), $ = xe();
882
- G(() => {
883
- if (!i.current?.input) return;
884
- const m = se(i.current.input, {
875
+ ]), z = x.useWatch(
876
+ l ? Array.isArray(l) ? [...l, 0] : [l, 0] : void 0,
877
+ p
878
+ ), U = x.useWatch(
879
+ l ? Array.isArray(l) ? [...l, 1] : [l, 1] : void 0,
880
+ p
881
+ ), B = x.useWatch(l, p), W = Te();
882
+ X(() => {
883
+ if (!c.current?.input) return;
884
+ const m = ce(c.current.input, {
885
885
  mask: o,
886
886
  lazy: !1
887
887
  });
888
888
  return s.current = m, m.on("accept", () => {
889
- const F = m.value, V = m.unmaskedValue || "";
889
+ const E = m.value, L = m.unmaskedValue || "";
890
890
  if (console.log("🔵 [시작일] accept 이벤트:", {
891
- maskValue: F,
892
- unmaskedValue: V,
893
- length: F.length,
894
- formatLength: n.length
895
- }), F.length > 0 && (h("start"), C(!0), L(!1)), V.length === d.length) {
896
- const w = N(F, n, !0);
897
- if (w.isValid()) {
891
+ maskValue: E,
892
+ unmaskedValue: L,
893
+ length: E.length,
894
+ formatLength: r.length
895
+ }), E.length > 0 && (f("start"), C(!0), Y(!1)), L.length === i.length) {
896
+ const k = N(E, r, !0);
897
+ if (k.isValid()) {
898
898
  console.log("🔵 [시작일] 입력 완료 및 검증 통과:", {
899
- parsed: w.format(n)
899
+ parsed: k.format(r)
900
900
  });
901
- const H = w.format(d);
902
- U.current = !0;
903
- const S = Array.isArray(a) ? [...a, 0] : [a, 0];
904
- g.setFieldValue(S, H), b([w, k[1]]), s.current && s.current.updateValue(), p(!1), setTimeout(() => {
905
- c.current && (c.current.value = "", c.current.unmaskedValue = "", c.current.updateValue());
906
- const I = Array.isArray(a) ? [...a, 1] : [a, 1];
907
- g.getFieldValue(I) || g.setFieldValue(I, void 0), f.current?.focus(), setTimeout(() => {
908
- if (c.current) {
909
- const W = c.current.value || "";
910
- !(c.current.unmaskedValue || "") && !W.replace(/[^0-9]/g, "") && (c.current.value = "", c.current.updateValue());
901
+ const H = k.format(i);
902
+ _.current = !0;
903
+ const b = Array.isArray(l) ? [...l, 0] : [l, 0];
904
+ p.setFieldValue(b, H), S([k, D[1]]), s.current && s.current.updateValue(), g(!1), setTimeout(() => {
905
+ d.current && (d.current.value = "", d.current.unmaskedValue = "", d.current.updateValue());
906
+ const V = Array.isArray(l) ? [...l, 1] : [l, 1];
907
+ p.getFieldValue(V) || p.setFieldValue(V, void 0), h.current?.focus(), setTimeout(() => {
908
+ if (d.current) {
909
+ const j = d.current.value || "";
910
+ !(d.current.unmaskedValue || "") && !j.replace(/[^0-9]/g, "") && (d.current.value = "", d.current.updateValue());
911
911
  }
912
- }, 10), h("end"), C(!0), U.current = !1;
912
+ }, 10), f("end"), C(!0), _.current = !1;
913
913
  }, 0);
914
914
  } else
915
- l?.allowEmpty ? p(!1) : (console.log("🔵 [시작일] 검증 실패:", { val: F, parsed: w }), p(!0));
915
+ a?.allowEmpty ? g(!1) : (console.log("🔵 [시작일] 검증 실패:", { val: E, parsed: k }), g(!0));
916
916
  }
917
917
  }), () => {
918
918
  m.destroy();
919
919
  };
920
- }, [n, o, a]), G(() => {
921
- if (!f.current?.input) return;
922
- const m = se(f.current.input, {
920
+ }, [r, o, l]), X(() => {
921
+ if (!h.current?.input) return;
922
+ const m = ce(h.current.input, {
923
923
  mask: o,
924
924
  lazy: !1
925
925
  });
926
- return c.current = m, m.on("accept", () => {
927
- const F = m.value, V = m.unmaskedValue || "";
926
+ return d.current = m, m.on("accept", () => {
927
+ const E = m.value, L = m.unmaskedValue || "";
928
928
  if (console.log("🟢 [종료일] accept 이벤트:", {
929
- maskValue: F,
930
- unmaskedValue: V,
931
- length: F.length,
932
- formatLength: n.length
933
- }), V === "" || V.length === 0) {
934
- const w = Array.isArray(a) ? [...a, 1] : [a, 1];
935
- g.setFieldValue(w, void 0), b([k[0], null]), c.current && (c.current.value = "", c.current.updateValue()), setTimeout(() => {
936
- i.current?.focus(), h("start"), C(!0);
929
+ maskValue: E,
930
+ unmaskedValue: L,
931
+ length: E.length,
932
+ formatLength: r.length
933
+ }), L === "" || L.length === 0) {
934
+ const k = Array.isArray(l) ? [...l, 1] : [l, 1];
935
+ p.setFieldValue(k, void 0), S([D[0], null]), d.current && (d.current.value = "", d.current.updateValue()), setTimeout(() => {
936
+ c.current?.focus(), f("start"), C(!0);
937
937
  }, 0);
938
938
  return;
939
939
  }
940
- if (F.length > 0 && (h("end"), C(!0)), F.length < n.length) {
941
- p(!1);
940
+ if (E.length > 0 && (f("end"), C(!0)), E.length < r.length) {
941
+ g(!1);
942
942
  return;
943
943
  }
944
- if (V.length === d.length) {
945
- const w = N(F, n, !0);
946
- if (w.isValid()) {
947
- const H = w.format(d);
944
+ if (L.length === i.length) {
945
+ const k = N(E, r, !0);
946
+ if (k.isValid()) {
947
+ const H = k.format(i);
948
948
  console.log("🟢 [종료일] 입력 완료:", {
949
- parsed: w.format(n),
949
+ parsed: k.format(r),
950
950
  formatted: H
951
- }), U.current = !0;
952
- const S = Array.isArray(a) ? [...a, 1] : [a, 1];
953
- g.setFieldValue(S, H), b([k[0], w]), c.current?.updateValue(), setTimeout(() => {
954
- U.current = !1;
951
+ }), _.current = !0;
952
+ const b = Array.isArray(l) ? [...l, 1] : [l, 1];
953
+ p.setFieldValue(b, H), S([D[0], k]), d.current?.updateValue(), setTimeout(() => {
954
+ _.current = !1;
955
955
  }, 0);
956
956
  } else
957
- l?.allowEmpty ? p(!1) : (console.log("🟢 [종료일] 검증 실패:", { val: F, parsed: w }), p(!0));
957
+ a?.allowEmpty ? g(!1) : (console.log("🟢 [종료일] 검증 실패:", { val: E, parsed: k }), g(!0));
958
958
  }
959
959
  }), () => {
960
960
  m.destroy();
961
961
  };
962
- }, [n, o, a]), G(() => {
962
+ }, [r, o, l]), X(() => {
963
963
  console.log("🟡 [useEffect] form 값 변경 감지:", {
964
- startFormValue: B,
965
- endFormValue: A,
966
- formValue: M
964
+ startFormValue: z,
965
+ endFormValue: U,
966
+ formValue: B
967
967
  });
968
- const m = B ?? (Array.isArray(M) ? M[0] : null), F = A ?? (Array.isArray(M) ? M[1] : null);
969
- if (m === void 0 && F === void 0 && (!M || !Array.isArray(M))) {
970
- b([null, null]);
968
+ const m = z ?? (Array.isArray(B) ? B[0] : null), E = U ?? (Array.isArray(B) ? B[1] : null);
969
+ if (m === void 0 && E === void 0 && (!B || !Array.isArray(B))) {
970
+ S([null, null]);
971
971
  return;
972
972
  }
973
- const V = (S) => {
974
- if (!S) return null;
975
- let I = null;
976
- if (typeof S == "string" && S.length === d.length && /^\d+$/.test(S))
977
- if (e === "date") {
978
- const _ = S.substring(0, 4), W = S.substring(4, 6), pe = S.substring(6, 8);
979
- I = N(`${_}-${W}-${pe}`, n, !0);
980
- } else if (e === "month") {
981
- const _ = S.substring(0, 4), W = S.substring(4, 6);
982
- I = N(`${_}-${W}`, n, !0);
983
- } else e === "year" && (I = N(S, n, !0));
973
+ const L = (b) => {
974
+ if (!b) return null;
975
+ let V = null;
976
+ if (typeof b == "string" && b.length === i.length && /^\d+$/.test(b))
977
+ if (t === "date") {
978
+ const R = b.substring(0, 4), j = b.substring(4, 6), De = b.substring(6, 8);
979
+ V = N(`${R}-${j}-${De}`, r, !0);
980
+ } else if (t === "month") {
981
+ const R = b.substring(0, 4), j = b.substring(4, 6);
982
+ V = N(`${R}-${j}`, r, !0);
983
+ } else t === "year" && (V = N(b, r, !0));
984
984
  else
985
- I = N(S, n, !0);
986
- return I && I.isValid() ? I : null;
987
- }, w = V(m), H = V(F);
985
+ V = N(b, r, !0);
986
+ return V && V.isValid() ? V : null;
987
+ }, k = L(m), H = L(E);
988
988
  if (console.log("🟡 [useEffect] 파싱 결과:", {
989
- startParsed: w ? w.format(n) : null,
990
- endParsed: H ? H.format(n) : null,
991
- isStartDateFromPicker: P
992
- }), b([w, H]), U.current) {
993
- console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"), p(!1);
989
+ startParsed: k ? k.format(r) : null,
990
+ endParsed: H ? H.format(r) : null,
991
+ isStartDateFromPicker: v
992
+ }), S([k, H]), _.current) {
993
+ console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"), g(!1);
994
994
  return;
995
995
  }
996
- if (!P && s.current) {
997
- const S = s.current.value || "", I = w ? w.format(n) : "", _ = s.current.unmaskedValue || "", W = w ? w.format(d) : "";
996
+ if (!v && s.current) {
997
+ const b = s.current.value || "", V = k ? k.format(r) : "", R = s.current.unmaskedValue || "", j = k ? k.format(i) : "";
998
998
  console.log("🟡 [useEffect] 시작일 마스크 값 체크:", {
999
- currentMaskValue: S,
1000
- expectedMaskValue: I,
1001
- unmaskedValue: _,
1002
- expectedUnmasked: W,
1003
- shouldUpdate: S === "" || S !== I,
1004
- canUpdate: _ === "" || _ === W
1005
- }), (S === "" || S !== I) && (_ === "" || _ === W ? (console.log("🟡 [useEffect] 시작일 마스크 값 업데이트:", {
1006
- before: S,
1007
- after: w ? w.format(n) : ""
1008
- }), w ? (s.current.value = w.format(n), s.current.updateValue()) : (s.current.value = "", s.current.updateValue())) : console.log(
999
+ currentMaskValue: b,
1000
+ expectedMaskValue: V,
1001
+ unmaskedValue: R,
1002
+ expectedUnmasked: j,
1003
+ shouldUpdate: b === "" || b !== V,
1004
+ canUpdate: R === "" || R === j
1005
+ }), (b === "" || b !== V) && (R === "" || R === j ? (console.log("🟡 [useEffect] 시작일 마스크 값 업데이트:", {
1006
+ before: b,
1007
+ after: k ? k.format(r) : ""
1008
+ }), k ? (s.current.value = k.format(r), s.current.updateValue()) : (s.current.value = "", s.current.updateValue())) : console.log(
1009
1009
  "🟡 [useEffect] 시작일 마스크 값 업데이트 스킵 (사용자 입력 중)"
1010
1010
  ));
1011
1011
  }
1012
- if (c.current) {
1013
- const S = c.current.value || "", I = H ? H.format(n) : "", _ = c.current.unmaskedValue || "", W = H ? H.format(d) : "";
1012
+ if (d.current) {
1013
+ const b = d.current.value || "", V = H ? H.format(r) : "", R = d.current.unmaskedValue || "", j = H ? H.format(i) : "";
1014
1014
  console.log("🟡 [useEffect] 종료일 마스크 값 체크:", {
1015
- currentMaskValue: S,
1016
- expectedMaskValue: I,
1017
- unmaskedValue: _,
1018
- expectedUnmasked: W,
1019
- shouldUpdate: S === "" || S !== I,
1020
- canUpdate: _ === "" || _ === W
1021
- }), (S === "" || S !== I) && (_ === "" || _ === W ? (console.log("🟡 [useEffect] 종료일 마스크 값 업데이트:", {
1022
- before: S,
1023
- after: I
1024
- }), H ? (c.current.value = H.format(n), c.current.updateValue()) : (c.current.value = "", c.current.updateValue())) : console.log(
1015
+ currentMaskValue: b,
1016
+ expectedMaskValue: V,
1017
+ unmaskedValue: R,
1018
+ expectedUnmasked: j,
1019
+ shouldUpdate: b === "" || b !== V,
1020
+ canUpdate: R === "" || R === j
1021
+ }), (b === "" || b !== V) && (R === "" || R === j ? (console.log("🟡 [useEffect] 종료일 마스크 값 업데이트:", {
1022
+ before: b,
1023
+ after: V
1024
+ }), H ? (d.current.value = H.format(r), d.current.updateValue()) : (d.current.value = "", d.current.updateValue())) : console.log(
1025
1025
  "🟡 [useEffect] 종료일 마스크 값 업데이트 스킵 (사용자 입력 중)"
1026
1026
  ));
1027
1027
  }
1028
- p(!1);
1029
- }, [B, A, M, n, d, e]);
1030
- const re = (m) => {
1028
+ g(!1);
1029
+ }, [z, U, B, r, i, t]);
1030
+ const ae = (m) => {
1031
1031
  if (console.log("🔴 [RangePicker] 날짜 변경:", {
1032
1032
  dates: m ? [
1033
- m[0] ? m[0].format(n) : null,
1034
- m[1] ? m[1].format(n) : null
1033
+ m[0] ? m[0].format(r) : null,
1034
+ m[1] ? m[1].format(r) : null
1035
1035
  ] : null,
1036
1036
  prevRange: [
1037
- k[0] ? k[0].format(n) : null,
1038
- k[1] ? k[1].format(n) : null
1037
+ D[0] ? D[0].format(r) : null,
1038
+ D[1] ? D[1].format(r) : null
1039
1039
  ]
1040
1040
  }), !m) {
1041
- b([null, null]);
1042
- const I = Array.isArray(a) ? [...a, 0] : [a, 0], _ = Array.isArray(a) ? [...a, 1] : [a, 1];
1043
- g.setFieldValue(I, void 0), g.setFieldValue(_, void 0), s.current?.updateValue(), c.current?.updateValue();
1041
+ S([null, null]);
1042
+ const V = Array.isArray(l) ? [...l, 0] : [l, 0], R = Array.isArray(l) ? [...l, 1] : [l, 1];
1043
+ p.setFieldValue(V, void 0), p.setFieldValue(R, void 0), s.current?.updateValue(), d.current?.updateValue();
1044
1044
  return;
1045
1045
  }
1046
- const [F, V] = m, w = k[0], H = F && (!w || !F.isSame(
1047
- w,
1048
- e === "year" ? "year" : e === "month" ? "month" : "day"
1046
+ const [E, L] = m, k = D[0], H = E && (!k || !E.isSame(
1047
+ k,
1048
+ t === "year" ? "year" : t === "month" ? "month" : "day"
1049
1049
  ));
1050
1050
  if (console.log("🔴 [RangePicker] 시작일 변경 여부:", {
1051
1051
  isStartDateChanged: H,
1052
- startDate: F ? F.format(n) : null,
1053
- prevStartDate: w ? w.format(n) : null
1054
- }), b([F, V]), H) {
1055
- console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"), L(!0), s.current && (s.current.value = "", s.current.updateValue());
1056
- const I = F.format(d);
1052
+ startDate: E ? E.format(r) : null,
1053
+ prevStartDate: k ? k.format(r) : null
1054
+ }), S([E, L]), H) {
1055
+ console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"), Y(!0), s.current && (s.current.value = "", s.current.updateValue());
1056
+ const V = E.format(i);
1057
1057
  console.log("🔴 [RangePicker] form 값 업데이트:", {
1058
- formatted: I
1058
+ formatted: V
1059
1059
  });
1060
- const _ = Array.isArray(a) ? [...a, 0] : [a, 0];
1061
- g.setFieldValue(_, I);
1062
- } else if (!F && s.current) {
1063
- L(!1), s.current.value = "", s.current.updateValue();
1064
- const I = Array.isArray(a) ? [...a, 0] : [a, 0];
1065
- g.setFieldValue(I, void 0);
1060
+ const R = Array.isArray(l) ? [...l, 0] : [l, 0];
1061
+ p.setFieldValue(R, V);
1062
+ } else if (!E && s.current) {
1063
+ Y(!1), s.current.value = "", s.current.updateValue();
1064
+ const V = Array.isArray(l) ? [...l, 0] : [l, 0];
1065
+ p.setFieldValue(V, void 0);
1066
1066
  } else
1067
- L(!1);
1068
- const S = Array.isArray(a) ? [...a, 1] : [a, 1];
1069
- if (V) {
1070
- const I = V.format(d);
1071
- g.setFieldValue(S, I), c.current && (c.current.value = V.format(n), c.current.updateValue());
1067
+ Y(!1);
1068
+ const b = Array.isArray(l) ? [...l, 1] : [l, 1];
1069
+ if (L) {
1070
+ const V = L.format(i);
1071
+ p.setFieldValue(b, V), d.current && (d.current.value = L.format(r), d.current.updateValue());
1072
1072
  } else
1073
- g.setFieldValue(S, void 0), c.current && (c.current.value = "", c.current.updateValue());
1074
- p(!1);
1075
- }, Z = (m) => {
1073
+ p.setFieldValue(b, void 0), d.current && (d.current.value = "", d.current.updateValue());
1074
+ g(!1);
1075
+ }, ne = (m) => {
1076
1076
  setTimeout(() => {
1077
- const F = document.activeElement, V = y.current, w = V?.querySelector(".ant-picker-dropdown");
1078
- !(V && (V.contains(F) || V === F || w?.contains(F))) && !(m !== void 0 ? m : Y) && (console.log("✅ Input과 RangePicker 모두 포커스가 없습니다"), C(!1));
1077
+ const E = document.activeElement, L = y.current, k = L?.querySelector(".ant-picker-dropdown");
1078
+ !(L && (L.contains(E) || L === E || k?.contains(E))) && !(m !== void 0 ? m : I) && (console.log("✅ Input과 RangePicker 모두 포커스가 없습니다"), C(!1));
1079
1079
  }, 0);
1080
1080
  };
1081
- return /* @__PURE__ */ t(
1082
- R,
1081
+ return /* @__PURE__ */ e(
1082
+ G,
1083
1083
  {
1084
- ...r,
1084
+ ...n,
1085
1085
  name: void 0,
1086
- validateStatus: O ? "warning" : void 0,
1087
- children: /* @__PURE__ */ T(
1088
- ie,
1086
+ validateStatus: T ? "warning" : void 0,
1087
+ children: /* @__PURE__ */ O(
1088
+ de,
1089
1089
  {
1090
- componentSize: $.componentSize,
1090
+ componentSize: W.componentSize,
1091
1091
  theme: {
1092
1092
  components: {
1093
1093
  Input: {
@@ -1096,7 +1096,7 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1096
1096
  }
1097
1097
  },
1098
1098
  children: [
1099
- /* @__PURE__ */ T(
1099
+ /* @__PURE__ */ O(
1100
1100
  "div",
1101
1101
  {
1102
1102
  ref: y,
@@ -1107,130 +1107,130 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1107
1107
  width: "100%"
1108
1108
  },
1109
1109
  children: [
1110
- /* @__PURE__ */ t(
1111
- D.Item,
1110
+ /* @__PURE__ */ e(
1111
+ x.Item,
1112
1112
  {
1113
- name: a ? Array.isArray(a) ? [...a, 0] : [a, 0] : void 0,
1113
+ name: l ? Array.isArray(l) ? [...l, 0] : [l, 0] : void 0,
1114
1114
  getValueProps: (m) => {
1115
1115
  if (!m) return { value: void 0 };
1116
- if (typeof m == "string" && m.length === d.length && /^\d+$/.test(m)) {
1117
- if (e === "date") {
1118
- const F = m.substring(0, 4), V = m.substring(4, 6), w = m.substring(6, 8);
1119
- return { value: `${F}-${V}-${w}` };
1120
- } else if (e === "month") {
1121
- const F = m.substring(0, 4), V = m.substring(4, 6);
1122
- return { value: `${F}-${V}` };
1123
- } else if (e === "year")
1116
+ if (typeof m == "string" && m.length === i.length && /^\d+$/.test(m)) {
1117
+ if (t === "date") {
1118
+ const E = m.substring(0, 4), L = m.substring(4, 6), k = m.substring(6, 8);
1119
+ return { value: `${E}-${L}-${k}` };
1120
+ } else if (t === "month") {
1121
+ const E = m.substring(0, 4), L = m.substring(4, 6);
1122
+ return { value: `${E}-${L}` };
1123
+ } else if (t === "year")
1124
1124
  return { value: m };
1125
1125
  }
1126
- return { value: N(m).format(n) };
1126
+ return { value: N(m).format(r) };
1127
1127
  },
1128
- normalize: (m) => m ? N(m).format(d) : (l?.allowEmpty, void 0),
1128
+ normalize: (m) => m ? N(m).format(i) : (a?.allowEmpty, void 0),
1129
1129
  noStyle: !0,
1130
- rules: r?.rules ?? [],
1131
- children: /* @__PURE__ */ t(
1132
- X,
1130
+ rules: n?.rules ?? [],
1131
+ children: /* @__PURE__ */ e(
1132
+ K,
1133
1133
  {
1134
1134
  ...u,
1135
1135
  value: void 0,
1136
- ref: i,
1136
+ ref: c,
1137
1137
  onFocus: () => {
1138
- if (h("start"), C(!Y), L(!1), s.current) {
1139
- const m = Array.isArray(a) ? [...a, 0] : [a, 0];
1140
- g.getFieldValue(m) || (s.current.value = "", s.current.unmaskedValue = ""), s.current.updateValue();
1138
+ if (f("start"), C(!I), Y(!1), s.current) {
1139
+ const m = Array.isArray(l) ? [...l, 0] : [l, 0];
1140
+ p.getFieldValue(m) || (s.current.value = "", s.current.unmaskedValue = ""), s.current.updateValue();
1141
1141
  }
1142
1142
  },
1143
1143
  onBlur: () => {
1144
- Z();
1144
+ ne();
1145
1145
  },
1146
1146
  onKeyDown: (m) => {
1147
- if (m.key === "Backspace" && (h("start"), C(!0)), m.key === "Enter")
1148
- if (Y && E === "start") {
1149
- const F = s.current?.value || "";
1150
- F.length === n.length ? N(F, n, !0).isValid() ? (C(!1), p(!1)) : l?.allowEmpty ? p(!1) : p(!0) : p(!1);
1147
+ if (m.key === "Backspace" && (f("start"), C(!0)), m.key === "Enter")
1148
+ if (I && F === "start") {
1149
+ const E = s.current?.value || "";
1150
+ E.length === r.length ? N(E, r, !0).isValid() ? (C(!1), g(!1)) : a?.allowEmpty ? g(!1) : g(!0) : g(!1);
1151
1151
  } else
1152
- h("start"), C(!0);
1152
+ f("start"), C(!0);
1153
1153
  },
1154
1154
  style: {
1155
1155
  flex: 1
1156
1156
  },
1157
1157
  allowClear: !0,
1158
1158
  placeholder: o.replace(/0/g, "_"),
1159
- suffix: /* @__PURE__ */ t(me, { style: { color: "#d9d9d9" } }),
1159
+ suffix: /* @__PURE__ */ e(pe, { style: { color: "#d9d9d9" } }),
1160
1160
  autoComplete: "off"
1161
1161
  }
1162
1162
  )
1163
1163
  }
1164
1164
  ),
1165
- /* @__PURE__ */ t("span", { style: { color: "#d9d9d9", userSelect: "none" }, children: "~" }),
1166
- /* @__PURE__ */ t(
1167
- D.Item,
1165
+ /* @__PURE__ */ e("span", { style: { color: "#d9d9d9", userSelect: "none" }, children: "~" }),
1166
+ /* @__PURE__ */ e(
1167
+ x.Item,
1168
1168
  {
1169
- name: a ? Array.isArray(a) ? [...a, 1] : [a, 1] : void 0,
1169
+ name: l ? Array.isArray(l) ? [...l, 1] : [l, 1] : void 0,
1170
1170
  getValueProps: (m) => {
1171
1171
  if (!m) return { value: void 0 };
1172
- if (typeof m == "string" && m.length === d.length && /^\d+$/.test(m)) {
1173
- if (e === "date") {
1174
- const F = m.substring(0, 4), V = m.substring(4, 6), w = m.substring(6, 8);
1175
- return { value: `${F}-${V}-${w}` };
1176
- } else if (e === "month") {
1177
- const F = m.substring(0, 4), V = m.substring(4, 6);
1178
- return { value: `${F}-${V}` };
1179
- } else if (e === "year")
1172
+ if (typeof m == "string" && m.length === i.length && /^\d+$/.test(m)) {
1173
+ if (t === "date") {
1174
+ const E = m.substring(0, 4), L = m.substring(4, 6), k = m.substring(6, 8);
1175
+ return { value: `${E}-${L}-${k}` };
1176
+ } else if (t === "month") {
1177
+ const E = m.substring(0, 4), L = m.substring(4, 6);
1178
+ return { value: `${E}-${L}` };
1179
+ } else if (t === "year")
1180
1180
  return { value: m };
1181
1181
  }
1182
- return { value: N(m).format(n) };
1182
+ return { value: N(m).format(r) };
1183
1183
  },
1184
- normalize: (m) => m ? N(m).format(d) : (l?.allowEmpty, void 0),
1184
+ normalize: (m) => m ? N(m).format(i) : (a?.allowEmpty, void 0),
1185
1185
  noStyle: !0,
1186
- rules: r?.rules ?? [],
1187
- children: /* @__PURE__ */ t(
1188
- X,
1186
+ rules: n?.rules ?? [],
1187
+ children: /* @__PURE__ */ e(
1188
+ K,
1189
1189
  {
1190
1190
  ...u,
1191
- ref: f,
1191
+ ref: h,
1192
1192
  onFocus: () => {
1193
- if (h("end"), C(!Y), c.current) {
1194
- c.current.updateValue();
1195
- const m = c.current.value || "";
1196
- !(c.current.unmaskedValue || "") && !m.replace(/[^0-9]/g, "") && (c.current.value = "", c.current.updateValue());
1193
+ if (f("end"), C(!I), d.current) {
1194
+ d.current.updateValue();
1195
+ const m = d.current.value || "";
1196
+ !(d.current.unmaskedValue || "") && !m.replace(/[^0-9]/g, "") && (d.current.value = "", d.current.updateValue());
1197
1197
  }
1198
1198
  },
1199
1199
  onBlur: () => {
1200
- Z();
1200
+ ne();
1201
1201
  },
1202
1202
  onKeyDown: (m) => {
1203
1203
  if (m.key === "Backspace") {
1204
- const F = c.current?.value || "", V = c.current?.unmaskedValue || "";
1205
- if (F === "" || V === "" || F.replace(/[^0-9]/g, "").length <= 1) {
1204
+ const E = d.current?.value || "", L = d.current?.unmaskedValue || "";
1205
+ if (E === "" || L === "" || E.replace(/[^0-9]/g, "").length <= 1) {
1206
1206
  m.preventDefault();
1207
- const w = Array.isArray(a) ? [...a, 1] : [a, 1];
1208
- g.setFieldValue(w, void 0), b([k[0], null]), c.current && (c.current.value = "", c.current.updateValue()), setTimeout(() => {
1209
- i.current?.focus(), h("start"), C(!0);
1207
+ const k = Array.isArray(l) ? [...l, 1] : [l, 1];
1208
+ p.setFieldValue(k, void 0), S([D[0], null]), d.current && (d.current.value = "", d.current.updateValue()), setTimeout(() => {
1209
+ c.current?.focus(), f("start"), C(!0);
1210
1210
  }, 0);
1211
1211
  return;
1212
1212
  }
1213
- h("end"), C(!0);
1213
+ f("end"), C(!0);
1214
1214
  }
1215
1215
  if (m.key === "Tab" && C(!1), m.key === "Enter")
1216
- if (Y && E === "end") {
1217
- const F = c.current?.value || "";
1218
- F.length === n.length ? N(F, n, !0).isValid() ? (C(!1), p(!1)) : l?.allowEmpty ? p(!1) : p(!0) : p(!1);
1216
+ if (I && F === "end") {
1217
+ const E = d.current?.value || "";
1218
+ E.length === r.length ? N(E, r, !0).isValid() ? (C(!1), g(!1)) : a?.allowEmpty ? g(!1) : g(!0) : g(!1);
1219
1219
  } else
1220
- h("end"), C(!0);
1220
+ f("end"), C(!0);
1221
1221
  },
1222
1222
  style: {
1223
1223
  flex: 1
1224
1224
  },
1225
1225
  allowClear: !0,
1226
1226
  onClear: () => {
1227
- const m = Array.isArray(a) ? [...a, 1] : [a, 1];
1228
- g.setFieldValue(m, void 0), b([k[0], null]), c.current && (c.current.value = "", c.current.updateValue()), setTimeout(() => {
1229
- i.current?.focus(), h("start"), C(!0);
1227
+ const m = Array.isArray(l) ? [...l, 1] : [l, 1];
1228
+ p.setFieldValue(m, void 0), S([D[0], null]), d.current && (d.current.value = "", d.current.updateValue()), setTimeout(() => {
1229
+ c.current?.focus(), f("start"), C(!0);
1230
1230
  }, 0);
1231
1231
  },
1232
1232
  placeholder: o.replace(/0/g, "_"),
1233
- suffix: /* @__PURE__ */ t(me, { style: { color: "#d9d9d9" } }),
1233
+ suffix: /* @__PURE__ */ e(pe, { style: { color: "#d9d9d9" } }),
1234
1234
  autoComplete: "off"
1235
1235
  }
1236
1236
  )
@@ -1239,23 +1239,23 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1239
1239
  ]
1240
1240
  }
1241
1241
  ),
1242
- /* @__PURE__ */ t(
1243
- St,
1242
+ /* @__PURE__ */ e(
1243
+ bt,
1244
1244
  {
1245
- ...l,
1246
- open: Y,
1247
- picker: e,
1245
+ ...a,
1246
+ open: I,
1247
+ picker: t,
1248
1248
  format: {
1249
- format: n,
1249
+ format: r,
1250
1250
  type: "mask"
1251
1251
  },
1252
1252
  showNow: !0,
1253
- value: k,
1254
- onChange: re,
1253
+ value: D,
1254
+ onChange: ae,
1255
1255
  onOpenChange: (m) => {
1256
- C(m), m || Z(!1);
1256
+ C(m), m || ne(!1);
1257
1257
  },
1258
- renderExtraFooter: () => O ? /* @__PURE__ */ T(
1258
+ renderExtraFooter: () => T ? /* @__PURE__ */ O(
1259
1259
  "div",
1260
1260
  {
1261
1261
  style: {
@@ -1269,8 +1269,8 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1269
1269
  backgroundColor: "#fffbe6"
1270
1270
  },
1271
1271
  children: [
1272
- /* @__PURE__ */ t(Ie, {}),
1273
- /* @__PURE__ */ t("span", { children: "유효하지 않은 날짜입니다" })
1272
+ /* @__PURE__ */ e(Ae, {}),
1273
+ /* @__PURE__ */ e("span", { children: "유효하지 않은 날짜입니다" })
1274
1274
  ]
1275
1275
  }
1276
1276
  ) : null,
@@ -1290,46 +1290,46 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1290
1290
  )
1291
1291
  }
1292
1292
  );
1293
- }, { Option: we } = he, tn = ({ itemProps: e, inputProps: r }) => {
1294
- const [u, l] = z([]);
1295
- return G(() => {
1296
- r?.addField === "ALL" ? l([
1293
+ }, { Option: Se } = Ce, on = ({ itemProps: t, inputProps: n }) => {
1294
+ const [u, a] = P([]);
1295
+ return X(() => {
1296
+ n?.addField === "ALL" ? a([
1297
1297
  { label: "전체", value: "" },
1298
- ...r?.list || []
1299
- ]) : r?.addField === "NULL" ? l([{ label: "", value: "" }, ...r?.list || []]) : l(r?.list || []);
1300
- }, [r?.list]), /* @__PURE__ */ t(
1301
- R,
1298
+ ...n?.list || []
1299
+ ]) : n?.addField === "NULL" ? a([{ label: "", value: "" }, ...n?.list || []]) : a(n?.list || []);
1300
+ }, [n?.list]), /* @__PURE__ */ e(
1301
+ G,
1302
1302
  {
1303
- ...e,
1304
- getValueProps: (n) => n ? {
1305
- value: n && n.indexOf(",") > 0 ? n.split(",") : [n]
1303
+ ...t,
1304
+ getValueProps: (r) => r ? {
1305
+ value: r && r.indexOf(",") > 0 ? r.split(",") : [r]
1306
1306
  } : {
1307
1307
  value: []
1308
1308
  },
1309
- normalize: (n) => n != null && n != null && n.length > 0 ? n.toString() : "",
1310
- children: /* @__PURE__ */ t(he, { ...r, mode: "multiple", children: u.map((n) => {
1311
- const { value: o, label: d } = n;
1312
- return r?.printCode ? /* @__PURE__ */ t(we, { value: o, label: d, children: /* @__PURE__ */ t(j, { children: `[${o}] ${d}` }) }, o) : /* @__PURE__ */ t(we, { value: o, label: d, children: /* @__PURE__ */ t(j, { children: `${d}` }) }, o);
1309
+ normalize: (r) => r != null && r != null && r.length > 0 ? r.toString() : "",
1310
+ children: /* @__PURE__ */ e(Ce, { ...n, mode: "multiple", children: u.map((r) => {
1311
+ const { value: o, label: i } = r;
1312
+ return n?.printCode ? /* @__PURE__ */ e(Se, { value: o, label: i, children: /* @__PURE__ */ e($, { children: `[${o}] ${i}` }) }, o) : /* @__PURE__ */ e(Se, { value: o, label: i, children: /* @__PURE__ */ e($, { children: `${i}` }) }, o);
1313
1313
  }) })
1314
1314
  }
1315
1315
  );
1316
- }, nn = ({ itemProps: e, inputProps: r }) => {
1317
- const u = (n) => {
1318
- let o = n.toString().split(".");
1319
- return r?.decimalPoint != null && o[1] != null && r?.decimalPoint > 0 ? o[1].length > r?.decimalPoint ? o[1] = "." + o[1].substring(0, r?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + o[1];
1320
- }, l = (n) => {
1321
- let o = n.toString().split(".");
1322
- return r?.decimalPoint != null && o[1] != null && r?.decimalPoint > 0 ? o[1].length > r?.decimalPoint ? o[1] = "." + o[1].substring(0, r?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\$\s?|(,*)/g, "") + o[1];
1316
+ }, ln = ({ itemProps: t, inputProps: n }) => {
1317
+ const u = (r) => {
1318
+ let o = r.toString().split(".");
1319
+ return n?.decimalPoint != null && o[1] != null && n?.decimalPoint > 0 ? o[1].length > n?.decimalPoint ? o[1] = "." + o[1].substring(0, n?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + o[1];
1320
+ }, a = (r) => {
1321
+ let o = r.toString().split(".");
1322
+ return n?.decimalPoint != null && o[1] != null && n?.decimalPoint > 0 ? o[1].length > n?.decimalPoint ? o[1] = "." + o[1].substring(0, n?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\$\s?|(,*)/g, "") + o[1];
1323
1323
  };
1324
- return /* @__PURE__ */ t(R, { ...e, children: /* @__PURE__ */ t(
1325
- Pe,
1324
+ return /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(
1325
+ je,
1326
1326
  {
1327
- ...r,
1328
- formatter: (n) => u(n),
1329
- parser: (n) => l(n)
1327
+ ...n,
1328
+ formatter: (r) => u(r),
1329
+ parser: (r) => a(r)
1330
1330
  }
1331
1331
  ) });
1332
- }, rn = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, children: /* @__PURE__ */ t($e.Group, { ...r }) }), { RangePicker: Et } = ce, Ye = {
1332
+ }, an = ({ itemProps: t, inputProps: n }) => /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(Xe.Group, { ...n }) }), { RangePicker: Yt } = ue, be = {
1333
1333
  year: { displayFormat: "YYYY", outputFormat: "YYYY" },
1334
1334
  month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
1335
1335
  date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
@@ -1338,141 +1338,141 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1338
1338
  displayFormat: "YYYY-MM-DD HH:mm",
1339
1339
  outputFormat: "YYYYMMDDHHmm"
1340
1340
  }
1341
- }, on = ({
1342
- itemProps: e,
1343
- inputProps: r,
1341
+ }, sn = ({
1342
+ itemProps: t,
1343
+ inputProps: n,
1344
1344
  type: u = "date",
1345
- minDate: l,
1346
- maxDate: n,
1345
+ minDate: a,
1346
+ maxDate: r,
1347
1347
  returnType: o = "string"
1348
1348
  }) => {
1349
- const { displayFormat: d, outputFormat: i } = q(
1350
- () => Ye[u],
1349
+ const { displayFormat: i, outputFormat: c } = q(
1350
+ () => be[u],
1351
1351
  [u]
1352
- ), f = q(
1353
- () => Object.values(Ye).map((s) => s.outputFormat).sort((s, c) => {
1354
- if (s.length === c.length) {
1355
- if (s === i) return -1;
1356
- if (c === i) return 1;
1352
+ ), h = q(
1353
+ () => Object.values(be).map((s) => s.outputFormat).sort((s, d) => {
1354
+ if (s.length === d.length) {
1355
+ if (s === c) return -1;
1356
+ if (d === c) return 1;
1357
1357
  }
1358
- return c.length - s.length;
1358
+ return d.length - s.length;
1359
1359
  }),
1360
- [i]
1360
+ [c]
1361
1361
  // type(outputFormat)이 바뀔 때마다 재정렬
1362
1362
  );
1363
- return /* @__PURE__ */ t(
1364
- R,
1363
+ return /* @__PURE__ */ e(
1364
+ G,
1365
1365
  {
1366
- ...e,
1366
+ ...t,
1367
1367
  getValueProps: (s) => ({
1368
1368
  // 폼에 저장된 값(문자열 또는 Dayjs)을 RangePicker가 요구하는 Dayjs 배열로 변환
1369
1369
  value: s && s.length > 0 ? [
1370
- s[0] ? N.isDayjs(s[0]) ? s[0] : N(s[0], f) : null,
1371
- s[1] ? N.isDayjs(s[1]) ? s[1] : N(s[1], f) : null
1370
+ s[0] ? N.isDayjs(s[0]) ? s[0] : N(s[0], h) : null,
1371
+ s[1] ? N.isDayjs(s[1]) ? s[1] : N(s[1], h) : null
1372
1372
  ] : null
1373
1373
  }),
1374
1374
  normalize: (s) => s ? o === "dayjs" ? [s[0] ?? void 0, s[1] ?? void 0] : [
1375
- s[0] ? s[0].format(i) : void 0,
1376
- s[1] ? s[1].format(i) : void 0
1375
+ s[0] ? s[0].format(c) : void 0,
1376
+ s[1] ? s[1].format(c) : void 0
1377
1377
  ] : [void 0, void 0],
1378
- children: /* @__PURE__ */ t(
1379
- Et,
1378
+ children: /* @__PURE__ */ e(
1379
+ Yt,
1380
1380
  {
1381
- ...r,
1381
+ ...n,
1382
1382
  order: !0,
1383
- minDate: l ? N(l, f) : void 0,
1384
- maxDate: n ? N(n, f) : void 0,
1383
+ minDate: a ? N(a, h) : void 0,
1384
+ maxDate: r ? N(r, h) : void 0,
1385
1385
  picker: u === "datetime" ? "date" : u,
1386
- showTime: r?.showTime ?? (u === "datetime" || u === "time"),
1387
- format: d
1386
+ showTime: n?.showTime ?? (u === "datetime" || u === "time"),
1387
+ format: i
1388
1388
  }
1389
1389
  )
1390
1390
  }
1391
1391
  );
1392
- }, be = X.Search, an = (e) => {
1393
- const r = D.useFormInstance(), { openPopup: u } = Ke(), l = e.itemProps?.name || [], n = e.popupConfig || {
1394
- callback(d) {
1395
- Array.isArray(l) && l.length > 1 ? (r.setFieldValue(l[0], d.code), r.setFieldValue(l[1], d.name)) : r.setFieldValue(l, d.code);
1392
+ }, Le = K.Search, cn = (t) => {
1393
+ const n = x.useFormInstance(), { openPopup: u } = et(), a = t.itemProps?.name || [], r = t.popupConfig || {
1394
+ callback(i) {
1395
+ Array.isArray(a) && a.length > 1 ? (n.setFieldValue(a[0], i.code), n.setFieldValue(a[1], i.name)) : n.setFieldValue(a, i.code);
1396
1396
  }
1397
1397
  }, o = {
1398
- ...e,
1399
- placeholder: typeof e.placeholder == "string" ? e.placeholder : e.placeholder?.[0] || "",
1400
- onChange: (d) => {
1401
- Array.isArray(l) && l.length > 1 && r.setFieldValue(l[0], ""), e.onChange?.(d);
1398
+ ...t,
1399
+ placeholder: typeof t.placeholder == "string" ? t.placeholder : t.placeholder?.[0] || "",
1400
+ onChange: (i) => {
1401
+ Array.isArray(a) && a.length > 1 && n.setFieldValue(a[0], ""), t.onChange?.(i);
1402
1402
  },
1403
- onSearch: (d) => {
1404
- e.popuCd ? u(e.popuCd, e.popupParams, n) : e.onSearch?.(d);
1403
+ onSearch: (i) => {
1404
+ t.popuCd ? u(t.popuCd, t.popupParams, r) : t.onSearch?.(i);
1405
1405
  }
1406
1406
  };
1407
- return Array.isArray(l) && l.length > 1 ? /* @__PURE__ */ t(R, { ...e.itemProps, name: void 0, children: /* @__PURE__ */ T(j.Compact, { block: !0, children: [
1408
- /* @__PURE__ */ t(
1409
- D.Item,
1407
+ return Array.isArray(a) && a.length > 1 ? /* @__PURE__ */ e(G, { ...t.itemProps, name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
1408
+ /* @__PURE__ */ e(
1409
+ x.Item,
1410
1410
  {
1411
- name: l[0],
1412
- rules: e.itemProps?.rules,
1411
+ name: a[0],
1412
+ rules: t.itemProps?.rules,
1413
1413
  style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
1414
1414
  validateStatus: "",
1415
1415
  help: "",
1416
- children: /* @__PURE__ */ t(
1417
- X,
1416
+ children: /* @__PURE__ */ e(
1417
+ K,
1418
1418
  {
1419
1419
  style: { color: "#999", backgroundColor: "#f5f5f5" },
1420
- placeholder: e.placeholder?.[0] || "",
1420
+ placeholder: t.placeholder?.[0] || "",
1421
1421
  readOnly: !0
1422
1422
  }
1423
1423
  )
1424
1424
  }
1425
1425
  ),
1426
- /* @__PURE__ */ t(D.Item, { name: l[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ t(
1427
- be,
1426
+ /* @__PURE__ */ e(x.Item, { name: a[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ e(
1427
+ Le,
1428
1428
  {
1429
- readOnly: e.readOnly,
1430
- enterButton: /* @__PURE__ */ t(
1431
- J,
1429
+ readOnly: t.readOnly,
1430
+ enterButton: /* @__PURE__ */ e(
1431
+ ee,
1432
1432
  {
1433
- icon: /* @__PURE__ */ t(ge, {}),
1434
- disabled: e.readOnly
1433
+ icon: /* @__PURE__ */ e(Fe, {}),
1434
+ disabled: t.readOnly
1435
1435
  }
1436
1436
  ),
1437
1437
  ...o
1438
1438
  }
1439
1439
  ) })
1440
- ] }) }) : /* @__PURE__ */ t(R, { ...e.itemProps, children: /* @__PURE__ */ t(be, { ...o }) });
1441
- }, ln = ({
1442
- itemProps: e,
1443
- selectProps: r = {
1440
+ ] }) }) : /* @__PURE__ */ e(G, { ...t.itemProps, children: /* @__PURE__ */ e(Le, { ...o }) });
1441
+ }, dn = ({
1442
+ itemProps: t,
1443
+ selectProps: n = {
1444
1444
  options: [],
1445
1445
  allowClear: !0
1446
1446
  }
1447
1447
  }) => {
1448
- const u = D.useFormInstance(), l = !!u, n = q(() => r?.addField === "ALL" ? [{ label: "전체", value: "" }, ...r?.options || []] : r?.addField === "NULL" ? [{ label: "", value: "" }, ...r?.options || []] : r?.options || [], [r.options, r.addField]), o = (f) => {
1449
- r.onChange?.(f);
1450
- }, d = {
1451
- ...r,
1452
- allowClear: r.allowClear ?? !0,
1453
- options: n,
1448
+ const u = x.useFormInstance(), a = !!u, r = q(() => n?.addField === "ALL" ? [{ label: "전체", value: "" }, ...n?.options || []] : n?.addField === "NULL" ? [{ label: "", value: "" }, ...n?.options || []] : n?.options || [], [n.options, n.addField]), o = (h) => {
1449
+ n.onChange?.(h);
1450
+ }, i = {
1451
+ ...n,
1452
+ allowClear: n.allowClear ?? !0,
1453
+ options: r,
1454
1454
  onChange: o,
1455
- variant: r.variant
1456
- }, i = /* @__PURE__ */ t(he, { ...d, disabled: r.disabled });
1457
- return r.copyable && !l && console.warn(
1455
+ variant: n.variant
1456
+ }, c = /* @__PURE__ */ e(Ce, { ...i, disabled: n.disabled });
1457
+ return n.copyable && !a && console.warn(
1458
1458
  "BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."
1459
- ), r.copyable ? /* @__PURE__ */ t(R, { ...e, name: void 0, children: /* @__PURE__ */ T(j.Compact, { block: !0, children: [
1460
- /* @__PURE__ */ t(
1461
- D.Item,
1459
+ ), n.copyable ? /* @__PURE__ */ e(G, { ...t, name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
1460
+ /* @__PURE__ */ e(
1461
+ x.Item,
1462
1462
  {
1463
- name: e?.name,
1464
- rules: e?.rules,
1463
+ name: t?.name,
1464
+ rules: t?.rules,
1465
1465
  style: { width: "100%", marginBottom: 0 },
1466
1466
  validateStatus: "",
1467
1467
  help: "",
1468
- children: i
1468
+ children: c
1469
1469
  }
1470
1470
  ),
1471
- /* @__PURE__ */ t(
1471
+ /* @__PURE__ */ e(
1472
1472
  fe.Paragraph,
1473
1473
  {
1474
1474
  copyable: {
1475
- text: l && u?.getFieldValue(e?.name)?.toString() || "",
1475
+ text: a && u?.getFieldValue(t?.name)?.toString() || "",
1476
1476
  tooltips: ["코드복사", "코드복사됨"]
1477
1477
  },
1478
1478
  style: {
@@ -1489,99 +1489,99 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1489
1489
  }
1490
1490
  }
1491
1491
  )
1492
- ] }) }) : /* @__PURE__ */ t(R, { ...e, children: i });
1493
- }, sn = ({
1494
- itemProps: e,
1495
- inputProps: r = {
1492
+ ] }) }) : /* @__PURE__ */ e(G, { ...t, children: c });
1493
+ }, un = ({
1494
+ itemProps: t,
1495
+ inputProps: n = {
1496
1496
  format: "YN"
1497
1497
  }
1498
1498
  }) => {
1499
- const u = D.useFormInstance(), l = (n, o) => {
1500
- r.format === "boolean" ? u.setFieldValue(e?.name, n) : u.setFieldValue(e?.name, n ? "Y" : "N"), r.onChange && r.onChange(n, o);
1499
+ const u = x.useFormInstance(), a = (r, o) => {
1500
+ n.format === "boolean" ? u.setFieldValue(t?.name, r) : u.setFieldValue(t?.name, r ? "Y" : "N"), n.onChange && n.onChange(r, o);
1501
1501
  };
1502
- return /* @__PURE__ */ t(
1503
- R,
1502
+ return /* @__PURE__ */ e(
1503
+ G,
1504
1504
  {
1505
- ...e,
1506
- getValueProps: (n) => ({ checked: r.format === "boolean" ? !!n : n === "Y" }),
1507
- normalize: (n) => typeof n == "boolean" ? r.format === "boolean" ? n : n ? "Y" : "N" : r.format === "boolean" ? !!n : n ? "Y" : "N",
1508
- children: /* @__PURE__ */ t(He, { ...r, onChange: (n, o) => l(n, o) })
1505
+ ...t,
1506
+ getValueProps: (r) => ({ checked: n.format === "boolean" ? !!r : r === "Y" }),
1507
+ normalize: (r) => typeof r == "boolean" ? n.format === "boolean" ? r : r ? "Y" : "N" : n.format === "boolean" ? !!r : r ? "Y" : "N",
1508
+ children: /* @__PURE__ */ e(Ke, { ...n, onChange: (r, o) => a(r, o) })
1509
1509
  }
1510
1510
  );
1511
- }, { TextArea: Dt } = X, cn = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, children: /* @__PURE__ */ t(Dt, { ...r }) }), It = X.Search, dn = (e) => {
1512
- const r = D.useFormInstance(), { openCorePopup: u } = Le(), l = {
1511
+ }, { TextArea: Nt } = K, fn = ({ itemProps: t, inputProps: n }) => /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(Nt, { ...n }) }), xt = K.Search, mn = (t) => {
1512
+ const n = x.useFormInstance(), { openCorePopup: u } = Ue(), a = {
1513
1513
  value: "deptNm",
1514
1514
  fieldName: "deptNm",
1515
1515
  placeholder: "부서명"
1516
- }, n = {
1516
+ }, r = {
1517
1517
  value: "empNm",
1518
1518
  fieldName: "empNm",
1519
1519
  placeholder: "사원명 입력"
1520
- }, o = e.field1 || l, d = e.field2 || n, i = Q(
1521
- (c) => {
1522
- r.setFieldValue(e.employeeFieldName || "employee", c), r.setFieldValue(e.empNoFieldName || "empNo", c.empNo ?? ""), r.setFieldValue(
1520
+ }, o = t.field1 || a, i = t.field2 || r, c = te(
1521
+ (d) => {
1522
+ n.setFieldValue(t.employeeFieldName || "employee", d), n.setFieldValue(t.empNoFieldName || "empNo", d.empNo ?? ""), n.setFieldValue(
1523
1523
  o.fieldName,
1524
- c[o.value || "deptNm"] ?? ""
1525
- ), r.setFieldValue(
1526
- d.fieldName,
1527
- c[d.value || "empNm"] ?? ""
1528
- ), e.onFinish?.();
1524
+ d[o.value || "deptNm"] ?? ""
1525
+ ), n.setFieldValue(
1526
+ i.fieldName,
1527
+ d[i.value || "empNm"] ?? ""
1528
+ ), t.onFinish?.();
1529
1529
  },
1530
- [r, o, d, e.employeeFieldName]
1531
- ), f = Q(
1532
- (c) => {
1530
+ [n, o, i, t.employeeFieldName]
1531
+ ), h = te(
1532
+ (d) => {
1533
1533
  u("CORE_ORGANIZATION_01", {
1534
1534
  onSelect: (y) => {
1535
- i(y);
1535
+ c(y);
1536
1536
  },
1537
1537
  defaultParams: {
1538
- keyword: c
1538
+ keyword: d
1539
1539
  }
1540
1540
  });
1541
1541
  },
1542
- [i, u]
1543
- ), s = Q(
1544
- async (c) => {
1545
- const y = c?.trim();
1542
+ [c, u]
1543
+ ), s = te(
1544
+ async (d) => {
1545
+ const y = d?.trim();
1546
1546
  if (y)
1547
1547
  try {
1548
- const g = await te(
1548
+ const p = await oe(
1549
1549
  "SCMUTIL00101",
1550
1550
  {
1551
1551
  keyword: y
1552
1552
  },
1553
1553
  { showLoading: !1 }
1554
- ), Y = g?.empList || [];
1555
- if (g?.empCnt === 0) {
1556
- x.warning(
1554
+ ), I = p?.empList || [];
1555
+ if (p?.empCnt === 0) {
1556
+ w.warning(
1557
1557
  "일치하는 사원을 찾을 수 없어 팝업을 열립니다. 사원을 선택해주세요."
1558
- ), f();
1558
+ ), h();
1559
1559
  return;
1560
1560
  }
1561
- if (g?.empCnt > 1) {
1562
- x.info(
1561
+ if (p?.empCnt > 1) {
1562
+ w.info(
1563
1563
  "여러 건이 검색되어 팝업이 열립니다. 사원을 선택해주세요."
1564
- ), f(y);
1564
+ ), h(y);
1565
1565
  return;
1566
1566
  }
1567
- const C = Y[0];
1568
- i(C);
1569
- } catch (g) {
1570
- console.error("사원 검색 서비스 실패:", g), x.error("사원 검색 중 오류가 발생했습니다.");
1567
+ const C = I[0];
1568
+ c(C);
1569
+ } catch (p) {
1570
+ console.error("사원 검색 서비스 실패:", p), w.error("사원 검색 중 오류가 발생했습니다.");
1571
1571
  }
1572
1572
  },
1573
- [i, f]
1573
+ [c, h]
1574
1574
  );
1575
- return /* @__PURE__ */ t(R, { label: e.label || "사원", name: void 0, children: /* @__PURE__ */ T(j.Compact, { block: !0, children: [
1576
- /* @__PURE__ */ t(
1577
- D.Item,
1575
+ return /* @__PURE__ */ e(G, { label: t.label || "사원", name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
1576
+ /* @__PURE__ */ e(
1577
+ x.Item,
1578
1578
  {
1579
1579
  name: o.fieldName,
1580
1580
  style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
1581
1581
  validateStatus: "",
1582
1582
  help: "",
1583
- children: /* @__PURE__ */ t(
1584
- X,
1583
+ children: /* @__PURE__ */ e(
1584
+ K,
1585
1585
  {
1586
1586
  style: { color: "#999", backgroundColor: "#f5f5f5" },
1587
1587
  placeholder: o.placeholder,
@@ -1590,301 +1590,114 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1590
1590
  )
1591
1591
  }
1592
1592
  ),
1593
- /* @__PURE__ */ t(
1594
- D.Item,
1593
+ /* @__PURE__ */ e(
1594
+ x.Item,
1595
1595
  {
1596
- name: e.employeeFieldName || "employee",
1596
+ name: t.employeeFieldName || "employee",
1597
1597
  hidden: !0
1598
1598
  }
1599
1599
  ),
1600
- /* @__PURE__ */ t(D.Item, { name: e.empNoFieldName || "empNo", hidden: !0 }),
1601
- /* @__PURE__ */ t(
1602
- D.Item,
1600
+ /* @__PURE__ */ e(x.Item, { name: t.empNoFieldName || "empNo", hidden: !0 }),
1601
+ /* @__PURE__ */ e(
1602
+ x.Item,
1603
1603
  {
1604
- name: d.fieldName,
1604
+ name: i.fieldName,
1605
1605
  style: { width: "60%", marginBottom: 0 },
1606
- children: /* @__PURE__ */ t(
1607
- It,
1606
+ children: /* @__PURE__ */ e(
1607
+ xt,
1608
1608
  {
1609
1609
  allowClear: !0,
1610
- readOnly: e.readOnly,
1611
- placeholder: d.placeholder,
1612
- enterButton: /* @__PURE__ */ t(
1613
- J,
1610
+ readOnly: t.readOnly,
1611
+ placeholder: i.placeholder,
1612
+ enterButton: /* @__PURE__ */ e(
1613
+ ee,
1614
1614
  {
1615
- icon: /* @__PURE__ */ t(ge, {}),
1616
- disabled: e.readOnly,
1615
+ icon: /* @__PURE__ */ e(Fe, {}),
1616
+ disabled: t.readOnly,
1617
1617
  onClick: () => {
1618
- f();
1618
+ h();
1619
1619
  }
1620
1620
  }
1621
1621
  ),
1622
1622
  onSearch: s,
1623
- onChange: (c) => {
1624
- r.setFieldValue(o.fieldName, ""), r.setFieldValue(e.employeeFieldName || "employee", null), r.setFieldValue(e.empNoFieldName || "empNo", "");
1623
+ onChange: (d) => {
1624
+ n.setFieldValue(o.fieldName, ""), n.setFieldValue(t.employeeFieldName || "employee", null), n.setFieldValue(t.empNoFieldName || "empNo", "");
1625
1625
  }
1626
1626
  }
1627
1627
  )
1628
1628
  }
1629
1629
  )
1630
1630
  ] }) });
1631
- }, { Text: Se } = fe, v = {
1632
- IDLE: "idle",
1633
- UPLOADING: "uploading",
1634
- UPLOADED: "uploaded",
1635
- EXECUTING: "executing",
1636
- COMPLETED: "completed",
1637
- FAILED: "failed"
1638
- }, Nt = {
1639
- [v.IDLE]: "엑셀 파일을 선택해 업로드 해 주세요. (xlsx, xls, csv만 가능)",
1640
- [v.UPLOADING]: "엑셀 업로드 중입니다. 잠시만 기다려 주세요.",
1641
- [v.UPLOADED]: "엑셀 업로드가 완료되었습니다.",
1642
- [v.EXECUTING]: "배치 작업 실행 중입니다. 잠시만 기다려 주세요.",
1643
- [v.COMPLETED]: "배치 작업이 완료되었습니다.",
1644
- [v.FAILED]: "배치 작업이 실패했습니다."
1645
- }, un = ({
1646
- label: e = "엑셀 업로드",
1647
- jobId: r,
1648
- extraParams: u,
1649
- onFinish: l,
1650
- disabled: n = !1
1651
- }) => {
1652
- const [o, d] = z(v.IDLE), [i, f] = z(null), [s, c] = z(null), y = Q(async () => {
1653
- if (!(!i || !s)) {
1654
- if (!r) {
1655
- x.warning("실행 job id(jobId)가 설정되어 있지 않습니다.");
1656
- return;
1657
- }
1658
- try {
1659
- if (!s.filePath) {
1660
- x.error("파일 URL 정보가 없습니다.");
1661
- return;
1662
- }
1663
- d(v.EXECUTING);
1664
- const p = {
1665
- crprCd: Ne(),
1666
- sysCd: window.__SYS_CD__ || "",
1667
- fileKey: s.fileKey,
1668
- filePath: s.filePath,
1669
- jobId: r
1670
- }, E = await te("SCMUTIL00301", {
1671
- ...p,
1672
- ...u
1673
- });
1674
- E?.success ? (g(), x.success(
1675
- E?.message || "배치 실행 요청이 성공적으로 완료되었습니다."
1676
- )) : (d(v.FAILED), x.error(E?.message || "배치 실행 요청에 실패했습니다."));
1677
- } catch (p) {
1678
- console.error("배치 실행 요청에 실패했습니다.", p), x.error("배치 실행 요청에 실패했습니다."), d(v.FAILED);
1679
- }
1680
- }
1681
- }, [i, s, r, u]), g = Q(async () => {
1682
- setTimeout(async () => {
1683
- try {
1684
- const p = await te("SCMUTIL00302", {
1685
- jobId: r
1686
- });
1687
- if (p?.status === "COMPLETED") {
1688
- d(v.COMPLETED), x.success("배치 작업이 완료되었습니다."), l?.();
1689
- return;
1690
- } else if (p?.status === "FAILED") {
1691
- d(v.FAILED), x.error("배치 작업이 실패했습니다.");
1692
- return;
1693
- } else {
1694
- setTimeout(g, 1e3);
1695
- return;
1696
- }
1697
- } catch (p) {
1698
- console.error("배치 작업 상태 확인 오류:", p), d(v.FAILED), x.error("배치 작업 상태 확인 중 오류가 발생했습니다.");
1699
- }
1700
- }, 3e3);
1701
- }, [r, l]), Y = q(
1702
- () => ({
1703
- name: "file",
1704
- accept: ".xlsx, .xls, .csv",
1705
- listType: "picture",
1706
- multiple: !1,
1707
- action: "/api/upload",
1708
- showUploadList: {
1709
- showRemoveIcon: !0
1710
- },
1711
- beforeUpload: (p) => {
1712
- const E = `.${p.name.split(".").pop()?.toLowerCase()}`;
1713
- if (![".xlsx", ".xls", ".csv"].includes(E))
1714
- return x.error(
1715
- `${p.name} 파일은 허용되지 않는 확장자입니다. (xlsx, xls, csv만 가능)`
1716
- ), ee.LIST_IGNORE;
1717
- },
1718
- onChange: (p) => {
1719
- const { status: E } = p.file;
1720
- if (E === "removed") {
1721
- f(null), d(v.IDLE), c(null);
1722
- return;
1723
- }
1724
- if (f(p.file), E === "uploading") {
1725
- d(v.UPLOADING);
1726
- return;
1727
- }
1728
- if (E === "done") {
1729
- if (p.file.response?.success) {
1730
- d(v.UPLOADED);
1731
- const h = p.file.response.uploadedFiles[0] || {};
1732
- c({
1733
- fileKey: h.fileKey,
1734
- filePath: h.filePath,
1735
- fileNameL: h.fileNameL,
1736
- fileNameP: h.fileNameP,
1737
- fileSize: h.fileSize,
1738
- fileExt: h.fileExt
1739
- });
1740
- } else
1741
- d(v.IDLE), x.error(
1742
- p.file.response?.message || `${p.file.name} 파일 업로드에 실패했습니다.`
1743
- );
1744
- return;
1745
- }
1746
- E === "error" && (d(v.IDLE), x.error(
1747
- p.file.response?.message || `${p.file.name} 파일 업로드 중 오류가 발생했습니다.`
1748
- ));
1749
- }
1750
- }),
1751
- []
1752
- ), C = q(
1753
- () => /* @__PURE__ */ T(j, { direction: "vertical", style: { width: 400 }, children: [
1754
- /* @__PURE__ */ T(j, { children: [
1755
- o === v.EXECUTING && /* @__PURE__ */ t(Ee, { size: "small" }),
1756
- /* @__PURE__ */ t(Se, { type: o === v.FAILED ? "danger" : "secondary", children: Nt[o] })
1757
- ] }),
1758
- o !== v.EXECUTING && o !== v.COMPLETED && o !== v.FAILED && /* @__PURE__ */ t(ee, { ...Y, children: !i && /* @__PURE__ */ t(oe, { icon: /* @__PURE__ */ t(ae, {}), children: "파일 선택" }) }),
1759
- o === v.UPLOADED && /* @__PURE__ */ t(j, { direction: "vertical", children: /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
1760
- oe,
1761
- {
1762
- type: "primary",
1763
- icon: /* @__PURE__ */ t(rt, {}),
1764
- onClick: y,
1765
- disabled: !i,
1766
- children: "실행하기"
1767
- }
1768
- ) }) }),
1769
- (o === v.COMPLETED || o === v.FAILED) && /* @__PURE__ */ t(j, { direction: "vertical", children: /* @__PURE__ */ T(j, { children: [
1770
- /* @__PURE__ */ t(oe, { icon: /* @__PURE__ */ t(ot, {}), onClick: y, children: "다시 실행하기" }),
1771
- /* @__PURE__ */ t(
1772
- oe,
1773
- {
1774
- icon: /* @__PURE__ */ t(ae, {}),
1775
- onClick: () => {
1776
- d(v.IDLE), f(null), c(null);
1777
- },
1778
- children: "다른 파일 업로드"
1779
- }
1780
- )
1781
- ] }) })
1782
- ] }),
1783
- [o, i, y, Y]
1784
- ), O = /* @__PURE__ */ t(oe, { icon: /* @__PURE__ */ t(ae, {}), disabled: n, children: e });
1785
- return n ? /* @__PURE__ */ t(
1786
- Fe,
1787
- {
1788
- title: /* @__PURE__ */ T("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1789
- /* @__PURE__ */ t(at, { style: { color: "#faad14", fontSize: 16 } }),
1790
- /* @__PURE__ */ t("span", { style: { fontWeight: 600 }, children: "'엑셀 업로드' 버튼에 대한 사용 권한이 없습니다." })
1791
- ] }),
1792
- content: /* @__PURE__ */ t(
1793
- "div",
1794
- {
1795
- style: {
1796
- display: "flex",
1797
- flexDirection: "column",
1798
- gap: 4,
1799
- paddingLeft: 24
1800
- },
1801
- children: /* @__PURE__ */ t("span", { style: { fontSize: 12 }, children: "관리자에게 문의하세요." })
1802
- }
1803
- ),
1804
- placement: "bottom",
1805
- styles: { body: { backgroundColor: "#fffbe6" } },
1806
- children: /* @__PURE__ */ t("span", { children: O })
1807
- }
1808
- ) : /* @__PURE__ */ t(
1809
- Fe,
1810
- {
1811
- content: C,
1812
- title: /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", marginBottom: 0 }, children: /* @__PURE__ */ t(Se, { strong: !0, children: "엑셀 업로드" }) }),
1813
- trigger: "click",
1814
- placement: "bottom",
1815
- children: O
1816
- }
1817
- );
1818
- }, vt = X.Search, mn = (e) => {
1819
- const r = D.useFormInstance(), { openCorePopup: u } = Le(), l = {
1631
+ }, Vt = K.Search, hn = (t) => {
1632
+ const n = x.useFormInstance(), { openCorePopup: u } = Ue(), a = {
1820
1633
  value: "deptNm",
1821
1634
  fieldName: "deptNm",
1822
1635
  placeholder: "부서명"
1823
- }, n = e.field || l, o = Q(
1824
- (f) => {
1825
- r.setFieldValue(e.departmentFieldName || "department", f), r.setFieldValue(
1826
- n.fieldName,
1827
- f[n.value || "deptNm"] ?? ""
1828
- ), r.setFieldValue(
1829
- e.deptCdFieldName || "deptCd",
1830
- f.deptCd ?? ""
1831
- ), e.onFinish?.();
1636
+ }, r = t.field || a, o = te(
1637
+ (h) => {
1638
+ n.setFieldValue(t.departmentFieldName || "department", h), n.setFieldValue(
1639
+ r.fieldName,
1640
+ h[r.value || "deptNm"] ?? ""
1641
+ ), n.setFieldValue(
1642
+ t.deptCdFieldName || "deptCd",
1643
+ h.deptCd ?? ""
1644
+ ), t.onFinish?.();
1832
1645
  },
1833
- [r, n, e.departmentFieldName, e.deptCdFieldName]
1834
- ), d = Q(
1835
- (f) => {
1646
+ [n, r, t.departmentFieldName, t.deptCdFieldName]
1647
+ ), i = te(
1648
+ (h) => {
1836
1649
  u("CORE_DEPARTMENT_01", {
1837
1650
  onSelect: (s) => {
1838
1651
  o(s);
1839
1652
  },
1840
1653
  defaultParams: {
1841
- keyword: f
1654
+ keyword: h
1842
1655
  }
1843
1656
  });
1844
1657
  },
1845
1658
  [o, u]
1846
- ), i = Q(
1847
- async (f) => {
1848
- const s = f?.trim();
1659
+ ), c = te(
1660
+ async (h) => {
1661
+ const s = h?.trim();
1849
1662
  if (s)
1850
1663
  try {
1851
- const c = await te(
1664
+ const d = await oe(
1852
1665
  "SCMUTIL00103",
1853
1666
  {
1854
1667
  keyword: s
1855
1668
  },
1856
1669
  { showLoading: !1 }
1857
- ), y = c?.deptCnt ?? 0, g = c?.deptList || [];
1858
- if (y === 0 || g.length === 0) {
1859
- x.warning(
1670
+ ), y = d?.deptCnt ?? 0, p = d?.deptList || [];
1671
+ if (y === 0 || p.length === 0) {
1672
+ w.warning(
1860
1673
  "일치하는 부서를 찾을 수 없어 팝업을 열립니다. 부서를 선택해주세요."
1861
- ), d(s);
1674
+ ), i(s);
1862
1675
  return;
1863
1676
  }
1864
- if (y > 1 || g.length > 1) {
1865
- x.info(
1677
+ if (y > 1 || p.length > 1) {
1678
+ w.info(
1866
1679
  "여러 건이 검색되어 팝업이 열립니다. 부서를 선택해주세요."
1867
- ), d(s);
1680
+ ), i(s);
1868
1681
  return;
1869
1682
  }
1870
- const Y = g[0];
1871
- o(Y);
1872
- } catch (c) {
1873
- console.error("부서 검색 서비스 실패:", c), x.error("부서 검색 중 오류가 발생했습니다.");
1683
+ const I = p[0];
1684
+ o(I);
1685
+ } catch (d) {
1686
+ console.error("부서 검색 서비스 실패:", d), w.error("부서 검색 중 오류가 발생했습니다.");
1874
1687
  }
1875
1688
  },
1876
- [o, d]
1689
+ [o, i]
1877
1690
  );
1878
- return /* @__PURE__ */ t(R, { label: e.label || "부서", name: void 0, children: /* @__PURE__ */ T(j.Compact, { block: !0, children: [
1879
- /* @__PURE__ */ t(
1880
- D.Item,
1691
+ return /* @__PURE__ */ e(G, { label: t.label || "부서", name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
1692
+ /* @__PURE__ */ e(
1693
+ x.Item,
1881
1694
  {
1882
- name: e.deptCdFieldName || "deptCd",
1695
+ name: t.deptCdFieldName || "deptCd",
1883
1696
  style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
1884
1697
  validateStatus: "",
1885
1698
  help: "",
1886
- children: /* @__PURE__ */ t(
1887
- X,
1699
+ children: /* @__PURE__ */ e(
1700
+ K,
1888
1701
  {
1889
1702
  style: { color: "#999", backgroundColor: "#f5f5f5" },
1890
1703
  placeholder: "부서코드",
@@ -1893,38 +1706,38 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1893
1706
  )
1894
1707
  }
1895
1708
  ),
1896
- /* @__PURE__ */ t(
1897
- D.Item,
1709
+ /* @__PURE__ */ e(
1710
+ x.Item,
1898
1711
  {
1899
- name: e.departmentFieldName || "department",
1712
+ name: t.departmentFieldName || "department",
1900
1713
  hidden: !0
1901
1714
  }
1902
1715
  ),
1903
- /* @__PURE__ */ t(
1904
- D.Item,
1716
+ /* @__PURE__ */ e(
1717
+ x.Item,
1905
1718
  {
1906
- name: n.fieldName,
1719
+ name: r.fieldName,
1907
1720
  style: { width: "60%", marginBottom: 0 },
1908
- children: /* @__PURE__ */ t(
1909
- vt,
1721
+ children: /* @__PURE__ */ e(
1722
+ Vt,
1910
1723
  {
1911
1724
  allowClear: !0,
1912
- readOnly: e.readOnly,
1913
- placeholder: n.placeholder,
1914
- enterButton: /* @__PURE__ */ t(
1915
- J,
1725
+ readOnly: t.readOnly,
1726
+ placeholder: r.placeholder,
1727
+ enterButton: /* @__PURE__ */ e(
1728
+ ee,
1916
1729
  {
1917
- icon: /* @__PURE__ */ t(ge, {}),
1918
- disabled: e.readOnly,
1730
+ icon: /* @__PURE__ */ e(Fe, {}),
1731
+ disabled: t.readOnly,
1919
1732
  onClick: () => {
1920
- d();
1733
+ i();
1921
1734
  }
1922
1735
  }
1923
1736
  ),
1924
- onSearch: i,
1925
- onChange: (f) => {
1926
- r.setFieldValue(e.deptCdFieldName || "deptCd", ""), r.setFieldValue(
1927
- e.departmentFieldName || "department",
1737
+ onSearch: c,
1738
+ onChange: (h) => {
1739
+ n.setFieldValue(t.deptCdFieldName || "deptCd", ""), n.setFieldValue(
1740
+ t.departmentFieldName || "department",
1928
1741
  null
1929
1742
  );
1930
1743
  }
@@ -1933,54 +1746,54 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1933
1746
  }
1934
1747
  )
1935
1748
  ] }) });
1936
- }, xt = ({
1937
- originNode: e,
1938
- file: r,
1749
+ }, At = ({
1750
+ originNode: t,
1751
+ file: n,
1939
1752
  fileList: u,
1940
- moveFile: l,
1941
- onDrop: n
1753
+ moveFile: a,
1754
+ onDrop: r
1942
1755
  }) => {
1943
- const o = K(null), [{ handlerId: d }, i] = gt({
1756
+ const o = J(null), [{ handlerId: i }, c] = yt({
1944
1757
  accept: "file",
1945
1758
  collect: (y) => ({
1946
1759
  handlerId: y.getHandlerId()
1947
1760
  }),
1948
- hover(y, g) {
1761
+ hover(y, p) {
1949
1762
  if (!o.current)
1950
1763
  return;
1951
- const Y = y.uid, C = r.uid;
1952
- if (Y === C)
1764
+ const I = y.uid, C = n.uid;
1765
+ if (I === C)
1953
1766
  return;
1954
- const O = de(u, { uid: C }), p = de(u, { uid: Y });
1955
- if (p === -1 || O === -1)
1767
+ const T = me(u, { uid: C }), g = me(u, { uid: I });
1768
+ if (g === -1 || T === -1)
1956
1769
  return;
1957
- const E = o.current.getBoundingClientRect(), h = g.getClientOffset();
1958
- if (!h)
1770
+ const F = o.current.getBoundingClientRect(), f = p.getClientOffset();
1771
+ if (!f)
1959
1772
  return;
1960
- const P = (E.bottom - E.top) / 2, L = h.y - E.top;
1961
- p < O && L < P || p > O && L > P || l(Y, C);
1773
+ const v = (F.bottom - F.top) / 2, Y = f.y - F.top;
1774
+ g < T && Y < v || g > T && Y > v || a(I, C);
1962
1775
  },
1963
1776
  drop() {
1964
- n();
1777
+ r();
1965
1778
  }
1966
- }), [{ isDragging: f }, s] = pt({
1779
+ }), [{ isDragging: h }, s] = Ct({
1967
1780
  type: "file",
1968
1781
  item: () => ({
1969
- uid: r.uid,
1970
- index: de(u, { uid: r.uid })
1782
+ uid: n.uid,
1783
+ index: me(u, { uid: n.uid })
1971
1784
  }),
1972
1785
  collect: (y) => ({
1973
1786
  isDragging: y.isDragging()
1974
1787
  })
1975
- }), c = f ? 0 : 1;
1976
- return s(i(o)), /* @__PURE__ */ t("div", { ref: o, style: { opacity: c }, "data-handler-id": d, children: e });
1977
- }, Be = (e, r, u, l, n) => {
1978
- const o = u[0]?.uid === r.uid, d = Ge(e, {
1979
- href: r.url || void 0,
1788
+ }), d = h ? 0 : 1;
1789
+ return s(c(o)), /* @__PURE__ */ e("div", { ref: o, style: { opacity: d }, "data-handler-id": i, children: t });
1790
+ }, ze = (t, n, u, a, r) => {
1791
+ const o = u[0]?.uid === n.uid, i = Ze(t, {
1792
+ href: n.url || void 0,
1980
1793
  title: void 0
1981
1794
  });
1982
- return /* @__PURE__ */ T(_e, { children: [
1983
- o && /* @__PURE__ */ T(
1795
+ return /* @__PURE__ */ O($e, { children: [
1796
+ o && /* @__PURE__ */ O(
1984
1797
  "div",
1985
1798
  {
1986
1799
  style: {
@@ -1995,138 +1808,497 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
1995
1808
  ]
1996
1809
  }
1997
1810
  ),
1998
- /* @__PURE__ */ t(
1999
- xt,
1811
+ /* @__PURE__ */ e(
1812
+ At,
2000
1813
  {
2001
- originNode: d,
2002
- file: r,
1814
+ originNode: i,
1815
+ file: n,
2003
1816
  fileList: u,
2004
- moveFile: l,
2005
- onDrop: n
1817
+ moveFile: a,
1818
+ onDrop: r
2006
1819
  }
2007
1820
  )
2008
1821
  ] });
2009
- }, Te = (e, r) => {
2010
- const u = String(r || "");
2011
- return u.startsWith("picture") ? e.name.endsWith(".pdf") ? /* @__PURE__ */ t(lt, {}) : e.name.endsWith(".docx") || e.name.endsWith(".doc") ? /* @__PURE__ */ t(st, {}) : e.name.endsWith(".xlsx") || e.name.endsWith(".xls") ? /* @__PURE__ */ t(it, {}) : e.name.endsWith(".pptx") || e.name.endsWith(".ppt") ? /* @__PURE__ */ t(ct, {}) : /* @__PURE__ */ t(dt, {}) : u.startsWith("text") ? /* @__PURE__ */ t(ut, {}) : /* @__PURE__ */ t(mt, {});
2012
- }, fn = ({
2013
- listType: e = "picture",
2014
- buttonText: r = "파일 선택",
1822
+ }, Re = (t, n) => {
1823
+ const u = String(n || "");
1824
+ return u.startsWith("picture") ? t.name.endsWith(".pdf") ? /* @__PURE__ */ e(it, {}) : t.name.endsWith(".docx") || t.name.endsWith(".doc") ? /* @__PURE__ */ e(ct, {}) : t.name.endsWith(".xlsx") || t.name.endsWith(".xls") ? /* @__PURE__ */ e(dt, {}) : t.name.endsWith(".pptx") || t.name.endsWith(".ppt") ? /* @__PURE__ */ e(ut, {}) : /* @__PURE__ */ e(ft, {}) : u.startsWith("text") ? /* @__PURE__ */ e(mt, {}) : /* @__PURE__ */ e(ht, {});
1825
+ }, pn = ({
1826
+ listType: t = "picture",
1827
+ buttonText: n = "파일 선택",
2015
1828
  permissions: u,
2016
- multiple: l = !1,
2017
- fileGrpKey: n,
1829
+ multiple: a = !1,
1830
+ fileGrpKey: r,
2018
1831
  uploadProps: o,
2019
- heights: d,
2020
- ...i
1832
+ heights: i,
1833
+ ...c
2021
1834
  }) => {
2022
1835
  const {
2023
- defaultUploadProps: f,
1836
+ defaultUploadProps: h,
2024
1837
  fileList: s,
2025
- fetchFileList: c,
1838
+ fetchFileList: d,
2026
1839
  reorderFiles: y,
2027
- saveFileOrder: g
2028
- } = Ae({ multiple: l, fileGrpKey: n, ...i });
2029
- G(() => {
2030
- n && c();
2031
- }, [n]);
2032
- const Y = !!u?.fileAdd, C = {
2033
- ...f,
2034
- listType: e,
1840
+ saveFileOrder: p
1841
+ } = Be({ multiple: a, fileGrpKey: r, ...c });
1842
+ X(() => {
1843
+ r && d();
1844
+ }, [r]);
1845
+ const I = !!u?.fileAdd, C = {
1846
+ ...h,
1847
+ listType: t,
2035
1848
  styles: {
2036
- root: { height: d?.root },
2037
- list: { height: d?.list }
1849
+ root: { height: i?.root },
1850
+ list: { height: i?.list }
2038
1851
  },
2039
- iconRender: Te,
2040
- itemRender(O, p, E) {
2041
- return Be(
2042
- O,
2043
- p,
2044
- E,
1852
+ iconRender: Re,
1853
+ itemRender(T, g, F) {
1854
+ return ze(
1855
+ T,
1856
+ g,
1857
+ F,
2045
1858
  y,
2046
- g
1859
+ p
2047
1860
  );
2048
1861
  },
2049
1862
  ...o
2050
1863
  };
2051
- return /* @__PURE__ */ t(Me, { backend: Oe, children: /* @__PURE__ */ t(
2052
- ee,
1864
+ return /* @__PURE__ */ e(Pe, { backend: _e, children: /* @__PURE__ */ e(
1865
+ Q,
2053
1866
  {
2054
1867
  headers: { SYSCD: __SYS_CD__ },
2055
- style: { height: d?.root },
1868
+ style: { height: i?.root },
2056
1869
  ...C,
2057
- children: Y && l || (Y && !l || s.length === 0) && /* @__PURE__ */ t(J, { icon: /* @__PURE__ */ t(ae, {}), children: r })
1870
+ children: I && a || (I && !a || s.length === 0) && /* @__PURE__ */ e(ee, { icon: /* @__PURE__ */ e(re, {}), children: n })
2058
1871
  }
2059
1872
  ) });
2060
- }, hn = ({
2061
- listType: e = "picture",
2062
- permissions: r,
1873
+ }, gn = ({
1874
+ listType: t = "picture",
1875
+ permissions: n,
2063
1876
  multiple: u = !1,
2064
- fileGrpKey: l,
2065
- uploadProps: n,
1877
+ fileGrpKey: a,
1878
+ uploadProps: r,
2066
1879
  heights: o,
2067
- ...d
1880
+ ...i
2068
1881
  }) => {
2069
- const { defaultUploadProps: i, fetchFileList: f, reorderFiles: s, saveFileOrder: c } = Ae({ multiple: u, fileGrpKey: l, ...d }), y = {
2070
- ...i,
2071
- listType: e,
1882
+ const { defaultUploadProps: c, fetchFileList: h, reorderFiles: s, saveFileOrder: d } = Be({ multiple: u, fileGrpKey: a, ...i }), y = {
1883
+ ...c,
1884
+ listType: t,
2072
1885
  // styles: {
2073
1886
  // root: { height: heights?.root },
2074
1887
  // list: { height: heights?.list, overflowY: 'auto' },
2075
1888
  // },
2076
- iconRender: Te,
2077
- itemRender(g, Y, C) {
2078
- return Be(
2079
- g,
2080
- Y,
1889
+ iconRender: Re,
1890
+ itemRender(p, I, C) {
1891
+ return ze(
1892
+ p,
1893
+ I,
2081
1894
  C,
2082
1895
  s,
2083
- c
1896
+ d
2084
1897
  );
2085
1898
  },
2086
- ...n
1899
+ ...r
2087
1900
  };
2088
- return G(() => {
2089
- l && f();
2090
- }, [l]), /* @__PURE__ */ t(Me, { backend: Oe, children: /* @__PURE__ */ T(
2091
- yt,
1901
+ return X(() => {
1902
+ a && h();
1903
+ }, [a]), /* @__PURE__ */ e(Pe, { backend: _e, children: /* @__PURE__ */ O(
1904
+ Ft,
2092
1905
  {
2093
1906
  style: { marginBottom: 10 },
2094
1907
  height: o?.dragger || 100,
2095
1908
  ...y,
2096
1909
  children: [
2097
- /* @__PURE__ */ t("p", { className: "ant-upload-drag-icon", style: { marginBottom: 10 }, children: /* @__PURE__ */ t(De, { style: { fontSize: 25 } }) }),
2098
- /* @__PURE__ */ t("p", { className: "ant-upload-hint", children: "첨부할 파일을 여기에 끌어다 놓거나, 영역을 클릭하여 파일을 직접 선택해주세요." })
1910
+ /* @__PURE__ */ e("p", { className: "ant-upload-drag-icon", style: { marginBottom: 10 }, children: /* @__PURE__ */ e(Ve, { style: { fontSize: 25 } }) }),
1911
+ /* @__PURE__ */ e("p", { className: "ant-upload-hint", children: "첨부할 파일을 여기에 끌어다 놓거나, 영역을 클릭하여 파일을 직접 선택해주세요." })
2099
1912
  ]
2100
1913
  }
2101
1914
  ) });
1915
+ }, { Text: Ye } = fe, A = {
1916
+ IDLE: "idle",
1917
+ UPLOADING: "uploading",
1918
+ UPLOADED: "uploaded",
1919
+ EXECUTING: "executing",
1920
+ COMPLETED: "completed",
1921
+ FAILED: "failed"
1922
+ }, vt = {
1923
+ [A.IDLE]: "엑셀 파일을 선택해 업로드 해 주세요. (xlsx, xls, csv만 가능)",
1924
+ [A.UPLOADING]: "엑셀 업로드 중입니다. 잠시만 기다려 주세요.",
1925
+ [A.UPLOADED]: "엑셀 업로드가 완료되었습니다.",
1926
+ [A.EXECUTING]: "배치 작업 실행 중입니다. 잠시만 기다려 주세요.",
1927
+ [A.COMPLETED]: "배치 작업이 완료되었습니다.",
1928
+ [A.FAILED]: "배치 작업이 실패했습니다."
1929
+ }, yn = ({
1930
+ label: t = "엑셀 업로드",
1931
+ jobId: n,
1932
+ extraParams: u,
1933
+ onFinish: a,
1934
+ disabled: r = !1
1935
+ }) => {
1936
+ const [o, i] = P(A.IDLE), [c, h] = P(null), [s, d] = P(null), y = te(async () => {
1937
+ if (!(!c || !s)) {
1938
+ if (!n) {
1939
+ w.warning("실행 job id(jobId)가 설정되어 있지 않습니다.");
1940
+ return;
1941
+ }
1942
+ try {
1943
+ if (!s.filePath) {
1944
+ w.error("파일 URL 정보가 없습니다.");
1945
+ return;
1946
+ }
1947
+ i(A.EXECUTING);
1948
+ const g = {
1949
+ crprCd: Ee(),
1950
+ sysCd: window.__SYS_CD__ || "",
1951
+ fileKey: s.fileKey,
1952
+ filePath: s.filePath,
1953
+ jobId: n
1954
+ }, F = await oe("SCMUTIL00301", {
1955
+ ...g,
1956
+ ...u
1957
+ });
1958
+ F?.success ? w.success(
1959
+ F?.message || "배치 실행 요청이 접수되었습니다. 상태 확인을 눌러주세요."
1960
+ ) : (i(A.FAILED), w.error(F?.message || "배치 실행 요청에 실패했습니다."));
1961
+ } catch (g) {
1962
+ console.error("배치 실행 요청에 실패했습니다.", g), w.error("배치 실행 요청에 실패했습니다."), i(A.FAILED);
1963
+ }
1964
+ }
1965
+ }, [c, s, n, u]), p = te(async () => {
1966
+ if (!n) {
1967
+ w.warning("실행 job id(jobId)가 설정되어 있지 않습니다.");
1968
+ return;
1969
+ }
1970
+ try {
1971
+ const g = await oe("SCMUTIL00302", {
1972
+ jobId: n
1973
+ });
1974
+ if (g?.status === "COMPLETED") {
1975
+ i(A.COMPLETED), w.success("배치 작업이 완료되었습니다."), a?.();
1976
+ return;
1977
+ }
1978
+ if (g?.status === "FAILED") {
1979
+ i(A.FAILED), w.error("배치 작업이 실패했습니다.");
1980
+ return;
1981
+ }
1982
+ w.info("배치가 아직 진행 중입니다.");
1983
+ } catch (g) {
1984
+ console.error("배치 작업 상태 확인 오류:", g), w.error("배치 작업 상태 확인 중 오류가 발생했습니다.");
1985
+ }
1986
+ }, [n, a]), I = q(
1987
+ () => ({
1988
+ name: "file",
1989
+ accept: ".xlsx, .xls, .csv",
1990
+ listType: "picture",
1991
+ multiple: !1,
1992
+ action: "/api/upload",
1993
+ showUploadList: {
1994
+ showRemoveIcon: !0
1995
+ },
1996
+ beforeUpload: (g) => {
1997
+ const F = `.${g.name.split(".").pop()?.toLowerCase()}`;
1998
+ if (![".xlsx", ".xls", ".csv"].includes(F))
1999
+ return w.error(
2000
+ `${g.name} 파일은 허용되지 않는 확장자입니다. (xlsx, xls, csv만 가능)`
2001
+ ), Q.LIST_IGNORE;
2002
+ },
2003
+ onChange: (g) => {
2004
+ const { status: F } = g.file;
2005
+ if (F === "removed") {
2006
+ h(null), i(A.IDLE), d(null);
2007
+ return;
2008
+ }
2009
+ if (h(g.file), F === "uploading") {
2010
+ i(A.UPLOADING);
2011
+ return;
2012
+ }
2013
+ if (F === "done") {
2014
+ if (g.file.response?.success) {
2015
+ i(A.UPLOADED);
2016
+ const f = g.file.response.uploadedFiles[0] || {};
2017
+ d({
2018
+ fileKey: f.fileKey,
2019
+ filePath: f.filePath,
2020
+ fileNameL: f.fileNameL,
2021
+ fileNameP: f.fileNameP,
2022
+ fileSize: f.fileSize,
2023
+ fileExt: f.fileExt
2024
+ });
2025
+ } else
2026
+ i(A.IDLE), w.error(
2027
+ g.file.response?.message || `${g.file.name} 파일 업로드에 실패했습니다.`
2028
+ );
2029
+ return;
2030
+ }
2031
+ F === "error" && (i(A.IDLE), w.error(
2032
+ g.file.response?.message || `${g.file.name} 파일 업로드 중 오류가 발생했습니다.`
2033
+ ));
2034
+ }
2035
+ }),
2036
+ []
2037
+ ), C = q(
2038
+ () => /* @__PURE__ */ O($, { direction: "vertical", style: { width: 400 }, children: [
2039
+ /* @__PURE__ */ O($, { children: [
2040
+ o === A.EXECUTING && /* @__PURE__ */ e(ye, { size: "small" }),
2041
+ /* @__PURE__ */ e(Ye, { type: o === A.FAILED ? "danger" : "secondary", children: vt[o] })
2042
+ ] }),
2043
+ o !== A.EXECUTING && o !== A.COMPLETED && o !== A.FAILED && /* @__PURE__ */ e(Q, { ...I, children: !c && /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), children: "파일 선택" }) }),
2044
+ o === A.UPLOADED && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
2045
+ Z,
2046
+ {
2047
+ type: "primary",
2048
+ icon: /* @__PURE__ */ e(ve, {}),
2049
+ onClick: y,
2050
+ disabled: !c,
2051
+ children: "실행하기"
2052
+ }
2053
+ ) }) }),
2054
+ o === A.EXECUTING && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
2055
+ Z,
2056
+ {
2057
+ icon: /* @__PURE__ */ e(ge, {}),
2058
+ onClick: p,
2059
+ type: "primary",
2060
+ children: "상태 새로고침"
2061
+ }
2062
+ ) }) }),
2063
+ (o === A.COMPLETED || o === A.FAILED) && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ O($, { children: [
2064
+ /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(ge, {}), onClick: y, children: "다시 실행하기" }),
2065
+ /* @__PURE__ */ e(
2066
+ Z,
2067
+ {
2068
+ icon: /* @__PURE__ */ e(re, {}),
2069
+ onClick: () => {
2070
+ i(A.IDLE), h(null), d(null);
2071
+ },
2072
+ children: "다른 파일 업로드"
2073
+ }
2074
+ )
2075
+ ] }) })
2076
+ ] }),
2077
+ [o, c, y, I]
2078
+ ), T = /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), disabled: r, children: t });
2079
+ return r ? /* @__PURE__ */ e(
2080
+ ie,
2081
+ {
2082
+ title: /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2083
+ /* @__PURE__ */ e(Oe, { style: { color: "#faad14", fontSize: 16 } }),
2084
+ /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "'엑셀 업로드' 버튼에 대한 사용 권한이 없습니다." })
2085
+ ] }),
2086
+ content: /* @__PURE__ */ e(
2087
+ "div",
2088
+ {
2089
+ style: {
2090
+ display: "flex",
2091
+ flexDirection: "column",
2092
+ gap: 4,
2093
+ paddingLeft: 24
2094
+ },
2095
+ children: /* @__PURE__ */ e("span", { style: { fontSize: 12 }, children: "관리자에게 문의하세요." })
2096
+ }
2097
+ ),
2098
+ placement: "bottom",
2099
+ styles: { body: { backgroundColor: "#fffbe6" } },
2100
+ children: /* @__PURE__ */ e("span", { children: T })
2101
+ }
2102
+ ) : /* @__PURE__ */ e(
2103
+ ie,
2104
+ {
2105
+ content: C,
2106
+ title: /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", marginBottom: 0 }, children: /* @__PURE__ */ e(Ye, { strong: !0, children: "엑셀 업로드" }) }),
2107
+ trigger: "click",
2108
+ placement: "bottom",
2109
+ children: T
2110
+ }
2111
+ );
2112
+ }, { Text: Ne } = fe, M = {
2113
+ IDLE: "idle",
2114
+ UPLOADING: "uploading",
2115
+ UPLOADED: "uploaded",
2116
+ EXECUTING: "executing",
2117
+ COMPLETED: "completed",
2118
+ FAILED: "failed"
2119
+ }, Ot = {
2120
+ [M.IDLE]: "엑셀 파일을 선택해 업로드 해 주세요. (xlsx만 가능)",
2121
+ [M.UPLOADING]: "엑셀 업로드 중입니다. 잠시만 기다려 주세요.",
2122
+ [M.UPLOADED]: "엑셀 업로드가 완료되었습니다.",
2123
+ [M.EXECUTING]: "서비스 작업 실행 중입니다. 잠시만 기다려 주세요.",
2124
+ [M.COMPLETED]: "서비스 작업이 완료되었습니다.",
2125
+ [M.FAILED]: "서비스 작업이 실패했습니다."
2126
+ }, Cn = ({
2127
+ label: t = "엑셀 업로드",
2128
+ serviceName: n,
2129
+ extraParams: u,
2130
+ onFinish: a,
2131
+ disabled: r = !1
2132
+ }) => {
2133
+ const [o, i] = P(M.IDLE), [c, h] = P(null), [s, d] = P(null), y = te(async () => {
2134
+ if (!(!c || !s)) {
2135
+ if (!n) {
2136
+ w.warning(
2137
+ "실행 서비스 이름(serviceName)이 설정되어 있지 않습니다."
2138
+ );
2139
+ return;
2140
+ }
2141
+ try {
2142
+ if (!s.filePath) {
2143
+ w.error("파일 URL 정보가 없습니다.");
2144
+ return;
2145
+ }
2146
+ i(M.EXECUTING);
2147
+ const F = {
2148
+ crprCd: Ee(),
2149
+ filePath: s.filePath
2150
+ }, f = await oe(n, {
2151
+ ...F,
2152
+ ...u
2153
+ });
2154
+ f?.success || (i(M.FAILED), w.error(f?.message || "서비스 실행에 실패했습니다.")), i(M.COMPLETED), w.success(f?.message || "서비스 실행이 완료되었습니다."), a?.();
2155
+ } catch (F) {
2156
+ console.error("서비스 실행 요청에 실패했습니다.", F), w.error("서비스 실행 요청에 실패했습니다."), i(M.FAILED);
2157
+ }
2158
+ }
2159
+ }, [c, s, n, u, a]), I = `/excel/test/${N().format("YYYY/MM/DD")}`, C = q(
2160
+ () => ({
2161
+ name: "file",
2162
+ accept: ".xlsx",
2163
+ listType: "picture",
2164
+ multiple: !1,
2165
+ action: `/api/upload${I}`,
2166
+ showUploadList: {
2167
+ showRemoveIcon: !0
2168
+ },
2169
+ beforeUpload: (F) => {
2170
+ const f = `.${F.name.split(".").pop()?.toLowerCase()}`;
2171
+ if (![".xlsx"].includes(f))
2172
+ return w.error(
2173
+ `${F.name} 파일은 허용되지 않는 확장자입니다. (xlsx만 가능)`
2174
+ ), Q.LIST_IGNORE;
2175
+ const v = 10 * 1024 * 1024;
2176
+ if (F.size > v)
2177
+ return w.error("첨부 파일은 최대 10MB까지 업로드 가능합니다."), Q.LIST_IGNORE;
2178
+ },
2179
+ onChange: (F) => {
2180
+ const { status: f } = F.file;
2181
+ if (f === "removed") {
2182
+ h(null), i(M.IDLE), d(null);
2183
+ return;
2184
+ }
2185
+ if (h(F.file), f === "uploading") {
2186
+ i(M.UPLOADING);
2187
+ return;
2188
+ }
2189
+ if (f === "done") {
2190
+ i(M.UPLOADED);
2191
+ const v = F.file, Y = v.name || v.response.file_1?.filename, _ = v.response.file_1?.encrypted;
2192
+ d({
2193
+ fileKey: _,
2194
+ filePath: `${I}/${Y}`,
2195
+ fileNameL: Y,
2196
+ fileNameP: v.response.file_1?.encrypted,
2197
+ fileSize: v.response.file_1?.fileSize,
2198
+ fileExt: Y.includes(".") ? Y.split(".").pop() : ""
2199
+ });
2200
+ }
2201
+ f === "error" && (i(M.IDLE), w.error(
2202
+ F.file.response?.message || `${F.file.name} 파일 업로드 중 오류가 발생했습니다.`
2203
+ ));
2204
+ }
2205
+ }),
2206
+ [I]
2207
+ ), T = q(
2208
+ () => /* @__PURE__ */ O($, { direction: "vertical", style: { width: 400 }, children: [
2209
+ /* @__PURE__ */ O($, { children: [
2210
+ o === M.EXECUTING && /* @__PURE__ */ e(ye, { size: "small" }),
2211
+ /* @__PURE__ */ e(Ne, { type: o === M.FAILED ? "danger" : "secondary", children: Ot[o] })
2212
+ ] }),
2213
+ o !== M.EXECUTING && o !== M.COMPLETED && o !== M.FAILED && /* @__PURE__ */ e(Q, { ...C, children: !c && /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), children: "파일 선택" }) }),
2214
+ o === M.UPLOADED && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
2215
+ Z,
2216
+ {
2217
+ type: "primary",
2218
+ icon: /* @__PURE__ */ e(ve, {}),
2219
+ onClick: y,
2220
+ disabled: !c,
2221
+ children: "실행하기"
2222
+ }
2223
+ ) }) }),
2224
+ (o === M.COMPLETED || o === M.FAILED) && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ O($, { children: [
2225
+ /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(ge, {}), onClick: y, children: "다시 실행하기" }),
2226
+ /* @__PURE__ */ e(
2227
+ Z,
2228
+ {
2229
+ icon: /* @__PURE__ */ e(re, {}),
2230
+ onClick: () => {
2231
+ i(M.IDLE), h(null), d(null);
2232
+ },
2233
+ children: "다른 파일 업로드"
2234
+ }
2235
+ )
2236
+ ] }) })
2237
+ ] }),
2238
+ [o, c, y, C]
2239
+ ), g = /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), disabled: r, children: t });
2240
+ return r ? /* @__PURE__ */ e(
2241
+ ie,
2242
+ {
2243
+ title: /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2244
+ /* @__PURE__ */ e(Oe, { style: { color: "#faad14", fontSize: 16 } }),
2245
+ /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "'엑셀 업로드' 버튼에 대한 사용 권한이 없습니다." })
2246
+ ] }),
2247
+ content: /* @__PURE__ */ e(
2248
+ "div",
2249
+ {
2250
+ style: {
2251
+ display: "flex",
2252
+ flexDirection: "column",
2253
+ gap: 4,
2254
+ paddingLeft: 24
2255
+ },
2256
+ children: /* @__PURE__ */ e("span", { style: { fontSize: 12 }, children: "관리자에게 문의하세요." })
2257
+ }
2258
+ ),
2259
+ placement: "bottom",
2260
+ style: { backgroundColor: "#fffbe6" },
2261
+ children: /* @__PURE__ */ e("span", { children: g })
2262
+ }
2263
+ ) : /* @__PURE__ */ e(
2264
+ ie,
2265
+ {
2266
+ content: T,
2267
+ title: /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", marginBottom: 0 }, children: /* @__PURE__ */ e(Ne, { strong: !0, children: "엑셀 업로드" }) }),
2268
+ trigger: "click",
2269
+ placement: "bottom",
2270
+ children: g
2271
+ }
2272
+ );
2102
2273
  };
2103
2274
  export {
2104
- oe as BwgButton,
2105
- jt as BwgCheck,
2106
- Gt as BwgCheckList,
2107
- Xt as BwgDatePicker,
2108
- mn as BwgDeptSearch,
2109
- Kt as BwgDownload,
2110
- hn as BwgDraggerUploader,
2111
- dn as BwgEmpSearch,
2112
- Ft as BwgForm,
2113
- R as BwgFormItem,
2114
- qt as BwgInput,
2115
- Jt as BwgLargeUploader,
2116
- Qt as BwgMaskedDate,
2117
- Zt as BwgMaskedInput,
2118
- en as BwgMaskedRange,
2119
- tn as BwgMultiSelect,
2120
- nn as BwgNumber,
2121
- rn as BwgRadio,
2122
- on as BwgRangePicker,
2123
- an as BwgSearch,
2124
- ln as BwgSelect,
2125
- sn as BwgSwitch,
2126
- cn as BwgTextArea,
2127
- fn as BwgUploader,
2128
- un as BwgXlsxUploader,
2129
- xt as DraggableUploadListItem,
2130
- Te as defaultIconRender,
2131
- Be as defaultItemRender
2275
+ Z as BwgButton,
2276
+ Kt as BwgCheck,
2277
+ qt as BwgCheckList,
2278
+ Jt as BwgDatePicker,
2279
+ hn as BwgDeptSearch,
2280
+ Zt as BwgDownload,
2281
+ gn as BwgDraggerUploader,
2282
+ mn as BwgEmpSearch,
2283
+ yn as BwgExcelUploaderBatch,
2284
+ Cn as BwgExcelUploaderService,
2285
+ Et as BwgForm,
2286
+ G as BwgFormItem,
2287
+ Qt as BwgInput,
2288
+ en as BwgLargeUploader,
2289
+ nn as BwgMaskedDate,
2290
+ tn as BwgMaskedInput,
2291
+ rn as BwgMaskedRange,
2292
+ on as BwgMultiSelect,
2293
+ ln as BwgNumber,
2294
+ an as BwgRadio,
2295
+ sn as BwgRangePicker,
2296
+ cn as BwgSearch,
2297
+ dn as BwgSelect,
2298
+ un as BwgSwitch,
2299
+ fn as BwgTextArea,
2300
+ pn as BwgUploader,
2301
+ At as DraggableUploadListItem,
2302
+ Re as defaultIconRender,
2303
+ ze as defaultItemRender
2132
2304
  };