@bwg-ui/core 1.2.30 → 1.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/chunks/{CMSearchIntfGwP01-CIf-fHXy.js → CMSearchIntfGwP01-C_y_G3xh.js} +108 -94
  2. package/dist/chunks/CMSearchIntfGwP01-uJxdFXUb.cjs +1 -0
  3. package/dist/chunks/{MenuReport-DQS5SAmi.cjs → MenuReport-DkWB3Yyc.cjs} +1 -1
  4. package/dist/chunks/{MenuReport-GeXRkcDD.js → MenuReport-XwdiwiFn.js} +1 -1
  5. package/dist/chunks/{common-components-DNos8aEG.js → common-components-Cxh8PLBH.js} +5 -5
  6. package/dist/chunks/{common-components-CyqUT5Vj.cjs → common-components-DcTm1Tn1.cjs} +1 -1
  7. package/dist/chunks/layout-components-B4ptqDmC.cjs +35 -0
  8. package/dist/chunks/{layout-components-C4ehuALr.js → layout-components-Bp6b-T1V.js} +495 -474
  9. package/dist/components/common/BwgPopup.d.ts.map +1 -1
  10. package/dist/components/common/index.cjs +1 -1
  11. package/dist/components/common/index.js +1 -1
  12. package/dist/components/core/BwgMaskedPicker.d.ts.map +1 -1
  13. package/dist/components/core/index.cjs +1 -1
  14. package/dist/components/core/index.js +683 -615
  15. package/dist/components/guide/index.cjs +1 -1
  16. package/dist/components/guide/index.js +1 -1
  17. package/dist/components/layout/custom/ConfigurableSidebar.d.ts.map +1 -1
  18. package/dist/components/layout/index.cjs +1 -1
  19. package/dist/components/layout/index.js +1 -1
  20. package/dist/components/popup/CMSearchIntfGwP01.d.ts.map +1 -1
  21. package/dist/components/popup/index.cjs +1 -1
  22. package/dist/components/popup/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +2 -2
  25. package/dist/provider/contexts/ServiceCodeContext.d.ts.map +1 -1
  26. package/dist/provider/index.cjs +1 -1
  27. package/dist/provider/index.js +90 -90
  28. package/dist/stores/index.cjs +1 -1
  29. package/dist/stores/index.js +1 -1
  30. package/dist/styles/layout.css +1234 -1176
  31. package/dist/utils/index.cjs +1 -1
  32. package/dist/utils/index.js +1 -1
  33. package/package.json +1 -1
  34. package/dist/chunks/CMSearchIntfGwP01-C4Kg1iWo.cjs +0 -1
  35. package/dist/chunks/layout-components-USIA9TVn.cjs +0 -35
  36. package/dist/components/common/BwgDraggable.d.ts +0 -25
  37. package/dist/components/common/BwgDraggable.d.ts.map +0 -1
@@ -1,21 +1,21 @@
1
- import { jsx as r, jsxs as q } from "react/jsx-runtime";
2
- import { Button as X, Form as B, Checkbox as ie, ConfigProvider as pe, DatePicker as le, message as L, Card as ye, List as ee, Input as te, Spin as Le, Upload as G, Typography as Fe, Flex as de, Progress as be, notification as we, Tooltip as _e, Select as se, Space as ae, InputNumber as Ie, Radio as Ne, Switch as Me } from "antd";
3
- import { useMemo as W, memo as De, useState as T, useEffect as j, forwardRef as ke, useRef as Z, cloneElement as xe } from "react";
4
- import { useUserStore as ve, usePopupStore as Be } from "../../stores/index.js";
5
- import A from "dayjs";
6
- import { PaperClipOutlined as Ee, DownloadOutlined as Oe, DeleteOutlined as ze, InboxOutlined as Ve, UploadOutlined as Ye, CloudUploadOutlined as Ue, CheckCircleOutlined as Ae, CloseCircleOutlined as Te, FileTextOutlined as Re, SearchOutlined as $e } from "@ant-design/icons";
7
- import { isEmpty as je, debounce as He, findIndex as ne } from "lodash";
8
- import { callServiceBySysCd as Ke, getUserInfo as K, callService as J } from "../../utils/index.js";
9
- import Ge from "jszip";
1
+ import { jsx as r, jsxs as K } from "react/jsx-runtime";
2
+ import { Button as Z, Form as O, Checkbox as ie, ConfigProvider as le, DatePicker as se, message as _, Card as ye, List as ee, Input as te, Spin as Se, Upload as q, Typography as Fe, Flex as ue, Progress as Le, notification as we, Tooltip as Ie, Select as ce, Space as ae, InputNumber as _e, Radio as Ne, Switch as Me } from "antd";
3
+ import { useMemo as J, memo as ke, useState as R, useEffect as H, forwardRef as De, useRef as W, cloneElement as xe } from "react";
4
+ import { useUserStore as ve, usePopupStore as Ee } from "../../stores/index.js";
5
+ import B from "dayjs";
6
+ import { PaperClipOutlined as Be, DownloadOutlined as Oe, DeleteOutlined as ze, InboxOutlined as Ve, UploadOutlined as Ye, CloudUploadOutlined as Ue, CheckCircleOutlined as Ae, CloseCircleOutlined as $e, FileTextOutlined as Te, CalendarOutlined as Re, ExclamationCircleOutlined as je, SearchOutlined as He } from "@ant-design/icons";
7
+ import { isEmpty as Ke, debounce as Ge, findIndex as ne } from "lodash";
8
+ import { callServiceBySysCd as qe, getUserInfo as G, callService as X } from "../../utils/index.js";
9
+ import We from "jszip";
10
10
  import Ce from "imask";
