@owp/core 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/components/OwpMrtTable/OwpMrtTable.js +223 -196
- package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
- package/dist/components/OwpMrtTable/OwpMrtTableNoDataOverlay.js +53 -0
- package/dist/components/OwpMrtTable/OwpMrtTableNoDataOverlay.js.map +1 -0
- package/dist/components/OwpSection/OwpSection.js +35 -35
- package/dist/components/OwpSection/OwpSection.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +291 -192
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js +48 -46
- package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js.map +1 -1
- package/dist/components/OwpTreeGrid/perf.js +31 -0
- package/dist/components/OwpTreeGrid/perf.js.map +1 -0
- package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js +34 -0
- package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js.map +1 -0
- package/dist/index.js +25 -23
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
- package/dist/types/components/OwpMrtTable/OwpMrtTable.d.ts +2 -0
- package/dist/types/components/OwpMrtTable/OwpMrtTableNoDataOverlay.d.ts +14 -0
- package/dist/types/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.d.ts +2 -1
- package/dist/types/components/OwpTreeGrid/perf.d.ts +30 -0
- package/dist/types/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.d.ts +13 -0
- package/dist/types/components/OwpTreeGridResetChangesButton/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/preloadOnIdle.d.ts +7 -0
- package/dist/types/utils/treeGridBodyRowsEvent.d.ts +9 -0
- package/dist/utils/exceljsBrowser.js +6 -6
- package/dist/utils/exceljsBrowser.js.map +1 -1
- package/dist/utils/jszipBrowser.js +6 -6
- package/dist/utils/jszipBrowser.js.map +1 -1
- package/dist/utils/preloadOnIdle.js +27 -0
- package/dist/utils/preloadOnIdle.js.map +1 -0
- package/dist/utils/treeGridBodyRowsEvent.js +14 -0
- package/dist/utils/treeGridBodyRowsEvent.js.map +1 -0
- package/dist/utils/treeGridExportExcelUtil.js +306 -268
- package/dist/utils/treeGridExportExcelUtil.js.map +1 -1
- package/dist/utils/treeGridUtil.js +79 -72
- package/dist/utils/treeGridUtil.js.map +1 -1
- package/dist/utils.js +64 -62
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_commonjs-dynamic-modules.js +0 -10
- package/dist/_virtual/_commonjs-dynamic-modules.js.map +0 -1
- package/dist/_virtual/exceljs.min.js +0 -31
- package/dist/_virtual/exceljs.min.js.map +0 -1
- package/dist/_virtual/exceljs.min2.js +0 -5
- package/dist/_virtual/exceljs.min2.js.map +0 -1
- package/dist/_virtual/jszip.min.js +0 -31
- package/dist/_virtual/jszip.min.js.map +0 -1
- package/dist/_virtual/jszip.min2.js +0 -5
- package/dist/_virtual/jszip.min2.js.map +0 -1
- package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.js +0 -23540
- package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.js.map +0 -1
- package/dist/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js +0 -2385
- 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
|
|
2
|
-
var l = (t, e) =>
|
|
3
|
-
import
|
|
4
|
-
import { enqueueSnackbar as
|
|
5
|
-
import { exportExcelByBuffer as
|
|
6
|
-
import { loadExcelJSBrowser as
|
|
7
|
-
import { DEFAULT_WRAP_CELL_ALIGNMENT as
|
|
8
|
-
const
|
|
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"),
|
|
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"),
|
|
20
|
-
const e =
|
|
21
|
-
for (const
|
|
22
|
-
!
|
|
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 =
|
|
26
|
-
return
|
|
27
|
-
const n = e[
|
|
28
|
-
return !n ||
|
|
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"),
|
|
31
|
-
const
|
|
30
|
+
}, "getAllExportColumns"), xt = /* @__PURE__ */ l((t, e) => {
|
|
31
|
+
const o = D(t);
|
|
32
32
|
return e.filter((n) => {
|
|
33
|
-
const
|
|
34
|
-
return
|
|
33
|
+
const s = o[n];
|
|
34
|
+
return s ? O(s.Visible) : !1;
|
|
35
35
|
});
|
|
36
|
-
}, "getVisibleExportColumns"),
|
|
37
|
-
const e = [],
|
|
38
|
-
!
|
|
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(
|
|
41
|
-
let
|
|
42
|
-
for (;
|
|
43
|
-
n(
|
|
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"),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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 =
|
|
58
|
-
for (const
|
|
59
|
-
const
|
|
60
|
-
|
|
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
|
-
}, "
|
|
64
|
-
const
|
|
65
|
-
e.map((
|
|
66
|
-
),
|
|
67
|
-
let
|
|
68
|
-
for (let
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
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(
|
|
73
|
-
|
|
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
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
const d =
|
|
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 =
|
|
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:
|
|
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"),
|
|
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
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
104
|
-
const n = "__TREEGRID_MINUTE_TWO__",
|
|
105
|
-
return
|
|
106
|
-
}, "getDayjsDateFormat"),
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
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 =
|
|
111
|
-
return n.isValid() ? n.format(
|
|
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"),
|
|
113
|
-
const n = e == null ? void 0 : e[
|
|
114
|
-
return n != null ? String(n) : typeof t.GetCaption == "function" ? t.GetCaption(
|
|
115
|
-
}, "getHeaderValue"),
|
|
116
|
-
const
|
|
117
|
-
return !
|
|
118
|
-
}, "appendHtmlPostfix"), Et = /* @__PURE__ */ l((t, e,
|
|
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
|
|
121
|
-
if (
|
|
122
|
-
return
|
|
122
|
+
const a = t.GetString(e, o);
|
|
123
|
+
if (a != null)
|
|
124
|
+
return y(a, n);
|
|
123
125
|
}
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
return
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
return
|
|
130
|
-
if (
|
|
131
|
-
return
|
|
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
|
|
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
|
|
139
|
-
|
|
140
|
-
|
|
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
|
|
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
|
|
149
|
-
|
|
150
|
-
|
|
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"),
|
|
155
|
+
}, "getBodyValue"), q = /* @__PURE__ */ l(({
|
|
154
156
|
colName: t,
|
|
155
157
|
resolveSpan: e,
|
|
156
|
-
row:
|
|
158
|
+
row: o,
|
|
157
159
|
rowIndex: n,
|
|
158
|
-
totalRows:
|
|
160
|
+
totalRows: s
|
|
159
161
|
}) => {
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
Math.max(1,
|
|
163
|
-
), { allColSpan:
|
|
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
|
-
|
|
167
|
+
o[`${t}Span`]
|
|
166
168
|
);
|
|
167
169
|
return {
|
|
168
|
-
allColSpan:
|
|
169
|
-
rowSpan:
|
|
170
|
-
visibleColIndex:
|
|
171
|
-
visibleColSpan:
|
|
170
|
+
allColSpan: i,
|
|
171
|
+
rowSpan: r,
|
|
172
|
+
visibleColIndex: a,
|
|
173
|
+
visibleColSpan: c
|
|
172
174
|
};
|
|
173
|
-
}, "getCellSpanInfo"),
|
|
175
|
+
}, "getCellSpanInfo"), z = /* @__PURE__ */ l((t, e, o) => {
|
|
174
176
|
var n;
|
|
175
|
-
return (n = t.get(e)) == null ? void 0 : n.has(
|
|
176
|
-
}, "isOccupied"),
|
|
177
|
-
for (let
|
|
178
|
-
const
|
|
179
|
-
for (let
|
|
180
|
-
|
|
181
|
-
t.set(
|
|
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"),
|
|
185
|
+
}, "markOccupied"), mt = /* @__PURE__ */ l(async ({
|
|
184
186
|
allExportColumns: t,
|
|
185
187
|
getValue: e,
|
|
186
|
-
onVisibleEntry:
|
|
188
|
+
onVisibleEntry: o,
|
|
187
189
|
resolveSpan: n,
|
|
188
|
-
rows:
|
|
190
|
+
rows: s
|
|
189
191
|
}) => {
|
|
190
192
|
if (!t.length)
|
|
191
193
|
return [];
|
|
192
|
-
const
|
|
193
|
-
for (let
|
|
194
|
-
const
|
|
195
|
-
if (!(!
|
|
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 ||
|
|
200
|
+
if (!g || z(r, a, d))
|
|
199
201
|
continue;
|
|
200
|
-
const { allColSpan:
|
|
201
|
-
row:
|
|
202
|
+
const { allColSpan: p, rowSpan: x, visibleColIndex: u, visibleColSpan: w } = q({
|
|
203
|
+
row: c,
|
|
202
204
|
colName: g,
|
|
203
|
-
rowIndex:
|
|
204
|
-
totalRows:
|
|
205
|
+
rowIndex: a,
|
|
206
|
+
totalRows: s.length,
|
|
205
207
|
resolveSpan: n
|
|
206
208
|
});
|
|
207
|
-
if (
|
|
209
|
+
if (J(r, a, d, x, p), u === null || w < 1)
|
|
208
210
|
continue;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
+
const C = e(c, g);
|
|
212
|
+
o == null || o(u, C), f.push({
|
|
211
213
|
colIndex: u,
|
|
212
|
-
value:
|
|
213
|
-
rowSpan:
|
|
214
|
-
colSpan:
|
|
214
|
+
value: C,
|
|
215
|
+
rowSpan: x,
|
|
216
|
+
colSpan: w
|
|
215
217
|
});
|
|
216
218
|
}
|
|
217
|
-
(
|
|
219
|
+
(a + 1) % S === 0 && await R();
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
|
-
return
|
|
221
|
-
}, "createEntryRows"),
|
|
222
|
+
return i;
|
|
223
|
+
}, "createEntryRows"), Mt = /* @__PURE__ */ l(async ({
|
|
222
224
|
allExportColumns: t,
|
|
223
225
|
grid: e,
|
|
224
|
-
headerRows:
|
|
226
|
+
headerRows: o,
|
|
225
227
|
resolveSpan: n,
|
|
226
|
-
visibleExportColumns:
|
|
227
|
-
}) =>
|
|
228
|
+
visibleExportColumns: s
|
|
229
|
+
}) => s.length ? o.length ? mt({
|
|
228
230
|
allExportColumns: t,
|
|
229
|
-
getValue: /* @__PURE__ */ l((
|
|
231
|
+
getValue: /* @__PURE__ */ l((r, i) => V(e, r, i), "getValue"),
|
|
230
232
|
resolveSpan: n,
|
|
231
|
-
rows:
|
|
233
|
+
rows: o
|
|
232
234
|
}) : [
|
|
233
|
-
|
|
234
|
-
colName:
|
|
235
|
-
colIndex:
|
|
236
|
-
value:
|
|
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"),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
] : [], "createHeaderEntries"), At = /* @__PURE__ */ l(async ({
|
|
243
|
+
worksheet: t,
|
|
244
|
+
allExportColumns: e,
|
|
245
|
+
columns: o,
|
|
244
246
|
grid: n,
|
|
245
|
-
|
|
246
|
-
resolveSpan:
|
|
247
|
-
|
|
248
|
-
}) =>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
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
|
|
265
|
-
}, "appendEntryRows"),
|
|
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
|
|
268
|
-
for (let
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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) %
|
|
305
|
+
(n + 1) % S === 0 && await R();
|
|
278
306
|
}
|
|
279
|
-
}, "mergeEntryRows"),
|
|
280
|
-
for (let o = 0; o <
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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
|
-
(
|
|
328
|
+
(s + 1) % S === 0 && await R();
|
|
291
329
|
}
|
|
292
|
-
}, "styleHeaderRows"),
|
|
293
|
-
for (let
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
for (let
|
|
297
|
-
|
|
298
|
-
(
|
|
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"),
|
|
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"),
|
|
304
|
-
const n = new Array(
|
|
305
|
-
for (let
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
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
|
|
310
|
-
if (
|
|
311
|
-
n[
|
|
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
|
|
315
|
-
n[
|
|
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((
|
|
320
|
-
if (
|
|
357
|
+
updateWidth: /* @__PURE__ */ l((r, i) => {
|
|
358
|
+
if (s[r])
|
|
321
359
|
return;
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
360
|
+
const a = n[r];
|
|
361
|
+
if (a === void 0)
|
|
324
362
|
return;
|
|
325
|
-
const
|
|
326
|
-
|
|
363
|
+
const c = W(`${i ?? ""}`.length);
|
|
364
|
+
c > a && (n[r] = c);
|
|
327
365
|
}, "updateWidth")
|
|
328
366
|
};
|
|
329
|
-
}, "createColumnWidths"),
|
|
367
|
+
}, "createColumnWidths"), Ht = /* @__PURE__ */ l(async (t, e) => {
|
|
330
368
|
try {
|
|
331
|
-
const
|
|
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
|
-
|
|
372
|
+
H(n, "Message.TreeGrid 인스턴스가 없습니다.", st)
|
|
335
373
|
);
|
|
336
|
-
const
|
|
337
|
-
allExportColumns:
|
|
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:
|
|
341
|
-
visibleExportColumns:
|
|
342
|
-
}), u = await
|
|
343
|
-
|
|
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
|
-
|
|
354
|
-
),
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
|
364
|
-
|
|
365
|
-
...
|
|
366
|
-
horizontal: St(
|
|
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
|
|
370
|
-
|
|
371
|
-
|
|
407
|
+
await bt(h, p, I), await _t(h, K), await Dt(
|
|
408
|
+
h,
|
|
409
|
+
I,
|
|
372
410
|
p.length,
|
|
373
|
-
|
|
374
|
-
), await
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
),
|
|
380
|
-
const
|
|
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
|
-
|
|
385
|
-
} catch (
|
|
386
|
-
const n = typeof e == "string" ? {} : e,
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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
|
-
|
|
429
|
+
rt
|
|
392
430
|
),
|
|
393
431
|
{
|
|
394
432
|
variant: "error"
|
|
395
433
|
}
|
|
396
434
|
);
|
|
397
435
|
}
|
|
398
|
-
}, "exportTreeGridExcel"),
|
|
436
|
+
}, "exportTreeGridExcel"), Yt = Ht;
|
|
399
437
|
export {
|
|
400
|
-
|
|
401
|
-
|
|
438
|
+
Yt as exportExcelByGrid,
|
|
439
|
+
Ht as exportTreeGridExcel
|
|
402
440
|
};
|
|
403
441
|
//# sourceMappingURL=treeGridExportExcelUtil.js.map
|