open-grid 1.1.1 → 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.
- package/CHANGELOG.md +32 -0
- package/README.md +30 -1
- package/dist/OpenGrid-0r_543Kj.cjs +7192 -0
- package/dist/OpenGrid-HmhGVC2V.js +7203 -0
- package/dist/open-grid-react.cjs +27 -1
- package/dist/open-grid-react.js +22 -82
- package/dist/open-grid-vue.cjs +31 -1
- package/dist/open-grid-vue.js +29 -79
- package/dist/open-grid.cjs +272 -6
- package/dist/open-grid.js +174 -260
- package/dist/types/core/CellEditManager.d.ts +75 -0
- package/dist/types/core/CellEventHandler.d.ts +99 -2
- package/dist/types/core/ChartManager.d.ts +53 -3
- package/dist/types/core/ContextMenu.d.ts +48 -3
- package/dist/types/core/CrossGridController.d.ts +86 -15
- package/dist/types/core/CrossGridRegistry.d.ts +36 -2
- package/dist/types/core/DetailManager.d.ts +108 -15
- package/dist/types/core/ExportManager.d.ts +73 -1
- package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
- package/dist/types/core/FilterPanel.d.ts +21 -3
- package/dist/types/core/FilterSelect.d.ts +41 -14
- package/dist/types/core/FindBarManager.d.ts +32 -0
- package/dist/types/core/FlatRowModel.d.ts +54 -11
- package/dist/types/core/FooterManager.d.ts +53 -1
- package/dist/types/core/FormulaController.d.ts +141 -10
- package/dist/types/core/GridComposer.d.ts +57 -4
- package/dist/types/core/GridRenderer.d.ts +3 -0
- package/dist/types/core/GridShuttle.d.ts +44 -4
- package/dist/types/core/GroupTreeManager.d.ts +86 -2
- package/dist/types/core/IconRegistry.d.ts +56 -9
- package/dist/types/core/KeyboardManager.d.ts +90 -4
- package/dist/types/core/MaskingEngine.d.ts +10 -9
- package/dist/types/core/MutationService.d.ts +115 -10
- package/dist/types/core/OpenGrid.d.ts +393 -34
- package/dist/types/core/OrgChart.d.ts +56 -1
- package/dist/types/core/OverrideKernel.d.ts +59 -15
- package/dist/types/core/Pagination.d.ts +44 -5
- package/dist/types/core/RangeSelectionManager.d.ts +123 -7
- package/dist/types/core/RenderController.d.ts +56 -0
- package/dist/types/core/RowManager.d.ts +55 -0
- package/dist/types/core/SkinRegistry.d.ts +51 -15
- package/dist/types/core/SortFilterManager.d.ts +82 -1
- package/dist/types/core/TriggerManager.d.ts +46 -0
- package/dist/types/core/WorksheetManager.d.ts +65 -3
- package/dist/types/core/XmlConverter.d.ts +56 -23
- package/dist/types/core/chart/types.d.ts +107 -10
- package/dist/types/core/detail/DetailGlyph.d.ts +3 -1
- package/dist/types/core/editors/CellEditor.d.ts +29 -2
- package/dist/types/core/formula/types.d.ts +71 -8
- package/dist/types/core/i18n/LocaleRegistry.d.ts +0 -0
- package/dist/types/core/i18n/interpolate.d.ts +5 -0
- package/dist/types/core/i18n/locales/en.d.ts +166 -0
- package/dist/types/core/i18n/locales/ko.d.ts +166 -0
- package/dist/types/core/i18n/types.d.ts +249 -0
- package/dist/types/core/range/RangeQuery.d.ts +24 -2
- package/dist/types/core/renderers/CellRenderer.d.ts +105 -8
- package/dist/types/core/types.d.ts +352 -96
- package/dist/types/index.d.ts +22 -0
- package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
- package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
- package/package.json +4 -1
- package/dist/OpenGrid-LcZ5iixx.cjs +0 -97
- package/dist/OpenGrid-yg4mw6Ge.js +0 -9505
- 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,27 +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
|
|
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
|
|
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. */
|
|
111
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
112
|
+
/** sort/filter 재적용(setData). / Re-apply sort/filter (setData). */
|
|
70
113
|
applyFilters: () => void;
|
|
71
|
-
/** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. */
|
|
114
|
+
/** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. / Consume formula dirty seeds right before the writeCell/endBatch commit emit. */
|
|
72
115
|
flushFormula: () => void;
|
|
73
|
-
/** 현재 가시 범위 렌더(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. */
|
|
74
117
|
doRenderWindow: () => void;
|
|
75
|
-
/** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. */
|
|
118
|
+
/** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. / Full render (this._doRender(0, -1)) — clearData's full mode. */
|
|
76
119
|
doRenderFull: () => void;
|
|
77
|
-
/** 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). */
|
|
78
121
|
resetFormulaState: () => void;
|
|
79
|
-
/** 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'). */
|
|
80
123
|
seedFormulaDirty: (rowIndex: number, field: string) => void;
|
|
81
|
-
/** deleteRow: 제거된 rowId 를 deps 로 갖는 수식들을 #REF 로 무효화(preRender). */
|
|
124
|
+
/** deleteRow: 제거된 rowId 를 deps 로 갖는 수식들을 #REF 로 무효화(preRender). / deleteRow: invalidates formulas that depend on a removed rowId to #REF (preRender). */
|
|
82
125
|
invalidateRemovedRows: (rowIds: string[]) => void;
|
|
83
|
-
/** deleteRow: 제거 전 flat index 의 안정 rowId 확보. */
|
|
126
|
+
/** deleteRow: 제거 전 flat index 의 안정 rowId 확보. / deleteRow: captures the stable rowId at a flat index before removal. */
|
|
84
127
|
getRowIdAt: (rowIndex: number) => string | undefined;
|
|
85
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
|
+
*/
|
|
86
138
|
export declare class MutationService<T extends Record<string, any> = any> {
|
|
87
139
|
private _deps;
|
|
88
140
|
/** reentrant 카운터. 0 초과면 배치 중(writeCell 이 render/dataChange 를 지연). */
|
|
@@ -95,21 +147,66 @@ export declare class MutationService<T extends Record<string, any> = any> {
|
|
|
95
147
|
* 꼬리를 여기로 수렴. **관측 순서는 spec 필드로 인코딩**(정규화 아님 — R0 골든 diff=0).
|
|
96
148
|
* 배치 코얼레싱을 내재화: `coalescable` 커밋은 배치 개구 중 render/emit 을 지연하고
|
|
97
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
|
|
98
157
|
*/
|
|
99
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
|
+
*/
|
|
100
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
|
+
*/
|
|
101
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
|
+
*/
|
|
102
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
|
+
*/
|
|
103
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
|
+
*/
|
|
104
195
|
writeCell(rowIndex: number, field: string, value: any): void;
|
|
105
196
|
/**
|
|
106
197
|
* 배치 쓰기 시작(C2.1). 이후 writeCell 호출들은 render/dataChange 를 지연·coalesce 한다.
|
|
107
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.
|
|
108
202
|
*/
|
|
109
203
|
beginBatch(): void;
|
|
110
204
|
/**
|
|
111
205
|
* 배치 종료(C2.1). 카운터가 0 이 되는 시점에 한해 배치 중 발생한 쓰기가 있으면
|
|
112
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).
|
|
113
210
|
*/
|
|
114
211
|
endBatch(): void;
|
|
115
212
|
/**
|
|
@@ -117,6 +214,14 @@ export declare class MutationService<T extends Record<string, any> = any> {
|
|
|
117
214
|
* FlatRowModel.resolveFlatRow 로 해소해 kind!=='data' (group/tree/detail 의사행)이면
|
|
118
215
|
* 쓰기 전에 skip 한다(C0.3 쓰기 안전, filler 에 writeCell 절대 금지).
|
|
119
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
|
|
120
225
|
*/
|
|
121
226
|
writeCells(patches: Array<{
|
|
122
227
|
rowIndex: number;
|