open-grid 1.0.0 → 1.0.2

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 (44) hide show
  1. package/NOTICE +21 -0
  2. package/README.md +8 -0
  3. package/THIRD_PARTY_LICENSES.txt +229 -0
  4. package/dist/{OpenGrid-C6SK6VeK.cjs → OpenGrid-B7dLL9eH.cjs} +2 -2
  5. package/dist/{OpenGrid-C6SK6VeK.cjs.map → OpenGrid-B7dLL9eH.cjs.map} +1 -1
  6. package/dist/{OpenGrid-D7EJOVi1.js → OpenGrid-v528T7RJ.js} +3 -3
  7. package/dist/{OpenGrid-D7EJOVi1.js.map → OpenGrid-v528T7RJ.js.map} +1 -1
  8. package/dist/open-grid-react.cjs +1 -1
  9. package/dist/open-grid-react.js +1 -1
  10. package/dist/open-grid-vue.cjs +1 -1
  11. package/dist/open-grid-vue.js +1 -1
  12. package/dist/open-grid.cjs +1 -1
  13. package/dist/open-grid.js +2 -2
  14. package/dist/types/core/CellEditManager.d.ts +2 -2
  15. package/dist/types/core/CellEventHandler.d.ts +4 -4
  16. package/dist/types/core/CellTypeRegistry.d.ts +1 -1
  17. package/dist/types/core/ColumnLayout.d.ts +1 -1
  18. package/dist/types/core/ContextMenu.d.ts +1 -1
  19. package/dist/types/core/CrossGridRegistry.d.ts +1 -1
  20. package/dist/types/core/DataLayer.d.ts +1 -1
  21. package/dist/types/core/ExportManager.d.ts +2 -2
  22. package/dist/types/core/FilterPanel.d.ts +1 -1
  23. package/dist/types/core/FilterSelect.d.ts +1 -1
  24. package/dist/types/core/FindBarManager.d.ts +4 -4
  25. package/dist/types/core/FormulaEngine.d.ts +1 -1
  26. package/dist/types/core/GridRenderer.d.ts +1 -1
  27. package/dist/types/core/GridShuttle.d.ts +1 -1
  28. package/dist/types/core/GroupEngine.d.ts +1 -1
  29. package/dist/types/core/GroupTreeManager.d.ts +2 -2
  30. package/dist/types/core/KeyboardManager.d.ts +4 -4
  31. package/dist/types/core/OpenGrid.d.ts +4 -4
  32. package/dist/types/core/PivotEngine.d.ts +1 -1
  33. package/dist/types/core/SortFilterManager.d.ts +5 -5
  34. package/dist/types/core/TriggerManager.d.ts +1 -1
  35. package/dist/types/core/WorksheetManager.d.ts +1 -1
  36. package/dist/types/core/editors/CellEditor.d.ts +2 -2
  37. package/dist/types/core/editors/DateEditor.d.ts +2 -2
  38. package/dist/types/core/editors/SelectEditor.d.ts +2 -2
  39. package/dist/types/core/renderers/CellRenderer.d.ts +1 -1
  40. package/dist/types/index.d.ts +0 -1
  41. package/dist/types/react/OpenGrid.d.ts +2 -3
  42. package/dist/types/vue/OpenGrid.vue.d.ts +15 -55
  43. package/dist/types/vue/types.d.ts +1 -1
  44. package/package.json +7 -4
package/NOTICE ADDED
@@ -0,0 +1,21 @@
1
+ OPEN_GRID
2
+ Copyright (c) 2026 OPEN_GRID Contributors
3
+
4
+ This product is licensed under the MIT License (see LICENSE).
5
+
6
+ This product bundles third-party components that are licensed under the
7
+ Apache License, Version 2.0. Their attribution notices are reproduced below,
8
+ and the full license texts are provided in THIRD_PARTY_LICENSES.txt.
9
+
10
+ -----------------------------------------------------------------------
11
+ SheetJS Community Edition (xlsx)
12
+ Copyright (C) 2012-present SheetJS LLC
13
+ https://sheetjs.com/
14
+ Licensed under the Apache License, Version 2.0.
15
+
16
+ xlsx-js-style
17
+ Copyright (C) 2012-present SheetJS LLC
18
+ Copyright (C) 2021-present Brent Ely (gitbrent)
19
+ https://github.com/gitbrent/xlsx-js-style/
20
+ Licensed under the Apache License, Version 2.0.
21
+ -----------------------------------------------------------------------
package/README.md CHANGED
@@ -365,3 +365,11 @@ CSS 변수로 완전한 테마 커스터마이즈 가능:
365
365
  ## License
366
366
 
367
367
  MIT © OPEN_GRID Contributors
