@owp/core 1.25.0 → 1.26.0

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 (113) hide show
  1. package/colors.d.ts +1 -0
  2. package/colors.js +1 -0
  3. package/context.d.ts +1 -0
  4. package/context.js +1 -0
  5. package/dist/OwpAppProvider-F48yHfyI.js +22 -0
  6. package/dist/OwpAppProvider-F48yHfyI.js.map +1 -0
  7. package/dist/OwpStoreProvider-CqHkIIUm.js +34 -0
  8. package/dist/OwpStoreProvider-CqHkIIUm.js.map +1 -0
  9. package/dist/OwpUtils-DxEd-Pjo.js +618 -0
  10. package/dist/OwpUtils-DxEd-Pjo.js.map +1 -0
  11. package/dist/{QuickPanel-uWtPXsYC.js → QuickPanel-DNAisp_R.js} +3 -3
  12. package/dist/{QuickPanel-uWtPXsYC.js.map → QuickPanel-DNAisp_R.js.map} +1 -1
  13. package/dist/colors.js +38 -0
  14. package/dist/colors.js.map +1 -0
  15. package/dist/constants.js +9 -8
  16. package/dist/constants.js.map +1 -1
  17. package/dist/context.js +28 -0
  18. package/dist/context.js.map +1 -0
  19. package/dist/emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js +1751 -0
  20. package/dist/emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js.map +1 -0
  21. package/dist/hooks.js +76 -33
  22. package/dist/hooks.js.map +1 -1
  23. package/dist/{index-DvBno1rF.js → index-fDrAKBzK.js} +18170 -20983
  24. package/dist/index-fDrAKBzK.js.map +1 -0
  25. package/dist/index.js +125 -233
  26. package/dist/index.js.map +1 -1
  27. package/dist/isTypedArray-DPyC49cI.js +411 -0
  28. package/dist/isTypedArray-DPyC49cI.js.map +1 -0
  29. package/dist/lazyLoadedSlices-CsgnywgU.js +2815 -0
  30. package/dist/lazyLoadedSlices-CsgnywgU.js.map +1 -0
  31. package/dist/owp-app.css +1 -1
  32. package/dist/storageKeys-DRzte9LZ.js +15 -0
  33. package/dist/storageKeys-DRzte9LZ.js.map +1 -0
  34. package/dist/store.js +7 -0
  35. package/dist/store.js.map +1 -0
  36. package/dist/toUpper-BhzrnIm3.js +16 -0
  37. package/dist/toUpper-BhzrnIm3.js.map +1 -0
  38. package/dist/treeGrid-CjB04cBq.js +35 -0
  39. package/dist/treeGrid-CjB04cBq.js.map +1 -0
  40. package/dist/treeGridUtil-DaqTz5v3.js +771 -0
  41. package/dist/treeGridUtil-DaqTz5v3.js.map +1 -0
  42. package/dist/types/colors/index.d.ts +2 -0
  43. package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
  44. package/dist/types/components/OwpAutoLogoutDialog/index.d.ts +1 -0
  45. package/dist/types/components/OwpBarcodeInput/OwpBarcodeInput.d.ts +1 -0
  46. package/dist/types/components/OwpBarcodeInput/index.d.ts +1 -0
  47. package/dist/types/components/OwpButtonDelete/OwpButtonDelete.d.ts +12 -0
  48. package/dist/types/components/OwpButtonDelete/index.d.ts +1 -12
  49. package/dist/types/components/OwpButtonSave/OwpButtonSave.d.ts +12 -0
  50. package/dist/types/components/OwpButtonSave/index.d.ts +1 -12
  51. package/dist/types/components/OwpCommonDialog/OwpCommonDialog.d.ts +26 -0
  52. package/dist/types/components/OwpCommonDialog/index.d.ts +1 -26
  53. package/dist/types/components/OwpExportExcelButton/index.d.ts +1 -0
  54. package/dist/types/components/OwpFileUploadButton/index.d.ts +1 -0
  55. package/dist/types/components/OwpMrtTable/OwpMrtTable.d.ts +9 -0
  56. package/dist/types/components/OwpMrtTable/index.d.ts +1 -9
  57. package/dist/types/components/OwpNumberField/OwpNumberField.d.ts +12 -0
  58. package/dist/types/components/OwpNumberField/index.d.ts +1 -12
  59. package/dist/types/components/OwpOptionSelector/OwpOptionSelector.d.ts +22 -0
  60. package/dist/types/components/OwpOptionSelector/index.d.ts +1 -22
  61. package/dist/types/components/OwpPageContent/OwpPageContent.d.ts +17 -0
  62. package/dist/types/components/OwpPageContent/index.d.ts +1 -17
  63. package/dist/types/components/OwpPageLockLoading/OwpPageLockLoading.d.ts +11 -0
  64. package/dist/types/components/OwpPageLockLoading/index.d.ts +1 -11
  65. package/dist/types/components/OwpPageTitle/OwpPageTitle.d.ts +15 -0
  66. package/dist/types/components/OwpPageTitle/index.d.ts +1 -15
  67. package/dist/types/components/OwpPicker/index.d.ts +5 -0
  68. package/dist/types/components/OwpSearchFilter/OwpSearchFilter.d.ts +17 -0
  69. package/dist/types/components/OwpSearchFilter/index.d.ts +1 -17
  70. package/dist/types/components/OwpSection/OwpSection.d.ts +24 -0
  71. package/dist/types/components/OwpSection/index.d.ts +1 -24
  72. package/dist/types/components/OwpTable/index.d.ts +3 -0
  73. package/dist/types/components/OwpTextField/index.d.ts +1 -0
  74. package/dist/types/components/OwpTreeGridExcelButton/OwpTreeGridExcelButton.d.ts +12 -0
  75. package/dist/types/components/OwpTreeGridExcelButton/index.d.ts +1 -12
  76. package/dist/types/components/OwpTreeView/index.d.ts +1 -0
  77. package/dist/types/components/OwpYesNoSelector/OwpYesNoSelector.d.ts +16 -0
  78. package/dist/types/components/OwpYesNoSelector/index.d.ts +1 -16
  79. package/dist/types/components/OwpZoomImageSlider/index.d.ts +1 -0
  80. package/dist/types/components/shared-components/tabs/OwpTab.d.ts +1 -1
  81. package/dist/types/components/shared-components/tabs/OwpTabs.d.ts +1 -1
  82. package/dist/types/context/OwpCoreProvider.d.ts +21 -0
  83. package/dist/types/context/index.d.ts +2 -0
  84. package/dist/types/hooks/useCommonCodeList.d.ts +4 -4
  85. package/dist/types/hooks/useNavigation.d.ts +4 -4
  86. package/dist/types/index.d.ts +2 -9
  87. package/dist/types/store/OwpStoreProvider.d.ts +12 -0
  88. package/dist/types/store/index.d.ts +3 -0
  89. package/dist/useStorage-B4ZrPct1.js +65 -0
  90. package/dist/useStorage-B4ZrPct1.js.map +1 -0
  91. package/dist/useTreeGridExcelExport-BjyBdpz1.js +360 -0
  92. package/dist/useTreeGridExcelExport-BjyBdpz1.js.map +1 -0
  93. package/dist/utils.js +6934 -64
  94. package/dist/utils.js.map +1 -1
  95. package/package.json +7 -1
  96. package/store.d.ts +1 -0
  97. package/store.js +1 -0
  98. package/dist/index-DvBno1rF.js.map +0 -1
  99. package/dist/treeGrid-CPgV7yMG.js +0 -46
  100. package/dist/treeGrid-CPgV7yMG.js.map +0 -1
  101. package/dist/treeGridUtil-mbjQrrTs.js +0 -1176
  102. package/dist/treeGridUtil-mbjQrrTs.js.map +0 -1
  103. package/dist/types/components/layouts/index.d.ts +0 -8
  104. package/dist/types/components/layouts/layout1/components/RightSideLayout1.d.ts +0 -6
  105. package/dist/types/components/layouts/shared-components/DemoLayoutFooterContent.d.ts +0 -5
  106. package/dist/types/components/layouts/shared-components/DocumentationButton.d.ts +0 -8
  107. package/dist/types/components/layouts/shared-components/PoweredByLinks.d.ts +0 -5
  108. package/dist/types/components/layouts/shared-components/PurchaseButton.d.ts +0 -8
  109. package/dist/types/components/layouts/shared-components/UserNavbarHeader.d.ts +0 -5
  110. package/dist/useTreeGridExcelExport-BPWeY2Oq.js +0 -2201
  111. package/dist/useTreeGridExcelExport-BPWeY2Oq.js.map +0 -1
  112. package/dist/zipUtil-Dmq4Gna2.js +0 -7505
  113. package/dist/zipUtil-Dmq4Gna2.js.map +0 -1
