open-grid 1.2.0 → 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 (54) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -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 +177 -266
  11. package/dist/types/core/CellEditManager.d.ts +73 -0
  12. package/dist/types/core/CellEventHandler.d.ts +99 -2
  13. package/dist/types/core/ChartManager.d.ts +51 -3
  14. package/dist/types/core/ContextMenu.d.ts +43 -2
  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 +106 -15
  18. package/dist/types/core/ExportManager.d.ts +66 -1
  19. package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
  20. package/dist/types/core/FilterPanel.d.ts +17 -2
  21. package/dist/types/core/FilterSelect.d.ts +37 -13
  22. package/dist/types/core/FindBarManager.d.ts +26 -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 +139 -10
  26. package/dist/types/core/GridComposer.d.ts +54 -6
  27. package/dist/types/core/GridShuttle.d.ts +44 -4
  28. package/dist/types/core/GroupTreeManager.d.ts +86 -2
  29. package/dist/types/core/IconRegistry.d.ts +56 -9
  30. package/dist/types/core/KeyboardManager.d.ts +88 -4
  31. package/dist/types/core/MaskingEngine.d.ts +10 -9
  32. package/dist/types/core/MutationService.d.ts +113 -10
  33. package/dist/types/core/OrgChart.d.ts +56 -1
  34. package/dist/types/core/OverrideKernel.d.ts +59 -15
  35. package/dist/types/core/Pagination.d.ts +38 -4
  36. package/dist/types/core/RangeSelectionManager.d.ts +121 -7
  37. package/dist/types/core/RenderController.d.ts +56 -0
  38. package/dist/types/core/RowManager.d.ts +55 -0
  39. package/dist/types/core/SkinRegistry.d.ts +51 -15
  40. package/dist/types/core/SortFilterManager.d.ts +80 -1
  41. package/dist/types/core/TriggerManager.d.ts +46 -0
  42. package/dist/types/core/WorksheetManager.d.ts +61 -2
  43. package/dist/types/core/XmlConverter.d.ts +56 -23
  44. package/dist/types/core/chart/types.d.ts +107 -10
  45. package/dist/types/core/editors/CellEditor.d.ts +29 -2
  46. package/dist/types/core/formula/types.d.ts +71 -8
  47. package/dist/types/core/range/RangeQuery.d.ts +24 -2
  48. package/dist/types/core/renderers/CellRenderer.d.ts +100 -8
  49. package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
  50. package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
  51. package/package.json +2 -1
  52. package/dist/OpenGrid-B0Spm0rU.js +0 -10404
  53. package/dist/OpenGrid-CuXj0isp.cjs +0 -97
  54. package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
@@ -1,2 +1,28 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),r=require("react"),D=require("./OpenGrid-CuXj0isp.cjs");function M({data:e,columns:t,height:u=400,width:s="100%",editable:l=!1,sortable:O=!0,filterable:o=!0,rowNumber:x=!1,checkColumn:y=!1,stateColumn:R=!1,draggable:G=!1,frozenColumns:j=0,theme:f="default",options:P,style:W,className:z,onReady:c,onDataChange:b,onCellClick:q,onRowClick:S,onEditEnd:d,onSortChange:v,onFilterChange:E,onRowDrop:T}){const i=r.useRef(null),n=r.useRef(null),A={height:typeof u=="number"?`${u}px`:u,width:typeof s=="number"?`${s}px`:s,display:"block",boxSizing:"border-box",...W};return r.useEffect(()=>{if(!i.current)return;const B={columns:t,height:"100%",width:"100%",editable:l,sortable:O,filterable:o,rowNumber:x,checkColumn:y,stateColumn:R,draggable:G,frozenColumns:j,theme:f,...P,onReady:p=>{n.current=p,e!=null&&e.length&&p.setData(e),c==null||c(p)},...b&&{onDataChange:b},...q&&{onCellClick:q},...S&&{onRowClick:S},...d&&{onEditEnd:d},...v&&{onSortChange:v},...E&&{onFilterChange:E},...T&&{onRowDrop:T}},$=new D.OpenGrid(i.current,B);return n.current=$,()=>{$.destroy(),n.current=null}},[t,l,O,o,x,y,R,G,j]),r.useEffect(()=>{n.current&&e&&n.current.setData(e)},[e]),r.useEffect(()=>{n.current&&n.current.setTheme(f)},[f]),g.jsx("div",{ref:i,style:A,className:z})}const H=r.forwardRef((e,t)=>{r.useRef(null);const u=r.useRef(null);return r.useEffect(()=>{u.current&&t&&(typeof t=="function"?t(u.current):t.current=u.current)}),g.jsx(M,{...e})});H.displayName="OpenGrid";exports.OpenGrid=M;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime"), React = require("react"), OpenGrid = require("./OpenGrid-0r_543Kj.cjs");
4
+ function OpenGridReact({ data: e, columns: r, height: t = 400, width: u = "100%", editable: i = false, sortable: p = true, filterable: o = true, rowNumber: l = false, checkColumn: d = false, stateColumn: y = false, draggable: R = false, frozenColumns: x = 0, theme: s = "default", options: E, style: T, className: $, onReady: g, onDataChange: O, onCellClick: G, onRowClick: j, onEditEnd: a, onSortChange: b, onFilterChange: q, onRowDrop: S }) {
5
+ const c = React.useRef(null), n = React.useRef(null), M = { height: typeof t == "number" ? `${t}px` : t, width: typeof u == "number" ? `${u}px` : u, display: "block", boxSizing: "border-box", ...T };
6
+ return React.useEffect(() => {
7
+ if (!c.current) return;
8
+ const P = { columns: r, height: "100%", width: "100%", editable: i, sortable: p, filterable: o, rowNumber: l, checkColumn: d, stateColumn: y, draggable: R, frozenColumns: x, theme: s, ...E, onReady: (f) => {
9
+ n.current = f, (e == null ? void 0 : e.length) && f.setData(e), g == null ? void 0 : g(f);
10
+ }, ...O && { onDataChange: O }, ...G && { onCellClick: G }, ...j && { onRowClick: j }, ...a && { onEditEnd: a }, ...b && { onSortChange: b }, ...q && { onFilterChange: q }, ...S && { onRowDrop: S } }, v = new OpenGrid.OpenGrid(c.current, P);
11
+ return n.current = v, () => {
12
+ v.destroy(), n.current = null;
13
+ };
14
+ }, [r, i, p, o, l, d, y, R, x]), React.useEffect(() => {
15
+ n.current && e && n.current.setData(e);
16
+ }, [e]), React.useEffect(() => {
17
+ n.current && n.current.setTheme(s);
18
+ }, [s]), jsxRuntime.jsx("div", { ref: c, style: M, className: $ });
19
+ }
20
+ const OpenGridWithRef = React.forwardRef((e, r) => {
21
+ React.useRef(null);
22
+ const t = React.useRef(null);
23
+ return React.useEffect(() => {
24
+ t.current && r && (typeof r == "function" ? r(t.current) : r.current = t.current);
25
+ }), jsxRuntime.jsx(OpenGridReact, { ...e });
26
+ });
27
+ OpenGridWithRef.displayName = "OpenGrid", exports.OpenGrid = OpenGridReact;
2
28
  //# sourceMappingURL=open-grid-react.cjs.map
