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
|
@@ -7,13 +7,20 @@ import { CellRange } from '../types.js';
|
|
|
7
7
|
* 폴백 렌더된다(CanvasAdapter._computeGeometry). 하위호환을 위해 타입 자체는 유지한다.
|
|
8
8
|
*/
|
|
9
9
|
export type ChartType = 'bar' | 'line' | 'area' | 'pie' | 'doughnut' | 'bar-stacked' | 'bar-grouped';
|
|
10
|
+
/** 시리즈(컬럼) 명세. / Series (column) spec. */
|
|
10
11
|
export interface ChartSeriesSpec {
|
|
12
|
+
/** 값 컬럼 field 명. / Value column field name. */
|
|
11
13
|
field: string;
|
|
14
|
+
/** 범례 라벨(기본 = 컬럼 header/field). / Legend label (default = column header/field). */
|
|
12
15
|
name?: string;
|
|
16
|
+
/** 시리즈 색. / Series color. */
|
|
13
17
|
color?: string;
|
|
18
|
+
/** 색 외 구분 패턴. / Non-color distinction pattern. */
|
|
14
19
|
pattern?: ChartSeries['pattern'];
|
|
20
|
+
/** 시리즈별 렌더 타입(혼합 차트). / Per-series render type (mixed charts). */
|
|
15
21
|
type?: 'bar' | 'line' | 'area';
|
|
16
22
|
}
|
|
23
|
+
/** 차트 데이터 소스(범위/선택/체크/전체/컬럼 지정). / Chart data source (range/selection/checked/all/explicit columns). */
|
|
17
24
|
export type ChartSource = {
|
|
18
25
|
kind: 'range';
|
|
19
26
|
range?: CellRange;
|
|
@@ -28,61 +35,92 @@ export type ChartSource = {
|
|
|
28
35
|
category?: string;
|
|
29
36
|
series: Array<string | ChartSeriesSpec>;
|
|
30
37
|
};
|
|
38
|
+
/** 카테고리 집계 연산. / Category aggregation operation. */
|
|
31
39
|
export type ChartAggregateOp = 'sum' | 'avg' | 'count' | 'min' | 'max';
|
|
40
|
+
/** 집계 연산 또는 커스텀 리듀서. / An aggregation op or a custom reducer. */
|
|
32
41
|
export type ChartAggregate = ChartAggregateOp | ((values: number[], category: string) => number);
|
|
42
|
+
/** 접근성(SR) 테이블 모델 — 스크린리더 폴백. / Accessibility (SR) table model — screen-reader fallback. */
|
|
33
43
|
export interface A11yTableModel {
|
|
34
|
-
/** aria-label 요약
|
|
44
|
+
/** aria-label 요약 캡션. / aria-label summary caption. */
|
|
35
45
|
caption: string;
|
|
36
46
|
/** ['category', ...series names] */
|
|
37
47
|
colHeaders: string[];
|
|
38
|
-
/** [category, v1, v2, ...] — locale 포맷
|
|
48
|
+
/** [category, v1, v2, ...] — locale 포맷 문자열. / [category, v1, v2, ...] — locale-formatted strings. */
|
|
39
49
|
rows: string[][];
|
|
40
50
|
}
|
|
51
|
+
/** 차트 시리즈(정규화된 값 배열). / Chart series (normalized value array). */
|
|
41
52
|
export interface ChartSeries {
|
|
42
|
-
/** 범례 라벨(기본값 = 원본 컬럼 header/field) */
|
|
53
|
+
/** 범례 라벨(기본값 = 원본 컬럼 header/field). / Legend label (default = source column header/field). */
|
|
43
54
|
name: string;
|
|
44
|
-
/** categories 와 동일 순서로 정렬. 결측=null */
|
|
55
|
+
/** categories 와 동일 순서로 정렬. 결측=null. / Aligned to categories order; missing = null. */
|
|
45
56
|
data: Array<number | null>;
|
|
57
|
+
/** 시리즈 색. / Series color. */
|
|
46
58
|
color?: string;
|
|
47
|
-
/** 색 외 구분(HANMS-19) */
|
|
59
|
+
/** 색 외 구분(HANMS-19). / Non-color distinction (HANMS-19). */
|
|
48
60
|
pattern?: 'solid' | 'hatch' | 'dot' | 'cross';
|
|
49
61
|
}
|
|
62
|
+
/** 차트 데이터 모델 메타(출처·샘플링·집계 배지 정보). / Chart data model meta (source, sampling, aggregation badge info). */
|
|
50
63
|
export interface ChartDataModelMeta {
|
|
64
|
+
/** 소스 종류. / Source kind. */
|
|
51
65
|
sourceKind: ChartSource['kind'];
|
|
52
|
-
/** 원본 포인트(행)
|
|
66
|
+
/** 원본 포인트(행) 수. / Original point (row) count. */
|
|
53
67
|
total: number;
|
|
54
|
-
/** LTTB 다운샘플 또는 category 집계로 축약됐는가 → 배지(§C) */
|
|
68
|
+
/** LTTB 다운샘플 또는 category 집계로 축약됐는가 → 배지(§C). / Whether reduced by LTTB downsample or category aggregation → badge (§C). */
|
|
55
69
|
sampled: boolean;
|
|
70
|
+
/** 다운샘플 전 포인트 수. / Point count before downsampling. */
|
|
56
71
|
sampledFrom?: number;
|
|
72
|
+
/** 다운샘플 후 포인트 수. / Point count after downsampling. */
|
|
57
73
|
sampledTo?: number;
|
|
74
|
+
/** 적용된 집계 연산. / Applied aggregation op. */
|
|
58
75
|
aggregatedOp?: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'custom';
|
|
76
|
+
/** pie 에서 첫 시리즈만 사용됐는가. / Whether pie used only the first series. */
|
|
59
77
|
pieReducedToFirst?: boolean;
|
|
78
|
+
/** pie 에서 음수를 절댓값 처리했는가. / Whether pie used absolute values for negatives. */
|
|
60
79
|
negativesAbsInPie?: boolean;
|
|
61
|
-
/** SR 폴백 — extractor 가 렌더러와 무관하게 항상 채운다(§B 하드 게이트) */
|
|
80
|
+
/** SR 폴백 — extractor 가 렌더러와 무관하게 항상 채운다(§B 하드 게이트). / SR fallback — always filled by the extractor regardless of renderer (§B hard gate). */
|
|
62
81
|
a11yTable: A11yTableModel;
|
|
63
82
|
}
|
|
83
|
+
/** 헤드리스 차트 데이터 모델(추출 산출물). / Headless chart data model (extraction output). */
|
|
64
84
|
export interface ChartDataModel {
|
|
85
|
+
/** 카테고리(x축) 라벨. / Category (x-axis) labels. */
|
|
65
86
|
categories: string[];
|
|
87
|
+
/** 시리즈 배열. / Series array. */
|
|
66
88
|
series: ChartSeries[];
|
|
89
|
+
/** 모델 메타. / Model meta. */
|
|
67
90
|
meta: ChartDataModelMeta;
|
|
68
91
|
}
|
|
92
|
+
/** 차트 테마(색·글꼴·팔레트). / Chart theme (colors, fonts, palette). */
|
|
69
93
|
export interface ChartTheme {
|
|
94
|
+
/** 주 색. / Primary color. */
|
|
70
95
|
primary: string;
|
|
96
|
+
/** 축·테두리 색. / Axis/border color. */
|
|
71
97
|
border: string;
|
|
98
|
+
/** 텍스트 색. / Text color. */
|
|
72
99
|
text: string;
|
|
100
|
+
/** 배경 색. / Background color. */
|
|
73
101
|
bg: string;
|
|
102
|
+
/** 그리드 선 색. / Grid line color. */
|
|
74
103
|
gridLine: string;
|
|
104
|
+
/** 글꼴 패밀리. / Font family. */
|
|
75
105
|
fontFamily: string;
|
|
106
|
+
/** 기본 글꼴 크기(px). / Base font size in px. */
|
|
76
107
|
fontSize: number;
|
|
108
|
+
/** 시리즈 순환 팔레트. / Series-cycling palette. */
|
|
77
109
|
palette: string[];
|
|
78
110
|
}
|
|
111
|
+
/** 렌더 스펙(어댑터에 전달되는 스냅샷). / Render spec (snapshot passed to adapters). */
|
|
79
112
|
export interface ChartRenderSpec {
|
|
113
|
+
/** 차트 타입. / Chart type. */
|
|
80
114
|
type: ChartType;
|
|
115
|
+
/** 차트 제목. / Chart title. */
|
|
81
116
|
title?: string;
|
|
117
|
+
/** 범례 표시/위치. / Legend visibility/position. */
|
|
82
118
|
legend?: boolean | {
|
|
83
119
|
position: 'top' | 'bottom' | 'left' | 'right';
|
|
84
120
|
};
|
|
121
|
+
/** 툴팁 사용 여부. / Whether tooltips are enabled. */
|
|
85
122
|
tooltip?: boolean;
|
|
123
|
+
/** 축 설정(라벨·min/max·스택). / Axis config (labels, min/max, stacked). */
|
|
86
124
|
axis?: {
|
|
87
125
|
xLabel?: string;
|
|
88
126
|
yLabel?: string;
|
|
@@ -90,33 +128,56 @@ export interface ChartRenderSpec {
|
|
|
90
128
|
yMax?: number;
|
|
91
129
|
stacked?: boolean;
|
|
92
130
|
};
|
|
131
|
+
/** 시리즈 팔레트(테마 팔레트 오버라이드). / Series palette (overrides theme palette). */
|
|
93
132
|
palette?: string[];
|
|
133
|
+
/** 렌더 테마. / Render theme. */
|
|
94
134
|
theme: ChartTheme;
|
|
135
|
+
/** 숫자 포맷터(축/툴팁/범례 컨텍스트). / Number formatter (axis/tooltip/legend context). */
|
|
95
136
|
numberFormat?: (v: number, ctx: {
|
|
96
137
|
axis: 'x' | 'y' | 'tooltip' | 'legend';
|
|
97
138
|
field?: string;
|
|
98
139
|
}) => string;
|
|
140
|
+
/** 접근성 테이블 모델. / Accessibility table model. */
|
|
99
141
|
a11y: A11yTableModel;
|
|
100
142
|
}
|
|
143
|
+
/** 차트 포인트(히트테스트/클릭 대상). / Chart point (hit-test/click target). */
|
|
101
144
|
export interface ChartPoint {
|
|
145
|
+
/** 시리즈 이름. / Series name. */
|
|
102
146
|
seriesName: string;
|
|
147
|
+
/** 카테고리 라벨. / Category label. */
|
|
103
148
|
category: string;
|
|
149
|
+
/** 값(결측 null). / Value (null if missing). */
|
|
104
150
|
value: number | null;
|
|
151
|
+
/** 카테고리 인덱스. / Category index. */
|
|
105
152
|
index: number;
|
|
153
|
+
/** 원본 행 stable id(있으면). / Source row stable id (if any). */
|
|
106
154
|
rowId?: string;
|
|
107
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* 차트 렌더 어댑터(교체 seam) — 내장 canvas / 외부 lib 백엔드를 통일된 인터페이스로 감싼다.
|
|
158
|
+
* / Chart render adapter (swap seam) — wraps the built-in canvas / external-lib backends behind one interface.
|
|
159
|
+
*/
|
|
108
160
|
export interface ChartAdapter {
|
|
161
|
+
/** 어댑터 식별자. / Adapter identifier. */
|
|
109
162
|
readonly id: string;
|
|
163
|
+
/** 호스트에 초기화. / Initialize into the host. */
|
|
110
164
|
init(host: HTMLElement, spec: ChartRenderSpec): Promise<void>;
|
|
165
|
+
/** 모델을 렌더. / Render the model. */
|
|
111
166
|
render(model: ChartDataModel, spec: ChartRenderSpec): void;
|
|
167
|
+
/** 렌더 영역 크기 변경. / Resize the render area. */
|
|
112
168
|
resize(width: number, height: number): void;
|
|
169
|
+
/** 현재 렌더를 이미지 Blob 으로(선택). / Export current render as an image Blob (optional). */
|
|
113
170
|
toBlob?(mime?: string): Promise<Blob | null>;
|
|
171
|
+
/** 포인트 클릭 콜백 등록(선택). / Register a point-click callback (optional). */
|
|
114
172
|
onPointClick?(cb: (p: ChartPoint) => void): void;
|
|
173
|
+
/** 어댑터 정리. / Tear down the adapter. */
|
|
115
174
|
destroy(): void;
|
|
116
175
|
}
|
|
117
|
-
/** createChart 반환 핸들(§6). 구현은 ChartManager. */
|
|
176
|
+
/** createChart 반환 핸들(§6). 구현은 ChartManager. / Handle returned by createChart (§6); implemented by ChartManager. */
|
|
118
177
|
export interface ChartInstance {
|
|
178
|
+
/** 차트 인스턴스 id. / Chart instance id. */
|
|
119
179
|
readonly id: string;
|
|
180
|
+
/** 설정 패치 후 갱신. / Patch config and update. */
|
|
120
181
|
update(patch?: Partial<ChartConfig>): void;
|
|
121
182
|
/**
|
|
122
183
|
* 모델을 재추출하고 렌더 스펙(테마 포함)을 재스냅샷해 재렌더한다(§5.3). 그리드는 테마 변경
|
|
@@ -124,56 +185,92 @@ export interface ChartInstance {
|
|
|
124
185
|
* 변화 없는 순수 테마 전환 후에는, 열려 있는 각 차트에 대해 이 메서드를 호출해야 새 테마
|
|
125
186
|
* (색·글꼴·팔레트)가 재적용된다. `update()`/`setType()`도 내부적으로 동일 경로를 탄다.
|
|
126
187
|
*/
|
|
188
|
+
/** 모델을 재추출하고 렌더 스펙(테마 포함)을 재스냅샷해 재렌더. / Re-extract the model and re-snapshot the render spec (incl. theme), then re-render. */
|
|
127
189
|
refresh(): void;
|
|
190
|
+
/** 차트 타입 변경. / Change the chart type. */
|
|
128
191
|
setType(type: ChartType): void;
|
|
192
|
+
/** 차트 인스턴스 파기. / Destroy the chart instance. */
|
|
129
193
|
destroy(): void;
|
|
194
|
+
/** 현재 렌더를 이미지 Blob 으로. / Export current render as an image Blob. */
|
|
130
195
|
toBlob(mime?: string): Promise<Blob | null>;
|
|
196
|
+
/** 현재 데이터 모델 반환. / Return the current data model. */
|
|
131
197
|
getModel(): ChartDataModel;
|
|
198
|
+
/** 차트 이벤트 리스너 등록. / Register a chart event listener. */
|
|
132
199
|
on(ev: 'chartRender' | 'chartPointClick', cb: (...a: any[]) => void): void;
|
|
133
200
|
}
|
|
134
|
-
/** GridOptions.chart 로 중첩되는 전역 옵션(C5.1, 최상위 flat 키 금지). */
|
|
201
|
+
/** GridOptions.chart 로 중첩되는 전역 옵션(C5.1, 최상위 flat 키 금지). / Global options nested under GridOptions.chart (C5.1; no top-level flat keys). */
|
|
135
202
|
export interface ChartGlobalOptions {
|
|
203
|
+
/** 차트 기능 활성화. / Enable the chart feature. */
|
|
136
204
|
enabled?: boolean;
|
|
205
|
+
/** 기본 렌더 엔진. / Default render engine. */
|
|
137
206
|
defaultEngine?: 'builtin' | 'chartjs' | 'echarts';
|
|
207
|
+
/** 기본 차트 타입. / Default chart type. */
|
|
138
208
|
defaultType?: ChartType;
|
|
209
|
+
/** 기본 배치 방식. / Default placement. */
|
|
139
210
|
placement?: 'docked' | 'modal' | 'inline' | 'floating';
|
|
211
|
+
/** 렌더 포인트 상한(초과 시 다운샘플). / Max render points (downsample above this). */
|
|
140
212
|
maxPoints?: number;
|
|
213
|
+
/** live 갱신 디바운스(ms). / Debounce for live updates (ms). */
|
|
141
214
|
debounceMs?: number;
|
|
215
|
+
/** 기본 팔레트. / Default palette. */
|
|
142
216
|
palette?: string[];
|
|
217
|
+
/** 기본 숫자 포맷터. / Default number formatter. */
|
|
143
218
|
numberFormat?: (v: number, ctx: {
|
|
144
219
|
axis: 'x' | 'y' | 'tooltip' | 'legend';
|
|
145
220
|
field?: string;
|
|
146
221
|
}) => string;
|
|
222
|
+
/** 차트 생성 콜백. / Chart-create callback. */
|
|
147
223
|
onChartCreate?: (i: ChartInstance) => void;
|
|
224
|
+
/** 차트 렌더 콜백. / Chart-render callback. */
|
|
148
225
|
onChartRender?: (e: {
|
|
149
226
|
id: string;
|
|
150
227
|
model: ChartDataModel;
|
|
151
228
|
}) => void;
|
|
229
|
+
/** 포인트 클릭 콜백. / Point-click callback. */
|
|
152
230
|
onChartPointClick?: (e: {
|
|
153
231
|
id: string;
|
|
154
232
|
point: ChartPoint;
|
|
155
233
|
}) => void;
|
|
234
|
+
/** 차트 파기 콜백. / Chart-destroy callback. */
|
|
156
235
|
onChartDestroy?: (e: {
|
|
157
236
|
id: string;
|
|
158
237
|
}) => void;
|
|
159
238
|
}
|
|
239
|
+
/** createChart() 공개 설정(§6). / Public config for createChart() (§6). */
|
|
160
240
|
export interface ChartConfig {
|
|
241
|
+
/** 데이터 소스. / Data source. */
|
|
161
242
|
source: ChartSource;
|
|
243
|
+
/** 차트 타입. / Chart type. */
|
|
162
244
|
type: ChartType;
|
|
245
|
+
/** 렌더 엔진 또는 커스텀 어댑터. / Render engine or custom adapter. */
|
|
163
246
|
engine?: 'builtin' | 'chartjs' | 'echarts' | ChartAdapter;
|
|
247
|
+
/** 배치 방식. / Placement. */
|
|
164
248
|
placement?: 'docked' | 'modal' | 'inline' | 'floating';
|
|
249
|
+
/** inline/floating 시 마운트 대상. / Mount target for inline/floating. */
|
|
165
250
|
mount?: HTMLElement;
|
|
251
|
+
/** 카테고리(x축) 컬럼 field. / Category (x-axis) column field. */
|
|
166
252
|
category?: string;
|
|
253
|
+
/** 시리즈 명세 목록. / Series specs. */
|
|
167
254
|
series?: Array<string | ChartSeriesSpec>;
|
|
255
|
+
/** 카테고리 집계 연산. / Category aggregation op. */
|
|
168
256
|
aggregate?: ChartAggregate;
|
|
257
|
+
/** 렌더 포인트 상한. / Max render points. */
|
|
169
258
|
maxPoints?: number;
|
|
259
|
+
/** 데이터 변경 시 자동 갱신. / Auto-refresh on data changes. */
|
|
170
260
|
live?: boolean;
|
|
261
|
+
/** 차트 제목. / Chart title. */
|
|
171
262
|
title?: string;
|
|
263
|
+
/** 범례 설정. / Legend config. */
|
|
172
264
|
legend?: ChartRenderSpec['legend'];
|
|
265
|
+
/** 툴팁 사용 여부. / Whether tooltips are enabled. */
|
|
173
266
|
tooltip?: boolean;
|
|
267
|
+
/** 축 설정. / Axis config. */
|
|
174
268
|
axis?: ChartRenderSpec['axis'];
|
|
269
|
+
/** 시리즈 팔레트. / Series palette. */
|
|
175
270
|
palette?: string[];
|
|
271
|
+
/** 숫자 포맷터. / Number formatter. */
|
|
176
272
|
numberFormat?: ChartRenderSpec['numberFormat'];
|
|
273
|
+
/** 렌더 크기(px). / Render size (px). */
|
|
177
274
|
size?: {
|
|
178
275
|
width: number;
|
|
179
276
|
height: number;
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* 렌더 배선(GridRenderer expander 셀)이 이 모듈의 순수 함수/상수를 소비해 실제 DOM 속성을 채운다.
|
|
13
13
|
* 이 파일은 DOM 을 만들지 않는다 — 문자열/속성 값만 생성.
|
|
14
14
|
*/
|
|
15
|
+
/** i18n: 글리프 aria/툴팁 로케일 해석기(주입 없으면 전역 t). / i18n: glyph aria/tooltip resolver (global t when not injected). */
|
|
16
|
+
export type DetailGlyphT = (key: string, params?: Record<string, string | number>) => string;
|
|
15
17
|
/** 트리 셰브론(▸/▾)과 충돌하지 않는 전용 글리프(C10 기본값). */
|
|
16
18
|
export declare const DETAIL_GLYPH_COLLAPSED = "\u2295";
|
|
17
19
|
export declare const DETAIL_GLYPH_EXPANDED = "\u2296";
|
|
@@ -32,7 +34,7 @@ export interface DetailGlyphInfo {
|
|
|
32
34
|
* 펼침 여부에 따른 글리프/aria-label/title 조합을 반환한다. 트리 셰브론과 절대 겹치지 않는
|
|
33
35
|
* 문자셋만 사용(C10 R-DETAIL-GLYPH 하드 룰).
|
|
34
36
|
*/
|
|
35
|
-
export declare function getDetailGlyph(expanded: boolean): DetailGlyphInfo;
|
|
37
|
+
export declare function getDetailGlyph(expanded: boolean, t?: DetailGlyphT): DetailGlyphInfo;
|
|
36
38
|
/** NFR-5(1): 마스터 행 `aria-expanded` 값(문자열 — DOM setAttribute 그대로 사용). */
|
|
37
39
|
export declare function getMasterRowAriaExpanded(expanded: boolean): 'true' | 'false';
|
|
38
40
|
/**
|
|
@@ -2,16 +2,25 @@ import { ColumnDef, EditorDef } from '../types.js';
|
|
|
2
2
|
import { RenderContext } from '../renderers/CellRenderer.js';
|
|
3
3
|
export { DateEditor } from './DateEditor.js';
|
|
4
4
|
export { SelectEditor } from './SelectEditor.js';
|
|
5
|
+
/** 편집 결과(커밋 여부 + 값). / Edit result (whether committed + value). */
|
|
5
6
|
export interface EditorResult {
|
|
7
|
+
/** 커밋(확정) 여부. / Whether committed. */
|
|
6
8
|
committed: boolean;
|
|
9
|
+
/** 편집된 값. / Edited value. */
|
|
7
10
|
value: any;
|
|
8
11
|
}
|
|
12
|
+
/** 셀 에디터 인터페이스 — 편집 위젯 수명 관리. / Cell editor interface — manages the edit widget lifecycle. */
|
|
9
13
|
export interface CellEditor {
|
|
14
|
+
/** 컨테이너에 편집 위젯을 마운트한다. / Mount the edit widget into the container. */
|
|
10
15
|
mount(container: HTMLElement, ctx: RenderContext, onCommit: (value: any) => void, onCancel: () => void): void;
|
|
16
|
+
/** 현재 편집 값을 반환한다. / Return the current edit value. */
|
|
11
17
|
getValue(): any;
|
|
18
|
+
/** 편집 위젯에 포커스한다. / Focus the edit widget. */
|
|
12
19
|
focus(): void;
|
|
20
|
+
/** 편집 위젯을 정리한다. / Tear down the edit widget. */
|
|
13
21
|
destroy(): void;
|
|
14
22
|
}
|
|
23
|
+
/** 텍스트 입력 에디터. / Text input editor. */
|
|
15
24
|
export declare class TextEditor implements CellEditor {
|
|
16
25
|
private input;
|
|
17
26
|
private _onCommit;
|
|
@@ -23,6 +32,7 @@ export declare class TextEditor implements CellEditor {
|
|
|
23
32
|
focus(): void;
|
|
24
33
|
destroy(): void;
|
|
25
34
|
}
|
|
35
|
+
/** 숫자 입력 에디터(min/max/step 지원). / Number input editor (supports min/max/step). */
|
|
26
36
|
export declare class NumberEditor implements CellEditor {
|
|
27
37
|
private input;
|
|
28
38
|
private _onCommit;
|
|
@@ -43,6 +53,7 @@ export declare class NumberEditor implements CellEditor {
|
|
|
43
53
|
focus(): void;
|
|
44
54
|
destroy(): void;
|
|
45
55
|
}
|
|
56
|
+
/** 체크박스 에디터(change 즉시 커밋). / Checkbox editor (commits immediately on change). */
|
|
46
57
|
export declare class CheckboxEditor implements CellEditor {
|
|
47
58
|
private chk;
|
|
48
59
|
private _onCommit;
|
|
@@ -62,9 +73,25 @@ export declare class CheckboxEditor implements CellEditor {
|
|
|
62
73
|
* - number 는 def 가 있으면 min/max/step 을 옵션으로, 없으면 기본 NumberEditor.
|
|
63
74
|
* - select 는 def 가 있으면 def.options, 없으면 col.options 를 쓴다(원 switch 와 동일).
|
|
64
75
|
*/
|
|
76
|
+
/** 셀 에디터 팩토리 시그니처 `(col, def?) => CellEditor`. / Cell-editor factory signature `(col, def?) => CellEditor`. */
|
|
65
77
|
export type EditorFactory = (col: ColumnDef, def?: EditorDef) => CellEditor;
|
|
66
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* 커스텀 셀 에디터 타입을 코어 편집 없이 등록(OCP). 프로세스 전역.
|
|
80
|
+
* / Register a custom cell-editor type without editing core (OCP). Process-global.
|
|
81
|
+
*
|
|
82
|
+
* @param typeName - 에디터 타입 이름(예: 'color') / Editor type name (e.g. 'color')
|
|
83
|
+
* @param factory - 에디터 팩토리 / Editor factory
|
|
84
|
+
* @example
|
|
85
|
+
* registerEditor('color', () => new TextEditor());
|
|
86
|
+
*/
|
|
67
87
|
export declare function registerEditor(typeName: string, factory: EditorFactory): void;
|
|
68
|
-
/** 등록 여부 조회(내부/테스트용). */
|
|
88
|
+
/** 에디터 타입 등록 여부 조회(내부/테스트용). / Whether an editor type is registered (internal/test use). */
|
|
69
89
|
export declare function hasEditor(typeName: string): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* 컬럼 정의로부터 셀 에디터를 생성한다(레지스트리 해석, 미등록 시 TextEditor 폴백).
|
|
92
|
+
* / Create a cell editor from a column definition (registry resolution; falls back to TextEditor when unregistered).
|
|
93
|
+
*
|
|
94
|
+
* @param col - 컬럼 정의 / Column definition
|
|
95
|
+
* @returns 셀 에디터 / A cell editor
|
|
96
|
+
*/
|
|
70
97
|
export declare function createEditor(col: ColumnDef): CellEditor;
|
|
@@ -1,48 +1,100 @@
|
|
|
1
1
|
import { OGDecimal } from '../OGDecimal.js';
|
|
2
|
+
/** 셀 키 문자열 `${rowId}:${field}`(내부 전용 포맷). / Cell key string `${rowId}:${field}` (internal format). */
|
|
2
3
|
export type CellKey = string;
|
|
4
|
+
/**
|
|
5
|
+
* rowId·field 로 셀 키를 만든다. / Build a cell key from rowId and field.
|
|
6
|
+
*
|
|
7
|
+
* @param rowId - 행 stable id / Row stable id
|
|
8
|
+
* @param field - 컬럼 field 명 / Column field name
|
|
9
|
+
* @returns `${rowId}:${field}` 형태의 키 / A `${rowId}:${field}` key
|
|
10
|
+
*/
|
|
3
11
|
export declare function cellKey(rowId: string, field: string): CellKey;
|
|
12
|
+
/**
|
|
13
|
+
* 셀 키를 rowId·field 로 분해한다. / Split a cell key back into rowId and field.
|
|
14
|
+
*
|
|
15
|
+
* @param key - 셀 키 문자열 / Cell key string
|
|
16
|
+
* @returns { rowId, field }
|
|
17
|
+
*/
|
|
4
18
|
export declare function parseCellKey(key: CellKey): {
|
|
5
19
|
rowId: string;
|
|
6
20
|
field: string;
|
|
7
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* 수식 에러 코드. / Formula error code.
|
|
24
|
+
*
|
|
25
|
+
* `#ERR`(일반), `#REF`(참조 무효), `#CYCLE`(순환), `#DIV0`(0 나눗셈), `#NAME`(미정의 이름),
|
|
26
|
+
* `#VALUE`(비수치), `#NUM`(수치 범위).
|
|
27
|
+
* / `#ERR` (general), `#REF` (invalid ref), `#CYCLE` (cyclic), `#DIV0` (divide by zero),
|
|
28
|
+
* `#NAME` (undefined name), `#VALUE` (non-numeric), `#NUM` (numeric range).
|
|
29
|
+
*/
|
|
8
30
|
export type FormulaErrorCode = '#ERR' | '#REF' | '#CYCLE' | '#DIV0' | '#NAME' | '#VALUE' | '#NUM';
|
|
31
|
+
/** 전체 에러 코드 집합(런타임 판별용). / Set of all error codes (for runtime checks). */
|
|
9
32
|
export declare const FORMULA_ERROR_CODES: ReadonlySet<string>;
|
|
10
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* 값이 이미 다른 수식의 에러 결과(문자열)인지 판별 — 에러 전파용. / Detect whether a value is already another formula's error result (string) — for error propagation.
|
|
35
|
+
*
|
|
36
|
+
* @param v - 검사할 값 / Value to inspect
|
|
37
|
+
* @returns 에러 코드 또는 null / The error code, or null
|
|
38
|
+
*/
|
|
11
39
|
export declare function isErrorToken(v: unknown): FormulaErrorCode | null;
|
|
40
|
+
/** 수식 셀의 계산 결과 값 타입. / Computed result value type of a formula cell. */
|
|
12
41
|
export type CellValue = OGDecimal | string | boolean | null;
|
|
42
|
+
/** 참조 정규화 모드: 'stable'(rowId 앵커) | 'relative'(행 오프셋). / Reference normalization mode: 'stable' (rowId anchor) | 'relative' (row offset). */
|
|
13
43
|
export type RefMode = 'stable' | 'relative';
|
|
44
|
+
/** 정규화된 절대 참조(rowId 앵커). / Normalized absolute reference (rowId anchor). */
|
|
14
45
|
export interface CanonicalAbsRef {
|
|
15
46
|
kind: 'abs';
|
|
47
|
+
/** 앵커 행 stable id. / Anchor row stable id. */
|
|
16
48
|
rowId: string;
|
|
49
|
+
/** 컬럼 field 명. / Column field name. */
|
|
17
50
|
field: string;
|
|
51
|
+
/** 원문에 '$' 행 고정이 있었는지. / Whether the source had a '$' row lock. */
|
|
18
52
|
dollarRow: boolean;
|
|
53
|
+
/** 원문에 '$' 열 고정이 있었는지. / Whether the source had a '$' column lock. */
|
|
19
54
|
dollarCol: boolean;
|
|
20
55
|
}
|
|
56
|
+
/** 정규화된 상대 참조(행 오프셋). / Normalized relative reference (row offset). */
|
|
21
57
|
export interface CanonicalRelRef {
|
|
22
58
|
kind: 'rel';
|
|
59
|
+
/** 현재 셀 기준 행 오프셋 (refMode:'relative' 전용, §2.3). / Row offset from the current cell (refMode:'relative' only, §2.3). */
|
|
23
60
|
dRow: number;
|
|
61
|
+
/** 컬럼 field 명. / Column field name. */
|
|
24
62
|
field: string;
|
|
63
|
+
/** rel 인데 dollarRow=true 인 경우는 없음(구조상 dollarRow=true 면 abs). / Never true for rel (a '$' row lock structurally implies abs). */
|
|
25
64
|
dollarRow: boolean;
|
|
65
|
+
/** 열 고정 여부. / Whether the column is locked. */
|
|
26
66
|
dollarCol: boolean;
|
|
27
67
|
}
|
|
68
|
+
/** 정규화된 단일 참조(절대 | 상대). / Normalized single reference (absolute | relative). */
|
|
28
69
|
export type CanonicalRef = CanonicalAbsRef | CanonicalRelRef;
|
|
70
|
+
/** 정규화된 범위 참조(두 코너). / Normalized range reference (two corners). */
|
|
29
71
|
export interface CanonicalRangeRef {
|
|
72
|
+
/** 코너1 (원문 좌측/상단 그대로, 정렬은 evaluate-time §3.5). / Corner 1 (kept as source left/top; ordering happens at evaluate-time §3.5). */
|
|
30
73
|
a: CanonicalRef;
|
|
74
|
+
/** 코너2. / Corner 2. */
|
|
31
75
|
b: CanonicalRef;
|
|
32
76
|
}
|
|
77
|
+
/** 파서 원시 셀 참조 노드(정규화 전). / Raw parser cell-reference node (pre-normalization). */
|
|
33
78
|
export interface RawCellRefNode {
|
|
34
79
|
t: 'rawRef';
|
|
80
|
+
/** A1 열문자. / A1 column letters. */
|
|
35
81
|
colLetters: string;
|
|
82
|
+
/** 1-based 행 번호. / 1-based row number. */
|
|
36
83
|
row: number;
|
|
84
|
+
/** 열 '$' 고정. / Column '$' lock. */
|
|
37
85
|
dollarCol: boolean;
|
|
86
|
+
/** 행 '$' 고정. / Row '$' lock. */
|
|
38
87
|
dollarRow: boolean;
|
|
39
88
|
}
|
|
89
|
+
/** 파서 원시 범위 참조 노드(정규화 전). / Raw parser range-reference node (pre-normalization). */
|
|
40
90
|
export interface RawRangeRefNode {
|
|
41
91
|
t: 'rawRange';
|
|
42
92
|
a: RawCellRefNode;
|
|
43
93
|
b: RawCellRefNode;
|
|
44
94
|
}
|
|
95
|
+
/** 수식 이항 연산자. / Formula binary operator. */
|
|
45
96
|
export type BinOp = '+' | '-' | '*' | '/' | '%' | '^' | '&' | '=' | '<>' | '<' | '<=' | '>' | '>=';
|
|
97
|
+
/** 수식 AST 노드(원시 참조 + 정규화 후 노드 공존 유니온). / Formula AST node (union of raw refs and normalized nodes). */
|
|
46
98
|
export type AstNode = {
|
|
47
99
|
t: 'num';
|
|
48
100
|
v: string;
|
|
@@ -78,27 +130,38 @@ export type AstNode = {
|
|
|
78
130
|
left: AstNode;
|
|
79
131
|
right: AstNode;
|
|
80
132
|
};
|
|
133
|
+
/** 수식 셀 사이드카 저장 단위(§3.4/§4.1). / Formula-cell sidecar storage unit (§3.4/§4.1). */
|
|
81
134
|
export interface FormulaCell {
|
|
135
|
+
/** 원문 "=A1+B2"(편집 표시용, §4.3). / Source text "=A1+B2" (for edit display, §4.3). */
|
|
82
136
|
src: string;
|
|
137
|
+
/** 정규화된 AST. / Normalized AST. */
|
|
83
138
|
ast: AstNode;
|
|
139
|
+
/** 범위 참조 포함 여부 → applySort/applyFilter dirty 대상(§3.5 P0). / Whether a range ref is present → dirtied by applySort/applyFilter (§3.5 P0). */
|
|
84
140
|
hasRangeRef: boolean;
|
|
141
|
+
/** 캐시된 계산 결과. / Cached computed result. */
|
|
85
142
|
value: CellValue;
|
|
143
|
+
/** 에러 코드(없으면 null). / Error code (null if none). */
|
|
86
144
|
error: FormulaErrorCode | null;
|
|
145
|
+
/** 근사(SQRT 등) 포함 여부 → ≈ 표식(C11). / Whether approximation (e.g. SQRT) is involved → ≈ marker (C11). */
|
|
87
146
|
approx?: boolean;
|
|
88
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* 수식 엔진이 그리드/데이터를 보는 유일한 인터페이스(주입, 의존성 역전 C0/C0.3/C1).
|
|
150
|
+
* / The sole interface through which the formula engine views the grid/data (injected, dependency inversion C0/C0.3/C1).
|
|
151
|
+
*/
|
|
89
152
|
export interface FormulaGridAccessor {
|
|
90
|
-
/** A1 열문자 매핑 기준 — visibleLeaves(숨김 제외) 순서의 field 배열(§3.1/C1). */
|
|
153
|
+
/** A1 열문자 매핑 기준 — visibleLeaves(숨김 제외) 순서의 field 배열(§3.1/C1). / A1 column-letter basis — field array in visibleLeaves order (hidden excluded) (§3.1/C1). */
|
|
91
154
|
visibleFields(): string[];
|
|
92
|
-
/** flat index(0-based) → rowId. kind!=='data' 이거나 범위 밖이면 null(§C0.3). */
|
|
155
|
+
/** flat index(0-based) → rowId. kind!=='data' 이거나 범위 밖이면 null(§C0.3). / flat index (0-based) → rowId; null when kind!=='data' or out of range (§C0.3). */
|
|
93
156
|
rowIdAtFlat(flatIndex: number): string | null;
|
|
94
|
-
/** rowId → 현재 flat index(0-based). 없음/필터아웃/접힘이면 -1. */
|
|
157
|
+
/** rowId → 현재 flat index(0-based). 없음/필터아웃/접힘이면 -1. / rowId → current flat index (0-based); -1 when absent/filtered-out/collapsed. */
|
|
95
158
|
flatIndexOfRowId(rowId: string): number;
|
|
96
|
-
/** 현재 표시(필터 통과) 순서의 rowId 배열 — 범위 evaluate-time 멤버십 해소용(§3.5). */
|
|
159
|
+
/** 현재 표시(필터 통과) 순서의 rowId 배열 — 범위 evaluate-time 멤버십 해소용(§3.5). / rowId array in current display (filtered) order — for evaluate-time range membership (§3.5). */
|
|
97
160
|
displayedRowIds(): string[];
|
|
98
|
-
/** (rowId, field) 셀의 원시 값(비수식, 이미 계산된 값 포함) 조회. */
|
|
161
|
+
/** (rowId, field) 셀의 원시 값(비수식, 이미 계산된 값 포함) 조회. / Read the raw value at (rowId, field) (non-formula; includes already-computed values). */
|
|
99
162
|
getCellValue(rowId: string, field: string): unknown;
|
|
100
|
-
/** rowId 존재 여부(행 삭제 감지, F3-R28). */
|
|
163
|
+
/** rowId 존재 여부(행 삭제 감지, F3-R28). / Whether a rowId exists (row-deletion detection, F3-R28). */
|
|
101
164
|
hasRow(rowId: string): boolean;
|
|
102
|
-
/** field 존재 여부(열 삭제 감지, F3-R28). */
|
|
165
|
+
/** field 존재 여부(열 삭제 감지, F3-R28). / Whether a field exists (column-deletion detection, F3-R28). */
|
|
103
166
|
hasField(field: string): boolean;
|
|
104
167
|
}
|
|
Binary file
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `{name}` 명명 파라미터를 치환한다. `{{`→`{`, `}}`→`}` 이스케이프. 누락 파라미터는 플레이스홀더 유지.
|
|
3
|
+
* / Substitute `{name}` params. Escapes `{{`→`{`, `}}`→`}`. Missing params keep the placeholder.
|
|
4
|
+
*/
|
|
5
|
+
export declare function interpolate(template: string, params?: Readonly<Record<string, string | number>>): string;
|