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.
Files changed (52) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +30 -1
  3. package/THIRD_PARTY_LICENSES.txt +43 -0
  4. package/dist/OpenGrid-B0Spm0rU.js +10404 -0
  5. package/dist/OpenGrid-CuXj0isp.cjs +97 -0
  6. package/dist/open-grid-base.css +5 -5
  7. package/dist/open-grid-react.cjs +1 -1
  8. package/dist/open-grid-react.js +1 -1
  9. package/dist/open-grid-skins.css +111 -0
  10. package/dist/open-grid-vue.cjs +1 -1
  11. package/dist/open-grid-vue.js +1 -1
  12. package/dist/open-grid.cjs +5 -5
  13. package/dist/open-grid.js +149 -136
  14. package/dist/types/core/AppearanceResolver.d.ts +100 -0
  15. package/dist/types/core/CellEditManager.d.ts +2 -0
  16. package/dist/types/core/ChartManager.d.ts +2 -0
  17. package/dist/types/core/ContextMenu.d.ts +5 -1
  18. package/dist/types/core/CrossGridController.d.ts +70 -0
  19. package/dist/types/core/DetailManager.d.ts +2 -0
  20. package/dist/types/core/ExportManager.d.ts +7 -0
  21. package/dist/types/core/ExtensionPointRegistry.d.ts +92 -0
  22. package/dist/types/core/FilterPanel.d.ts +4 -1
  23. package/dist/types/core/FilterSelect.d.ts +4 -1
  24. package/dist/types/core/FindBarManager.d.ts +6 -0
  25. package/dist/types/core/FormulaController.d.ts +81 -0
  26. package/dist/types/core/GridComposer.d.ts +142 -0
  27. package/dist/types/core/GridRenderer.d.ts +44 -4
  28. package/dist/types/core/IconRegistry.d.ts +55 -0
  29. package/dist/types/core/KeyboardManager.d.ts +2 -0
  30. package/dist/types/core/MutationService.d.ts +128 -0
  31. package/dist/types/core/OpenGrid.d.ts +464 -68
  32. package/dist/types/core/OrgChart.d.ts +2 -0
  33. package/dist/types/core/Pagination.d.ts +6 -1
  34. package/dist/types/core/RangeSelectionManager.d.ts +2 -0
  35. package/dist/types/core/RenderController.d.ts +65 -0
  36. package/dist/types/core/SkinRegistry.d.ts +53 -0
  37. package/dist/types/core/SortFilterManager.d.ts +2 -0
  38. package/dist/types/core/WorksheetManager.d.ts +4 -1
  39. package/dist/types/core/detail/DetailGlyph.d.ts +3 -1
  40. package/dist/types/core/editors/CellEditor.d.ts +17 -1
  41. package/dist/types/core/i18n/LocaleRegistry.d.ts +0 -0
  42. package/dist/types/core/i18n/interpolate.d.ts +5 -0
  43. package/dist/types/core/i18n/locales/en.d.ts +166 -0
  44. package/dist/types/core/i18n/locales/ko.d.ts +166 -0
  45. package/dist/types/core/i18n/types.d.ts +249 -0
  46. package/dist/types/core/icons/bootstrap-icons.d.ts +9 -0
  47. package/dist/types/core/renderers/CellRenderer.d.ts +43 -2
  48. package/dist/types/core/types.d.ts +387 -91
  49. package/dist/types/index.d.ts +26 -0
  50. package/package.json +3 -1
  51. package/dist/OpenGrid-5flQwc3W.js +0 -8434
  52. package/dist/OpenGrid-DahxRY7C.cjs +0 -92
