@owp/core 2.2.0 → 2.2.2

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 (55) hide show
  1. package/dist/_virtual/index10.js +2 -2
  2. package/dist/_virtual/index11.js +2 -2
  3. package/dist/_virtual/index13.js +2 -2
  4. package/dist/_virtual/index14.js +2 -2
  5. package/dist/_virtual/index15.js +2 -2
  6. package/dist/_virtual/index16.js +5 -2
  7. package/dist/_virtual/index16.js.map +1 -1
  8. package/dist/_virtual/index17.js +2 -2
  9. package/dist/_virtual/index5.js +2 -5
  10. package/dist/_virtual/index5.js.map +1 -1
  11. package/dist/_virtual/index6.js +2 -2
  12. package/dist/_virtual/index7.js +2 -2
  13. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +137 -134
  14. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  15. package/dist/components/OwpTreeGrid/OwpTreeGridNoDataOverlay.js +3 -4
  16. package/dist/components/OwpTreeGrid/OwpTreeGridNoDataOverlay.js.map +1 -1
  17. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  18. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  19. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  20. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  21. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  22. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  23. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  24. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  25. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  26. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  27. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  28. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  29. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  30. package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  31. package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +1 -1
  32. package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
  33. package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
  34. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +2 -1
  35. package/dist/utils/exceljsBrowser.js +6 -6
  36. package/dist/utils/exceljsBrowser.js.map +1 -1
  37. package/dist/utils/jszipBrowser.js +6 -6
  38. package/dist/utils/jszipBrowser.js.map +1 -1
  39. package/dist/utils/treeGridExportExcelUtil.js +306 -268
  40. package/dist/utils/treeGridExportExcelUtil.js.map +1 -1
  41. package/package.json +1 -3
  42. package/dist/_virtual/_commonjs-dynamic-modules.js +0 -10
  43. package/dist/_virtual/_commonjs-dynamic-modules.js.map +0 -1
  44. package/dist/_virtual/exceljs.min.js +0 -31
  45. package/dist/_virtual/exceljs.min.js.map +0 -1
  46. package/dist/_virtual/exceljs.min2.js +0 -5
  47. package/dist/_virtual/exceljs.min2.js.map +0 -1
  48. package/dist/_virtual/jszip.min.js +0 -31
  49. package/dist/_virtual/jszip.min.js.map +0 -1
  50. package/dist/_virtual/jszip.min2.js +0 -5
  51. package/dist/_virtual/jszip.min2.js.map +0 -1
  52. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.js +0 -23540
  53. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.js.map +0 -1
  54. package/dist/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js +0 -2385
  55. package/dist/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js.map +0 -1
