open-grid 1.1.1 → 1.2.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +30 -1
  3. package/dist/{OpenGrid-yg4mw6Ge.js → OpenGrid-B0Spm0rU.js} +2777 -1878
  4. package/dist/OpenGrid-CuXj0isp.cjs +97 -0
  5. package/dist/open-grid-react.cjs +1 -1
  6. package/dist/open-grid-react.js +1 -1
  7. package/dist/open-grid-vue.cjs +1 -1
  8. package/dist/open-grid-vue.js +1 -1
  9. package/dist/open-grid.cjs +5 -5
  10. package/dist/open-grid.js +155 -152
  11. package/dist/types/core/CellEditManager.d.ts +2 -0
  12. package/dist/types/core/ChartManager.d.ts +2 -0
  13. package/dist/types/core/ContextMenu.d.ts +5 -1
  14. package/dist/types/core/DetailManager.d.ts +2 -0
  15. package/dist/types/core/ExportManager.d.ts +7 -0
  16. package/dist/types/core/FilterPanel.d.ts +4 -1
  17. package/dist/types/core/FilterSelect.d.ts +4 -1
  18. package/dist/types/core/FindBarManager.d.ts +6 -0
  19. package/dist/types/core/FormulaController.d.ts +2 -0
  20. package/dist/types/core/GridComposer.d.ts +5 -0
  21. package/dist/types/core/GridRenderer.d.ts +3 -0
  22. package/dist/types/core/KeyboardManager.d.ts +2 -0
  23. package/dist/types/core/MutationService.d.ts +2 -0
  24. package/dist/types/core/OpenGrid.d.ts +393 -34
  25. package/dist/types/core/Pagination.d.ts +6 -1
  26. package/dist/types/core/RangeSelectionManager.d.ts +2 -0
  27. package/dist/types/core/SortFilterManager.d.ts +2 -0
  28. package/dist/types/core/WorksheetManager.d.ts +4 -1
  29. package/dist/types/core/detail/DetailGlyph.d.ts +3 -1
  30. package/dist/types/core/i18n/LocaleRegistry.d.ts +0 -0
  31. package/dist/types/core/i18n/interpolate.d.ts +5 -0
  32. package/dist/types/core/i18n/locales/en.d.ts +166 -0
  33. package/dist/types/core/i18n/locales/ko.d.ts +166 -0
  34. package/dist/types/core/i18n/types.d.ts +249 -0
  35. package/dist/types/core/renderers/CellRenderer.d.ts +5 -0
  36. package/dist/types/core/types.d.ts +352 -96
  37. package/dist/types/index.d.ts +22 -0
  38. package/package.json +3 -1
  39. package/dist/OpenGrid-LcZ5iixx.cjs +0 -97
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),r=require("react"),D=require("./OpenGrid-LcZ5iixx.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";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;
2
2
  //# sourceMappingURL=open-grid-react.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { jsx as A } from "react/jsx-runtime";
2
2
  import K, { useRef as f, useEffect as u } from "react";
3
- import { O as L } from "./OpenGrid-yg4mw6Ge.js";
3
+ import { O as L } from "./OpenGrid-B0Spm0rU.js";
4
4
  function M({
5
5
  data: r,
6
6
  columns: e,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),p=require("./OpenGrid-LcZ5iixx.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";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;
2
2
  //# sourceMappingURL=open-grid-vue.cjs.map
@@ -1,5 +1,5 @@
1
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-yg4mw6Ge.js";
2
+ import { O as w } from "./OpenGrid-B0Spm0rU.js";
3
3
  const _ = /* @__PURE__ */ p({
4
4
  __name: "OpenGrid",
5
5
  props: {
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./OpenGrid-LcZ5iixx.cjs");class C{constructor(t,e,o,i={}){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:${i.layout==="horizontal"?"row":"column"};`;const c=(m,f,u)=>{const a=document.createElement("button");return a.type="button",a.className="og-shuttle-btn",a.textContent=m,a.title=f,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",()=>{a.style.background="#f0f6ff",a.style.borderColor="#1976d2"}),a.addEventListener("mouseout",()=>{a.style.background="#fff",a.style.borderColor="#bbb"}),a.addEventListener("click",u),a},_=i.labels??{};r.appendChild(c(_.toRight??"▶","체크한 행을 오른쪽 그리드로 이동",()=>{this._left.moveCheckedTo(this._right)})),r.appendChild(c(_.toLeft??"◀","체크한 행을 왼쪽 그리드로 이동",()=>{this._right.moveCheckedTo(this._left)})),i.includeAll&&(r.appendChild(c(_.allRight??"⏩","왼쪽 전체를 오른쪽으로 이동",()=>{this._moveAll(this._left,this._right)})),r.appendChild(c(_.allLeft??"⏪","오른쪽 전체를 왼쪽으로 이동",()=>{this._moveAll(this._right,this._left)}))),o.appendChild(r),this._el=r}_moveAll(t,e){const o=t.getData().length;o>0&&t.moveRowsTo(e,Array.from({length:o},(i,r)=>r))}destroy(){this._el.remove()}}function T(A,t,e,o){return new C(A,t,e,o)}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:o,expandOnLoad:i}=this._opts;i&&this._expandedKeys.size===0&&t.forEach(r=>this._expandedKeys.add(r[e])),this._roots=b.buildTree(t,{idField:e,parentIdField:o},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 o of e)this._expandedKeys.add(o._treeId),o.children.length&&t(o.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=b.buildTree(this._data,{idField:t,parentIdField:e},this._expandedKeys),this._render()}_calcLayout(){const{nodeWidth:t,nodeHeight:e,levelGap:o,siblingGap:i}=this._opts,r=new Map;let c=0;const _=u=>{const a=u._depth*(e+o),g=u._expanded?u.children:[];if(!g.length){const p=c;return c+=t+i,r.set(u._treeId,{x:p,y:a}),{minX:p,maxX:p}}let n=1/0,l=-1/0;for(const p of g){const{minX:s,maxX:h}=_(p);s<n&&(n=s),h>l&&(l=h)}const d=n+(l-n+t)/2-t/2;return r.set(u._treeId,{x:d,y:a}),{minX:n,maxX:l}};for(const u of this._roots)_(u);let m=0,f=0;for(const{x:u,y:a}of r.values())u+t>m&&(m=u+t),a+e>f&&(f=a+e);return{layout:r,totalW:m+i,totalH:f+o+16}}_line(t,e,o,i,r){const c=document.createElementNS("http://www.w3.org/2000/svg","line");c.setAttribute("x1",String(e)),c.setAttribute("y1",String(o)),c.setAttribute("x2",String(i)),c.setAttribute("y2",String(r)),c.setAttribute("class","og-orgchart-line"),t.appendChild(c)}_render(){const{nodeWidth:t,nodeHeight:e,levelGap:o,columns:i}=this._opts,{layout:r,totalW:c,totalH:_}=this._calcLayout();this._container.innerHTML="";const m=document.createElement("div");m.className="og-orgchart-wrap",m.style.cssText=`width:${c}px;height:${_}px;`;const f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("width",String(c)),f.setAttribute("height",String(_)),f.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";const u=g=>{for(const n of g){if(!n._expanded||!n.children.length)continue;const l=r.get(n._treeId),d=l.x+t/2,p=l.y+e,s=p+o/2,h=n.children;if(this._line(f,d,p,d,s),h.length>1){const x=r.get(h[0]._treeId),y=r.get(h[h.length-1]._treeId);this._line(f,x.x+t/2,s,y.x+t/2,s)}for(const x of h){const y=r.get(x._treeId),E=y.x+t/2;this._line(f,E,s,E,y.y)}u(h)}};u(this._roots),m.appendChild(f);const a=g=>{for(const n of g){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 p=document.createElement("div");p.className="og-orgchart-node-content";for(const s of i){const h=n.data[s.field],x=document.createElement("div");if(x.className="og-orgchart-col"+(s.className?" "+s.className:""),s.style){const y=typeof s.style=="function"?s.style(h,n.data):s.style;x.setAttribute("style",y)}if(s.renderer){const y=s.renderer(h,n.data);typeof y=="string"?x.innerHTML=y:x.appendChild(y)}else x.textContent=h??"";p.appendChild(x)}if(d.appendChild(p),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",n._expanded?"접기":"펼치기");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&&a(n.children)}};a(this._roots),this._container.appendChild(m)}}class N{static parse(t,e={}){var g,n;const{fieldMap:o={},trim:i=!0}=e,c=new DOMParser().parseFromString(t.trim(),"text/xml"),_=c.querySelector("parsererror");if(_)throw new Error(`XML 파싱 오류: ${(g=_.textContent)==null?void 0:g.trim()}`);const m=c.documentElement;let f=e.rowTag;if(!f){const l=e.rootTag?c.querySelector(e.rootTag):m;f=((n=l==null?void 0:l.children[0])==null?void 0:n.tagName)??"row"}const u=c.getElementsByTagName(f),a=[];for(let l=0;l<u.length;l++){const d=u[l],p={};for(const s of Array.from(d.attributes)){const h=o[s.name]??s.name;p[h]=i?s.value.trim():s.value}for(const s of Array.from(d.children)){const h=o[s.tagName]??s.tagName,x=s.textContent??"";p[h]=i?x.trim():x}a.push(p)}return a}static stringify(t,e={}){const{rootTag:o="rows",rowTag:i="row",mode:r="element",fieldMap:c={},declaration:_=!0,indent:m=2,nullAs:f="",excludeFields:u=[]}=e,a=" ".repeat(m),g=[];_&&g.push('<?xml version="1.0" encoding="UTF-8"?>'),g.push(`<${o}>`);for(const n of t){const l=Object.entries(n).filter(([d])=>!u.includes(d));if(r==="attribute"){const d=l.map(([p,s])=>{const h=c[p]??p,x=s==null?f:String(s);return`${h}="${this._escAttr(x)}"`}).join(" ");g.push(`${a}<${i}${d?" "+d:""} />`)}else{g.push(`${a}<${i}>`);for(const[d,p]of l){const s=c[d]??d,h=p==null?f:String(p);g.push(`${a}${a}<${s}>${this._escText(h)}</${s}>`)}g.push(`${a}</${i}>`)}}return g.push(`</${o}>`),g.join(`
2
- `)}static parseSap(t){var m,f,u,a;const o=new DOMParser().parseFromString(t.trim(),"text/xml"),i={header:{},items:[],returns:[],raw:o},r=o.getElementsByTagName("DOCUMENTHEADER")[0];if(r)for(const g of Array.from(r.children))i.header[g.tagName]=((m=g.textContent)==null?void 0:m.trim())??"";const c=o.getElementsByTagName("RETURN");for(const g of Array.from(c)){const n={};for(const l of Array.from(g.children))n[l.tagName]=((f=l.textContent)==null?void 0:f.trim())??"";i.returns.push(n)}const _=["ACCOUNTGL","ACCOUNTRECEIVABLE","ACCOUNTPAYABLE","ITEMS"];for(const g of _){const n=o.getElementsByTagName(g)[0];if(!n)continue;const l=n.getElementsByTagName("ITEM"),d=l.length>0?Array.from(l):[n];for(const p of d){const s={};for(const h of Array.from(p.children))s[h.tagName]=((u=h.textContent)==null?void 0:u.trim())??"";i.items.push(s)}break}if(i.items.length===0){const g=o.documentElement,n=Array.from(g.children).filter(l=>l.hasAttribute("SEGMENT"));for(const l of n){if(l.tagName==="EDI_DC40")continue;const d={};for(const p of Array.from(l.children))d[p.tagName]=((a=p.textContent)==null?void 0:a.trim())??"";Object.keys(d).length>0&&i.items.push(d)}}return i}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[i,r]of Object.entries(t.DOCUMENTHEADER))r!=null&&r!==""&&e.push(` <${i}>${this._escText(String(r))}</${i}>`);e.push(" </DOCUMENTHEADER>")}const o=Object.keys(t).find(i=>Array.isArray(t[i])&&!i.startsWith("_"));if(o){e.push(` <${o}>`);for(const i of t[o]){e.push(" <ITEM>");for(const[r,c]of Object.entries(i))c!=null&&c!==""&&!r.startsWith("_")&&e.push(` <${r}>${this._escText(String(c))}</${r}>`);e.push(" </ITEM>")}e.push(` </${o}>`)}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((o,i)=>{e.push(` <BAPI_CALL seq="${i+1}">`);const r=this.stringifySap(o).split(`
4
- `).filter(c=>!c.startsWith("<?xml")).map(c=>" "+c).join(`
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
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=b.DEFAULT_ICON_ROLES;exports.IconRegistry=b.IconRegistry;exports.OpenGrid=b.OpenGrid;exports.SkinRegistry=b.SkinRegistry;exports.iconRegistry=b.iconRegistry;exports.renderIcon=b.renderIcon;exports.skinRegistry=b.skinRegistry;exports.GridShuttle=C;exports.OrgChart=v;exports.XmlConverter=N;exports.createGridShuttle=T;
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;
7
7
  //# sourceMappingURL=open-grid.cjs.map
package/dist/open-grid.js CHANGED
@@ -1,56 +1,56 @@
1
- import { b as E } from "./OpenGrid-yg4mw6Ge.js";
2
- import { D as $, I as S, O, S as D, i as k, r as M, s as B } from "./OpenGrid-yg4mw6Ge.js";
3
- class C {
4
- constructor(t, e, o, i = {}) {
1
+ import { b as E, t as C } from "./OpenGrid-B0Spm0rU.js";
2
+ import { D as S, I as O, L as R, O as D, S as k, i as M, l as B, r as U, s as F } from "./OpenGrid-B0Spm0rU.js";
3
+ class T {
4
+ constructor(t, e, i, a = {}) {
5
5
  this._left = t, this._right = e;
6
6
  const r = document.createElement("div");
7
- r.className = "og-shuttle", r.style.cssText = `display:flex;gap:6px;align-items:center;justify-content:center;flex-direction:${i.layout === "horizontal" ? "row" : "column"};`;
8
- const a = (m, f, u) => {
9
- const c = document.createElement("button");
10
- return c.type = "button", c.className = "og-shuttle-btn", c.textContent = m, c.title = f, c.style.cssText = "min-width:34px;height:30px;padding:0 8px;border:1px solid #bbb;border-radius:7px;background:#fff;cursor:pointer;font-size:14px;color:#444;line-height:1;box-shadow:0 1px 2px rgba(0,0,0,0.06);", c.addEventListener("mouseover", () => {
11
- c.style.background = "#f0f6ff", c.style.borderColor = "#1976d2";
12
- }), c.addEventListener("mouseout", () => {
13
- c.style.background = "#fff", c.style.borderColor = "#bbb";
14
- }), c.addEventListener("click", u), c;
15
- }, _ = i.labels ?? {};
16
- r.appendChild(a(
7
+ r.className = "og-shuttle", r.style.cssText = `display:flex;gap:6px;align-items:center;justify-content:center;flex-direction:${a.layout === "horizontal" ? "row" : "column"};`;
8
+ const c = (g, f, u) => {
9
+ const o = document.createElement("button");
10
+ return o.type = "button", o.className = "og-shuttle-btn", o.textContent = g, 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", () => {
11
+ o.style.background = "#f0f6ff", o.style.borderColor = "#1976d2";
12
+ }), o.addEventListener("mouseout", () => {
13
+ o.style.background = "#fff", o.style.borderColor = "#bbb";
14
+ }), o.addEventListener("click", u), o;
15
+ }, _ = a.labels ?? {}, m = (g) => this._left.t(g);
16
+ r.appendChild(c(
17
17
  _.toRight ?? "▶",
18
- "체크한 행을 오른쪽 그리드로 이동",
18
+ m("shuttle.toRight"),
19
19
  () => {
20
20
  this._left.moveCheckedTo(this._right);
21
21
  }
22
- )), r.appendChild(a(
22
+ )), r.appendChild(c(
23
23
  _.toLeft ?? "◀",
24
- "체크한 행을 왼쪽 그리드로 이동",
24
+ m("shuttle.toLeft"),
25
25
  () => {
26
26
  this._right.moveCheckedTo(this._left);
27
27
  }
28
- )), i.includeAll && (r.appendChild(a(
28
+ )), a.includeAll && (r.appendChild(c(
29
29
  _.allRight ?? "⏩",
30
- "왼쪽 전체를 오른쪽으로 이동",
30
+ m("shuttle.allRight"),
31
31
  () => {
32
32
  this._moveAll(this._left, this._right);
33
33
  }
34
- )), r.appendChild(a(
34
+ )), r.appendChild(c(
35
35
  _.allLeft ?? "⏪",
36
- "오른쪽 전체를 왼쪽으로 이동",
36
+ m("shuttle.allLeft"),
37
37
  () => {
38
38
  this._moveAll(this._right, this._left);
39
39
  }
40
- ))), o.appendChild(r), this._el = r;
40
+ ))), i.appendChild(r), this._el = r;
41
41
  }
42
42
  _moveAll(t, e) {
43
- const o = t.getData().length;
44
- o > 0 && t.moveRowsTo(e, Array.from({ length: o }, (i, r) => r));
43
+ const i = t.getData().length;
44
+ i > 0 && t.moveRowsTo(e, Array.from({ length: i }, (a, r) => r));
45
45
  }
46
46
  destroy() {
47
47
  this._el.remove();
48
48
  }
49
49
  }
50
- function v(A, t, e, o) {
51
- return new C(A, t, e, o);
50
+ function N(A, t, e, i) {
51
+ return new T(A, t, e, i);
52
52
  }
53
- class N {
53
+ class I {
54
54
  constructor(t, e) {
55
55
  this._data = [], this._roots = [], this._expandedKeys = /* @__PURE__ */ new Set(), this._selectedId = null, this._container = typeof t == "string" ? document.querySelector(t) : t, this._opts = {
56
56
  nodeWidth: 160,
@@ -65,8 +65,8 @@ class N {
65
65
  }
66
66
  setData(t) {
67
67
  this._data = t;
68
- const { idField: e, parentIdField: o, expandOnLoad: i } = this._opts;
69
- i && this._expandedKeys.size === 0 && t.forEach((r) => this._expandedKeys.add(r[e])), this._roots = E(t, { idField: e, parentIdField: o }, this._expandedKeys), this._render();
68
+ const { idField: e, parentIdField: i, expandOnLoad: a } = this._opts;
69
+ a && this._expandedKeys.size === 0 && t.forEach((r) => this._expandedKeys.add(r[e])), this._roots = E(t, { idField: e, parentIdField: i }, this._expandedKeys), this._render();
70
70
  }
71
71
  setTheme(t) {
72
72
  this._container.setAttribute("data-og-theme", t);
@@ -77,8 +77,8 @@ class N {
77
77
  }
78
78
  expandAll() {
79
79
  const t = (e) => {
80
- for (const o of e)
81
- this._expandedKeys.add(o._treeId), o.children.length && t(o.children);
80
+ for (const i of e)
81
+ this._expandedKeys.add(i._treeId), i.children.length && t(i.children);
82
82
  };
83
83
  t(this._roots), this._rebuild();
84
84
  }
@@ -94,66 +94,66 @@ class N {
94
94
  }
95
95
  // ── 레이아웃 계산 (post-order: 리프부터 배치, 부모는 자식 중앙) ──
96
96
  _calcLayout() {
97
- const { nodeWidth: t, nodeHeight: e, levelGap: o, siblingGap: i } = this._opts, r = /* @__PURE__ */ new Map();
98
- let a = 0;
99
- const _ = (u) => {
100
- const c = u._depth * (e + o), p = u._expanded ? u.children : [];
101
- if (!p.length) {
102
- const g = a;
103
- return a += t + i, r.set(u._treeId, { x: g, y: c }), { minX: g, maxX: g };
97
+ const { nodeWidth: t, nodeHeight: e, levelGap: i, siblingGap: a } = this._opts, r = /* @__PURE__ */ new Map();
98
+ let c = 0;
99
+ const _ = (f) => {
100
+ const u = f._depth * (e + i), o = f._expanded ? f.children : [];
101
+ if (!o.length) {
102
+ const p = c;
103
+ return c += t + a, r.set(f._treeId, { x: p, y: u }), { minX: p, maxX: p };
104
104
  }
105
105
  let n = 1 / 0, l = -1 / 0;
106
- for (const g of p) {
107
- const { minX: s, maxX: h } = _(g);
106
+ for (const p of o) {
107
+ const { minX: s, maxX: h } = _(p);
108
108
  s < n && (n = s), h > l && (l = h);
109
109
  }
110
110
  const d = n + (l - n + t) / 2 - t / 2;
111
- return r.set(u._treeId, { x: d, y: c }), { minX: n, maxX: l };
111
+ return r.set(f._treeId, { x: d, y: u }), { minX: n, maxX: l };
112
112
  };
113
- for (const u of this._roots) _(u);
114
- let m = 0, f = 0;
115
- for (const { x: u, y: c } of r.values())
116
- u + t > m && (m = u + t), c + e > f && (f = c + e);
117
- return { layout: r, totalW: m + i, totalH: f + o + 16 };
113
+ for (const f of this._roots) _(f);
114
+ let m = 0, g = 0;
115
+ for (const { x: f, y: u } of r.values())
116
+ f + t > m && (m = f + t), u + e > g && (g = u + e);
117
+ return { layout: r, totalW: m + a, totalH: g + i + 16 };
118
118
  }
119
119
  // ── SVG 직선 헬퍼 ──
120
- _line(t, e, o, i, r) {
121
- const a = document.createElementNS("http://www.w3.org/2000/svg", "line");
122
- a.setAttribute("x1", String(e)), a.setAttribute("y1", String(o)), a.setAttribute("x2", String(i)), a.setAttribute("y2", String(r)), a.setAttribute("class", "og-orgchart-line"), t.appendChild(a);
120
+ _line(t, e, i, a, r) {
121
+ const c = document.createElementNS("http://www.w3.org/2000/svg", "line");
122
+ c.setAttribute("x1", String(e)), c.setAttribute("y1", String(i)), c.setAttribute("x2", String(a)), c.setAttribute("y2", String(r)), c.setAttribute("class", "og-orgchart-line"), t.appendChild(c);
123
123
  }
124
124
  // ── 렌더 ──
125
125
  _render() {
126
- const { nodeWidth: t, nodeHeight: e, levelGap: o, columns: i } = this._opts, { layout: r, totalW: a, totalH: _ } = this._calcLayout();
126
+ const { nodeWidth: t, nodeHeight: e, levelGap: i, columns: a } = this._opts, { layout: r, totalW: c, totalH: _ } = this._calcLayout();
127
127
  this._container.innerHTML = "";
128
128
  const m = document.createElement("div");
129
- m.className = "og-orgchart-wrap", m.style.cssText = `width:${a}px;height:${_}px;`;
130
- const f = document.createElementNS("http://www.w3.org/2000/svg", "svg");
131
- f.setAttribute("width", String(a)), f.setAttribute("height", String(_)), f.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";
132
- const u = (p) => {
133
- for (const n of p) {
129
+ m.className = "og-orgchart-wrap", m.style.cssText = `width:${c}px;height:${_}px;`;
130
+ const g = document.createElementNS("http://www.w3.org/2000/svg", "svg");
131
+ g.setAttribute("width", String(c)), g.setAttribute("height", String(_)), g.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;overflow:visible;";
132
+ const f = (o) => {
133
+ for (const n of o) {
134
134
  if (!n._expanded || !n.children.length) continue;
135
- const l = r.get(n._treeId), d = l.x + t / 2, g = l.y + e, s = g + o / 2, h = n.children;
136
- if (this._line(f, d, g, d, s), h.length > 1) {
135
+ const l = r.get(n._treeId), d = l.x + t / 2, p = l.y + e, s = p + i / 2, h = n.children;
136
+ if (this._line(g, d, p, d, s), h.length > 1) {
137
137
  const x = r.get(h[0]._treeId), y = r.get(h[h.length - 1]._treeId);
138
- this._line(f, x.x + t / 2, s, y.x + t / 2, s);
138
+ this._line(g, x.x + t / 2, s, y.x + t / 2, s);
139
139
  }
140
140
  for (const x of h) {
141
141
  const y = r.get(x._treeId), b = y.x + t / 2;
142
- this._line(f, b, s, b, y.y);
142
+ this._line(g, b, s, b, y.y);
143
143
  }
144
- u(h);
144
+ f(h);
145
145
  }
146
146
  };
147
- u(this._roots), m.appendChild(f);
148
- const c = (p) => {
149
- for (const n of p) {
147
+ f(this._roots), m.appendChild(g);
148
+ const u = (o) => {
149
+ for (const n of o) {
150
150
  const l = r.get(n._treeId);
151
151
  if (!l) continue;
152
152
  const d = document.createElement("div");
153
153
  d.className = "og-orgchart-node", n._hasChildren && d.classList.add("og-orgchart-node--branch"), n._expanded && d.classList.add("og-orgchart-node--expanded"), this._selectedId === n._treeId && d.classList.add("og-orgchart-node--selected"), d.style.cssText = `left:${l.x}px;top:${l.y}px;width:${t}px;height:${e}px;`;
154
- const g = document.createElement("div");
155
- g.className = "og-orgchart-node-content";
156
- for (const s of i) {
154
+ const p = document.createElement("div");
155
+ p.className = "og-orgchart-node-content";
156
+ for (const s of a) {
157
157
  const h = n.data[s.field], x = document.createElement("div");
158
158
  if (x.className = "og-orgchart-col" + (s.className ? " " + s.className : ""), s.style) {
159
159
  const y = typeof s.style == "function" ? s.style(h, n.data) : s.style;
@@ -164,11 +164,11 @@ class N {
164
164
  typeof y == "string" ? x.innerHTML = y : x.appendChild(y);
165
165
  } else
166
166
  x.textContent = h ?? "";
167
- g.appendChild(x);
167
+ p.appendChild(x);
168
168
  }
169
- if (d.appendChild(g), n._hasChildren) {
169
+ if (d.appendChild(p), n._hasChildren) {
170
170
  const s = document.createElement("button");
171
- s.type = "button", s.className = "og-orgchart-toggle", s.setAttribute("aria-expanded", n._expanded ? "true" : "false"), s.setAttribute("aria-label", n._expanded ? "접기" : "펼치기");
171
+ s.type = "button", s.className = "og-orgchart-toggle", s.setAttribute("aria-expanded", n._expanded ? "true" : "false"), s.setAttribute("aria-label", C(n._expanded ? "tree.collapse" : "tree.expand"));
172
172
  const h = document.createElement("i");
173
173
  h.setAttribute("aria-hidden", "true"), h.className = n._expanded ? "bi bi-dash-circle" : "bi bi-plus-circle", s.appendChild(h), s.addEventListener("click", (x) => {
174
174
  x.stopPropagation(), this._toggle(n._treeId);
@@ -176,13 +176,13 @@ class N {
176
176
  }
177
177
  d.addEventListener("click", () => {
178
178
  this._selectedId = n._treeId, this._opts.onNodeClick(n._treeId, n.data), this._container.querySelectorAll(".og-orgchart-node--selected").forEach((s) => s.classList.remove("og-orgchart-node--selected")), d.classList.add("og-orgchart-node--selected");
179
- }), m.appendChild(d), n._expanded && n.children.length && c(n.children);
179
+ }), m.appendChild(d), n._expanded && n.children.length && u(n.children);
180
180
  }
181
181
  };
182
- c(this._roots), this._container.appendChild(m);
182
+ u(this._roots), this._container.appendChild(m);
183
183
  }
184
184
  }
185
- class I {
185
+ class w {
186
186
  // ── 1. XML → 데이터 배열 ────────────────────────────────────
187
187
  /**
188
188
  * XML 문자열을 파싱하여 그리드 데이터 배열로 변환.
@@ -191,29 +191,29 @@ class I {
191
191
  * @throws XML 파싱 오류 시 Error 발생
192
192
  */
193
193
  static parse(t, e = {}) {
194
- var p, n;
195
- const { fieldMap: o = {}, trim: i = !0 } = e, a = new DOMParser().parseFromString(t.trim(), "text/xml"), _ = a.querySelector("parsererror");
196
- if (_) throw new Error(`XML 파싱 오류: ${(p = _.textContent) == null ? void 0 : p.trim()}`);
197
- const m = a.documentElement;
198
- let f = e.rowTag;
199
- if (!f) {
200
- const l = e.rootTag ? a.querySelector(e.rootTag) : m;
201
- f = ((n = l == null ? void 0 : l.children[0]) == null ? void 0 : n.tagName) ?? "row";
194
+ var o, n;
195
+ const { fieldMap: i = {}, trim: a = !0 } = e, c = new DOMParser().parseFromString(t.trim(), "text/xml"), _ = c.querySelector("parsererror");
196
+ if (_) throw new Error(`XML 파싱 오류: ${(o = _.textContent) == null ? void 0 : o.trim()}`);
197
+ const m = c.documentElement;
198
+ let g = e.rowTag;
199
+ if (!g) {
200
+ const l = e.rootTag ? c.querySelector(e.rootTag) : m;
201
+ g = ((n = l == null ? void 0 : l.children[0]) == null ? void 0 : n.tagName) ?? "row";
202
202
  }
203
- const u = a.getElementsByTagName(f), c = [];
204
- for (let l = 0; l < u.length; l++) {
205
- const d = u[l], g = {};
203
+ const f = c.getElementsByTagName(g), u = [];
204
+ for (let l = 0; l < f.length; l++) {
205
+ const d = f[l], p = {};
206
206
  for (const s of Array.from(d.attributes)) {
207
- const h = o[s.name] ?? s.name;
208
- g[h] = i ? s.value.trim() : s.value;
207
+ const h = i[s.name] ?? s.name;
208
+ p[h] = a ? s.value.trim() : s.value;
209
209
  }
210
210
  for (const s of Array.from(d.children)) {
211
- const h = o[s.tagName] ?? s.tagName, x = s.textContent ?? "";
212
- g[h] = i ? x.trim() : x;
211
+ const h = i[s.tagName] ?? s.tagName, x = s.textContent ?? "";
212
+ p[h] = a ? x.trim() : x;
213
213
  }
214
- c.push(g);
214
+ u.push(p);
215
215
  }
216
- return c;
216
+ return u;
217
217
  }
218
218
  // ── 2. 데이터 배열 → XML ─────────────────────────────────────
219
219
  /**
@@ -221,34 +221,34 @@ class I {
221
221
  */
222
222
  static stringify(t, e = {}) {
223
223
  const {
224
- rootTag: o = "rows",
225
- rowTag: i = "row",
224
+ rootTag: i = "rows",
225
+ rowTag: a = "row",
226
226
  mode: r = "element",
227
- fieldMap: a = {},
227
+ fieldMap: c = {},
228
228
  declaration: _ = !0,
229
229
  indent: m = 2,
230
- nullAs: f = "",
231
- excludeFields: u = []
232
- } = e, c = " ".repeat(m), p = [];
233
- _ && p.push('<?xml version="1.0" encoding="UTF-8"?>'), p.push(`<${o}>`);
230
+ nullAs: g = "",
231
+ excludeFields: f = []
232
+ } = e, u = " ".repeat(m), o = [];
233
+ _ && o.push('<?xml version="1.0" encoding="UTF-8"?>'), o.push(`<${i}>`);
234
234
  for (const n of t) {
235
- const l = Object.entries(n).filter(([d]) => !u.includes(d));
235
+ const l = Object.entries(n).filter(([d]) => !f.includes(d));
236
236
  if (r === "attribute") {
237
- const d = l.map(([g, s]) => {
238
- const h = a[g] ?? g, x = s == null ? f : String(s);
237
+ const d = l.map(([p, s]) => {
238
+ const h = c[p] ?? p, x = s == null ? g : String(s);
239
239
  return `${h}="${this._escAttr(x)}"`;
240
240
  }).join(" ");
241
- p.push(`${c}<${i}${d ? " " + d : ""} />`);
241
+ o.push(`${u}<${a}${d ? " " + d : ""} />`);
242
242
  } else {
243
- p.push(`${c}<${i}>`);
244
- for (const [d, g] of l) {
245
- const s = a[d] ?? d, h = g == null ? f : String(g);
246
- p.push(`${c}${c}<${s}>${this._escText(h)}</${s}>`);
243
+ o.push(`${u}<${a}>`);
244
+ for (const [d, p] of l) {
245
+ const s = c[d] ?? d, h = p == null ? g : String(p);
246
+ o.push(`${u}${u}<${s}>${this._escText(h)}</${s}>`);
247
247
  }
248
- p.push(`${c}</${i}>`);
248
+ o.push(`${u}</${a}>`);
249
249
  }
250
250
  }
251
- return p.push(`</${o}>`), p.join(`
251
+ return o.push(`</${i}>`), o.join(`
252
252
  `);
253
253
  }
254
254
  // ── 3. SAP BAPI XML 응답 파싱 ────────────────────────────────
@@ -261,42 +261,42 @@ class I {
261
261
  * <RETURN><TYPE>S</TYPE><MESSAGE>...</MESSAGE></RETURN>
262
262
  */
263
263
  static parseSap(t) {
264
- var m, f, u, c;
265
- const o = new DOMParser().parseFromString(t.trim(), "text/xml"), i = { header: {}, items: [], returns: [], raw: o }, r = o.getElementsByTagName("DOCUMENTHEADER")[0];
264
+ var m, g, f, u;
265
+ const i = new DOMParser().parseFromString(t.trim(), "text/xml"), a = { header: {}, items: [], returns: [], raw: i }, r = i.getElementsByTagName("DOCUMENTHEADER")[0];
266
266
  if (r)
267
- for (const p of Array.from(r.children))
268
- i.header[p.tagName] = ((m = p.textContent) == null ? void 0 : m.trim()) ?? "";
269
- const a = o.getElementsByTagName("RETURN");
270
- for (const p of Array.from(a)) {
267
+ for (const o of Array.from(r.children))
268
+ a.header[o.tagName] = ((m = o.textContent) == null ? void 0 : m.trim()) ?? "";
269
+ const c = i.getElementsByTagName("RETURN");
270
+ for (const o of Array.from(c)) {
271
271
  const n = {};
272
- for (const l of Array.from(p.children))
273
- n[l.tagName] = ((f = l.textContent) == null ? void 0 : f.trim()) ?? "";
274
- i.returns.push(n);
272
+ for (const l of Array.from(o.children))
273
+ n[l.tagName] = ((g = l.textContent) == null ? void 0 : g.trim()) ?? "";
274
+ a.returns.push(n);
275
275
  }
276
276
  const _ = ["ACCOUNTGL", "ACCOUNTRECEIVABLE", "ACCOUNTPAYABLE", "ITEMS"];
277
- for (const p of _) {
278
- const n = o.getElementsByTagName(p)[0];
277
+ for (const o of _) {
278
+ const n = i.getElementsByTagName(o)[0];
279
279
  if (!n) continue;
280
280
  const l = n.getElementsByTagName("ITEM"), d = l.length > 0 ? Array.from(l) : [n];
281
- for (const g of d) {
281
+ for (const p of d) {
282
282
  const s = {};
283
- for (const h of Array.from(g.children))
284
- s[h.tagName] = ((u = h.textContent) == null ? void 0 : u.trim()) ?? "";
285
- i.items.push(s);
283
+ for (const h of Array.from(p.children))
284
+ s[h.tagName] = ((f = h.textContent) == null ? void 0 : f.trim()) ?? "";
285
+ a.items.push(s);
286
286
  }
287
287
  break;
288
288
  }
289
- if (i.items.length === 0) {
290
- const p = o.documentElement, n = Array.from(p.children).filter((l) => l.hasAttribute("SEGMENT"));
289
+ if (a.items.length === 0) {
290
+ const o = i.documentElement, n = Array.from(o.children).filter((l) => l.hasAttribute("SEGMENT"));
291
291
  for (const l of n) {
292
292
  if (l.tagName === "EDI_DC40") continue;
293
293
  const d = {};
294
- for (const g of Array.from(l.children))
295
- d[g.tagName] = ((c = g.textContent) == null ? void 0 : c.trim()) ?? "";
296
- Object.keys(d).length > 0 && i.items.push(d);
294
+ for (const p of Array.from(l.children))
295
+ d[p.tagName] = ((u = p.textContent) == null ? void 0 : u.trim()) ?? "";
296
+ Object.keys(d).length > 0 && a.items.push(d);
297
297
  }
298
298
  }
299
- return i;
299
+ return a;
300
300
  }
301
301
  // ── 4. SAP BAPI 페이로드 → XML 직렬화 ───────────────────────
302
302
  /**
@@ -310,22 +310,22 @@ class I {
310
310
  ];
311
311
  if (t.BAPI_FUNCTION && e.push(` <FUNCTION>${this._escText(t.BAPI_FUNCTION)}</FUNCTION>`), t.DOCUMENTHEADER && typeof t.DOCUMENTHEADER == "object") {
312
312
  e.push(" <DOCUMENTHEADER>");
313
- for (const [i, r] of Object.entries(t.DOCUMENTHEADER))
314
- r != null && r !== "" && e.push(` <${i}>${this._escText(String(r))}</${i}>`);
313
+ for (const [a, r] of Object.entries(t.DOCUMENTHEADER))
314
+ r != null && r !== "" && e.push(` <${a}>${this._escText(String(r))}</${a}>`);
315
315
  e.push(" </DOCUMENTHEADER>");
316
316
  }
317
- const o = Object.keys(t).find(
318
- (i) => Array.isArray(t[i]) && !i.startsWith("_")
317
+ const i = Object.keys(t).find(
318
+ (a) => Array.isArray(t[a]) && !a.startsWith("_")
319
319
  );
320
- if (o) {
321
- e.push(` <${o}>`);
322
- for (const i of t[o]) {
320
+ if (i) {
321
+ e.push(` <${i}>`);
322
+ for (const a of t[i]) {
323
323
  e.push(" <ITEM>");
324
- for (const [r, a] of Object.entries(i))
325
- a != null && a !== "" && !r.startsWith("_") && e.push(` <${r}>${this._escText(String(a))}</${r}>`);
324
+ for (const [r, c] of Object.entries(a))
325
+ c != null && c !== "" && !r.startsWith("_") && e.push(` <${r}>${this._escText(String(c))}</${r}>`);
326
326
  e.push(" </ITEM>");
327
327
  }
328
- e.push(` </${o}>`);
328
+ e.push(` </${i}>`);
329
329
  }
330
330
  return e.push("</BAPI_CALL>"), e.join(`
331
331
  `);
@@ -340,10 +340,10 @@ class I {
340
340
  '<?xml version="1.0" encoding="UTF-8"?>',
341
341
  `<BAPI_BATCH total="${t.documents.length}">`
342
342
  ];
343
- return t.documents.forEach((o, i) => {
344
- e.push(` <BAPI_CALL seq="${i + 1}">`);
345
- const r = this.stringifySap(o).split(`
346
- `).filter((a) => !a.startsWith("<?xml")).map((a) => " " + a).join(`
343
+ return t.documents.forEach((i, a) => {
344
+ e.push(` <BAPI_CALL seq="${a + 1}">`);
345
+ const r = this.stringifySap(i).split(`
346
+ `).filter((c) => !c.startsWith("<?xml")).map((c) => " " + c).join(`
347
347
  `);
348
348
  e.push(r), e.push(" </BAPI_CALL>");
349
349
  }), e.push("</BAPI_BATCH>"), e.join(`
@@ -358,16 +358,19 @@ class I {
358
358
  }
359
359
  }
360
360
  export {
361
- $ as DEFAULT_ICON_ROLES,
362
- C as GridShuttle,
363
- S as IconRegistry,
364
- O as OpenGrid,
365
- N as OrgChart,
366
- D as SkinRegistry,
367
- I as XmlConverter,
368
- v as createGridShuttle,
369
- k as iconRegistry,
370
- M as renderIcon,
371
- B as skinRegistry
361
+ S as DEFAULT_ICON_ROLES,
362
+ T as GridShuttle,
363
+ O as IconRegistry,
364
+ R as LocaleRegistry,
365
+ D as OpenGrid,
366
+ I as OrgChart,
367
+ k as SkinRegistry,
368
+ w as XmlConverter,
369
+ N as createGridShuttle,
370
+ M as iconRegistry,
371
+ B as localeRegistry,
372
+ U as renderIcon,
373
+ F as skinRegistry,
374
+ C as t
372
375
  };
373
376
  //# sourceMappingURL=open-grid.js.map
@@ -12,6 +12,8 @@ export interface CellEditDeps<T extends Record<string, any>> {
12
12
  emit: (event: string, ...args: any[]) => void;
13
13
  doRender: () => void;
14
14
  announce: (msg: string) => void;
15
+ /** i18n: 편집 셀 위치 announce 해석 + 에디터 ctx 로케일 주입. / i18n: resolve edit-cell announce + inject locale into editor ctx. */
16
+ t: (key: string, params?: Record<string, string | number>) => string;
15
17
  writeCell: (ri: number, field: string, value: any) => void;
16
18
  scrollToRow: (ri: number) => void;
17
19
  getVisibleLeaves: () => ColumnDef<T>[];
@@ -19,6 +19,8 @@ export interface ChartManagerDeps {
19
19
  off(ev: string, cb: (...a: any[]) => void): void;
20
20
  emit(ev: string, ...args: any[]): void;
21
21
  announce(msg: string): void;
22
+ /** i18n: 차트 배지·패널 aria·announce 해석. / i18n: resolve chart badges/panel-aria/announce. */
23
+ t(key: string, params?: Record<string, string | number>): string;
22
24
  }
23
25
  export type { ChartInstance } from './chart/types.js';
24
26
  export declare class ChartManager {