@@ -0,0 +1,249 @@
1
+ /** 보간 파라미터. 명명 파라미터만(위치 파라미터 금지 — 어순이 언어마다 다름). / Interpolation params. Named only (positional forbidden — word order differs per language). */
2
+ export type MessageParams = Readonly<Record<string, string | number>>;
3
+ /**
4
+ * 메시지 값: 평문 문자열('{name}' 보간) 또는 함수(복수형·조사 등 "문법이 데이터인" 케이스의 탈출구).
5
+ * ICU/CLDR 복수 엔진은 zero-dependency 정체성 때문에 도입하지 않는다(규칙은 로케일 파일에 둔다).
6
+ * / A message value: a plain string ('{name}' interpolation) or a function (escape hatch for
7
+ * plurals/particles where "grammar is data"). No ICU/CLDR plural engine (zero-dependency).
8
+ */
9
+ export type MessageValue = string | ((params: MessageParams) => string);
10
+ /**
11
+ * 로케일 메시지 카탈로그(2단 중첩, 최상위 섹션 = 소비 UI 표면). 파라미터를 받는 값만 `MessageValue`
12
+ * (함수형 복수 허용), 정적 라벨은 `string`. 내장 ko 가 SSOT 이며 en 은 동일 키 집합을 갖는다.
13
+ * / The locale message catalog (2-level nested, top-level section = consuming UI surface). Only
14
+ * parameterized entries are `MessageValue` (allowing plural functions); static labels are
15
+ * `string`. Built-in ko is the SSOT; en carries the same key set.
16
+ */
17
+ export interface LocaleMessages {
18
+ /** 우클릭 컨텍스트 메뉴 라벨. / Right-click context-menu labels. */
19
+ contextMenu: {
20
+ sortAsc: string;
21
+ sortDesc: string;
22
+ find: string;
23
+ exportExcel: string;
24
+ exportCsv: string;
25
+ print: string;
26
+ };
27
+ /** 필터 패널·필터 셀렉트 라벨. / Filter panel & filter-select labels. */
28
+ filter: {
29
+ title: string;
30
+ opContains: string;
31
+ opEq: string;
32
+ opNe: string;
33
+ opStartsWith: string;
34
+ opEndsWith: string;
35
+ opGt: string;
36
+ opLt: string;
37
+ opGte: string;
38
+ opLte: string;
39
+ valuePlaceholder: string;
40
+ clear: string;
41
+ apply: string;
42
+ legend: string;
43
+ clearAria: string;
44
+ all: string;
45
+ };
46
+ /** 찾기 바 라벨/placeholder/aria/카운트 배지. / Find-bar label/placeholder/aria/count badge. */
47
+ findBar: {
48
+ label: string;
49
+ placeholder: string;
50
+ searchAria: string;
51
+ closeAria: string;
52
+ /** 결과 개수 배지. 파라미터 {n}. / Result count badge. Param {n}. */
53
+ countBadge: MessageValue;
54
+ };
55
+ /** 페이지네이션 라벨/범위 배지/빈 상태. / Pagination labels/range badge/empty state. */
56
+ pagination: {
57
+ rowsPerPage: string;
58
+ /** 현재 범위 배지. 파라미터 {from} {to} {total}. / Current range badge. Params {from} {to} {total}. */
59
+ rangeBadge: MessageValue;
60
+ empty: string;
61
+ };
62
+ /** 행 드래그 고스트 라벨. / Row-drag ghost label. */
63
+ drag: {
64
+ /** 드래그 중 행 개수. 파라미터 {count}. / Rows being dragged. Param {count}. */
65
+ rowCount: MessageValue;
66
+ };
67
+ /** 크로스그리드 매핑 다이얼로그(디자인타임 헬퍼). / Cross-grid mapping dialog (design-time helper). */
68
+ crossGrid: {
69
+ overlayAria: string;
70
+ title: string;
71
+ desc1: string;
72
+ desc2: string;
73
+ emptyOption: string;
74
+ scriptTitle: string;
75
+ copy: string;
76
+ copied: string;
77
+ copyFailed: string;
78
+ cancel: string;
79
+ applyMove: string;
80
+ scriptComment: string;
81
+ };
82
+ /** 그리드↔그리드 셔틀 버튼 aria/tooltip. / Grid-to-grid shuttle button aria/tooltip. */
83
+ shuttle: {
84
+ toRight: string;
85
+ toLeft: string;
86
+ allRight: string;
87
+ allLeft: string;
88
+ };
89
+ /** 트리 노드 확장/접기 aria. / Tree node expand/collapse aria. */
90
+ tree: {
91
+ collapse: string;
92
+ expand: string;
93
+ };
94
+ /** 마스터/디테일 글리프·announce. / Master/detail glyph & announce. */
95
+ detail: {
96
+ glyphLabel: string;
97
+ glyphTooltip: string;
98
+ expandAria: string;
99
+ collapseAria: string;
100
+ expandedAnnounce: string;
101
+ collapsedAnnounce: string;
102
+ collapsedAllAnnounce: string;
103
+ /** 상세 패널 깊이 한계. 파라미터 {max}. / Detail depth limit. Param {max}. */
104
+ depthLimitOpen: MessageValue;
105
+ /** 서브그리드 깊이 한계. 파라미터 {max}. / Subgrid depth limit. Param {max}. */
106
+ depthLimitSubgrid: MessageValue;
107
+ };
108
+ /** 워크시트 탭 UI. / Worksheet tab UI. */
109
+ worksheet: {
110
+ addAria: string;
111
+ };
112
+ /** 인라인 에디터 aria/announce. / Inline editor aria/announce. */
113
+ editor: {
114
+ datePick: string;
115
+ select: string;
116
+ /** 편집 셀 위치 announce. 파라미터 {row} {col} {header} {value}. / Edited-cell position announce. Params {row} {col} {header} {value}. */
117
+ cellPositionAnnounce: MessageValue;
118
+ };
119
+ /** 셀 렌더러(마스킹·라디오·바코드·수식 빈값). / Cell renderer (masking/radio/barcode/formula empty). */
120
+ cell: {
121
+ emptyValue: string;
122
+ revealTooltip: string;
123
+ revealAria: string;
124
+ radioAria: string;
125
+ /** 바코드 셀 aria. 파라미터 {value}. / Barcode cell aria. Param {value}. */
126
+ barcodeAria: MessageValue;
127
+ };
128
+ /** 행 선택 aria + 행 이동 announce. / Row selection aria + row-move announce. */
129
+ row: {
130
+ selectAllAria: string;
131
+ /** 행 체크박스 aria. 파라미터 {n}. / Row checkbox aria. Param {n}. */
132
+ selectAria: MessageValue;
133
+ /** 행 이동 announce. 파라미터 {from} {to}. / Row-move announce. Params {from} {to}. */
134
+ moveAnnounce: MessageValue;
135
+ };
136
+ /** 그룹 행 배지/null 라벨. / Group-row badge / null label. */
137
+ group: {
138
+ /** 그룹 배지. 파라미터 {label} {count}. / Group badge. Params {label} {count}. */
139
+ badge: MessageValue;
140
+ nullLabel: string;
141
+ };
142
+ /** 피벗 총계 행. / Pivot total row. */
143
+ pivot: {
144
+ totalLabel: string;
145
+ };
146
+ /** 데이터 로드/스킵 announce. / Data load/skip announce. */
147
+ data: {
148
+ /** 데이터 로드 announce. 파라미터 {count}. / Data-loaded announce. Param {count}. */
149
+ loadedAnnounce: MessageValue;
150
+ /** 쓰기 대상 아닌 셀 스킵 announce. 파라미터 {count}. / Non-writable cells skipped announce. Param {count}. */
151
+ skippedCellsAnnounce: MessageValue;
152
+ };
153
+ /** 범위 선택 + 채우기 announce/aria. / Range selection + fill announce/aria. */
154
+ range: {
155
+ /** 범위 선택 announce. 파라미터 {r1} {c1} {r2} {c2} {n}. / Range selection announce. Params {r1} {c1} {r2} {c2} {n}. */
156
+ selectionAnnounce: MessageValue;
157
+ /** 수식 셀 보존 announce. 파라미터 {count}. / Formula cells preserved announce. Param {count}. */
158
+ formulaPreserved: MessageValue;
159
+ /** 채우기 스킵 announce. 파라미터 {count}. / Fill-skipped announce. Param {count}. */
160
+ fillSkipped: MessageValue;
161
+ fillHandleAria: string;
162
+ };
163
+ /** 정렬 상태어 + announce. / Sort state words + announce. */
164
+ sort: {
165
+ asc: string;
166
+ desc: string;
167
+ none: string;
168
+ /** 정렬 announce. 파라미터 {field} {dir}. / Sort announce. Params {field} {dir}. */
169
+ announce: MessageValue;
170
+ };
171
+ /** F4 차트 배지·announce·접근성 요약. / F4 chart badges/announce/a11y summary. */
172
+ chart: {
173
+ defaultTitle: string;
174
+ /** 샘플링 배지. 파라미터 {to} {from}. / Sampled badge. Params {to} {from}. */
175
+ badgeSampled: MessageValue;
176
+ /** 집계 배지. 파라미터 {op}. / Aggregated badge. Param {op}. */
177
+ badgeAggregated: MessageValue;
178
+ badgePieFirstSeries: string;
179
+ badgeNegativesAbs: string;
180
+ badgeRangeFallback: string;
181
+ /** 엔진 폴백 배지. 파라미터 {engine}. / Engine-fallback badge. Param {engine}. */
182
+ badgeEngineFallback: MessageValue;
183
+ /** 배지 announce 접두. 파라미터 {badges}. / Badge announce prefix. Param {badges}. */
184
+ announcePrefix: MessageValue;
185
+ /** 접근성 요약. 파라미터 {title} {categories} {series}. / A11y summary. Params {title} {categories} {series}. */
186
+ a11ySummary: MessageValue;
187
+ /** 무제목 접근성 요약. 파라미터 {categories} {series}. / Titleless a11y summary. Params {categories} {series}. */
188
+ a11ySummaryNoTitle: MessageValue;
189
+ /** 캔버스 대체 텍스트. 파라미터 {title} {categories} {series}. / Canvas alt text. Params {title} {categories} {series}. */
190
+ a11yAltText: MessageValue;
191
+ a11yNoData: string;
192
+ tooltipEmpty: string;
193
+ canvasDefault: string;
194
+ };
195
+ /** 사용자 노출 수식 오류 셀 라벨. / User-facing formula error cell labels. */
196
+ formulaError: {
197
+ err: string;
198
+ ref: string;
199
+ cycle: string;
200
+ div0: string;
201
+ name: string;
202
+ value: string;
203
+ num: string;
204
+ fallback: string;
205
+ };
206
+ /** 수식 셀 announce/aria(파라미터형). / Formula cell announce/aria (parameterized). */
207
+ formula: {
208
+ /** 셀 오류 announce. 파라미터 {field} {message}. / Cell error announce. Params {field} {message}. */
209
+ cellErrorAnnounce: MessageValue;
210
+ /** 수식 오류 셀 aria. 파라미터 {src} {message}. / Formula error cell aria. Params {src} {message}. */
211
+ ariaError: MessageValue;
212
+ /** 수식 값 셀 aria. 파라미터 {src} {value} {approx}. / Formula value cell aria. Params {src} {value} {approx}. */
213
+ ariaValue: MessageValue;
214
+ approxSuffix: string;
215
+ };
216
+ /** 컨테이너·빈 상태·헤더 필터 아이콘·디테일 영역 aria/tooltip. / Container/empty/header-filter/detail-region aria & tooltip. */
217
+ grid: {
218
+ containerAria: string;
219
+ emptyMessage: string;
220
+ filterTooltip: string;
221
+ detailRegion: string;
222
+ };
223
+ /** 인쇄/내보내기 문서 문구(포맷 파라미터형). / Print/export document strings (parameterized). */
224
+ export: {
225
+ /** 인쇄 요약행. 파라미터 {rows} {cols} {date}. / Print summary row. Params {rows} {cols} {date}. */
226
+ printSummary: MessageValue;
227
+ };
228
+ }
229
+ /** 부분 오버라이드(2단 딥머지, 카탈로그 위). / Partial override (2-level deep-merge over the catalog). */
230
+ export type PartialLocaleMessages = {
231
+ [S in keyof LocaleMessages]?: Partial<LocaleMessages[S]>;
232
+ };
233
+ /** dot-key 유니온(`'filter.apply'` 등) — 오타를 컴파일 에러화. / Dot-key union (e.g. `'filter.apply'`) — typos become compile errors. */
234
+ export type LocaleMessageKey = {
235
+ [S in keyof LocaleMessages]: `${S & string}.${keyof LocaleMessages[S] & string}`;
236
+ }[keyof LocaleMessages];
237
+ /** 로케일 포맷 파라미터(문자열 아님): Intl 태그·방향·수출 폰트. / Locale format params (non-string): Intl tag, direction, export font. */
238
+ export interface LocaleMeta {
239
+ /** BCP-47 태그(toLocaleString/lang/인쇄 템플릿용). 예 'ko-KR'. / BCP-47 tag (for toLocaleString/lang/print template). e.g. 'ko-KR'. */
240
+ readonly intlLocale: string;
241
+ /** 텍스트 방향(현 코어는 ltr 검증). / Text direction (core validated for ltr). */
242
+ readonly dir?: 'ltr' | 'rtl';
243
+ /** Excel 내보내기 기본 폰트. / Default font for Excel export. */
244
+ readonly exportFont?: string;
245
+ }
246
+ /** register() 결과 — 누락 키 정직 신호(막지 않음). / register() result — honest missing-key signal (never blocks). */
247
+ export interface LocaleRegisterResult {
248
+ readonly missingKeys: string[];
249
+ }
@@ -0,0 +1,9 @@
1
+ /** 모든 큐레이션 글리프 공통 viewBox(Bootstrap Icons 16px 그리드). */
2
+ export declare const ICON_VIEWBOX = "0 0 16 16";
3
+ /**
4
+ * symbolId → SVG 내부 마크업(<path>/<g>). Bootstrap Icons v1.13.1(MIT)에서 큐레이션.
5
+ * `eye-reveal` 는 예외(기존 마스킹 셀 커스텀 글리프, 행동 보존용).
6
+ */
7
+ export declare const BOOTSTRAP_ICONS: Readonly<Record<string, string>>;
8
+ /** 큐레이션에 포함된 symbol 개수(테스트/디버깅용). `eye-reveal`(커스텀 1) 포함. */
9
+ export declare const BOOTSTRAP_ICON_COUNT: number;
@@ -1,4 +1,7 @@
1
- import { ColumnDef } from '../types.js';
1
+ import { ColumnDef, RendererDef } from '../types.js';
2
+ /** i18n: 렌더 컨텍스트 로케일 해석기(주입 없으면 전역 t). 인스턴스 로케일이 전역보다 우선.
3
+ * / i18n: render-context locale resolver (global t when not injected). Instance locale wins over global. */
4
+ export declare function ctxT(ctx: RenderContext, key: string, params?: Record<string, string | number>): string;
2
5
  export interface RenderContext<T = any> {
3
6
  value: any;
4
7
  row: T;
@@ -7,14 +10,29 @@ export interface RenderContext<T = any> {
7
10
  colIndex: number;
8
11
  isSelected: boolean;
9
12
  rowState: 'none' | 'added' | 'edited' | 'removed';
13
+ /** i18n: 인스턴스 로케일 해석기(GridRenderer/CellEditManager 가 주입, 미주입 시 전역 t 폴백). / i18n: instance locale resolver (injected; global-t fallback). */
14
+ t?: (key: string, params?: Record<string, string | number>) => string;
10
15
  displayValue?: string | null;
16
+ /** R1b: per-instance displayFormatter 전략(값·필드·행 → 표시문자열|null). Number/Date 렌더러가
17
+ * ctx.value 위에 적용한다(모듈전역 없이 멀티그리드 격리). null 반환/미설정 시 기본 포맷 폴백.
18
+ * ※ getDisplayValue override(text 경로의 ctx.displayValue)와 달리 **전략만** 적용 — 숫자/날짜의
19
+ * 기본 포맷(천단위·통화·정밀도)을 보존하고 그룹모드 인덱스 불일치를 피한다. */
20
+ displayFormatter?: ((value: any, field: string, row: any) => string | null) | null;
11
21
  /** C7(15_cross_contracts.md/F3-R14): 이 셀에 F3 셀 수식이 있으면 true — ColumnDef.formula 재평가를 skip. */
12
22
  hasCellFormula?: boolean;
13
23
  }
14
24
  export interface CellRenderer {
15
25
  render(ctx: RenderContext): HTMLElement;
16
26
  }
17
- export declare function setDisplayFormatterResolver(resolver: ((value: any, field: string, row: any) => string | null) | null): void;
27
+ /**
28
+ * R1(OOP 리팩터, DIP 수정): 과거엔 formatNumber/formatDate 가 host 참조가 없어 **모듈 전역**
29
+ * resolver 로 displayFormatter 슬롯에 도달했다. 그 전역은 매 OpenGrid 생성자가 덮어써,
30
+ * 한 페이지에 그리드가 여럿이면 마지막 그리드의 포매터가 전 그리드에 새는 P0 정합성 결함이었다.
31
+ * → 전역을 제거했다. 이제 displayFormatter 는 **per-instance 안전 경로 하나**로만 흐른다:
32
+ * OpenGrid.getDisplayValue(슬롯 읽기) → GridRenderer 가 RenderContext.displayValue 로 주입
33
+ * → 각 셀 렌더러(Text/Number/Date)가 ctx.displayValue 를 우선 사용.
34
+ * formatNumber/formatDate 는 전역 상태 0 의 순수 포맷 함수로 환원했다(출력 동일, 회귀 0).
35
+ */
18
36
  /**
19
37
  * 컬럼에 formula가 있으면 OGDecimal로 평가해 표시값(string)을 반환.
20
38
  * formula가 없으면 null 반환 → 기존 ctx.value 사용.
@@ -62,6 +80,10 @@ export declare class CheckboxRenderer implements CellRenderer {
62
80
  export interface ButtonRendererDef {
63
81
  type: 'button';
64
82
  label?: string | ((value: any, row: any) => string);
83
+ /** R12c: 라벨과 함께 표시할 아이콘 role/key(renderIcon). 미지정 시 라벨만(기존과 동일). */
84
+ icon?: string;
85
+ /** 아이콘 위치(기본 'left'). */
86
+ iconPos?: 'left' | 'right';
65
87
  buttonClass?: string;
66
88
  style?: string;
67
89
  }