@@ -1,91 +1,31 @@
1
- import { jsx as A } from "react/jsx-runtime";
2
- import K, { useRef as f, useEffect as u } from "react";
3
- import { O as L } from "./OpenGrid-B0Spm0rU.js";
4
- function M({
5
- data: r,
6
- columns: e,
7
- height: t = 400,
8
- width: c = "100%",
9
- editable: o = !1,
10
- sortable: O = !0,
11
- filterable: x = !0,
12
- rowNumber: y = !1,
13
- checkColumn: G = !1,
14
- stateColumn: m = !1,
15
- draggable: R = !1,
16
- frozenColumns: $ = 0,
17
- theme: s = "default",
18
- options: B,
19
- style: D,
20
- className: H,
21
- onReady: i,
22
- onDataChange: b,
23
- onCellClick: j,
24
- onRowClick: v,
25
- onEditEnd: S,
26
- onSortChange: T,
27
- onFilterChange: W,
28
- onRowDrop: q
29
- }) {
30
- const p = f(null), n = f(null), I = {
31
- height: typeof t == "number" ? `${t}px` : t,
32
- width: typeof c == "number" ? `${c}px` : c,
33
- display: "block",
34
- boxSizing: "border-box",
35
- ...D
36
- };
37
- return u(() => {
38
- if (!p.current) return;
39
- const J = {
40
- columns: e,
41
- height: "100%",
42
- width: "100%",
43
- editable: o,
44
- sortable: O,
45
- filterable: x,
46
- rowNumber: y,
47
- checkColumn: G,
48
- stateColumn: m,
49
- draggable: R,
50
- frozenColumns: $,
51
- theme: s,
52
- ...B,
53
- onReady: (l) => {
54
- n.current = l, r != null && r.length && l.setData(r), i == null || i(l);
55
- },
56
- ...b && { onDataChange: b },
57
- ...j && { onCellClick: j },
58
- ...v && { onRowClick: v },
59
- ...S && { onEditEnd: S },
60
- ...T && { onSortChange: T },
61
- ...W && { onFilterChange: W },
62
- ...q && { onRowDrop: q }
63
- }, z = new L(p.current, J);
64
- return n.current = z, () => {
65
- z.destroy(), n.current = null;
1
+ import { jsx as W } from "react/jsx-runtime";
2
+ import J, { useRef as u, useEffect as f } from "react";
3
+ import { O as K } from "./OpenGrid-HmhGVC2V.js";
4
+ function q({ data: r, columns: e, height: t = 400, width: c = "100%", editable: o = false, sortable: l = true, filterable: y = true, rowNumber: d = false, checkColumn: O = false, stateColumn: R = false, draggable: x = false, frozenColumns: G = 0, theme: s = "default", options: z, style: A, className: B, onReady: D, onDataChange: m, onCellClick: a, onRowClick: $, onEditEnd: b, onSortChange: j, onFilterChange: v, onRowDrop: S }) {
5
+ const i = u(null), n = u(null), H = { height: typeof t == "number" ? `${t}px` : t, width: typeof c == "number" ? `${c}px` : c, display: "block", boxSizing: "border-box", ...A };
6
+ return f(() => {
7
+ if (!i.current) return;
8
+ const I = { columns: e, height: "100%", width: "100%", editable: o, sortable: l, filterable: y, rowNumber: d, checkColumn: O, stateColumn: R, draggable: x, frozenColumns: G, theme: s, ...z, onReady: (p) => {
9
+ n.current = p, (r == null ? void 0 : r.length) && p.setData(r), D == null ? void 0 : D(p);
10
+ }, ...m && { onDataChange: m }, ...a && { onCellClick: a }, ...$ && { onRowClick: $ }, ...b && { onEditEnd: b }, ...j && { onSortChange: j }, ...v && { onFilterChange: v }, ...S && { onRowDrop: S } }, T = new K(i.current, I);
11
+ return n.current = T, () => {
12
+ T.destroy(), n.current = null;
66
13
  };
67
- }, [e, o, O, x, y, G, m, R, $]), u(() => {
14
+ }, [e, o, l, y, d, O, R, x, G]), f(() => {
68
15
  n.current && r && n.current.setData(r);
69
- }, [r]), u(() => {
16
+ }, [r]), f(() => {
70
17
  n.current && n.current.setTheme(s);
71
- }, [s]), /* @__PURE__ */ A(
72
- "div",
73
- {
74
- ref: p,
75
- style: I,
76
- className: H
77
- }
78
- );
18
+ }, [s]), W("div", { ref: i, style: H, className: B });
79
19
  }
80
- const N = K.forwardRef((r, e) => {
81
- f(null);
82
- const t = f(null);
83
- return u(() => {
20
+ const L = J.forwardRef((r, e) => {
21
+ u(null);
22
+ const t = u(null);
23
+ return f(() => {
84
24
  t.current && e && (typeof e == "function" ? e(t.current) : e.current = t.current);
85
- }), /* @__PURE__ */ A(M, { ...r });
25
+ }), W(q, { ...r });
86
26
  });
87
- N.displayName = "OpenGrid";
27
+ L.displayName = "OpenGrid";
88
28
  export {
89
- M as OpenGrid
29
+ q as OpenGrid
90
30
  };
91
31
  //# sourceMappingURL=open-grid-react.js.map
@@ -1,2 +1,32 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),p=require("./OpenGrid-CuXj0isp.cjs"),h=a.defineComponent({__name:"OpenGrid",props:{data:{default:()=>[]},columns:{},height:{default:400},width:{default:"100%"},editable:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!0},rowNumber:{type:Boolean,default:!1},checkColumn:{type:Boolean,default:!1},stateColumn:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},frozenColumns:{default:0},theme:{default:"default"},options:{}},emits:["update:data","ready","cell-click","row-click","edit-end","sort-change","filter-change","row-check"],setup(r,{expose:c,emit:u}){const e=r,n=u,d=a.ref(),o=a.shallowRef(null);let i=null;const f=a.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width}));return a.onMounted(()=>{if(!d.value)return;const l={columns:e.columns,height:"100%",width:"100%",editable:e.editable,sortable:e.sortable,filterable:e.filterable,rowNumber:e.rowNumber,checkColumn:e.checkColumn,stateColumn:e.stateColumn,draggable:e.draggable,frozenColumns:e.frozenColumns,theme:e.theme,...e.options,onReady:t=>{var s;(s=e.data)!=null&&s.length&&t.setData(e.data),n("ready",t)},onCellClick:t=>n("cell-click",t),onRowClick:t=>n("row-click",t),onEditEnd:t=>n("edit-end",t),onSortChange:t=>n("sort-change",t),onFilterChange:t=>n("filter-change",t),onDataChange:t=>{i=t,n("update:data",t)}};o.value=new p.OpenGrid(d.value,l)}),a.watch(()=>e.data,l=>{!o.value||!l||l!==i&&o.value.setData(l)},{deep:!1}),a.watch(()=>e.theme,l=>{o.value&&l&&o.value.setTheme(l)}),a.watch(()=>e.columns,l=>{o.value&&o.value.applyColumns(l)},{deep:!1}),a.onUnmounted(()=>{var l;(l=o.value)==null||l.destroy(),o.value=null}),c({grid:o}),(l,t)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"containerRef",ref:d,class:"og-vue-wrapper",style:a.normalizeStyle(f.value)},null,4))}}),m=(r,c)=>{const u=r.__vccOpts||r;for(const[e,n]of c)u[e]=n;return u},g=m(h,[["__scopeId","data-v-0a49d4fc"]]);exports.OpenGrid=g;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue"), OpenGrid$1 = require("./OpenGrid-0r_543Kj.cjs"), _sfc_main = vue.defineComponent({ __name: "OpenGrid", props: { data: { default: () => [] }, columns: {}, height: { default: 400 }, width: { default: "100%" }, editable: { type: Boolean, default: false }, sortable: { type: Boolean, default: true }, filterable: { type: Boolean, default: true }, rowNumber: { type: Boolean, default: false }, checkColumn: { type: Boolean, default: false }, stateColumn: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, frozenColumns: { default: 0 }, theme: { default: "default" }, options: {} }, emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"], setup(n, { expose: u, emit: r }) {
4
+ const e = n, o = r, c = vue.ref(), a = vue.shallowRef(null);
5
+ let d = null;
6
+ const i = vue.computed(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height, width: typeof e.width == "number" ? `${e.width}px` : e.width }));
7
+ return vue.onMounted(() => {
8
+ if (!c.value) return;
9
+ const l = { columns: e.columns, height: "100%", width: "100%", editable: e.editable, sortable: e.sortable, filterable: e.filterable, rowNumber: e.rowNumber, checkColumn: e.checkColumn, stateColumn: e.stateColumn, draggable: e.draggable, frozenColumns: e.frozenColumns, theme: e.theme, ...e.options, onReady: (t) => {
10
+ var _a;
11
+ ((_a = e.data) == null ? void 0 : _a.length) && t.setData(e.data), o("ready", t);
12
+ }, onCellClick: (t) => o("cell-click", t), onRowClick: (t) => o("row-click", t), onEditEnd: (t) => o("edit-end", t), onSortChange: (t) => o("sort-change", t), onFilterChange: (t) => o("filter-change", t), onDataChange: (t) => {
13
+ d = t, o("update:data", t);
14
+ } };
15
+ a.value = new OpenGrid$1.OpenGrid(c.value, l);
16
+ }), vue.watch(() => e.data, (l) => {
17
+ !a.value || !l || l !== d && a.value.setData(l);
18
+ }, { deep: false }), vue.watch(() => e.theme, (l) => {
19
+ a.value && l && a.value.setTheme(l);
20
+ }), vue.watch(() => e.columns, (l) => {
21
+ a.value && a.value.applyColumns(l);
22
+ }, { deep: false }), vue.onUnmounted(() => {
23
+ var _a;
24
+ (_a = a.value) == null ? void 0 : _a.destroy(), a.value = null;
25
+ }), u({ grid: a }), (l, t) => (vue.openBlock(), vue.createElementBlock("div", { ref_key: "containerRef", ref: c, class: "og-vue-wrapper", style: vue.normalizeStyle(i.value) }, null, 4));
26
+ } }), _export_sfc = (n, u) => {
27
+ const r = n.__vccOpts || n;
28
+ for (const [e, o] of u) r[e] = o;
29
+ return r;
30
+ }, OpenGrid = _export_sfc(_sfc_main, [["__scopeId", "data-v-0a49d4fc"]]);
31
+ exports.OpenGrid = OpenGrid;
2
32
  //# sourceMappingURL=open-grid-vue.cjs.map
