open-grid 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const OpenGrid = require("./OpenGrid-B7m7ei7f.cjs");
3
+ const OpenGrid = require("./OpenGrid-BOtTt5aI.cjs"), Registry = require("./Registry-D74ZmdDz.cjs");
4
4
  class GridShuttle {
5
5
  constructor(t, e, n, o = {}) {
6
6
  this._left = t, this._right = e;
@@ -73,16 +73,16 @@ class OrgChart {
73
73
  const _ = (h) => {
74
74
  const g = h._depth * (e + n), r = h._expanded ? h.children : [];
75
75
  if (!r.length) {
76
- const f = a;
77
- return a += t + o, s.set(h._treeId, { x: f, y: g }), { minX: f, maxX: f };
76
+ const u = a;
77
+ return a += t + o, s.set(h._treeId, { x: u, y: g }), { minX: u, maxX: u };
78
78
  }
79
- let i = 1 / 0, u = -1 / 0;
80
- for (const f of r) {
81
- const { minX: c, maxX: m } = _(f);
82
- c < i && (i = c), m > u && (u = m);
79
+ let i = 1 / 0, f = -1 / 0;
80
+ for (const u of r) {
81
+ const { minX: c, maxX: m } = _(u);
82
+ c < i && (i = c), m > f && (f = m);
83
83
  }
84
- const l = i + (u - i + t) / 2 - t / 2;
85
- return s.set(h._treeId, { x: l, y: g }), { minX: i, maxX: u };
84
+ const l = i + (f - i + t) / 2 - t / 2;
85
+ return s.set(h._treeId, { x: l, y: g }), { minX: i, maxX: f };
86
86
  };
87
87
  for (const h of this._roots) _(h);
88
88
  let p = 0, d = 0;
@@ -103,8 +103,8 @@ class OrgChart {
103
103
  const h = (r) => {
104
104
  for (const i of r) {
105
105
  if (!i._expanded || !i.children.length) continue;
106
- const u = s.get(i._treeId), l = u.x + t / 2, f = u.y + e, c = f + n / 2, m = i.children;
107
- if (this._line(d, l, f, l, c), m.length > 1) {
106
+ const f = s.get(i._treeId), l = f.x + t / 2, u = f.y + e, c = u + n / 2, m = i.children;
107
+ if (this._line(d, l, u, l, c), m.length > 1) {
108
108
  const x = s.get(m[0]._treeId), y = s.get(m[m.length - 1]._treeId);
109
109
  this._line(d, x.x + t / 2, c, y.x + t / 2, c);
110
110
  }
@@ -118,12 +118,12 @@ class OrgChart {
118
118
  h(this._roots), p.appendChild(d);
119
119
  const g = (r) => {
120
120
  for (const i of r) {
121
- const u = s.get(i._treeId);
122
- if (!u) continue;
121
+ const f = s.get(i._treeId);
122
+ if (!f) continue;
123
123
  const l = document.createElement("div");
124
- l.className = "og-orgchart-node", i._hasChildren && l.classList.add("og-orgchart-node--branch"), i._expanded && l.classList.add("og-orgchart-node--expanded"), this._selectedId === i._treeId && l.classList.add("og-orgchart-node--selected"), l.style.cssText = `left:${u.x}px;top:${u.y}px;width:${t}px;height:${e}px;`;
125
- const f = document.createElement("div");
126
- f.className = "og-orgchart-node-content";
124
+ l.className = "og-orgchart-node", i._hasChildren && l.classList.add("og-orgchart-node--branch"), i._expanded && l.classList.add("og-orgchart-node--expanded"), this._selectedId === i._treeId && l.classList.add("og-orgchart-node--selected"), l.style.cssText = `left:${f.x}px;top:${f.y}px;width:${t}px;height:${e}px;`;
125
+ const u = document.createElement("div");
126
+ u.className = "og-orgchart-node-content";
127
127
  for (const c of o) {
128
128
  const m = i.data[c.field], x = document.createElement("div");
129
129
  if (x.className = "og-orgchart-col" + (c.className ? " " + c.className : ""), c.style) {
@@ -134,9 +134,9 @@ class OrgChart {
134
134
  const y = c.renderer(m, i.data);
135
135
  typeof y == "string" ? x.innerHTML = y : x.appendChild(y);
136
136
  } else x.textContent = m ?? "";
137
- f.appendChild(x);
137
+ u.appendChild(x);
138
138
  }
139
- if (l.appendChild(f), i._hasChildren) {
139
+ if (l.appendChild(u), i._hasChildren) {
140
140
  const c = document.createElement("button");
141
141
  c.type = "button", c.className = "og-orgchart-toggle", c.setAttribute("aria-expanded", i._expanded ? "true" : "false"), c.setAttribute("aria-label", OpenGrid.t(i._expanded ? "tree.collapse" : "tree.expand"));
142
142
  const m = document.createElement("i");
@@ -162,16 +162,16 @@ class XmlConverter {
162
162
  d || (d = ((_c = (_b = e.rootTag ? a.querySelector(e.rootTag) : p) == null ? void 0 : _b.children[0]) == null ? void 0 : _c.tagName) ?? "row");
163
163
  const h = a.getElementsByTagName(d), g = [];
164
164
  for (let r = 0; r < h.length; r++) {
165
- const i = h[r], u = {};
165
+ const i = h[r], f = {};
166
166
  for (const l of Array.from(i.attributes)) {
167
- const f = n[l.name] ?? l.name;
168
- u[f] = o ? l.value.trim() : l.value;
167
+ const u = n[l.name] ?? l.name;
168
+ f[u] = o ? l.value.trim() : l.value;
169
169
  }
170
170
  for (const l of Array.from(i.children)) {
171
- const f = n[l.tagName] ?? l.tagName, c = l.textContent ?? "";
172
- u[f] = o ? c.trim() : c;
171
+ const u = n[l.tagName] ?? l.tagName, c = l.textContent ?? "";
172
+ f[u] = o ? c.trim() : c;
173
173
  }
174
- g.push(u);
174
+ g.push(f);
175
175
  }
176
176
  return g;
177
177
  }
@@ -179,17 +179,17 @@ class XmlConverter {
179
179
  const { rootTag: n = "rows", rowTag: o = "row", mode: s = "element", fieldMap: a = {}, declaration: _ = true, indent: p = 2, nullAs: d = "", excludeFields: h = [] } = e, g = " ".repeat(p), r = [];
180
180
  _ && r.push('<?xml version="1.0" encoding="UTF-8"?>'), r.push(`<${n}>`);
181
181
  for (const i of t) {
182
- const u = Object.entries(i).filter(([l]) => !h.includes(l));
182
+ const f = Object.entries(i).filter(([l]) => !h.includes(l));
183
183
  if (s === "attribute") {
184
- const l = u.map(([f, c]) => {
185
- const m = a[f] ?? f, x = c == null ? d : String(c);
184
+ const l = f.map(([u, c]) => {
185
+ const m = a[u] ?? u, x = c == null ? d : String(c);
186
186
  return `${m}="${this._escAttr(x)}"`;
187
187
  }).join(" ");
188
188
  r.push(`${g}<${o}${l ? " " + l : ""} />`);
189
189
  } else {
190
190
  r.push(`${g}<${o}>`);
191
- for (const [l, f] of u) {
192
- const c = a[l] ?? l, m = f == null ? d : String(f);
191
+ for (const [l, u] of f) {
192
+ const c = a[l] ?? l, m = u == null ? d : String(u);
193
193
  r.push(`${g}${g}<${c}>${this._escText(m)}</${c}>`);
194
194
  }
195
195
  r.push(`${g}</${o}>`);
@@ -215,7 +215,7 @@ class XmlConverter {
215
215
  const h = d.getElementsByTagName("ITEM"), g = h.length > 0 ? Array.from(h) : [d];
216
216
  for (const r of g) {
217
217
  const i = {};
218
- for (const u of Array.from(r.children)) i[u.tagName] = ((_c = u.textContent) == null ? void 0 : _c.trim()) ?? "";
218
+ for (const f of Array.from(r.children)) i[f.tagName] = ((_c = f.textContent) == null ? void 0 : _c.trim()) ?? "";
219
219
  o.items.push(i);
220
220
  }
221
221
  break;
@@ -269,5 +269,5 @@ class XmlConverter {
269
269
  return this._escText(t).replace(/"/g, "&quot;").replace(/'/g, "&apos;");
270
270
  }
271
271
  }
272
- exports.DEFAULT_ICON_ROLES = OpenGrid.DEFAULT_ICON_ROLES, exports.IconRegistry = OpenGrid.IconRegistry, exports.LocaleRegistry = OpenGrid.LocaleRegistry, exports.OpenGrid = OpenGrid.OpenGrid, exports.SkinRegistry = OpenGrid.SkinRegistry, exports.iconRegistry = OpenGrid.iconRegistry, exports.localeRegistry = OpenGrid.localeRegistry, exports.renderIcon = OpenGrid.renderIcon, exports.skinRegistry = OpenGrid.skinRegistry, exports.t = OpenGrid.t, exports.GridShuttle = GridShuttle, exports.OrgChart = OrgChart, exports.XmlConverter = XmlConverter, exports.createGridShuttle = createGridShuttle;
272
+ exports.DEFAULT_ICON_ROLES = OpenGrid.DEFAULT_ICON_ROLES, exports.IconRegistry = OpenGrid.IconRegistry, exports.LocaleRegistry = OpenGrid.LocaleRegistry, exports.OpenGrid = OpenGrid.OpenGrid, exports.SkinRegistry = OpenGrid.SkinRegistry, exports.iconRegistry = OpenGrid.iconRegistry, exports.localeRegistry = OpenGrid.localeRegistry, exports.renderIcon = OpenGrid.renderIcon, exports.skinRegistry = OpenGrid.skinRegistry, exports.t = OpenGrid.t, exports.RESERVED_PREFIXES = Registry.RESERVED_PREFIXES, exports.TypedRegistry = Registry.TypedRegistry, exports.isReserved = Registry.isReserved, exports.GridShuttle = GridShuttle, exports.OrgChart = OrgChart, exports.XmlConverter = XmlConverter, exports.createGridShuttle = createGridShuttle;
273
273
  //# sourceMappingURL=open-grid.cjs.map
package/dist/open-grid.js CHANGED
@@ -1,10 +1,11 @@
1
- import { b, t as C } from "./OpenGrid-CeUdO_fM.js";
2
- import { D, I, L, O, S, i, l, r, s } from "./OpenGrid-CeUdO_fM.js";
3
- class T {
4
- constructor(t, e, o, r2 = {}) {
1
+ import { b, t as T } from "./OpenGrid-sI_vdHQw.js";
2
+ import { D, I, L, O, S, i, l, r, s } from "./OpenGrid-sI_vdHQw.js";
3
+ import { R, T as T2, i as i2 } from "./Registry-CPJYOqCn.js";
4
+ class C {
5
+ constructor(t, e, r2, o = {}) {
5
6
  this._left = t, this._right = e;
6
7
  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
+ s2.className = "og-shuttle", s2.style.cssText = `display:flex;gap:6px;align-items:center;justify-content:center;flex-direction:${o.layout === "horizontal" ? "row" : "column"};`;
8
9
  const c = (d, h, g) => {
9
10
  const n = document.createElement("button");
10
11
  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", () => {
@@ -12,27 +13,27 @@ class T {
12
13
  }), n.addEventListener("mouseout", () => {
13
14
  n.style.background = "#fff", n.style.borderColor = "#bbb";
14
15
  }), n.addEventListener("click", g), n;
15
- }, _ = r2.labels ?? {}, p = (d) => this._left.t(d);
16
+ }, _ = o.labels ?? {}, p = (d) => this._left.t(d);
16
17
  s2.appendChild(c(_.toRight ?? "▶", p("shuttle.toRight"), () => {
17
18
  this._left.moveCheckedTo(this._right);
18
19
  })), s2.appendChild(c(_.toLeft ?? "◀", p("shuttle.toLeft"), () => {
19
20
  this._right.moveCheckedTo(this._left);
20
- })), r2.includeAll && (s2.appendChild(c(_.allRight ?? "⏩", p("shuttle.allRight"), () => {
21
+ })), o.includeAll && (s2.appendChild(c(_.allRight ?? "⏩", p("shuttle.allRight"), () => {
21
22
  this._moveAll(this._left, this._right);
22
23
  })), s2.appendChild(c(_.allLeft ?? "⏪", p("shuttle.allLeft"), () => {
23
24
  this._moveAll(this._right, this._left);
24
- }))), o.appendChild(s2), this._el = s2;
25
+ }))), r2.appendChild(s2), this._el = s2;
25
26
  }
26
27
  _moveAll(t, e) {
27
- const o = t.getData().length;
28
- o > 0 && t.moveRowsTo(e, Array.from({ length: o }, (r2, s2) => s2));
28
+ const r2 = t.getData().length;
29
+ r2 > 0 && t.moveRowsTo(e, Array.from({ length: r2 }, (o, s2) => s2));
29
30
  }
30
31
  destroy() {
31
32
  this._el.remove();
32
33
  }
33
34
  }
34
- function v(E, t, e, o) {
35
- return new T(E, t, e, o);
35
+ function v(E, t, e, r2) {
36
+ return new C(E, t, e, r2);
36
37
  }
37
38
  class N {
38
39
  constructor(t, e) {
@@ -41,8 +42,8 @@ class N {
41
42
  }
42
43
  setData(t) {
43
44
  this._data = t;
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();
45
+ const { idField: e, parentIdField: r2, expandOnLoad: o } = this._opts;
46
+ o && this._expandedKeys.size === 0 && t.forEach((s2) => this._expandedKeys.add(s2[e])), this._roots = b(t, { idField: e, parentIdField: r2 }, this._expandedKeys), this._render();
46
47
  }
47
48
  setTheme(t) {
48
49
  this._container.setAttribute("data-og-theme", t);
@@ -52,7 +53,7 @@ class N {
52
53
  }
53
54
  expandAll() {
54
55
  const t = (e) => {
55
- for (const o of e) this._expandedKeys.add(o._treeId), o.children.length && t(o.children);
56
+ for (const r2 of e) this._expandedKeys.add(r2._treeId), r2.children.length && t(r2.children);
56
57
  };
57
58
  t(this._roots), this._rebuild();
58
59
  }
@@ -67,42 +68,42 @@ class N {
67
68
  this._roots = b(this._data, { idField: t, parentIdField: e }, this._expandedKeys), this._render();
68
69
  }
69
70
  _calcLayout() {
70
- const { nodeWidth: t, nodeHeight: e, levelGap: o, siblingGap: r2 } = this._opts, s2 = /* @__PURE__ */ new Map();
71
+ const { nodeWidth: t, nodeHeight: e, levelGap: r2, siblingGap: o } = this._opts, s2 = /* @__PURE__ */ new Map();
71
72
  let c = 0;
72
73
  const _ = (h) => {
73
- const g = h._depth * (e + o), n = h._expanded ? h.children : [];
74
+ const g = h._depth * (e + r2), n = h._expanded ? h.children : [];
74
75
  if (!n.length) {
75
76
  const f = c;
76
- return c += t + r2, s2.set(h._treeId, { x: f, y: g }), { minX: f, maxX: f };
77
+ return c += t + o, s2.set(h._treeId, { x: f, y: g }), { minX: f, maxX: f };
77
78
  }
78
- let i2 = 1 / 0, u = -1 / 0;
79
+ let i3 = 1 / 0, u = -1 / 0;
79
80
  for (const f of n) {
80
81
  const { minX: a, maxX: m } = _(f);
81
- a < i2 && (i2 = a), m > u && (u = m);
82
+ a < i3 && (i3 = a), m > u && (u = m);
82
83
  }
83
- const l2 = i2 + (u - i2 + t) / 2 - t / 2;
84
- return s2.set(h._treeId, { x: l2, y: g }), { minX: i2, maxX: u };
84
+ const l2 = i3 + (u - i3 + t) / 2 - t / 2;
85
+ return s2.set(h._treeId, { x: l2, y: g }), { minX: i3, maxX: u };
85
86
  };
86
87
  for (const h of this._roots) _(h);
87
88
  let p = 0, d = 0;
88
89
  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 };
90
+ return { layout: s2, totalW: p + o, totalH: d + r2 + 16 };
90
91
  }
91
- _line(t, e, o, r2, s2) {
92
+ _line(t, e, r2, o, s2) {
92
93
  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);
94
+ c.setAttribute("x1", String(e)), c.setAttribute("y1", String(r2)), c.setAttribute("x2", String(o)), c.setAttribute("y2", String(s2)), c.setAttribute("class", "og-orgchart-line"), t.appendChild(c);
94
95
  }
95
96
  _render() {
96
- const { nodeWidth: t, nodeHeight: e, levelGap: o, columns: r2 } = this._opts, { layout: s2, totalW: c, totalH: _ } = this._calcLayout();
97
+ const { nodeWidth: t, nodeHeight: e, levelGap: r2, columns: o } = this._opts, { layout: s2, totalW: c, totalH: _ } = this._calcLayout();
97
98
  this._container.innerHTML = "";
98
99
  const p = document.createElement("div");
99
100
  p.className = "og-orgchart-wrap", p.style.cssText = `width:${c}px;height:${_}px;`;
100
101
  const d = document.createElementNS("http://www.w3.org/2000/svg", "svg");
101
102
  d.setAttribute("width", String(c)), d.setAttribute("height", String(_)), d.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";
102
103
  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;
104
+ for (const i3 of n) {
105
+ if (!i3._expanded || !i3.children.length) continue;
106
+ const u = s2.get(i3._treeId), l2 = u.x + t / 2, f = u.y + e, a = f + r2 / 2, m = i3.children;
106
107
  if (this._line(d, l2, f, l2, a), m.length > 1) {
107
108
  const x = s2.get(m[0]._treeId), y = s2.get(m[m.length - 1]._treeId);
108
109
  this._line(d, x.x + t / 2, a, y.x + t / 2, a);
@@ -116,36 +117,36 @@ class N {
116
117
  };
117
118
  h(this._roots), p.appendChild(d);
118
119
  const g = (n) => {
119
- for (const i2 of n) {
120
- const u = s2.get(i2._treeId);
120
+ for (const i3 of n) {
121
+ const u = s2.get(i3._treeId);
121
122
  if (!u) continue;
122
123
  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
+ l2.className = "og-orgchart-node", i3._hasChildren && l2.classList.add("og-orgchart-node--branch"), i3._expanded && l2.classList.add("og-orgchart-node--expanded"), this._selectedId === i3._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
125
  const f = document.createElement("div");
125
126
  f.className = "og-orgchart-node-content";
126
- for (const a of r2) {
127
- const m = i2.data[a.field], x = document.createElement("div");
127
+ for (const a of o) {
128
+ const m = i3.data[a.field], x = document.createElement("div");
128
129
  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;
130
+ const y = typeof a.style == "function" ? a.style(m, i3.data) : a.style;
130
131
  x.setAttribute("style", y);
131
132
  }
132
133
  if (a.renderer) {
133
- const y = a.renderer(m, i2.data);
134
+ const y = a.renderer(m, i3.data);
134
135
  typeof y == "string" ? x.innerHTML = y : x.appendChild(y);
135
136
  } else x.textContent = m ?? "";
136
137
  f.appendChild(x);
137
138
  }
138
- if (l2.appendChild(f), i2._hasChildren) {
139
+ if (l2.appendChild(f), i3._hasChildren) {
139
140
  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
+ a.type = "button", a.className = "og-orgchart-toggle", a.setAttribute("aria-expanded", i3._expanded ? "true" : "false"), a.setAttribute("aria-label", T(i3._expanded ? "tree.collapse" : "tree.expand"));
141
142
  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);
143
+ m.setAttribute("aria-hidden", "true"), m.className = i3._expanded ? "bi bi-dash-circle" : "bi bi-plus-circle", a.appendChild(m), a.addEventListener("click", (x) => {
144
+ x.stopPropagation(), this._toggle(i3._treeId);
144
145
  }), l2.appendChild(a);
145
146
  }
146
147
  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);
148
+ this._selectedId = i3._treeId, this._opts.onNodeClick(i3._treeId, i3.data), this._container.querySelectorAll(".og-orgchart-node--selected").forEach((a) => a.classList.remove("og-orgchart-node--selected")), l2.classList.add("og-orgchart-node--selected");
149
+ }), p.appendChild(l2), i3._expanded && i3.children.length && g(i3.children);
149
150
  }
150
151
  };
151
152
  g(this._roots), this._container.appendChild(p);
@@ -154,107 +155,107 @@ class N {
154
155
  class I2 {
155
156
  static parse(t, e = {}) {
156
157
  var _a, _b, _c;
157
- const { fieldMap: o = {}, trim: r2 = true } = e, c = new DOMParser().parseFromString(t.trim(), "text/xml"), _ = c.querySelector("parsererror");
158
+ const { fieldMap: r2 = {}, trim: o = true } = e, c = new DOMParser().parseFromString(t.trim(), "text/xml"), _ = c.querySelector("parsererror");
158
159
  if (_) throw new Error(`XML 파싱 오류: ${(_a = _.textContent) == null ? void 0 : _a.trim()}`);
159
160
  const p = c.documentElement;
160
161
  let d = e.rowTag;
161
162
  d || (d = ((_c = (_b = e.rootTag ? c.querySelector(e.rootTag) : p) == null ? void 0 : _b.children[0]) == null ? void 0 : _c.tagName) ?? "row");
162
163
  const h = c.getElementsByTagName(d), g = [];
163
164
  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;
165
+ const i3 = h[n], u = {};
166
+ for (const l2 of Array.from(i3.attributes)) {
167
+ const f = r2[l2.name] ?? l2.name;
168
+ u[f] = o ? l2.value.trim() : l2.value;
168
169
  }
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;
170
+ for (const l2 of Array.from(i3.children)) {
171
+ const f = r2[l2.tagName] ?? l2.tagName, a = l2.textContent ?? "";
172
+ u[f] = o ? a.trim() : a;
172
173
  }
173
174
  g.push(u);
174
175
  }
175
176
  return g;
176
177
  }
177
178
  static stringify(t, e = {}) {
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));
179
+ const { rootTag: r2 = "rows", rowTag: o = "row", mode: s2 = "element", fieldMap: c = {}, declaration: _ = true, indent: p = 2, nullAs: d = "", excludeFields: h = [] } = e, g = " ".repeat(p), n = [];
180
+ _ && n.push('<?xml version="1.0" encoding="UTF-8"?>'), n.push(`<${r2}>`);
181
+ for (const i3 of t) {
182
+ const u = Object.entries(i3).filter(([l2]) => !h.includes(l2));
182
183
  if (s2 === "attribute") {
183
184
  const l2 = u.map(([f, a]) => {
184
185
  const m = c[f] ?? f, x = a == null ? d : String(a);
185
186
  return `${m}="${this._escAttr(x)}"`;
186
187
  }).join(" ");
187
- n.push(`${g}<${r2}${l2 ? " " + l2 : ""} />`);
188
+ n.push(`${g}<${o}${l2 ? " " + l2 : ""} />`);
188
189
  } else {
189
- n.push(`${g}<${r2}>`);
190
+ n.push(`${g}<${o}>`);
190
191
  for (const [l2, f] of u) {
191
192
  const a = c[l2] ?? l2, m = f == null ? d : String(f);
192
193
  n.push(`${g}${g}<${a}>${this._escText(m)}</${a}>`);
193
194
  }
194
- n.push(`${g}</${r2}>`);
195
+ n.push(`${g}</${o}>`);
195
196
  }
196
197
  }
197
- return n.push(`</${o}>`), n.join(`
198
+ return n.push(`</${r2}>`), n.join(`
198
199
  `);
199
200
  }
200
201
  static parseSap(t) {
201
202
  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");
203
+ const r2 = new DOMParser().parseFromString(t.trim(), "text/xml"), o = { header: {}, items: [], returns: [], raw: r2 }, s2 = r2.getElementsByTagName("DOCUMENTHEADER")[0];
204
+ if (s2) for (const p of Array.from(s2.children)) o.header[p.tagName] = ((_a = p.textContent) == null ? void 0 : _a.trim()) ?? "";
205
+ const c = r2.getElementsByTagName("RETURN");
205
206
  for (const p of Array.from(c)) {
206
207
  const d = {};
207
208
  for (const h of Array.from(p.children)) d[h.tagName] = ((_b = h.textContent) == null ? void 0 : _b.trim()) ?? "";
208
- r2.returns.push(d);
209
+ o.returns.push(d);
209
210
  }
210
211
  const _ = ["ACCOUNTGL", "ACCOUNTRECEIVABLE", "ACCOUNTPAYABLE", "ITEMS"];
211
212
  for (const p of _) {
212
- const d = o.getElementsByTagName(p)[0];
213
+ const d = r2.getElementsByTagName(p)[0];
213
214
  if (!d) continue;
214
215
  const h = d.getElementsByTagName("ITEM"), g = h.length > 0 ? Array.from(h) : [d];
215
216
  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);
217
+ const i3 = {};
218
+ for (const u of Array.from(n.children)) i3[u.tagName] = ((_c = u.textContent) == null ? void 0 : _c.trim()) ?? "";
219
+ o.items.push(i3);
219
220
  }
220
221
  break;
221
222
  }
222
- if (r2.items.length === 0) {
223
- const p = o.documentElement, d = Array.from(p.children).filter((h) => h.hasAttribute("SEGMENT"));
223
+ if (o.items.length === 0) {
224
+ const p = r2.documentElement, d = Array.from(p.children).filter((h) => h.hasAttribute("SEGMENT"));
224
225
  for (const h of d) {
225
226
  if (h.tagName === "EDI_DC40") continue;
226
227
  const g = {};
227
228
  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);
229
+ Object.keys(g).length > 0 && o.items.push(g);
229
230
  }
230
231
  }
231
- return r2;
232
+ return o;
232
233
  }
233
234
  static stringifySap(t) {
234
235
  const e = ['<?xml version="1.0" encoding="UTF-8"?>', "<BAPI_CALL>"];
235
236
  if (t.BAPI_FUNCTION && e.push(` <FUNCTION>${this._escText(t.BAPI_FUNCTION)}</FUNCTION>`), t.DOCUMENTHEADER && typeof t.DOCUMENTHEADER == "object") {
236
237
  e.push(" <DOCUMENTHEADER>");
237
- for (const [r2, s2] of Object.entries(t.DOCUMENTHEADER)) s2 != null && s2 !== "" && e.push(` <${r2}>${this._escText(String(s2))}</${r2}>`);
238
+ for (const [o, s2] of Object.entries(t.DOCUMENTHEADER)) s2 != null && s2 !== "" && e.push(` <${o}>${this._escText(String(s2))}</${o}>`);
238
239
  e.push(" </DOCUMENTHEADER>");
239
240
  }
240
- const o = Object.keys(t).find((r2) => Array.isArray(t[r2]) && !r2.startsWith("_"));
241
- if (o) {
242
- e.push(` <${o}>`);
243
- for (const r2 of t[o]) {
241
+ const r2 = Object.keys(t).find((o) => Array.isArray(t[o]) && !o.startsWith("_"));
242
+ if (r2) {
243
+ e.push(` <${r2}>`);
244
+ for (const o of t[r2]) {
244
245
  e.push(" <ITEM>");
245
- for (const [s2, c] of Object.entries(r2)) c != null && c !== "" && !s2.startsWith("_") && e.push(` <${s2}>${this._escText(String(c))}</${s2}>`);
246
+ for (const [s2, c] of Object.entries(o)) c != null && c !== "" && !s2.startsWith("_") && e.push(` <${s2}>${this._escText(String(c))}</${s2}>`);
246
247
  e.push(" </ITEM>");
247
248
  }
248
- e.push(` </${o}>`);
249
+ e.push(` </${r2}>`);
249
250
  }
250
251
  return e.push("</BAPI_CALL>"), e.join(`
251
252
  `);
252
253
  }
253
254
  static stringifySapBatch(t) {
254
255
  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(`
256
+ return t.documents.forEach((r2, o) => {
257
+ e.push(` <BAPI_CALL seq="${o + 1}">`);
258
+ const s2 = this.stringifySap(r2).split(`
258
259
  `).filter((c) => !c.startsWith("<?xml")).map((c) => " " + c).join(`
259
260
  `);
260
261
  e.push(s2), e.push(" </BAPI_CALL>");
@@ -270,18 +271,21 @@ class I2 {
270
271
  }
271
272
  export {
272
273
  D as DEFAULT_ICON_ROLES,
273
- T as GridShuttle,
274
+ C as GridShuttle,
274
275
  I as IconRegistry,
275
276
  L as LocaleRegistry,
276
277
  O as OpenGrid,
277
278
  N as OrgChart,
279
+ R as RESERVED_PREFIXES,
278
280
  S as SkinRegistry,
281
+ T2 as TypedRegistry,
279
282
  I2 as XmlConverter,
280
283
  v as createGridShuttle,
281
284
  i as iconRegistry,
285
+ i2 as isReserved,
282
286
  l as localeRegistry,
283
287
  r as renderIcon,
284
288
  s as skinRegistry,
285
- C as t
289
+ T as t
286
290
  };
287
291
  //# sourceMappingURL=open-grid.js.map