368
+
369
+ ### Third-party licenses
370
+
371
+ The bundled Excel export uses **SheetJS Community Edition (`xlsx`)** and
372
+ **`xlsx-js-style`**, both licensed under the **Apache License, Version 2.0**
373
+ (© SheetJS LLC, and Brent Ely for the style fork). Their attribution notices
374
+ and the full license text are included in [`NOTICE`](NOTICE) and
375
+ [`THIRD_PARTY_LICENSES.txt`](THIRD_PARTY_LICENSES.txt).
@@ -0,0 +1,229 @@
1
+ OPEN_GRID — Third-Party Software Licenses
2
+ =========================================
3
+
4
+ The OPEN_GRID distribution (the `dist/` directory of the published npm package)
5
+ bundles the following third-party open-source components. OPEN_GRID itself is
6
+ licensed under the MIT License (see LICENSE). The components below are
7
+ redistributed under the Apache License, Version 2.0, a copy of which is
8
+ reproduced in full at the end of this file.
9
+
10
+ -----------------------------------------------------------------------
11
+ 1. SheetJS Community Edition (xlsx)
12
+ Copyright (C) 2012-present SheetJS LLC
13
+ Homepage: https://sheetjs.com/
14
+ License: Apache License, Version 2.0
15
+ Bundled as: dist/xlsx.min-*.js (used by the Excel export feature)
16
+
17
+ 2. xlsx-js-style
18
+ Copyright (C) 2012-present SheetJS LLC
19
+ Copyright (C) 2021-present Brent Ely (gitbrent)
20
+ Homepage: https://github.com/gitbrent/xlsx-js-style/
21
+ License: Apache License, Version 2.0
22
+ (A style-preserving fork of SheetJS Community Edition; portions of its
23
+ code are bundled together with the Excel export feature.)
24
+ -----------------------------------------------------------------------
25
+
26
+ The complete text of the Apache License, Version 2.0 follows.
27
+
28
+
29
+ Apache License
30
+ Version 2.0, January 2004
31
+ http://www.apache.org/licenses/
32
+
33
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
34
+
35
+ 1. Definitions.
36
+
37
+ "License" shall mean the terms and conditions for use, reproduction,
38
+ and distribution as defined by Sections 1 through 9 of this document.
39
+
40
+ "Licensor" shall mean the copyright owner or entity authorized by
41
+ the copyright owner that is granting the License.
42
+
43
+ "Legal Entity" shall mean the union of the acting entity and all
44
+ other entities that control, are controlled by, or are under common
45
+ control with that entity. For the purposes of this definition,
46
+ "control" means (i) the power, direct or indirect, to cause the
47
+ direction or management of such entity, whether by contract or
48
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
49
+ outstanding shares, or (iii) beneficial ownership of such entity.
50
+
51
+ "You" (or "Your") shall mean an individual or Legal Entity
52
+ exercising permissions granted by this License.
53
+
54
+ "Source" form shall mean the preferred form for making modifications,
55
+ including but not limited to software source code, documentation
56
+ source, and configuration files.
57
+
58
+ "Object" form shall mean any form resulting from mechanical
59
+ transformation or translation of a Source form, including but
60
+ not limited to compiled object code, generated documentation,
61
+ and conversions to other media types.
62
+
63
+ "Work" shall mean the work of authorship, whether in Source or
64
+ Object form, made available under the License, as indicated by a
65
+ copyright notice that is included in or attached to the work
66
+ (an example is provided in the Appendix below).
67
+
68
+ "Derivative Works" shall mean any work, whether in Source or Object
69
+ form, that is based on (or derived from) the Work and for which the
70
+ editorial revisions, annotations, elaborations, or other modifications
71
+ represent, as a whole, an original work of authorship. For the purposes
72
+ of this License, Derivative Works shall not include works that remain
73
+ separable from, or merely link (or bind by name) to the interfaces of,
74
+ the Work and Derivative Works thereof.
75
+
76
+ "Contribution" shall mean any work of authorship, including
77
+ the original version of the Work and any modifications or additions
78
+ to that Work or Derivative Works thereof, that is intentionally
79
+ submitted to Licensor for inclusion in the Work by the copyright owner
80
+ or by an individual or Legal Entity authorized to submit on behalf of
81
+ the copyright owner. For the purposes of this definition, "submitted"
82
+ means any form of electronic, verbal, or written communication sent
83
+ to the Licensor or its representatives, including but not limited to
84
+ communication on electronic mailing lists, source code control systems,
85
+ and issue tracking systems that are managed by, or on behalf of, the
86
+ Licensor for the purpose of discussing and improving the Work, but
87
+ excluding communication that is conspicuously marked or otherwise
88
+ designated in writing by the copyright owner as "Not a Contribution."
89
+
90
+ "Contributor" shall mean Licensor and any individual or Legal Entity
91
+ on behalf of whom a Contribution has been received by Licensor and
92
+ subsequently incorporated within the Work.
93
+
94
+ 2. Grant of Copyright License. Subject to the terms and conditions of
95
+ this License, each Contributor hereby grants to You a perpetual,
96
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
97
+ copyright license to reproduce, prepare Derivative Works of,
98
+ publicly display, publicly perform, sublicense, and distribute the
99
+ Work and such Derivative Works in Source or Object form.
100
+
101
+ 3. Grant of Patent License. Subject to the terms and conditions of
102
+ this License, each Contributor hereby grants to You a perpetual,
103
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
104
+ (except as stated in this section) patent license to make, have made,
105
+ use, offer to sell, sell, import, and otherwise transfer the Work,
106
+ where such license applies only to those patent claims licensable
107
+ by such Contributor that are necessarily infringed by their
108
+ Contribution(s) alone or by combination of their Contribution(s)
109
+ with the Work to which such Contribution(s) was submitted. If You
110
+ institute patent litigation against any entity (including a
111
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
112
+ or a Contribution incorporated within the Work constitutes direct
113
+ or contributory patent infringement, then any patent licenses
114
+ granted to You under this License for that Work shall terminate
115
+ as of the date such litigation is filed.
116
+
117
+ 4. Redistribution. You may reproduce and distribute copies of the
118
+ Work or Derivative Works thereof in any medium, with or without
119
+ modifications, and in Source or Object form, provided that You
120
+ meet the following conditions:
121
+
122
+ (a) You must give any other recipients of the Work or
123
+ Derivative Works a copy of this License; and
124
+
125
+ (b) You must cause any modified files to carry prominent notices
126
+ stating that You changed the files; and
127
+
128
+ (c) You must retain, in the Source form of any Derivative Works
129
+ that You distribute, all copyright, patent, trademark, and
130
+ attribution notices from the Source form of the Work,
131
+ excluding those notices that do not pertain to any part of
132
+ the Derivative Works; and
133
+
134
+ (d) If the Work includes a "NOTICE" text file as part of its
135
+ distribution, then any Derivative Works that You distribute must
136
+ include a readable copy of the attribution notices contained
137
+ within such NOTICE file, excluding those notices that do not
138
+ pertain to any part of the Derivative Works, in at least one
139
+ of the following places: within a NOTICE text file distributed
140
+ as part of the Derivative Works; within the Source form or
141
+ documentation, if provided along with the Derivative Works; or,
142
+ within a display generated by the Derivative Works, if and
143
+ wherever such third-party notices normally appear. The contents
144
+ of the NOTICE file are for informational purposes only and
145
+ do not modify the License. You may add Your own attribution
146
+ notices within Derivative Works that You distribute, alongside
147
+ or as an addendum to the NOTICE text from the Work, provided
148
+ that such additional attribution notices cannot be construed
149
+ as modifying the License.
150
+
151
+ You may add Your own copyright statement to Your modifications and
152
+ may provide additional or different license terms and conditions
153
+ for use, reproduction, or distribution of Your modifications, or
154
+ for any such Derivative Works as a whole, provided Your use,
155
+ reproduction, and distribution of the Work otherwise complies with
156
+ the conditions stated in this License.
157
+
158
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
159
+ any Contribution intentionally submitted for inclusion in the Work
160
+ by You to the Licensor shall be under the terms and conditions of
161
+ this License, without any additional terms or conditions.
162
+ Notwithstanding the above, nothing herein shall supersede or modify
163
+ the terms of any separate license agreement you may have executed
164
+ with Licensor regarding such Contributions.
165
+
166
+ 6. Trademarks. This License does not grant permission to use the trade
167
+ names, trademarks, service marks, or product names of the Licensor,
168
+ except as required for reasonable and customary use in describing the
169
+ origin of the Work and reproducing the content of the NOTICE file.
170
+
171
+ 7. Disclaimer of Warranty. Unless required by applicable law or
172
+ agreed to in writing, Licensor provides the Work (and each
173
+ Contributor provides its Contributions) on an "AS IS" BASIS,
174
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
175
+ implied, including, without limitation, any warranties or conditions
176
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
177
+ PARTICULAR PURPOSE. You are solely responsible for determining the
178
+ appropriateness of using or redistributing the Work and assume any
179
+ risks associated with Your exercise of permissions under this License.
180
+
181
+ 8. Limitation of Liability. In no event and under no legal theory,
182
+ whether in tort (including negligence), contract, or otherwise,
183
+ unless required by applicable law (such as deliberate and grossly
184
+ negligent acts) or agreed to in writing, shall any Contributor be
185
+ liable to You for damages, including any direct, indirect, special,
186
+ incidental, or consequential damages of any character arising as a
187
+ result of this License or out of the use or inability to use the
188
+ Work (including but not limited to damages for loss of goodwill,
189
+ work stoppage, computer failure or malfunction, or any and all
190
+ other commercial damages or losses), even if such Contributor
191
+ has been advised of the possibility of such damages.
192
+
193
+ 9. Accepting Warranty or Additional Liability. While redistributing
194
+ the Work or Derivative Works thereof, You may choose to offer,
195
+ and charge a fee for, acceptance of support, warranty, indemnity,
196
+ or other liability obligations and/or rights consistent with this
197
+ License. However, in accepting such obligations, You may act only
198
+ on Your own behalf and on Your sole responsibility, not on behalf
199
+ of any other Contributor, and only if You agree to indemnify,
200
+ defend, and hold each Contributor harmless for any liability
201
+ incurred by, or claims asserted against, such Contributor by reason
202
+ of your accepting any such warranty or additional liability.
203
+
204
+ END OF TERMS AND CONDITIONS
205
+
206
+ APPENDIX: How to apply the Apache License to your work.
207
+
208
+ To apply the Apache License to your work, attach the following
209
+ boilerplate notice, with the fields enclosed by brackets "{}"
210
+ replaced with your own identifying information. (Don't include
211
+ the brackets!) The text should be enclosed in the appropriate
212
+ comment syntax for the file format. We also recommend that a
213
+ file or class name and description of purpose be included on the
214
+ same "printed page" as the copyright notice for easier
215
+ identification within third-party archives.
216
+
217
+ Copyright (C) 2012-present SheetJS LLC
218
+
219
+ Licensed under the Apache License, Version 2.0 (the "License");
220
+ you may not use this file except in compliance with the License.
221
+ You may obtain a copy of the License at
222
+
223
+ http://www.apache.org/licenses/LICENSE-2.0
224
+
225
+ Unless required by applicable law or agreed to in writing, software
226
+ distributed under the License is distributed on an "AS IS" BASIS,
227
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
228
+ See the License for the specific language governing permissions and
229
+ limitations under the License.
@@ -85,6 +85,6 @@ function mapRow(src) {
85
85
  `+e.join(`
86
86
  `)+(e.length?`
87
87
  `:"")+` };
88
- }`}function os(d){return e=>{const t={};for(const[s,o]of Object.entries(d))o!==he&&(t[s]=e[o]);return t}}function ns(d,e){if(d.length!==e.length)return!1;const t=new Set(e);return d.every(s=>t.has(s))}function rs(d,e){return new Promise(t=>{const s=new Set(d.map(R=>R.field)),o={};for(const R of e)o[R.field]=s.has(R.field)?R.field:he;const i=document.createElement("div");i.className="og-mapper-overlay",i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-label","그리드 필드 매핑"),i.style.cssText="position:fixed;inset:0;z-index:100000;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;font-family:var(--og-font-family,-apple-system,sans-serif);";const n=document.createElement("div");n.style.cssText="background:#fff;border-radius:10px;box-shadow:0 12px 40px rgba(0,0,0,0.3);width:min(620px,92vw);max-height:88vh;overflow:auto;color:#222;",i.appendChild(n);const r=document.createElement("div");r.style.cssText="padding:18px 20px 8px;",r.innerHTML='<div style="font-size:16px;font-weight:700;">필드 매핑</div><div style="font-size:12.5px;color:#666;margin-top:4px;line-height:1.5;">두 그리드의 필드 구조가 다릅니다. <b>타깃 필드</b>마다 어떤 <b>소스 필드</b>의 값을 가져올지 지정하세요. 아래 스크립트를 복사해 <code>crossGridMapping</code> 에 baking 하면 다음부터는 이 창 없이 자동 변환됩니다.</div>',n.appendChild(r);const l=document.createElement("div");l.style.cssText="padding:6px 20px;";const a='<option value="">(비움)</option>'+d.map(R=>`<option value="${ie(R.field)}">${ie(R.header)} &lt;${ie(R.field)}&gt;</option>`).join("");for(const R of e){const F=document.createElement("div");F.style.cssText="display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #f0f0f0;";const I=document.createElement("div");I.style.cssText="flex:1;font-size:13px;min-width:0;",I.innerHTML=`<span style="font-weight:600;">${ie(R.header)}</span><span style="color:#999;font-size:11.5px;"> &lt;${ie(R.field)}&gt;</span>`;const T=document.createElement("span");T.textContent="←",T.style.cssText="color:#888;flex-shrink:0;";const A=document.createElement("select");A.style.cssText="flex:1;min-width:0;padding:6px 8px;border:1px solid #ccc;border-radius:6px;font-size:13px;background:#fff;",A.innerHTML=a,A.value=o[R.field]??he,A.addEventListener("change",()=>{o[R.field]=A.value,m()}),F.append(I,T,A),l.appendChild(F)}n.appendChild(l);const c=document.createElement("div");c.style.cssText="padding:10px 20px 4px;";const u=document.createElement("div");u.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;",u.innerHTML='<span style="font-size:12.5px;font-weight:600;color:#444;">생성된 변환 스크립트</span>';const h=document.createElement("button");h.type="button",h.textContent="복사",h.style.cssText="font-size:12px;padding:4px 10px;border:1px solid #ccc;border-radius:6px;background:#f7f7f7;cursor:pointer;",u.appendChild(h);const g=document.createElement("pre");g.style.cssText="margin:0;background:#0d1117;color:#c9d1d9;padding:12px;border-radius:8px;font-family:ui-monospace,Consolas,monospace;font-size:12px;line-height:1.5;overflow:auto;max-height:180px;",c.append(u,g),n.appendChild(c);function k(){return st(o)}function m(){g.textContent=k()}m(),h.addEventListener("click",()=>{var F;const R=k();(F=navigator.clipboard)==null||F.writeText(R).then(()=>{h.textContent="복사됨!",setTimeout(()=>h.textContent="복사",1200)},()=>{h.textContent="복사 실패",setTimeout(()=>h.textContent="복사",1200)})});const w=document.createElement("div");w.style.cssText="display:flex;justify-content:flex-end;gap:8px;padding:14px 20px 18px;";const x=document.createElement("button");x.type="button",x.textContent="취소",x.style.cssText="font-size:13px;padding:8px 16px;border:1px solid #ccc;border-radius:7px;background:#fff;cursor:pointer;";const _=document.createElement("button");_.type="button",_.textContent="적용 후 이동",_.style.cssText="font-size:13px;padding:8px 16px;border:0;border-radius:7px;background:#1976d2;color:#fff;cursor:pointer;font-weight:600;",w.append(x,_),n.appendChild(w);let b=!1;function L(R){b||(b=!0,document.removeEventListener("keydown",v),i.remove(),t(R))}function v(R){R.key==="Escape"&&L(null)}x.addEventListener("click",()=>L(null)),i.addEventListener("mousedown",R=>{R.target===i&&L(null)}),_.addEventListener("click",()=>L({mapping:{...o},script:k()})),document.addEventListener("keydown",v),document.body.appendChild(i),_.focus()})}function ie(d){return String(d).replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}class ls{constructor(){this._map=new Map}register(e,t){this._map.set(e,t)}unregister(e){this._map.delete(e)}get(e){return this._map.get(e)}get size(){return this._map.size}resolveAt(e,t,s){const o=document.elementFromPoint(e,t),i=o==null?void 0:o.closest(".og-body-wrapper");if(!i)return null;const n=this._map.get(i);return!n||n===s?null:n}}const ce=new ls;class as{constructor(e,t){this._originals=new Map,this._hadOwn=new Map,this._stack=new Map,this._strategies=new Map,this._callPath=[],this._host=e,this._strict=(t==null?void 0:t.strict)??!0,this._maxDepth=(t==null?void 0:t.maxDepth)??32}override(e,t,s={}){if(typeof t!="function")throw new TypeError(`OverrideKernel.override: fn for "${e}" must be a function`);if(!this._originals.has(e)){const i=this._host[e];if(typeof i!="function")throw new TypeError(`OverrideKernel.override: host["${e}"] is not a function`);this._hadOwn.set(e,Object.prototype.hasOwnProperty.call(this._host,e)),this._originals.set(e,i.bind(this._host))}const o=this._stack.get(e)??[];return o.push({fn:t,opts:s}),this._stack.set(e,o),this._host[e]=this._buildDispatcher(e),this._host}_buildDispatcher(e){var a;const t=this._originals.get(e),s=this._stack.get(e)??[],o=s.reduce((c,u)=>(...h)=>u.fn(c,...h),t),i=((a=s[s.length-1])==null?void 0:a.opts)??{},n=i.reentrant===!0,r=i.onError==="fallback",l=this;return function(...c){if(!n&&l._callPath.indexOf(e)!==-1)return t(...c);if(l._callPath.length>=l._maxDepth){if(l._strict&&!r)throw new Error(`OverrideKernel: max override depth (${l._maxDepth}) exceeded at "${e}"`);return t(...c)}l._callPath.push(e);try{return o(...c)}catch(u){if(r&&!l._strict)return console.warn(`[og.override:${e}]`,u),t(...c);if(r&&l._strict)return console.warn(`[og.override:${e}]`,u),t(...c);throw u}finally{l._callPath.pop()}}}strategy(e,t){if(typeof t!="function")throw new TypeError(`OverrideKernel.strategy: fn for "${e}" must be a function`);return this._strategies.set(e,t),this._host}getStrategy(e,t){return this._strategies.get(e)??t}hasStrategy(e){return this._strategies.has(e)}restore(e){return this._originals.has(e)?(this._hadOwn.get(e)?this._host[e]=this._originals.get(e):delete this._host[e],this._originals.delete(e),this._hadOwn.delete(e),this._stack.delete(e),this._host):this._host}restoreAll(){for(const e of[...this._originals.keys()])this.restore(e);return this._strategies.clear(),this._callPath=[],this._host}hasOverride(e){return this._originals.has(e)}getOverrideNames(){return[...this._originals.keys()]}}const Ue="_ogRowId",V=class V extends ot{constructor(e,t){var i;super(),this._vs=null,this._ro=null,this._renderer=null,this._trigMgr=new is,this._destroyed=!1,this._autoHeightWarned=!1,this._colWidths=[],this._userWidths=new Map,this._filterPanel=null,this._filterSelect=null,this._pagination=null,this._dnd=null,this._mergeEngine=new Z,this._liveRegion=null,this._ctxMenu=null,this._cmHandler=null,this._cmKbdHandler=null,this._wsManager=null;const s=typeof e=="string"?document.querySelector(e):e;if(!s)throw new Error(`OpenGrid: container not found: ${e}`);this._container=s,this._options={height:"100%",width:"100%",rowHeight:32,headerHeight:34,footerHeight:30,autoHeight:!1,fillWidth:!1,defaultColumnWidth:100,editable:!1,editMode:"dblclick",history:!0,historySize:100,selection:"single",clipboard:!0,sortable:!0,multiSort:!0,filterable:!0,defaultSort:[],frozenColumns:0,frozenRows:0,rowNumber:!1,stateColumn:!1,checkColumn:!1,draggable:!1,crossGrid:!1,crossGridMapping:"auto",mergeCells:!1,groupBy:[],summary:void 0,treeMode:"auto",treeId:"id",treeParentId:"parentId",expandOnLoad:!1,pagination:!1,pageSize:50,footer:void 0,footerPosition:"bottom",theme:"default",cssVars:{},ariaLabel:"OPEN_GRID 데이터 그리드",...t},this._data=new rt(Ue),this._rowMgr=new It(this._data),this._colLayout=new ue(this._options.columns,this._options.frozenColumns),this._editMgr=new Bt({data:this._data,colLayout:this._colLayout,getRenderer:()=>this._renderer,getContainer:()=>this._container,getOptions:()=>this._options,emit:(n,...r)=>this.emit(n,...r),doRender:()=>this._doRender(...this._visRange()),announce:n=>this._announce(n),writeCell:(n,r,l)=>this.writeCell(n,r,l),scrollToRow:n=>{var r;return(r=this._vs)==null?void 0:r.scrollToRow(n)},getVisibleLeaves:()=>this._colLayout.visibleLeaves}),this._exportMgr=new Ut({getData:()=>this._data.getData(),getColLayout:()=>this._colLayout,getColWidths:()=>this._colWidths,getOptions:()=>this._options,getContainer:()=>this._container,getMaskEnabled:n=>this.getMaskEnabled(n),getWsManager:()=>this._wsManager,getStrategy:(n,r)=>this._ovk.getStrategy(n,r)}),this._footerMgr=new Gt({getData:()=>this._data.getData(),getColLayout:()=>this._colLayout,getColWidths:()=>this._colWidths,getOptions:()=>this._options,getContainer:()=>this._container,getStrategy:(n,r)=>this._ovk.getStrategy(n,r)}),this._kbdMgr=new qt({getEditMgr:()=>this._editMgr,getRowMgr:()=>this._rowMgr,getData:()=>this._data,getColLayout:()=>this._colLayout,getOptions:()=>this._options,setFocusCell:(n,r)=>this._setFocusCell(n,r),handleRowDrop:(n,r)=>this._handleRowDrop(n,r),doRender:()=>this._doRender(...this._visRange()),announce:n=>this._announce(n),emit:(n,...r)=>this.emit(n,...r),visRange:()=>this._visRange(),handleCellKeyEvt:(n,r)=>this._handleCellKeyEvt(n,r)}),this._sfMgr=new ts({getData:()=>this._data,getColLayout:()=>this._colLayout,getFindFilter:()=>this._findMgr.findFilter,getVs:()=>this._vs,getPagination:()=>this._pagination,getOptions:()=>this._options,renderHeader:()=>this._renderHeader(),doRender:()=>this._doRender(...this._visRange()),announce:n=>this._announce(n),emit:(n,...r)=>this.emit(n,...r)}),this._findMgr=new Xt({getColLayout:()=>this._colLayout,getData:()=>this._data,getFilters:()=>this._sfMgr.filters,getVs:()=>this._vs,getPagination:()=>this._pagination,doRender:()=>this._doRender(...this._visRange())}),this._cellEvt=new ss({getData:()=>this._data,getColLayout:()=>this._colLayout,getOptions:()=>this._options,getEditMgr:()=>this._editMgr,getRowMgr:()=>this._rowMgr,emit:(n,...r)=>this.emit(n,...r),writeCell:(n,r,l)=>this.writeCell(n,r,l),doRender:()=>this._doRender(...this._visRange()),getContainer:()=>this._container}),this._grpMgr=new es({getData:()=>this._data.getData(),getDataLayer:()=>this._data,getOptions:()=>this._options,getVs:()=>this._vs,doRenderFull:n=>this._doRender(0,n-1),doRender:()=>this._doRender(...this._visRange()),getStrategy:(n,r)=>this._ovk.getStrategy(n,r)}),this._mount(),this._bindOptionEvents(),(i=this._options.defaultSort)!=null&&i.length&&this._sfMgr.initSort(this._options.defaultSort),this._ovk=new as(this,{strict:this._options.overrideStrict??!0}),this._data.setStrategyResolver((n,r)=>this._ovk.getStrategy(n,r)),bt((n,r,l)=>{var a;return((a=this._ovk.getStrategy("displayFormatter",null))==null?void 0:a(n,r,l))??null}),this.override=Object.assign((n,r,l)=>this._ovk.override(n,r,l),{strategy:(n,r)=>this._ovk.strategy(n,r)});const o=this.destroy.bind(this);this.destroy=()=>{try{o()}finally{this._ovk.restoreAll()}};for(const[n,r]of V._defaultStrategies)this._ovk.strategy(n,r);for(const[n,r,l]of V._defaultOverrides)this._ovk.override(n,r,l);requestAnimationFrame(()=>{var n,r;this.emit("ready",this),(r=(n=this._options).onReady)==null||r.call(n,this)})}static defaultOverride(e,t,s={}){return V._defaultOverrides.push([e,t,s]),V}restore(e){return this._ovk.restore(e),this}restoreAll(){return this._ovk.restoreAll(),this}hasOverride(e){return this._ovk.hasOverride(e)}getOverrideNames(){return this._ovk.getOverrideNames()}getStrategy(e,t){return this._ovk.getStrategy(e,t)}_mount(){var s,o;this._container.classList.add("og-container");const e=this._options.height,t=this._options.width;this._container.style.height=typeof e=="number"?`${e}px`:String(e),this._container.style.width=typeof t=="number"?`${t}px`:String(t),this._container.style.display="flex",this._container.style.flexDirection="column",this._container.style.overflow="hidden",this._container.style.boxSizing="border-box",this._container.style.border="1px solid var(--og-border-color, #e0e0e0)",this._container.style.fontFamily="var(--og-font-family, -apple-system, sans-serif)",this._container.style.fontSize="var(--og-font-size, 13px)",this._container.setAttribute("data-og-theme",this._options.theme);for(const[i,n]of Object.entries(this._options.cssVars))this._container.style.setProperty(i,n);this._renderer=new Ht(this._container,this._options,{onHeaderClick:(i,n)=>this._handleSortClick(i,n),onCellClick:(i,n,r)=>this._handleCellClick(i,n,r),onCellDblClick:(i,n,r)=>this._handleCellDblClick(i,n,r),onCellMouseOver:(i,n,r)=>this._handleCellMouseOver(i,n,r),onCellMouseOut:(i,n,r)=>this._handleCellMouseOut(i,n,r),onCellMouseDown:(i,n,r)=>this._handleCellMouseDown(i,n,r),onCellMouseUp:(i,n,r)=>this._handleCellMouseUp(i,n,r),onCellMouseMove:(i,n,r)=>this._handleCellMouseMove(i,n,r),onRowCheck:(i,n)=>this._handleRowCheck(i,n),onAllCheck:i=>this._handleAllCheck(i),onColResize:(i,n)=>this._handleColResize(i,n),onFilterIconClick:(i,n)=>this._handleFilterIconClick(i,n),getDndManager:()=>this._dnd,onColDragStart:i=>{this._editMgr.dragColIdx=i},onColDrop:i=>{this._editMgr.dragColIdx!==null&&this._editMgr.dragColIdx!==i&&this._reorderColumn(this._editMgr.dragColIdx,i),this._editMgr.dragColIdx=null},getColDragIdx:()=>this._editMgr.dragColIdx}),this._filterPanel=new dt(this._container,(i,n)=>this.setFilter(i,n),i=>this.resetFilter(i)),this._container.setAttribute("role","grid"),this._container.setAttribute("aria-label",this._options.ariaLabel??((s=this._options.cssVars)==null?void 0:s["aria-label"])??"OPEN_GRID 데이터 그리드"),this._container.setAttribute("aria-rowcount","0"),this._container.setAttribute("aria-colcount",String(this._options.columns.filter(i=>!i.hidden).length)),this._liveRegion=document.createElement("div"),this._liveRegion.setAttribute("aria-live","polite"),this._liveRegion.setAttribute("aria-atomic","true"),this._liveRegion.className="og-live-region",this._container.insertAdjacentElement("beforebegin",this._liveRegion),this._container.tabIndex=0,this._container.addEventListener("keydown",i=>this._handleKeyDown(i)),this._container.addEventListener("keyup",i=>this._handleCellKeyEvt("cellKeyUp",i)),this._container.addEventListener("keypress",i=>this._handleCellKeyEvt("cellKeyPress",i)),this._vs=new at(this._renderer.bodyWrapper,{rowHeight:this._options.rowHeight,onRender:(i,n)=>this._doRender(i,n)}),ce.register(this._renderer.bodyWrapper,this),this._options.draggable&&(this._dnd=new Pt(this._renderer.bodyWrapper,this._options.rowHeight,(i,n)=>this._handleRowDrop(i,n),this._options.crossGrid?{resolveTarget:(i,n)=>{const r=ce.resolveAt(i,n,this);return!r||!r._options.crossGrid?null:{bodyEl:r._crossBodyEl(),rowHeight:r._options.rowHeight,totalRows:r._data.rowCount}},onCrossDrop:(i,n,r)=>this._handleCrossGridDrop(i,n,r)}:void 0,i=>this._dragRowSet(i).length)),this._options.pagination&&(this._pagination=new Wt(this._container,this._options.pageSize,i=>{this.emit("pageChange",i),this._doRender(...this._visRange())})),this._findMgr.init(this._container),this._initContextMenu(),(o=this._options.worksheets)!=null&&o.length&&this._initWorksheets(),this._ro=new ResizeObserver(()=>this._onResize()),this._ro.observe(this._container),this._onResize()}_initContextMenu(){const e=this._options.contextMenu;e!==!1&&(this._cmHandler&&this._container.removeEventListener("contextmenu",this._cmHandler),this._cmKbdHandler&&this._container.removeEventListener("keydown",this._cmKbdHandler),this._cmHandler=this._cmKbdHandler=null,this._ctxMenu=new jt(this._container,{onSortAsc:()=>{const t=this._colLayout.visibleLeaves[0];t&&this.orderBy(t.field,"asc")},onSortDesc:()=>{const t=this._colLayout.visibleLeaves[0];t&&this.orderBy(t.field,"desc")},onFind:()=>this._findMgr.open(),onExcel:()=>this.exportExcel(),onCsv:()=>this.exportCsv(),onPrint:()=>this.print()}),this._cmHandler=t=>{var r;const s=t.target.closest(".og-cell");if(!s)return;t.preventDefault();const o=Number(s.dataset.colIndex??-1),i=this._colLayout.visibleLeaves[o];i&&this._ctxMenu&&(this._ctxMenu._actions.onSortAsc=()=>this.orderBy(i.field,"asc"),this._ctxMenu._actions.onSortDesc=()=>this.orderBy(i.field,"desc"));const n=Array.isArray(e)?e:void 0;(r=this._ctxMenu)==null||r.open(t,n)},this._container.addEventListener("contextmenu",this._cmHandler),this._cmKbdHandler=t=>{var s;if(t.shiftKey&&t.key==="F10"){t.preventDefault();const o=this._container.getBoundingClientRect(),i={clientX:o.left+80,clientY:o.top+40};(s=this._ctxMenu)==null||s.open(i)}},this._container.addEventListener("keydown",this._cmKbdHandler))}openContextMenu(e,t){var s;(s=this._ctxMenu)==null||s.open(e,t)}closeContextMenu(){var e;(e=this._ctxMenu)==null||e.close()}setFilterSelect(e){var t;(t=this._filterSelect)==null||t.destroy(),this._filterSelect=null,e&&(this._container.id||(this._container.id=`og-${Math.random().toString(36).slice(2,7)}`),this._filterSelect=new Ot(this._container,e,(s,o)=>this.setFilter(s,o),s=>this.resetFilter(s),this._container.id))}setOptions(e){var t;if(Object.assign(this._options,e),"contextMenu"in e&&((t=this._ctxMenu)==null||t.destroy(),this._ctxMenu=null,this._initContextMenu()),"groupBy"in e||"summary"in e){const s=e.groupBy??[];s.length>0?this._grpMgr.groupBy(s):this.clearGroup();return}this._renderHeader(),this._doRender(...this._visRange())}setMaskEnabled(e,t){var o;const s=this._colLayout.getColumnByField(e);s&&(t?(s._maskRevealed=!1,(o=s._maskRevealedRows)==null||o.clear()):s._maskRevealed=!0,this._doRender(...this._visRange()))}getMaskEnabled(e){const t=this._colLayout.getColumnByField(e);return t?t._maskRevealed!==!0:!1}_initWorksheets(){const e=this._options.worksheets;this._wsManager=new Ve(this._container,(t,s)=>{this._data.setData(s.data),this._colLayout=new ue(s.columns.length?s.columns:this._options.columns,this._options.frozenColumns),this._doRender(...this._visRange()),this._renderHeader()});for(const t of e)this._wsManager.add(t.name,t.columns??this._options.columns,t.data??[])}addWorksheet(e,t,s){this._wsManager||(this._wsManager=new Ve(this._container,(o,i)=>{this._data.setData(i.data),this._colLayout=new ue(i.columns.length?i.columns:this._options.columns,this._options.frozenColumns),this._doRender(...this._visRange()),this._renderHeader()})),this._wsManager.add(e,t??this._options.columns,s??[])}removeWorksheet(e){var t;(t=this._wsManager)==null||t.remove(e)}switchWorksheet(e){var t;(t=this._wsManager)==null||t.switch(e)}renameWorksheet(e,t){var s;(s=this._wsManager)==null||s.rename(e,t)}getWorksheet(e){var t;return(t=this._wsManager)==null?void 0:t.get(e)}getWorksheetNames(){var e;return((e=this._wsManager)==null?void 0:e.getNames())??[]}exportSheetsExcel(e){this._exportMgr.exportSheetsExcel(e)}_paginationHeight(){return this._options.pagination?38:0}_onResize(){const{width:e}=this._container.getBoundingClientRect();e&&(this._recalcWidths(e),this._renderHeader(),this._doRender(...this._visRange()))}_recalcWidths(e){this._colWidths=this._colLayout.computeWidths(e-(this._options.stateColumn?24:0)-(this._options.draggable?18:0)-(this._options.rowNumber?44:0)-(this._options.checkColumn?36:0),this._options.defaultColumnWidth),this._userWidths.size&&this._colLayout.visibleLeaves.forEach((t,s)=>{const o=this._userWidths.get(t.field);o!=null&&(this._colWidths[s]=o)})}_renderHeader(){var e;(e=this._renderer)==null||e.renderHeader(this._colLayout.buildHeaderCells(),this._colLayout.visibleLeaves,this._colWidths,this._sfMgr.sortList,{...this._options,_activeFilters:this._sfMgr.filters,_frozenCount:this._colLayout.frozenCount}),this._syncHeaderLayout()}_syncHeaderLayout(){if(!this._renderer||!this._vs)return;const{height:e}=this._container.getBoundingClientRect();if(!e)return;const t=this._renderer.getHeaderHeight(),s=t>this._options.headerHeight?t:this._options.headerHeight;this._renderer.updateSize(e-this._paginationHeight(),s),this._vs.setViewportHeight(e-s-this._paginationHeight())}_doRender(e,t){var i;if(!this._renderer||!this._vs)return;const s=this._vs.getVisibleRange(),o=this._options.autoHeight===!0;o&&([e,t]=this._visRange(),!this._autoHeightWarned&&t-e+1>2e3&&(this._autoHeightWarned=!0,console.warn(`[OpenGrid] autoHeight 는 가상 스크롤이 아니라 전 행(${t-e+1}행)을 렌더합니다. 행이 많으면 고정 rowHeight(가상 스크롤) 사용을 권장합니다.`))),this._renderer.renderBody(e,t,this._data,this._colLayout.visibleLeaves,this._colWidths,this._options,o?0:s.offsetY,o?0:this._vs.getTotalHeight(),this._rowMgr.selectedRows,this._rowMgr.checkedRows,this._grpMgr.isGroupMode?this._grpMgr.groupFlatRows:this._grpMgr.isTreeMode?this._grpMgr.treeFlatRows:null,n=>this._grpMgr.handleGroupToggle(n),this._grpMgr.isTreeMode?n=>this._grpMgr.handleTreeToggle(n):void 0,{_totalRows:this._data.rowCount,_frozenCount:this._colLayout.frozenCount,_focusCell:this._editMgr.focusCell},this._mergeEngine),(i=this._options.footer)!=null&&i.length&&this._renderFooterEl()}_handleGroupToggle(e){this._grpMgr.handleGroupToggle(e)}_visRange(){var t;if(this._options.pagination&&this._pagination){const{start:s,end:o}=this._pagination.getRange();return[s,o]}if(this._options.autoHeight)return[0,(this._grpMgr.isGroupMode?this._grpMgr.groupFlatRows.length:this._grpMgr.isTreeMode?this._grpMgr.treeFlatRows.length:this._data.rowCount)-1];const e=(t=this._vs)==null?void 0:t.getVisibleRange();return[(e==null?void 0:e.startIndex)??0,Math.min(((e==null?void 0:e.endIndex)??30)+this._visCount()+5,this._data.rowCount-1)]}_visCount(){const e=this._container.getBoundingClientRect().height;return Math.ceil((e-this._options.headerHeight-this._paginationHeight())/this._options.rowHeight)+5}_handleSortClick(e,t){this._sfMgr.handleSortClick(e,t)}_isToggleCol(e){return ne(e)}_handleCellClick(e,t,s){this._cellEvt.handleCellClick(e,t,s)}_handleCellDblClick(e,t,s){this._cellEvt.handleCellDblClick(e,t,s)}_handleCellMouseOver(e,t,s){this._cellEvt.handleCellMouseOver(e,t,s)}_handleCellMouseOut(e,t,s){this._cellEvt.handleCellMouseOut(e,t,s)}_handleCellMouseDown(e,t,s){this._cellEvt.handleCellMouseDown(e,t,s)}_handleCellMouseUp(e,t,s){this._cellEvt.handleCellMouseUp(e,t,s)}_handleCellMouseMove(e,t,s){this._cellEvt.handleCellMouseMove(e,t,s)}_handleCellKeyEvt(e,t){this._cellEvt.handleCellKeyEvt(e,t)}_handleRowCheck(e,t){this._rowMgr.check(e,t),this._doRender(...this._visRange()),this.emit("rowCheck",{rowIndex:e,checked:t,row:this._data.getRowByIndex(e)})}_handleFilterIconClick(e,t){var o,i;if((o=this._filterPanel)!=null&&o.isOpen){this._filterPanel.close();return}const s=this._sfMgr.filters[e]??[];(i=this._filterPanel)==null||i.open(e,t,s)}_handleAllCheck(e){this._rowMgr.checkAll(e,this._data.rowCount),this._doRender(...this._visRange()),this.emit("allCheck",{checked:e})}_handleRowDrop(e,t){var s,o;this._data.moveRow(e,t),this._doRender(...this._visRange()),this.emit("rowDrop",{fromIndex:e,toIndex:t}),(o=(s=this._options).onRowDrop)==null||o.call(s,{fromIndex:e,toIndex:t})}_crossBodyEl(){return this._renderer.bodyWrapper}_dragRowSet(e){const t=[...this._rowMgr.selectedRows];return t.length>1&&t.includes(e)?t.sort((s,o)=>s-o):[e]}_handleCrossGridDrop(e,t,s){const o=ce.get(t);!o||o===this||this.moveRowsTo(o,this._dragRowSet(e),s)}async moveRowsTo(e,t,s){const o=e;if(!o||o===this||!t.length)return!1;const i=[...new Set(t)].sort((c,u)=>c-u),n=s??o._data.rowCount;let r=i.map(c=>{const u={...this._data.getRowByIndex(c)};return delete u[Ue],u});const l=await this._resolveCrossTransform(o);if(l===!1)return!1;l&&(r=r.map(c=>l(c)));const a={sourceGrid:this,targetGrid:o,rows:r,sourceIndexes:i,targetIndex:n};return this._fireGridDropBefore(a)===!1||a.cancel||o._fireGridDropBefore(a)===!1||a.cancel?!1:(r.forEach((c,u)=>o.insertRow(c,n+u)),[...i].sort((c,u)=>u-c).forEach(c=>this.deleteRow(c)),this._fireGridDropAfter(a),o._fireGridDropAfter(a),this._fireGridDropComplete(a),o._fireGridDropComplete(a),!0)}async moveCheckedTo(e){const t=this._rowMgr.getChecked().map(s=>s.rowIndex);return t.length?(this._rowMgr.uncheckAll(),this.moveRowsTo(e,t)):!1}async _resolveCrossTransform(e){var r,l;const t=this._options.crossGridMapping;if(typeof t=="function")return t;if(t!=="interactive")return null;const s=this._colLayout.visibleLeaves.map(a=>({field:a.field,header:a.header})),o=e._colLayout.visibleLeaves.map(a=>({field:a.field,header:a.header}));if(ns(s.map(a=>a.field),o.map(a=>a.field)))return null;const i=await rs(s,o);if(!i)return!1;const n={sourceGrid:this,targetGrid:e,mapping:i.mapping,script:i.script};return this.emit("gridDropMapping",n),(l=(r=this._options).onGridDropMapping)==null||l.call(r,n),console.log(`[OpenGrid] cross-grid mapping script:
88
+ }`}function os(d){return e=>{const t={};for(const[s,o]of Object.entries(d))o!==he&&(t[s]=e[o]);return t}}function ns(d,e){if(d.length!==e.length)return!1;const t=new Set(e);return d.every(s=>t.has(s))}function rs(d,e){return new Promise(t=>{const s=new Set(d.map(R=>R.field)),o={};for(const R of e)o[R.field]=s.has(R.field)?R.field:he;const i=document.createElement("div");i.className="og-mapper-overlay",i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-label","그리드 필드 매핑"),i.style.cssText="position:fixed;inset:0;z-index:100000;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;font-family:var(--og-font-family,-apple-system,sans-serif);";const n=document.createElement("div");n.style.cssText="background:#fff;border-radius:10px;box-shadow:0 12px 40px rgba(0,0,0,0.3);width:min(620px,92vw);max-height:88vh;overflow:auto;color:#222;",i.appendChild(n);const r=document.createElement("div");r.style.cssText="padding:18px 20px 8px;",r.innerHTML='<div style="font-size:16px;font-weight:700;">필드 매핑</div><div style="font-size:12.5px;color:#666;margin-top:4px;line-height:1.5;">두 그리드의 필드 구조가 다릅니다. <b>타깃 필드</b>마다 어떤 <b>소스 필드</b>의 값을 가져올지 지정하세요. 아래 스크립트를 복사해 <code>crossGridMapping</code> 에 baking 하면 다음부터는 이 창 없이 자동 변환됩니다.</div>',n.appendChild(r);const l=document.createElement("div");l.style.cssText="padding:6px 20px;";const a='<option value="">(비움)</option>'+d.map(R=>`<option value="${ie(R.field)}">${ie(R.header)} &lt;${ie(R.field)}&gt;</option>`).join("");for(const R of e){const F=document.createElement("div");F.style.cssText="display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #f0f0f0;";const I=document.createElement("div");I.style.cssText="flex:1;font-size:13px;min-width:0;",I.innerHTML=`<span style="font-weight:600;">${ie(R.header)}</span><span style="color:#999;font-size:11.5px;"> &lt;${ie(R.field)}&gt;</span>`;const T=document.createElement("span");T.textContent="←",T.style.cssText="color:#888;flex-shrink:0;";const A=document.createElement("select");A.style.cssText="flex:1;min-width:0;padding:6px 8px;border:1px solid #ccc;border-radius:6px;font-size:13px;background:#fff;",A.innerHTML=a,A.value=o[R.field]??he,A.addEventListener("change",()=>{o[R.field]=A.value,m()}),F.append(I,T,A),l.appendChild(F)}n.appendChild(l);const c=document.createElement("div");c.style.cssText="padding:10px 20px 4px;";const u=document.createElement("div");u.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;",u.innerHTML='<span style="font-size:12.5px;font-weight:600;color:#444;">생성된 변환 스크립트</span>';const h=document.createElement("button");h.type="button",h.textContent="복사",h.style.cssText="font-size:12px;padding:4px 10px;border:1px solid #ccc;border-radius:6px;background:#f7f7f7;cursor:pointer;",u.appendChild(h);const g=document.createElement("pre");g.style.cssText="margin:0;background:#0d1117;color:#c9d1d9;padding:12px;border-radius:8px;font-family:ui-monospace,Consolas,monospace;font-size:12px;line-height:1.5;overflow:auto;max-height:180px;",c.append(u,g),n.appendChild(c);function k(){return st(o)}function m(){g.textContent=k()}m(),h.addEventListener("click",()=>{var F;const R=k();(F=navigator.clipboard)==null||F.writeText(R).then(()=>{h.textContent="복사됨!",setTimeout(()=>h.textContent="복사",1200)},()=>{h.textContent="복사 실패",setTimeout(()=>h.textContent="복사",1200)})});const w=document.createElement("div");w.style.cssText="display:flex;justify-content:flex-end;gap:8px;padding:14px 20px 18px;";const x=document.createElement("button");x.type="button",x.textContent="취소",x.style.cssText="font-size:13px;padding:8px 16px;border:1px solid #ccc;border-radius:7px;background:#fff;cursor:pointer;";const _=document.createElement("button");_.type="button",_.textContent="적용 후 이동",_.style.cssText="font-size:13px;padding:8px 16px;border:0;border-radius:7px;background:#1976d2;color:#fff;cursor:pointer;font-weight:600;",w.append(x,_),n.appendChild(w);let b=!1;function L(R){b||(b=!0,document.removeEventListener("keydown",v),i.remove(),t(R))}function v(R){R.key==="Escape"&&L(null)}x.addEventListener("click",()=>L(null)),i.addEventListener("mousedown",R=>{R.target===i&&L(null)}),_.addEventListener("click",()=>L({mapping:{...o},script:k()})),document.addEventListener("keydown",v),document.body.appendChild(i),_.focus()})}function ie(d){return String(d).replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}class ls{constructor(){this._map=new Map}register(e,t){this._map.set(e,t)}unregister(e){this._map.delete(e)}get(e){return this._map.get(e)}get size(){return this._map.size}resolveAt(e,t,s){const o=document.elementFromPoint(e,t),i=o==null?void 0:o.closest(".og-body-wrapper");if(!i)return null;const n=this._map.get(i);return!n||n===s?null:n}}const ce=new ls;class as{constructor(e,t){this._originals=new Map,this._hadOwn=new Map,this._stack=new Map,this._strategies=new Map,this._callPath=[],this._host=e,this._strict=(t==null?void 0:t.strict)??!0,this._maxDepth=(t==null?void 0:t.maxDepth)??32}override(e,t,s={}){if(typeof t!="function")throw new TypeError(`OverrideKernel.override: fn for "${e}" must be a function`);if(!this._originals.has(e)){const i=this._host[e];if(typeof i!="function")throw new TypeError(`OverrideKernel.override: host["${e}"] is not a function`);this._hadOwn.set(e,Object.prototype.hasOwnProperty.call(this._host,e)),this._originals.set(e,i.bind(this._host))}const o=this._stack.get(e)??[];return o.push({fn:t,opts:s}),this._stack.set(e,o),this._host[e]=this._buildDispatcher(e),this._host}_buildDispatcher(e){var a;const t=this._originals.get(e),s=this._stack.get(e)??[],o=s.reduce((c,u)=>(...h)=>u.fn(c,...h),t),i=((a=s[s.length-1])==null?void 0:a.opts)??{},n=i.reentrant===!0,r=i.onError==="fallback",l=this;return function(...c){if(!n&&l._callPath.indexOf(e)!==-1)return t(...c);if(l._callPath.length>=l._maxDepth){if(l._strict&&!r)throw new Error(`OverrideKernel: max override depth (${l._maxDepth}) exceeded at "${e}"`);return t(...c)}l._callPath.push(e);try{return o(...c)}catch(u){if(r&&!l._strict)return console.warn(`[og.override:${e}]`,u),t(...c);if(r&&l._strict)return console.warn(`[og.override:${e}]`,u),t(...c);throw u}finally{l._callPath.pop()}}}strategy(e,t){if(typeof t!="function")throw new TypeError(`OverrideKernel.strategy: fn for "${e}" must be a function`);return this._strategies.set(e,t),this._host}getStrategy(e,t){return this._strategies.get(e)??t}hasStrategy(e){return this._strategies.has(e)}restore(e){return this._originals.has(e)?(this._hadOwn.get(e)?this._host[e]=this._originals.get(e):delete this._host[e],this._originals.delete(e),this._hadOwn.delete(e),this._stack.delete(e),this._host):this._host}restoreAll(){for(const e of[...this._originals.keys()])this.restore(e);return this._strategies.clear(),this._callPath=[],this._host}hasOverride(e){return this._originals.has(e)}getOverrideNames(){return[...this._originals.keys()]}}const Ue="_ogRowId",V=class V extends ot{constructor(e,t){var i;super(),this._vs=null,this._ro=null,this._renderer=null,this._trigMgr=new is,this._destroyed=!1,this._autoHeightWarned=!1,this._colWidths=[],this._userWidths=new Map,this._filterPanel=null,this._filterSelect=null,this._pagination=null,this._dnd=null,this._mergeEngine=new Z,this._liveRegion=null,this._ctxMenu=null,this._cmHandler=null,this._cmKbdHandler=null,this._wsManager=null;const s=typeof e=="string"?document.querySelector(e):e;if(!s)throw new Error(`OpenGrid: container not found: ${e}`);this._container=s,this._options={height:"100%",width:"100%",rowHeight:32,headerHeight:34,footerHeight:30,autoHeight:!1,fillWidth:!1,defaultColumnWidth:100,editable:!1,editMode:"dblclick",history:!0,historySize:100,selection:"single",clipboard:!0,sortable:!0,multiSort:!0,filterable:!0,defaultSort:[],frozenColumns:0,frozenRows:0,rowNumber:!1,stateColumn:!1,checkColumn:!1,draggable:!1,crossGrid:!1,crossGridMapping:"auto",mergeCells:!1,groupBy:[],summary:void 0,treeMode:"auto",treeId:"id",treeParentId:"parentId",expandOnLoad:!1,pagination:!1,pageSize:50,footer:void 0,footerPosition:"bottom",theme:"default",cssVars:{},ariaLabel:"OPEN_GRID 데이터 그리드",...t},this._data=new rt(Ue),this._rowMgr=new It(this._data),this._colLayout=new ue(this._options.columns,this._options.frozenColumns),this._editMgr=new Bt({data:this._data,colLayout:this._colLayout,getRenderer:()=>this._renderer,getContainer:()=>this._container,getOptions:()=>this._options,emit:(n,...r)=>this.emit(n,...r),doRender:()=>this._doRender(...this._visRange()),announce:n=>this._announce(n),writeCell:(n,r,l)=>this.writeCell(n,r,l),scrollToRow:n=>{var r;return(r=this._vs)==null?void 0:r.scrollToRow(n)},getVisibleLeaves:()=>this._colLayout.visibleLeaves}),this._exportMgr=new Ut({getData:()=>this._data.getData(),getColLayout:()=>this._colLayout,getColWidths:()=>this._colWidths,getOptions:()=>this._options,getContainer:()=>this._container,getMaskEnabled:n=>this.getMaskEnabled(n),getWsManager:()=>this._wsManager,getStrategy:(n,r)=>this._ovk.getStrategy(n,r)}),this._footerMgr=new Gt({getData:()=>this._data.getData(),getColLayout:()=>this._colLayout,getColWidths:()=>this._colWidths,getOptions:()=>this._options,getContainer:()=>this._container,getStrategy:(n,r)=>this._ovk.getStrategy(n,r)}),this._kbdMgr=new qt({getEditMgr:()=>this._editMgr,getRowMgr:()=>this._rowMgr,getData:()=>this._data,getColLayout:()=>this._colLayout,getOptions:()=>this._options,setFocusCell:(n,r)=>this._setFocusCell(n,r),handleRowDrop:(n,r)=>this._handleRowDrop(n,r),doRender:()=>this._doRender(...this._visRange()),announce:n=>this._announce(n),emit:(n,...r)=>this.emit(n,...r),visRange:()=>this._visRange(),handleCellKeyEvt:(n,r)=>this._handleCellKeyEvt(n,r)}),this._sfMgr=new ts({getData:()=>this._data,getColLayout:()=>this._colLayout,getFindFilter:()=>this._findMgr.findFilter,getVs:()=>this._vs,getPagination:()=>this._pagination,getOptions:()=>this._options,renderHeader:()=>this._renderHeader(),doRender:()=>this._doRender(...this._visRange()),announce:n=>this._announce(n),emit:(n,...r)=>this.emit(n,...r)}),this._findMgr=new Xt({getColLayout:()=>this._colLayout,getData:()=>this._data,getFilters:()=>this._sfMgr.filters,getVs:()=>this._vs,getPagination:()=>this._pagination,doRender:()=>this._doRender(...this._visRange())}),this._cellEvt=new ss({getData:()=>this._data,getColLayout:()=>this._colLayout,getOptions:()=>this._options,getEditMgr:()=>this._editMgr,getRowMgr:()=>this._rowMgr,emit:(n,...r)=>this.emit(n,...r),writeCell:(n,r,l)=>this.writeCell(n,r,l),doRender:()=>this._doRender(...this._visRange()),getContainer:()=>this._container}),this._grpMgr=new es({getData:()=>this._data.getData(),getDataLayer:()=>this._data,getOptions:()=>this._options,getVs:()=>this._vs,doRenderFull:n=>this._doRender(0,n-1),doRender:()=>this._doRender(...this._visRange()),getStrategy:(n,r)=>this._ovk.getStrategy(n,r)}),this._ovk=new as(this,{strict:this._options.overrideStrict??!0}),this._data.setStrategyResolver((n,r)=>this._ovk.getStrategy(n,r)),bt((n,r,l)=>{var a;return((a=this._ovk.getStrategy("displayFormatter",null))==null?void 0:a(n,r,l))??null}),this._mount(),this._bindOptionEvents(),(i=this._options.defaultSort)!=null&&i.length&&this._sfMgr.initSort(this._options.defaultSort),this.override=Object.assign((n,r,l)=>this._ovk.override(n,r,l),{strategy:(n,r)=>this._ovk.strategy(n,r)});const o=this.destroy.bind(this);this.destroy=()=>{try{o()}finally{this._ovk.restoreAll()}};for(const[n,r]of V._defaultStrategies)this._ovk.strategy(n,r);for(const[n,r,l]of V._defaultOverrides)this._ovk.override(n,r,l);requestAnimationFrame(()=>{var n,r;this.emit("ready",this),(r=(n=this._options).onReady)==null||r.call(n,this)})}static defaultOverride(e,t,s={}){return V._defaultOverrides.push([e,t,s]),V}restore(e){return this._ovk.restore(e),this}restoreAll(){return this._ovk.restoreAll(),this}hasOverride(e){return this._ovk.hasOverride(e)}getOverrideNames(){return this._ovk.getOverrideNames()}getStrategy(e,t){return this._ovk.getStrategy(e,t)}_mount(){var s,o;this._container.classList.add("og-container");const e=this._options.height,t=this._options.width;this._container.style.height=typeof e=="number"?`${e}px`:String(e),this._container.style.width=typeof t=="number"?`${t}px`:String(t),this._container.style.display="flex",this._container.style.flexDirection="column",this._container.style.overflow="hidden",this._container.style.boxSizing="border-box",this._container.style.border="1px solid var(--og-border-color, #e0e0e0)",this._container.style.fontFamily="var(--og-font-family, -apple-system, sans-serif)",this._container.style.fontSize="var(--og-font-size, 13px)",this._container.setAttribute("data-og-theme",this._options.theme);for(const[i,n]of Object.entries(this._options.cssVars))this._container.style.setProperty(i,n);this._renderer=new Ht(this._container,this._options,{onHeaderClick:(i,n)=>this._handleSortClick(i,n),onCellClick:(i,n,r)=>this._handleCellClick(i,n,r),onCellDblClick:(i,n,r)=>this._handleCellDblClick(i,n,r),onCellMouseOver:(i,n,r)=>this._handleCellMouseOver(i,n,r),onCellMouseOut:(i,n,r)=>this._handleCellMouseOut(i,n,r),onCellMouseDown:(i,n,r)=>this._handleCellMouseDown(i,n,r),onCellMouseUp:(i,n,r)=>this._handleCellMouseUp(i,n,r),onCellMouseMove:(i,n,r)=>this._handleCellMouseMove(i,n,r),onRowCheck:(i,n)=>this._handleRowCheck(i,n),onAllCheck:i=>this._handleAllCheck(i),onColResize:(i,n)=>this._handleColResize(i,n),onFilterIconClick:(i,n)=>this._handleFilterIconClick(i,n),getDndManager:()=>this._dnd,onColDragStart:i=>{this._editMgr.dragColIdx=i},onColDrop:i=>{this._editMgr.dragColIdx!==null&&this._editMgr.dragColIdx!==i&&this._reorderColumn(this._editMgr.dragColIdx,i),this._editMgr.dragColIdx=null},getColDragIdx:()=>this._editMgr.dragColIdx}),this._filterPanel=new dt(this._container,(i,n)=>this.setFilter(i,n),i=>this.resetFilter(i)),this._container.setAttribute("role","grid"),this._container.setAttribute("aria-label",this._options.ariaLabel??((s=this._options.cssVars)==null?void 0:s["aria-label"])??"OPEN_GRID 데이터 그리드"),this._container.setAttribute("aria-rowcount","0"),this._container.setAttribute("aria-colcount",String(this._options.columns.filter(i=>!i.hidden).length)),this._liveRegion=document.createElement("div"),this._liveRegion.setAttribute("aria-live","polite"),this._liveRegion.setAttribute("aria-atomic","true"),this._liveRegion.className="og-live-region",this._container.insertAdjacentElement("beforebegin",this._liveRegion),this._container.tabIndex=0,this._container.addEventListener("keydown",i=>this._handleKeyDown(i)),this._container.addEventListener("keyup",i=>this._handleCellKeyEvt("cellKeyUp",i)),this._container.addEventListener("keypress",i=>this._handleCellKeyEvt("cellKeyPress",i)),this._vs=new at(this._renderer.bodyWrapper,{rowHeight:this._options.rowHeight,onRender:(i,n)=>this._doRender(i,n)}),ce.register(this._renderer.bodyWrapper,this),this._options.draggable&&(this._dnd=new Pt(this._renderer.bodyWrapper,this._options.rowHeight,(i,n)=>this._handleRowDrop(i,n),this._options.crossGrid?{resolveTarget:(i,n)=>{const r=ce.resolveAt(i,n,this);return!r||!r._options.crossGrid?null:{bodyEl:r._crossBodyEl(),rowHeight:r._options.rowHeight,totalRows:r._data.rowCount}},onCrossDrop:(i,n,r)=>this._handleCrossGridDrop(i,n,r)}:void 0,i=>this._dragRowSet(i).length)),this._options.pagination&&(this._pagination=new Wt(this._container,this._options.pageSize,i=>{this.emit("pageChange",i),this._doRender(...this._visRange())})),this._findMgr.init(this._container),this._initContextMenu(),(o=this._options.worksheets)!=null&&o.length&&this._initWorksheets(),this._ro=new ResizeObserver(()=>this._onResize()),this._ro.observe(this._container),this._onResize()}_initContextMenu(){const e=this._options.contextMenu;e!==!1&&(this._cmHandler&&this._container.removeEventListener("contextmenu",this._cmHandler),this._cmKbdHandler&&this._container.removeEventListener("keydown",this._cmKbdHandler),this._cmHandler=this._cmKbdHandler=null,this._ctxMenu=new jt(this._container,{onSortAsc:()=>{const t=this._colLayout.visibleLeaves[0];t&&this.orderBy(t.field,"asc")},onSortDesc:()=>{const t=this._colLayout.visibleLeaves[0];t&&this.orderBy(t.field,"desc")},onFind:()=>this._findMgr.open(),onExcel:()=>this.exportExcel(),onCsv:()=>this.exportCsv(),onPrint:()=>this.print()}),this._cmHandler=t=>{var r;const s=t.target.closest(".og-cell");if(!s)return;t.preventDefault();const o=Number(s.dataset.colIndex??-1),i=this._colLayout.visibleLeaves[o];i&&this._ctxMenu&&(this._ctxMenu._actions.onSortAsc=()=>this.orderBy(i.field,"asc"),this._ctxMenu._actions.onSortDesc=()=>this.orderBy(i.field,"desc"));const n=Array.isArray(e)?e:void 0;(r=this._ctxMenu)==null||r.open(t,n)},this._container.addEventListener("contextmenu",this._cmHandler),this._cmKbdHandler=t=>{var s;if(t.shiftKey&&t.key==="F10"){t.preventDefault();const o=this._container.getBoundingClientRect(),i={clientX:o.left+80,clientY:o.top+40};(s=this._ctxMenu)==null||s.open(i)}},this._container.addEventListener("keydown",this._cmKbdHandler))}openContextMenu(e,t){var s;(s=this._ctxMenu)==null||s.open(e,t)}closeContextMenu(){var e;(e=this._ctxMenu)==null||e.close()}setFilterSelect(e){var t;(t=this._filterSelect)==null||t.destroy(),this._filterSelect=null,e&&(this._container.id||(this._container.id=`og-${Math.random().toString(36).slice(2,7)}`),this._filterSelect=new Ot(this._container,e,(s,o)=>this.setFilter(s,o),s=>this.resetFilter(s),this._container.id))}setOptions(e){var t;if(Object.assign(this._options,e),"contextMenu"in e&&((t=this._ctxMenu)==null||t.destroy(),this._ctxMenu=null,this._initContextMenu()),"groupBy"in e||"summary"in e){const s=e.groupBy??[];s.length>0?this._grpMgr.groupBy(s):this.clearGroup();return}this._renderHeader(),this._doRender(...this._visRange())}setMaskEnabled(e,t){var o;const s=this._colLayout.getColumnByField(e);s&&(t?(s._maskRevealed=!1,(o=s._maskRevealedRows)==null||o.clear()):s._maskRevealed=!0,this._doRender(...this._visRange()))}getMaskEnabled(e){const t=this._colLayout.getColumnByField(e);return t?t._maskRevealed!==!0:!1}_initWorksheets(){const e=this._options.worksheets;this._wsManager=new Ve(this._container,(t,s)=>{this._data.setData(s.data),this._colLayout=new ue(s.columns.length?s.columns:this._options.columns,this._options.frozenColumns),this._doRender(...this._visRange()),this._renderHeader()});for(const t of e)this._wsManager.add(t.name,t.columns??this._options.columns,t.data??[])}addWorksheet(e,t,s){this._wsManager||(this._wsManager=new Ve(this._container,(o,i)=>{this._data.setData(i.data),this._colLayout=new ue(i.columns.length?i.columns:this._options.columns,this._options.frozenColumns),this._doRender(...this._visRange()),this._renderHeader()})),this._wsManager.add(e,t??this._options.columns,s??[])}removeWorksheet(e){var t;(t=this._wsManager)==null||t.remove(e)}switchWorksheet(e){var t;(t=this._wsManager)==null||t.switch(e)}renameWorksheet(e,t){var s;(s=this._wsManager)==null||s.rename(e,t)}getWorksheet(e){var t;return(t=this._wsManager)==null?void 0:t.get(e)}getWorksheetNames(){var e;return((e=this._wsManager)==null?void 0:e.getNames())??[]}exportSheetsExcel(e){this._exportMgr.exportSheetsExcel(e)}_paginationHeight(){return this._options.pagination?38:0}_onResize(){const{width:e}=this._container.getBoundingClientRect();e&&(this._recalcWidths(e),this._renderHeader(),this._doRender(...this._visRange()))}_recalcWidths(e){this._colWidths=this._colLayout.computeWidths(e-(this._options.stateColumn?24:0)-(this._options.draggable?18:0)-(this._options.rowNumber?44:0)-(this._options.checkColumn?36:0),this._options.defaultColumnWidth),this._userWidths.size&&this._colLayout.visibleLeaves.forEach((t,s)=>{const o=this._userWidths.get(t.field);o!=null&&(this._colWidths[s]=o)})}_renderHeader(){var e;(e=this._renderer)==null||e.renderHeader(this._colLayout.buildHeaderCells(),this._colLayout.visibleLeaves,this._colWidths,this._sfMgr.sortList,{...this._options,_activeFilters:this._sfMgr.filters,_frozenCount:this._colLayout.frozenCount}),this._syncHeaderLayout()}_syncHeaderLayout(){if(!this._renderer||!this._vs)return;const{height:e}=this._container.getBoundingClientRect();if(!e)return;const t=this._renderer.getHeaderHeight(),s=t>this._options.headerHeight?t:this._options.headerHeight;this._renderer.updateSize(e-this._paginationHeight(),s),this._vs.setViewportHeight(e-s-this._paginationHeight())}_doRender(e,t){var i;if(!this._renderer||!this._vs)return;const s=this._vs.getVisibleRange(),o=this._options.autoHeight===!0;o&&([e,t]=this._visRange(),!this._autoHeightWarned&&t-e+1>2e3&&(this._autoHeightWarned=!0,console.warn(`[OpenGrid] autoHeight 는 가상 스크롤이 아니라 전 행(${t-e+1}행)을 렌더합니다. 행이 많으면 고정 rowHeight(가상 스크롤) 사용을 권장합니다.`))),this._renderer.renderBody(e,t,this._data,this._colLayout.visibleLeaves,this._colWidths,this._options,o?0:s.offsetY,o?0:this._vs.getTotalHeight(),this._rowMgr.selectedRows,this._rowMgr.checkedRows,this._grpMgr.isGroupMode?this._grpMgr.groupFlatRows:this._grpMgr.isTreeMode?this._grpMgr.treeFlatRows:null,n=>this._grpMgr.handleGroupToggle(n),this._grpMgr.isTreeMode?n=>this._grpMgr.handleTreeToggle(n):void 0,{_totalRows:this._data.rowCount,_frozenCount:this._colLayout.frozenCount,_focusCell:this._editMgr.focusCell},this._mergeEngine),(i=this._options.footer)!=null&&i.length&&this._renderFooterEl()}_handleGroupToggle(e){this._grpMgr.handleGroupToggle(e)}_visRange(){var t;if(this._options.pagination&&this._pagination){const{start:s,end:o}=this._pagination.getRange();return[s,o]}if(this._options.autoHeight)return[0,(this._grpMgr.isGroupMode?this._grpMgr.groupFlatRows.length:this._grpMgr.isTreeMode?this._grpMgr.treeFlatRows.length:this._data.rowCount)-1];const e=(t=this._vs)==null?void 0:t.getVisibleRange();return[(e==null?void 0:e.startIndex)??0,Math.min(((e==null?void 0:e.endIndex)??30)+this._visCount()+5,this._data.rowCount-1)]}_visCount(){const e=this._container.getBoundingClientRect().height;return Math.ceil((e-this._options.headerHeight-this._paginationHeight())/this._options.rowHeight)+5}_handleSortClick(e,t){this._sfMgr.handleSortClick(e,t)}_isToggleCol(e){return ne(e)}_handleCellClick(e,t,s){this._cellEvt.handleCellClick(e,t,s)}_handleCellDblClick(e,t,s){this._cellEvt.handleCellDblClick(e,t,s)}_handleCellMouseOver(e,t,s){this._cellEvt.handleCellMouseOver(e,t,s)}_handleCellMouseOut(e,t,s){this._cellEvt.handleCellMouseOut(e,t,s)}_handleCellMouseDown(e,t,s){this._cellEvt.handleCellMouseDown(e,t,s)}_handleCellMouseUp(e,t,s){this._cellEvt.handleCellMouseUp(e,t,s)}_handleCellMouseMove(e,t,s){this._cellEvt.handleCellMouseMove(e,t,s)}_handleCellKeyEvt(e,t){this._cellEvt.handleCellKeyEvt(e,t)}_handleRowCheck(e,t){this._rowMgr.check(e,t),this._doRender(...this._visRange()),this.emit("rowCheck",{rowIndex:e,checked:t,row:this._data.getRowByIndex(e)})}_handleFilterIconClick(e,t){var o,i;if((o=this._filterPanel)!=null&&o.isOpen){this._filterPanel.close();return}const s=this._sfMgr.filters[e]??[];(i=this._filterPanel)==null||i.open(e,t,s)}_handleAllCheck(e){this._rowMgr.checkAll(e,this._data.rowCount),this._doRender(...this._visRange()),this.emit("allCheck",{checked:e})}_handleRowDrop(e,t){var s,o;this._data.moveRow(e,t),this._doRender(...this._visRange()),this.emit("rowDrop",{fromIndex:e,toIndex:t}),(o=(s=this._options).onRowDrop)==null||o.call(s,{fromIndex:e,toIndex:t})}_crossBodyEl(){return this._renderer.bodyWrapper}_dragRowSet(e){const t=[...this._rowMgr.selectedRows];return t.length>1&&t.includes(e)?t.sort((s,o)=>s-o):[e]}_handleCrossGridDrop(e,t,s){const o=ce.get(t);!o||o===this||this.moveRowsTo(o,this._dragRowSet(e),s)}async moveRowsTo(e,t,s){const o=e;if(!o||o===this||!t.length)return!1;const i=[...new Set(t)].sort((c,u)=>c-u),n=s??o._data.rowCount;let r=i.map(c=>{const u={...this._data.getRowByIndex(c)};return delete u[Ue],u});const l=await this._resolveCrossTransform(o);if(l===!1)return!1;l&&(r=r.map(c=>l(c)));const a={sourceGrid:this,targetGrid:o,rows:r,sourceIndexes:i,targetIndex:n};return this._fireGridDropBefore(a)===!1||a.cancel||o._fireGridDropBefore(a)===!1||a.cancel?!1:(r.forEach((c,u)=>o.insertRow(c,n+u)),[...i].sort((c,u)=>u-c).forEach(c=>this.deleteRow(c)),this._fireGridDropAfter(a),o._fireGridDropAfter(a),this._fireGridDropComplete(a),o._fireGridDropComplete(a),!0)}async moveCheckedTo(e){const t=this._rowMgr.getChecked().map(s=>s.rowIndex);return t.length?(this._rowMgr.uncheckAll(),this.moveRowsTo(e,t)):!1}async _resolveCrossTransform(e){var r,l;const t=this._options.crossGridMapping;if(typeof t=="function")return t;if(t!=="interactive")return null;const s=this._colLayout.visibleLeaves.map(a=>({field:a.field,header:a.header})),o=e._colLayout.visibleLeaves.map(a=>({field:a.field,header:a.header}));if(ns(s.map(a=>a.field),o.map(a=>a.field)))return null;const i=await rs(s,o);if(!i)return!1;const n={sourceGrid:this,targetGrid:e,mapping:i.mapping,script:i.script};return this.emit("gridDropMapping",n),(l=(r=this._options).onGridDropMapping)==null||l.call(r,n),console.log(`[OpenGrid] cross-grid mapping script:
89
89
  `+st(i.mapping)),os(i.mapping)}_fireGridDropBefore(e){var t,s;return this.emit("gridDropBefore",e),(s=(t=this._options).onGridDropBefore)==null?void 0:s.call(t,e)}_fireGridDropAfter(e){var t,s;this.emit("gridDropAfter",e),(s=(t=this._options).onGridDropAfter)==null||s.call(t,e)}_fireGridDropComplete(e){var t,s;this.emit("gridDropComplete",e),(s=(t=this._options).onGridDropComplete)==null||s.call(t,e)}reorderRow(e,t){this._data.moveRow(e,t),this._doRender(...this._visRange())}_handleColResize(e,t){this._colWidths[e]!==void 0&&(this._colWidths[e]=t);const s=this._colLayout.visibleLeaves[e];s&&this._userWidths.set(s.field,t),this._renderHeader(),this._doRender(...this._visRange())}_handleKeyDown(e){this._kbdMgr.handleKeyDown(e)}_setFocusCell(e,t){this._rowMgr.selectSingle(e),this._editMgr.setFocusCell(e,t)}_announce(e){this._liveRegion&&(this._liveRegion.textContent="",setTimeout(()=>{this._liveRegion&&(this._liveRegion.textContent=e)},50))}_bindOptionEvents(){this._options.onCellClick&&this.on("cellClick",this._options.onCellClick),this._options.onCellDblClick&&this.on("cellDblClick",this._options.onCellDblClick),this._options.onRowClick&&this.on("rowClick",this._options.onRowClick),this._options.onEditStart&&this.on("editStart",this._options.onEditStart),this._options.onEditEnd&&this.on("editEnd",this._options.onEditEnd),this._options.onSortChange&&this.on("sortChange",this._options.onSortChange),this._options.onFilterChange&&this.on("filterChange",this._options.onFilterChange),this._options.onScroll&&this.on("scroll",this._options.onScroll),this._options.onDataChange&&this.on("dataChange",this._options.onDataChange),this._options.onSelectionChange&&this.on("selectionChange",this._options.onSelectionChange),this._options.onRowDblClick&&this.on("rowDblClick",this._options.onRowDblClick),this._options.onRowMouseOver&&this.on("rowMouseOver",this._options.onRowMouseOver),this._options.onRowMouseOut&&this.on("rowMouseOut",this._options.onRowMouseOut),this._options.onRowMouseDown&&this.on("rowMouseDown",this._options.onRowMouseDown),this._options.onRowMouseUp&&this.on("rowMouseUp",this._options.onRowMouseUp),this._options.onRowMouseMove&&this.on("rowMouseMove",this._options.onRowMouseMove),this._options.onCellMouseOver&&this.on("cellMouseOver",this._options.onCellMouseOver),this._options.onCellMouseOut&&this.on("cellMouseOut",this._options.onCellMouseOut),this._options.onCellMouseDown&&this.on("cellMouseDown",this._options.onCellMouseDown),this._options.onCellMouseUp&&this.on("cellMouseUp",this._options.onCellMouseUp),this._options.onCellMouseMove&&this.on("cellMouseMove",this._options.onCellMouseMove),this._options.onCellKeyDown&&this.on("cellKeyDown",this._options.onCellKeyDown),this._options.onCellKeyUp&&this.on("cellKeyUp",this._options.onCellKeyUp),this._options.onCellKeyPress&&this.on("cellKeyPress",this._options.onCellKeyPress)}setData(e){var s;const t=this._trigMgr.mkCtx("setData",[e]);this._trigMgr.exec("before:setData",t)&&(this._rowMgr.reset(),this._data.setData(e),this._applyFilters(),this._grpMgr.isTreeMode?this._grpMgr.rebuildTree():this._grpMgr.isGroupMode?this._grpMgr.rebuildGroups():(s=this._vs)==null||s.setTotalRows(this._data.rowCount),this._container.setAttribute("aria-rowcount",String(this._data.rowCount)),this._container.setAttribute("aria-colcount",String(this._colLayout.visibleLeaves.length)),this._announce(`${this._data.rowCount}행 데이터 로드됨`),this.emit("dataChange",this._data.getData()),t.result=e.length,this._trigMgr.exec("after:setData",t))}getData(){return this._data.getData()}getSourceRows(){return this._data.getOriginalData()}pushData(e){var o,i;const t=[...this._data.getAllData(),...e];this._data.setData(t);const s=this._data.rowCount;(o=this._vs)==null||o.setTotalRows(s),(i=this._pagination)==null||i.setTotalRows(s)}prefixData(e){var o,i;const t=[...e,...this._data.getAllData()];this._data.setData(t);const s=this._data.rowCount;(o=this._vs)==null||o.setTotalRows(s),(i=this._pagination)==null||i.setTotalRows(s)}clearData(){var e,t;this._rowMgr.reset(),this._data.clearData(),(e=this._vs)==null||e.setTotalRows(0),(t=this._pagination)==null||t.setTotalRows(0),this._doRender(0,-1),this.emit("dataChange",[])}insertRow(e,t="last"){var n,r,l,a;const s=this._trigMgr.mkCtx("insertRow",[e,t]);if(!this._trigMgr.exec("before:insertRow",s))return;const o=t==="before"?0:t==="after"?this._data.rowCount:t;this._data.addRow(e,o);const i=this._data.rowCount;(n=this._vs)==null||n.setTotalRows(i),(r=this._pagination)==null||r.setTotalRows(i),this._doRender(...this._visRange()),this.emit("dataChange",this._data.getData()),(a=(l=this._options).onDataChange)==null||a.call(l,this._data.getData()),s.result={rowCount:i,item:e},this._trigMgr.exec("after:insertRow",s)}pushRow(e){var o,i,n,r;(Array.isArray(e)?e:[e]).forEach(l=>this._data.addRow(l,"last"));const s=this._data.rowCount;(o=this._vs)==null||o.setTotalRows(s),(i=this._pagination)==null||i.setTotalRows(s),this._doRender(...this._visRange()),this.emit("dataChange",this._data.getData()),(r=(n=this._options).onDataChange)==null||r.call(n,this._data.getData())}appendRows(e){this.pushRow(e)}unshiftRow(e){var o,i,n,r;(Array.isArray(e)?e:[e]).forEach(l=>this._data.addRow(l,"first"));const s=this._data.rowCount;(o=this._vs)==null||o.setTotalRows(s),(i=this._pagination)==null||i.setTotalRows(s),this._doRender(...this._visRange()),this.emit("dataChange",this._data.getData()),(r=(n=this._options).onDataChange)==null||r.call(n,this._data.getData())}prependRows(e){this.unshiftRow(e)}deleteRow(e){var n,r,l,a;const t=this._trigMgr.mkCtx("deleteRow",[e]),s=Array.isArray(e)?[...e]:[e];if(t.extra={rows:s.map(c=>this._data.getRowByIndex(c))},!this._trigMgr.exec("before:deleteRow",t))return;const o=s.sort((c,u)=>u-c);o.forEach(c=>this._data.removeRow(c));const i=this._data.rowCount;(n=this._vs)==null||n.setTotalRows(i),(r=this._pagination)==null||r.setTotalRows(i),this._doRender(...this._visRange()),this.emit("dataChange",this._data.getData()),(a=(l=this._options).onDataChange)==null||a.call(l,this._data.getData()),t.result={deleted:o.length,rowCount:i},this._trigMgr.exec("after:deleteRow",t)}deleteById(e){}readCell(e,t){return this._data.getCellValue(e,t)}getDisplayValue(e,t){const s=this.readCell(e,t);return this._ovk.getStrategy("displayFormatter",(i,n,r)=>i==null?"":String(i))(s,t,this._data.getRowByIndex(e))}writeCell(e,t,s){var c,u,h,g;const o=this.readCell(e,t),i=this._trigMgr.mkCtx("writeCell",[e,t,s]);if(i.extra={oldValue:o,rowIndex:e,field:t},!this._trigMgr.exec("before:writeCell",i))return;this._data.updateCell(e,t,s);const n=this._data.getRowByIndex(e),r=this._colLayout.getColumnByField(t),l=this._colLayout.getColumnIndex(t),a={type:"editEnd",rowIndex:e,columnIndex:l,field:t,oldValue:o,newValue:s,row:n,column:r};this.emit("editEnd",a),(u=(c=this._options).onEditEnd)==null||u.call(c,a),this.emit("dataChange",this._data.getData()),(g=(h=this._options).onDataChange)==null||g.call(h,this._data.getData()),this._doRender(...this._visRange()),i.result={rowIndex:e,field:t,oldValue:o,newValue:s},this._trigMgr.exec("after:writeCell",i)}getRowAt(e){return this._data.getRowByIndex(e)}getChanges(){return this._data.getChanges()}getEditedRows(){return this._data.getEditedRows()}getChangedRows(){return this._data.getChangedRows()}getChangedColumns(){return this._data.getChangedColumns()}getAddedRows(){return this._data.getAddedRows()}getRemovedRows(){return this._data.getRemovedRows()}getOriginalRow(e){return this._data.getOriginalRow(e)}getRowsWithState(e){return this._data.getRowsWithState(e)}undo(){}redo(){}clearHistory(){}getColumnDefs(){return this._colLayout.visibleLeaves}getAllColumnDefs(){return this._colLayout.leaves}getColumnCount(){return this._colLayout.visibleLeaves.length}applyColumns(e){const t=this._trigMgr.mkCtx("applyColumns",[e]);this._trigMgr.exec("before:applyColumns",t)&&(this._colLayout.setColumns(e),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._doRender(...this._visRange()),t.result={columnCount:e.length},this._trigMgr.exec("after:applyColumns",t))}insertColumn(e,t){this._colLayout.addColumn(e,t),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._doRender(...this._visRange())}deleteColumn(e){this._colLayout.removeColumn(e),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._doRender(...this._visRange())}_reorderColumn(e,t){var n,r;const s=this._colLayout.visibleLeaves.map(l=>l);if(e<0||t<0||e>=s.length||t>=s.length)return;const o=[...this._options.columns],[i]=o.splice(e,1);o.splice(t,0,i),this._options.columns=o,this.applyColumns(o),(r=(n=this._options).onColumnReorder)==null||r.call(n,{fromIndex:e,toIndex:t,field:i.field??""})}hideColumn(e){this._colLayout.hideColumn(e),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._doRender(...this._visRange())}showColumn(e){this._colLayout.showColumn(e),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._doRender(...this._visRange())}getColumnIndex(e){return this._colLayout.getColumnIndex(e)}getFieldAt(e){var t;return((t=this._colLayout.getColumnByIndex(e))==null?void 0:t.field)??""}getColValues(e,t=!1){return this._data.getData().map(s=>s[e])}getUniqueValues(e,t=!1){return[...new Set(this.getColValues(e,t))]}setColWidths(e){}calcColWidths(e=!1){return[]}getSelections(){return this._rowMgr.getSelections()}getActiveRow(){return this._rowMgr.getActiveRow()}activate(e){this._rowMgr.activate(e),this._doRender(...this._visRange())}deselect(){this._rowMgr.deselect(),this._doRender(...this._visRange())}getChecked(){return this._rowMgr.getChecked()}getAllChecked(){return this._rowMgr.getAllChecked()}checkById(e){}addCheckById(e){}checkByValue(e,t){this._rowMgr.checkByValue(e,t),this._doRender(...this._visRange())}uncheckById(e){}uncheckAll(){this._rowMgr.uncheckAll(),this._doRender(...this._visRange())}orderBy(e,t="asc"){const s=this._trigMgr.mkCtx("orderBy",[e,t]);this._trigMgr.exec("before:orderBy",s)&&(this._sfMgr.sort(e,t),s.result={sortList:this._sfMgr.sortList},this._trigMgr.exec("after:orderBy",s))}resetOrder(){this._sfMgr.resetSort()}setFilter(e,t){const s=this._trigMgr.mkCtx("setFilter",[e,t]);this._trigMgr.exec("before:setFilter",s)&&(this._sfMgr.setFilter(e,t),s.result={field:e,filteredCount:this._data.rowCount},this._trigMgr.exec("after:setFilter",s))}resetFilter(e){this._sfMgr.resetFilter(e)}getFilterState(){return this._sfMgr.getFilterState()}restoreFilter(e){this._sfMgr.restoreFilter(e)}_applyFilters(){this._sfMgr.applyFilters()}freeze(e){this._colLayout.setFrozen(e),this._renderHeader(),this._doRender(...this._visRange())}mergeCells(e){this._mergeEngine.applyMergeCells(e),this._doRender(...this._visRange())}autoMerge(e){const t=this._colLayout.visibleLeaves,s=[],o=[];for(const i of e){const n=t.findIndex(r=>r.field===i);n>=0&&(s.push(n),o.push(i))}this._mergeEngine.applyAutoMerge(this._data.getData(),s,o),this._doRender(...this._visRange())}clearMerge(){this._mergeEngine.clear(),this._doRender(...this._visRange())}freezeRows(e){}groupBy(e){const t=this._trigMgr.mkCtx("groupBy",[e]);this._trigMgr.exec("before:groupBy",t)&&(this._grpMgr.groupBy(e),t.result={fields:e},this._trigMgr.exec("after:groupBy",t))}clearGroup(){this._grpMgr.clearGroup()}expandAll(){this._grpMgr.expandAll()}collapseAll(){this._grpMgr.collapseAll()}enableTree(){this._grpMgr.enableTree()}disableTree(){this._grpMgr.disableTree()}expandNodes(e,t=!0){this._grpMgr.expandNodes(e,t)}expandAllNodes(){this._grpMgr.expandAllNodes()}collapseAllNodes(){this._grpMgr.collapseAllNodes()}addTreeRow(e,t,s){}exportExcel(e){this._exportMgr.exportExcel(e)}exportCsv(e){this._exportMgr.exportCsv(e)}exportJson(e){this._exportMgr.exportJson(e)}print(e){this._exportMgr.print(e)}toArray(e=!0){const t=this._data.getData();if(e)return t;const s=this._colLayout.visibleLeaves;return t.map(o=>s.map(i=>o[i.field]))}jumpToRow(e){var t;this._rowMgr.selectSingle(e),(t=this._vs)==null||t.scrollToRow(e),this._doRender(...this._visRange())}jumpToCol(e){}getScrollPos(){var e,t;return{x:((e=this._renderer)==null?void 0:e.bodyWrapper.scrollLeft)??0,y:((t=this._renderer)==null?void 0:t.bodyWrapper.scrollTop)??0}}setFooter(e){this._options.footer=e,this._renderFooterEl()}getFooterData(){return this._footerMgr.computeValues()}getFooterValue(e){var t;return((t=this._footerMgr.computeValues().find(s=>s._field===e))==null?void 0:t._value)??null}_renderFooterEl(){this._footerMgr.render()}resize(e,t){e&&(this._container.style.width=`${e}px`),t&&(this._container.style.height=`${t}px`),this._onResize()}setTheme(e){this._container.setAttribute("data-og-theme",e)}setThemeVar(e,t){this._container.style.setProperty(e,t)}addTrigger(e,t){return this._trigMgr.add(e,t),this}removeTrigger(e,t){return this._trigMgr.remove(e,t),this}clearTriggers(e){return this._trigMgr.clear(e),this}_mkCtx(e,t){return this._trigMgr.mkCtx(e,t)}_trig(e,t){return this._trigMgr.exec(e,t)}destroy(){var e,t,s,o,i,n,r,l;this._destroyed||(this._destroyed=!0,this._renderer&&ce.unregister(this._renderer.bodyWrapper),this._trigMgr.clear(),(e=this._ro)==null||e.disconnect(),(t=this._vs)==null||t.destroy(),(s=this._filterPanel)==null||s.destroy(),(o=this._dnd)==null||o.destroy(),this._cmHandler&&this._container.removeEventListener("contextmenu",this._cmHandler),this._cmKbdHandler&&this._container.removeEventListener("keydown",this._cmKbdHandler),this._cmHandler=this._cmKbdHandler=null,(i=this._ctxMenu)==null||i.destroy(),(n=this._wsManager)==null||n.destroy(),(r=this._renderer)==null||r.destroy(),(l=this._liveRegion)==null||l.remove(),this._liveRegion=null,this._container.innerHTML="",this._container.classList.remove("og-container"),this.removeAllListeners())}};V._defaultOverrides=[],V._defaultStrategies=[],V.defaults={strategy(e,t){return V._defaultStrategies.push([e,t]),V}};let Le=V;exports.OpenGrid=Le;exports.buildTree=Ee;
90
- //# sourceMappingURL=OpenGrid-C6SK6VeK.cjs.map
90
+ //# sourceMappingURL=OpenGrid-B7dLL9eH.cjs.map