open-grid 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/OpenGrid-0r_543Kj.cjs +7192 -0
  4. package/dist/OpenGrid-HmhGVC2V.js +7203 -0
  5. package/dist/open-grid-react.cjs +27 -1
  6. package/dist/open-grid-react.js +22 -82
  7. package/dist/open-grid-vue.cjs +31 -1
  8. package/dist/open-grid-vue.js +29 -79
  9. package/dist/open-grid.cjs +272 -6
  10. package/dist/open-grid.js +177 -266
  11. package/dist/types/core/CellEditManager.d.ts +73 -0
  12. package/dist/types/core/CellEventHandler.d.ts +99 -2
  13. package/dist/types/core/ChartManager.d.ts +51 -3
  14. package/dist/types/core/ContextMenu.d.ts +43 -2
  15. package/dist/types/core/CrossGridController.d.ts +86 -15
  16. package/dist/types/core/CrossGridRegistry.d.ts +36 -2
  17. package/dist/types/core/DetailManager.d.ts +106 -15
  18. package/dist/types/core/ExportManager.d.ts +66 -1
  19. package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
  20. package/dist/types/core/FilterPanel.d.ts +17 -2
  21. package/dist/types/core/FilterSelect.d.ts +37 -13
  22. package/dist/types/core/FindBarManager.d.ts +26 -0
  23. package/dist/types/core/FlatRowModel.d.ts +54 -11
  24. package/dist/types/core/FooterManager.d.ts +53 -1
  25. package/dist/types/core/FormulaController.d.ts +139 -10
  26. package/dist/types/core/GridComposer.d.ts +54 -6
  27. package/dist/types/core/GridShuttle.d.ts +44 -4
  28. package/dist/types/core/GroupTreeManager.d.ts +86 -2
  29. package/dist/types/core/IconRegistry.d.ts +56 -9
  30. package/dist/types/core/KeyboardManager.d.ts +88 -4
  31. package/dist/types/core/MaskingEngine.d.ts +10 -9
  32. package/dist/types/core/MutationService.d.ts +113 -10
  33. package/dist/types/core/OrgChart.d.ts +56 -1
  34. package/dist/types/core/OverrideKernel.d.ts +59 -15
  35. package/dist/types/core/Pagination.d.ts +38 -4
  36. package/dist/types/core/RangeSelectionManager.d.ts +121 -7
  37. package/dist/types/core/RenderController.d.ts +56 -0
  38. package/dist/types/core/RowManager.d.ts +55 -0
  39. package/dist/types/core/SkinRegistry.d.ts +51 -15
  40. package/dist/types/core/SortFilterManager.d.ts +80 -1
  41. package/dist/types/core/TriggerManager.d.ts +46 -0
  42. package/dist/types/core/WorksheetManager.d.ts +61 -2
  43. package/dist/types/core/XmlConverter.d.ts +56 -23
  44. package/dist/types/core/chart/types.d.ts +107 -10
  45. package/dist/types/core/editors/CellEditor.d.ts +29 -2
  46. package/dist/types/core/formula/types.d.ts +71 -8
  47. package/dist/types/core/range/RangeQuery.d.ts +24 -2
  48. package/dist/types/core/renderers/CellRenderer.d.ts +100 -8
  49. package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
  50. package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
  51. package/package.json +2 -1
  52. package/dist/OpenGrid-B0Spm0rU.js +0 -10404
  53. package/dist/OpenGrid-CuXj0isp.cjs +0 -97
  54. package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
@@ -12,23 +12,52 @@ import { GridOptions, Position } from './types.js';
12
12
  * `commit(spec)` 로 수렴시키기 위한 명시 데이터계약(CommitSpec DTO). 각 mutator 의
13
13
  * **관측 가능한 발화 순서 차이는 정규화 대상이 아니라 이 필드들로 인코딩**한다
14
14
  * (R-9c 회귀0: R0 골든 `mutation-event-sequence.test.ts` 순서 보존).
15
+ * / Explicit data contract (CommitSpec DTO) that converges every mutator's mutate→render→emit
16
+ * tail into the single choke point `commit(spec)` (R4, §3.4, R-9a/R-9b). Each mutator's
17
+ * **observable firing-order differences are not normalized away but encoded into these
18
+ * fields** (R-9c, zero regression: order preserved by the R0 golden test
19
+ * `mutation-event-sequence.test.ts`).
15
20
  *
16
21
  * - `totals` : VS/Pagination 행수 갱신. 'count'=현재 행수(insert/delete/push/unshift),
17
22
  * 'zero'=0(clearData). 생략=미갱신(writeCell/setData — 행수 불변 or 인라인 처리).
