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