@@ -0,0 +1,771 @@
1
+ var ue = Object.defineProperty;
2
+ var a = (e, t) => ue(e, "name", { value: t, configurable: !0 });
3
+ import { c as J, b as Z, a as D, d as B, e as Q, g as ye, h as ge } from "./treeGrid-CjB04cBq.js";
4
+ import { c as he, d as v, e as we, t as pe, f as x, g as Ee, h as ee, j as Re, k as Se, l as Ie, b as $, i as Ce } from "./isTypedArray-DPyC49cI.js";
5
+ import te from "dayjs";
6
+ import Te from "exceljs";
7
+ import { enqueueSnackbar as me } from "notistack";
8
+ function be(e, t) {
9
+ const n = new Set(t);
10
+ return e.filter((r) => !n.has(r));
11
+ }
12
+ a(be, "difference");
13
+ function xe(e, ...t) {
14
+ return be(e, t);
15
+ }
16
+ a(xe, "without$1");
17
+ function Ge(e) {
18
+ return Array.isArray(e);
19
+ }
20
+ a(Ge, "isArray");
21
+ const Ae = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu");
22
+ function _e(e) {
23
+ return Array.from(e.match(Ae) ?? []);
24
+ }
25
+ a(_e, "words");
26
+ function De(e) {
27
+ return _e(e).map((n) => n.toLowerCase()).join(" ");
28
+ }
29
+ a(De, "lowerCase$1");
30
+ function Be(e) {
31
+ return he(e) && v(e);
32
+ }
33
+ a(Be, "isArrayLikeObject");
34
+ function k(e, t) {
35
+ if (e == null)
36
+ return !0;
37
+ switch (typeof t) {
38
+ case "symbol":
39
+ case "number":
40
+ case "object": {
41
+ if (Array.isArray(t))
42
+ return U(e, t);
43
+ if (typeof t == "number" ? t = Ee(t) : typeof t == "object" && (Object.is(t == null ? void 0 : t.valueOf(), -0) ? t = "-0" : t = String(t)), x(t))
44
+ return !1;
45
+ if ((e == null ? void 0 : e[t]) === void 0)
46
+ return !0;
47
+ try {
48
+ return delete e[t], !0;
49
+ } catch {
50
+ return !1;
51
+ }
52
+ }
53
+ case "string": {
54
+ if ((e == null ? void 0 : e[t]) === void 0 && we(t))
55
+ return U(e, pe(t));
56
+ if (x(t))
57
+ return !1;
58
+ try {
59
+ return delete e[t], !0;
60
+ } catch {
61
+ return !1;
62
+ }
63
+ }
64
+ }
65
+ }
66
+ a(k, "unset");
67
+ function U(e, t) {
68
+ const n = ee(e, t.slice(0, -1), e), r = t[t.length - 1];
69
+ if ((n == null ? void 0 : n[r]) === void 0)
70
+ return !0;
71
+ if (x(r))
72
+ return !1;
73
+ try {
74
+ return delete n[r], !0;
75
+ } catch {
76
+ return !1;
77
+ }
78
+ }
79
+ a(U, "unsetWithPath");
80
+ function Le(e, ...t) {
81
+ return Be(e) ? xe(Array.from(e), ...t) : [];
82
+ }
83
+ a(Le, "without");
84
+ function ne(e) {
85
+ if (e == null)
86
+ return "";
87
+ if (typeof e == "string")
88
+ return e;
89
+ if (Array.isArray(e))
90
+ return e.map(ne).join(",");
91
+ const t = String(e);
92
+ return t === "0" && Object.is(Number(e), -0) ? "-0" : t;
93
+ }
94
+ a(ne, "toString");
95
+ function Fe(e) {
96
+ const t = e == null ? void 0 : e.constructor, n = typeof t == "function" ? t.prototype : Object.prototype;
97
+ return e === n;
98
+ }
99
+ a(Fe, "isPrototype");
100
+ function Me(e, ...t) {
101
+ if (e == null)
102
+ return {};
103
+ const n = Re(e);
104
+ for (let r = 0; r < t.length; r++) {
105
+ let s = t[r];
106
+ switch (typeof s) {
107
+ case "object": {
108
+ Array.isArray(s) || (s = Array.from(s));
109
+ for (let o = 0; o < s.length; o++) {
110
+ const i = s[o];
111
+ k(n, i);
112
+ }
113
+ break;
114
+ }
115
+ case "string":
116
+ case "symbol":
117
+ case "number": {
118
+ k(n, s);
119
+ break;
120
+ }
121
+ }
122
+ }
123
+ return n;
124
+ }
125
+ a(Me, "omit");
126
+ function L(e) {
127
+ if (e == null)
128
+ return !0;
129
+ if (v(e))
130
+ return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !Se(e) && !Ie(e) ? !1 : e.length === 0;
131
+ if (typeof e == "object") {
132
+ if (e instanceof Map || e instanceof Set)
133
+ return e.size === 0;
134
+ const t = Object.keys(e);
135
+ return Fe(e) ? t.filter((n) => n !== "constructor").length === 0 : t.length === 0;
136
+ }
137
+ return !0;
138
+ }
139
+ a(L, "isEmpty");
140
+ function Ne(e) {
141
+ return typeof e != "string" && (e = ne(e)), e.replace(/['\u2019]/g, "");
142
+ }
143
+ a(Ne, "normalizeForCase");
144
+ function He(e) {
145
+ return De(Ne(e));
146
+ }
147
+ a(He, "lowerCase");
148
+ const Ve = "Header", Pe = "Toolbar", re = "Foot", se = "nextSibling", Oe = [
149
+ Ve,
150
+ Pe,
151
+ re
152
+ ], $e = Object.prototype.hasOwnProperty;
153
+ let W;
154
+ const G = /* @__PURE__ */ a((e, t) => {
155
+ const n = e;
156
+ for (const r in t) {
157
+ if (!$e.call(t, r) || r === se)
158
+ continue;
159
+ const s = t[r];
160
+ s !== void 0 && (n[r] = s);
161
+ }
162
+ }, "assignTreeGridSectionFields"), ke = /* @__PURE__ */ a((e, t) => {
163
+ if (!t || !(e != null && e.Header))
164
+ return;
165
+ let n = t[se], r = e.Header.nextSibling;
166
+ for (; n && r; )
167
+ G(r, n), n = n.nextSibling, r = r.nextSibling;
168
+ }, "applyTreeGridSubHeaderLayoutText"), Ue = /* @__PURE__ */ a((e) => {
169
+ var t;
170
+ try {
171
+ if (!e || typeof DOMParser != "function")
172
+ return;
173
+ W ?? (W = new DOMParser());
174
+ const r = (t = W.parseFromString(e, "text/xml").documentElement) == null ? void 0 : t.children;
175
+ if (!(r != null && r.length))
176
+ return;
177
+ const s = new Array(r.length);
178
+ for (let o = 0; o < r.length; o += 1) {
179
+ const i = r[o].attributes, c = {};
180
+ for (let l = 0; l < i.length; l += 1) {
181
+ const f = i[l];
182
+ c[f.name] = f.value;
183
+ }
184
+ s[o] = c;
185
+ }
186
+ return s;
187
+ } catch (n) {
188
+ console.error(n);
189
+ return;
190
+ }
191
+ }, "parseTreeGridXmlToJson"), Qt = /* @__PURE__ */ a((e, t, n) => {
192
+ var i, c;
193
+ if (!t || !e)
194
+ return;
195
+ const r = (((i = e == null ? void 0 : e.Header) == null ? void 0 : i.Block) ?? 0) > 0, s = t.Header, o = (c = e.Foot) == null ? void 0 : c.lastChild;
196
+ r && s && $(s) && ke(e, s);
197
+ for (const l of Oe) {
198
+ const f = t[l];
199
+ if (!f || !$(f))
200
+ continue;
201
+ if (l === re && o) {
202
+ G(o, f);
203
+ continue;
204
+ }
205
+ const d = e[l];
206
+ d && G(d, f);
207
+ }
208
+ n || e.ReloadBody();
209
+ }, "applyTreeGridLayoutToGrid"), We = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Ke = "sheet", Ye = /* @__PURE__ */ a((e, t) => e.getCell(t), "getWorksheetCell"), je = /* @__PURE__ */ a((e, t) => {
210
+ const n = t ?? Ke, r = URL.createObjectURL(e), s = document.createElement("a");
211
+ s.href = r, s.download = `${n.normalize("NFC")}.xlsx`, s.click(), URL.revokeObjectURL(r);
212
+ }, "downloadExcelFile"), Xe = /* @__PURE__ */ a((e, t) => ({
213
+ ...Z,
214
+ ...!e && J,
215
+ ...t
216
+ }), "createCellFont"), ze = /* @__PURE__ */ a((e) => ({
217
+ ...D,
218
+ ...e
219
+ }), "createCellAlignment"), qe = /* @__PURE__ */ a((e, t, n) => {
220
+ if (e.border = B, n) {
221
+ e.fill = Q;
222
+ return;
223
+ }
224
+ L(t) || (e.fill = t);
225
+ }, "applyCellFillAndBorder"), vt = /* @__PURE__ */ a((e) => e.split("").reduce((t, n) => t * 26 + parseInt(n, 36) - 9, 0), "getIndexByLetters"), en = /* @__PURE__ */ a((e) => {
226
+ const t = String.fromCharCode(65 + (e - 1) % 26);
227
+ return e > 26 ? String.fromCharCode(64 + (e - 1) / 26) + t : t;
228
+ }, "getLettersByIndex"), Je = /* @__PURE__ */ a((e, t) => {
229
+ const n = new Blob([e], {
230
+ type: We
231
+ });
232
+ je(n, t);
233
+ }, "exportExcelByBuffer"), Ze = /* @__PURE__ */ a((e, { key: t, value: n, font: r, alignment: s, fill: o, isHeader: i }) => {
234
+ const c = Ye(e, t);
235
+ c.value = n, c.font = Xe(i, r), c.alignment = ze(s), qe(c, o, i);
236
+ }, "setCellValue"), tn = /* @__PURE__ */ a((e, { range: t, value: n, font: r, alignment: s, fill: o, isHeader: i }) => {
237
+ const c = t.split(":")[1];
238
+ e.mergeCells(t), Ze(e, {
239
+ key: c,
240
+ value: n,
241
+ alignment: s,
242
+ font: r,
243
+ fill: o,
244
+ isHeader: i
245
+ });
246
+ }, "setMergeCells"), I = 200, K = /* @__PURE__ */ new Map(), Qe = "엑셀 다운로드 중 오류가 발생했습니다.", ve = "TreeGrid 인스턴스가 없습니다.", A = /* @__PURE__ */ a((e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e instanceof Date, "isPrimitiveCellValue"), R = /* @__PURE__ */ a(() => new Promise((e) => {
247
+ if (typeof requestAnimationFrame == "function") {
248
+ requestAnimationFrame(() => {
249
+ e();
250
+ });
251
+ return;
252
+ }
253
+ setTimeout(e, 0);
254
+ }), "yieldToMain"), Y = /* @__PURE__ */ a((e, t, n) => (e == null ? void 0 : e(t, { defaultValue: n })) ?? n, "translateText"), et = /* @__PURE__ */ a((e) => e.ColNames ?? [], "getGridColNames"), F = /* @__PURE__ */ a((e) => e.Cols, "getGridCols"), tt = /* @__PURE__ */ a((e) => e.Rows, "getGridRows"), nt = /* @__PURE__ */ a((e) => e.Header ?? null, "getGridHeader"), rt = /* @__PURE__ */ a((e) => e.Head ?? null, "getGridHead"), st = /* @__PURE__ */ a((e) => e.ExportName, "getGridExportName"), ot = /* @__PURE__ */ a((e) => (e == null ? void 0 : e.firstChild) ?? null, "getRowFirstChild"), at = /* @__PURE__ */ a((e) => (e == null ? void 0 : e.nextSibling) ?? null, "getRowNextSibling"), oe = /* @__PURE__ */ a((e) => (e ?? "sheet").trim().replace(/[\\/:*?"<>|]/g, "_") || "sheet", "getSafeExportName"), it = /* @__PURE__ */ a((e) => oe(e).slice(0, 31) || "sheet", "getSafeSheetName"), ae = /* @__PURE__ */ a((e) => {
255
+ const t = Number(e);
256
+ return !Number.isFinite(t) || t < 1 ? 1 : Math.floor(t);
257
+ }, "toPositiveInt"), _ = /* @__PURE__ */ a((e) => e !== 0 && e !== !1 && e !== "0", "isVisible"), ct = /* @__PURE__ */ a((e) => (e == null ? void 0 : e.Type) === "Button" || `${(e == null ? void 0 : e.Button) ?? ""}` == "Button", "isButtonColumn"), lt = /* @__PURE__ */ a((e) => {
258
+ const t = et(e).flat(), n = t.length > 0 ? t : typeof e.GetCols == "function" ? e.GetCols() : [], r = [], s = /* @__PURE__ */ new Set();
259
+ for (const o of n)
260
+ !o || s.has(o) || (s.add(o), r.push(o));
261
+ return r;
262
+ }, "getColumnNames"), ft = /* @__PURE__ */ a((e) => {
263
+ const t = F(e);
264
+ return lt(e).filter((n) => {
265
+ const r = t[n];
266
+ return !r || n === "Panel" || ct(r) ? !1 : r.CanExport !== 0;
267
+ });
268
+ }, "getAllExportColumns"), dt = /* @__PURE__ */ a((e, t) => {
269
+ const n = F(e);
270
+ return t.filter((r) => {
271
+ const s = n[r];
272
+ return s ? _(s.Visible) : !1;
273
+ });
274
+ }, "getVisibleExportColumns"), ut = /* @__PURE__ */ a((e) => {
275
+ const t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ a((o) => {
276
+ !o || n.has(o) || o.Kind && o.Kind !== "Header" || (n.add(o), t.push(o));
277
+ }, "appendHeaderRow");
278
+ r(nt(e));
279
+ let s = ot(rt(e));
280
+ for (; s; )
281
+ r(s), s = at(s);
282
+ return t;
283
+ }, "getHeaderRows"), yt = /* @__PURE__ */ a((e) => {
284
+ if (typeof e.GetShownRows == "function") {
285
+ const r = e.GetShownRows();
286
+ if (Array.isArray(r)) {
287
+ const s = [];
288
+ for (let o = 0; o < r.length; o += 1) {
289
+ const i = r[o];
290
+ !i || i.Kind !== "Data" || !_(i.Visible) || i.Fixed === "Foot" || s.push(i);
291
+ }
292
+ return s;
293
+ }
294
+ }
295
+ const t = [], n = tt(e);
296
+ for (const r in n) {
297
+ const s = n[r];
298
+ !s || s.Kind !== "Data" || !_(s.Visible) || s.Fixed === "Foot" || t.push(s);
299
+ }
300
+ return t;
301
+ }, "getVisibleDataRows"), gt = /* @__PURE__ */ a((e, t) => {
302
+ const n = new Map(e.map((l, f) => [l, f])), r = new Map(
303
+ t.map((l, f) => [l, f])
304
+ ), s = new Array(e.length + 1).fill(0), o = new Array(e.length).fill(-1), i = new Array(e.length).fill(-1);
305
+ let c = -1;
306
+ for (let l = 0; l < e.length; l += 1) {
307
+ const f = e[l];
308
+ if (!f)
309
+ continue;
310
+ const d = r.get(f) ?? -1;
311
+ o[l] = d, s[l + 1] = s[l] + (d >= 0 ? 1 : 0);
312
+ }
313
+ for (let l = e.length - 1; l >= 0; l -= 1)
314
+ o[l] >= 0 && (c = l), i[l] = c;
315
+ return (l, f) => {
316
+ const d = n.get(l);
317
+ if (d === void 0)
318
+ return {
319
+ allColSpan: 1,
320
+ visibleColIndex: null,
321
+ visibleColSpan: 0
322
+ };
323
+ const u = ae(f), p = Math.min(e.length - 1, d + u - 1), g = i[d], h = g >= 0 && g <= p ? o[g] : null, S = s[p + 1] - s[d];
324
+ return {
325
+ allColSpan: u,
326
+ visibleColIndex: h !== null && h >= 0 ? h : null,
327
+ visibleColSpan: S
328
+ };
329
+ };
330
+ }, "createSpanResolver"), ht = /* @__PURE__ */ a((e) => {
331
+ const t = `${(e == null ? void 0 : e.Align) ?? ""}`.toLowerCase();
332
+ return t === "left" || t === "center" || t === "right" ? t : (e == null ? void 0 : e.Type) === "Int" || (e == null ? void 0 : e.Type) === "Float" ? "right" : (e == null ? void 0 : e.Type) === "Date" || (e == null ? void 0 : e.Type) === "Enum" ? "center" : "left";
333
+ }, "getCellHorizontalAlignment"), wt = /* @__PURE__ */ a((e) => {
334
+ if ((e == null ? void 0 : e.Type) !== "Date")
335
+ return null;
336
+ const t = `${e.Format ?? ""}`.trim();
337
+ if (!t)
338
+ return null;
339
+ const n = K.get(t);
340
+ if (n !== void 0)
341
+ return n;
342
+ const r = "__TREEGRID_MINUTE_TWO__", s = "__TREEGRID_MINUTE_ONE__", o = t.replace(/yyyy/g, "YYYY").replace(/yy/g, "YY").replace(/tt/g, "A").replace(/hh/g, "HH").replace(/\bh\b/g, "H").replace(/(H{1,2}:)mm/g, `$1${r}`).replace(/(H{1,2}:)m/g, `$1${s}`).replace(/mmmm/g, "MMMM").replace(/mmm/g, "MMM").replace(/mm/g, "MM").replace(/\bm\b/g, "M").replace(new RegExp(r, "g"), "mm").replace(new RegExp(s, "g"), "m").replace(/dddd/g, "dddd").replace(/ddd/g, "ddd").replace(/dd/g, "DD").replace(/\bd\b/g, "D");
343
+ return K.set(t, o), o;
344
+ }, "getDayjsDateFormat"), m = /* @__PURE__ */ a((e, t) => {
345
+ const n = wt(t);
346
+ if (!n || !A(e) || e === null || e === void 0 || e === "" || typeof e == "boolean")
347
+ return null;
348
+ const r = te(e);
349
+ return r.isValid() ? r.format(n) : null;
350
+ }, "formatDateValue"), b = /* @__PURE__ */ a((e, t) => (t == null ? void 0 : t.Type) !== "Bool" ? null : e == null || e === "" ? "" : e === !0 || e === 1 || e === "1" || e === "Y" || e === "y" || e === "true" || e === "TRUE" ? "Y" : e === !1 || e === 0 || e === "0" || e === "N" || e === "n" || e === "false" || e === "FALSE" ? "N" : null, "formatBoolValue"), j = /* @__PURE__ */ a((e, t, n) => {
351
+ const r = t == null ? void 0 : t[n];
352
+ return r != null ? String(r) : typeof e.GetCaption == "function" ? e.GetCaption(n) ?? "" : n;
353
+ }, "getHeaderValue"), w = /* @__PURE__ */ a((e, t) => {
354
+ const n = `${(t == null ? void 0 : t.HtmlPostfix) ?? ""}`;
355
+ return !n || e === null || e === void 0 || e === "" ? e : `${e}${n}`;
356
+ }, "appendHtmlPostfix"), pt = /* @__PURE__ */ a((e, t, n, r) => {
357
+ if ((r == null ? void 0 : r.Type) === "Enum" && typeof e.GetString == "function") {
358
+ const c = e.GetString(t, n);
359
+ if (c != null)
360
+ return w(c, r);
361
+ }
362
+ const s = t[n], o = b(s, r);
363
+ if (o !== null)
364
+ return w(o, r);
365
+ const i = m(s, r);
366
+ if (i !== null)
367
+ return w(i, r);
368
+ if (A(s))
369
+ return w(s, r);
370
+ if (typeof e.GetValue == "function") {
371
+ const c = e.GetValue(t, n), l = b(c, r);
372
+ if (l !== null)
373
+ return w(l, r);
374
+ const f = m(c, r);
375
+ if (f !== null)
376
+ return w(f, r);
377
+ if (A(c))
378
+ return w(c, r);
379
+ }
380
+ if (typeof e.GetString == "function") {
381
+ const c = e.GetString(t, n), l = b(c, r);
382
+ if (l !== null)
383
+ return w(l, r);
384
+ const f = m(c, r);
385
+ if (f !== null)
386
+ return w(f, r);
387
+ if (c != null)
388
+ return w(c, r);
389
+ }
390
+ return "";
391
+ }, "getBodyValue"), Et = /* @__PURE__ */ a(({
392
+ colName: e,
393
+ resolveSpan: t,
394
+ row: n,
395
+ rowIndex: r,
396
+ totalRows: s
397
+ }) => {
398
+ const o = Math.min(
399
+ ae(n[`${e}RowSpan`]),
400
+ Math.max(1, s - r)
401
+ ), { allColSpan: i, visibleColIndex: c, visibleColSpan: l } = t(
402
+ e,
403
+ n[`${e}Span`]
404
+ );
405
+ return {
406
+ allColSpan: i,
407
+ rowSpan: o,
408
+ visibleColIndex: c,
409
+ visibleColSpan: l
410
+ };
411
+ }, "getCellSpanInfo"), Rt = /* @__PURE__ */ a((e, t, n) => {
412
+ var r;
413
+ return (r = e.get(t)) == null ? void 0 : r.has(n);
414
+ }, "isOccupied"), St = /* @__PURE__ */ a((e, t, n, r, s) => {
415
+ for (let o = t; o < t + r; o += 1) {
416
+ const i = e.get(o) ?? /* @__PURE__ */ new Set();
417
+ for (let c = n; c < n + s; c += 1)
418
+ i.add(c);
419
+ e.set(o, i);
420
+ }
421
+ }, "markOccupied"), ie = /* @__PURE__ */ a(async ({
422
+ allExportColumns: e,
423
+ getValue: t,
424
+ onVisibleEntry: n,
425
+ resolveSpan: r,
426
+ rows: s
427
+ }) => {
428
+ if (!e.length)
429
+ return [];
430
+ const o = /* @__PURE__ */ new Map(), i = s.map(() => []);
431
+ for (let c = 0; c < s.length; c += 1) {
432
+ const l = s[c], f = i[c];
433
+ if (!(!l || !f)) {
434
+ for (let d = 0; d < e.length; d += 1) {
435
+ const u = e[d];
436
+ if (!u || Rt(o, c, d))
437
+ continue;
438
+ const { allColSpan: p, rowSpan: g, visibleColIndex: h, visibleColSpan: S } = Et({
439
+ row: l,
440
+ colName: u,
441
+ rowIndex: c,
442
+ totalRows: s.length,
443
+ resolveSpan: r
444
+ });
445
+ if (St(o, c, d, g, p), h === null || S < 1)
446
+ continue;
447
+ const T = t(l, u);
448
+ n == null || n(h, T), f.push({
449
+ colIndex: h,
450
+ value: T,
451
+ rowSpan: g,
452
+ colSpan: S
453
+ });
454
+ }
455
+ (c + 1) % I === 0 && await R();
456
+ }
457
+ }
458
+ return i;
459
+ }, "createEntryRows"), It = /* @__PURE__ */ a(async ({
460
+ allExportColumns: e,
461
+ grid: t,
462
+ headerRows: n,
463
+ resolveSpan: r,
464
+ visibleExportColumns: s
465
+ }) => s.length ? n.length ? ie({
466
+ allExportColumns: e,
467
+ getValue: /* @__PURE__ */ a((o, i) => j(t, o, i), "getValue"),
468
+ resolveSpan: r,
469
+ rows: n
470
+ }) : [
471
+ s.map((o, i) => ({
472
+ colName: o,
473
+ colIndex: i,
474
+ value: j(t, null, o),
475
+ rowSpan: 1,
476
+ colSpan: 1
477
+ }))
478
+ ] : [], "createHeaderEntries"), Ct = /* @__PURE__ */ a(async ({
479
+ allExportColumns: e,
480
+ columns: t,
481
+ onVisibleEntry: n,
482
+ grid: r,
483
+ dataRows: s,
484
+ resolveSpan: o,
485
+ visibleExportColumns: i
486
+ }) => i.length ? ie({
487
+ allExportColumns: e,
488
+ getValue: /* @__PURE__ */ a((c, l) => pt(r, c, l, t[l]), "getValue"),
489
+ onVisibleEntry: n,
490
+ resolveSpan: o,
491
+ rows: s
492
+ }) : [], "createBodyEntries"), X = /* @__PURE__ */ a(async (e, t, n) => {
493
+ const r = e.rowCount + 1, s = [];
494
+ for (let o = 0; o < t.length; o += 1) {
495
+ const i = t[o] ?? [], c = new Array(n).fill("");
496
+ for (let l = 0; l < i.length; l += 1) {
497
+ const f = i[l];
498
+ f && (c[f.colIndex] = f.value ?? "");
499
+ }
500
+ s.push(c), s.length === I ? (e.addRows(s), s.length = 0, await R()) : (o + 1) % I === 0 && await R();
501
+ }
502
+ return s.length && e.addRows(s), r;
503
+ }, "appendEntryRows"), z = /* @__PURE__ */ a(async (e, t, n) => {
504
+ for (let r = 0; r < t.length; r += 1) {
505
+ const s = t[r] ?? [];
506
+ for (let o = 0; o < s.length; o += 1) {
507
+ const i = s[o];
508
+ i && (i.rowSpan === 1 && i.colSpan === 1 || e.mergeCells(
509
+ n + r,
510
+ i.colIndex + 1,
511
+ n + r + i.rowSpan - 1,
512
+ i.colIndex + i.colSpan
513
+ ));
514
+ }
515
+ (r + 1) % I === 0 && await R();
516
+ }
517
+ }, "mergeEntryRows"), Tt = /* @__PURE__ */ a(async (e, t, n, r) => {
518
+ for (let s = 0; s < n; s += 1) {
519
+ const o = e.getRow(t + s);
520
+ o.font = Z;
521
+ for (let i = 1; i <= r; i += 1) {
522
+ const c = o.getCell(i);
523
+ c.fill = Q, c.border = B, c.alignment = {
524
+ ...D,
525
+ horizontal: "center"
526
+ };
527
+ }
528
+ (s + 1) % I === 0 && await R();
529
+ }
530
+ }, "styleHeaderRows"), mt = /* @__PURE__ */ a(async (e, t, n, r) => {
531
+ for (let s = 0; s < n; s += 1) {
532
+ const o = e.getRow(t + s);
533
+ o.font = J;
534
+ for (let i = 1; i <= r; i += 1)
535
+ o.getCell(i).border = B;
536
+ (s + 1) % I === 0 && await R();
537
+ }
538
+ }, "styleBodyRows"), bt = /* @__PURE__ */ a((e) => {
539
+ const t = Number((e == null ? void 0 : e.Width) ?? (e == null ? void 0 : e.MinWidth));
540
+ return !Number.isFinite(t) || t <= 0 ? null : Math.min(Math.max(Math.round(t / 8), 10), 50);
541
+ }, "getPreferredColumnWidth"), q = /* @__PURE__ */ a((e) => Math.min(Math.max(e + 4, 10), 50), "getAutoColumnWidth"), xt = /* @__PURE__ */ a((e, t, n) => {
542
+ const r = new Array(n.length).fill(10), s = new Array(n.length).fill(!1);
543
+ for (let o = 0; o < n.length; o += 1) {
544
+ const i = n[o];
545
+ if (!i)
546
+ continue;
547
+ const c = t[i], l = bt(c);
548
+ if (l !== null) {
549
+ r[o] = l, s[o] = !0;
550
+ continue;
551
+ }
552
+ const f = (typeof e.GetCaption == "function" ? e.GetCaption(i) : "") || i;
553
+ r[o] = q(`${f}`.length);
554
+ }
555
+ return {
556
+ widths: r,
557
+ updateWidth: /* @__PURE__ */ a((o, i) => {
558
+ if (s[o])
559
+ return;
560
+ const c = r[o];
561
+ if (c === void 0)
562
+ return;
563
+ const l = q(`${i ?? ""}`.length);
564
+ l > c && (r[o] = l);
565
+ }, "updateWidth")
566
+ };
567
+ }, "createColumnWidths"), ce = /* @__PURE__ */ a(async (e, t) => {
568
+ try {
569
+ const n = typeof t == "string" ? { exportName: t } : t, r = n == null ? void 0 : n.t;
570
+ if (!e)
571
+ throw new Error(
572
+ Y(r, "Message.TreeGrid 인스턴스가 없습니다.", ve)
573
+ );
574
+ const s = F(e), o = ft(e), i = dt(e, o), { widths: c, updateWidth: l } = xt(e, s, i), f = ut(e), d = yt(e), u = gt(o, i), p = await It({
575
+ allExportColumns: o,
576
+ grid: e,
577
+ headerRows: f,
578
+ resolveSpan: u,
579
+ visibleExportColumns: i
580
+ }), g = await Ct({
581
+ allExportColumns: o,
582
+ columns: s,
583
+ dataRows: d,
584
+ grid: e,
585
+ onVisibleEntry: l,
586
+ resolveSpan: u,
587
+ visibleExportColumns: i
588
+ }), h = new Te.Workbook(), S = (n == null ? void 0 : n.exportName) ?? st(e) ?? e.id ?? "sheet", T = n != null && n.useAppendCurrentDateTimeToExportName ? `-${te().format("YYYY-MM-DD-HH-mm-ss")}` : "", N = oe(`${S}${T}`), E = h.addWorksheet(it(N)), H = await X(
589
+ E,
590
+ p,
591
+ i.length
592
+ ), V = await X(
593
+ E,
594
+ g,
595
+ i.length
596
+ );
597
+ for (let C = 0; C < i.length; C += 1) {
598
+ const P = i[C];
599
+ if (!P)
600
+ continue;
601
+ const de = s[P], O = E.getColumn(C + 1);
602
+ O.width = c[C], O.alignment = {
603
+ ...D,
604
+ horizontal: ht(de)
605
+ };
606
+ }
607
+ await z(E, p, H), await z(E, g, V), await Tt(
608
+ E,
609
+ H,
610
+ p.length,
611
+ i.length
612
+ ), await mt(
613
+ E,
614
+ V,
615
+ g.length,
616
+ i.length
617
+ ), E.views = [{ state: "frozen", ySplit: p.length }], await R();
618
+ const fe = await h.xlsx.writeBuffer({
619
+ useSharedStrings: !1,
620
+ useStyles: !0
621
+ });
622
+ Je(fe, N);
623
+ } catch (n) {
624
+ const r = typeof t == "string" ? {} : t, s = r == null ? void 0 : r.t;
625
+ me(
626
+ n instanceof Error ? n.message : Y(
627
+ s,
628
+ "Message.엑셀 다운로드 중 오류가 발생했습니다.",
629
+ Qe
630
+ ),
631
+ {
632
+ variant: "error"
633
+ }
634
+ );
635
+ }
636
+ }, "exportTreeGridExcel"), nn = ce, Gt = ["Added", "Changed"], At = ["OWP", "IPX"], _t = /* @__PURE__ */ a((e) => Object.values((e == null ? void 0 : e.Rows) ?? {}).filter((t) => t.Kind === "Data"), "getDataRows"), Dt = /* @__PURE__ */ a((e, t) => {
637
+ const n = (t == null ? void 0 : t.insertPosition) ?? "top", r = t == null ? void 0 : t.parent, s = t == null ? void 0 : t.anchorRow;
638
+ let o = r ?? (s ? s.parentNode : null) ?? e.GetFirst(), i = null;
639
+ switch (n) {
640
+ case "top":
641
+ i = e.GetFirst();
642
+ break;
643
+ case "last":
644
+ o = e.GetNext(e.GetLast(), e.RowCount > 0 ? e.RowCount + 1 : 0), i = o;
645
+ break;
646
+ case "above":
647
+ i = s ?? e.GetFirst();
648
+ break;
649
+ case "below":
650
+ i = (s == null ? void 0 : s.nextSibling) ?? e.GetFirst();
651
+ break;
652
+ }
653
+ return { resolvedParent: o, next: i };
654
+ }, "resolveRowInsertionTarget"), Bt = /* @__PURE__ */ a((e, t) => {
655
+ Ce(t) && Object.entries(t).forEach(([n, r]) => {
656
+ e[n] = r;
657
+ });
658
+ }, "assignInitialRowValues"), Lt = /* @__PURE__ */ a((e) => At.some((t) => e.startsWith(t)), "isTreeGridDataKey"), Ft = /* @__PURE__ */ a((e) => Object.fromEntries(
659
+ Le(Object.keys(e), "id").filter((t) => Lt(t) && !L(e[t])).map((t) => [t, e[t]])
660
+ ), "normalizeAddedRow"), Mt = /* @__PURE__ */ a((e, t) => e.filter((n) => ee(n, t) === "1" && n.Deleted !== "1").map((n) => t === "Changed" ? Me(n, ["id", "Changed"]) : Ft(n)).filter((n) => !L(n)), "getChangedRowsByStatus"), y = /* @__PURE__ */ a((e) => Grids[e], "getTreeGridById"), Nt = /* @__PURE__ */ a((e) => {
661
+ const t = y(e);
662
+ return _t(t);
663
+ }, "getTreeGridDataRowsById"), Ht = /* @__PURE__ */ a((e, t) => {
664
+ const n = y(e);
665
+ if (!n)
666
+ return;
667
+ const r = n.Data.Data;
668
+ n.Data.Data = {
669
+ ...r,
670
+ Data: { Body: [t || []] },
671
+ Url: ""
672
+ }, n.ReloadBody();
673
+ }, "reloadTreeGridBodyById"), Vt = /* @__PURE__ */ a((e, t) => {
674
+ const n = y(e);
675
+ if (!n)
676
+ return;
677
+ const r = t == null ? void 0 : t.canSelect, s = t == null ? void 0 : t.initialValues, { resolvedParent: o, next: i } = Dt(n, t), c = n.AddRow(o, i, 1);
678
+ Bt(c, s), c.CanEdit = 1, c.CanDelete = 1, c.CanSelect = r ? 1 : 0, n.Focus(c), n.RefreshRow(c);
679
+ }, "addTreeGridRowById"), Pt = /* @__PURE__ */ a((e) => {
680
+ const t = y(e), n = Ue(t == null ? void 0 : t.GetXmlData("changes,allcols,nogrid,noio"));
681
+ return Ge(n) ? Object.fromEntries(
682
+ Gt.map((r) => [
683
+ He(r),
684
+ Mt(n, r)
685
+ ])
686
+ ) : { added: [], changed: [] };
687
+ }, "getTreeGridRowChangesById"), Ot = /* @__PURE__ */ a((e, t) => {
688
+ const n = y(e);
689
+ n && ce(n, { exportName: t ?? "" });
690
+ }, "exportTreeGridToExcelById"), $t = /* @__PURE__ */ a((e) => {
691
+ const t = y(e);
692
+ return (t == null ? void 0 : t.GetSelRows()) ?? [];
693
+ }, "getTreeGridSelectedRowsById"), kt = /* @__PURE__ */ a((e, t) => {
694
+ const n = y(e);
695
+ if (!n || !(t != null && t.targetKey))
696
+ return;
697
+ const r = t == null ? void 0 : t.targetKey;
698
+ if (t == null ? void 0 : t.canVisible) {
699
+ n.ShowCol(r);
700
+ return;
701
+ }
702
+ n.HideCol(r);
703
+ }, "setTreeGridColumnVisibilityById"), Ut = /* @__PURE__ */ a((e, t) => {
704
+ const n = y(e), r = t == null ? void 0 : t.row, s = t == null ? void 0 : t.col;
705
+ !n || !r || !s || (n.SetValue(r, `${s}Class`, ye), n.SetValue(r, `${s}Color`, ge), n.RefreshCell(r, s));
706
+ }, "highlightTreeGridCellById"), M = /* @__PURE__ */ a((e) => {
707
+ const t = y(e);
708
+ t && t.ActionDeselectAll(1, 0);
709
+ }, "resetTreeGridSelectionById"), Wt = /* @__PURE__ */ a((e) => {
710
+ e.forEach(M);
711
+ }, "resetTreeGridSelectionsByIds"), le = /* @__PURE__ */ a((e) => {
712
+ const t = y(e);
713
+ t && (t.ActionUndoAll(1, 0), M(e));
714
+ }, "resetTreeGridChangesById"), Kt = /* @__PURE__ */ a((e) => {
715
+ e.forEach(le);
716
+ }, "resetTreeGridChangesByIds"), Yt = /* @__PURE__ */ a((e, t, n, r, s) => {
717
+ if (!(n != null && n.length))
718
+ return;
719
+ const o = y(e);
720
+ if (!o)
721
+ return;
722
+ const i = n.map((l) => {
723
+ const f = l;
724
+ return `${s.map((u) => f[u]).find((u) => u != null && u !== "") ?? ""}`;
725
+ }).join("|"), c = n.map((l) => `${l[r] ?? ""}`).join("|");
726
+ o.SetAttribute(null, t, "Type", "Enum", 0, 0), o.SetAttribute(null, t, "Enum", `|${i}`, 0, 0), o.SetAttribute(null, t, "EnumKeys", `|${c}`, 1, 0);
727
+ }, "setTreeGridColumnEnumOptionsById"), rn = y, sn = Nt, on = Ht, an = Vt, cn = Pt, ln = Ot, fn = $t, dn = kt, un = Ut, yn = M, gn = Wt, hn = le, wn = Kt, pn = Yt;
728
+ export {
729
+ an as A,
730
+ cn as B,
731
+ ln as C,
732
+ fn as D,
733
+ dn as E,
734
+ un as F,
735
+ yn as G,
736
+ gn as H,
737
+ hn as I,
738
+ wn as J,
739
+ pn as K,
740
+ Be as L,
741
+ L as M,
742
+ Qt as N,
743
+ Me as O,
744
+ vt as a,
745
+ en as b,
746
+ Je as c,
747
+ Ze as d,
748
+ ce as e,
749
+ tn as f,
750
+ y as g,
751
+ nn as h,
752
+ Ge as i,
753
+ Nt as j,
754
+ Vt as k,
755
+ Pt as l,
756
+ Ot as m,
757
+ $t as n,
758
+ kt as o,
759
+ Ut as p,
760
+ M as q,
761
+ Ht as r,
762
+ Yt as s,
763
+ ne as t,
764
+ Wt as u,
765
+ le as v,
766
+ Kt as w,
767
+ rn as x,
768
+ sn as y,
769
+ on as z
770
+ };
771
+ //# sourceMappingURL=treeGridUtil-DaqTz5v3.js.map