23
+ * / Updates the VS/Pagination row count. `'count'` = current row count
24
+ * (insert/delete/push/unshift), `'zero'` = 0 (clearData). Omitted = no update
25
+ * (writeCell/setData — row count unchanged, or handled inline).
18
26
  * - `renderMode` : 'sync-window'=`_doRender(...visRange)`(insert/delete/write/endBatch),
19
27
  * 'full'=`_doRender(0,-1)`(clearData),
20
28
  * 'async-vs'=명령형 렌더 없음. setData 는 setTotalRows/rebuild 로 VS 가
21
29
  * rAF 스케줄(비동기)하므로 `commit` 은 동기 `_doRender` 를 **하지 않는다**.
30
+ * / `'sync-window'` = `_doRender(...visRange)` (insert/delete/write/endBatch),
31
+ * `'full'` = `_doRender(0,-1)` (clearData), `'async-vs'` = no imperative render.
32
+ * For setData, VS schedules via rAF through setTotalRows/rebuild, so `commit`
33
+ * **does not** invoke a synchronous `_doRender`.
22
34
  * - `emitBeforeRender` : true=emit 을 render 앞에(writeCell/endBatch — 현행 순서), 기본 false=render 먼저(insert/delete).
35
+ * / `true` = emit before render (writeCell/endBatch — current order); default
36
+ * `false` = render first (insert/delete).
23
37
  * - `emitPayload` : `emit('dataChange', …)` 페이로드 지연 평가(thunk). getData() 시점을
24
38
  * 현행과 동일(render 뒤 or 앞)하게 유지 + 명시 onDataChange 재호출 시 2회 평가 보존.
39
+ * / Lazily-evaluated (thunk) payload for `emit('dataChange', …)`. Keeps the
40
+ * `getData()` evaluation point identical to current behavior (before or after
41
+ * render) and preserves double evaluation when `onDataChange` is explicitly
42
+ * re-invoked.
25
43
  * - `fireOnDataChangeExplicitly` : true=`_options.onDataChange?.()` 를 **명시 재호출**(bound listener 와 합쳐 DOUBLE-fire).
26
44
  * row mutator=true, setData/clearData=false(bound listener 로 ONCE).
45
+ * / `true` = **explicitly re-invokes** `_options.onDataChange?.()` (combined with
46
+ * the bound listener, this DOUBLE-fires). Row mutators = `true`;
47
+ * setData/clearData = `false` (bound listener fires ONCE).
27
48
  * - `flushFormula` : true=emit 전에 `_flushFormulaRecalc()`(writeCell/endBatch).
49
+ * / `true` = calls `_flushFormulaRecalc()` right before emit (writeCell/endBatch).
28
50
  * - `preRender` : render 직전 훅(deleteRow 의 removedRowId invalidate 루프).
51
+ * / Hook that runs immediately before render (deleteRow's removedRowId
52
+ * invalidation loop).
29
53
  * - `coalescable` : true 인 커밋만 배치 개구 중 render/emit 을 no-op 하고 `_batchDirty` 를 세운다.
30
54
  * **writeCell 만 원래 배치를 감지**했으므로 나머지 mutator(coalescable 생략)는
31
55
  * 배치 안에서도 즉시 렌더(현행 보존 — 배치 게이트를 전 mutator 로 확대하지 않는다).
56
+ * / Only commits with `true` no-op render/emit while a batch is open and instead
57
+ * set `_batchDirty`. **Only writeCell originally detected batches**, so the
58
+ * remaining mutators (which omit `coalescable`) still render immediately even
59
+ * inside a batch (current behavior preserved — the batch gate is not widened to
60
+ * every mutator).
32
61
  */