@@ -1,84 +1,34 @@
1
- import { defineComponent as p, ref as m, shallowRef as h, computed as g, onMounted as y, watch as d, onUnmounted as b, openBlock as v, createElementBlock as C, normalizeStyle as k } from "vue";
2
- import { O as w } from "./OpenGrid-B0Spm0rU.js";
3
- const _ = /* @__PURE__ */ p({
4
- __name: "OpenGrid",
5
- props: {
6
- data: { default: () => [] },
7
- columns: {},
8
- height: { default: 400 },
9
- width: { default: "100%" },
10
- editable: { type: Boolean, default: !1 },
11
- sortable: { type: Boolean, default: !0 },
12
- filterable: { type: Boolean, default: !0 },
13
- rowNumber: { type: Boolean, default: !1 },
14
- checkColumn: { type: Boolean, default: !1 },
15
- stateColumn: { type: Boolean, default: !1 },
16
- draggable: { type: Boolean, default: !1 },
17
- frozenColumns: { default: 0 },
18
- theme: { default: "default" },
19
- options: {}
20
- },
21
- emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"],
22
- setup(n, { expose: u, emit: r }) {
23
- const e = n, o = r, c = m(), a = h(null);
24
- let i = null;
25
- const f = g(() => ({
26
- height: typeof e.height == "number" ? `${e.height}px` : e.height,
27
- width: typeof e.width == "number" ? `${e.width}px` : e.width
28
- }));
29
- return y(() => {
30
- if (!c.value) return;
31
- const l = {
32
- columns: e.columns,
33
- height: "100%",
34
- width: "100%",
35
- editable: e.editable,
36
- sortable: e.sortable,
37
- filterable: e.filterable,
38
- rowNumber: e.rowNumber,
39
- checkColumn: e.checkColumn,
40
- stateColumn: e.stateColumn,
41
- draggable: e.draggable,
42
- frozenColumns: e.frozenColumns,
43
- theme: e.theme,
44
- ...e.options,
45
- onReady: (t) => {
46
- var s;
47
- (s = e.data) != null && s.length && t.setData(e.data), o("ready", t);
48
- },
49
- onCellClick: (t) => o("cell-click", t),
50
- onRowClick: (t) => o("row-click", t),
51
- onEditEnd: (t) => o("edit-end", t),
52
- onSortChange: (t) => o("sort-change", t),
53
- onFilterChange: (t) => o("filter-change", t),
54
- onDataChange: (t) => {
55
- i = t, o("update:data", t);
56
- }
57
- };
58
- a.value = new w(c.value, l);
59
- }), d(() => e.data, (l) => {
60
- !a.value || !l || l !== i && a.value.setData(l);
61
- }, { deep: !1 }), d(() => e.theme, (l) => {
62
- a.value && l && a.value.setTheme(l);
63
- }), d(() => e.columns, (l) => {
64
- a.value && a.value.applyColumns(l);
65
- }, { deep: !1 }), b(() => {
66
- var l;
67
- (l = a.value) == null || l.destroy(), a.value = null;
68
- }), u({ grid: a }), (l, t) => (v(), C("div", {
69
- ref_key: "containerRef",
70
- ref: c,
71
- class: "og-vue-wrapper",
72
- style: k(f.value)
73
- }, null, 4));
74
- }
75
- }), B = (n, u) => {
1
+ import { defineComponent as f, ref as p, shallowRef as m, computed as h, onMounted as g, watch as d, onUnmounted as y, openBlock as b, createElementBlock as v, normalizeStyle as C } from "vue";
2
+ import { O as k } from "./OpenGrid-HmhGVC2V.js";
3
+ const w = f({ __name: "OpenGrid", props: { data: { default: () => [] }, columns: {}, height: { default: 400 }, width: { default: "100%" }, editable: { type: Boolean, default: false }, sortable: { type: Boolean, default: true }, filterable: { type: Boolean, default: true }, rowNumber: { type: Boolean, default: false }, checkColumn: { type: Boolean, default: false }, stateColumn: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, frozenColumns: { default: 0 }, theme: { default: "default" }, options: {} }, emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"], setup(n, { expose: u, emit: r }) {
4
+ const e = n, o = r, c = p(), a = m(null);
5
+ let i = null;
6
+ const s = h(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height, width: typeof e.width == "number" ? `${e.width}px` : e.width }));
7
+ return g(() => {
8
+ if (!c.value) return;
9
+ const l = { columns: e.columns, height: "100%", width: "100%", editable: e.editable, sortable: e.sortable, filterable: e.filterable, rowNumber: e.rowNumber, checkColumn: e.checkColumn, stateColumn: e.stateColumn, draggable: e.draggable, frozenColumns: e.frozenColumns, theme: e.theme, ...e.options, onReady: (t) => {
10
+ var _a;
11
+ ((_a = e.data) == null ? void 0 : _a.length) && t.setData(e.data), o("ready", t);
12
+ }, onCellClick: (t) => o("cell-click", t), onRowClick: (t) => o("row-click", t), onEditEnd: (t) => o("edit-end", t), onSortChange: (t) => o("sort-change", t), onFilterChange: (t) => o("filter-change", t), onDataChange: (t) => {
13
+ i = t, o("update:data", t);
14
+ } };
15
+ a.value = new k(c.value, l);
16
+ }), d(() => e.data, (l) => {
17
+ !a.value || !l || l !== i && a.value.setData(l);
18
+ }, { deep: false }), d(() => e.theme, (l) => {
19
+ a.value && l && a.value.setTheme(l);
20
+ }), d(() => e.columns, (l) => {
21
+ a.value && a.value.applyColumns(l);
22
+ }, { deep: false }), y(() => {
23
+ var _a;
24
+ (_a = a.value) == null ? void 0 : _a.destroy(), a.value = null;
25
+ }), u({ grid: a }), (l, t) => (b(), v("div", { ref_key: "containerRef", ref: c, class: "og-vue-wrapper", style: C(s.value) }, null, 4));
26
+ } }), _ = (n, u) => {
76
27
  const r = n.__vccOpts || n;
77
- for (const [e, o] of u)
78
- r[e] = o;
28
+ for (const [e, o] of u) r[e] = o;
79
29
  return r;
80
- }, R = /* @__PURE__ */ B(_, [["__scopeId", "data-v-0a49d4fc"]]);
30
+ }, B = _(w, [["__scopeId", "data-v-0a49d4fc"]]);
81
31
  export {
82
- R as OpenGrid
32
+ B as OpenGrid
83
33
  };
