open-grid 1.1.1 → 1.2.1

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 (64) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +30 -1
  3. package/dist/OpenGrid-0r_543Kj.cjs +7192 -0
  4. package/dist/OpenGrid-HmhGVC2V.js +7203 -0
  5. package/dist/open-grid-react.cjs +27 -1
  6. package/dist/open-grid-react.js +22 -82
  7. package/dist/open-grid-vue.cjs +31 -1
  8. package/dist/open-grid-vue.js +29 -79
  9. package/dist/open-grid.cjs +272 -6
  10. package/dist/open-grid.js +174 -260
  11. package/dist/types/core/CellEditManager.d.ts +75 -0
  12. package/dist/types/core/CellEventHandler.d.ts +99 -2
  13. package/dist/types/core/ChartManager.d.ts +53 -3
  14. package/dist/types/core/ContextMenu.d.ts +48 -3
  15. package/dist/types/core/CrossGridController.d.ts +86 -15
  16. package/dist/types/core/CrossGridRegistry.d.ts +36 -2
  17. package/dist/types/core/DetailManager.d.ts +108 -15
  18. package/dist/types/core/ExportManager.d.ts +73 -1
  19. package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
  20. package/dist/types/core/FilterPanel.d.ts +21 -3
  21. package/dist/types/core/FilterSelect.d.ts +41 -14
  22. package/dist/types/core/FindBarManager.d.ts +32 -0
  23. package/dist/types/core/FlatRowModel.d.ts +54 -11
  24. package/dist/types/core/FooterManager.d.ts +53 -1
  25. package/dist/types/core/FormulaController.d.ts +141 -10
  26. package/dist/types/core/GridComposer.d.ts +57 -4
  27. package/dist/types/core/GridRenderer.d.ts +3 -0
  28. package/dist/types/core/GridShuttle.d.ts +44 -4
  29. package/dist/types/core/GroupTreeManager.d.ts +86 -2
  30. package/dist/types/core/IconRegistry.d.ts +56 -9
  31. package/dist/types/core/KeyboardManager.d.ts +90 -4
  32. package/dist/types/core/MaskingEngine.d.ts +10 -9
  33. package/dist/types/core/MutationService.d.ts +115 -10
  34. package/dist/types/core/OpenGrid.d.ts +393 -34
  35. package/dist/types/core/OrgChart.d.ts +56 -1
  36. package/dist/types/core/OverrideKernel.d.ts +59 -15
  37. package/dist/types/core/Pagination.d.ts +44 -5
  38. package/dist/types/core/RangeSelectionManager.d.ts +123 -7
  39. package/dist/types/core/RenderController.d.ts +56 -0
  40. package/dist/types/core/RowManager.d.ts +55 -0
  41. package/dist/types/core/SkinRegistry.d.ts +51 -15
  42. package/dist/types/core/SortFilterManager.d.ts +82 -1
  43. package/dist/types/core/TriggerManager.d.ts +46 -0
  44. package/dist/types/core/WorksheetManager.d.ts +65 -3
  45. package/dist/types/core/XmlConverter.d.ts +56 -23
  46. package/dist/types/core/chart/types.d.ts +107 -10
  47. package/dist/types/core/detail/DetailGlyph.d.ts +3 -1
  48. package/dist/types/core/editors/CellEditor.d.ts +29 -2
  49. package/dist/types/core/formula/types.d.ts +71 -8
  50. package/dist/types/core/i18n/LocaleRegistry.d.ts +0 -0
  51. package/dist/types/core/i18n/interpolate.d.ts +5 -0
  52. package/dist/types/core/i18n/locales/en.d.ts +166 -0
  53. package/dist/types/core/i18n/locales/ko.d.ts +166 -0
  54. package/dist/types/core/i18n/types.d.ts +249 -0
  55. package/dist/types/core/range/RangeQuery.d.ts +24 -2
  56. package/dist/types/core/renderers/CellRenderer.d.ts +105 -8
  57. package/dist/types/core/types.d.ts +352 -96
  58. package/dist/types/index.d.ts +22 -0
  59. package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
  60. package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
  61. package/package.json +4 -1
  62. package/dist/OpenGrid-LcZ5iixx.cjs +0 -97
  63. package/dist/OpenGrid-yg4mw6Ge.js +0 -9505
  64. package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