33
62
  export interface CommitSpec {
34
63
  totals?: 'count' | 'zero';
@@ -50,6 +79,18 @@ export interface CommitSpec {
50
79
  * render 는 주입된 `doRenderWindow`/`doRenderFull` 콜백으로만 유발한다. 값(vs/pagination/recalc
51
80
  * 등)은 늦은-null / 재할당(worksheet 전환)을 견디도록 전부 getter 클로저로 읽는다.
52
81
  * 배치 코얼레싱(`_batchDepth`/`_batchDirty`) 시맨틱은 R4 와 1:1 동일하다(회귀 0).
82
+ * / Dependency contract that moves the data-mutation surface (setData/insert/push/delete/
83
+ * writeCell/writeCells + batch API) and the single commit choke point `commit(CommitSpec)`
84
+ * introduced by R4 out of the `OpenGrid` God object with **behavior unchanged** (R6, §3.1 C5,
85
+ * §6-R6). `OpenGrid` retains only thin delegating public methods (public API unchanged).
86
+ *
87
+ * Strangler principle (A2): `DataLayer` is still owned by `OpenGrid`; it is only **injected**
88
+ * here via the `*Deps` closure-inversion pattern. **The service has no direct knowledge of
89
+ * rendering** (Yourdon I/O separation): render is only triggered through the injected
90
+ * `doRenderWindow`/`doRenderFull` callbacks. Values (vs/pagination/recalc, etc.) are all read
91
+ * through getter closures so they tolerate late-null / reassignment (worksheet switching).
92
+ * Batch coalescing semantics (`_batchDepth`/`_batchDirty`) are 1:1 identical to R4 (zero
93
+ * regression).
53
94
  */
54
95
  export interface MutationServiceDeps<T extends Record<string, any> = any> {
55
96
  getData: () => DataLayer<T>;
@@ -62,29 +103,38 @@ export interface MutationServiceDeps<T extends Record<string, any> = any> {
62
103
  getRowMgr: () => RowManager<T>;
63
104
  getGrpMgr: () => GroupTreeManager<T>;
64
105
  getOptions: () => Required<GridOptions<T>>;
65
- /** EventEmitter fan (this.emit) — 'dataChange'/'editEnd'/'writeCellsSkip'. */
106
+ /** EventEmitter fan(this.emit) — 'dataChange'/'editEnd'/'writeCellsSkip'. / EventEmitter fan-out (this.emit) for 'dataChange'/'editEnd'/'writeCellsSkip'. */
66
107
  emit: (event: string, payload?: any) => void;
67
- /** aria-live announce (C8.1 공용 인프라). */
108
+ /** aria-live announce(C8.1 공용 인프라). / aria-live announce (C8.1 shared infrastructure). */
68
109
  announce: (msg: string) => void;
69
110
  /** i18n: 데이터 로드/스킵 announce 해석. / i18n: resolve data load/skip announces. */
70
111
  t: (key: string, params?: Record<string, string | number>) => string;
71
- /** sort/filter 재적용(setData). */
112
+ /** sort/filter 재적용(setData). / Re-apply sort/filter (setData). */
72
113
  applyFilters: () => void;
73
- /** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. */
114
+ /** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. / Consume formula dirty seeds right before the writeCell/endBatch commit emit. */
74
115
  flushFormula: () => void;
75
- /** 현재 가시 범위 렌더(this._doRender(...this._visRange())). 서비스는 렌더 내부를 모른다. */
116
+ /** 현재 가시 범위 렌더(this._doRender(...this._visRange())). 서비스는 렌더 내부를 모른다. / Render the current visible range (this._doRender(...this._visRange())). The service has no knowledge of render internals. */
76
117
  doRenderWindow: () => void;
77
- /** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. */
118
+ /** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. / Full render (this._doRender(0, -1)) — clearData's full mode. */
78
119
  doRenderFull: () => void;
79
- /** setData: 수식 dirty seed clear + RecalcCoordinator 재생성(rowId 재발급 대응). */
120
+ /** setData: 수식 dirty seed clear + RecalcCoordinator 재생성(rowId 재발급 대응). / setData: clears formula dirty seeds and recreates the RecalcCoordinator (to cope with rowId reissuance). */
80
121
  resetFormulaState: () => void;
81
- /** writeCell: 값이 바뀐 셀을 수식 dirty seed 로 적립(kind==='data' 일 때만). */
122
+ /** writeCell: 값이 바뀐 셀을 수식 dirty seed 로 적립(kind==='data' 일 때만). / writeCell: accumulates a changed cell as a formula dirty seed (only when kind === 'data'). */
82
123
  seedFormulaDirty: (rowIndex: number, field: string) => void;
83
- /** deleteRow: 제거된 rowId 를 deps 로 갖는 수식들을 #REF 로 무효화(preRender). */
124
+ /** deleteRow: 제거된 rowId 를 deps 로 갖는 수식들을 #REF 로 무효화(preRender). / deleteRow: invalidates formulas that depend on a removed rowId to #REF (preRender). */
84
125
  invalidateRemovedRows: (rowIds: string[]) => void;
85
- /** deleteRow: 제거 전 flat index 의 안정 rowId 확보. */
126
+ /** deleteRow: 제거 전 flat index 의 안정 rowId 확보. / deleteRow: captures the stable rowId at a flat index before removal. */
86
127
  getRowIdAt: (rowIndex: number) => string | undefined;
87
128
  }
129
+ /**
130
+ * 모든 데이터 변경(mutation)의 단일 초크포인트. / Single chokepoint for all data mutations.
131
+ *
132
+ * setData/insertRow/pushRow/deleteRow/writeCell/writeCells + 배치 API를 소유하며, 각 연산의
133
+ * mutate→render→emit 꼬리를 {@link CommitSpec} 을 통해 `commit()` 하나로 수렴시킨다(R4/R6).
134
+ * / Owns setData/insertRow/pushRow/deleteRow/writeCell/writeCells plus the batch API, and
135
+ * converges every operation's mutate→render→emit tail into a single `commit()` call driven
136
+ * by a {@link CommitSpec} (R4/R6).
137
+ */
88
138
  export declare class MutationService<T extends Record<string, any> = any> {
89
139
  private _deps;
90
140
  /** reentrant 카운터. 0 초과면 배치 중(writeCell 이 render/dataChange 를 지연). */
@@ -97,21 +147,66 @@ export declare class MutationService<T extends Record<string, any> = any> {
97
147
  * 꼬리를 여기로 수렴. **관측 순서는 spec 필드로 인코딩**(정규화 아님 — R0 골든 diff=0).
98
148
  * 배치 코얼레싱을 내재화: `coalescable` 커밋은 배치 개구 중 render/emit 을 지연하고
99
149
  * `_batchDirty` 만 세운다(가장 바깥 endBatch 에서 1회 flush).
150
+ * / Single commit chokepoint (R4, §3.4, R-9a). Converges the post-mutate
151
+ * totals→(preRender)→flush→render/emit tail here. **Observable order is encoded via the
152
+ * spec fields** (not normalized — R0 golden diff = 0). Internalizes batch coalescing:
153
+ * commits marked `coalescable` defer render/emit while a batch is open and only set
154
+ * `_batchDirty` (flushed once by the outermost endBatch).
155
+ *
156
+ * @param spec - 커밋 데이터계약 / The commit data contract
100
157
  */
101
158
  commit(spec: CommitSpec): void;
159
+ /**
160
+ * 전체 데이터를 교체한다. rowId 를 재발급하므로 기존 stable-id 앵커 수식은 전량 무효화된다.
161
+ * / Replace the entire dataset. Reissues rowIds, so any existing stable-id-anchored formulas
162
+ * are fully invalidated.
163
+ *
164
+ * @param data - 새 행 데이터 배열 / New array of row data
165
+ */
102
166
  setData(data: T[]): void;
167
+ /**
168
+ * 행 하나를 삽입한다. / Insert a single row.
169
+ *
170
+ * @param item - 삽입할 행 데이터(부분) / Row data to insert (partial)
171
+ * @param position - 삽입 위치. 기본 'last' / Insert position. Default `'last'`
172
+ */
103
173
  insertRow(item: Partial<T>, position?: Position): void;
174
+ /**
175
+ * 하나 이상의 행을 끝에 추가한다(트리거 브래킷 없음). / Append one or more rows to the end (no trigger bracket).
176
+ *
177
+ * @param items - 추가할 행(단일 또는 배열) / Row(s) to append (single or array)
178
+ */
104
179
  pushRow(items: Partial<T> | Partial<T>[]): void;
180
+ /**
181
+ * 하나 이상의 행을 제거한다. 제거된 rowId 에 의존하던 수식은 #REF 로 무효화된다.
182
+ * / Remove one or more rows. Formulas depending on a removed rowId are invalidated to #REF.
183
+ *
184
+ * @param rowIndex - 제거할 행의 (표시) 인덱스, 단일 또는 배열 / (Displayed) index of the row(s) to remove, single or array
185
+ */
105
186
  deleteRow(rowIndex: number | number[]): void;
187
+ /**
188
+ * 셀 하나에 값을 쓴다. 배치 개구 중이면 render/emit 을 coalesce 한다.
189
+ * / Write a value to a single cell. Coalesces render/emit while a batch is open.
190
+ *
191
+ * @param rowIndex - 대상 행의 flat index / Flat index of the target row
192
+ * @param field - 컬럼 field 명 / Column field name
193
+ * @param value - 기록할 값 / Value to write
194
+ */
106
195
  writeCell(rowIndex: number, field: string, value: any): void;
107
196
  /**
108
197
  * 배치 쓰기 시작(C2.1). 이후 writeCell 호출들은 render/dataChange 를 지연·coalesce 한다.
109
198
  * 중첩 호출은 카운팅(reentrant) — 가장 바깥 endBatch 에서만 실제로 flush 된다.
199
+ * / Begin batched writes (C2.1). Subsequent writeCell calls defer and coalesce
200
+ * render/dataChange. Nested calls are counted (reentrant) — only the outermost endBatch
201
+ * actually flushes.
110
202
  */
111
203
  beginBatch(): void;
112
204
  /**
113
205
  * 배치 종료(C2.1). 카운터가 0 이 되는 시점에 한해 배치 중 발생한 쓰기가 있으면
114
206
  * _doRender 1회 + dataChange 1회를 발생시킨다(둘 다 0회 또는 1회 — 폭주 차단).
207
+ * / End the batch (C2.1). Only when the counter reaches 0 and a write occurred during the
208
+ * batch does this fire one `_doRender` and one `dataChange` (each either 0 or 1 times — no
209
+ * runaway firing).
115
210
  */
116
211
  endBatch(): void;
117
212
  /**
@@ -119,6 +214,14 @@ export declare class MutationService<T extends Record<string, any> = any> {
119
214
  * FlatRowModel.resolveFlatRow 로 해소해 kind!=='data' (group/tree/detail 의사행)이면
120
215
  * 쓰기 전에 skip 한다(C0.3 쓰기 안전, filler 에 writeCell 절대 금지).
121
216
  * 건너뛴 셀 수를 반환하고, 1건이라도 있으면 announce + 'writeCellsSkip' 이벤트로 표면화한다.
217
+ * / A beginBatch+loop+endBatch wrapper (C2.1). `rowIndex` in each patch is a flat index —
218
+ * if resolving it via `FlatRowModel.resolveFlatRow` yields `kind !== 'data'` (a group/tree/
219
+ * detail pseudo-row), the write is skipped (C0.3 write safety — writeCell is never allowed
220
+ * on fillers). Returns the number of skipped cells and, if any were skipped, surfaces it via
221
+ * announce + a `'writeCellsSkip'` event.
222
+ *
223
+ * @param patches - 적용할 셀 패치 배열 / Array of cell patches to apply
224
+ * @returns 건너뛴 셀 수 / Number of cells skipped
122
225
  */
123
226
  writeCells(patches: Array<{
124
227
  rowIndex: number;
@@ -1,20 +1,54 @@
1
+ /**
2
+ * 조직도 노드 카드의 컬럼(필드) 정의. / Column (field) definition for an org-chart node card.
3
+ */
1
4
  export interface OrgChartColumnDef {
5
+ /** 표시할 데이터 필드명. / Data field name to display. */
2
6
  field: string;
7
+ /** 셀 래퍼에 추가할 CSS 클래스명. / Extra CSS class name for the cell wrapper. */
3
8
  className?: string;
9
+ /** 인라인 스타일 문자열 또는 (값, 행)→스타일 함수. / Inline style string or (value, row)→style function. */
4
10
  style?: string | ((value: any, row: Record<string, any>) => string);
11
+ /** 커스텀 렌더러. 문자열 반환 시 innerHTML, 엘리먼트 반환 시 append. / Custom renderer; a string is set as innerHTML, an element is appended. */
5
12
  renderer?: (value: any, row: Record<string, any>) => HTMLElement | string;
6
13
  }
14
+ /**
15
+ * 조직도 생성 옵션. / Org-chart construction options.
16
+ */
7
17
  export interface OrgChartOptions {
18
+ /** 각 행의 고유 id 필드명. / Field name holding each row's unique id. */
8
19
  idField: string;
20
+ /** 부모 id 를 담은 필드명(트리 구성 기준). / Field name holding the parent id (tree structure key). */
9
21
  parentIdField: string;
22
+ /** 노드 카드에 렌더할 컬럼 정의 배열. / Column definitions rendered inside each node card. */
10
23
  columns: OrgChartColumnDef[];
24
+ /** 노드 카드 너비(px). 기본 160. / Node card width in px. Default 160. @defaultValue 160 */
11
25
  nodeWidth?: number;
26
+ /** 노드 카드 높이(px). 기본 72. / Node card height in px. Default 72. @defaultValue 72 */
12
27
  nodeHeight?: number;
28
+ /** 레벨(세대) 간 세로 간격(px). 기본 52. / Vertical gap between levels in px. Default 52. @defaultValue 52 */
13
29
  levelGap?: number;
30
+ /** 형제 노드 간 가로 간격(px). 기본 20. / Horizontal gap between siblings in px. Default 20. @defaultValue 20 */
14
31
  siblingGap?: number;
32
+ /** 최초 로드 시 전체 펼침 여부. 기본 true. / Whether to expand all on first load. Default true. @defaultValue true */
15
33
  expandOnLoad?: boolean;
34
+ /** 노드 클릭 콜백 (id, 행데이터). / Node click callback (id, row data). */
16
35
  onNodeClick?: (id: any, data: Record<string, any>) => void;
17
36
  }
37
+ /**
38
+ * 조직도 컴포넌트. / Org-chart component.
39
+ *
40
+ * 부모/자식 관계(idField/parentIdField)를 가진 평면 데이터를 트리로 구성해
41
+ * SVG 연결선 + 노드 카드로 렌더한다. 그리드와 독립된 standalone 컴포넌트다.
42
+ * / Builds a tree from flat parent/child data (idField/parentIdField) and renders it as
43
+ * SVG connectors plus node cards. A standalone component independent of the grid.
44
+ *
45
+ * @example
46
+ * const chart = new OrgChart('#org', {
47
+ * idField: 'id', parentIdField: 'managerId',
48
+ * columns: [{ field: 'name' }, { field: 'title' }],
49
+ * });
50
+ * chart.setData([{ id: 1, managerId: null, name: 'CEO', title: '대표' }]);
51
+ */
18
52
  export declare class OrgChart {
19
53
  private _container;
20
54
  private _opts;
@@ -22,12 +56,33 @@ export declare class OrgChart {
22
56
  private _roots;
23
57
  private _expandedKeys;
24
58
  private _selectedId;
59
+ /**
60
+ * @param selector - 마운트할 컨테이너 셀렉터 문자열 또는 엘리먼트 / Container selector string or element to mount into
61
+ * @param opts - 조직도 옵션 / Org-chart options
62
+ */
25
63
  constructor(selector: string | HTMLElement, opts: OrgChartOptions);
64
+ /**
65
+ * 조직도 데이터를 설정하고 렌더한다. / Set org-chart data and render.
66
+ *
67
+ * @param data - 부모/자식 관계를 가진 평면 행 배열 / Flat array of rows with parent/child relations
68
+ */
26
69
  setData(data: Record<string, any>[]): void;
70
+ /**
71
+ * COLOR 축 테마를 컨테이너에 설정한다. / Set the COLOR-axis theme on the container.
72
+ *
73
+ * @param theme - data-og-theme 값 / data-og-theme value
74
+ */
27
75
  setTheme(theme: string): void;
28
- /** R12b: FORM(스킨) 축 — data-og-skin 을 자기 컨테이너에 설정(setTheme 과 동형, 색과 직교). */
76
+ /**
77
+ * R12b: FORM(스킨) 축 — data-og-skin 을 자기 컨테이너에 설정(setTheme 과 동형, 색과 직교).
78
+ * / R12b: FORM (skin) axis — set data-og-skin on the container (symmetric to setTheme, orthogonal to color).
79
+ *
80
+ * @param skin - data-og-skin 값 / data-og-skin value
81
+ */
29
82
  setSkin(skin: string): void;
83
+ /** 모든 노드를 펼친다. / Expand all nodes. */
30
84
  expandAll(): void;
85
+ /** 모든 노드를 접는다(루트만 표시). / Collapse all nodes (roots only). */
31
86
  collapseAll(): void;
32
87
  private _toggle;
33
88
  private _rebuild;
@@ -12,17 +12,34 @@
12
12
  * 본 커널은 단독 클래스로, OpenGrid 인스턴스를 host 로 받아 프로토타입 메서드를
13
13
  * 인스턴스 프로퍼티로 shadowing(순수 런타임 래핑, C1-clean) 한다. 소스 본문 0줄 수정.
14
14
  */
15
+ /** override 커널의 호스트(임의 메서드를 가진 객체, 보통 OpenGrid 인스턴스). / Host of the override kernel (an object with arbitrary methods, usually an OpenGrid instance). */
15
16
  export interface OverrideKernelHost {
16
17
  [name: string]: any;
17
18
  }
18
- /** override() 호출 시 레이어가 받는 함수 시그니처: 첫 인자는 안쪽(원본 근접) 함수. */
19
+ /**
20
+ * override() 호출 시 레이어가 받는 함수 시그니처: 첫 인자는 안쪽(원본 근접) 함수.
21
+ * / Layer function signature received by override(): the first argument is the inner (closest-to-original) function.
22
+ */
19
23
  export type OverrideLayer = (orig: (...args: any[]) => any, ...args: any[]) => any;
24
+ /** override 옵션. / Override options. */
20
25
  export interface OverrideOptions {
21
- /** 동일 name 재진입을 허용(정당한 재귀). 기본 false. */
26
+ /** 동일 name 재진입을 허용(정당한 재귀). 기본 false. / Allow re-entry for the same name (legitimate recursion). Default false. @defaultValue false */
22
27
  reentrant?: boolean;
23
- /** 'fallback' → 레이어 예외 시 경고 후 orig 실행(멱등 가정). 미지정 시 strict(전파). */
28
+ /** 'fallback' → 레이어 예외 시 경고 후 orig 실행(멱등 가정). 미지정 시 strict(전파). / 'fallback' → on layer exception, warn then run orig (idempotent assumption); otherwise strict (propagate). */
24
29
  onError?: 'fallback';
25
30
  }
31
+ /**
32
+ * `grid.override()` 확장 커널. / The `grid.override()` extension kernel.
33
+ *
34
+ * OpenGrid 인스턴스를 host 로 받아 프로토타입 메서드를 인스턴스 프로퍼티로 shadowing 한다
35
+ * (순수 런타임 래핑, 소스 본문 0줄 수정). FIFO 합성 + 재진입 가드 + 에러 격리를 제공한다.
36
+ * / Takes an OpenGrid instance as host and shadows prototype methods with instance properties
37
+ * (pure runtime wrapping, zero source edits). Provides FIFO composition, re-entry guarding, and error isolation.
38
+ *
39
+ * @example
40
+ * const k = new OverrideKernel(grid);
41
+ * k.override('setData', (orig, rows) => orig(rows.filter(r => r.active)));
42
+ */
26
43
  export declare class OverrideKernel {
27
44
  private _host;
28
45
  /** name → this-bound 원본 함수 (최초 1회 보존) */
@@ -39,32 +56,59 @@ export declare class OverrideKernel {
39
56
  private _strict;
40
57
  /** F3: 재귀 깊이 제한 */
41
58
  private _maxDepth;
59
+ /**
60
+ * @param host - override 대상 호스트 객체 / Host object to override
61
+ * @param opts - strict(기본 true, 예외 전파) / maxDepth(기본 32, 재귀 깊이 제한) / strict (default true, propagate) / maxDepth (default 32, recursion depth limit)
62
+ */
42
63
  constructor(host: OverrideKernelHost, opts?: {
43
64
  strict?: boolean;
44
65
  maxDepth?: number;
45
66
  });
46
67
  /**
47
- * 메서드 override 등록.
48
- * 1. 최초 1회 원본을 this-bound 로 보존.
49
- * 2. 레이어 push (FIFO 등록순).
50
- * 3. reduce 좌측폴드로 합성(나중 등록 = 최외곽).
51
- * 4. 재진입 가드 + 에러 격리로 감싼 dispatcher host[name] 인스턴스 프로퍼티에 할당.
68
+ * 메서드 override 등록. / Register a method override.
69
+ *
70
+ * 1. 최초 1회 원본을 this-bound 로 보존. / Preserve the original once, this-bound.
71
+ * 2. 레이어 push (FIFO 등록순). / Push the layer (FIFO registration order).
72
+ * 3. reduce 좌측폴드로 합성(나중 등록 = 최외곽). / Compose via reduce left-fold (later registration = outermost).
73
+ * 4. 재진입 가드 + 에러 격리로 감싼 dispatcher 를 host[name] 인스턴스 프로퍼티에 할당. / Assign a re-entry-guarded, error-isolated dispatcher to the host[name] instance property.
74
+ *
75
+ * @param name - override 대상 메서드명 / Method name to override
76
+ * @param fn - override 레이어(첫 인자는 안쪽 orig) / Override layer (first arg is the inner orig)
77
+ * @param opts - override 옵션 / Override options
78
+ * @returns 체이닝용 host / The host for chaining
52
79
  */
53
80
  override(name: string, fn: OverrideLayer, opts?: OverrideOptions): OverrideKernelHost;
54
81
  /** 합성된 dispatcher 생성. override/restore 시점마다 재구성. */
55
82
  private _buildDispatcher;
56
- /** strategy 슬롯 등록 (Phase 2 매니저 배선용 API). */
83
+ /**
84
+ * strategy 슬롯 등록(매니저 배선용 API). / Register a strategy slot (manager-wiring API).
85
+ *
86
+ * @param slot - 전략 슬롯 이름 / Strategy slot name
87
+ * @param fn - 전략 함수 / Strategy function
88
+ * @returns 체이닝용 host / The host for chaining
89
+ */
57
90
  strategy(slot: string, fn: Function): OverrideKernelHost;
58
- /** strategy 슬롯 조회 — 미등록 시 fallback 반환 (매니저 read API). */
91
+ /**
92
+ * strategy 슬롯 조회 — 미등록 시 fallback 반환(매니저 read API). / Read a strategy slot — returns fallback when unregistered (manager read API).
93
+ *
94
+ * @param slot - 전략 슬롯 이름 / Strategy slot name
95
+ * @param fallback - 미등록 시 반환할 기본 함수 / Default function returned when unregistered
96
+ * @returns 등록된 전략 또는 fallback / The registered strategy or fallback
97
+ */
59
98
  getStrategy<F extends Function>(slot: string, fallback: F): F;
60
- /** 슬롯 등록 여부. */
99
+ /** 전략 슬롯 등록 여부. / Whether a strategy slot is registered. */
61
100
  hasStrategy(slot: string): boolean;
62
- /** 단일 메서드 원본 복구. 없으면 no-op. */
101
+ /**
102
+ * 단일 메서드 원본 복구. 없으면 no-op. / Restore a single method's original; no-op if absent.
103
+ *
104
+ * @param name - 복구할 메서드명 / Method name to restore
105
+ * @returns 체이닝용 host / The host for chaining
106
+ */
63
107
  restore(name: string): OverrideKernelHost;
64
- /** 전체 복구 + strategy clear. destroy 시 호출. */
108
+ /** 전체 복구 + strategy clear. destroy 시 호출. / Restore everything + clear strategies; called on destroy. */
65
109
  restoreAll(): OverrideKernelHost;
66
- /** override 등록 여부. */
110
+ /** 해당 메서드가 override 등록돼 있는가. / Whether the given method is overridden. */
67
111
  hasOverride(name: string): boolean;
68
- /** override 등록된 메서드 이름 목록. */
112
+ /** override 등록된 메서드 이름 목록. / List of overridden method names. */
69
113
  getOverrideNames(): string[];
70
114
  }
@@ -1,15 +1,25 @@
1
+ /**
2
+ * 페이지 변경 시 전달되는 이벤트 페이로드. / Event payload delivered on a page change.
3
+ */
1
4
  export interface PageChangeEvent {
5
+ /** 현재(변경 후) 페이지 번호(1-base). / Current (post-change) page number (1-based). */
2
6
  page: number;
7
+ /** 페이지당 행 수. / Rows per page. */
3
8
  pageSize: number;
9
+ /** 전체 행 수. / Total row count. */
4
10
  totalRows: number;
11
+ /** 전체 페이지 수. / Total page count. */
5
12
  totalPages: number;
6
13
  }
14
+ /** 페이지 변경 콜백. / Callback invoked on a page change. */
7
15
  export type PageChangeFn = (e: PageChangeEvent) => void;
8
16
  /** i18n: 페이지네이션 라벨 해석기(행/페이지·범위 배지·빈 상태). / i18n: pagination label resolver (rows-per-page, range badge, empty). */
9
17
  export type PaginationT = (key: string, params?: Record<string, string | number>) => string;
10
18
  /**
11
- * 그리드 하단 페이지네이션 UI + 상태 관리.
12
- * DataLayer의 _displayIndexes 슬라이싱을 담당.
19
+ * 그리드 하단 페이지네이션 UI + 상태 관리. / Grid bottom pagination UI plus state management.
20
+ *
21
+ * DataLayer의 `_displayIndexes` 슬라이싱 범위(`getRange`)를 계산해 넘겨준다.
22
+ * / Computes the slice range (`getRange`) used against DataLayer's `_displayIndexes`.
13
23
  */
14
24
  export declare class Pagination {
15
25
  private _el;
@@ -19,21 +29,45 @@ export declare class Pagination {
19
29
  private _onChange;
20
30
  private _t;
21
31
  constructor(container: HTMLElement, pageSize: number, onChange: PageChangeFn, t?: PaginationT);
32
+ /** 현재 페이지 번호(1-base). / Current page number (1-based). */
22
33
  get page(): number;
34
+ /** 페이지당 행 수. / Rows per page. */
23
35
  get pageSize(): number;
36
+ /** 전체 페이지 수(최소 1). / Total page count (minimum 1). */
24
37
  get totalPages(): number;
25
- /** 전체 행 수 갱신 → 현재 페이지 유효성 검사 후 재렌더 */
38
+ /**
39
+ * 전체 행 수 갱신 → 현재 페이지 유효성 검사 후 재렌더. / Update the total row count, clamp the current page if needed, and re-render.
40
+ *
41
+ * @param n - 새 전체 행 수 / New total row count
42
+ */
26
43
  setTotalRows(n: number): void;
44
+ /**
45
+ * 페이지당 행 수를 변경하고 1페이지로 리셋한다. / Change rows-per-page and reset to page 1.
46
+ *
47
+ * @param size - 새 페이지당 행 수 / New rows-per-page value
48
+ */
27
49
  setPageSize(size: number): void;
50
+ /**
51
+ * 지정 페이지로 이동한다(범위를 벗어나면 클램프). / Navigate to the given page (clamped to valid range).
52
+ *
53
+ * @param page - 이동할 페이지 번호(1-base) / Target page number (1-based)
54
+ */
28
55
  goTo(page: number): void;
29
- /** 현재 페이지의 [startIndex, endIndex] 반환 (DataLayer 인덱스 기준) */
56
+ /**
57
+ * 현재 페이지의 `[startIndex, endIndex]` 반환(DataLayer 인덱스 기준). / Return `[startIndex, endIndex]` for the current page (DataLayer index space).
58
+ *
59
+ * @returns 현재 페이지의 시작/끝 인덱스(포함) / Start/end index (inclusive) for the current page
60
+ */
30
61
  getRange(): {
31
62
  start: number;
32
63
  end: number;
33
64
  };
65
+ /** @internal 현재 상태로 `onChange` 콜백을 실행한다. / Invokes the `onChange` callback with the current state. */
34
66
  private _emit;
67
+ /** @internal 페이지네이션 바 DOM 을 전체 재렌더한다. / Fully re-renders the pagination bar DOM. */
35
68
  private _render;
36
69
  /** i18n: 상주 크롬 라벨을 활성 로케일로 다시 그린다(setLocale 경로). / i18n: repaint resident chrome labels in the active locale (setLocale path). */
37
70
  refreshLabels(): void;
71
+ /** 페이지네이션 바 DOM 을 제거한다. / Remove the pagination bar DOM. */
38
72
  destroy(): void;
39
73
  }