84
34
  //# sourceMappingURL=open-grid-vue.js.map
@@ -1,7 +1,273 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./OpenGrid-CuXj0isp.cjs");class C{constructor(t,e,i,c={}){this._left=t,this._right=e;const r=document.createElement("div");r.className="og-shuttle",r.style.cssText=`display:flex;gap:6px;align-items:center;justify-content:center;flex-direction:${c.layout==="horizontal"?"row":"column"};`;const a=(p,f,u)=>{const o=document.createElement("button");return o.type="button",o.className="og-shuttle-btn",o.textContent=p,o.title=f,o.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);",o.addEventListener("mouseover",()=>{o.style.background="#f0f6ff",o.style.borderColor="#1976d2"}),o.addEventListener("mouseout",()=>{o.style.background="#fff",o.style.borderColor="#bbb"}),o.addEventListener("click",u),o},_=c.labels??{},m=p=>this._left.t(p);r.appendChild(a(_.toRight??"▶",m("shuttle.toRight"),()=>{this._left.moveCheckedTo(this._right)})),r.appendChild(a(_.toLeft??"◀",m("shuttle.toLeft"),()=>{this._right.moveCheckedTo(this._left)})),c.includeAll&&(r.appendChild(a(_.allRight??"⏩",m("shuttle.allRight"),()=>{this._moveAll(this._left,this._right)})),r.appendChild(a(_.allLeft??"⏪",m("shuttle.allLeft"),()=>{this._moveAll(this._right,this._left)}))),i.appendChild(r),this._el=r}_moveAll(t,e){const i=t.getData().length;i>0&&t.moveRowsTo(e,Array.from({length:i},(c,r)=>r))}destroy(){this._el.remove()}}function T(A,t,e,i){return new C(A,t,e,i)}class v{constructor(t,e){this._data=[],this._roots=[],this._expandedKeys=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:!0,onNodeClick:()=>{},...e},this._container.classList.add("og-orgchart")}setData(t){this._data=t;const{idField:e,parentIdField:i,expandOnLoad:c}=this._opts;c&&this._expandedKeys.size===0&&t.forEach(r=>this._expandedKeys.add(r[e])),this._roots=y.buildTree(t,{idField:e,parentIdField:i},this._expandedKeys),this._render()}setTheme(t){this._container.setAttribute("data-og-theme",t)}setSkin(t){this._container.setAttribute("data-og-skin",t)}expandAll(){const t=e=>{for(const i of e)this._expandedKeys.add(i._treeId),i.children.length&&t(i.children)};t(this._roots),this._rebuild()}collapseAll(){this._expandedKeys.clear(),this._rebuild()}_toggle(t){this._expandedKeys.has(t)?this._expandedKeys.delete(t):this._expandedKeys.add(t),this._rebuild()}_rebuild(){const{idField:t,parentIdField:e}=this._opts;this._roots=y.buildTree(this._data,{idField:t,parentIdField:e},this._expandedKeys),this._render()}_calcLayout(){const{nodeWidth:t,nodeHeight:e,levelGap:i,siblingGap:c}=this._opts,r=new Map;let a=0;const _=f=>{const u=f._depth*(e+i),o=f._expanded?f.children:[];if(!o.length){const g=a;return a+=t+c,r.set(f._treeId,{x:g,y:u}),{minX:g,maxX:g}}let n=1/0,l=-1/0;for(const g of o){const{minX:s,maxX:h}=_(g);s<n&&(n=s),h>l&&(l=h)}const d=n+(l-n+t)/2-t/2;return r.set(f._treeId,{x:d,y:u}),{minX:n,maxX:l}};for(const f of this._roots)_(f);let m=0,p=0;for(const{x:f,y:u}of r.values())f+t>m&&(m=f+t),u+e>p&&(p=u+e);return{layout:r,totalW:m+c,totalH:p+i+16}}_line(t,e,i,c,r){const a=document.createElementNS("http://www.w3.org/2000/svg","line");a.setAttribute("x1",String(e)),a.setAttribute("y1",String(i)),a.setAttribute("x2",String(c)),a.setAttribute("y2",String(r)),a.setAttribute("class","og-orgchart-line"),t.appendChild(a)}_render(){const{nodeWidth:t,nodeHeight:e,levelGap:i,columns:c}=this._opts,{layout:r,totalW:a,totalH:_}=this._calcLayout();this._container.innerHTML="";const m=document.createElement("div");m.className="og-orgchart-wrap",m.style.cssText=`width:${a}px;height:${_}px;`;const p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("width",String(a)),p.setAttribute("height",String(_)),p.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";const f=o=>{for(const n of o){if(!n._expanded||!n.children.length)continue;const l=r.get(n._treeId),d=l.x+t/2,g=l.y+e,s=g+i/2,h=n.children;if(this._line(p,d,g,d,s),h.length>1){const x=r.get(h[0]._treeId),b=r.get(h[h.length-1]._treeId);this._line(p,x.x+t/2,s,b.x+t/2,s)}for(const x of h){const b=r.get(x._treeId),E=b.x+t/2;this._line(p,E,s,E,b.y)}f(h)}};f(this._roots),m.appendChild(p);const u=o=>{for(const n of o){const l=r.get(n._treeId);if(!l)continue;const d=document.createElement("div");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;`;const g=document.createElement("div");g.className="og-orgchart-node-content";for(const s of c){const h=n.data[s.field],x=document.createElement("div");if(x.className="og-orgchart-col"+(s.className?" "+s.className:""),s.style){const b=typeof s.style=="function"?s.style(h,n.data):s.style;x.setAttribute("style",b)}if(s.renderer){const b=s.renderer(h,n.data);typeof b=="string"?x.innerHTML=b:x.appendChild(b)}else x.textContent=h??"";g.appendChild(x)}if(d.appendChild(g),n._hasChildren){const s=document.createElement("button");s.type="button",s.className="og-orgchart-toggle",s.setAttribute("aria-expanded",n._expanded?"true":"false"),s.setAttribute("aria-label",y.t(n._expanded?"tree.collapse":"tree.expand"));const h=document.createElement("i");h.setAttribute("aria-hidden","true"),h.className=n._expanded?"bi bi-dash-circle":"bi bi-plus-circle",s.appendChild(h),s.addEventListener("click",x=>{x.stopPropagation(),this._toggle(n._treeId)}),d.appendChild(s)}d.addEventListener("click",()=>{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")}),m.appendChild(d),n._expanded&&n.children.length&&u(n.children)}};u(this._roots),this._container.appendChild(m)}}class N{static parse(t,e={}){var o,n;const{fieldMap:i={},trim:c=!0}=e,a=new DOMParser().parseFromString(t.trim(),"text/xml"),_=a.querySelector("parsererror");if(_)throw new Error(`XML 파싱 오류: ${(o=_.textContent)==null?void 0:o.trim()}`);const m=a.documentElement;let p=e.rowTag;if(!p){const l=e.rootTag?a.querySelector(e.rootTag):m;p=((n=l==null?void 0:l.children[0])==null?void 0:n.tagName)??"row"}const f=a.getElementsByTagName(p),u=[];for(let l=0;l<f.length;l++){const d=f[l],g={};for(const s of Array.from(d.attributes)){const h=i[s.name]??s.name;g[h]=c?s.value.trim():s.value}for(const s of Array.from(d.children)){const h=i[s.tagName]??s.tagName,x=s.textContent??"";g[h]=c?x.trim():x}u.push(g)}return u}static stringify(t,e={}){const{rootTag:i="rows",rowTag:c="row",mode:r="element",fieldMap:a={},declaration:_=!0,indent:m=2,nullAs:p="",excludeFields:f=[]}=e,u=" ".repeat(m),o=[];_&&o.push('<?xml version="1.0" encoding="UTF-8"?>'),o.push(`<${i}>`);for(const n of t){const l=Object.entries(n).filter(([d])=>!f.includes(d));if(r==="attribute"){const d=l.map(([g,s])=>{const h=a[g]??g,x=s==null?p:String(s);return`${h}="${this._escAttr(x)}"`}).join(" ");o.push(`${u}<${c}${d?" "+d:""} />`)}else{o.push(`${u}<${c}>`);for(const[d,g]of l){const s=a[d]??d,h=g==null?p:String(g);o.push(`${u}${u}<${s}>${this._escText(h)}</${s}>`)}o.push(`${u}</${c}>`)}}return o.push(`</${i}>`),o.join(`
2
- `)}static parseSap(t){var m,p,f,u;const i=new DOMParser().parseFromString(t.trim(),"text/xml"),c={header:{},items:[],returns:[],raw:i},r=i.getElementsByTagName("DOCUMENTHEADER")[0];if(r)for(const o of Array.from(r.children))c.header[o.tagName]=((m=o.textContent)==null?void 0:m.trim())??"";const a=i.getElementsByTagName("RETURN");for(const o of Array.from(a)){const n={};for(const l of Array.from(o.children))n[l.tagName]=((p=l.textContent)==null?void 0:p.trim())??"";c.returns.push(n)}const _=["ACCOUNTGL","ACCOUNTRECEIVABLE","ACCOUNTPAYABLE","ITEMS"];for(const o of _){const n=i.getElementsByTagName(o)[0];if(!n)continue;const l=n.getElementsByTagName("ITEM"),d=l.length>0?Array.from(l):[n];for(const g of d){const s={};for(const h of Array.from(g.children))s[h.tagName]=((f=h.textContent)==null?void 0:f.trim())??"";c.items.push(s)}break}if(c.items.length===0){const o=i.documentElement,n=Array.from(o.children).filter(l=>l.hasAttribute("SEGMENT"));for(const l of n){if(l.tagName==="EDI_DC40")continue;const d={};for(const g of Array.from(l.children))d[g.tagName]=((u=g.textContent)==null?void 0:u.trim())??"";Object.keys(d).length>0&&c.items.push(d)}}return c}static stringifySap(t){const e=['<?xml version="1.0" encoding="UTF-8"?>',"<BAPI_CALL>"];if(t.BAPI_FUNCTION&&e.push(` <FUNCTION>${this._escText(t.BAPI_FUNCTION)}</FUNCTION>`),t.DOCUMENTHEADER&&typeof t.DOCUMENTHEADER=="object"){e.push(" <DOCUMENTHEADER>");for(const[c,r]of Object.entries(t.DOCUMENTHEADER))r!=null&&r!==""&&e.push(` <${c}>${this._escText(String(r))}</${c}>`);e.push(" </DOCUMENTHEADER>")}const i=Object.keys(t).find(c=>Array.isArray(t[c])&&!c.startsWith("_"));if(i){e.push(` <${i}>`);for(const c of t[i]){e.push(" <ITEM>");for(const[r,a]of Object.entries(c))a!=null&&a!==""&&!r.startsWith("_")&&e.push(` <${r}>${this._escText(String(a))}</${r}>`);e.push(" </ITEM>")}e.push(` </${i}>`)}return e.push("</BAPI_CALL>"),e.join(`
3
- `)}static stringifySapBatch(t){const e=['<?xml version="1.0" encoding="UTF-8"?>',`<BAPI_BATCH total="${t.documents.length}">`];return t.documents.forEach((i,c)=>{e.push(` <BAPI_CALL seq="${c+1}">`);const r=this.stringifySap(i).split(`
4
- `).filter(a=>!a.startsWith("<?xml")).map(a=>" "+a).join(`
5
- `);e.push(r),e.push(" </BAPI_CALL>")}),e.push("</BAPI_BATCH>"),e.join(`
6
- `)}static _escText(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}static _escAttr(t){return this._escText(t).replace(/"/g,"&quot;").replace(/'/g,"&apos;")}}exports.DEFAULT_ICON_ROLES=y.DEFAULT_ICON_ROLES;exports.IconRegistry=y.IconRegistry;exports.LocaleRegistry=y.LocaleRegistry;exports.OpenGrid=y.OpenGrid;exports.SkinRegistry=y.SkinRegistry;exports.iconRegistry=y.iconRegistry;exports.localeRegistry=y.localeRegistry;exports.renderIcon=y.renderIcon;exports.skinRegistry=y.skinRegistry;exports.t=y.t;exports.GridShuttle=C;exports.OrgChart=v;exports.XmlConverter=N;exports.createGridShuttle=T;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const OpenGrid = require("./OpenGrid-0r_543Kj.cjs");
4
+ class GridShuttle {
5
+ constructor(t, e, n, o = {}) {
6
+ this._left = t, this._right = e;
7
+ const s = document.createElement("div");
8
+ s.className = "og-shuttle", s.style.cssText = `display:flex;gap:6px;align-items:center;justify-content:center;flex-direction:${o.layout === "horizontal" ? "row" : "column"};`;
9
+ const a = (d, h, g) => {
10
+ const r = document.createElement("button");
11
+ return r.type = "button", r.className = "og-shuttle-btn", r.textContent = d, r.title = h, r.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);", r.addEventListener("mouseover", () => {
12
+ r.style.background = "#f0f6ff", r.style.borderColor = "#1976d2";
13
+ }), r.addEventListener("mouseout", () => {
14
+ r.style.background = "#fff", r.style.borderColor = "#bbb";
15
+ }), r.addEventListener("click", g), r;
16
+ }, _ = o.labels ?? {}, p = (d) => this._left.t(d);
17
+ s.appendChild(a(_.toRight ?? "▶", p("shuttle.toRight"), () => {
18
+ this._left.moveCheckedTo(this._right);
19
+ })), s.appendChild(a(_.toLeft ?? "◀", p("shuttle.toLeft"), () => {
20
+ this._right.moveCheckedTo(this._left);
21
+ })), o.includeAll && (s.appendChild(a(_.allRight ?? "⏩", p("shuttle.allRight"), () => {
22
+ this._moveAll(this._left, this._right);
23
+ })), s.appendChild(a(_.allLeft ?? "⏪", p("shuttle.allLeft"), () => {
24
+ this._moveAll(this._right, this._left);
25
+ }))), n.appendChild(s), this._el = s;
26
+ }
27
+ _moveAll(t, e) {
28
+ const n = t.getData().length;
29
+ n > 0 && t.moveRowsTo(e, Array.from({ length: n }, (o, s) => s));
30
+ }
31
+ destroy() {
32
+ this._el.remove();
33
+ }
34
+ }
35
+ function createGridShuttle(E, t, e, n) {
36
+ return new GridShuttle(E, t, e, n);
37
+ }
38
+ class OrgChart {
39
+ constructor(t, e) {
40
+ 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: () => {
41
+ }, ...e }, this._container.classList.add("og-orgchart");
42
+ }
43
+ setData(t) {
44
+ this._data = t;
45
+ const { idField: e, parentIdField: n, expandOnLoad: o } = this._opts;
46
+ o && this._expandedKeys.size === 0 && t.forEach((s) => this._expandedKeys.add(s[e])), this._roots = OpenGrid.buildTree(t, { idField: e, parentIdField: n }, this._expandedKeys), this._render();
47
+ }
48
+ setTheme(t) {
49
+ this._container.setAttribute("data-og-theme", t);
50
+ }
51
+ setSkin(t) {
52
+ this._container.setAttribute("data-og-skin", t);
53
+ }
54
+ expandAll() {
55
+ const t = (e) => {
56
+ for (const n of e) this._expandedKeys.add(n._treeId), n.children.length && t(n.children);
57
+ };
58
+ t(this._roots), this._rebuild();
59
+ }
60
+ collapseAll() {
61
+ this._expandedKeys.clear(), this._rebuild();
62
+ }
63
+ _toggle(t) {
64
+ this._expandedKeys.has(t) ? this._expandedKeys.delete(t) : this._expandedKeys.add(t), this._rebuild();
65
+ }
66
+ _rebuild() {
67
+ const { idField: t, parentIdField: e } = this._opts;
68
+ this._roots = OpenGrid.buildTree(this._data, { idField: t, parentIdField: e }, this._expandedKeys), this._render();
69
+ }
70
+ _calcLayout() {
71
+ const { nodeWidth: t, nodeHeight: e, levelGap: n, siblingGap: o } = this._opts, s = /* @__PURE__ */ new Map();
72
+ let a = 0;
73
+ const _ = (h) => {
74
+ const g = h._depth * (e + n), r = h._expanded ? h.children : [];
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 };
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);
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 };
86
+ };
87
+ for (const h of this._roots) _(h);
88
+ let p = 0, d = 0;
89
+ for (const { x: h, y: g } of s.values()) h + t > p && (p = h + t), g + e > d && (d = g + e);
90
+ return { layout: s, totalW: p + o, totalH: d + n + 16 };
91
+ }
92
+ _line(t, e, n, o, s) {
93
+ const a = document.createElementNS("http://www.w3.org/2000/svg", "line");
94
+ a.setAttribute("x1", String(e)), a.setAttribute("y1", String(n)), a.setAttribute("x2", String(o)), a.setAttribute("y2", String(s)), a.setAttribute("class", "og-orgchart-line"), t.appendChild(a);
95
+ }
96
+ _render() {
97
+ const { nodeWidth: t, nodeHeight: e, levelGap: n, columns: o } = this._opts, { layout: s, totalW: a, totalH: _ } = this._calcLayout();
98
+ this._container.innerHTML = "";
99
+ const p = document.createElement("div");
100
+ p.className = "og-orgchart-wrap", p.style.cssText = `width:${a}px;height:${_}px;`;
101
+ const d = document.createElementNS("http://www.w3.org/2000/svg", "svg");
102
+ d.setAttribute("width", String(a)), d.setAttribute("height", String(_)), d.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";
103
+ const h = (r) => {
104
+ for (const i of r) {
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) {
108
+ const x = s.get(m[0]._treeId), y = s.get(m[m.length - 1]._treeId);
109
+ this._line(d, x.x + t / 2, c, y.x + t / 2, c);
110
+ }
111
+ for (const x of m) {
112
+ const y = s.get(x._treeId), b = y.x + t / 2;
113
+ this._line(d, b, c, b, y.y);
114
+ }
115
+ h(m);
116
+ }
117
+ };
118
+ h(this._roots), p.appendChild(d);
119
+ const g = (r) => {
120
+ for (const i of r) {
121
+ const u = s.get(i._treeId);
122
+ if (!u) continue;
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";
127
+ for (const c of o) {
128
+ const m = i.data[c.field], x = document.createElement("div");
129
+ if (x.className = "og-orgchart-col" + (c.className ? " " + c.className : ""), c.style) {
130
+ const y = typeof c.style == "function" ? c.style(m, i.data) : c.style;
131
+ x.setAttribute("style", y);
132
+ }
133
+ if (c.renderer) {
134
+ const y = c.renderer(m, i.data);
135
+ typeof y == "string" ? x.innerHTML = y : x.appendChild(y);
136
+ } else x.textContent = m ?? "";
137
+ f.appendChild(x);
138
+ }
139
+ if (l.appendChild(f), i._hasChildren) {
140
+ const c = document.createElement("button");
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
+ const m = document.createElement("i");
143
+ m.setAttribute("aria-hidden", "true"), m.className = i._expanded ? "bi bi-dash-circle" : "bi bi-plus-circle", c.appendChild(m), c.addEventListener("click", (x) => {
144
+ x.stopPropagation(), this._toggle(i._treeId);
145
+ }), l.appendChild(c);
146
+ }
147
+ l.addEventListener("click", () => {
148
+ this._selectedId = i._treeId, this._opts.onNodeClick(i._treeId, i.data), this._container.querySelectorAll(".og-orgchart-node--selected").forEach((c) => c.classList.remove("og-orgchart-node--selected")), l.classList.add("og-orgchart-node--selected");
149
+ }), p.appendChild(l), i._expanded && i.children.length && g(i.children);
150
+ }
151
+ };
152
+ g(this._roots), this._container.appendChild(p);
153
+ }
154
+ }
155
+ class XmlConverter {
156
+ static parse(t, e = {}) {
157
+ var _a, _b, _c;
158
+ const { fieldMap: n = {}, trim: o = true } = e, a = new DOMParser().parseFromString(t.trim(), "text/xml"), _ = a.querySelector("parsererror");
159
+ if (_) throw new Error(`XML 파싱 오류: ${(_a = _.textContent) == null ? void 0 : _a.trim()}`);
160
+ const p = a.documentElement;
161
+ let d = e.rowTag;
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
+ const h = a.getElementsByTagName(d), g = [];
164
+ for (let r = 0; r < h.length; r++) {
165
+ const i = h[r], u = {};
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;
169
+ }
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;
173
+ }
174
+ g.push(u);
175
+ }
176
+ return g;
177
+ }
178
+ static stringify(t, e = {}) {
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
+ _ && r.push('<?xml version="1.0" encoding="UTF-8"?>'), r.push(`<${n}>`);
181
+ for (const i of t) {
182
+ const u = Object.entries(i).filter(([l]) => !h.includes(l));
183
+ if (s === "attribute") {
184
+ const l = u.map(([f, c]) => {
185
+ const m = a[f] ?? f, x = c == null ? d : String(c);
186
+ return `${m}="${this._escAttr(x)}"`;
187
+ }).join(" ");
188
+ r.push(`${g}<${o}${l ? " " + l : ""} />`);
189
+ } else {
190
+ r.push(`${g}<${o}>`);
191
+ for (const [l, f] of u) {
192
+ const c = a[l] ?? l, m = f == null ? d : String(f);
193
+ r.push(`${g}${g}<${c}>${this._escText(m)}</${c}>`);
194
+ }
195
+ r.push(`${g}</${o}>`);
196
+ }
197
+ }
198
+ return r.push(`</${n}>`), r.join(`
199
+ `);
200
+ }
201
+ static parseSap(t) {
202
+ var _a, _b, _c, _d;
203
+ const n = new DOMParser().parseFromString(t.trim(), "text/xml"), o = { header: {}, items: [], returns: [], raw: n }, s = n.getElementsByTagName("DOCUMENTHEADER")[0];
204
+ if (s) for (const p of Array.from(s.children)) o.header[p.tagName] = ((_a = p.textContent) == null ? void 0 : _a.trim()) ?? "";
205
+ const a = n.getElementsByTagName("RETURN");
206
+ for (const p of Array.from(a)) {
207
+ const d = {};
208
+ for (const h of Array.from(p.children)) d[h.tagName] = ((_b = h.textContent) == null ? void 0 : _b.trim()) ?? "";
209
+ o.returns.push(d);
210
+ }
211
+ const _ = ["ACCOUNTGL", "ACCOUNTRECEIVABLE", "ACCOUNTPAYABLE", "ITEMS"];
212
+ for (const p of _) {
213
+ const d = n.getElementsByTagName(p)[0];
214
+ if (!d) continue;
215
+ const h = d.getElementsByTagName("ITEM"), g = h.length > 0 ? Array.from(h) : [d];
216
+ for (const r of g) {
217
+ const i = {};
218
+ for (const u of Array.from(r.children)) i[u.tagName] = ((_c = u.textContent) == null ? void 0 : _c.trim()) ?? "";
219
+ o.items.push(i);
220
+ }
221
+ break;
222
+ }
223
+ if (o.items.length === 0) {
224
+ const p = n.documentElement, d = Array.from(p.children).filter((h) => h.hasAttribute("SEGMENT"));
225
+ for (const h of d) {
226
+ if (h.tagName === "EDI_DC40") continue;
227
+ const g = {};
228
+ for (const r of Array.from(h.children)) g[r.tagName] = ((_d = r.textContent) == null ? void 0 : _d.trim()) ?? "";
229
+ Object.keys(g).length > 0 && o.items.push(g);
230
+ }
231
+ }
232
+ return o;
233
+ }
234
+ static stringifySap(t) {
235
+ const e = ['<?xml version="1.0" encoding="UTF-8"?>', "<BAPI_CALL>"];
236
+ if (t.BAPI_FUNCTION && e.push(` <FUNCTION>${this._escText(t.BAPI_FUNCTION)}</FUNCTION>`), t.DOCUMENTHEADER && typeof t.DOCUMENTHEADER == "object") {
237
+ e.push(" <DOCUMENTHEADER>");
238
+ for (const [o, s] of Object.entries(t.DOCUMENTHEADER)) s != null && s !== "" && e.push(` <${o}>${this._escText(String(s))}</${o}>`);
239
+ e.push(" </DOCUMENTHEADER>");
240
+ }
241
+ const n = Object.keys(t).find((o) => Array.isArray(t[o]) && !o.startsWith("_"));
242
+ if (n) {
243
+ e.push(` <${n}>`);
244
+ for (const o of t[n]) {
245
+ e.push(" <ITEM>");
246
+ for (const [s, a] of Object.entries(o)) a != null && a !== "" && !s.startsWith("_") && e.push(` <${s}>${this._escText(String(a))}</${s}>`);
247
+ e.push(" </ITEM>");
248
+ }
249
+ e.push(` </${n}>`);
250
+ }
251
+ return e.push("</BAPI_CALL>"), e.join(`
252
+ `);
253
+ }
254
+ static stringifySapBatch(t) {
255
+ const e = ['<?xml version="1.0" encoding="UTF-8"?>', `<BAPI_BATCH total="${t.documents.length}">`];
256
+ return t.documents.forEach((n, o) => {
257
+ e.push(` <BAPI_CALL seq="${o + 1}">`);
258
+ const s = this.stringifySap(n).split(`
259
+ `).filter((a) => !a.startsWith("<?xml")).map((a) => " " + a).join(`
260
+ `);
261
+ e.push(s), e.push(" </BAPI_CALL>");
262
+ }), e.push("</BAPI_BATCH>"), e.join(`
263
+ `);
264
+ }
265
+ static _escText(t) {
266
+ return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
267
+ }
268
+ static _escAttr(t) {
269
+ return this._escText(t).replace(/"/g, "&quot;").replace(/'/g, "&apos;");
270
+ }
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;
7
273
  //# sourceMappingURL=open-grid.cjs.map