11
- import { DndProvider as qe, useDrop as We, useDrag as Je } from "react-dnd";
12
- import { HTML5Backend as Xe } from "react-dnd-html5-backend";
13
- const Yt = (t) => {
14
- const { componentSize: e } = ve(), l = W(() => t.size ? t.size : {
11
+ import { DndProvider as Je, useDrop as Xe, useDrag as Ze } from "react-dnd";
12
+ import { HTML5Backend as Pe } from "react-dnd-html5-backend";
13
+ const bt = (t) => {
14
+ const { componentSize: e } = ve(), l = J(() => t.size ? t.size : {
15
15
  0: "small",
16
16
  1: "middle",
17
17
  2: "large"
18
- }[e], [e, t.size]), i = W(() => ({
18
+ }[e], [e, t.size]), a = J(() => ({
19
19
  0: 12,
20
20
  // 작게
21
21
  1: 14,
@@ -24,64 +24,64 @@ const Yt = (t) => {
24
24
  // 크게
25
25
  })[e], [e]);
26
26
  return /* @__PURE__ */ r(
27
- X,
27
+ Z,
28
28
  {
29
29
  ...t,
30
30
  size: l,
31
31
  className: "bwg-btn",
32
- style: { fontSize: `${i}px`, ...t.style },
32
+ style: { fontSize: `${a}px`, ...t.style },
33
33
  children: t.children
34
34
  }
35
35
  );
36
- }, D = De(
36
+ }, E = ke(
37
37
  ({
38
38
  children: t,
39
39
  label: e,
40
40
  name: l,
41
- rules: i,
41
+ rules: a,
42
42
  initialValue: n,
43
43
  style: o,
44
44
  required: u,
45
- ...a
45
+ ...i
46
46
  }) => {
47
- const d = {
47
+ const m = {
48
48
  fontWeight: "bold"
49
49
  };
50
- (i == null || i == null) && u && (i = [
50
+ (a == null || a == null) && u && (a = [
51
51
  {
52
52
  required: !0,
53
53
  message: `${e}을(를) 입력해주세요.`
54
54
  }
55
55
  ]);
56
- const s = Array.isArray(i) && i.some((p) => p.required === !0), C = () => typeof e == "string" ? /* @__PURE__ */ q("span", { style: d, children: [
56
+ const c = Array.isArray(a) && a.some((g) => g.required === !0), S = () => typeof e == "string" ? /* @__PURE__ */ K("span", { style: m, children: [
57
57
  e,
58
- s && /* @__PURE__ */ r("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
59
- ] }) : /* @__PURE__ */ r("span", { style: d, children: e });
58
+ c && /* @__PURE__ */ r("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
59
+ ] }) : /* @__PURE__ */ r("span", { style: m, children: e });
60
60
  return /* @__PURE__ */ r(
61
- B.Item,
61
+ O.Item,
62
62
  {
63
63
  className: "bwg-form-item",
64
- label: e ? C() : void 0,
65
- labelAlign: a.labelAlign || "left",
64
+ label: e ? S() : void 0,
65
+ labelAlign: i.labelAlign || "left",
66
66
  name: l,
67
- rules: i,
67
+ rules: a,
68
68
  colon: !1,
69
69
  initialValue: n,
70
70
  style: o,
71
- ...a,
71
+ ...i,
72
72
  children: t
73
73
  }
74
74
  );
75
75
  }
76
- ), Ct = ({
76
+ ), St = ({
77
77
  itemProps: t,
78
78
  inputProps: e = {
79
79
  format: "YN"
80
80
  }
81
81
  }) => {
82
- const l = B.useFormInstance();
82
+ const l = O.useFormInstance();
83
83
  return /* @__PURE__ */ r(
84
- D,
84
+ E,
85
85
  {
86
86
  ...t,
87
87
  getValueProps: (n) => ({ checked: e.format === "boolean" ? !!n : n === "Y" }),
@@ -91,26 +91,26 @@ const Yt = (t) => {
91
91
  }, children: e?.title })
92
92
  }
93
93
  );
94
- }, St = ({ itemProps: t, inputProps: e }) => {
95
- const l = B.useFormInstance(), [i, n] = T(
94
+ }, Lt = ({ itemProps: t, inputProps: e }) => {
95
+ const l = O.useFormInstance(), [a, n] = R(
96
96
  t?.initialValue ?? []
97
- ), [o, u] = T([]), a = o.length > 0 && o.length == i?.length, d = i?.length > 0 && i.length < o.length;
98
- j(() => {
99
- u(s(e?.options));
100
- }, [e?.options]), j(() => {
101
- n(i);
102
- }, [i]);
103
- const s = (Y) => {
104
- const S = [];
105
- return (Y || []).map((k, E) => {
106
- S.push(k.value);
107
- }), S;
108
- }, C = (Y) => {
109
- n(Y.target.checked ? o : []), l.setFieldValue(t?.name, Y.target.checked ? o : []);
110
- }, p = (Y) => {
111
- n(Y), l.setFieldValue(t?.name, Y), e?.onChange && typeof e?.onChange == "function" && e?.onChange(Y);
97
+ ), [o, u] = R([]), i = o.length > 0 && o.length == a?.length, m = a?.length > 0 && a.length < o.length;
98
+ H(() => {
99
+ u(c(e?.options));
100
+ }, [e?.options]), H(() => {
101
+ n(a);
102
+ }, [a]);
103
+ const c = (C) => {
104
+ const L = [];
105
+ return (C || []).map((D, V) => {
106
+ L.push(D.value);
107
+ }), L;
108
+ }, S = (C) => {
109
+ n(C.target.checked ? o : []), l.setFieldValue(t?.name, C.target.checked ? o : []);
110
+ }, g = (C) => {
111
+ n(C), l.setFieldValue(t?.name, C), e?.onChange && typeof e?.onChange == "function" && e?.onChange(C);
112
112
  };
113
- return /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ q(pe, { theme: {
113
+ return /* @__PURE__ */ r(E, { ...t, children: /* @__PURE__ */ K(le, { theme: {
114
114
  components: {
115
115
  Checkbox: {
116
116
  colorPrimary: "var(--check-primary)",
@@ -122,9 +122,9 @@ const Yt = (t) => {
122
122
  e?.allCheck && /* @__PURE__ */ r(
123
123
  ie,
124
124
  {
125
- indeterminate: d,
126
- checked: a,
127
- onChange: C,
125
+ indeterminate: m,
126
+ checked: i,
127
+ onChange: S,
128
128
  children: "전체선택"
129
129
  }
130
130
  ),
@@ -132,12 +132,12 @@ const Yt = (t) => {
132
132
  ie.Group,
133
133
  {
134
134
  options: e?.options,
135
- value: i,
136
- onChange: p
135
+ value: a,
136
+ onChange: g
137
137
  }
138
138
  )
139
139
  ] }) });
140
- }, ue = {
140
+ }, me = {
141
141
  year: { displayFormat: "YYYY", outputFormat: "YYYY" },
142
142
  month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
143
143
  date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
@@ -146,37 +146,37 @@ const Yt = (t) => {
146
146
  displayFormat: "YYYY-MM-DD HH:mm",
147
147
  outputFormat: "YYYYMMDDHHmm"
148
148
  }
149
- }, Lt = ({
149
+ }, wt = ({
150
150
  itemProps: t,
151
151
  inputProps: e,
152
152
  type: l = "date",
153
- returnType: i = "string"
153
+ returnType: a = "string"
154
154
  }) => {
155
- const { displayFormat: n, outputFormat: o } = W(
156
- () => ue[l],
155
+ const { displayFormat: n, outputFormat: o } = J(
156
+ () => me[l],
157
157
  [l]
158
- ), u = W(
159
- () => Object.values(ue).map((a) => a.outputFormat).sort((a, d) => {
160
- if (a.length === d.length) {
161
- if (a === o) return -1;
162
- if (d === o) return 1;
158
+ ), u = J(
159
+ () => Object.values(me).map((i) => i.outputFormat).sort((i, m) => {
160
+ if (i.length === m.length) {
161
+ if (i === o) return -1;
162
+ if (m === o) return 1;
163
163
  }
164
- return d.length - a.length;
164
+ return m.length - i.length;
165
165
  }),
166
166
  [o]
167
167
  // type(outputFormat)이 바뀔 때마다 재정렬
168
168
  );
169
169
  return /* @__PURE__ */ r(
170
- D,
170
+ E,
171
171
  {
172
172
  ...t,
173
- getValueProps: (a) => ({
173
+ getValueProps: (i) => ({
174
174
  // 폼에 저장된 값(문자열 또는 Dayjs)을 DatePicker가 요구하는 Dayjs로 변환
175
- value: a ? A.isDayjs(a) ? a : A(a, u) : null
175
+ value: i ? B.isDayjs(i) ? i : B(i, u) : null
176
176
  }),
177
- normalize: (a) => a ? i === "dayjs" ? a : a.format(o) : null,
177
+ normalize: (i) => i ? a === "dayjs" ? i : i.format(o) : null,
178
178
  children: /* @__PURE__ */ r(
179
- le,
179
+ se,
180
180
  {
181
181
  ...e,
182
182
  picker: l === "datetime" ? "date" : l,
@@ -186,51 +186,51 @@ const Yt = (t) => {
186
186
  )
187
187
  }
188
188
  );
189
- }, bt = ({
189
+ }, It = ({
190
190
  fileGrpKey: t,
191
191
  onFetchFilesTrxCd: e = "SCMFILE00101",
192
192
  readOnly: l = !1,
193
- sysCd: i = __SYS_CD__
193
+ sysCd: a = __SYS_CD__
194
194
  }) => {
195
- const [n, o] = T([]);
196
- j(() => {
197
- t && e ? i != __SYS_CD__ ? Ke(__APP_CD__, e, {
198
- crprCd: K()?.crprCd,
199
- sysCd: i,
195
+ const [n, o] = R([]);
196
+ H(() => {
197
+ t && e ? a != __SYS_CD__ ? qe(__APP_CD__, e, {
198
+ crprCd: G()?.crprCd,
199
+ sysCd: a,
200
200
  fileGrpKey: t
201
- }).then((a) => {
202
- if (a?.sub) {
203
- const d = a.sub.map((s) => ({
204
- uid: s.fileKey,
205
- name: s.lgclFileNm,
206
- filePath: s.filePath
201
+ }).then((i) => {
202
+ if (i?.sub) {
203
+ const m = i.sub.map((c) => ({
204
+ uid: c.fileKey,
205
+ name: c.lgclFileNm,
206
+ filePath: c.filePath
207
207
  }));
208
- o(d);
208
+ o(m);
209
209
  }
210
- }).catch((a) => {
211
- console.error("파일 목록 조회 서비스 호출에 실패했습니다.", a), L.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
212
- }) : J(e, {
213
- crprCd: K()?.crprCd,
214
- sysCd: i,
210
+ }).catch((i) => {
211
+ console.error("파일 목록 조회 서비스 호출에 실패했습니다.", i), _.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
212
+ }) : X(e, {
213
+ crprCd: G()?.crprCd,
214
+ sysCd: a,
215
215
  fileGrpKey: t
216
- }).then((a) => {
217
- if (a?.sub) {
218
- const d = a.sub.map((s) => ({
219
- uid: s.fileKey,
220
- name: s.lgclFileNm,
221
- filePath: s.filePath
216
+ }).then((i) => {
217
+ if (i?.sub) {
218
+ const m = i.sub.map((c) => ({
219
+ uid: c.fileKey,
220
+ name: c.lgclFileNm,
221
+ filePath: c.filePath
222
222
  }));
223
- o(d);
223
+ o(m);
224
224
  }
225
- }).catch((a) => {
226
- console.error("파일 목록 조회 서비스 호출에 실패했습니다.", a), L.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
225
+ }).catch((i) => {
226
+ console.error("파일 목록 조회 서비스 호출에 실패했습니다.", i), _.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
227
227
  }) : o([]);
228
228
  }, [t, e]);
229
- const u = async (a) => {
229
+ const u = async (i) => {
230
230
  try {
231
- let d;
232
- i != __SYS_CD__ ? d = "/api/download/" + i : d = "/api/download";
233
- const s = await fetch(d, {
231
+ let m;
232
+ a != __SYS_CD__ ? m = "/api/download/" + a : m = "/api/download";
233
+ const c = await fetch(m, {
234
234
  method: "POST",
235
235
  headers: {
236
236
  SYSCD: __SYS_CD__,
@@ -238,49 +238,49 @@ const Yt = (t) => {
238
238
  // 여기에 필요한 다른 헤더(예: 인증 토큰)를 추가할 수 있습니다.
239
239
  },
240
240
  body: JSON.stringify({
241
- filePath: a.filePath,
242
- logicalName: a.name,
243
- fileKey: a.uid
241
+ filePath: i.filePath,
242
+ logicalName: i.name,
243
+ fileKey: i.uid
244
244
  })
245
245
  });
246
- if (!s.ok) {
247
- const k = (await s.json().catch(() => null))?.message || "파일 다운로드에 실패했습니다.";
248
- throw new Error(k);
246
+ if (!c.ok) {
247
+ const D = (await c.json().catch(() => null))?.message || "파일 다운로드에 실패했습니다.";
248
+ throw new Error(D);
249
249
  }
250
- const C = await s.blob(), p = window.URL.createObjectURL(C), Y = document.createElement("a");
251
- Y.href = p, Y.setAttribute("download", a.name), document.body.appendChild(Y), Y.click(), document.body.removeChild(Y), window.URL.revokeObjectURL(p);
252
- } catch (d) {
253
- console.error(d), L.error(
254
- d.message || "파일을 다운로드하는 중 오류가 발생했습니다."
250
+ const S = await c.blob(), g = window.URL.createObjectURL(S), C = document.createElement("a");
251
+ C.href = g, C.setAttribute("download", i.name), document.body.appendChild(C), C.click(), document.body.removeChild(C), window.URL.revokeObjectURL(g);
252
+ } catch (m) {
253
+ console.error(m), _.error(
254
+ m.message || "파일을 다운로드하는 중 오류가 발생했습니다."
255
255
  );
256
256
  }
257
257
  };
258
- return je(n) ? null : /* @__PURE__ */ r(ye, { title: "파일 목록", children: /* @__PURE__ */ r(
258
+ return Ke(n) ? null : /* @__PURE__ */ r(ye, { title: "파일 목록", children: /* @__PURE__ */ r(
259
259
  ee,
260
260
  {
261
261
  dataSource: n,
262
- renderItem: (a) => /* @__PURE__ */ r(
262
+ renderItem: (i) => /* @__PURE__ */ r(
263
263
  ee.Item,
264
264
  {
265
265
  actions: l ? [] : [
266
266
  /* @__PURE__ */ r(
267
- X,
267
+ Z,
268
268
  {
269
269
  type: "text",
270
270
  icon: /* @__PURE__ */ r(Oe, {}),
271
- onClick: () => u(a)
271
+ onClick: () => u(i)
272
272
  },
273
273
  "download"
274
274
  )
275
275
  ],
276
- children: /* @__PURE__ */ r(ee.Item.Meta, { avatar: /* @__PURE__ */ r(Ee, {}), title: a.name })
276
+ children: /* @__PURE__ */ r(ee.Item.Meta, { avatar: /* @__PURE__ */ r(Be, {}), title: i.name })
277
277
  }
278
278
  )
279
279
  }
280
280
  ) });
281
- }, Ze = ke(
282
- ({ children: t, labelCol: e, style: l, className: i, ...n }, o) => /* @__PURE__ */ r(
283
- pe,
281
+ }, Qe = De(
282
+ ({ children: t, labelCol: e, style: l, className: a, ...n }, o) => /* @__PURE__ */ r(
283
+ le,
284
284
  {
285
285
  form: {
286
286
  /**
@@ -290,22 +290,22 @@ const Yt = (t) => {
290
290
  // validateMessages: { required: "'${label}을(를) 입력해주세요.'" },
291
291
  },
292
292
  children: /* @__PURE__ */ r(
293
- B,
293
+ O,
294
294
  {
295
295
  ref: o,
296
296
  ...n,
297
297
  requiredMark: !1,
298
298
  labelCol: e || { flex: "100px" },
299
299
  style: { padding: "10px", ...l },
300
- className: `bwg-form ${i ?? ""}`,
300
+ className: `bwg-form ${a ?? ""}`,
301
301
  children: t
302
302
  }
303
303
  )
304
304
  }
305
305
  )
306
306
  );
307
- Ze.displayName = "BwgForm";
308
- const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(te, { ...e }) }), { Text: oe } = Fe, { Dragger: Qe } = G, Pe = [
307
+ Qe.displayName = "BwgForm";
308
+ const _t = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(E, { ...t, children: /* @__PURE__ */ r(te, { ...e }) }), { Text: oe } = Fe, { Dragger: et } = q, tt = [
309
309
  ".pdf",
310
310
  ".xlsx",
311
311
  ".xls",
@@ -323,60 +323,60 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
323
323
  ".gif",
324
324
  // 압축
325
325
  ".zip"
326
- ], et = (t, e = 2) => {
326
+ ], rt = (t, e = 2) => {
327
327
  if (t === 0) return "0 Bytes";
328
- const l = 1024, i = e < 0 ? 0 : e, n = ["Bytes", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(t) / Math.log(l));
329
- return parseFloat((t / Math.pow(l, o)).toFixed(i)) + " " + n[o];
330
- }, _t = ({
328
+ const l = 1024, a = e < 0 ? 0 : e, n = ["Bytes", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(t) / Math.log(l));
329
+ return parseFloat((t / Math.pow(l, o)).toFixed(a)) + " " + n[o];
330
+ }, Nt = ({
331
331
  title: t = "첨부파일",
332
332
  fileGrpKey: e,
333
333
  onUploadComplete: l,
334
- onSuccessTrxCd: i = "SCMFILE00102",
334
+ onSuccessTrxCd: a = "SCMFILE00102",
335
335
  // BwgUploader와 동일한 기본 trxCd 설정
336
336
  anotherServiceTrxCd: n = "SCMFILE00105",
337
- allowedExtensions: o = Pe,
337
+ allowedExtensions: o = tt,
338
338
  maxFileSize: u = 2048
339
339
  // 기본값 2GB
340
340
  }) => {
341
- const [a, d] = T([]), [s, C] = T(!1), [p, Y] = T(!1), [S, k] = T(0), E = (m) => {
341
+ const [i, m] = R([]), [c, S] = R(!1), [g, C] = R(!1), [L, D] = R(0), V = (h) => {
342
342
  if (o && o.length > 0) {
343
- const _ = ((O) => {
344
- const H = O.lastIndexOf(".");
345
- return H === -1 ? "" : O.substring(H).toLowerCase();
346
- })(m.name);
347
- if (!o.includes(_))
348
- return L.error(
349
- `${m.name} 파일은 허용되지 않는 확장자입니다. (${o.join(
343
+ const s = ((F) => {
344
+ const w = F.lastIndexOf(".");
345
+ return w === -1 ? "" : F.substring(w).toLowerCase();
346
+ })(h.name);
347
+ if (!o.includes(s))
348
+ return _.error(
349
+ `${h.name} 파일은 허용되지 않는 확장자입니다. (${o.join(
350
350
  ", "
351
351
  )}만 가능)`
352
352
  ), !1;
353
353
  }
354
354
  return !0;
355
- }, x = async () => {
356
- const m = a.filter((I) => I.status !== "done"), g = m.reduce(
357
- (I, R) => I + (R.size || 0),
355
+ }, N = async () => {
356
+ const h = i.filter((I) => I.status !== "done"), y = h.reduce(
357
+ (I, $) => I + ($.size || 0),
358
358
  0
359
- ), _ = 2 * 1024 * 1024 * 1024;
360
- if (g > _) {
359
+ ), s = 2 * 1024 * 1024 * 1024;
360
+ if (y > s) {
361
361
  we.error({
362
362
  message: "업로드 용량 초과",
363
363
  description: "한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."
364
364
  });
365
365
  return;
366
366
  }
367
- if (m.length === 0) {
368
- L.warning(
367
+ if (h.length === 0) {
368
+ _.warning(
369
369
  "업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다."
370
370
  );
371
371
  return;
372
372
  }
373
- Y(!0);
374
- let O;
373
+ C(!0);
374
+ let F;
375
375
  try {
376
- const I = new Ge();
377
- m.forEach((R) => {
378
- R.originFileObj && I.file(R.name, R.originFileObj);
379
- }), O = await I.generateAsync({
376
+ const I = new We();
377
+ h.forEach(($) => {
378
+ $.originFileObj && I.file($.name, $.originFileObj);
379
+ }), F = await I.generateAsync({
380
380
  type: "blob",
381
381
  compression: "DEFLATE",
382
382
  compressionOptions: {
@@ -385,188 +385,188 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
385
385
  }
386
386
  });
387
387
  } catch (I) {
388
- Y(!1), L.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", I);
388
+ C(!1), _.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", I);
389
389
  return;
390
390
  }
391
- Y(!1);
392
- const H = new FormData();
393
- H.append("file", O, "upload.zip"), C(!0), k(0);
391
+ C(!1);
392
+ const w = new FormData();
393
+ w.append("file", F, "upload.zip"), S(!0), D(0);
394
394
  try {
395
- const I = await new Promise((y, b) => {
396
- const v = new XMLHttpRequest();
397
- v.open("POST", "/api/upload-large", !0), v.upload.onprogress = (N) => {
398
- if (N.lengthComputable) {
395
+ const I = await new Promise((Y, M) => {
396
+ const z = new XMLHttpRequest();
397
+ z.open("POST", "/api/upload-large", !0), z.upload.onprogress = (x) => {
398
+ if (x.lengthComputable) {
399
399
  const re = Math.round(
400
- N.loaded / N.total * 100
400
+ x.loaded / x.total * 100
401
401
  );
402
- k(re);
402
+ D(re);
403
403
  }
404
- }, v.onload = () => {
405
- if (v.status >= 200 && v.status < 300)
404
+ }, z.onload = () => {
405
+ if (z.status >= 200 && z.status < 300)
406
406
  try {
407
- const N = JSON.parse(v.responseText);
408
- N.success ? y(N) : b(
409
- new Error(N.message || "파일 업로드에 실패했습니다.")
407
+ const x = JSON.parse(z.responseText);
408
+ x.success ? Y(x) : M(
409
+ new Error(x.message || "파일 업로드에 실패했습니다.")
410
410
  );
411
411
  } catch {
412
- b(new Error("잘못된 서버 응답입니다."));
412
+ M(new Error("잘못된 서버 응답입니다."));
413
413
  }
414
414
  else
415
415
  try {
416
- const N = JSON.parse(v.responseText);
417
- b(new Error(N.message || `서버 오류: ${v.status}`));
416
+ const x = JSON.parse(z.responseText);
417
+ M(new Error(x.message || `서버 오류: ${z.status}`));
418
418
  } catch {
419
- b(new Error(`서버 오류: ${v.status}`));
419
+ M(new Error(`서버 오류: ${z.status}`));
420
420
  }
421
- }, v.onerror = () => {
422
- b(new Error("네트워크 오류가 발생했습니다."));
423
- }, v.send(H);
421
+ }, z.onerror = () => {
422
+ M(new Error("네트워크 오류가 발생했습니다."));
423
+ }, z.send(w);
424
424
  });
425
- L.success(
425
+ _.success(
426
426
  I.message || "압축 파일이 성공적으로 업로드되었습니다."
427
427
  );
428
- const R = a.map(
429
- (y) => m.find((b) => b.uid === y.uid) ? { ...y, status: "done" } : y
428
+ const $ = i.map(
429
+ (Y) => h.find((M) => M.uid === Y.uid) ? { ...Y, status: "done" } : Y
430
430
  );
431
- if (d(R), i && I.uploadedFiles && Array.isArray(I.uploadedFiles)) {
432
- const y = K();
433
- I.uploadedFiles.forEach((b) => {
434
- const v = {
435
- crprCd: y?.crprCd,
431
+ if (m($), a && I.uploadedFiles && Array.isArray(I.uploadedFiles)) {
432
+ const Y = G();
433
+ I.uploadedFiles.forEach((M) => {
434
+ const z = {
435
+ crprCd: Y?.crprCd,
436
436
  sysCd: __SYS_CD__,
437
437
  fileGrpKey: e,
438
438
  sub: [
439
439
  {
440
- crprCd: y?.crprCd,
440
+ crprCd: Y?.crprCd,
441
441
  sysCd: __SYS_CD__,
442
442
  fileGrpKey: e,
443
- physFileNm: b.fileNameP,
444
- lgclFileNm: b.fileNameL,
445
- filePath: b.filePath,
446
- fileExtn: b.fileExt,
447
- fileSize: b.fileSize,
443
+ physFileNm: M.fileNameP,
444
+ lgclFileNm: M.fileNameL,
445
+ filePath: M.filePath,
446
+ fileExtn: M.fileExt,
447
+ fileSize: M.fileSize,
448
448
  mltpYn: "Y"
449
449
  }
450
450
  ]
451
451
  };
452
- J(i, v).then((N) => {
453
- const re = a.map((Q) => ({
454
- crprCd: y?.crprCd,
452
+ X(a, z).then((x) => {
453
+ const re = i.map((P) => ({
454
+ crprCd: Y?.crprCd,
455
455
  sysCd: __SYS_CD__,
456
- fileGrpKey: N.sub[0].fileGrpKey,
457
- fileKey: N.sub[0].fileKey,
458
- lgclFileNm: Q.name,
459
- fileSize: Q.size,
460
- fileExtn: Q.name.split(".").pop(),
461
- fileType: Q.type
456
+ fileGrpKey: x.sub[0].fileGrpKey,
457
+ fileKey: x.sub[0].fileKey,
458
+ lgclFileNm: P.name,
459
+ fileSize: P.size,
460
+ fileExtn: P.name.split(".").pop(),
461
+ fileType: P.type
462
462
  }));
463
- J(n, {
463
+ X(n, {
464
464
  // 파일 목록에 fileKey를 추가합니다.
465
465
  sub: re
466
466
  });
467
- }).catch((N) => {
468
- console.error("후처리 서비스 호출 실패:", N), L.error(
469
- `${b.fileNameL} 파일의 후처리 작업에 실패했습니다.`
467
+ }).catch((x) => {
468
+ console.error("후처리 서비스 호출 실패:", x), _.error(
469
+ `${M.fileNameL} 파일의 후처리 작업에 실패했습니다.`
470
470
  );
471
471
  }), l && l({
472
- fileNameP: b.fileNameP,
473
- fileNameL: b.fileNameL
472
+ fileNameP: M.fileNameP,
473
+ fileNameL: M.fileNameL
474
474
  });
475
475
  });
476
476
  }
477
477
  } catch (I) {
478
- L.error(I.message || "파일 업로드 중 오류가 발생했습니다.");
479
- const R = a.map(
480
- (y) => m.find((b) => b.uid === y.uid) ? {
481
- ...y,
478
+ _.error(I.message || "파일 업로드 중 오류가 발생했습니다.");
479
+ const $ = i.map(
480
+ (Y) => h.find((M) => M.uid === Y.uid) ? {
481
+ ...Y,
482
482
  status: "error",
483
483
  response: I.message || "파일 업로드 중 오류가 발생했습니다."
484
- } : y
484
+ } : Y
485
485
  );
486
- d(R);
486
+ m($);
487
487
  } finally {
488
- C(!1);
488
+ S(!1);
489
489
  }
490
- }, f = {
490
+ }, p = {
491
491
  multiple: !0,
492
- fileList: a,
493
- beforeUpload: (m) => E(m) ? u && m.size >= u * 1024 * 1024 ? (L.error(
492
+ fileList: i,
493
+ beforeUpload: (h) => V(h) ? u && h.size >= u * 1024 * 1024 ? (_.error(
494
494
  `대용량 첨부 파일 최대 크기는 ${(u / 1024).toFixed(
495
495
  1
496
496
  )}GB입니다.`
497
- ), G.LIST_IGNORE) : !1 : G.LIST_IGNORE,
498
- onChange: ({ fileList: m }) => {
499
- const g = new Map(a.map((_) => [_.uid, _]));
500
- m.forEach((_) => {
501
- g.set(_.uid, _);
502
- }), d(Array.from(g.values()));
497
+ ), q.LIST_IGNORE) : !1 : q.LIST_IGNORE,
498
+ onChange: ({ fileList: h }) => {
499
+ const y = new Map(i.map((s) => [s.uid, s]));
500
+ h.forEach((s) => {
501
+ y.set(s.uid, s);
502
+ }), m(Array.from(y.values()));
503
503
  },
504
- onRemove: (m) => {
505
- const g = a.filter((_) => _.uid !== m.uid);
506
- d(g);
504
+ onRemove: (h) => {
505
+ const y = i.filter((s) => s.uid !== h.uid);
506
+ m(y);
507
507
  },
508
508
  showUploadList: !1
509
509
  // 수동으로 목록을 렌더링하므로 antd의 기본 목록은 숨깁니다.
510
510
  };
511
511
  return /* @__PURE__ */ r(
512
- Le,
512
+ Se,
513
513
  {
514
- spinning: s || p,
515
- tip: p ? "파일 압축 중..." : `파일 업로드 중... ${S}%`,
516
- children: /* @__PURE__ */ q("div", { className: "bwg-large-uploader-container", children: [
514
+ spinning: c || g,
515
+ tip: g ? "파일 압축 중..." : `파일 업로드 중... ${L}%`,
516
+ children: /* @__PURE__ */ K("div", { className: "bwg-large-uploader-container", children: [
517
517
  /* @__PURE__ */ r(
518
518
  ye,
519
519
  {
520
520
  title: /* @__PURE__ */ r(oe, { strong: !0, children: t }),
521
- extra: /* @__PURE__ */ r(G, { ...f, children: /* @__PURE__ */ r(X, { icon: /* @__PURE__ */ r(Ye, {}), children: "파일 선택" }) }),
521
+ extra: /* @__PURE__ */ r(q, { ...p, children: /* @__PURE__ */ r(Z, { icon: /* @__PURE__ */ r(Ye, {}), children: "파일 선택" }) }),
522
522
  style: { padding: 0 },
523
523
  children: /* @__PURE__ */ r(
524
- Qe,
524
+ et,
525
525
  {
526
- ...f,
526
+ ...p,
527
527
  style: {
528
528
  border: "none",
529
529
  background: "transparent",
530
530
  padding: 0
531
531
  },
532
- children: /* @__PURE__ */ r("div", { className: "upload-list-container", children: a.length > 0 ? /* @__PURE__ */ r(
532
+ children: /* @__PURE__ */ r("div", { className: "upload-list-container", children: i.length > 0 ? /* @__PURE__ */ r(
533
533
  ee,
534
534
  {
535
535
  style: { textAlign: "left" },
536
- dataSource: a,
537
- renderItem: (m) => {
538
- const g = m.status === "done", _ = m.status === "error";
539
- let O;
540
- return g ? O = /* @__PURE__ */ r(
536
+ dataSource: i,
537
+ renderItem: (h) => {
538
+ const y = h.status === "done", s = h.status === "error";
539
+ let F;
540
+ return y ? F = /* @__PURE__ */ r(
541
541
  Ae,
542
542
  {
543
543
  style: { color: "#52c41a", fontSize: 14 }
544
544
  }
545
- ) : _ ? O = /* @__PURE__ */ r(
546
- _e,
545
+ ) : s ? F = /* @__PURE__ */ r(
546
+ Ie,
547
547
  {
548
- title: typeof m.response == "string" ? m.response : "업로드 실패",
548
+ title: typeof h.response == "string" ? h.response : "업로드 실패",
549
549
  children: /* @__PURE__ */ r(
550
- Te,
550
+ $e,
551
551
  {
552
552
  style: { color: "#ff4d4f", fontSize: 14 }
553
553
  }
554
554
  )
555
555
  }
556
- ) : O = /* @__PURE__ */ r(Re, { style: { fontSize: 14 } }), /* @__PURE__ */ r(
556
+ ) : F = /* @__PURE__ */ r(Te, { style: { fontSize: 14 } }), /* @__PURE__ */ r(
557
557
  ee.Item,
558
558
  {
559
559
  actions: [
560
- /* @__PURE__ */ r(oe, { type: "secondary", children: et(m.size || 0) }, "size"),
560
+ /* @__PURE__ */ r(oe, { type: "secondary", children: rt(h.size || 0) }, "size"),
561
561
  /* @__PURE__ */ r(
562
- X,
562
+ Z,
563
563
  {
564
564
  type: "text",
565
565
  icon: /* @__PURE__ */ r(ze, {}),
566
- onClick: (H) => {
567
- H.stopPropagation(), f.onRemove?.(m);
566
+ onClick: (w) => {
567
+ w.stopPropagation(), p.onRemove?.(h);
568
568
  },
569
- disabled: s || p
569
+ disabled: c || g
570
570
  },
571
571
  "delete"
572
572
  )
@@ -574,17 +574,17 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
574
574
  children: /* @__PURE__ */ r(
575
575
  ee.Item.Meta,
576
576
  {
577
- avatar: O,
578
- title: /* @__PURE__ */ r(oe, { type: _ ? "danger" : void 0, children: m.name })
577
+ avatar: F,
578
+ title: /* @__PURE__ */ r(oe, { type: s ? "danger" : void 0, children: h.name })
579
579
  }
580
580
  )
581
581
  },
582
- m.uid
582
+ h.uid
583
583
  );
584
584
  }
585
585
  }
586
- ) : /* @__PURE__ */ q(
587
- de,
586
+ ) : /* @__PURE__ */ K(
587
+ ue,
588
588
  {
589
589
  gap: "middle",
590
590
  align: "center",
@@ -601,21 +601,21 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
601
601
  )
602
602
  }
603
603
  ),
604
- a.length > 0 && /* @__PURE__ */ q(
605
- de,
604
+ i.length > 0 && /* @__PURE__ */ K(
605
+ ue,
606
606
  {
607
607
  justify: "flex-end",
608
608
  align: "center",
609
609
  gap: "large",
610
610
  style: { marginTop: 16 },
611
611
  children: [
612
- s && /* @__PURE__ */ r("div", { style: { width: "250px" }, children: /* @__PURE__ */ r(be, { percent: S, size: "small" }) }),
612
+ c && /* @__PURE__ */ r("div", { style: { width: "250px" }, children: /* @__PURE__ */ r(Le, { percent: L, size: "small" }) }),
613
613
  /* @__PURE__ */ r(
614
- X,
614
+ Z,
615
615
  {
616
616
  type: "primary",
617
- onClick: x,
618
- disabled: s || p || a.filter((m) => m.status !== "done").length === 0,
617
+ onClick: N,
618
+ disabled: c || g || i.filter((h) => h.status !== "done").length === 0,
619
619
  icon: /* @__PURE__ */ r(Ue, {}),
620
620
  children: "일괄 업로드"
621
621
  }
@@ -626,35 +626,35 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
626
626
  ] })
627
627
  }
628
628
  );
629
- }, tt = (t) => {
629
+ }, nt = (t) => {
630
630
  if (typeof t == "string")
631
631
  return t.replace(/0/g, "_");
632
632
  if (Array.isArray(t))
633
633
  return t[0].replace(/0/g, "_");
634
634
  if (typeof t == "object" && "mask" in t && "blocks" in t) {
635
635
  const { mask: e, blocks: l } = t;
636
- return e.split(".").map((i) => {
637
- const o = l?.[i]?.maxLength ?? 3;
636
+ return e.split(".").map((a) => {
637
+ const o = l?.[a]?.maxLength ?? 3;
638
638
  return "_".repeat(o);
639
639
  }).join(".");
640
640
  }
641
641
  return "";
642
- }, It = ({
642
+ }, Mt = ({
643
643
  itemProps: t,
644
644
  inputProps: e,
645
645
  mask: l
646
646
  }) => {
647
- const i = Z(null), n = B.useFormInstance(), o = W(() => tt(l), [l]);
648
- return j(() => {
649
- if (!i.current?.input) return;
650
- const u = typeof l == "string" || Array.isArray(l) ? { mask: l } : l, a = Ce(i.current.input, u);
651
- return a.on("accept", () => {
652
- n && t?.name && n.setFieldValue(t.name, a.value);
647
+ const a = W(null), n = O.useFormInstance(), o = J(() => nt(l), [l]);
648
+ return H(() => {
649
+ if (!a.current?.input) return;
650
+ const u = typeof l == "string" || Array.isArray(l) ? { mask: l } : l, i = Ce(a.current.input, u);
651
+ return i.on("accept", () => {
652
+ n && t?.name && n.setFieldValue(t.name, i.value);
653
653
  }), () => {
654
- a.destroy();
654
+ i.destroy();
655
655
  };
656
- }, [l, n, t?.name]), /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(te, { ...e, ref: i, placeholder: o }) });
657
- }, rt = (t) => {
656
+ }, [l, n, t?.name]), /* @__PURE__ */ r(E, { ...t, children: /* @__PURE__ */ r(te, { ...e, ref: a, placeholder: o }) });
657
+ }, ot = (t) => {
658
658
  switch (t) {
659
659
  case "year":
660
660
  return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
@@ -668,102 +668,170 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
668
668
  outputFormat: "YYYYMMDD"
669
669
  };
670
670
  }
671
- }, Nt = ({
671
+ }, kt = ({
672
672
  type: t = "date",
673
673
  itemProps: e = { name: "calendar" },
674
674
  inputProps: l
675
675
  }) => {
676
- const { format: i, mask: n, outputFormat: o } = rt(t), u = Z(null), a = Z(null), d = B.useFormInstance(), [s, C] = T(!1), [p, Y] = T(!1), S = e?.name, [k, E] = T(null);
677
- j(() => {
676
+ const { format: a, mask: n, outputFormat: o } = ot(t), u = W(null), i = W(null), m = W(null), c = O.useFormInstance(), [S, g] = R(!1), [C, L] = R(!1), D = e?.name, [V, N] = R(null), p = O.useWatch(D, c);
677
+ H(() => {
678
678
  if (!u.current?.input) return;
679
- const f = Ce(u.current.input, {
679
+ const s = Ce(u.current.input, {
680
680
  mask: n,
681
681
  lazy: !1
682
682
  });
683
- return a.current = f, f.on("accept", () => {
684
- console.log("input :: ", f.value);
685
- const m = f.value, g = A(m, i, !0);
686
- console.log("input :: ", g), m.length === i.length && g.isValid() && (console.log("parsed :: ", g.format(o)), d.setFieldValue(S, g.format(o)), a.current?.updateValue(), C(!1));
683
+ return i.current = s, s.on("accept", () => {
684
+ const F = s.value;
685
+ F.length > 0 && g(!0);
686
+ const w = B(F, a, !0);
687
+ F.length === a.length && w.isValid() && (c.setFieldValue(D, s.value), N(w), i.current?.updateValue());
687
688
  }), () => {
688
- f.destroy();
689
+ s.destroy();
689
690
  };
690
- }, [i, n]), j(() => {
691
- E(A(d.getFieldValue(S)));
692
- }, [d.getFieldValue(S)]);
693
- const x = (f) => {
694
- if (!f) {
695
- a.current?.updateValue();
691
+ }, [a, n]), H(() => {
692
+ if (!p) {
693
+ N(null);
696
694
  return;
697
695
  }
698
- const m = f.format(o);
699
- console.log("formatted :: ", m), a.current && (a.current.value = m, a.current.updateValue()), Y(!1);
696
+ let s = null;
697
+ if (typeof p == "string" && p.length === o.length && /^\d+$/.test(p))
698
+ if (t === "date") {
699
+ const F = p.substring(0, 4), w = p.substring(4, 6), I = p.substring(6, 8);
700
+ s = B(`${F}-${w}-${I}`, a, !0);
701
+ } else if (t === "month") {
702
+ const F = p.substring(0, 4), w = p.substring(4, 6);
703
+ s = B(`${F}-${w}`, a, !0);
704
+ } else t === "year" && (s = B(p, a, !0));
705
+ else
706
+ s = B(p, a, !0);
707
+ s && s.isValid() ? N(s) : N(null), L(!1);
708
+ }, [p, a, o, t]);
709
+ const h = (s) => {
710
+ if (!s) {
711
+ N(null), i.current?.updateValue();
712
+ return;
713
+ }
714
+ N(s);
715
+ const F = s.format(o);
716
+ i.current && (i.current.value = F, i.current.updateValue()), L(!1);
717
+ }, y = (s) => {
718
+ setTimeout(() => {
719
+ const F = document.activeElement, w = m.current, I = w?.querySelector(".ant-picker-dropdown");
720
+ !(w && (w.contains(F) || w === F || I?.contains(F))) && !(s !== void 0 ? s : S) && console.log("✅ Input과 DatePicker 모두 포커스가 없습니다");
721
+ }, 0);
700
722
  };
701
723
  return /* @__PURE__ */ r(
702
- D,
724
+ E,
703
725
  {
704
726
  ...e,
705
727
  name: void 0,
706
- validateStatus: p ? "warning" : void 0,
707
- help: p ? "유효하지 않은 날짜입니다" : void 0,
708
- children: /* @__PURE__ */ q("div", { style: { position: "relative" }, children: [
709
- /* @__PURE__ */ r(
710
- B.Item,
711
- {
712
- name: S,
713
- getValueProps: (f) => ({
714
- value: f ? A(f).format(i) : void 0
715
- }),
716
- normalize: (f) => f ? A(f).format(o) : void 0,
717
- noStyle: !0,
718
- children: /* @__PURE__ */ r(
719
- te,
728
+ validateStatus: C ? "warning" : void 0,
729
+ children: /* @__PURE__ */ r(
730
+ le,
731
+ {
732
+ theme: {
733
+ components: {
734
+ Input: {
735
+ addonBg: "#fff"
736
+ }
737
+ }
738
+ },
739
+ children: /* @__PURE__ */ K("div", { ref: m, style: { position: "relative" }, children: [
740
+ /* @__PURE__ */ r(
741
+ O.Item,
742
+ {
743
+ name: D,
744
+ getValueProps: (s) => ({
745
+ value: s ? B(s).format(a) : void 0
746
+ }),
747
+ normalize: (s) => s ? B(s).format(o) : void 0,
748
+ noStyle: !0,
749
+ children: /* @__PURE__ */ r(
750
+ te,
751
+ {
752
+ ...l,
753
+ ref: u,
754
+ onFocus: () => {
755
+ g(!S), i.current?.updateValue();
756
+ },
757
+ onBlur: () => {
758
+ y();
759
+ },
760
+ onKeyDown: (s) => {
761
+ if (s.key === "Backspace" && g(!0), s.key === "Tab" && g(!1), s.key === "Enter")
762
+ if (S) {
763
+ const F = i.current?.value || "", w = B(F, a, !0);
764
+ F.length === a.length && w.isValid() ? (g(!1), L(!1)) : L(!0);
765
+ } else
766
+ g(!0);
767
+ },
768
+ allowClear: !0,
769
+ placeholder: n.replace(/0/g, "_"),
770
+ suffix: /* @__PURE__ */ r(Re, { style: { color: "#d9d9d9" } }),
771
+ autoComplete: "off"
772
+ }
773
+ )
774
+ }
775
+ ),
776
+ /* @__PURE__ */ r(
777
+ se,
720
778
  {
721
- ...l,
722
- ref: u,
723
- onFocus: () => {
724
- C(!s), a.current?.updateValue();
779
+ open: S,
780
+ picker: t,
781
+ format: {
782
+ format: a,
783
+ type: "mask"
725
784
  },
726
- onKeyDown: (f) => {
727
- f.key === "Backspace" && C(!0), f.key === "Tab" && C(!1);
785
+ showNow: !0,
786
+ value: V,
787
+ onChange: h,
788
+ onOpenChange: (s) => {
789
+ g(s), s || y(!1);
728
790
  },
729
- allowClear: !0,
730
- placeholder: n.replace(/0/g, "_"),
731
- autoComplete: "off"
791
+ renderExtraFooter: () => C ? /* @__PURE__ */ K(
792
+ "div",
793
+ {
794
+ style: {
795
+ color: "#faad14",
796
+ paddingLeft: "8px",
797
+ fontSize: "12px",
798
+ display: "flex",
799
+ alignItems: "center",
800
+ gap: "6px",
801
+ borderTop: "1px solid #f0f0f0",
802
+ backgroundColor: "#fffbe6"
803
+ },
804
+ children: [
805
+ /* @__PURE__ */ r(je, {}),
806
+ /* @__PURE__ */ r("span", { children: "유효하지 않은 날짜입니다" })
807
+ ]
808
+ }
809
+ ) : null,
810
+ getPopupContainer: (s) => s.parentElement,
811
+ style: {
812
+ position: "absolute",
813
+ top: 0,
814
+ left: 0,
815
+ pointerEvents: "none",
816
+ opacity: 0,
817
+ width: "100%"
818
+ }
732
819
  }
733
820
  )
734
- }
735
- ),
736
- /* @__PURE__ */ r(
737
- le,
738
- {
739
- open: s,
740
- picker: t,
741
- format: i,
742
- value: k,
743
- onChange: x,
744
- getPopupContainer: (f) => f.parentElement,
745
- style: {
746
- position: "absolute",
747
- top: 0,
748
- left: 0,
749
- pointerEvents: "none",
750
- opacity: 0,
751
- width: "100%"
752
- }
753
- }
754
- )
755
- ] })
821
+ ] })
822
+ }
823
+ )
756
824
  }
757
825
  );
758
- }, { Option: me } = se, Mt = ({ itemProps: t, inputProps: e }) => {
759
- const [l, i] = T([]);
760
- return j(() => {
761
- e?.addField === "ALL" ? i([
826
+ }, { Option: fe } = ce, Dt = ({ itemProps: t, inputProps: e }) => {
827
+ const [l, a] = R([]);
828
+ return H(() => {
829
+ e?.addField === "ALL" ? a([
762
830
  { label: "전체", value: "" },
763
831
  ...e?.list || []
764
- ]) : e?.addField === "NULL" ? i([{ label: "", value: "" }, ...e?.list || []]) : i(e?.list || []);
832
+ ]) : e?.addField === "NULL" ? a([{ label: "", value: "" }, ...e?.list || []]) : a(e?.list || []);
765
833
  }, [e?.list]), /* @__PURE__ */ r(
766
- D,
834
+ E,
767
835
  {
768
836
  ...t,
769
837
  getValueProps: (n) => n ? {
@@ -772,29 +840,29 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
772
840
  value: []
773
841
  },
774
842
  normalize: (n) => n != null && n != null && n.length > 0 ? n.toString() : "",
775
- children: /* @__PURE__ */ r(se, { ...e, mode: "multiple", children: l.map((n) => {
843
+ children: /* @__PURE__ */ r(ce, { ...e, mode: "multiple", children: l.map((n) => {
776
844
  const { value: o, label: u } = n;
777
- return e?.printCode ? /* @__PURE__ */ r(me, { value: o, label: u, children: /* @__PURE__ */ r(ae, { children: `[${o}] ${u}` }) }, o) : /* @__PURE__ */ r(me, { value: o, label: u, children: /* @__PURE__ */ r(ae, { children: `${u}` }) }, o);
845
+ return e?.printCode ? /* @__PURE__ */ r(fe, { value: o, label: u, children: /* @__PURE__ */ r(ae, { children: `[${o}] ${u}` }) }, o) : /* @__PURE__ */ r(fe, { value: o, label: u, children: /* @__PURE__ */ r(ae, { children: `${u}` }) }, o);
778
846
  }) })
779
847
  }
780
848
  );
781
- }, Dt = ({ itemProps: t, inputProps: e }) => {
849
+ }, xt = ({ itemProps: t, inputProps: e }) => {
782
850
  const l = (n) => {
783
851
  let o = n.toString().split(".");
784
852
  return e?.decimalPoint != null && o[1] != null && e?.decimalPoint > 0 ? o[1].length > e?.decimalPoint ? o[1] = "." + o[1].substring(0, e?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + o[1];
785
- }, i = (n) => {
853
+ }, a = (n) => {
786
854
  let o = n.toString().split(".");
787
855
  return e?.decimalPoint != null && o[1] != null && e?.decimalPoint > 0 ? o[1].length > e?.decimalPoint ? o[1] = "." + o[1].substring(0, e?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\$\s?|(,*)/g, "") + o[1];
788
856
  };
789
- return /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(
790
- Ie,
857
+ return /* @__PURE__ */ r(E, { ...t, children: /* @__PURE__ */ r(
858
+ _e,
791
859
  {
792
860
  ...e,
793
861
  formatter: (n) => l(n),
794
- parser: (n) => i(n)
862
+ parser: (n) => a(n)
795
863
  }
796
864
  ) });
797
- }, kt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(Ne.Group, { ...e }) }), { RangePicker: nt } = le, fe = {
865
+ }, vt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(E, { ...t, children: /* @__PURE__ */ r(Ne.Group, { ...e }) }), { RangePicker: at } = se, he = {
798
866
  year: { displayFormat: "YYYY", outputFormat: "YYYY" },
799
867
  month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
800
868
  date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
@@ -803,50 +871,50 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
803
871
  displayFormat: "YYYY-MM-DD HH:mm",
804
872
  outputFormat: "YYYYMMDDHHmm"
805
873
  }
806
- }, xt = ({
874
+ }, Et = ({
807
875
  itemProps: t,
808
876
  inputProps: e,
809
877
  type: l = "date",
810
- minDate: i,
878
+ minDate: a,
811
879
  maxDate: n,
812
880
  returnType: o = "string"
813
881
  }) => {
814
- const { displayFormat: u, outputFormat: a } = W(
815
- () => fe[l],
882
+ const { displayFormat: u, outputFormat: i } = J(
883
+ () => he[l],
816
884
  [l]
817
- ), d = W(
818
- () => Object.values(fe).map((s) => s.outputFormat).sort((s, C) => {
819
- if (s.length === C.length) {
820
- if (s === a) return -1;
821
- if (C === a) return 1;
885
+ ), m = J(
886
+ () => Object.values(he).map((c) => c.outputFormat).sort((c, S) => {
887
+ if (c.length === S.length) {
888
+ if (c === i) return -1;
889
+ if (S === i) return 1;
822
890
  }
823
- return C.length - s.length;
891
+ return S.length - c.length;
824
892
  }),
825
- [a]
893
+ [i]
826
894
  // type(outputFormat)이 바뀔 때마다 재정렬
827
895
  );
828
896
  return /* @__PURE__ */ r(
829
- D,
897
+ E,
830
898
  {
831
899
  ...t,
832
- getValueProps: (s) => ({
900
+ getValueProps: (c) => ({
833
901
  // 폼에 저장된 값(문자열 또는 Dayjs)을 RangePicker가 요구하는 Dayjs 배열로 변환
834
- value: s && s.length > 0 ? [
835
- s[0] ? A.isDayjs(s[0]) ? s[0] : A(s[0], d) : null,
836
- s[1] ? A.isDayjs(s[1]) ? s[1] : A(s[1], d) : null
902
+ value: c && c.length > 0 ? [
903
+ c[0] ? B.isDayjs(c[0]) ? c[0] : B(c[0], m) : null,
904
+ c[1] ? B.isDayjs(c[1]) ? c[1] : B(c[1], m) : null
837
905
  ] : null
838
906
  }),
839
- normalize: (s) => s ? o === "dayjs" ? [s[0] ?? void 0, s[1] ?? void 0] : [
840
- s[0] ? s[0].format(a) : void 0,
841
- s[1] ? s[1].format(a) : void 0
907
+ normalize: (c) => c ? o === "dayjs" ? [c[0] ?? void 0, c[1] ?? void 0] : [
908
+ c[0] ? c[0].format(i) : void 0,
909
+ c[1] ? c[1].format(i) : void 0
842
910
  ] : [void 0, void 0],
843
911
  children: /* @__PURE__ */ r(
844
- nt,
912
+ at,
845
913
  {
846
914
  ...e,
847
915
  order: !0,
848
- minDate: i ? A(i, d) : void 0,
849
- maxDate: n ? A(n, d) : void 0,
916
+ minDate: a ? B(a, m) : void 0,
917
+ maxDate: n ? B(n, m) : void 0,
850
918
  picker: l === "datetime" ? "date" : l,
851
919
  showTime: e?.showTime ?? (l === "datetime" || l === "time"),
852
920
  format: u
@@ -854,26 +922,26 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
854
922
  )
855
923
  }
856
924
  );
857
- }, he = te.Search, vt = (t) => {
858
- const e = B.useFormInstance(), { openPopup: l } = Be(), i = t.itemProps?.name || [], n = t.popupConfig || {
925
+ }, ge = te.Search, Bt = (t) => {
926
+ const e = O.useFormInstance(), { openPopup: l } = Ee(), a = t.itemProps?.name || [], n = t.popupConfig || {
859
927
  callback(u) {
860
- console.log("callback data :: ", u), i.length > 1 ? (e.setFieldValue(i[0], u.code), e.setFieldValue(i[1], u.name)) : e.setFieldValue(i, u.code);
928
+ console.log("callback data :: ", u), a.length > 1 ? (e.setFieldValue(a[0], u.code), e.setFieldValue(a[1], u.name)) : e.setFieldValue(a, u.code);
861
929
  }
862
930
  }, o = {
863
931
  ...t,
864
932
  placeholder: typeof t.placeholder == "string" ? t.placeholder : t.placeholder?.[0] || "",
865
933
  onChange: (u) => {
866
- i.length > 1 && e.setFieldValue(i[0], ""), t.onChange?.(u);
934
+ a.length > 1 && e.setFieldValue(a[0], ""), t.onChange?.(u);
867
935
  },
868
936
  onSearch: (u) => {
869
937
  t.popuCd ? l(t.popuCd, t.popupParams, n) : t.onSearch?.(u);
870
938
  }
871
939
  };
872
- return i.length > 1 ? /* @__PURE__ */ r(D, { ...t.itemProps, name: void 0, children: /* @__PURE__ */ q(ae.Compact, { block: !0, children: [
940
+ return a.length > 1 ? /* @__PURE__ */ r(E, { ...t.itemProps, name: void 0, children: /* @__PURE__ */ K(ae.Compact, { block: !0, children: [
873
941
  /* @__PURE__ */ r(
874
- B.Item,
942
+ O.Item,
875
943
  {
876
- name: i[0],
944
+ name: a[0],
877
945
  rules: t.itemProps?.rules,
878
946
  style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
879
947
  validateStatus: "",
@@ -888,56 +956,56 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
888
956
  )
889
957
  }
890
958
  ),
891
- /* @__PURE__ */ r(B.Item, { name: i[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ r(
892
- he,
959
+ /* @__PURE__ */ r(O.Item, { name: a[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ r(
960
+ ge,
893
961
  {
894
962
  readOnly: t.readOnly,
895
963
  enterButton: /* @__PURE__ */ r(
896
- X,
964
+ Z,
897
965
  {
898
- icon: /* @__PURE__ */ r($e, {}),
966
+ icon: /* @__PURE__ */ r(He, {}),
899
967
  disabled: t.readOnly
900
968
  }
901
969
  ),
902
970
  ...o
903
971
  }
904
972
  ) })
905
- ] }) }) : /* @__PURE__ */ r(D, { ...t.itemProps, children: /* @__PURE__ */ r(he, { ...o }) });
906
- }, Bt = ({
973
+ ] }) }) : /* @__PURE__ */ r(E, { ...t.itemProps, children: /* @__PURE__ */ r(ge, { ...o }) });
974
+ }, Ot = ({
907
975
  itemProps: t,
908
976
  selectProps: e = {
909
977
  options: [],
910
978
  allowClear: !0
911
979
  }
912
980
  }) => {
913
- const l = B.useFormInstance(), i = !!l, n = W(() => e?.addField === "ALL" ? [{ label: "전체", value: "" }, ...e?.options || []] : e?.addField === "NULL" ? [{ label: "", value: "" }, ...e?.options || []] : e?.options || [], [e.options, e.addField]), o = (d) => {
914
- e.onChange?.(d);
981
+ const l = O.useFormInstance(), a = !!l, n = J(() => e?.addField === "ALL" ? [{ label: "전체", value: "" }, ...e?.options || []] : e?.addField === "NULL" ? [{ label: "", value: "" }, ...e?.options || []] : e?.options || [], [e.options, e.addField]), o = (m) => {
982
+ e.onChange?.(m);
915
983
  }, u = {
916
984
  ...e,
917
985
  allowClear: e.allowClear ?? !0,
918
986
  options: n,
919
987
  onChange: o,
920
988
  variant: e.variant
921
- }, a = /* @__PURE__ */ r(se, { ...u, disabled: e.disabled });
922
- return e.copyable && !i && console.warn(
989
+ }, i = /* @__PURE__ */ r(ce, { ...u, disabled: e.disabled });
990
+ return e.copyable && !a && console.warn(
923
991
  "BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."
924
- ), e.copyable ? /* @__PURE__ */ r(D, { ...t, name: void 0, children: /* @__PURE__ */ q(ae.Compact, { block: !0, children: [
992
+ ), e.copyable ? /* @__PURE__ */ r(E, { ...t, name: void 0, children: /* @__PURE__ */ K(ae.Compact, { block: !0, children: [
925
993
  /* @__PURE__ */ r(
926
- B.Item,
994
+ O.Item,
927
995
  {
928
996
  name: t?.name,
929
997
  rules: t?.rules,
930
998
  style: { width: "100%", marginBottom: 0 },
931
999
  validateStatus: "",
932
1000
  help: "",
933
- children: a
1001
+ children: i
934
1002
  }
935
1003
  ),
936
1004
  /* @__PURE__ */ r(
937
1005
  Fe.Paragraph,
938
1006
  {
939
1007
  copyable: {
940
- text: i && l?.getFieldValue(t?.name)?.toString() || "",
1008
+ text: a && l?.getFieldValue(t?.name)?.toString() || "",
941
1009
  tooltips: ["코드복사", "코드복사됨"]
942
1010
  },
943
1011
  style: {
@@ -954,26 +1022,26 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
954
1022
  }
955
1023
  }
956
1024
  )
957
- ] }) }) : /* @__PURE__ */ r(D, { ...t, children: a });
958
- }, Et = ({
1025
+ ] }) }) : /* @__PURE__ */ r(E, { ...t, children: i });
1026
+ }, zt = ({
959
1027
  itemProps: t,
960
1028
  inputProps: e = {
961
1029
  format: "YN"
962
1030
  }
963
1031
  }) => {
964
- const l = B.useFormInstance(), i = (n, o) => {
1032
+ const l = O.useFormInstance(), a = (n, o) => {
965
1033
  e.format === "boolean" ? l.setFieldValue(t?.name, n) : l.setFieldValue(t?.name, n ? "Y" : "N"), e.onChange && e.onChange(n, o);
966
1034
  };
967
1035
  return /* @__PURE__ */ r(
968
- D,
1036
+ E,
969
1037
  {
970
1038
  ...t,
971
1039
  getValueProps: (n) => ({ checked: e.format === "boolean" ? !!n : n === "Y" }),
972
1040
  normalize: (n) => typeof n == "boolean" ? e.format === "boolean" ? n : n ? "Y" : "N" : e.format === "boolean" ? !!n : n ? "Y" : "N",
973
- children: /* @__PURE__ */ r(Me, { ...e, onChange: (n, o) => i(n, o) })
1041
+ children: /* @__PURE__ */ r(Me, { ...e, onChange: (n, o) => a(n, o) })
974
1042
  }
975
1043
  );
976
- }, { TextArea: ot } = te, Ot = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(ot, { ...e }) }), at = [
1044
+ }, { TextArea: it } = te, Vt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(E, { ...t, children: /* @__PURE__ */ r(it, { ...e }) }), lt = [
977
1045
  ".pdf",
978
1046
  ".xlsx",
979
1047
  ".xls",
@@ -991,332 +1059,332 @@ const wt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
991
1059
  ".gif",
992
1060
  // 압축
993
1061
  ".zip"
994
- ], ge = {
1062
+ ], pe = {
995
1063
  FILE: "file"
996
- }, it = ({
1064
+ }, st = ({
997
1065
  originNode: t,
998
1066
  file: e,
999
1067
  fileList: l,
1000
- moveFile: i,
1068
+ moveFile: a,
1001
1069
  onDrop: n
1002
1070
  }) => {
1003
- const o = Z(null), [{ handlerId: u }, a] = We({
1004
- accept: ge.FILE,
1005
- collect: (p) => ({
1006
- handlerId: p.getHandlerId()
1071
+ const o = W(null), [{ handlerId: u }, i] = Xe({
1072
+ accept: pe.FILE,
1073
+ collect: (g) => ({
1074
+ handlerId: g.getHandlerId()
1007
1075
  }),
1008
- hover(p, Y) {
1076
+ hover(g, C) {
1009
1077
  if (!o.current)
1010
1078
  return;
1011
- const S = p.uid, k = e.uid;
1012
- if (S === k)
1079
+ const L = g.uid, D = e.uid;
1080
+ if (L === D)
1013
1081
  return;
1014
- const E = ne(l, { uid: k }), x = ne(l, { uid: S });
1015
- if (x === -1 || E === -1)
1082
+ const V = ne(l, { uid: D }), N = ne(l, { uid: L });
1083
+ if (N === -1 || V === -1)
1016
1084
  return;
1017
- const f = o.current.getBoundingClientRect(), m = Y.getClientOffset();
1018
- if (!m)
1085
+ const p = o.current.getBoundingClientRect(), h = C.getClientOffset();
1086
+ if (!h)
1019
1087
  return;
1020
- const g = (f.bottom - f.top) / 2, _ = m.y - f.top;
1021
- x < E && _ < g || x > E && _ > g || i(S, k);
1088
+ const y = (p.bottom - p.top) / 2, s = h.y - p.top;
1089
+ N < V && s < y || N > V && s > y || a(L, D);
1022
1090
  },
1023
1091
  drop() {
1024
1092
  n();
1025
1093
  }
1026
- }), [{ isDragging: d }, s] = Je({
1027
- type: ge.FILE,
1094
+ }), [{ isDragging: m }, c] = Ze({
1095
+ type: pe.FILE,
1028
1096
  item: () => ({
1029
1097
  uid: e.uid,
1030
1098
  index: ne(l, { uid: e.uid })
1031
1099
  }),
1032
- collect: (p) => ({
1033
- isDragging: p.isDragging()
1100
+ collect: (g) => ({
1101
+ isDragging: g.isDragging()
1034
1102
  })
1035
- }), C = d ? 0 : 1;
1036
- return s(a(o)), /* @__PURE__ */ r("div", { ref: o, style: { opacity: C }, "data-handler-id": u, children: t });
1037
- }, zt = ({
1103
+ }), S = m ? 0 : 1;
1104
+ return c(i(o)), /* @__PURE__ */ r("div", { ref: o, style: { opacity: S }, "data-handler-id": u, children: t });
1105
+ }, Ut = ({
1038
1106
  itemProps: t,
1039
1107
  fileGrpKey: e,
1040
1108
  onUploadComplete: l,
1041
- onFetchFilesTrxCd: i = "SCMFILE00101",
1109
+ onFetchFilesTrxCd: a = "SCMFILE00101",
1042
1110
  onSuccessTrxCd: n = "SCMFILE00102",
1043
1111
  onDeleteFileTrxCd: o = "SCMFILE00103",
1044
1112
  onReorderFilesTrxCd: u = "SCMFILE00104",
1045
- allowedExtensions: a = at,
1046
- maxFileSize: d = 200,
1047
- showButton: s = !0,
1113
+ allowedExtensions: i = lt,
1114
+ maxFileSize: m = 200,
1115
+ showButton: c = !0,
1048
1116
  // 기본값으로 true 설정
1049
- multiple: C = !1,
1050
- newFileGrpKeyonModify: p = !1,
1051
- buttonText: Y = "파일 선택",
1052
- localOnly: S = !1,
1053
- onFilesChange: k
1117
+ multiple: S = !1,
1118
+ newFileGrpKeyonModify: g = !1,
1119
+ buttonText: C = "파일 선택",
1120
+ localOnly: L = !1,
1121
+ onFilesChange: D
1054
1122
  }) => {
1055
- const [E, x] = T([]), f = Z(e), m = Z([]), g = B.useFormInstance(), O = Z(
1056
- He(() => {
1057
- if (S || m.current.length === 0)
1123
+ const [V, N] = R([]), p = W(e), h = W([]), y = O.useFormInstance(), F = W(
1124
+ Ge(() => {
1125
+ if (L || h.current.length === 0)
1058
1126
  return;
1059
- const c = [...m.current];
1060
- if (m.current = [], n) {
1061
- const w = c.map((F) => ({
1062
- crprCd: K()?.crprCd,
1127
+ const d = [...h.current];
1128
+ if (h.current = [], n) {
1129
+ const k = d.map((b) => ({
1130
+ crprCd: G()?.crprCd,
1063
1131
  sysCd: __SYS_CD__,
1064
- fileGrpKey: f.current,
1065
- physFileNm: F.fileNameP,
1066
- lgclFileNm: F.fileNameL,
1067
- filePath: F.filePath,
1068
- fileExtn: F.fileExt,
1069
- fileSize: F.fileSize,
1132
+ fileGrpKey: p.current,
1133
+ physFileNm: b.fileNameP,
1134
+ lgclFileNm: b.fileNameL,
1135
+ filePath: b.filePath,
1136
+ fileExtn: b.fileExt,
1137
+ fileSize: b.fileSize,
1070
1138
  mltpYn: "N"
1071
1139
  }));
1072
- console.log("newFileGrpKeyonModify", p), console.log(
1140
+ console.log("newFileGrpKeyonModify", g), console.log(
1073
1141
  "newFileGrpKeyonModify",
1074
- p ? 0 : f.current
1075
- ), J(n, {
1076
- crprCd: K()?.crprCd,
1142
+ g ? 0 : p.current
1143
+ ), X(n, {
1144
+ crprCd: G()?.crprCd,
1077
1145
  sysCd: __SYS_CD__,
1078
- fileGrpKey: p ? 0 : f.current,
1079
- oldFileGrpKey: f.current,
1080
- newFileGrpKeyonModify: p,
1081
- sub: w
1082
- }).then((F) => {
1083
- if (F?.sub && F.sub.length > 0) {
1084
- const h = F.sub[0].fileGrpKey;
1085
- (!f.current || p) && (f.current = h);
1086
- const z = /* @__PURE__ */ new Map();
1087
- F.sub.forEach((M) => {
1088
- const V = c.find(
1089
- ($) => $.fileNameL === M.lgclFileNm
1146
+ fileGrpKey: g ? 0 : p.current,
1147
+ oldFileGrpKey: p.current,
1148
+ newFileGrpKeyonModify: g,
1149
+ sub: k
1150
+ }).then((b) => {
1151
+ if (b?.sub && b.sub.length > 0) {
1152
+ const f = b.sub[0].fileGrpKey;
1153
+ (!p.current || g) && (p.current = f);
1154
+ const U = /* @__PURE__ */ new Map();
1155
+ b.sub.forEach((v) => {
1156
+ const A = d.find(
1157
+ (j) => j.fileNameL === v.lgclFileNm
1090
1158
  );
1091
- V && z.set(V.tempId, M);
1159
+ A && U.set(A.tempId, v);
1092
1160
  });
1093
- const P = t?.name;
1094
- ((M) => {
1095
- if (y) {
1096
- const V = g?.getFieldValue(P) || [], $ = M(V);
1097
- g?.setFieldValue(P, $);
1161
+ const Q = t?.name;
1162
+ ((v) => {
1163
+ if (Y) {
1164
+ const A = y?.getFieldValue(Q) || [], j = v(A);
1165
+ y?.setFieldValue(Q, j);
1098
1166
  } else
1099
- x((V) => M(V));
1100
- })((M) => M.map((V) => {
1101
- const $ = z.get(V.uid);
1102
- if ($) {
1103
- const ce = c.find(
1104
- (Se) => Se.tempId === V.uid
1167
+ N((A) => v(A));
1168
+ })((v) => v.map((A) => {
1169
+ const j = U.get(A.uid);
1170
+ if (j) {
1171
+ const de = d.find(
1172
+ (be) => be.tempId === A.uid
1105
1173
  );
1106
- return l && ce && l({
1107
- ...ce,
1108
- fileGrpKey: h,
1109
- fileKey: $.fileKey
1174
+ return l && de && l({
1175
+ ...de,
1176
+ fileGrpKey: f,
1177
+ fileKey: j.fileKey
1110
1178
  }), {
1111
- ...V,
1112
- name: $.lgclFileNm,
1113
- fileGrpKey: h,
1114
- fileKey: $.fileKey,
1115
- uid: $.fileKey,
1179
+ ...A,
1180
+ name: j.lgclFileNm,
1181
+ fileGrpKey: f,
1182
+ fileKey: j.fileKey,
1183
+ uid: j.fileKey,
1116
1184
  status: "done",
1117
- url: `/api/download?filePath=${$.filePath}&logicalName=${$.lgclFileNm}`
1185
+ url: `/api/download?filePath=${j.filePath}&logicalName=${j.lgclFileNm}`
1118
1186
  };
1119
1187
  }
1120
- return V;
1188
+ return A;
1121
1189
  }));
1122
1190
  }
1123
- }).catch((F) => {
1124
- console.error("업로드 후처리 서비스 호출 실패:", F), L.error("파일 후처리 중 오류가 발생했습니다.");
1125
- const h = new Set(c.map((U) => U.tempId)), z = t?.name;
1126
- ((U) => {
1127
- if (y) {
1128
- const M = g?.getFieldValue(z) || [], V = U(M);
1129
- g?.setFieldValue(z, V);
1191
+ }).catch((b) => {
1192
+ console.error("업로드 후처리 서비스 호출 실패:", b), _.error("파일 후처리 중 오류가 발생했습니다.");
1193
+ const f = new Set(d.map((T) => T.tempId)), U = t?.name;
1194
+ ((T) => {
1195
+ if (Y) {
1196
+ const v = y?.getFieldValue(U) || [], A = T(v);
1197
+ y?.setFieldValue(U, A);
1130
1198
  } else
1131
- x((M) => U(M));
1199
+ N((v) => T(v));
1132
1200
  })(
1133
- (U) => U.map(
1134
- (M) => h.has(M.uid) ? { ...M, status: "error", error: "후처리 실패" } : M
1201
+ (T) => T.map(
1202
+ (v) => f.has(v.uid) ? { ...v, status: "error", error: "후처리 실패" } : v
1135
1203
  )
1136
1204
  );
1137
1205
  });
1138
1206
  }
1139
1207
  }, 500)
1140
1208
  ).current;
1141
- j(() => () => {
1142
- O.cancel();
1143
- }, [O]), j(() => {
1144
- f.current = e;
1145
- }, [e]), j(() => {
1146
- S || e && i && J(i, {
1147
- crprCd: K()?.crprCd,
1209
+ H(() => () => {
1210
+ F.cancel();
1211
+ }, [F]), H(() => {
1212
+ p.current = e;
1213
+ }, [e]), H(() => {
1214
+ L || e && a && X(a, {
1215
+ crprCd: G()?.crprCd,
1148
1216
  sysCd: __SYS_CD__,
1149
1217
  fileGrpKey: e
1150
- }).then((c) => {
1151
- if (c?.sub) {
1152
- const w = c.sub.map((h) => ({
1153
- uid: h.fileKey,
1154
- name: h.lgclFileNm,
1218
+ }).then((d) => {
1219
+ if (d?.sub) {
1220
+ const k = d.sub.map((f) => ({
1221
+ uid: f.fileKey,
1222
+ name: f.lgclFileNm,
1155
1223
  status: "done",
1156
- url: `/api/download?filePath=${h.filePath}&logicalName=${h.lgclFileNm}`
1157
- })), F = t?.name;
1158
- y ? g?.setFieldValue(F, w) : x(w);
1224
+ url: `/api/download?filePath=${f.filePath}&logicalName=${f.lgclFileNm}`
1225
+ })), b = t?.name;
1226
+ Y ? y?.setFieldValue(b, k) : N(k);
1159
1227
  } else {
1160
- const w = t?.name;
1161
- y ? g?.setFieldValue(w, []) : x([]);
1228
+ const k = t?.name;
1229
+ Y ? y?.setFieldValue(k, []) : N([]);
1162
1230
  }
1163
- }).catch((c) => {
1164
- console.error("파일 목록 조회 서비스 호출에 실패했습니다.", c), L.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
1231
+ }).catch((d) => {
1232
+ console.error("파일 목록 조회 서비스 호출에 실패했습니다.", d), _.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
1165
1233
  });
1166
- }, [e, i]);
1167
- const H = (c, w) => {
1168
- const F = t?.name, h = y ? g?.getFieldValue(F) || [] : E, z = ne(h, { uid: c }), P = ne(h, { uid: w });
1169
- if (z < 0 || P < 0) return;
1170
- const U = [...h], [M] = U.splice(z, 1);
1171
- U.splice(P, 0, M), y ? g?.setFieldValue(F, U) : x(U);
1234
+ }, [e, a]);
1235
+ const w = (d, k) => {
1236
+ const b = t?.name, f = Y ? y?.getFieldValue(b) || [] : V, U = ne(f, { uid: d }), Q = ne(f, { uid: k });
1237
+ if (U < 0 || Q < 0) return;
1238
+ const T = [...f], [v] = T.splice(U, 1);
1239
+ T.splice(Q, 0, v), Y ? y?.setFieldValue(b, T) : N(T);
1172
1240
  }, I = () => {
1173
- if (!S && e && u) {
1174
- const c = t?.name, F = (y ? g?.getFieldValue(c) || [] : E).map((h) => h.uid);
1175
- J(u, {
1176
- crprCd: K()?.crprCd,
1241
+ if (!L && e && u) {
1242
+ const d = t?.name, b = (Y ? y?.getFieldValue(d) || [] : V).map((f) => f.uid);
1243
+ X(u, {
1244
+ crprCd: G()?.crprCd,
1177
1245
  sysCd: __SYS_CD__,
1178
1246
  fileGrpKey: e,
1179
- reorderedFileKeys: F
1247
+ reorderedFileKeys: b
1180
1248
  }).then(() => {
1181
- L.success("파일 순서가 성공적으로 저장되었습니다.");
1182
- }).catch((h) => {
1183
- console.error("파일 순서 저장 서비스 호출 실패:", h), L.error("파일 순서 저장 중 오류가 발생했습니다.");
1249
+ _.success("파일 순서가 성공적으로 저장되었습니다.");
1250
+ }).catch((f) => {
1251
+ console.error("파일 순서 저장 서비스 호출 실패:", f), _.error("파일 순서 저장 중 오류가 발생했습니다.");
1184
1252
  });
1185
1253
  }
1186
- }, R = (c) => {
1187
- const w = t?.name, F = y ? g?.getFieldValue(w) || [] : E;
1188
- if (!C && F.length > 0)
1189
- return L.error("하나의 파일만 업로드할 수 있습니다."), G.LIST_IGNORE;
1190
- if (a && a.length > 0) {
1191
- const h = `.${c.name.split(".").pop()?.toLowerCase()}`;
1192
- if (!a.includes(h))
1193
- return L.error(
1194
- `${c.name} 파일은 허용되지 않는 확장자입니다. (${a.join(
1254
+ }, $ = (d) => {
1255
+ const k = t?.name, b = Y ? y?.getFieldValue(k) || [] : V;
1256
+ if (!S && b.length > 0)
1257
+ return _.error("하나의 파일만 업로드할 수 있습니다."), q.LIST_IGNORE;
1258
+ if (i && i.length > 0) {
1259
+ const f = `.${d.name.split(".").pop()?.toLowerCase()}`;
1260
+ if (!i.includes(f))
1261
+ return _.error(
1262
+ `${d.name} 파일은 허용되지 않는 확장자입니다. (${i.join(
1195
1263
  ", "
1196
1264
  )})`
1197
- ), G.LIST_IGNORE;
1265
+ ), q.LIST_IGNORE;
1198
1266
  }
1199
- return d && !(c.size / 1024 / 1024 < d) ? (L.error(`일반업로드의 최대용량은 ${d}MB입니다.`), G.LIST_IGNORE) : !S;
1200
- }, y = !!t?.name, b = {
1267
+ return m && !(d.size / 1024 / 1024 < m) ? (_.error(`일반업로드의 최대용량은 ${m}MB입니다.`), q.LIST_IGNORE) : !L;
1268
+ }, Y = !!t?.name, M = {
1201
1269
  name: "file",
1202
- multiple: C,
1203
- action: S ? void 0 : "/api/upload",
1204
- beforeUpload: R,
1270
+ multiple: S,
1271
+ action: L ? void 0 : "/api/upload",
1272
+ beforeUpload: $,
1205
1273
  showUploadList: {
1206
- showRemoveIcon: s
1274
+ showRemoveIcon: c
1207
1275
  // showButton 값에 따라 삭제 버튼 표시/숨김
1208
1276
  },
1209
- onChange(c) {
1210
- const { status: w, uid: F } = c.file;
1211
- if (w === "removed") {
1212
- if (!S && o)
1213
- J(o, {
1214
- crprCd: K()?.crprCd,
1277
+ onChange(d) {
1278
+ const { status: k, uid: b } = d.file;
1279
+ if (k === "removed") {
1280
+ if (!L && o)
1281
+ X(o, {
1282
+ crprCd: G()?.crprCd,
1215
1283
  sysCd: __SYS_CD__,
1216
- fileGrpKey: p ? 0 : f.current,
1217
- fileKey: F,
1218
- oldFileGrpKey: f.current,
1219
- newFileGrpKeyonModify: p
1220
- }).then((h) => {
1221
- if (L.success("파일이 성공적으로 삭제되었습니다."), p && (f.current = h.fileGrpKey), y) {
1222
- const z = t?.name;
1223
- g?.setFieldValue(z, c.fileList);
1284
+ fileGrpKey: g ? 0 : p.current,
1285
+ fileKey: b,
1286
+ oldFileGrpKey: p.current,
1287
+ newFileGrpKeyonModify: g
1288
+ }).then((f) => {
1289
+ if (_.success("파일이 성공적으로 삭제되었습니다."), g && (p.current = f.fileGrpKey), Y) {
1290
+ const U = t?.name;
1291
+ y?.setFieldValue(U, d.fileList);
1224
1292
  } else
1225
- x(c.fileList);
1226
- k?.(c.fileList), l?.({
1227
- fileGrpKey: h.fileGrpKey
1293
+ N(d.fileList);
1294
+ D?.(d.fileList), l?.({
1295
+ fileGrpKey: f.fileGrpKey
1228
1296
  });
1229
- }).catch((h) => {
1230
- console.error("파일 삭제 서비스 호출에 실패했습니다.", h), L.error("파일 삭제 중 오류가 발생했습니다.");
1297
+ }).catch((f) => {
1298
+ console.error("파일 삭제 서비스 호출에 실패했습니다.", f), _.error("파일 삭제 중 오류가 발생했습니다.");
1231
1299
  });
1232
1300
  else {
1233
- if (y) {
1234
- const h = t?.name;
1235
- g?.setFieldValue(h, c.fileList);
1301
+ if (Y) {
1302
+ const f = t?.name;
1303
+ y?.setFieldValue(f, d.fileList);
1236
1304
  } else
1237
- x(c.fileList);
1238
- k?.(c.fileList);
1305
+ N(d.fileList);
1306
+ D?.(d.fileList);
1239
1307
  }
1240
1308
  return;
1241
1309
  }
1242
- if (y) {
1243
- const h = t?.name;
1244
- g?.setFieldValue(h, c.fileList);
1310
+ if (Y) {
1311
+ const f = t?.name;
1312
+ y?.setFieldValue(f, d.fileList);
1245
1313
  } else
1246
- x(c.fileList);
1247
- if (k?.(c.fileList), w === "done")
1248
- if (!S && c.file.response?.success) {
1249
- const { uploadedFiles: h } = c.file.response;
1250
- h && Array.isArray(h) && h.length > 0 && (h.forEach((z) => {
1251
- z.tempId = c.file.uid, m.current.push(z);
1252
- }), O()), L.success(
1253
- c.file.response.message || `${c.file.name} 파일이 성공적으로 업로드되었습니다.`
1314
+ N(d.fileList);
1315
+ if (D?.(d.fileList), k === "done")
1316
+ if (!L && d.file.response?.success) {
1317
+ const { uploadedFiles: f } = d.file.response;
1318
+ f && Array.isArray(f) && f.length > 0 && (f.forEach((U) => {
1319
+ U.tempId = d.file.uid, h.current.push(U);
1320
+ }), F()), _.success(
1321
+ d.file.response.message || `${d.file.name} 파일이 성공적으로 업로드되었습니다.`
1254
1322
  );
1255
1323
  } else
1256
- L.error(
1257
- c.file.response?.message || `${c.file.name} 파일 업로드에 실패했습니다.`
1324
+ _.error(
1325
+ d.file.response?.message || `${d.file.name} 파일 업로드에 실패했습니다.`
1258
1326
  );
1259
- else w === "error" && L.error(
1260
- c.file.response?.message || `${c.file.name} 파일 업로드 중 오류가 발생했습니다.`
1327
+ else k === "error" && _.error(
1328
+ d.file.response?.message || `${d.file.name} 파일 업로드 중 오류가 발생했습니다.`
1261
1329
  );
1262
1330
  },
1263
- itemRender(c, w, F) {
1264
- const h = xe(c, {
1265
- href: w.url || void 0,
1331
+ itemRender(d, k, b) {
1332
+ const f = xe(d, {
1333
+ href: k.url || void 0,
1266
1334
  title: void 0
1267
1335
  });
1268
1336
  return /* @__PURE__ */ r(
1269
- it,
1337
+ st,
1270
1338
  {
1271
- originNode: h,
1272
- file: w,
1273
- fileList: F,
1274
- moveFile: H,
1339
+ originNode: f,
1340
+ file: k,
1341
+ fileList: b,
1342
+ moveFile: w,
1275
1343
  onDrop: I
1276
1344
  },
1277
- w.uid
1345
+ k.uid
1278
1346
  );
1279
1347
  }
1280
1348
  };
1281
- y || (b.fileList = E);
1282
- const v = (c) => Array.isArray(c) ? c : c && c.fileList, N = t?.name, re = y ? B.useWatch?.(N, g) : void 0, Q = y ? re || [] : E;
1283
- return /* @__PURE__ */ r(qe, { backend: Xe, children: /* @__PURE__ */ r(
1284
- D,
1349
+ Y || (M.fileList = V);
1350
+ const z = (d) => Array.isArray(d) ? d : d && d.fileList, x = t?.name, re = Y ? O.useWatch?.(x, y) : void 0, P = Y ? re || [] : V;
1351
+ return /* @__PURE__ */ r(Je, { backend: Pe, children: /* @__PURE__ */ r(
1352
+ E,
1285
1353
  {
1286
1354
  valuePropName: "fileList",
1287
- getValueFromEvent: v,
1355
+ getValueFromEvent: z,
1288
1356
  ...t,
1289
1357
  children: /* @__PURE__ */ r(
1290
- G,
1358
+ q,
1291
1359
  {
1292
1360
  headers: { SYSCD: __SYS_CD__ },
1293
- ...b,
1361
+ ...M,
1294
1362
  listType: "picture",
1295
- children: s && (C || Q.length === 0) && /* @__PURE__ */ r(X, { icon: /* @__PURE__ */ r(Ye, {}), children: Y })
1363
+ children: c && (S || P.length === 0) && /* @__PURE__ */ r(Z, { icon: /* @__PURE__ */ r(Ye, {}), children: C })
1296
1364
  }
1297
1365
  )
1298
1366
  }
1299
1367
  ) });
1300
1368
  };
1301
1369
  export {
1302
- Yt as BwgButton,
1303
- Ct as BwgCheck,
1304
- St as BwgCheckList,
1305
- Lt as BwgDatePicker,
1306
- bt as BwgDownload,
1307
- Ze as BwgForm,
1308
- D as BwgFormItem,
1309
- wt as BwgInput,
1310
- _t as BwgLargeUploader,
1311
- It as BwgMaskedInput,
1312
- Nt as BwgMaskedPicker,
1313
- Mt as BwgMultiSelect,
1314
- Dt as BwgNumber,
1315
- kt as BwgRadio,
1316
- xt as BwgRangePicker,
1317
- vt as BwgSearch,
1318
- Bt as BwgSelect,
1319
- Et as BwgSwitch,
1320
- Ot as BwgTextArea,
1321
- zt as BwgUploader
1370
+ bt as BwgButton,
1371
+ St as BwgCheck,
1372
+ Lt as BwgCheckList,
1373
+ wt as BwgDatePicker,
1374
+ It as BwgDownload,
1375
+ Qe as BwgForm,
1376
+ E as BwgFormItem,
1377
+ _t as BwgInput,
1378
+ Nt as BwgLargeUploader,
1379
+ Mt as BwgMaskedInput,
1380
+ kt as BwgMaskedPicker,
1381
+ Dt as BwgMultiSelect,
1382
+ xt as BwgNumber,
1383
+ vt as BwgRadio,
1384
+ Et as BwgRangePicker,
1385
+ Bt as BwgSearch,
1386
+ Ot as BwgSelect,
1387
+ zt as BwgSwitch,
1388
+ Vt as BwgTextArea,
1389
+ Ut as BwgUploader
1322
1390
  };