@@ -1,11 +1,11 @@
1
- var j = Object.defineProperty;
2
- var l = (t, e) => j(t, "name", { value: e, configurable: !0 });
3
- import L from "dayjs";
4
- import { enqueueSnackbar as X } from "notistack";
5
- import { exportExcelByBuffer as Z } from "./excelUtil.js";
6
- import { loadExcelJSBrowser as Q } from "./exceljsBrowser.js";
7
- import { DEFAULT_WRAP_CELL_ALIGNMENT as P, DEFAULT_HEADER_FONT as v, DEFAULT_HEADER_FILL as tt, DEFAULT_THIN_BORDER as Y, DEFAULT_VALUE_FONT as et } from "../constants/excel.js";
8
- const R = 200, V = /* @__PURE__ */ new Map(), nt = "엑셀 다운로드 중 오류가 발생했습니다.", rt = "TreeGrid 인스턴스가 없습니다.", A = /* @__PURE__ */ l((t) => t == null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t instanceof Date, "isPrimitiveCellValue"), x = /* @__PURE__ */ l(() => new Promise((t) => {
1
+ var Z = Object.defineProperty;
2
+ var l = (t, e) => Z(t, "name", { value: e, configurable: !0 });
3
+ import $ from "dayjs";
4
+ import { enqueueSnackbar as Q } from "notistack";
5
+ import { exportExcelByBuffer as v } from "./excelUtil.js";
6
+ import { loadExcelJSBrowser as tt } from "./exceljsBrowser.js";
7
+ import { DEFAULT_WRAP_CELL_ALIGNMENT as L, DEFAULT_HEADER_FONT as et, DEFAULT_HEADER_FILL as nt, DEFAULT_THIN_BORDER as P, DEFAULT_VALUE_FONT as ot } from "../constants/excel.js";
8
+ const S = 200, F = /* @__PURE__ */ new Map(), rt = "엑셀 다운로드 중 오류가 발생했습니다.", st = "TreeGrid 인스턴스가 없습니다.", _ = /* @__PURE__ */ l((t) => t == null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t instanceof Date, "isPrimitiveCellValue"), R = /* @__PURE__ */ l(() => new Promise((t) => {
9
9
  if (typeof requestAnimationFrame == "function") {
10
10
  requestAnimationFrame(() => {
11
11
  t();
@@ -13,391 +13,429 @@ const R = 200, V = /* @__PURE__ */ new Map(), nt = "엑셀 다운로드 중 오
13
13
  return;
14
14
  }
15
15
  setTimeout(t, 0);
16
- }), "yieldToMain"), F = /* @__PURE__ */ l((t, e, r) => (t == null ? void 0 : t(e, { defaultValue: r })) ?? r, "translateText"), ot = /* @__PURE__ */ l((t) => t.ColNames ?? [], "getGridColNames"), T = /* @__PURE__ */ l((t) => t.Cols, "getGridCols"), st = /* @__PURE__ */ l((t) => t.Rows, "getGridRows"), it = /* @__PURE__ */ l((t) => t.Header ?? null, "getGridHeader"), at = /* @__PURE__ */ l((t) => t.Head ?? null, "getGridHead"), lt = /* @__PURE__ */ l((t) => t.ExportName, "getGridExportName"), ft = /* @__PURE__ */ l((t) => (t == null ? void 0 : t.firstChild) ?? null, "getRowFirstChild"), ct = /* @__PURE__ */ l((t) => (t == null ? void 0 : t.nextSibling) ?? null, "getRowNextSibling"), U = /* @__PURE__ */ l((t) => (t ?? "sheet").trim().replace(/[\\/:*?"<>|]/g, "_") || "sheet", "getSafeExportName"), dt = /* @__PURE__ */ l((t) => U(t).slice(0, 31) || "sheet", "getSafeSheetName"), O = /* @__PURE__ */ l((t) => {
16
+ }), "yieldToMain"), H = /* @__PURE__ */ l((t, e, o) => (t == null ? void 0 : t(e, { defaultValue: o })) ?? o, "translateText"), at = /* @__PURE__ */ l((t) => t.ColNames ?? [], "getGridColNames"), D = /* @__PURE__ */ l((t) => t.Cols, "getGridCols"), it = /* @__PURE__ */ l((t) => t.Rows, "getGridRows"), lt = /* @__PURE__ */ l((t) => t.Header ?? null, "getGridHeader"), ct = /* @__PURE__ */ l((t) => t.Head ?? null, "getGridHead"), ft = /* @__PURE__ */ l((t) => t.ExportName, "getGridExportName"), dt = /* @__PURE__ */ l((t) => (t == null ? void 0 : t.firstChild) ?? null, "getRowFirstChild"), pt = /* @__PURE__ */ l((t) => (t == null ? void 0 : t.nextSibling) ?? null, "getRowNextSibling"), Y = /* @__PURE__ */ l((t) => (t ?? "sheet").trim().replace(/[\\/:*?"<>|]/g, "_") || "sheet", "getSafeExportName"), ut = /* @__PURE__ */ l((t) => Y(t).slice(0, 31) || "sheet", "getSafeSheetName"), U = /* @__PURE__ */ l((t) => {
17
17
  const e = Number(t);
18
18
  return !Number.isFinite(e) || e < 1 ? 1 : Math.floor(e);
19
- }, "toPositiveInt"), M = /* @__PURE__ */ l((t) => t !== 0 && t !== !1 && t !== "0", "isVisible"), pt = /* @__PURE__ */ l((t) => (t == null ? void 0 : t.Type) === "Button" || `${(t == null ? void 0 : t.Button) ?? ""}` == "Button", "isButtonColumn"), ut = /* @__PURE__ */ l((t) => {
20
- const e = ot(t).flat(), r = e.length > 0 ? e : typeof t.GetCols == "function" ? t.GetCols() : [], n = [], o = /* @__PURE__ */ new Set();
21
- for (const s of r)
22
- !s || o.has(s) || (o.add(s), n.push(s));
19
+ }, "toPositiveInt"), O = /* @__PURE__ */ l((t) => t !== 0 && t !== !1 && t !== "0", "isVisible"), gt = /* @__PURE__ */ l((t) => (t == null ? void 0 : t.Type) === "Button" || `${(t == null ? void 0 : t.Button) ?? ""}` == "Button", "isButtonColumn"), wt = /* @__PURE__ */ l((t) => {
20
+ const e = at(t).flat(), o = e.length > 0 ? e : typeof t.GetCols == "function" ? t.GetCols() : [], n = [], s = /* @__PURE__ */ new Set();
21
+ for (const r of o)
22
+ !r || s.has(r) || (s.add(r), n.push(r));
23
23
  return n;
24
24
  }, "getColumnNames"), ht = /* @__PURE__ */ l((t) => {
25
- const e = T(t);
26
- return ut(t).filter((r) => {
27
- const n = e[r];
28
- return !n || r === "Panel" || pt(n) ? !1 : n.CanExport !== 0;
25
+ const e = D(t);
26
+ return wt(t).filter((o) => {
27
+ const n = e[o];
28
+ return !n || o === "Panel" || gt(n) ? !1 : n.CanExport !== 0;
29
29
  });
30
- }, "getAllExportColumns"), gt = /* @__PURE__ */ l((t, e) => {
31
- const r = T(t);
30
+ }, "getAllExportColumns"), xt = /* @__PURE__ */ l((t, e) => {
31
+ const o = D(t);
32
32
  return e.filter((n) => {
33
- const o = r[n];
34
- return o ? M(o.Visible) : !1;
33
+ const s = o[n];
34
+ return s ? O(s.Visible) : !1;
35
35
  });
36
- }, "getVisibleExportColumns"), wt = /* @__PURE__ */ l((t) => {
37
- const e = [], r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ l((s) => {
38
- !s || r.has(s) || s.Kind && s.Kind !== "Header" || (r.add(s), e.push(s));
36
+ }, "getVisibleExportColumns"), yt = /* @__PURE__ */ l((t) => {
37
+ const e = [], o = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ l((r) => {
38
+ !r || o.has(r) || r.Kind && r.Kind !== "Header" || (o.add(r), e.push(r));
39
39
  }, "appendHeaderRow");
40
- n(it(t));
41
- let o = ft(at(t));
42
- for (; o; )
43
- n(o), o = ct(o);
40
+ n(lt(t));
41
+ let s = dt(ct(t));
42
+ for (; s; )
43
+ n(s), s = pt(s);
44
44
  return e;
45
- }, "getHeaderRows"), yt = /* @__PURE__ */ l((t) => {
46
- if (typeof t.GetShownRows == "function") {
47
- const n = t.GetShownRows();
48
- if (Array.isArray(n)) {
49
- const o = [];
50
- for (let s = 0; s < n.length; s += 1) {
51
- const a = n[s];
52
- !a || a.Kind !== "Data" || !M(a.Visible) || a.Fixed === "Foot" || o.push(a);
53
- }
54
- return o;
55
- }
45
+ }, "getHeaderRows"), B = /* @__PURE__ */ l((t) => !!t && t.Kind === "Data" && O(t.Visible) && t.Fixed !== "Foot", "isExportDataRow");
46
+ function* k(t) {
47
+ if (typeof t.GetFirst == "function" && typeof t.GetNext == "function") {
48
+ let o = t.GetFirst();
49
+ for (; o; )
50
+ B(o) && (yield o), o = t.GetNext(o);
51
+ return;
56
52
  }
57
- const e = [], r = st(t);
58
- for (const n in r) {
59
- const o = r[n];
60
- !o || o.Kind !== "Data" || !M(o.Visible) || o.Fixed === "Foot" || e.push(o);
53
+ const e = it(t);
54
+ for (const o in e) {
55
+ const n = e[o];
56
+ B(n) && (yield n);
61
57
  }
58
+ }
59
+ l(k, "iterateExportDataRows");
60
+ const Rt = /* @__PURE__ */ l((t) => {
61
+ let e = 0;
62
+ for (const o of k(t))
63
+ o && (e += 1);
62
64
  return e;
63
- }, "getVisibleDataRows"), xt = /* @__PURE__ */ l((t, e) => {
64
- const r = new Map(t.map((f, c) => [f, c])), n = new Map(
65
- e.map((f, c) => [f, c])
66
- ), o = new Array(t.length + 1).fill(0), s = new Array(t.length).fill(-1), a = new Array(t.length).fill(-1);
67
- let i = -1;
68
- for (let f = 0; f < t.length; f += 1) {
69
- const c = t[f];
70
- if (!c)
65
+ }, "getExportDataRowCount"), Ct = /* @__PURE__ */ l((t, e) => {
66
+ const o = new Map(t.map((c, f) => [c, f])), n = new Map(
67
+ e.map((c, f) => [c, f])
68
+ ), s = new Array(t.length + 1).fill(0), r = new Array(t.length).fill(-1), i = new Array(t.length).fill(-1);
69
+ let a = -1;
70
+ for (let c = 0; c < t.length; c += 1) {
71
+ const f = t[c];
72
+ if (!f)
71
73
  continue;
72
- const d = n.get(c) ?? -1;
73
- s[f] = d, o[f + 1] = o[f] + (d >= 0 ? 1 : 0);
74
+ const d = n.get(f) ?? -1;
75
+ r[c] = d, s[c + 1] = s[c] + (d >= 0 ? 1 : 0);
74
76
  }
75
- for (let f = t.length - 1; f >= 0; f -= 1)
76
- s[f] >= 0 && (i = f), a[f] = i;
77
- return (f, c) => {
78
- const d = r.get(f);
77
+ for (let c = t.length - 1; c >= 0; c -= 1)
78
+ r[c] >= 0 && (a = c), i[c] = a;
79
+ return (c, f) => {
80
+ const d = o.get(c);
79
81
  if (d === void 0)
80
82
  return {
81
83
  allColSpan: 1,
82
84
  visibleColIndex: null,
83
85
  visibleColSpan: 0
84
86
  };
85
- const g = O(c), y = Math.min(t.length - 1, d + g - 1), p = a[d], u = p >= 0 && p <= y ? s[p] : null, S = o[y + 1] - o[d];
87
+ const g = U(f), p = Math.min(t.length - 1, d + g - 1), x = i[d], u = x >= 0 && x <= p ? r[x] : null, w = s[p + 1] - s[d];
86
88
  return {
87
89
  allColSpan: g,
88
90
  visibleColIndex: u !== null && u >= 0 ? u : null,
89
- visibleColSpan: S
91
+ visibleColSpan: w
90
92
  };
91
93
  };
92
94
  }, "createSpanResolver"), St = /* @__PURE__ */ l((t) => {
93
95
  const e = `${(t == null ? void 0 : t.Align) ?? ""}`.toLowerCase();
94
96
  return e === "left" || e === "center" || e === "right" ? e : (t == null ? void 0 : t.Type) === "Int" || (t == null ? void 0 : t.Type) === "Float" ? "right" : (t == null ? void 0 : t.Type) === "Date" || (t == null ? void 0 : t.Type) === "Enum" ? "center" : "left";
95
- }, "getCellHorizontalAlignment"), Rt = /* @__PURE__ */ l((t) => {
97
+ }, "getCellHorizontalAlignment"), It = /* @__PURE__ */ l((t) => {
96
98
  if ((t == null ? void 0 : t.Type) !== "Date")
97
99
  return null;
98
100
  const e = `${t.Format ?? ""}`.trim();
99
101
  if (!e)
100
102
  return null;
101
- const r = V.get(e);
102
- if (r !== void 0)
103
- return r;
104
- const n = "__TREEGRID_MINUTE_TWO__", o = "__TREEGRID_MINUTE_ONE__", s = e.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${n}`).replace(/(H{1,2}:)m/g, `$1${o}`).replace(/mmmm/g, "MMMM").replace(/mmm/g, "MMM").replace(/mm/g, "MM").replace(/\bm\b/g, "M").replace(new RegExp(n, "g"), "mm").replace(new RegExp(o, "g"), "m").replace(/dddd/g, "dddd").replace(/ddd/g, "ddd").replace(/dd/g, "DD").replace(/\bd\b/g, "D");
105
- return V.set(e, s), s;
106
- }, "getDayjsDateFormat"), I = /* @__PURE__ */ l((t, e) => {
107
- const r = Rt(e);
108
- if (!r || !A(t) || t === null || t === void 0 || t === "" || typeof t == "boolean")
103
+ const o = F.get(e);
104
+ if (o !== void 0)
105
+ return o;
106
+ const n = "__TREEGRID_MINUTE_TWO__", s = "__TREEGRID_MINUTE_ONE__", r = e.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${n}`).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(n, "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");
107
+ return F.set(e, r), r;
108
+ }, "getDayjsDateFormat"), T = /* @__PURE__ */ l((t, e) => {
109
+ const o = It(e);
110
+ if (!o || !_(t) || t === null || t === void 0 || t === "" || typeof t == "boolean")
109
111
  return null;
110
- const n = L(t);
111
- return n.isValid() ? n.format(r) : null;
112
- }, "formatDateValue"), b = /* @__PURE__ */ l((t, e) => (e == null ? void 0 : e.Type) !== "Bool" ? null : t == null || t === "" ? "" : t === !0 || t === 1 || t === "1" || t === "Y" || t === "y" || t === "true" || t === "TRUE" ? "Y" : t === !1 || t === 0 || t === "0" || t === "N" || t === "n" || t === "false" || t === "FALSE" ? "N" : null, "formatBoolValue"), H = /* @__PURE__ */ l((t, e, r) => {
113
- const n = e == null ? void 0 : e[r];
114
- return n != null ? String(n) : typeof t.GetCaption == "function" ? t.GetCaption(r) ?? "" : r;
115
- }, "getHeaderValue"), h = /* @__PURE__ */ l((t, e) => {
116
- const r = `${(e == null ? void 0 : e.HtmlPostfix) ?? ""}`;
117
- return !r || t === null || t === void 0 || t === "" ? t : `${t}${r}`;
118
- }, "appendHtmlPostfix"), Et = /* @__PURE__ */ l((t, e, r, n) => {
112
+ const n = $(t);
113
+ return n.isValid() ? n.format(o) : null;
114
+ }, "formatDateValue"), b = /* @__PURE__ */ l((t, e) => (e == null ? void 0 : e.Type) !== "Bool" ? null : t == null || t === "" ? "" : t === !0 || t === 1 || t === "1" || t === "Y" || t === "y" || t === "true" || t === "TRUE" ? "Y" : t === !1 || t === 0 || t === "0" || t === "N" || t === "n" || t === "false" || t === "FALSE" ? "N" : null, "formatBoolValue"), V = /* @__PURE__ */ l((t, e, o) => {
115
+ const n = e == null ? void 0 : e[o];
116
+ return n != null ? String(n) : typeof t.GetCaption == "function" ? t.GetCaption(o) ?? "" : o;
117
+ }, "getHeaderValue"), y = /* @__PURE__ */ l((t, e) => {
118
+ const o = `${(e == null ? void 0 : e.HtmlPostfix) ?? ""}`;
119
+ return !o || t === null || t === void 0 || t === "" ? t : `${t}${o}`;
120
+ }, "appendHtmlPostfix"), Et = /* @__PURE__ */ l((t, e, o, n) => {
119
121
  if ((n == null ? void 0 : n.Type) === "Enum" && typeof t.GetString == "function") {
120
- const i = t.GetString(e, r);
121
- if (i != null)
122
- return h(i, n);
122
+ const a = t.GetString(e, o);
123
+ if (a != null)
124
+ return y(a, n);
123
125
  }
124
- const o = e[r], s = b(o, n);
125
- if (s !== null)
126
- return h(s, n);
127
- const a = I(o, n);
128
- if (a !== null)
129
- return h(a, n);
130
- if (A(o))
131
- return h(o, n);
126
+ const s = e[o], r = b(s, n);
127
+ if (r !== null)
128
+ return y(r, n);
129
+ const i = T(s, n);
130
+ if (i !== null)
131
+ return y(i, n);
132
+ if (_(s))
133
+ return y(s, n);
132
134
  if (typeof t.GetValue == "function") {
133
- const i = t.GetValue(e, r), f = b(i, n);
134
- if (f !== null)
135
- return h(f, n);
136
- const c = I(i, n);
135
+ const a = t.GetValue(e, o), c = b(a, n);
137
136
  if (c !== null)
138
- return h(c, n);
139
- if (A(i))
140
- return h(i, n);
137
+ return y(c, n);
138
+ const f = T(a, n);
139
+ if (f !== null)
140
+ return y(f, n);
141
+ if (_(a))
142
+ return y(a, n);
141
143
  }
142
144
  if (typeof t.GetString == "function") {
143
- const i = t.GetString(e, r), f = b(i, n);
144
- if (f !== null)
145
- return h(f, n);
146
- const c = I(i, n);
145
+ const a = t.GetString(e, o), c = b(a, n);
147
146
  if (c !== null)
148
- return h(c, n);
149
- if (i != null)
150
- return h(i, n);
147
+ return y(c, n);
148
+ const f = T(a, n);
149
+ if (f !== null)
150
+ return y(f, n);
151
+ if (a != null)
152
+ return y(a, n);
151
153
  }
152
154
  return "";
153
- }, "getBodyValue"), Ct = /* @__PURE__ */ l(({
155
+ }, "getBodyValue"), q = /* @__PURE__ */ l(({
154
156
  colName: t,
155
157
  resolveSpan: e,
156
- row: r,
158
+ row: o,
157
159
  rowIndex: n,
158
- totalRows: o
160
+ totalRows: s
159
161
  }) => {
160
- const s = Math.min(
161
- O(r[`${t}RowSpan`]),
162
- Math.max(1, o - n)
163
- ), { allColSpan: a, visibleColIndex: i, visibleColSpan: f } = e(
162
+ const r = Math.min(
163
+ U(o[`${t}RowSpan`]),
164
+ Math.max(1, s - n)
165
+ ), { allColSpan: i, visibleColIndex: a, visibleColSpan: c } = e(
164
166
  t,
165
- r[`${t}Span`]
167
+ o[`${t}Span`]
166
168
  );
167
169
  return {
168
- allColSpan: a,
169
- rowSpan: s,
170
- visibleColIndex: i,
171
- visibleColSpan: f
170
+ allColSpan: i,
171
+ rowSpan: r,
172
+ visibleColIndex: a,
173
+ visibleColSpan: c
172
174
  };
173
- }, "getCellSpanInfo"), It = /* @__PURE__ */ l((t, e, r) => {
175
+ }, "getCellSpanInfo"), z = /* @__PURE__ */ l((t, e, o) => {
174
176
  var n;
175
- return (n = t.get(e)) == null ? void 0 : n.has(r);
176
- }, "isOccupied"), bt = /* @__PURE__ */ l((t, e, r, n, o) => {
177
- for (let s = e; s < e + n; s += 1) {
178
- const a = t.get(s) ?? /* @__PURE__ */ new Set();
179
- for (let i = r; i < r + o; i += 1)
180
- a.add(i);
181
- t.set(s, a);
177
+ return (n = t.get(e)) == null ? void 0 : n.has(o);
178
+ }, "isOccupied"), J = /* @__PURE__ */ l((t, e, o, n, s) => {
179
+ for (let r = e; r < e + n; r += 1) {
180
+ const i = t.get(r) ?? /* @__PURE__ */ new Set();
181
+ for (let a = o; a < o + s; a += 1)
182
+ i.add(a);
183
+ t.set(r, i);
182
184
  }
183
- }, "markOccupied"), k = /* @__PURE__ */ l(async ({
185
+ }, "markOccupied"), mt = /* @__PURE__ */ l(async ({
184
186
  allExportColumns: t,
185
187
  getValue: e,
186
- onVisibleEntry: r,
188
+ onVisibleEntry: o,
187
189
  resolveSpan: n,
188
- rows: o
190
+ rows: s
189
191
  }) => {
190
192
  if (!t.length)
191
193
  return [];
192
- const s = /* @__PURE__ */ new Map(), a = o.map(() => []);
193
- for (let i = 0; i < o.length; i += 1) {
194
- const f = o[i], c = a[i];
195
- if (!(!f || !c)) {
194
+ const r = /* @__PURE__ */ new Map(), i = s.map(() => []);
195
+ for (let a = 0; a < s.length; a += 1) {
196
+ const c = s[a], f = i[a];
197
+ if (!(!c || !f)) {
196
198
  for (let d = 0; d < t.length; d += 1) {
197
199
  const g = t[d];
198
- if (!g || It(s, i, d))
200
+ if (!g || z(r, a, d))
199
201
  continue;
200
- const { allColSpan: y, rowSpan: p, visibleColIndex: u, visibleColSpan: S } = Ct({
201
- row: f,
202
+ const { allColSpan: p, rowSpan: x, visibleColIndex: u, visibleColSpan: w } = q({
203
+ row: c,
202
204
  colName: g,
203
- rowIndex: i,
204
- totalRows: o.length,
205
+ rowIndex: a,
206
+ totalRows: s.length,
205
207
  resolveSpan: n
206
208
  });
207
- if (bt(s, i, d, p, y), u === null || S < 1)
209
+ if (J(r, a, d, x, p), u === null || w < 1)
208
210
  continue;
209
- const E = e(f, g);
210
- r == null || r(u, E), c.push({
211
+ const C = e(c, g);
212
+ o == null || o(u, C), f.push({
211
213
  colIndex: u,
212
- value: E,
213
- rowSpan: p,
214
- colSpan: S
214
+ value: C,
215
+ rowSpan: x,
216
+ colSpan: w
215
217
  });
216
218
  }
217
- (i + 1) % R === 0 && await x();
219
+ (a + 1) % S === 0 && await R();
218
220
  }
219
221
  }
220
- return a;
221
- }, "createEntryRows"), At = /* @__PURE__ */ l(async ({
222
+ return i;
223
+ }, "createEntryRows"), Mt = /* @__PURE__ */ l(async ({
222
224
  allExportColumns: t,
223
225
  grid: e,
224
- headerRows: r,
226
+ headerRows: o,
225
227
  resolveSpan: n,
226
- visibleExportColumns: o
227
- }) => o.length ? r.length ? k({
228
+ visibleExportColumns: s
229
+ }) => s.length ? o.length ? mt({
228
230
  allExportColumns: t,
229
- getValue: /* @__PURE__ */ l((s, a) => H(e, s, a), "getValue"),
231
+ getValue: /* @__PURE__ */ l((r, i) => V(e, r, i), "getValue"),
230
232
  resolveSpan: n,
231
- rows: r
233
+ rows: o
232
234
  }) : [
233
- o.map((s, a) => ({
234
- colName: s,
235
- colIndex: a,
236
- value: H(e, null, s),
235
+ s.map((r, i) => ({
236
+ colName: r,
237
+ colIndex: i,
238
+ value: V(e, null, r),
237
239
  rowSpan: 1,
238
240
  colSpan: 1
239
241
  }))
240
- ] : [], "createHeaderEntries"), Mt = /* @__PURE__ */ l(async ({
241
- allExportColumns: t,
242
- columns: e,
243
- onVisibleEntry: r,
242
+ ] : [], "createHeaderEntries"), At = /* @__PURE__ */ l(async ({
243
+ worksheet: t,
244
+ allExportColumns: e,
245
+ columns: o,
244
246
  grid: n,
245
- dataRows: o,
246
- resolveSpan: s,
247
- visibleExportColumns: a
248
- }) => a.length ? k({
249
- allExportColumns: t,
250
- getValue: /* @__PURE__ */ l((i, f) => Et(n, i, f, e[f]), "getValue"),
251
- onVisibleEntry: r,
252
- resolveSpan: s,
253
- rows: o
254
- }) : [], "createBodyEntries"), B = /* @__PURE__ */ l(async (t, e, r) => {
255
- const n = t.rowCount + 1, o = [];
256
- for (let s = 0; s < e.length; s += 1) {
257
- const a = e[s] ?? [], i = new Array(r).fill("");
258
- for (let f = 0; f < a.length; f += 1) {
259
- const c = a[f];
260
- c && (i[c.colIndex] = c.value ?? "");
247
+ onVisibleEntry: s,
248
+ resolveSpan: r,
249
+ visibleColumnCount: i
250
+ }) => {
251
+ const a = t.rowCount + 1;
252
+ if (!i)
253
+ return { startRowIndex: a, rowCount: 0, mergeRanges: [] };
254
+ const c = Rt(n), f = /* @__PURE__ */ new Map(), d = [], g = [];
255
+ let p = 0;
256
+ for (const x of k(n)) {
257
+ const u = new Array(i).fill("");
258
+ for (let w = 0; w < e.length; w += 1) {
259
+ const C = e[w];
260
+ if (!C || z(f, p, w))
261
+ continue;
262
+ const { allColSpan: M, rowSpan: h, visibleColIndex: I, visibleColSpan: E } = q({
263
+ row: x,
264
+ colName: C,
265
+ rowIndex: p,
266
+ totalRows: c,
267
+ resolveSpan: r
268
+ });
269
+ if (J(f, p, w, h, M), I === null || E < 1)
270
+ continue;
271
+ const A = Et(n, x, C, o[C]);
272
+ s == null || s(I, A), u[I] = A ?? "", !(h === 1 && E === 1) && g.push({
273
+ startRowIndex: a + p,
274
+ startColIndex: I + 1,
275
+ endRowIndex: a + p + h - 1,
276
+ endColIndex: I + E
277
+ });
278
+ }
279
+ d.push(u), f.delete(p), p += 1, d.length === S ? (t.addRows(d), d.length = 0, await R()) : p % S === 0 && await R();
280
+ }
281
+ return d.length && t.addRows(d), { startRowIndex: a, rowCount: p, mergeRanges: g };
282
+ }, "appendBodyRows"), Tt = /* @__PURE__ */ l(async (t, e, o) => {
283
+ const n = t.rowCount + 1, s = [];
284
+ for (let r = 0; r < e.length; r += 1) {
285
+ const i = e[r] ?? [], a = new Array(o).fill("");
286
+ for (let c = 0; c < i.length; c += 1) {
287
+ const f = i[c];
288
+ f && (a[f.colIndex] = f.value ?? "");
261
289
  }
262
- o.push(i), o.length === R ? (t.addRows(o), o.length = 0, await x()) : (s + 1) % R === 0 && await x();
290
+ s.push(a), s.length === S ? (t.addRows(s), s.length = 0, await R()) : (r + 1) % S === 0 && await R();
263
291
  }
264
- return o.length && t.addRows(o), n;
265
- }, "appendEntryRows"), W = /* @__PURE__ */ l(async (t, e, r) => {
292
+ return s.length && t.addRows(s), n;
293
+ }, "appendEntryRows"), bt = /* @__PURE__ */ l(async (t, e, o) => {
266
294
  for (let n = 0; n < e.length; n += 1) {
267
- const o = e[n] ?? [];
268
- for (let s = 0; s < o.length; s += 1) {
269
- const a = o[s];
270
- a && (a.rowSpan === 1 && a.colSpan === 1 || t.mergeCells(
271
- r + n,
272
- a.colIndex + 1,
273
- r + n + a.rowSpan - 1,
274
- a.colIndex + a.colSpan
295
+ const s = e[n] ?? [];
296
+ for (let r = 0; r < s.length; r += 1) {
297
+ const i = s[r];
298
+ i && (i.rowSpan === 1 && i.colSpan === 1 || t.mergeCells(
299
+ o + n,
300
+ i.colIndex + 1,
301
+ o + n + i.rowSpan - 1,
302
+ i.colIndex + i.colSpan
275
303
  ));
276
304
  }
277
- (n + 1) % R === 0 && await x();
305
+ (n + 1) % S === 0 && await R();
278
306
  }
279
- }, "mergeEntryRows"), Tt = /* @__PURE__ */ l(async (t, e, r, n) => {
280
- for (let o = 0; o < r; o += 1) {
281
- const s = t.getRow(e + o);
282
- s.font = v;
283
- for (let a = 1; a <= n; a += 1) {
284
- const i = s.getCell(a);
285
- i.fill = tt, i.border = Y, i.alignment = {
286
- ...P,
307
+ }, "mergeEntryRows"), _t = /* @__PURE__ */ l(async (t, e) => {
308
+ for (let o = 0; o < e.length; o += 1) {
309
+ const n = e[o];
310
+ n && (t.mergeCells(
311
+ n.startRowIndex,
312
+ n.startColIndex,
313
+ n.endRowIndex,
314
+ n.endColIndex
315
+ ), (o + 1) % S === 0 && await R());
316
+ }
317
+ }, "mergeWorksheetRanges"), Dt = /* @__PURE__ */ l(async (t, e, o, n) => {
318
+ for (let s = 0; s < o; s += 1) {
319
+ const r = t.getRow(e + s);
320
+ r.font = et;
321
+ for (let i = 1; i <= n; i += 1) {
322
+ const a = r.getCell(i);
323
+ a.fill = nt, a.border = P, a.alignment = {
324
+ ...L,
287
325
  horizontal: "center"
288
326
  };
289
327
  }
290
- (o + 1) % R === 0 && await x();
328
+ (s + 1) % S === 0 && await R();
291
329
  }
292
- }, "styleHeaderRows"), mt = /* @__PURE__ */ l(async (t, e, r, n) => {
293
- for (let o = 0; o < r; o += 1) {
294
- const s = t.getRow(e + o);
295
- s.font = et;
296
- for (let a = 1; a <= n; a += 1)
297
- s.getCell(a).border = Y;
298
- (o + 1) % R === 0 && await x();
330
+ }, "styleHeaderRows"), Nt = /* @__PURE__ */ l(async (t, e, o, n) => {
331
+ for (let s = 0; s < o; s += 1) {
332
+ const r = t.getRow(e + s);
333
+ r.font = ot;
334
+ for (let i = 1; i <= n; i += 1)
335
+ r.getCell(i).border = P;
336
+ (s + 1) % S === 0 && await R();
299
337
  }
300
- }, "styleBodyRows"), _t = /* @__PURE__ */ l((t) => {
338
+ }, "styleBodyRows"), Gt = /* @__PURE__ */ l((t) => {
301
339
  const e = Number((t == null ? void 0 : t.Width) ?? (t == null ? void 0 : t.MinWidth));
302
340
  return !Number.isFinite(e) || e <= 0 ? null : Math.min(Math.max(Math.round(e / 8), 10), 50);
303
- }, "getPreferredColumnWidth"), $ = /* @__PURE__ */ l((t) => Math.min(Math.max(t + 4, 10), 50), "getAutoColumnWidth"), Dt = /* @__PURE__ */ l((t, e, r) => {
304
- const n = new Array(r.length).fill(10), o = new Array(r.length).fill(!1);
305
- for (let s = 0; s < r.length; s += 1) {
306
- const a = r[s];
307
- if (!a)
341
+ }, "getPreferredColumnWidth"), W = /* @__PURE__ */ l((t) => Math.min(Math.max(t + 4, 10), 50), "getAutoColumnWidth"), Ft = /* @__PURE__ */ l((t, e, o) => {
342
+ const n = new Array(o.length).fill(10), s = new Array(o.length).fill(!1);
343
+ for (let r = 0; r < o.length; r += 1) {
344
+ const i = o[r];
345
+ if (!i)
308
346
  continue;
309
- const i = e[a], f = _t(i);
310
- if (f !== null) {
311
- n[s] = f, o[s] = !0;
347
+ const a = e[i], c = Gt(a);
348
+ if (c !== null) {
349
+ n[r] = c, s[r] = !0;
312
350
  continue;
313
351
  }
314
- const c = (typeof t.GetCaption == "function" ? t.GetCaption(a) : "") || a;
315
- n[s] = $(`${c}`.length);
352
+ const f = (typeof t.GetCaption == "function" ? t.GetCaption(i) : "") || i;
353
+ n[r] = W(`${f}`.length);
316
354
  }
317
355
  return {
318
356
  widths: n,
319
- updateWidth: /* @__PURE__ */ l((s, a) => {
320
- if (o[s])
357
+ updateWidth: /* @__PURE__ */ l((r, i) => {
358
+ if (s[r])
321
359
  return;
322
- const i = n[s];
323
- if (i === void 0)
360
+ const a = n[r];
361
+ if (a === void 0)
324
362
  return;
325
- const f = $(`${a ?? ""}`.length);
326
- f > i && (n[s] = f);
363
+ const c = W(`${i ?? ""}`.length);
364
+ c > a && (n[r] = c);
327
365
  }, "updateWidth")
328
366
  };
329
- }, "createColumnWidths"), Gt = /* @__PURE__ */ l(async (t, e) => {
367
+ }, "createColumnWidths"), Ht = /* @__PURE__ */ l(async (t, e) => {
330
368
  try {
331
- const r = typeof e == "string" ? { exportName: e } : e, n = r == null ? void 0 : r.t;
369
+ const o = typeof e == "string" ? { exportName: e } : e, n = o == null ? void 0 : o.t;
332
370
  if (!t)
333
371
  throw new Error(
334
- F(n, "Message.TreeGrid 인스턴스가 없습니다.", rt)
372
+ H(n, "Message.TreeGrid 인스턴스가 없습니다.", st)
335
373
  );
336
- const o = Q(), s = T(t), a = ht(t), i = gt(t, a), { widths: f, updateWidth: c } = Dt(t, s, i), d = wt(t), g = yt(t), y = xt(a, i), p = await At({
337
- allExportColumns: a,
374
+ const s = tt(), r = D(t), i = ht(t), a = xt(t, i), { widths: c, updateWidth: f } = Ft(t, r, a), d = yt(t), g = Ct(i, a), p = await Mt({
375
+ allExportColumns: i,
338
376
  grid: t,
339
377
  headerRows: d,
340
- resolveSpan: y,
341
- visibleExportColumns: i
342
- }), u = await Mt({
343
- allExportColumns: a,
344
- columns: s,
345
- dataRows: g,
346
- grid: t,
347
- onVisibleEntry: c,
348
- resolveSpan: y,
349
- visibleExportColumns: i
350
- }), S = await o, E = new S.Workbook(), K = (r == null ? void 0 : r.exportName) ?? lt(t) ?? t.id ?? "sheet", q = r != null && r.useAppendCurrentDateTimeToExportName ? `-${L().format("YYYY-MM-DD-HH-mm-ss")}` : "", m = U(`${K}${q}`), w = E.addWorksheet(dt(m)), _ = await B(
351
- w,
378
+ resolveSpan: g,
379
+ visibleExportColumns: a
380
+ }), x = await s, u = new x.Workbook(), w = (o == null ? void 0 : o.exportName) ?? ft(t) ?? t.id ?? "sheet", C = o != null && o.useAppendCurrentDateTimeToExportName ? `-${$().format("YYYY-MM-DD-HH-mm-ss")}` : "", M = Y(`${w}${C}`), h = u.addWorksheet(ut(M)), I = await Tt(
381
+ h,
352
382
  p,
353
- i.length
354
- ), D = await B(
355
- w,
356
- u,
357
- i.length
358
- );
359
- for (let C = 0; C < i.length; C += 1) {
360
- const G = i[C];
361
- if (!G)
383
+ a.length
384
+ ), {
385
+ startRowIndex: E,
386
+ rowCount: A,
387
+ mergeRanges: K
388
+ } = await At({
389
+ worksheet: h,
390
+ allExportColumns: i,
391
+ columns: r,
392
+ grid: t,
393
+ onVisibleEntry: f,
394
+ resolveSpan: g,
395
+ visibleColumnCount: a.length
396
+ });
397
+ for (let m = 0; m < a.length; m += 1) {
398
+ const N = a[m];
399
+ if (!N)
362
400
  continue;
363
- const J = s[G], N = w.getColumn(C + 1);
364
- N.width = f[C], N.alignment = {
365
- ...P,
366
- horizontal: St(J)
401
+ const X = r[N], G = h.getColumn(m + 1);
402
+ G.width = c[m], G.alignment = {
403
+ ...L,
404
+ horizontal: St(X)
367
405
  };
368
406
  }
369
- await W(w, p, _), await W(w, u, D), await Tt(
370
- w,
371
- _,
407
+ await bt(h, p, I), await _t(h, K), await Dt(
408
+ h,
409
+ I,
372
410
  p.length,
373
- i.length
374
- ), await mt(
375
- w,
376
- D,
377
- u.length,
378
- i.length
379
- ), w.views = [{ state: "frozen", ySplit: p.length }], await x();
380
- const z = await E.xlsx.writeBuffer({
411
+ a.length
412
+ ), await Nt(
413
+ h,
414
+ E,
415
+ A,
416
+ a.length
417
+ ), h.views = [{ state: "frozen", ySplit: p.length }], await R();
418
+ const j = await u.xlsx.writeBuffer({
381
419
  useSharedStrings: !1,
382
420
  useStyles: !0
383
421
  });
384
- Z(z, m);
385
- } catch (r) {
386
- const n = typeof e == "string" ? {} : e, o = n == null ? void 0 : n.t;
387
- X(
388
- r instanceof Error ? r.message : F(
389
- o,
422
+ v(j, M);
423
+ } catch (o) {
424
+ const n = typeof e == "string" ? {} : e, s = n == null ? void 0 : n.t;
425
+ Q(
426
+ o instanceof Error ? o.message : H(
427
+ s,
390
428
  "Message.엑셀 다운로드 중 오류가 발생했습니다.",
391
- nt
429
+ rt
392
430
  ),
393
431
  {
394
432
  variant: "error"
395
433
  }
396
434
  );
397
435
  }
398
- }, "exportTreeGridExcel"), $t = Gt;
436
+ }, "exportTreeGridExcel"), Yt = Ht;
399
437
  export {
400
- $t as exportExcelByGrid,
401
- Gt as exportTreeGridExcel
438
+ Yt as exportExcelByGrid,
439
+ Ht as exportTreeGridExcel
402
440
  };
403
441
  //# sourceMappingURL=treeGridExportExcelUtil.js.map