@@ -149,4 +171,23 @@ export declare class HtmlRenderer implements CellRenderer {
149
171
  export declare class BarcodeRenderer implements CellRenderer {
150
172
  render(ctx: RenderContext): HTMLElement;
151
173
  }
174
+ /**
175
+ * R10(§6-R10, §2.5 R-4c, §3.1 C11): `createRenderer` 이중 switch 를 `Map<typeName, factory>`
176
+ * 레지스트리로 대체한다. 내장 타입은 모듈 로드시 부트스트랩 등록(아래 switch 와 동일 매핑),
177
+ * `createRenderer` 는 레지스트리로 해석하고 미등록 타입은 기존과 동일하게 TextRenderer 로 폴백한다.
178
+ * `registerRenderer(typeName, factory)` 로 코어 편집 없이 커스텀 렌더러를 추가할 수 있다(OCP).
179
+ *
180
+ * 등록은 **프로세스 전역**(내장은 불변에 가깝고, 커스텀 등록은 defaultOverride 와 동형의 전역 정책).
181
+ * 인스턴스별 스코핑은 R11/R12(ExtensionPointRegistry)의 후속 작업으로 남긴다.
182
+ *
183
+ * 팩토리는 `(col, def)` 를 받는다. `def` 는 RendererDef 객체 경로에서만 채워지며(문자열/col.type
184
+ * 경로에서는 undefined), 원 switch 의 세 컨텍스트(col.type / 문자열 / 객체) 동작을 정확히 보존한다:
185
+ * - image/progress/sparkline/rating/template 은 def(설정 객체) 없이는 원래 TextRenderer 로 떨어졌으므로
186
+ * def 유무로 게이트한다(문자열 렌더러명만 준 미완성 설정 = 기존과 동일 폴백).
187
+ */
188
+ export type RendererFactory = (col: ColumnDef, def?: RendererDef) => CellRenderer;
189
+ /** 커스텀 셀 렌더러 타입을 코어 편집 없이 등록(OCP). 프로세스 전역. */
190
+ export declare function registerRenderer(typeName: string, factory: RendererFactory): void;
191
+ /** 등록 여부 조회(내부/테스트용). */
192
+ export declare function hasRenderer(typeName: string): boolean;
152
193
  export declare function createRenderer(col: ColumnDef): CellRenderer;