open-grid 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +30 -1
- package/THIRD_PARTY_LICENSES.txt +43 -0
- package/dist/OpenGrid-B0Spm0rU.js +10404 -0
- package/dist/OpenGrid-CuXj0isp.cjs +97 -0
- package/dist/open-grid-base.css +5 -5
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-skins.css +111 -0
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid.cjs +5 -5
- package/dist/open-grid.js +149 -136
- package/dist/types/core/AppearanceResolver.d.ts +100 -0
- package/dist/types/core/CellEditManager.d.ts +2 -0
- package/dist/types/core/ChartManager.d.ts +2 -0
- package/dist/types/core/ContextMenu.d.ts +5 -1
- package/dist/types/core/CrossGridController.d.ts +70 -0
- package/dist/types/core/DetailManager.d.ts +2 -0
- package/dist/types/core/ExportManager.d.ts +7 -0
- package/dist/types/core/ExtensionPointRegistry.d.ts +92 -0
- package/dist/types/core/FilterPanel.d.ts +4 -1
- package/dist/types/core/FilterSelect.d.ts +4 -1
- package/dist/types/core/FindBarManager.d.ts +6 -0
- package/dist/types/core/FormulaController.d.ts +81 -0
- package/dist/types/core/GridComposer.d.ts +142 -0
- package/dist/types/core/GridRenderer.d.ts +44 -4
- package/dist/types/core/IconRegistry.d.ts +55 -0
- package/dist/types/core/KeyboardManager.d.ts +2 -0
- package/dist/types/core/MutationService.d.ts +128 -0
- package/dist/types/core/OpenGrid.d.ts +464 -68
- package/dist/types/core/OrgChart.d.ts +2 -0
- package/dist/types/core/Pagination.d.ts +6 -1
- package/dist/types/core/RangeSelectionManager.d.ts +2 -0
- package/dist/types/core/RenderController.d.ts +65 -0
- package/dist/types/core/SkinRegistry.d.ts +53 -0
- package/dist/types/core/SortFilterManager.d.ts +2 -0
- package/dist/types/core/WorksheetManager.d.ts +4 -1
- package/dist/types/core/detail/DetailGlyph.d.ts +3 -1
- package/dist/types/core/editors/CellEditor.d.ts +17 -1
- 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/icons/bootstrap-icons.d.ts +9 -0
- package/dist/types/core/renderers/CellRenderer.d.ts +43 -2
- package/dist/types/core/types.d.ts +387 -91
- package/dist/types/index.d.ts +26 -0
- package/package.json +3 -1
- package/dist/OpenGrid-5flQwc3W.js +0 -8434
- package/dist/OpenGrid-DahxRY7C.cjs +0 -92
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
import { EventEmitter } from './EventEmitter.js';
|
|
2
|
+
import { PartialLocaleMessages, LocaleMessageKey, MessageValue } from './i18n/types.js';
|
|
3
|
+
import { SkinTokenDelta, GridOptions, OpenGridInstance, ColumnDef, SortItem, FilterItem, ExportOptions, Position, TriggerHandler, TriggerEvent, OverrideApi, OverrideCallOptions, CellRange, RangeStats } from './types.js';
|
|
2
4
|
import { FilterSelectConfig } from './FilterSelect.js';
|
|
3
5
|
import { MergeCell } from './MergeEngine.js';
|
|
6
|
+
import { RendererFactory } from './renderers/CellRenderer.js';
|
|
7
|
+
import { EditorFactory } from './editors/CellEditor.js';
|
|
4
8
|
import { FlatRowModel } from './FlatRowModel.js';
|
|
5
9
|
import { ChartInstance } from './ChartManager.js';
|
|
6
10
|
import { ChartConfig } from './chart/types.js';
|
|
7
11
|
import { OverrideLayer } from './OverrideKernel.js';
|
|
12
|
+
import { ExtensionPointRegistry } from './ExtensionPointRegistry.js';
|
|
8
13
|
import { FormulaErrorCode } from './formula/types.js';
|
|
9
|
-
|
|
14
|
+
/**
|
|
15
|
+
* OPEN_GRID 코어 그리드 클래스. / The OPEN_GRID core grid class.
|
|
16
|
+
*
|
|
17
|
+
* 컨테이너 요소에 마운트되어 가상 스크롤로 대량 행을 렌더하는 초경량 데이터 그리드.
|
|
18
|
+
* 정렬·필터·그룹/트리·병합·범위선택(F1)·마스터/디테일(F2)·셀 수식(F3)·통합 차트(F4)·
|
|
19
|
+
* override/strategy 확장 커널을 제공한다.
|
|
20
|
+
* / An ultra-light data grid that mounts into a container element and renders large row sets
|
|
21
|
+
* through virtual scrolling. Provides sorting, filtering, group/tree, merging, range selection
|
|
22
|
+
* (F1), master/detail (F2), cell formulas (F3), integrated charts (F4), and the
|
|
23
|
+
* override/strategy extension kernel.
|
|
24
|
+
*
|
|
25
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
26
|
+
* @example
|
|
27
|
+
* const grid = new OpenGrid('#host', {
|
|
28
|
+
* columns: [
|
|
29
|
+
* { field: 'name', header: '이름' },
|
|
30
|
+
* { field: 'qty', header: '수량', type: 'number' },
|
|
31
|
+
* ],
|
|
32
|
+
* height: 400,
|
|
33
|
+
* });
|
|
34
|
+
* grid.setData([{ name: 'Kim', qty: 3 }]);
|
|
35
|
+
*/
|
|
10
36
|
export declare class OpenGrid<T extends Record<string, any> = any> extends EventEmitter implements OpenGridInstance<T> {
|
|
11
37
|
private _container;
|
|
12
38
|
private _options;
|
|
@@ -15,12 +41,24 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
15
41
|
private _vs;
|
|
16
42
|
private _ro;
|
|
17
43
|
private _renderer;
|
|
44
|
+
private _appearance;
|
|
45
|
+
/** R12c: per-instance 아이콘 오버라이드 레지스트리(전역 iconRegistry 의 child). 첫 setIcon 때 지연 생성. */
|
|
46
|
+
private _icons;
|
|
47
|
+
/** i18n: per-instance 로케일 오버라이드 레지스트리(전역 localeRegistry 의 child). locale/messages 옵션 또는 첫 setLocale/setMessage 때 지연 생성. */
|
|
48
|
+
private _locales;
|
|
18
49
|
private _sfMgr;
|
|
19
50
|
private _rowMgr;
|
|
20
51
|
private _editMgr;
|
|
21
52
|
private _trigMgr;
|
|
22
53
|
private _destroyed;
|
|
23
|
-
|
|
54
|
+
/** R5(§3.1 C4): 렌더 루프 컨트롤러. `_mount` 에서 renderer/vs 배선 초입에 생성. */
|
|
55
|
+
private _render;
|
|
56
|
+
/** R6(§3.1 C5): 데이터 변경 서비스(setData/insert/push/delete/writeCell/writeCells + batch + commit). */
|
|
57
|
+
private _mutation;
|
|
58
|
+
/** R7(§3.1 C9): F3 수식 컨트롤러(accessor 조립·recalc flush·에러 표현 + 공개 수식 API). */
|
|
59
|
+
private _formula;
|
|
60
|
+
/** R7(§3.1 C8): 크로스그리드 컨트롤러(moveRowsTo/매핑/3단계 드롭 발화). */
|
|
61
|
+
private _cross;
|
|
24
62
|
private _colWidths;
|
|
25
63
|
/** 사용자가 헤더 드래그로 직접 조절한 컬럼 폭 (field 기준). _recalcWidths 가 덮어쓰지 않도록 보존 */
|
|
26
64
|
private _userWidths;
|
|
@@ -52,67 +90,195 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
52
90
|
private _recalc;
|
|
53
91
|
/** F3(C2): writeCell 단건 쓰기가 쌓아두는 dirty seed. endBatch/즉시 flush 시 onValuesChanged 1회로 소비. */
|
|
54
92
|
private _formulaDirtySeeds;
|
|
55
|
-
/** reentrant 카운터. 0 초과면 배치 중(writeCell 이 render/dataChange 를 지연). */
|
|
56
|
-
private _batchDepth;
|
|
57
|
-
/** 배치 구간 중 실제 쓰기가 1건이라도 있었는지(빈 배치는 endBatch 에서 아무 것도 안 함). */
|
|
58
|
-
private _batchDirty;
|
|
59
93
|
private _ovk;
|
|
60
|
-
/** 공개 override API (호출가능 + .strategy). 생성자 말미에 부착. */
|
|
94
|
+
/** 공개 override API (호출가능 + .strategy). 생성자 말미에 부착. / Public override API (callable + .strategy). Attached at the end of the constructor. */
|
|
61
95
|
override: OverrideApi<T>;
|
|
96
|
+
/** R11(§3.1 C7): 커널 위 타입드 확장점 레지스트리. _mount 초입에 생성(커널 준비 후). */
|
|
97
|
+
private _extensions;
|
|
98
|
+
/** R11: 타입드 확장점 레지스트리 정면(렌더훅 등록·strategy/override 타입드 카탈로그·MutationHook·catalog). / R11: typed extension-point registry facade (render-hook registration, typed strategy/override catalog, MutationHook, catalog). */
|
|
99
|
+
get extensions(): ExtensionPointRegistry<T>;
|
|
62
100
|
/** 정적 전역 override 레이어 (모든 신규 인스턴스에 생성자 말미 적용). */
|
|
63
101
|
private static _defaultOverrides;
|
|
64
102
|
/** 정적 전역 strategy 슬롯. */
|
|
65
103
|
private static _defaultStrategies;
|
|
66
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* 정적: 모든 신규 그리드에 적용될 override 레이어 등록. / Static: register an override layer
|
|
106
|
+
* applied to every newly created grid.
|
|
107
|
+
*
|
|
108
|
+
* @param name - 대상 공개 메서드 이름 / Target public method name
|
|
109
|
+
* @param fn - override 레이어 함수(첫 인자 orig) / Override layer function (first arg = orig)
|
|
110
|
+
* @param opts - 재진입/에러 정책 / Reentrancy & error policy
|
|
111
|
+
* @returns 체이닝용 OpenGrid 클래스 / The OpenGrid class for chaining
|
|
112
|
+
* @example
|
|
113
|
+
* OpenGrid.defaultOverride('getDisplayValue', (orig, ri, field) => orig(ri, field).toUpperCase());
|
|
114
|
+
*/
|
|
67
115
|
static defaultOverride(name: string, fn: OverrideLayer, opts?: OverrideCallOptions): typeof OpenGrid;
|
|
68
|
-
/** 정적 전역 defaults 네임스페이스 (strategy 슬롯). */
|
|
116
|
+
/** 정적 전역 defaults 네임스페이스 (strategy 슬롯). / Static global defaults namespace (strategy slots). */
|
|
69
117
|
static defaults: {
|
|
70
118
|
strategy(slot: string, fn: Function): typeof OpenGrid;
|
|
71
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* 커스텀 셀 렌더러 타입을 코어 편집 없이 등록. `col.type`/`col.renderer`(문자열 또는 `{type}`)가
|
|
122
|
+
* `typeName` 과 일치하면 등록 팩토리가 렌더러를 생성한다. 프로세스 전역(모든 그리드 인스턴스 공유).
|
|
123
|
+
* / Register a custom cell renderer type without editing the core. When `col.type`/`col.renderer`
|
|
124
|
+
* (string or `{type}`) matches `typeName`, the registered factory creates the renderer.
|
|
125
|
+
* Process-global (shared by all grid instances).
|
|
126
|
+
*
|
|
127
|
+
* @param typeName - 렌더러 타입 이름 / Renderer type name
|
|
128
|
+
* @param factory - 렌더러 팩토리 / Renderer factory
|
|
129
|
+
* @returns 체이닝용 OpenGrid 클래스 / The OpenGrid class for chaining
|
|
130
|
+
* @example
|
|
131
|
+
* OpenGrid.registerRenderer('stars', () => ({ render: (ctx) => '★'.repeat(ctx.value) }));
|
|
132
|
+
*/
|
|
133
|
+
static registerRenderer(typeName: string, factory: RendererFactory): typeof OpenGrid;
|
|
134
|
+
/**
|
|
135
|
+
* 커스텀 셀 에디터 타입을 코어 편집 없이 등록(OCP). 프로세스 전역.
|
|
136
|
+
* / Register a custom cell editor type without editing the core (OCP). Process-global.
|
|
137
|
+
*
|
|
138
|
+
* @param typeName - 에디터 타입 이름 / Editor type name
|
|
139
|
+
* @param factory - 에디터 팩토리 / Editor factory
|
|
140
|
+
* @returns 체이닝용 OpenGrid 클래스 / The OpenGrid class for chaining
|
|
141
|
+
*/
|
|
142
|
+
static registerEditor(typeName: string, factory: EditorFactory): typeof OpenGrid;
|
|
143
|
+
/**
|
|
144
|
+
* R12b(item3 §6.2): 커스텀 스킨을 코어 편집 없이 등록(defaultOverride 와 동형의 전역 정책).
|
|
145
|
+
* FORM-only 검증(색 리터럴 거부 = 색⊥형태 직교성) + HANMS 접근성 가드레일(포커스 <2px/none 클램프)
|
|
146
|
+
* 적용 후, 런타임 `<style>` 로 `.og-container[data-og-skin="name"]` 블록을 주입한다. 이후 어떤
|
|
147
|
+
* 인스턴스도 `grid.setSkin(name)` 으로 사용. 색값이 델타에 있으면 **throw**.
|
|
148
|
+
*
|
|
149
|
+
* 예) Neumorph 는 기본 카탈로그에서 컷(HANMS §1.3)됐으나 여기서 레시피로 재현 가능:
|
|
150
|
+
* OpenGrid.defineSkin('neumorph', { '--og-radius-md':'14px', '--og-elevation-inset':'inset -4px -4px 8px', … })
|
|
151
|
+
*
|
|
152
|
+
* / R12b (item3 §6.2): register a custom skin without editing the core (global policy, same
|
|
153
|
+
* shape as defaultOverride). After FORM-only validation (color literals rejected = color⊥form
|
|
154
|
+
* orthogonality) plus accessibility guardrails (focus <2px/none clamped), a runtime `<style>`
|
|
155
|
+
* block for `.og-container[data-og-skin="name"]` is injected. Any instance can then call
|
|
156
|
+
* `grid.setSkin(name)`. **Throws** when the delta contains color values.
|
|
157
|
+
*
|
|
158
|
+
* @param name - 스킨 id / Skin id
|
|
159
|
+
* @param delta - FORM 전용 토큰 델타 / FORM-only token delta
|
|
160
|
+
* @returns 체이닝용 OpenGrid 클래스 / The OpenGrid class for chaining
|
|
161
|
+
*/
|
|
162
|
+
static defineSkin(name: string, delta: SkinTokenDelta): typeof OpenGrid;
|
|
163
|
+
/**
|
|
164
|
+
* R12c(item3 §5.1, 계약 C13): 시맨틱 아이콘 role 세트를 코어 편집 없이 **전역** 등록/교체
|
|
165
|
+
* (defineSkin/registerRenderer 와 동형의 프로세스 전역 정책). 값은 알려진 아이콘 key(`BOOTSTRAP_ICONS`)
|
|
166
|
+
* 이거나 원시 SVG 본문 마크업. 이후 모든 인스턴스의 아이콘 해석에 반영된다. per-instance 교체는
|
|
167
|
+
* `grid.setIcon(role, svg)` 참조.
|
|
168
|
+
* 예) OpenGrid.defineIconSet({ 'sort.asc': 'arrow-up', 'row.delete': '<path d="…"/>' })
|
|
169
|
+
*
|
|
170
|
+
* / R12c (item3 §5.1, contract C13): register/replace semantic icon role sets **globally**
|
|
171
|
+
* without editing the core (process-global policy, same shape as defineSkin/registerRenderer).
|
|
172
|
+
* Values are either known icon keys (`BOOTSTRAP_ICONS`) or raw SVG body markup. Affects icon
|
|
173
|
+
* resolution of all instances. For per-instance replacement see `grid.setIcon(role, svg)`.
|
|
174
|
+
*
|
|
175
|
+
* @param map - role → 아이콘 key 또는 원시 SVG / role → icon key or raw SVG
|
|
176
|
+
* @returns 체이닝용 OpenGrid 클래스 / The OpenGrid class for chaining
|
|
177
|
+
*/
|
|
178
|
+
static defineIconSet(map: Record<string, string>): typeof OpenGrid;
|
|
179
|
+
/**
|
|
180
|
+
* i18n: UI 문자열 로케일을 코어 편집 없이 **전역** 등록/교체(defineSkin/defineIconSet 와 동형의
|
|
181
|
+
* 얇은 위임 파사드 — 정본은 `localeRegistry.register`). 부분 카탈로그 허용(폴백이 ko 로 메움).
|
|
182
|
+
* 이후 모든 인스턴스가 `grid.setLocale(id)` 로 사용. per-instance 오버라이드는 `grid.setMessage` 참조.
|
|
183
|
+
* 예) OpenGrid.defineLocale('ja', { contextMenu: { find: '検索' } })
|
|
184
|
+
*
|
|
185
|
+
* / i18n: register/replace a UI-string locale **globally** without editing the core (thin
|
|
186
|
+
* delegation façade isomorphic to defineSkin/defineIconSet — the canonical entry is
|
|
187
|
+
* `localeRegistry.register`). Partial catalogs are allowed (ko fills the gaps via fallback).
|
|
188
|
+
* Any instance can then call `grid.setLocale(id)`. For per-instance overrides see `grid.setMessage`.
|
|
189
|
+
*
|
|
190
|
+
* @param id - 로케일 id(예 'ja') / Locale id (e.g. 'ja')
|
|
191
|
+
* @param messages - 메시지 부분/전체 카탈로그 / Partial or full message catalog
|
|
192
|
+
* @param opts - `extends`: ko 이전에 시도할 폴백 로케일 / `extends`: fallback locale tried before ko
|
|
193
|
+
* @returns 체이닝용 OpenGrid 클래스 / The OpenGrid class for chaining
|
|
194
|
+
*/
|
|
195
|
+
static defineLocale(id: string, messages: PartialLocaleMessages, opts?: {
|
|
196
|
+
extends?: string;
|
|
197
|
+
}): typeof OpenGrid;
|
|
198
|
+
/**
|
|
199
|
+
* 그리드를 생성해 컨테이너에 마운트한다. / Create the grid and mount it into the container.
|
|
200
|
+
*
|
|
201
|
+
* @param container - CSS 셀렉터 또는 호스트 요소 / CSS selector or host element
|
|
202
|
+
* @param options - 그리드 옵션(columns 필수) / Grid options (columns required)
|
|
203
|
+
* @example
|
|
204
|
+
* const grid = new OpenGrid('#host', { columns: [{ field: 'id', header: 'ID' }] });
|
|
205
|
+
*/
|
|
72
206
|
constructor(container: string | HTMLElement, options: GridOptions<T>);
|
|
207
|
+
/** 단일 메서드의 override 를 원본으로 복구. / Restore a single overridden method to the original. */
|
|
73
208
|
restore(name: string): this;
|
|
209
|
+
/** 모든 override·strategy 를 복구(destroy 시 자동 수행). / Restore all overrides & strategies (run automatically on destroy). */
|
|
74
210
|
restoreAll(): this;
|
|
211
|
+
/** 해당 메서드가 override 되어 있는지 확인. / Whether the method is currently overridden. */
|
|
75
212
|
hasOverride(name: string): boolean;
|
|
213
|
+
/** override 등록된 메서드 이름 목록. / Names of currently overridden methods. */
|
|
76
214
|
getOverrideNames(): string[];
|
|
215
|
+
/** strategy 슬롯 조회(미등록 시 fallback 반환). / Read a strategy slot (returns fallback when unset). */
|
|
77
216
|
getStrategy<F extends Function>(slot: string, fallback: F): F;
|
|
78
217
|
private _mount;
|
|
79
218
|
private _initContextMenu;
|
|
219
|
+
/**
|
|
220
|
+
* 컨텍스트 메뉴를 지정 좌표에 연다. / Open the context menu at the event position.
|
|
221
|
+
*
|
|
222
|
+
* @param e - 좌표를 제공할 마우스 이벤트 / Mouse event providing coordinates
|
|
223
|
+
* @param items - 커스텀 메뉴 항목(생략 시 기본 메뉴) / Custom items (default menu when omitted)
|
|
224
|
+
*/
|
|
80
225
|
openContextMenu(e: MouseEvent, items?: import('./types').ContextMenuItem[]): void;
|
|
226
|
+
/** 컨텍스트 메뉴를 닫는다. / Close the context menu. */
|
|
81
227
|
closeContextMenu(): void;
|
|
228
|
+
/**
|
|
229
|
+
* 캐스케이딩 필터 셀렉트 패널 설정(null = 제거). / Configure the cascading filter-select panel
|
|
230
|
+
* (null removes it).
|
|
231
|
+
*/
|
|
82
232
|
setFilterSelect(config: FilterSelectConfig | null): void;
|
|
233
|
+
/**
|
|
234
|
+
* 옵션을 런타임에 부분 갱신한다 (contextMenu 재초기화, groupBy 재구성 등).
|
|
235
|
+
* / Partially update options at runtime (re-inits contextMenu, rebuilds groupBy, etc.).
|
|
236
|
+
*
|
|
237
|
+
* @param opts - 갱신할 옵션 부분집합 / Subset of options to update
|
|
238
|
+
*/
|
|
83
239
|
setOptions(opts: Partial<GridOptions<T>>): void;
|
|
84
240
|
/**
|
|
85
|
-
* 컬럼 마스킹 ON/OFF 전환.
|
|
86
|
-
* enabled=true → 마스킹 적용 (기본 상태)
|
|
87
|
-
* enabled=false → 컬럼 전체 마스킹 해제 (원문 표시)
|
|
241
|
+
* 컬럼 마스킹 ON/OFF 전환. / Toggle column masking on/off.
|
|
242
|
+
* enabled=true → 마스킹 적용 (기본 상태) / apply masking (default state)
|
|
243
|
+
* enabled=false → 컬럼 전체 마스킹 해제 (원문 표시) / reveal the whole column (show raw values)
|
|
244
|
+
*
|
|
245
|
+
* @param field - 대상 컬럼 field / Target column field
|
|
246
|
+
* @param enabled - 마스킹 활성 여부 / Whether masking is active
|
|
88
247
|
*/
|
|
89
248
|
setMaskEnabled(field: string, enabled: boolean): void;
|
|
90
|
-
/** 현재 컬럼 마스킹 활성 여부 반환. true=마스킹 중, false=해제됨 */
|
|
249
|
+
/** 현재 컬럼 마스킹 활성 여부 반환. true=마스킹 중, false=해제됨 / Return whether masking is active for the column (true = masked, false = revealed). */
|
|
91
250
|
getMaskEnabled(field: string): boolean;
|
|
92
251
|
private _initWorksheets;
|
|
93
252
|
private _loadWorksheetState;
|
|
253
|
+
/**
|
|
254
|
+
* 워크시트(탭)를 추가한다. / Add a worksheet (tab).
|
|
255
|
+
*
|
|
256
|
+
* @param name - 시트 이름 / Sheet name
|
|
257
|
+
* @param columns - 시트 전용 컬럼(생략 시 그리드 columns) / Sheet columns (grid columns when omitted)
|
|
258
|
+
* @param data - 시트 데이터 / Sheet data
|
|
259
|
+
*/
|
|
94
260
|
addWorksheet(name: string, columns?: import('./types').ColumnDef<T>[], data?: T[]): void;
|
|
261
|
+
/** 워크시트를 제거한다. / Remove a worksheet. */
|
|
95
262
|
removeWorksheet(name: string): void;
|
|
263
|
+
/** 지정 워크시트로 전환한다. / Switch to the given worksheet. */
|
|
96
264
|
switchWorksheet(name: string): void;
|
|
265
|
+
/** 워크시트 이름을 변경한다. / Rename a worksheet. */
|
|
97
266
|
renameWorksheet(oldName: string, newName: string): void;
|
|
267
|
+
/** 워크시트 상태 스냅샷 조회(없으면 undefined). / Get a worksheet state snapshot (undefined when absent). */
|
|
98
268
|
getWorksheet(name: string): import('./types').WorksheetState<T> | undefined;
|
|
269
|
+
/** 워크시트 이름 목록. / List of worksheet names. */
|
|
99
270
|
getWorksheetNames(): string[];
|
|
271
|
+
/** 모든 워크시트를 다중 시트 엑셀로 내보낸다. / Export all worksheets as a multi-sheet Excel file. */
|
|
100
272
|
exportSheetsExcel(filename?: string): void;
|
|
101
|
-
private _paginationHeight;
|
|
102
273
|
private _onResize;
|
|
103
274
|
private _recalcWidths;
|
|
104
275
|
private _renderHeader;
|
|
105
|
-
/**
|
|
106
|
-
* 렌더된 헤더의 실제 높이를 측정해 본문(bodyWrap) 높이와 뷰포트 높이에 반영한다.
|
|
107
|
-
* 줄바꿈이 없는 헤더는 측정 높이가 headerHeight 이하라 기존 고정 동작과 동일하다.
|
|
108
|
-
*/
|
|
109
276
|
private _syncHeaderLayout;
|
|
110
277
|
private _doRender;
|
|
111
278
|
/** F2(§4.5/§6.1): masterDetail.enabled 아니면 undefined(GridRenderer 는 기존 경로 그대로). */
|
|
112
279
|
private _buildDetailRenderContext;
|
|
113
280
|
private _handleGroupToggle;
|
|
114
281
|
private _visRange;
|
|
115
|
-
private _visCount;
|
|
116
282
|
private _handleSortClick;
|
|
117
283
|
private _isToggleCol;
|
|
118
284
|
private _handleCellClick;
|
|
@@ -127,132 +293,181 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
127
293
|
private _handleFilterIconClick;
|
|
128
294
|
private _handleAllCheck;
|
|
129
295
|
private _handleRowDrop;
|
|
130
|
-
/** 드래그/셔틀이 참조하는 바디 엘리먼트 (레지스트리 해석용) */
|
|
296
|
+
/** @internal 드래그/셔틀이 참조하는 바디 엘리먼트 (레지스트리 해석용) / Body element referenced by drag/shuttle (registry resolution). */
|
|
131
297
|
_crossBodyEl(): HTMLElement;
|
|
132
298
|
/** fromIndex 를 잡고 드래그할 때 함께 이동할 행 집합 (다중선택에 포함되면 선택 전체) */
|
|
133
299
|
private _dragRowSet;
|
|
134
|
-
/** 드래그 드롭 어댑터 → 공개 moveRowsTo 로 위임 */
|
|
135
|
-
private _handleCrossGridDrop;
|
|
136
300
|
/**
|
|
137
301
|
* 이 그리드의 행들을 다른 그리드로 이동(move)한다. 드래그·화살표 셔틀 공통 경로.
|
|
138
302
|
* 3단계 이벤트(before→after→complete)와 crossGridMapping(필드 매핑)을 적용한다.
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* @
|
|
303
|
+
* / Move rows from this grid to another grid (shared path for drag and arrow shuttle).
|
|
304
|
+
* Applies the three-phase events (before→after→complete) and crossGridMapping (field mapping).
|
|
305
|
+
*
|
|
306
|
+
* @param target - 대상 그리드 / Target grid
|
|
307
|
+
* @param sourceIndexes - 이동할 소스 행 인덱스들 / Source row indexes to move
|
|
308
|
+
* @param targetIndex - 삽입 시작 인덱스(생략 시 끝) / Insertion start index (end when omitted)
|
|
309
|
+
* @returns 이동 성공 여부 / Whether the move succeeded
|
|
143
310
|
*/
|
|
144
311
|
moveRowsTo(target: OpenGridInstance<T>, sourceIndexes: number[], targetIndex?: number): Promise<boolean>;
|
|
145
|
-
/** 체크된 행을 다른 그리드로 이동 (화살표 셔틀용). 체크 없으면 무시. */
|
|
312
|
+
/** 체크된 행을 다른 그리드로 이동 (화살표 셔틀용). 체크 없으면 무시. / Move checked rows to another grid (arrow-shuttle use). No-op when nothing is checked. */
|
|
146
313
|
moveCheckedTo(target: OpenGridInstance<T>): Promise<boolean>;
|
|
147
|
-
/**
|
|
148
|
-
* 크로스그리드 이동의 행 변환 함수를 결정한다.
|
|
149
|
-
* 반환: null=변환 불필요(그대로) / 함수=변환 적용 / false=매핑 모달 취소(이동 중단)
|
|
150
|
-
*/
|
|
151
|
-
private _resolveCrossTransform;
|
|
152
|
-
private _fireGridDropBefore;
|
|
153
|
-
private _fireGridDropAfter;
|
|
154
|
-
private _fireGridDropComplete;
|
|
155
|
-
/** 행을 드롭으로 이동할 때 실행된다 */
|
|
156
|
-
/** ???꾩튂 ?대룞 */
|
|
314
|
+
/** 행 위치 이동(드롭 경로에서 실행). / Move a row to a new position (executed on the drop path). */
|
|
157
315
|
reorderRow(fromIndex: number, toIndex: number): void;
|
|
158
316
|
private _handleColResize;
|
|
159
317
|
private _handleKeyDown;
|
|
160
318
|
private _setFocusCell;
|
|
161
319
|
private _announce;
|
|
162
320
|
private _bindOptionEvents;
|
|
321
|
+
/**
|
|
322
|
+
* 그리드 데이터를 통째로 교체한다(행 id 재발급, F3 수식 상태 초기화).
|
|
323
|
+
* / Replace the entire data set (row ids reissued; F3 formula state reset).
|
|
324
|
+
*
|
|
325
|
+
* @param data - 새 행 배열 / New array of rows
|
|
326
|
+
* @example
|
|
327
|
+
* grid.setData([{ name: 'Kim' }, { name: 'Lee' }]);
|
|
328
|
+
*/
|
|
163
329
|
setData(data: T[]): void;
|
|
330
|
+
/** 현재(정렬/필터 반영) 데이터 배열. / Current data array (sort/filter applied). */
|
|
164
331
|
getData(): T[];
|
|
332
|
+
/** 원본(정렬/필터 미반영) 데이터 배열. / Original data array (before sort/filter). */
|
|
165
333
|
getSourceRows(): T[];
|
|
334
|
+
/** 데이터 뒤에 행들을 추가한다. / Append rows after the existing data. */
|
|
166
335
|
pushData(data: T[]): void;
|
|
336
|
+
/** 데이터 앞에 행들을 추가한다. / Prepend rows before the existing data. */
|
|
167
337
|
prefixData(data: T[]): void;
|
|
338
|
+
/** 모든 행을 제거한다(컬럼·옵션 유지). / Remove all rows (columns & options kept). */
|
|
168
339
|
clearData(): void;
|
|
340
|
+
/**
|
|
341
|
+
* 지정 위치에 행 1건을 삽입한다. / Insert one row at the given position.
|
|
342
|
+
*
|
|
343
|
+
* @param item - 행 데이터(부분 객체 허용) / Row data (partial object allowed)
|
|
344
|
+
* @param position - 삽입 위치(기본 'last') / Insertion position (default 'last')
|
|
345
|
+
*/
|
|
169
346
|
insertRow(item: Partial<T>, position?: Position): void;
|
|
347
|
+
/** 행(들)을 끝에 추가한다. / Append row(s) at the end. */
|
|
170
348
|
pushRow(items: Partial<T> | Partial<T>[]): void;
|
|
171
|
-
/** @deprecated 하위호환 alias → pushRow */
|
|
349
|
+
/** @deprecated 하위호환 alias → pushRow / Backward-compat alias → pushRow */
|
|
172
350
|
appendRows(items: Partial<T> | Partial<T>[]): void;
|
|
351
|
+
/** 행(들)을 맨 앞에 추가한다. / Prepend row(s) at the beginning. */
|
|
173
352
|
unshiftRow(items: Partial<T> | Partial<T>[]): void;
|
|
174
|
-
/** @deprecated 하위호환 alias → unshiftRow */
|
|
353
|
+
/** @deprecated 하위호환 alias → unshiftRow / Backward-compat alias → unshiftRow */
|
|
175
354
|
prependRows(items: Partial<T> | Partial<T>[]): void;
|
|
355
|
+
/** 행(단건 또는 복수 인덱스)을 삭제한다. / Delete row(s) by index (single or array). */
|
|
176
356
|
deleteRow(rowIndex: number | number[]): void;
|
|
357
|
+
/**
|
|
358
|
+
* @deprecated no-op stub — id 기반 삭제는 미구현(본문 없음). 인덱스로 지우려면 `deleteRow(rowIndex)`
|
|
359
|
+
* 를, id→인덱스 변환은 `getFlatRowModel()`/`getData()` 조회 후 `deleteRow` 를 사용.
|
|
360
|
+
* / no-op stub — id-based deletion is not implemented (empty body). Use `deleteRow(rowIndex)`;
|
|
361
|
+
* resolve id→index via `getFlatRowModel()`/`getData()` first.
|
|
362
|
+
*/
|
|
177
363
|
deleteById(_ids: string[]): void;
|
|
364
|
+
/** 원시 셀 값을 읽는다. / Read the raw cell value. */
|
|
178
365
|
readCell(rowIndex: number, field: string): any;
|
|
366
|
+
/**
|
|
367
|
+
* 셀 표시 텍스트를 해석한다(displayFormatter strategy 반영). / Resolve the cell display text
|
|
368
|
+
* (honors the displayFormatter strategy).
|
|
369
|
+
*/
|
|
179
370
|
getDisplayValue(rowIndex: number, field: string): string;
|
|
371
|
+
/** 셀 값을 쓰고 변경 추적·수식 dirty 적립·재렌더한다. / Write a cell value (change tracking, formula dirty seeding, re-render). */
|
|
180
372
|
writeCell(rowIndex: number, field: string, value: any): void;
|
|
373
|
+
/** 지정 인덱스의 행 객체. / Row object at the given index. */
|
|
181
374
|
getRowAt(rowIndex: number): T;
|
|
182
|
-
/** flat/visual index ↔ data 리졸버(C0.3). F1/F3/F4 는 이 모델만 경유해야 한다. */
|
|
375
|
+
/** flat/visual index ↔ data 리졸버(C0.3). F1/F3/F4 는 이 모델만 경유해야 한다. / flat/visual index ↔ data resolver (C0.3). F1/F3/F4 must go through this model. */
|
|
183
376
|
getFlatRowModel(): FlatRowModel;
|
|
184
|
-
/**
|
|
185
|
-
* 배치 쓰기 시작(C2.1). 이후 writeCell 호출들은 render/dataChange 를 지연·coalesce 한다.
|
|
186
|
-
* 중첩 호출은 카운팅(reentrant) — 가장 바깥 endBatch 에서만 실제로 flush 된다.
|
|
187
|
-
*/
|
|
377
|
+
/** 배치 쓰기 시작 — 이후 writeCell 의 렌더/이벤트를 지연·병합. / Begin a write batch — subsequent writeCell renders/events are deferred & coalesced. */
|
|
188
378
|
beginBatch(): void;
|
|
189
|
-
/**
|
|
190
|
-
* 배치 종료(C2.1). 카운터가 0 이 되는 시점에 한해 배치 중 발생한 쓰기가 있으면
|
|
191
|
-
* _doRender 1회 + dataChange 1회를 발생시킨다(둘 다 0회 또는 1회 — 폭주 차단).
|
|
192
|
-
* 향후 F3 재계산 훅 지점: 아래 flush 블록 안에 RecalcCoordinator.onValuesChanged(dirtyKeys)
|
|
193
|
-
* 1회 호출을 끼워 넣는다(Phase 0 시점엔 미구현 — 계약 §C2.1 참조).
|
|
194
|
-
*/
|
|
379
|
+
/** 배치 종료 — 쓰기가 있었으면 1회 렌더 + 1회 dataChange. / End the batch — one render + one coalesced dataChange if anything was written. */
|
|
195
380
|
endBatch(): void;
|
|
196
|
-
/** writeCell 이 적립한 dirty seed 를 1회 onValuesChanged 로 소비하고 formulaRecalc 를 emit. */
|
|
197
|
-
private _flushFormulaRecalc;
|
|
198
381
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
382
|
+
* 셀에 수식을 설정한다("=A1+B2" 형태). / Set a cell formula (e.g. "=A1+B2").
|
|
383
|
+
*
|
|
384
|
+
* @param rowIndex - flat index(C0) / flat index (C0)
|
|
385
|
+
* @param field - 컬럼 field / Column field
|
|
386
|
+
* @param formula - '=' 로 시작하는 수식 원문 / Formula source starting with '='
|
|
387
|
+
* @example
|
|
388
|
+
* grid.setCellFormula(2, 'total', '=A1+B1');
|
|
202
389
|
*/
|
|
203
|
-
private _afterRecalc;
|
|
204
|
-
private _handleFormulaError;
|
|
205
|
-
private _formulaErrorMessageKo;
|
|
206
|
-
/** F3 accessor(C0/C0.5/C1) — FlatRowModel + ColumnLayout.visibleLeaves + DataLayer(rowId 기반)만 본다. */
|
|
207
|
-
private _buildFormulaAccessor;
|
|
208
390
|
setCellFormula(rowIndex: number, field: string, formula: string): void;
|
|
209
|
-
|
|
391
|
+
/** 셀 수식 원문(없으면 null). / Formula source of the cell (null when absent). */
|
|
210
392
|
getCellFormula(rowIndex: number, field: string): string | null;
|
|
393
|
+
/** 셀에 수식이 있는지. / Whether the cell has a formula. */
|
|
211
394
|
hasCellFormula(rowIndex: number, field: string): boolean;
|
|
395
|
+
/** 수식 제거(마지막 계산값은 유지). / Remove the formula (last computed value kept). */
|
|
212
396
|
clearCellFormula(rowIndex: number, field: string): void;
|
|
397
|
+
/** 셀 수식 에러 코드(없으면 null). / Formula error code of the cell (null when none). */
|
|
213
398
|
getCellError(rowIndex: number, field: string): FormulaErrorCode | null;
|
|
399
|
+
/** 디버깅용 — 이 셀을 참조하는(종속) 셀들. / Debugging — cells that depend on this cell. */
|
|
214
400
|
getDependents(rowIndex: number, field: string): Array<{
|
|
215
401
|
rowIndex: number;
|
|
216
402
|
field: string;
|
|
217
403
|
}>;
|
|
404
|
+
/** 디버깅용 — 이 셀이 참조하는(선행) 셀들. / Debugging — cells this cell references (precedents). */
|
|
218
405
|
getPrecedents(rowIndex: number, field: string): Array<{
|
|
219
406
|
rowIndex: number;
|
|
220
407
|
field: string;
|
|
221
408
|
}>;
|
|
409
|
+
/** 전체 수식 위상 재계산. / Recalculate all formulas in topological order. */
|
|
222
410
|
recalculate(): void;
|
|
411
|
+
/** 단일 셀 + 종속 폐포만 재계산. / Recalculate one cell plus its dependent closure. */
|
|
223
412
|
recalculateCell(rowIndex: number, field: string): void;
|
|
224
|
-
/** C3(F1 fill 전용): srcRowId/srcField 수식의 상대축만 dRow/dCol 오프셋한 새 수식 원문. */
|
|
413
|
+
/** C3(F1 fill 전용): srcRowId/srcField 수식의 상대축만 dRow/dCol 오프셋한 새 수식 원문. / C3 (F1 fill only): new formula source with only the relative axes of the srcRowId/srcField formula offset by dRow/dCol. */
|
|
225
414
|
offsetFormula(srcRowId: string, srcField: string, dRow: number, dCol: number): string;
|
|
226
|
-
/** F3 렌더 배선(§4.4/C7, §7.4/§7.5/§7.6) — 셀 수식 메타(없으면 null). */
|
|
227
|
-
private _getFormulaMeta;
|
|
228
415
|
/**
|
|
229
416
|
* beginBatch+루프+endBatch 래퍼(C2.1). patches 의 rowIndex 는 flat index — 대상이
|
|
230
417
|
* FlatRowModel.resolveFlatRow 로 해소해 kind!=='data' (group/tree/detail 의사행)이면
|
|
231
418
|
* 쓰기 전에 skip 한다(C0.3 쓰기 안전, filler 에 writeCell 절대 금지).
|
|
232
419
|
* 건너뛴 셀 수를 반환하고, 1건이라도 있으면 announce + 'writeCellsSkip' 이벤트로 표면화한다.
|
|
420
|
+
* / beginBatch+loop+endBatch wrapper (C2.1). Each patch rowIndex is a flat index — targets
|
|
421
|
+
* resolving to kind!=='data' (group/tree/detail pseudo-rows) are skipped before writing
|
|
422
|
+
* (C0.3 write safety). Returns the skipped-cell count and surfaces it via announce +
|
|
423
|
+
* a 'writeCellsSkip' event when non-zero.
|
|
424
|
+
*
|
|
425
|
+
* @param patches - 쓰기 목록 / List of writes
|
|
426
|
+
* @returns 건너뛴 셀 수 / Number of skipped cells
|
|
233
427
|
*/
|
|
234
428
|
writeCells(patches: Array<{
|
|
235
429
|
rowIndex: number;
|
|
236
430
|
field: string;
|
|
237
431
|
value: any;
|
|
238
432
|
}>): number;
|
|
433
|
+
/** 정규화된 선택 범위 rects(없으면 []). MVP 는 길이 ≤1. / Normalized selection rects ([] when none). Length ≤1 in MVP. */
|
|
239
434
|
getRangeSelection(): CellRange[];
|
|
435
|
+
/** 활성 범위(= getRangeSelection()[0] ?? null). / Active range (= getRangeSelection()[0] ?? null). */
|
|
240
436
|
getActiveRange(): CellRange | null;
|
|
437
|
+
/** 범위 선택을 프로그램적으로 설정. / Set the range selection programmatically. */
|
|
241
438
|
setRangeSelection(range: CellRange | CellRange[]): void;
|
|
439
|
+
/** 범위 선택 해제. / Clear the range selection. */
|
|
242
440
|
clearRangeSelection(): void;
|
|
441
|
+
/** 활성 범위의 값 2D 배열. / 2D value array of the active range. */
|
|
243
442
|
getRangeValues(): any[][];
|
|
443
|
+
/** 활성 범위 숫자 셀의 통계(합계/평균 등, OGDecimal 기반). / Stats of numeric cells in the active range (sum/avg…, OGDecimal-based). */
|
|
244
444
|
getRangeStats(): RangeStats | null;
|
|
445
|
+
/**
|
|
446
|
+
* source→target 채우기(배치 경유, C2). axis 는 두 rect 상대 위치로 추론.
|
|
447
|
+
* / Fill from source into target (batched, C2). The axis is inferred from the two rects.
|
|
448
|
+
*
|
|
449
|
+
* @param source - 원본 범위 / Source range
|
|
450
|
+
* @param target - 대상 범위 / Target range
|
|
451
|
+
* @param mode - 'copy'(기본) 또는 'series' / 'copy' (default) or 'series'
|
|
452
|
+
*/
|
|
245
453
|
fillRange(source: CellRange, target: CellRange, mode?: 'copy' | 'series'): void;
|
|
454
|
+
/** 그리드 데이터 소스 차트를 생성한다. / Create a chart backed by grid data. */
|
|
246
455
|
createChart(config: ChartConfig): ChartInstance;
|
|
456
|
+
/** 살아있는 차트 인스턴스 목록. / Live chart instances. */
|
|
247
457
|
getCharts(): ChartInstance[];
|
|
458
|
+
/** 모든 차트 파괴(구독 해제 포함). / Destroy all charts (including subscriptions). */
|
|
248
459
|
destroyCharts(): void;
|
|
460
|
+
/** 변경 추적 요약(추가/수정/삭제 행). / Change-tracking summary (added/edited/removed rows). */
|
|
249
461
|
getChanges(): {
|
|
250
462
|
added: T[];
|
|
251
463
|
edited: T[];
|
|
252
464
|
removed: T[];
|
|
253
465
|
};
|
|
466
|
+
/** 수정된 행 목록. / Edited rows. */
|
|
254
467
|
getEditedRows(): T[];
|
|
468
|
+
/** @deprecated 하위 호환 — getEditedRows() 권장. / Backward compat — prefer getEditedRows(). */
|
|
255
469
|
getChangedRows(): T[];
|
|
470
|
+
/** 행별 변경 필드·old/new 값 상세. / Per-row changed fields with old/new values. */
|
|
256
471
|
getChangedColumns(): Array<{
|
|
257
472
|
row: T;
|
|
258
473
|
fields: string[];
|
|
@@ -262,112 +477,293 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
262
477
|
newValue: any;
|
|
263
478
|
}>;
|
|
264
479
|
}>;
|
|
480
|
+
/** 추가된 행 목록. / Added rows. */
|
|
265
481
|
getAddedRows(): T[];
|
|
482
|
+
/** 삭제된 행 목록. / Removed rows. */
|
|
266
483
|
getRemovedRows(): T[];
|
|
484
|
+
/** 행의 원본(수정 전) 스냅샷. / Original (pre-edit) snapshot of the row. */
|
|
267
485
|
getOriginalRow(rowIndex: number): T | undefined;
|
|
486
|
+
/** stateField 값이 있는 행 목록. / Rows having a value in stateField. */
|
|
268
487
|
getRowsWithState(stateField: string): T[];
|
|
488
|
+
/** @deprecated no-op stub — undo/redo 히스토리는 미구현. 변이 가드는 TriggerManager `before:*` 훅,
|
|
489
|
+
* 변경 추적은 `getChanges()`/`getOriginalRow()` 를 사용.
|
|
490
|
+
* / no-op stub — undo/redo history is not implemented. Use TriggerManager `before:*` hooks
|
|
491
|
+
* for mutation guards and `getChanges()`/`getOriginalRow()` for change tracking. */
|
|
269
492
|
undo(): void;
|
|
493
|
+
/** @deprecated no-op stub — undo/redo 히스토리 미구현(위 `undo()` 참조). / no-op stub — see `undo()` above. */
|
|
270
494
|
redo(): void;
|
|
495
|
+
/** @deprecated no-op stub — undo/redo 히스토리 자체가 없어 비울 것도 없음(위 `undo()` 참조). / no-op stub — there is no history to clear (see `undo()`). */
|
|
271
496
|
clearHistory(): void;
|
|
497
|
+
/** 보이는 리프 컬럼 정의 목록. / Visible leaf column definitions. */
|
|
272
498
|
getColumnDefs(): ColumnDef<T>[];
|
|
499
|
+
/** 숨김 포함 전체 리프 컬럼 정의. / All leaf column definitions including hidden. */
|
|
273
500
|
getAllColumnDefs(): ColumnDef<T>[];
|
|
501
|
+
/** 보이는 컬럼 수. / Number of visible columns. */
|
|
274
502
|
getColumnCount(): number;
|
|
503
|
+
/** 컬럼 구성을 통째로 교체하고 재렌더한다. / Replace the whole column set and re-render. */
|
|
275
504
|
applyColumns(columns: ColumnDef<T>[]): void;
|
|
505
|
+
/** 컬럼 1개를 삽입한다. / Insert one column. */
|
|
276
506
|
insertColumn(colDef: ColumnDef<T>, position?: Position): void;
|
|
507
|
+
/** 컬럼을 삭제한다(해당 field 참조 수식은 #REF 처리). / Delete a column (formulas referencing the field become #REF). */
|
|
277
508
|
deleteColumn(field: string): void;
|
|
278
509
|
private _reorderColumn;
|
|
510
|
+
/** 컬럼(들)을 숨긴다. / Hide column(s). */
|
|
279
511
|
hideColumn(field: string | string[]): void;
|
|
512
|
+
/** 숨긴 컬럼(들)을 다시 표시한다. / Show hidden column(s). */
|
|
280
513
|
showColumn(field: string | string[]): void;
|
|
514
|
+
/** field 의 보이는 컬럼 인덱스(-1 = 없음). / Visible column index of the field (-1 when absent). */
|
|
281
515
|
getColumnIndex(field: string): number;
|
|
516
|
+
/** 인덱스 위치의 field 명(없으면 ''). / Field name at the index ('' when absent). */
|
|
282
517
|
getFieldAt(idx: number): string;
|
|
518
|
+
/** 해당 컬럼의 값 배열. / Values of the column. */
|
|
283
519
|
getColValues(field: string, _all?: boolean): any[];
|
|
520
|
+
/** 해당 컬럼의 고유 값 배열. / Unique values of the column. */
|
|
284
521
|
getUniqueValues(field: string, all?: boolean): any[];
|
|
522
|
+
/** @deprecated no-op stub — 컬럼 폭 일괄 설정 미구현. 폭은 `ColumnDef.width` 또는 헤더 드래그로
|
|
523
|
+
* 지정하며 내부 `_recalcWidths` 가 자동 배분한다.
|
|
524
|
+
* / no-op stub — bulk width setting is not implemented. Set widths via `ColumnDef.width`
|
|
525
|
+
* or header drag; internal `_recalcWidths` distributes automatically. */
|
|
285
526
|
setColWidths(_widths: number[]): void;
|
|
527
|
+
/** @deprecated no-op stub — 항상 빈 배열 반환(폭 계산 미구현). 자동 배분은 내부 `_recalcWidths` 담당. / no-op stub — always returns [] (width calculation not implemented). */
|
|
286
528
|
calcColWidths(_fitToGrid?: boolean): number[];
|
|
529
|
+
/** 선택된 행 데이터 목록. / Selected row data. */
|
|
287
530
|
getSelections(): T[];
|
|
531
|
+
/** 활성 행 인덱스(-1 = 없음). / Active row index (-1 when none). */
|
|
288
532
|
getActiveRow(): number;
|
|
533
|
+
/** 지정 행을 활성/선택한다. / Activate (select) the given row. */
|
|
289
534
|
activate(index: number): void;
|
|
535
|
+
/** 선택 해제. / Clear the selection. */
|
|
290
536
|
deselect(): void;
|
|
537
|
+
/** 체크된 행 목록({row, rowIndex}). / Checked rows ({row, rowIndex}). */
|
|
291
538
|
getChecked(): Array<{
|
|
292
539
|
row: T;
|
|
293
540
|
rowIndex: number;
|
|
294
541
|
}>;
|
|
542
|
+
/** 체크된 행 데이터만 배열로. / Checked row data only. */
|
|
295
543
|
getAllChecked(): T[];
|
|
544
|
+
/** @deprecated no-op stub — id 기반 체크 미구현. 값 기준 체크는 `checkByValue(field, values)` 사용. / no-op stub — id-based checking not implemented; use `checkByValue(field, values)`. */
|
|
296
545
|
checkById(_ids: string[]): void;
|
|
546
|
+
/** @deprecated no-op stub — id 기반 체크 추가 미구현(위 `checkById()` 참조). `checkByValue` 사용. / no-op stub — see `checkById()`; use `checkByValue`. */
|
|
297
547
|
addCheckById(_ids: string[]): void;
|
|
548
|
+
/** field 값이 values 에 포함되는 행을 체크한다. / Check rows whose field value is in values. */
|
|
298
549
|
checkByValue(field: string, values: any[]): void;
|
|
550
|
+
/** @deprecated no-op stub — id 기반 체크 해제 미구현. 전체 해제는 `uncheckAll()` 사용. / no-op stub — id-based unchecking not implemented; use `uncheckAll()`. */
|
|
299
551
|
uncheckById(_ids: string[]): void;
|
|
552
|
+
/** 전체 체크 해제. / Uncheck all rows. */
|
|
300
553
|
uncheckAll(): void;
|
|
554
|
+
/**
|
|
555
|
+
* 정렬을 적용한다(단일 field+dir 또는 SortItem 배열). / Apply sorting (single field+dir or a
|
|
556
|
+
* SortItem list).
|
|
557
|
+
*
|
|
558
|
+
* @param fieldOrList - field 명 또는 정렬 목록 / Field name or sort list
|
|
559
|
+
* @param dir - 단일 field 일 때 방향(기본 'asc') / Direction for single-field form (default 'asc')
|
|
560
|
+
*/
|
|
301
561
|
orderBy(fieldOrList: string | SortItem[], dir?: 'asc' | 'desc'): void;
|
|
562
|
+
/** 정렬을 초기 상태로 되돌린다. / Reset sorting to the initial state. */
|
|
302
563
|
resetOrder(): void;
|
|
564
|
+
/** 컬럼 필터를 설정한다. / Set filters for a column. */
|
|
303
565
|
setFilter(field: string, filterItems: FilterItem[]): void;
|
|
566
|
+
/** 필터 해제(field 생략 시 전체). / Clear filters (all when field omitted). */
|
|
304
567
|
resetFilter(field?: string): void;
|
|
305
568
|
/** F3-R13/MCCONNELL-03(P0): 정렬/필터 후 범위-보유(hasRangeRef) 수식 전부 dirty(§3.5). */
|
|
306
569
|
private _recalcRangeBearingFormulas;
|
|
570
|
+
/** 현재 필터 상태 스냅샷. / Snapshot of the current filter state. */
|
|
307
571
|
getFilterState(): Record<string, FilterItem[]>;
|
|
572
|
+
/** 필터 상태를 복원한다. / Restore a saved filter state. */
|
|
308
573
|
restoreFilter(state: Record<string, FilterItem[]>): void;
|
|
309
574
|
private _applyFilters;
|
|
575
|
+
/** 왼쪽 n개 컬럼을 고정한다. / Freeze the leftmost n columns. */
|
|
310
576
|
freeze(n: number): void;
|
|
311
|
-
/**
|
|
577
|
+
/** 수동 병합: [{row, col, rowSpan?, colSpan?}] / Manual merge: [{row, col, rowSpan?, colSpan?}] */
|
|
312
578
|
mergeCells(cells: MergeCell[]): void;
|
|
313
|
-
/** 자동 병합: 지정 필드 컬럼에서 연속 같은 값을 rowSpan으로
|
|
314
|
-
/** ?먮룞 蹂묓빀: 吏??field 而щ읆?먯꽌 ?곗냽 媛숈? 媛믪쓣 rowSpan */
|
|
579
|
+
/** 자동 병합: 지정 필드 컬럼에서 연속 같은 값을 rowSpan으로 묶는다. / Auto merge: consecutive equal values in the given field columns are merged via rowSpan. */
|
|
315
580
|
autoMerge(fields: string[]): void;
|
|
316
|
-
/**
|
|
581
|
+
/** 병합 해제. / Clear all merges. */
|
|
317
582
|
clearMerge(): void;
|
|
583
|
+
/** @deprecated no-op stub — 행 고정(freeze rows) 미구현. 컬럼 고정만 지원하며 `freeze(n)` 사용. / no-op stub — frozen rows are not implemented; only column freezing via `freeze(n)`. */
|
|
318
584
|
freezeRows(_n: number): void;
|
|
585
|
+
/** 지정 필드들로 그룹핑한다. / Group rows by the given fields. */
|
|
319
586
|
groupBy(fields: string[]): void;
|
|
587
|
+
/** 그룹핑 해제. / Clear grouping. */
|
|
320
588
|
clearGroup(): void;
|
|
589
|
+
/** 모든 그룹 펼침. / Expand all groups. */
|
|
321
590
|
expandAll(): void;
|
|
591
|
+
/** 모든 그룹 접힘. / Collapse all groups. */
|
|
322
592
|
collapseAll(): void;
|
|
593
|
+
/** 트리 모드 활성화. / Enable tree mode. */
|
|
323
594
|
enableTree(): void;
|
|
595
|
+
/** 트리 모드 비활성화. / Disable tree mode. */
|
|
324
596
|
disableTree(): void;
|
|
597
|
+
/** 지정 트리 노드 펼침/접힘. / Expand/collapse the given tree nodes. */
|
|
325
598
|
expandNodes(ids: any | any[], open?: boolean): void;
|
|
599
|
+
/** 모든 트리 노드 펼침. / Expand all tree nodes. */
|
|
326
600
|
expandAllNodes(): void;
|
|
601
|
+
/** 모든 트리 노드 접힘. / Collapse all tree nodes. */
|
|
327
602
|
collapseAllNodes(): void;
|
|
603
|
+
/** 행 상세 패널 펼침(rowRef = flat index 또는 {id}). / Expand the detail panel (rowRef = flat index or {id}). */
|
|
328
604
|
expandRow(rowRef: number | {
|
|
329
605
|
id: string;
|
|
330
606
|
}): void;
|
|
607
|
+
/** 행 상세 패널 접힘. / Collapse the detail panel. */
|
|
331
608
|
collapseRow(rowRef: number | {
|
|
332
609
|
id: string;
|
|
333
610
|
}): void;
|
|
611
|
+
/** 행 상세 패널 토글. / Toggle the detail panel. */
|
|
334
612
|
toggleRow(rowRef: number | {
|
|
335
613
|
id: string;
|
|
336
614
|
}): void;
|
|
615
|
+
/** 행 상세 패널 펼침 여부. / Whether the detail panel is expanded. */
|
|
337
616
|
isRowExpanded(rowRef: number | {
|
|
338
617
|
id: string;
|
|
339
618
|
}): boolean;
|
|
619
|
+
/** 모든 상세 패널 접힘. / Collapse all detail panels. */
|
|
340
620
|
collapseAllDetails(): void;
|
|
621
|
+
/** 상세 인스턴스(renderer 반환값 또는 자동 서브그리드; 펼친 적 없으면 undefined). / Detail instance (renderer result or auto subgrid; undefined if never expanded). */
|
|
341
622
|
getDetailInstance<D = any>(rowRef: number | {
|
|
342
623
|
id: string;
|
|
343
624
|
}): D | undefined;
|
|
625
|
+
/** 열린 상세 패널 폭 강제 재동기(FR-11). / Force re-sync of open detail panel widths (FR-11). */
|
|
344
626
|
resyncPanelWidths(): void;
|
|
627
|
+
/** @deprecated no-op stub — 부모 지정 트리행 삽입 미구현. 평면 삽입은 `insertRow(item, pos)`,
|
|
628
|
+
* 트리 구성은 `enableTree()`/`groupBy(fields)` 사용.
|
|
629
|
+
* / no-op stub — parented tree-row insertion is not implemented. Use `insertRow(item, pos)`
|
|
630
|
+
* for flat insertion and `enableTree()`/`groupBy(fields)` for tree structure. */
|
|
345
631
|
addTreeRow(_item: Partial<T>, _pid: string, _pos?: Position): void;
|
|
632
|
+
/** 엑셀(xlsx)로 내보낸다. / Export as Excel (xlsx). */
|
|
346
633
|
exportExcel(options?: ExportOptions | string): void;
|
|
634
|
+
/** CSV 로 내보낸다. / Export as CSV. */
|
|
347
635
|
exportCsv(options?: ExportOptions | string): void;
|
|
636
|
+
/** JSON 으로 내보낸다. / Export as JSON. */
|
|
348
637
|
exportJson(options?: ExportOptions | string): void;
|
|
638
|
+
/** 인쇄용 창을 연다. / Open the print view. */
|
|
349
639
|
print(options?: {
|
|
350
640
|
title?: string;
|
|
351
641
|
excludeFields?: string[];
|
|
352
642
|
}): void;
|
|
643
|
+
/**
|
|
644
|
+
* 데이터 배열 변환. / Convert the data set.
|
|
645
|
+
*
|
|
646
|
+
* @param keyValue - true = 객체 배열(기본), false = 값 2D 배열 / true = object array (default), false = 2D value array
|
|
647
|
+
*/
|
|
353
648
|
toArray(keyValue?: boolean): any[];
|
|
649
|
+
/** 지정 행으로 스크롤·선택한다. / Scroll to and select the given row. */
|
|
354
650
|
jumpToRow(rowIndex: number): void;
|
|
651
|
+
/** @deprecated no-op stub — 특정 컬럼으로 가로 스크롤 이동 미구현. 행 이동은 `jumpToRow(rowIndex)` 사용. / no-op stub — horizontal jump-to-column is not implemented; use `jumpToRow(rowIndex)`. */
|
|
355
652
|
jumpToCol(_field: string): void;
|
|
653
|
+
/** 현재 스크롤 좌표. / Current scroll position. */
|
|
356
654
|
getScrollPos(): {
|
|
357
655
|
x: number;
|
|
358
656
|
y: number;
|
|
359
657
|
};
|
|
658
|
+
/** 푸터 정의를 교체하고 다시 그린다. / Replace footer definitions and re-render the footer. */
|
|
360
659
|
setFooter(fd: any[]): void;
|
|
660
|
+
/** 푸터 집계값 목록. / Computed footer values. */
|
|
361
661
|
getFooterData(): any[];
|
|
662
|
+
/** 특정 field 의 푸터 집계값(없으면 null). / Footer value of the field (null when absent). */
|
|
362
663
|
getFooterValue(field: string): any;
|
|
363
664
|
private _renderFooterEl;
|
|
665
|
+
/** 그리드 크기를 변경하고 재배치한다. / Resize the grid and relayout. */
|
|
364
666
|
resize(w?: number, h?: number): void;
|
|
667
|
+
/** 색 테마(data-og-theme)를 전환한다. / Switch the color theme (data-og-theme). */
|
|
365
668
|
setTheme(theme: string): void;
|
|
669
|
+
/** 색 축 CSS 변수 1개를 런타임 설정한다. / Set one color-axis CSS variable at runtime. */
|
|
366
670
|
setThemeVar(k: string, v: string): void;
|
|
671
|
+
/**
|
|
672
|
+
* R12b: 스킨(FORM 축) 전환. data-og-skin 설정 + resolver 컨텍스트 교체 + 인라인 form 사이트 재해석.
|
|
673
|
+
* 색 테마와 직교(색 토큰 무변경). default→named 전환 시 인라인 보더가 리터럴→var() 로 승격되므로
|
|
674
|
+
* 헤더/본문을 한 번 재렌더한다(opt-in 비용). named→named/…→default 도 동일 경로로 안전.
|
|
675
|
+
* / R12b: switch the skin (FORM axis). Sets data-og-skin, swaps the resolver context and
|
|
676
|
+
* re-resolves inline form sites. Orthogonal to color themes (no color tokens touched).
|
|
677
|
+
*/
|
|
678
|
+
setSkin(skin: string): void;
|
|
679
|
+
/** R12b: 현재 스킨 id('default' = 오늘). / R12b: current skin id ('default' = stock look). */
|
|
680
|
+
getSkin(): string;
|
|
681
|
+
/**
|
|
682
|
+
* R12c(계약 C13): 이 그리드 인스턴스에 한해 시맨틱 아이콘 role 을 교체(멀티그리드 격리 —
|
|
683
|
+
* 전역 iconRegistry 를 부모로 하는 child 에만 기록). svgOrKey 는 알려진 아이콘 key 또는 원시 SVG 본문.
|
|
684
|
+
* R11 확장점과의 연결: 오버라이드를 `extensions.iconResolver` strategy 슬롯으로도 표면화해 발견가능하게 한다.
|
|
685
|
+
* 반환은 this(체이닝). 미지정 role/글리프는 안전 폴백(never throw).
|
|
686
|
+
* / R12c (contract C13): replace a semantic icon role for this instance only (multi-grid
|
|
687
|
+
* isolation — written to a child of the global iconRegistry). svgOrKey is a known icon key or
|
|
688
|
+
* raw SVG body. Returns this for chaining. Unknown roles/glyphs fall back safely (never throw).
|
|
689
|
+
*
|
|
690
|
+
* @param role - 시맨틱 아이콘 role / Semantic icon role
|
|
691
|
+
* @param svgOrKey - 아이콘 key 또는 원시 SVG / Icon key or raw SVG
|
|
692
|
+
* @returns 체이닝용 this / this for chaining
|
|
693
|
+
*/
|
|
694
|
+
setIcon(role: string, svgOrKey: string): this;
|
|
695
|
+
/** R12c: 이 인스턴스의 아이콘 role 해석(오버라이드 우선, 없으면 전역). 렌더 마크업/SVGElement. / R12c: resolve an icon role for this instance (override first, then global). Returns render markup or an SVGElement. */
|
|
696
|
+
renderIcon(role: string, opts?: {
|
|
697
|
+
size?: number;
|
|
698
|
+
title?: string;
|
|
699
|
+
el?: boolean;
|
|
700
|
+
}): string | SVGElement;
|
|
701
|
+
/**
|
|
702
|
+
* i18n: 이 인스턴스의 UI 로케일을 전환한다. setSkin 진영 — 데이터 불변 + 크롬/가시창 부분 재렌더.
|
|
703
|
+
* `lang` 속성을 로케일 Intl 태그로 갱신(스크린리더 발음 전환), 상주 크롬(페이지네이션/찾기)의
|
|
704
|
+
* 라벨을 새로 그리고, 캐시된 필터 패널을 무효화한 뒤 헤더+가시창을 1회 재렌더한다.
|
|
705
|
+
* 미등록 로케일은 throw 하지 않고 폴백 유지(never-throw). 전환 후 `localeChange` 이벤트 발화.
|
|
706
|
+
* / i18n: switch this instance's UI locale. setSkin camp — data-immutable + partial chrome/viewport
|
|
707
|
+
* re-render. Updates `lang` to the locale's Intl tag (screen-reader pronunciation), refreshes
|
|
708
|
+
* resident chrome labels (pagination/find), invalidates the cached filter panel, then re-renders
|
|
709
|
+
* the header + visible window once. Unknown locales never throw. Emits `localeChange` afterwards.
|
|
710
|
+
*
|
|
711
|
+
* @param locale - 로케일 id(예 'en') / Locale id (e.g. 'en')
|
|
712
|
+
* @example
|
|
713
|
+
* grid.setLocale('en');
|
|
714
|
+
*/
|
|
715
|
+
setLocale(locale: string): void;
|
|
716
|
+
/** i18n: 현재 인스턴스 로케일 id('ko' = 기본). / i18n: current instance locale id ('ko' = default). */
|
|
717
|
+
getLocale(): string;
|
|
718
|
+
/**
|
|
719
|
+
* i18n: 이 인스턴스만 단일 메시지를 오버라이드(setIcon 동형 — 첫 호출 때 child 지연 생성, 멀티그리드 격리).
|
|
720
|
+
* 자동 재렌더는 하지 않는다(다음 렌더/setLocale 때 반영). / i18n: override a single message for this
|
|
721
|
+
* instance only (isomorphic to setIcon — lazy child on first call, multi-grid isolation). No auto
|
|
722
|
+
* re-render (applied on the next render/setLocale).
|
|
723
|
+
*
|
|
724
|
+
* @param key - dot-key 메시지 키(예 'filter.apply') / dot-key message key (e.g. 'filter.apply')
|
|
725
|
+
* @param value - 문자열('{name}' 보간) 또는 함수 / string ('{name}' interpolation) or a function
|
|
726
|
+
* @returns 체이닝용 this / this for chaining
|
|
727
|
+
*/
|
|
728
|
+
setMessage(key: LocaleMessageKey | string, value: MessageValue): this;
|
|
729
|
+
/**
|
|
730
|
+
* i18n: 메시지를 해석한다(인스턴스 오버라이드 우선 → 활성 로케일 → ko → 키 원문). 절대 throw 안 함 —
|
|
731
|
+
* 렌더 루프(셀 aria) 소비자용. / i18n: resolve a message (instance override → active locale → ko →
|
|
732
|
+
* the key itself). Never throws — for render-loop consumers (cell aria).
|
|
733
|
+
*
|
|
734
|
+
* @param key - dot-key 메시지 키 / dot-key message key
|
|
735
|
+
* @param params - `{name}` 보간 파라미터 / `{name}` interpolation params
|
|
736
|
+
* @returns 해석된 문자열(미등록 키면 키 원문) / Resolved string (the key itself when unknown)
|
|
737
|
+
*/
|
|
738
|
+
t(key: LocaleMessageKey | string, params?: Record<string, string | number>): string;
|
|
739
|
+
/**
|
|
740
|
+
* R12b: FORM 축 단일 토큰 런타임 오버라이드(setThemeVar 의 형태-축 형제). 컨테이너 인라인이라
|
|
741
|
+
* 스타일시트를 항상 이긴다. 색⊥형태 직교성 보호를 위해 색 값은 거부한다.
|
|
742
|
+
* / R12b: runtime override of a single FORM-axis token (form-axis sibling of setThemeVar).
|
|
743
|
+
* Container-inline, so it always beats stylesheets. Color values are rejected to protect
|
|
744
|
+
* color⊥form orthogonality (throws).
|
|
745
|
+
*/
|
|
746
|
+
setSkinVar(k: string, v: string): void;
|
|
747
|
+
/**
|
|
748
|
+
* 트리거 등록('before:{op}' 취소 가능, 'after:{op}' 결과 수신). / Register a trigger
|
|
749
|
+
* ('before:{op}' can cancel, 'after:{op}' receives the result).
|
|
750
|
+
*
|
|
751
|
+
* @param event - 트리거 이벤트명 / Trigger event name
|
|
752
|
+
* @param handler - 핸들러(ctx.cancel() 지원) / Handler (supports ctx.cancel())
|
|
753
|
+
* @returns 체이닝용 this / this for chaining
|
|
754
|
+
* @example
|
|
755
|
+
* grid.addTrigger('before:insertRow', ctx => { if (!ctx.args[0]?.name) ctx.cancel(); });
|
|
756
|
+
*/
|
|
367
757
|
addTrigger(event: TriggerEvent | string, handler: TriggerHandler): this;
|
|
758
|
+
/** 트리거 제거. / Remove a trigger. */
|
|
368
759
|
removeTrigger(event: TriggerEvent | string, handler: TriggerHandler): this;
|
|
760
|
+
/** 트리거 전체 또는 특정 이벤트 클리어. / Clear all triggers or those of one event. */
|
|
369
761
|
clearTriggers(event?: TriggerEvent | string): this;
|
|
370
762
|
private _mkCtx;
|
|
371
763
|
private _trig;
|
|
764
|
+
/**
|
|
765
|
+
* 그리드를 파괴한다(옵저버/이벤트/차트/패널 해제, DOM 정리, override 전체 복구).
|
|
766
|
+
* / Destroy the grid (detach observers/events/charts/panels, clean the DOM, restore all overrides).
|
|
767
|
+
*/
|
|
372
768
|
destroy(): void;
|
|
373
769
|
}
|