package/dist/open-grid.js CHANGED
@@ -1,84 +1,58 @@
1
- import { b as E } from "./OpenGrid-yg4mw6Ge.js";
2
- import { D as $, I as S, O, S as D, i as k, r as M, s as B } from "./OpenGrid-yg4mw6Ge.js";
3
- class C {
4
- constructor(t, e, o, i = {}) {
1
+ import { b, t as C } from "./OpenGrid-HmhGVC2V.js";
2
+ import { D, I, L, O, S, i, l, r, s } from "./OpenGrid-HmhGVC2V.js";
3
+ class T {
4
+ constructor(t, e, o, r2 = {}) {
5
5
  this._left = t, this._right = e;
6
- const r = document.createElement("div");
7
- r.className = "og-shuttle", r.style.cssText = `display:flex;gap:6px;align-items:center;justify-content:center;flex-direction:${i.layout === "horizontal" ? "row" : "column"};`;
8
- const a = (m, f, u) => {
9
- const c = document.createElement("button");
10
- return c.type = "button", c.className = "og-shuttle-btn", c.textContent = m, c.title = f, c.style.cssText = "min-width:34px;height:30px;padding:0 8px;border:1px solid #bbb;border-radius:7px;background:#fff;cursor:pointer;font-size:14px;color:#444;line-height:1;box-shadow:0 1px 2px rgba(0,0,0,0.06);", c.addEventListener("mouseover", () => {
11
- c.style.background = "#f0f6ff", c.style.borderColor = "#1976d2";
12
- }), c.addEventListener("mouseout", () => {
13
- c.style.background = "#fff", c.style.borderColor = "#bbb";
14
- }), c.addEventListener("click", u), c;
15
- }, _ = i.labels ?? {};
16
- r.appendChild(a(
17
- _.toRight ?? "▶",
18
- "체크한 행을 오른쪽 그리드로 이동",
19
- () => {
20
- this._left.moveCheckedTo(this._right);
21
- }
22
- )), r.appendChild(a(
23
- _.toLeft ?? "◀",
24
- "체크한 행을 왼쪽 그리드로 이동",
25
- () => {
26
- this._right.moveCheckedTo(this._left);
27
- }
28
- )), i.includeAll && (r.appendChild(a(
29
- _.allRight ?? "⏩",
30
- "왼쪽 전체를 오른쪽으로 이동",
31
- () => {
32
- this._moveAll(this._left, this._right);
33
- }
34
- )), r.appendChild(a(
35
- _.allLeft ?? "⏪",
36
- "오른쪽 전체를 왼쪽으로 이동",
37
- () => {
38
- this._moveAll(this._right, this._left);
39
- }
40
- ))), o.appendChild(r), this._el = r;
6
+ const s2 = document.createElement("div");
7
+ s2.className = "og-shuttle", s2.style.cssText = `display:flex;gap:6px;align-items:center;justify-content:center;flex-direction:${r2.layout === "horizontal" ? "row" : "column"};`;
8
+ const c = (d, h, g) => {
9
+ const n = document.createElement("button");
10
+ return n.type = "button", n.className = "og-shuttle-btn", n.textContent = d, n.title = h, n.style.cssText = "min-width:34px;height:30px;padding:0 8px;border:1px solid #bbb;border-radius:7px;background:#fff;cursor:pointer;font-size:14px;color:#444;line-height:1;box-shadow:0 1px 2px rgba(0,0,0,0.06);", n.addEventListener("mouseover", () => {
11
+ n.style.background = "#f0f6ff", n.style.borderColor = "#1976d2";
12
+ }), n.addEventListener("mouseout", () => {
13
+ n.style.background = "#fff", n.style.borderColor = "#bbb";
14
+ }), n.addEventListener("click", g), n;
15
+ }, _ = r2.labels ?? {}, p = (d) => this._left.t(d);
16
+ s2.appendChild(c(_.toRight ?? "▶", p("shuttle.toRight"), () => {
17
+ this._left.moveCheckedTo(this._right);
18
+ })), s2.appendChild(c(_.toLeft ?? "◀", p("shuttle.toLeft"), () => {
19
+ this._right.moveCheckedTo(this._left);
20
+ })), r2.includeAll && (s2.appendChild(c(_.allRight ?? "⏩", p("shuttle.allRight"), () => {
21
+ this._moveAll(this._left, this._right);
22
+ })), s2.appendChild(c(_.allLeft ?? "⏪", p("shuttle.allLeft"), () => {
23
+ this._moveAll(this._right, this._left);
24
+ }))), o.appendChild(s2), this._el = s2;
41
25
  }
42
26
  _moveAll(t, e) {
43
27
  const o = t.getData().length;
44
- o > 0 && t.moveRowsTo(e, Array.from({ length: o }, (i, r) => r));
28
+ o > 0 && t.moveRowsTo(e, Array.from({ length: o }, (r2, s2) => s2));
45
29
  }
46
30
  destroy() {
47
31
  this._el.remove();
48
32
  }
49
33
  }
50
- function v(A, t, e, o) {
51
- return new C(A, t, e, o);
34
+ function v(E, t, e, o) {
35
+ return new T(E, t, e, o);
52
36
  }
53
37
  class N {
54
38
  constructor(t, e) {
55
- this._data = [], this._roots = [], this._expandedKeys = /* @__PURE__ */ new Set(), this._selectedId = null, this._container = typeof t == "string" ? document.querySelector(t) : t, this._opts = {
56
- nodeWidth: 160,
57
- nodeHeight: 72,
58
- levelGap: 52,
59
- siblingGap: 20,
60
- expandOnLoad: !0,
61
- onNodeClick: () => {
62
- },
63
- ...e
64
- }, this._container.classList.add("og-orgchart");
39
+ this._data = [], this._roots = [], this._expandedKeys = /* @__PURE__ */ new Set(), this._selectedId = null, this._container = typeof t == "string" ? document.querySelector(t) : t, this._opts = { nodeWidth: 160, nodeHeight: 72, levelGap: 52, siblingGap: 20, expandOnLoad: true, onNodeClick: () => {
40
+ }, ...e }, this._container.classList.add("og-orgchart");
65
41
  }
66
42
  setData(t) {
67
43
  this._data = t;
68
- const { idField: e, parentIdField: o, expandOnLoad: i } = this._opts;
69
- i && this._expandedKeys.size === 0 && t.forEach((r) => this._expandedKeys.add(r[e])), this._roots = E(t, { idField: e, parentIdField: o }, this._expandedKeys), this._render();
44
+ const { idField: e, parentIdField: o, expandOnLoad: r2 } = this._opts;
45
+ r2 && this._expandedKeys.size === 0 && t.forEach((s2) => this._expandedKeys.add(s2[e])), this._roots = b(t, { idField: e, parentIdField: o }, this._expandedKeys), this._render();
70
46
  }
71
47
  setTheme(t) {
72
48
  this._container.setAttribute("data-og-theme", t);
73
49
  }
74
- /** R12b: FORM(스킨) 축 — data-og-skin 을 자기 컨테이너에 설정(setTheme 과 동형, 색과 직교). */
75
50
  setSkin(t) {
76
51
  this._container.setAttribute("data-og-skin", t);
77
52
  }
78
53
  expandAll() {
79
54
  const t = (e) => {
80
- for (const o of e)
81
- this._expandedKeys.add(o._treeId), o.children.length && t(o.children);
55
+ for (const o of e) this._expandedKeys.add(o._treeId), o.children.length && t(o.children);
82
56
  };
83
57
  t(this._roots), this._rebuild();
84
58
  }
@@ -90,239 +64,185 @@ class N {
90
64
  }
91
65
  _rebuild() {
92
66
  const { idField: t, parentIdField: e } = this._opts;
93
- this._roots = E(this._data, { idField: t, parentIdField: e }, this._expandedKeys), this._render();
67
+ this._roots = b(this._data, { idField: t, parentIdField: e }, this._expandedKeys), this._render();
94
68
  }
95
- // ── 레이아웃 계산 (post-order: 리프부터 배치, 부모는 자식 중앙) ──
96
69
  _calcLayout() {
97
- const { nodeWidth: t, nodeHeight: e, levelGap: o, siblingGap: i } = this._opts, r = /* @__PURE__ */ new Map();
98
- let a = 0;
99
- const _ = (u) => {
100
- const c = u._depth * (e + o), p = u._expanded ? u.children : [];
101
- if (!p.length) {
102
- const g = a;
103
- return a += t + i, r.set(u._treeId, { x: g, y: c }), { minX: g, maxX: g };
70
+ const { nodeWidth: t, nodeHeight: e, levelGap: o, siblingGap: r2 } = this._opts, s2 = /* @__PURE__ */ new Map();
71
+ let c = 0;
72
+ const _ = (h) => {
73
+ const g = h._depth * (e + o), n = h._expanded ? h.children : [];
74
+ if (!n.length) {
75
+ const f = c;
76
+ return c += t + r2, s2.set(h._treeId, { x: f, y: g }), { minX: f, maxX: f };
104
77
  }
105
- let n = 1 / 0, l = -1 / 0;
106
- for (const g of p) {
107
- const { minX: s, maxX: h } = _(g);
108
- s < n && (n = s), h > l && (l = h);
78
+ let i2 = 1 / 0, u = -1 / 0;
79
+ for (const f of n) {
80
+ const { minX: a, maxX: m } = _(f);
81
+ a < i2 && (i2 = a), m > u && (u = m);
109
82
  }
110
- const d = n + (l - n + t) / 2 - t / 2;
111
- return r.set(u._treeId, { x: d, y: c }), { minX: n, maxX: l };
83
+ const l2 = i2 + (u - i2 + t) / 2 - t / 2;
84
+ return s2.set(h._treeId, { x: l2, y: g }), { minX: i2, maxX: u };
112
85
  };
113
- for (const u of this._roots) _(u);
114
- let m = 0, f = 0;
115
- for (const { x: u, y: c } of r.values())
116
- u + t > m && (m = u + t), c + e > f && (f = c + e);
117
- return { layout: r, totalW: m + i, totalH: f + o + 16 };
86
+ for (const h of this._roots) _(h);
87
+ let p = 0, d = 0;
88
+ for (const { x: h, y: g } of s2.values()) h + t > p && (p = h + t), g + e > d && (d = g + e);
89
+ return { layout: s2, totalW: p + r2, totalH: d + o + 16 };
118
90
  }
119
- // ── SVG 직선 헬퍼 ──
120
- _line(t, e, o, i, r) {
121
- const a = document.createElementNS("http://www.w3.org/2000/svg", "line");
122
- a.setAttribute("x1", String(e)), a.setAttribute("y1", String(o)), a.setAttribute("x2", String(i)), a.setAttribute("y2", String(r)), a.setAttribute("class", "og-orgchart-line"), t.appendChild(a);
91
+ _line(t, e, o, r2, s2) {
92
+ const c = document.createElementNS("http://www.w3.org/2000/svg", "line");
93
+ c.setAttribute("x1", String(e)), c.setAttribute("y1", String(o)), c.setAttribute("x2", String(r2)), c.setAttribute("y2", String(s2)), c.setAttribute("class", "og-orgchart-line"), t.appendChild(c);
123
94
  }
124
- // ── 렌더 ──
125
95
  _render() {
126
- const { nodeWidth: t, nodeHeight: e, levelGap: o, columns: i } = this._opts, { layout: r, totalW: a, totalH: _ } = this._calcLayout();
96
+ const { nodeWidth: t, nodeHeight: e, levelGap: o, columns: r2 } = this._opts, { layout: s2, totalW: c, totalH: _ } = this._calcLayout();
127
97
  this._container.innerHTML = "";
128
- const m = document.createElement("div");
129
- m.className = "og-orgchart-wrap", m.style.cssText = `width:${a}px;height:${_}px;`;
130
- const f = document.createElementNS("http://www.w3.org/2000/svg", "svg");
131
- f.setAttribute("width", String(a)), f.setAttribute("height", String(_)), f.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";
132
- const u = (p) => {
133
- for (const n of p) {
134
- if (!n._expanded || !n.children.length) continue;
135
- const l = r.get(n._treeId), d = l.x + t / 2, g = l.y + e, s = g + o / 2, h = n.children;
136
- if (this._line(f, d, g, d, s), h.length > 1) {
137
- const x = r.get(h[0]._treeId), y = r.get(h[h.length - 1]._treeId);
138
- this._line(f, x.x + t / 2, s, y.x + t / 2, s);
98
+ const p = document.createElement("div");
99
+ p.className = "og-orgchart-wrap", p.style.cssText = `width:${c}px;height:${_}px;`;
100
+ const d = document.createElementNS("http://www.w3.org/2000/svg", "svg");
101
+ d.setAttribute("width", String(c)), d.setAttribute("height", String(_)), d.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";
102
+ const h = (n) => {
103
+ for (const i2 of n) {
104
+ if (!i2._expanded || !i2.children.length) continue;
105
+ const u = s2.get(i2._treeId), l2 = u.x + t / 2, f = u.y + e, a = f + o / 2, m = i2.children;
106
+ if (this._line(d, l2, f, l2, a), m.length > 1) {
107
+ const x = s2.get(m[0]._treeId), y = s2.get(m[m.length - 1]._treeId);
108
+ this._line(d, x.x + t / 2, a, y.x + t / 2, a);
139
109
  }
140
- for (const x of h) {
141
- const y = r.get(x._treeId), b = y.x + t / 2;
142
- this._line(f, b, s, b, y.y);
110
+ for (const x of m) {
111
+ const y = s2.get(x._treeId), A = y.x + t / 2;
112
+ this._line(d, A, a, A, y.y);
143
113
  }
144
- u(h);
114
+ h(m);
145
115
  }
146
116
  };
147
- u(this._roots), m.appendChild(f);
148
- const c = (p) => {
149
- for (const n of p) {
150
- const l = r.get(n._treeId);
151
- if (!l) continue;
152
- const d = document.createElement("div");
153
- d.className = "og-orgchart-node", n._hasChildren && d.classList.add("og-orgchart-node--branch"), n._expanded && d.classList.add("og-orgchart-node--expanded"), this._selectedId === n._treeId && d.classList.add("og-orgchart-node--selected"), d.style.cssText = `left:${l.x}px;top:${l.y}px;width:${t}px;height:${e}px;`;
154
- const g = document.createElement("div");
155
- g.className = "og-orgchart-node-content";
156
- for (const s of i) {
157
- const h = n.data[s.field], x = document.createElement("div");
158
- if (x.className = "og-orgchart-col" + (s.className ? " " + s.className : ""), s.style) {
159
- const y = typeof s.style == "function" ? s.style(h, n.data) : s.style;
117
+ h(this._roots), p.appendChild(d);
118
+ const g = (n) => {
119
+ for (const i2 of n) {
120
+ const u = s2.get(i2._treeId);
121
+ if (!u) continue;
122
+ const l2 = document.createElement("div");
123
+ l2.className = "og-orgchart-node", i2._hasChildren && l2.classList.add("og-orgchart-node--branch"), i2._expanded && l2.classList.add("og-orgchart-node--expanded"), this._selectedId === i2._treeId && l2.classList.add("og-orgchart-node--selected"), l2.style.cssText = `left:${u.x}px;top:${u.y}px;width:${t}px;height:${e}px;`;
124
+ const f = document.createElement("div");
125
+ f.className = "og-orgchart-node-content";
126
+ for (const a of r2) {
127
+ const m = i2.data[a.field], x = document.createElement("div");
128
+ if (x.className = "og-orgchart-col" + (a.className ? " " + a.className : ""), a.style) {
129
+ const y = typeof a.style == "function" ? a.style(m, i2.data) : a.style;
160
130
  x.setAttribute("style", y);
161
131
  }
162
- if (s.renderer) {
163
- const y = s.renderer(h, n.data);
132
+ if (a.renderer) {
133
+ const y = a.renderer(m, i2.data);
164
134
  typeof y == "string" ? x.innerHTML = y : x.appendChild(y);
165
- } else
166
- x.textContent = h ?? "";
167
- g.appendChild(x);
135
+ } else x.textContent = m ?? "";
136
+ f.appendChild(x);
168
137
  }
169
- if (d.appendChild(g), n._hasChildren) {
170
- const s = document.createElement("button");
171
- s.type = "button", s.className = "og-orgchart-toggle", s.setAttribute("aria-expanded", n._expanded ? "true" : "false"), s.setAttribute("aria-label", n._expanded ? "접기" : "펼치기");
172
- const h = document.createElement("i");
173
- h.setAttribute("aria-hidden", "true"), h.className = n._expanded ? "bi bi-dash-circle" : "bi bi-plus-circle", s.appendChild(h), s.addEventListener("click", (x) => {
174
- x.stopPropagation(), this._toggle(n._treeId);
175
- }), d.appendChild(s);
138
+ if (l2.appendChild(f), i2._hasChildren) {
139
+ const a = document.createElement("button");
140
+ a.type = "button", a.className = "og-orgchart-toggle", a.setAttribute("aria-expanded", i2._expanded ? "true" : "false"), a.setAttribute("aria-label", C(i2._expanded ? "tree.collapse" : "tree.expand"));
141
+ const m = document.createElement("i");
142
+ m.setAttribute("aria-hidden", "true"), m.className = i2._expanded ? "bi bi-dash-circle" : "bi bi-plus-circle", a.appendChild(m), a.addEventListener("click", (x) => {
143
+ x.stopPropagation(), this._toggle(i2._treeId);
144
+ }), l2.appendChild(a);
176
145
  }
177
- d.addEventListener("click", () => {
178
- this._selectedId = n._treeId, this._opts.onNodeClick(n._treeId, n.data), this._container.querySelectorAll(".og-orgchart-node--selected").forEach((s) => s.classList.remove("og-orgchart-node--selected")), d.classList.add("og-orgchart-node--selected");
179
- }), m.appendChild(d), n._expanded && n.children.length && c(n.children);
146
+ l2.addEventListener("click", () => {
147
+ this._selectedId = i2._treeId, this._opts.onNodeClick(i2._treeId, i2.data), this._container.querySelectorAll(".og-orgchart-node--selected").forEach((a) => a.classList.remove("og-orgchart-node--selected")), l2.classList.add("og-orgchart-node--selected");
148
+ }), p.appendChild(l2), i2._expanded && i2.children.length && g(i2.children);
180
149
  }
181
150
  };
182
- c(this._roots), this._container.appendChild(m);
151
+ g(this._roots), this._container.appendChild(p);
183
152
  }
184
153
  }
185
- class I {
186
- // ── 1. XML → 데이터 배열 ────────────────────────────────────
187
- /**
188
- * XML 문자열을 파싱하여 그리드 데이터 배열로 변환.
189
- * Element / Attribute 방식 자동 감지.
190
- *
191
- * @throws XML 파싱 오류 시 Error 발생
192
- */
154
+ class I2 {
193
155
  static parse(t, e = {}) {
194
- var p, n;
195
- const { fieldMap: o = {}, trim: i = !0 } = e, a = new DOMParser().parseFromString(t.trim(), "text/xml"), _ = a.querySelector("parsererror");
196
- if (_) throw new Error(`XML 파싱 오류: ${(p = _.textContent) == null ? void 0 : p.trim()}`);
197
- const m = a.documentElement;
198
- let f = e.rowTag;
199
- if (!f) {
200
- const l = e.rootTag ? a.querySelector(e.rootTag) : m;
201
- f = ((n = l == null ? void 0 : l.children[0]) == null ? void 0 : n.tagName) ?? "row";
202
- }
203
- const u = a.getElementsByTagName(f), c = [];
204
- for (let l = 0; l < u.length; l++) {
205
- const d = u[l], g = {};
206
- for (const s of Array.from(d.attributes)) {
207
- const h = o[s.name] ?? s.name;
208
- g[h] = i ? s.value.trim() : s.value;
156
+ var _a, _b, _c;
157
+ const { fieldMap: o = {}, trim: r2 = true } = e, c = new DOMParser().parseFromString(t.trim(), "text/xml"), _ = c.querySelector("parsererror");
158
+ if (_) throw new Error(`XML 파싱 오류: ${(_a = _.textContent) == null ? void 0 : _a.trim()}`);
159
+ const p = c.documentElement;
160
+ let d = e.rowTag;
161
+ d || (d = ((_c = (_b = e.rootTag ? c.querySelector(e.rootTag) : p) == null ? void 0 : _b.children[0]) == null ? void 0 : _c.tagName) ?? "row");
162
+ const h = c.getElementsByTagName(d), g = [];
163
+ for (let n = 0; n < h.length; n++) {
164
+ const i2 = h[n], u = {};
165
+ for (const l2 of Array.from(i2.attributes)) {
166
+ const f = o[l2.name] ?? l2.name;
167
+ u[f] = r2 ? l2.value.trim() : l2.value;
209
168
  }
210
- for (const s of Array.from(d.children)) {
211
- const h = o[s.tagName] ?? s.tagName, x = s.textContent ?? "";
212
- g[h] = i ? x.trim() : x;
169
+ for (const l2 of Array.from(i2.children)) {
170
+ const f = o[l2.tagName] ?? l2.tagName, a = l2.textContent ?? "";
171
+ u[f] = r2 ? a.trim() : a;
213
172
  }
214
- c.push(g);
173
+ g.push(u);
215
174
  }
216
- return c;
175
+ return g;
217
176
  }
218
- // ── 2. 데이터 배열 → XML ─────────────────────────────────────
219
- /**
220
- * 그리드 데이터 배열을 XML 문자열로 직렬화.
221
- */
222
177
  static stringify(t, e = {}) {
223
- const {
224
- rootTag: o = "rows",
225
- rowTag: i = "row",
226
- mode: r = "element",
227
- fieldMap: a = {},
228
- declaration: _ = !0,
229
- indent: m = 2,
230
- nullAs: f = "",
231
- excludeFields: u = []
232
- } = e, c = " ".repeat(m), p = [];
233
- _ && p.push('<?xml version="1.0" encoding="UTF-8"?>'), p.push(`<${o}>`);
234
- for (const n of t) {
235
- const l = Object.entries(n).filter(([d]) => !u.includes(d));
236
- if (r === "attribute") {
237
- const d = l.map(([g, s]) => {
238
- const h = a[g] ?? g, x = s == null ? f : String(s);
239
- return `${h}="${this._escAttr(x)}"`;
178
+ const { rootTag: o = "rows", rowTag: r2 = "row", mode: s2 = "element", fieldMap: c = {}, declaration: _ = true, indent: p = 2, nullAs: d = "", excludeFields: h = [] } = e, g = " ".repeat(p), n = [];
179
+ _ && n.push('<?xml version="1.0" encoding="UTF-8"?>'), n.push(`<${o}>`);
180
+ for (const i2 of t) {
181
+ const u = Object.entries(i2).filter(([l2]) => !h.includes(l2));
182
+ if (s2 === "attribute") {
183
+ const l2 = u.map(([f, a]) => {
184
+ const m = c[f] ?? f, x = a == null ? d : String(a);
185
+ return `${m}="${this._escAttr(x)}"`;
240
186
  }).join(" ");
241
- p.push(`${c}<${i}${d ? " " + d : ""} />`);
187
+ n.push(`${g}<${r2}${l2 ? " " + l2 : ""} />`);
242
188
  } else {
243
- p.push(`${c}<${i}>`);
244
- for (const [d, g] of l) {
245
- const s = a[d] ?? d, h = g == null ? f : String(g);
246
- p.push(`${c}${c}<${s}>${this._escText(h)}</${s}>`);
189
+ n.push(`${g}<${r2}>`);
190
+ for (const [l2, f] of u) {
191
+ const a = c[l2] ?? l2, m = f == null ? d : String(f);
192
+ n.push(`${g}${g}<${a}>${this._escText(m)}</${a}>`);
247
193
  }
248
- p.push(`${c}</${i}>`);
194
+ n.push(`${g}</${r2}>`);
249
195
  }
250
196
  }
251
- return p.push(`</${o}>`), p.join(`
197
+ return n.push(`</${o}>`), n.join(`
252
198
  `);
253
199
  }
254
- // ── 3. SAP BAPI XML 응답 파싱 ────────────────────────────────
255
- /**
256
- * SAP BAPI XML 응답을 파싱하여 { header, items, returns } 구조로 반환.
257
- *
258
- * 지원 패턴:
259
- * <DOCUMENTHEADER>...</DOCUMENTHEADER>
260
- * <ACCOUNTGL><ITEM>...</ITEM></ACCOUNTGL>
261
- * <RETURN><TYPE>S</TYPE><MESSAGE>...</MESSAGE></RETURN>
262
- */
263
200
  static parseSap(t) {
264
- var m, f, u, c;
265
- const o = new DOMParser().parseFromString(t.trim(), "text/xml"), i = { header: {}, items: [], returns: [], raw: o }, r = o.getElementsByTagName("DOCUMENTHEADER")[0];
266
- if (r)
267
- for (const p of Array.from(r.children))
268
- i.header[p.tagName] = ((m = p.textContent) == null ? void 0 : m.trim()) ?? "";
269
- const a = o.getElementsByTagName("RETURN");
270
- for (const p of Array.from(a)) {
271
- const n = {};
272
- for (const l of Array.from(p.children))
273
- n[l.tagName] = ((f = l.textContent) == null ? void 0 : f.trim()) ?? "";
274
- i.returns.push(n);
201
+ var _a, _b, _c, _d;
202
+ const o = new DOMParser().parseFromString(t.trim(), "text/xml"), r2 = { header: {}, items: [], returns: [], raw: o }, s2 = o.getElementsByTagName("DOCUMENTHEADER")[0];
203
+ if (s2) for (const p of Array.from(s2.children)) r2.header[p.tagName] = ((_a = p.textContent) == null ? void 0 : _a.trim()) ?? "";
204
+ const c = o.getElementsByTagName("RETURN");
205
+ for (const p of Array.from(c)) {
206
+ const d = {};
207
+ for (const h of Array.from(p.children)) d[h.tagName] = ((_b = h.textContent) == null ? void 0 : _b.trim()) ?? "";
208
+ r2.returns.push(d);
275
209
  }
276
210
  const _ = ["ACCOUNTGL", "ACCOUNTRECEIVABLE", "ACCOUNTPAYABLE", "ITEMS"];
277
211
  for (const p of _) {
278
- const n = o.getElementsByTagName(p)[0];
279
- if (!n) continue;
280
- const l = n.getElementsByTagName("ITEM"), d = l.length > 0 ? Array.from(l) : [n];
281
- for (const g of d) {
282
- const s = {};
283
- for (const h of Array.from(g.children))
284
- s[h.tagName] = ((u = h.textContent) == null ? void 0 : u.trim()) ?? "";
285
- i.items.push(s);
212
+ const d = o.getElementsByTagName(p)[0];
213
+ if (!d) continue;
214
+ const h = d.getElementsByTagName("ITEM"), g = h.length > 0 ? Array.from(h) : [d];
215
+ for (const n of g) {
216
+ const i2 = {};
217
+ for (const u of Array.from(n.children)) i2[u.tagName] = ((_c = u.textContent) == null ? void 0 : _c.trim()) ?? "";
218
+ r2.items.push(i2);
286
219
  }
287
220
  break;
288
221
  }
289
- if (i.items.length === 0) {
290
- const p = o.documentElement, n = Array.from(p.children).filter((l) => l.hasAttribute("SEGMENT"));
291
- for (const l of n) {
292
- if (l.tagName === "EDI_DC40") continue;
293
- const d = {};
294
- for (const g of Array.from(l.children))
295
- d[g.tagName] = ((c = g.textContent) == null ? void 0 : c.trim()) ?? "";
296
- Object.keys(d).length > 0 && i.items.push(d);
222
+ if (r2.items.length === 0) {
223
+ const p = o.documentElement, d = Array.from(p.children).filter((h) => h.hasAttribute("SEGMENT"));
224
+ for (const h of d) {
225
+ if (h.tagName === "EDI_DC40") continue;
226
+ const g = {};
227
+ for (const n of Array.from(h.children)) g[n.tagName] = ((_d = n.textContent) == null ? void 0 : _d.trim()) ?? "";
228
+ Object.keys(g).length > 0 && r2.items.push(g);
297
229
  }
298
230
  }
299
- return i;
231
+ return r2;
300
232
  }
301
- // ── 4. SAP BAPI 페이로드 → XML 직렬화 ───────────────────────
302
- /**
303
- * BAPI 페이로드 객체를 SAP XML 형식으로 직렬화.
304
- * sapGenPayload()의 결과 또는 단일 document 객체를 받음.
305
- */
306
233
  static stringifySap(t) {
307
- const e = [
308
- '<?xml version="1.0" encoding="UTF-8"?>',
309
- "<BAPI_CALL>"
310
- ];
234
+ const e = ['<?xml version="1.0" encoding="UTF-8"?>', "<BAPI_CALL>"];
311
235
  if (t.BAPI_FUNCTION && e.push(` <FUNCTION>${this._escText(t.BAPI_FUNCTION)}</FUNCTION>`), t.DOCUMENTHEADER && typeof t.DOCUMENTHEADER == "object") {
312
236
  e.push(" <DOCUMENTHEADER>");
313
- for (const [i, r] of Object.entries(t.DOCUMENTHEADER))
314
- r != null && r !== "" && e.push(` <${i}>${this._escText(String(r))}</${i}>`);
237
+ for (const [r2, s2] of Object.entries(t.DOCUMENTHEADER)) s2 != null && s2 !== "" && e.push(` <${r2}>${this._escText(String(s2))}</${r2}>`);
315
238
  e.push(" </DOCUMENTHEADER>");
316
239
  }
317
- const o = Object.keys(t).find(
318
- (i) => Array.isArray(t[i]) && !i.startsWith("_")
319
- );
240
+ const o = Object.keys(t).find((r2) => Array.isArray(t[r2]) && !r2.startsWith("_"));
320
241
  if (o) {
321
242
  e.push(` <${o}>`);
322
- for (const i of t[o]) {
243
+ for (const r2 of t[o]) {
323
244
  e.push(" <ITEM>");
324
- for (const [r, a] of Object.entries(i))
325
- a != null && a !== "" && !r.startsWith("_") && e.push(` <${r}>${this._escText(String(a))}</${r}>`);
245
+ for (const [s2, c] of Object.entries(r2)) c != null && c !== "" && !s2.startsWith("_") && e.push(` <${s2}>${this._escText(String(c))}</${s2}>`);
326
246
  e.push(" </ITEM>");
327
247
  }
328
248
  e.push(` </${o}>`);
@@ -330,26 +250,17 @@ class I {
330
250
  return e.push("</BAPI_CALL>"), e.join(`
331
251
  `);
332
252
  }
333
- // ── 5. 다건 documents 배열 → XML (sapGenPayload 결과 전체) ───
334
- /**
335
- * sapGenPayload()의 { totalDocuments, documents[] } 결과를
336
- * 다건 BAPI XML로 직렬화.
337
- */
338
253
  static stringifySapBatch(t) {
339
- const e = [
340
- '<?xml version="1.0" encoding="UTF-8"?>',
341
- `<BAPI_BATCH total="${t.documents.length}">`
342
- ];
343
- return t.documents.forEach((o, i) => {
344
- e.push(` <BAPI_CALL seq="${i + 1}">`);
345
- const r = this.stringifySap(o).split(`
346
- `).filter((a) => !a.startsWith("<?xml")).map((a) => " " + a).join(`
254
+ const e = ['<?xml version="1.0" encoding="UTF-8"?>', `<BAPI_BATCH total="${t.documents.length}">`];
255
+ return t.documents.forEach((o, r2) => {
256
+ e.push(` <BAPI_CALL seq="${r2 + 1}">`);
257
+ const s2 = this.stringifySap(o).split(`
258
+ `).filter((c) => !c.startsWith("<?xml")).map((c) => " " + c).join(`
347
259
  `);
348
- e.push(r), e.push(" </BAPI_CALL>");
260
+ e.push(s2), e.push(" </BAPI_CALL>");
349
261
  }), e.push("</BAPI_BATCH>"), e.join(`
350
262
  `);
351
263
  }
352
- // ── 내부 이스케이프 헬퍼 ─────────────────────────────────────
353
264
  static _escText(t) {
354
265
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
355
266
  }
@@ -358,16 +269,19 @@ class I {
358
269
  }
359
270
  }
360
271
  export {
361
- $ as DEFAULT_ICON_ROLES,
362
- C as GridShuttle,
363
- S as IconRegistry,
272
+ D as DEFAULT_ICON_ROLES,
273
+ T as GridShuttle,
274
+ I as IconRegistry,
275
+ L as LocaleRegistry,
364
276
  O as OpenGrid,
365
277
  N as OrgChart,
366
- D as SkinRegistry,
367
- I as XmlConverter,
278
+ S as SkinRegistry,
279
+ I2 as XmlConverter,
368
280
  v as createGridShuttle,
369
- k as iconRegistry,
370
- M as renderIcon,
371
- B as skinRegistry
281
+ i as iconRegistry,
282
+ l as localeRegistry,
283
+ r as renderIcon,
284
+ s as skinRegistry,
285
+ C as t
372
286
  };
373
287
  //# sourceMappingURL=open-grid.js.map