open-grid 1.3.1 → 1.4.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 +28 -0
- package/README.ja.md +462 -0
- package/README.md +52 -18
- package/README.zh.md +455 -0
- package/dist/{OpenGrid-B7m7ei7f.cjs → OpenGrid-BOtTt5aI.cjs} +2 -2
- package/dist/{OpenGrid-CeUdO_fM.js → OpenGrid-sI_vdHQw.js} +2 -2
- package/dist/Registry-CPJYOqCn.js +74 -0
- package/dist/Registry-D74ZmdDz.cjs +71 -0
- package/dist/index-B3fKi43v.js +481 -0
- package/dist/{index-JjfWY3Bt.cjs → index-D1l3XFCM.cjs} +92 -160
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid.cjs +31 -31
- package/dist/open-grid.js +86 -82
- package/dist/types/core/FilterSelect.d.ts +269 -33
- package/dist/types/core/GridShuttle.d.ts +160 -24
- package/dist/types/core/IconRegistry.d.ts +241 -33
- package/dist/types/core/OpenGrid.d.ts +2589 -327
- package/dist/types/core/OrgChart.d.ts +249 -32
- package/dist/types/core/SkinRegistry.d.ts +295 -60
- package/dist/types/core/XmlConverter.d.ts +388 -47
- package/dist/types/core/chart/types.d.ts +1008 -126
- package/dist/types/core/extension/Registry.d.ts +389 -51
- package/dist/types/core/extension/reserved.d.ts +34 -5
- package/dist/types/core/i18n/LocaleRegistry.d.ts +271 -54
- package/dist/types/core/i18n/types.d.ts +636 -85
- package/dist/types/core/types.d.ts +3576 -426
- package/dist/types/index.d.ts +226 -17
- package/package.json +3 -1
- package/dist/index-DrCPRuYi.js +0 -548
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to OPEN_GRID will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.4.0] - 2026-07-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **확장 레지스트리 공개** / **Extension registry is now public.** 커스텀 등록소를 만들 때 쓰는
|
|
9
|
+
등록 정책 엔진 `TypedRegistry` 와 예약 네임스페이스 가드를 공개 API 로 내보낸다. 구현은
|
|
10
|
+
이전부터 코어 안에 있었고, 이번에 공개 표면에 올렸다.
|
|
11
|
+
- `TypedRegistry` — 매 등록의 처리 결과를 돌려준다: `added`(신규) · `replaced`(덮어씀) ·
|
|
12
|
+
`kept`(기존 유지) · `rejected`(거부). 유지·거부에는 `reason` 이 함께 온다.
|
|
13
|
+
- `RESERVED_PREFIXES` · `isReserved` — `og:` · `og-` 는 그리드가 예약한 대역이라 외부 등록이 거부된다.
|
|
14
|
+
- `duplicatePolicy: 'protect-builtin'` — `origin: 'builtin'` 으로 등록된 항목을 나중 등록이 덮지 못하게 막는다.
|
|
15
|
+
- 타입 10종(`IRegistry`·`RegisterOptions`·`RegisterResult`·`RegisterAction`·`RegisterReason`·
|
|
16
|
+
`RegistryEntry`·`EntryOrigin`·`DuplicatePolicy`·`DeprecationInfo`·`TypedRegistryConfig`).
|
|
17
|
+
- / `TypedRegistry` returns what each registration actually did, guards the reserved `og:`/`og-`
|
|
18
|
+
namespace, and can shield built-in entries. Types are erased at runtime.
|
|
19
|
+
- **번들 영향 +80B**(gzip, ES entry 4,441→4,521B / 예산 8,000B). ES 코어 청크는 불변.
|
|
20
|
+
- **순수 additive — 기존 사용자 조치 불필요.** `OpenGrid.registerRenderer` 의 내부 등록 경로는
|
|
21
|
+
바뀌지 않았다(정책 엔진을 거치지 않는다). 기존 동작 100% 보존.
|
|
22
|
+
|
|
23
|
+
### Docs
|
|
24
|
+
- **공개 API JSDoc 4개 국어(한국어·English·日本語·中文)** — TypeDoc 이 렌더하는 공개 선언 전 파일
|
|
25
|
+
891블록. 기존의 `설명. / English.` 한 줄 병기는 문서에서 두 언어가 한 문단에 뭉쳐 나오던 문제가
|
|
26
|
+
있어 **언어별 문단 분리**로 전환했다. 코드 로직 변화 0(주석 전용).
|
|
27
|
+
/ Public API JSDoc in Korean, English, Japanese and Chinese — 891 blocks, one paragraph per
|
|
28
|
+
language (the previous single-line `ko / en` form collapsed into one rendered paragraph).
|
|
29
|
+
- **README 일본어·중국어판** 신설(`README.ja.md` · `README.zh.md`) + 원본 현행화
|
|
30
|
+
(기능표가 v0.1 시절에 머물러 있던 것을 실제 구현 현황으로 교정, 테마 12→15).
|
|
31
|
+
- 영문 JSDoc 드리프트 2건 교정(`ChartSeries.pattern` 이 "색 대신" 분기를 누락, `sampled` 설명 정리).
|
|
32
|
+
|
|
5
33
|
## [1.3.1] - 2026-07-15
|
|
6
34
|
|
|
7
35
|
### Docs
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
# OPEN_GRID
|
|
2
|
+
|
|
3
|
+
**Meet Open Grid** — **依存ゼロのコア**を持つ超軽量データグリッド。どんな技術スタックにも
|
|
4
|
+
すんなり収まります。React、Vue、Angular、jQuery、素の JavaScript — どれでもそのまま動きます。
|
|
5
|
+
MIT ライセンスなので商用利用も自由、カスタマイズに際限はなく、AI フレンドリーな override ガイドで
|
|
6
|
+
グリッドをこれまで以上に押し広げられます。
|
|
7
|
+
|
|
8
|
+
仮想スクロール・インライン編集・グルーピング・ツリービュー・ドラッグ&ドロップ・変更追跡・フッター集計・列の並べ替えを備えた、高速でフレームワーク非依存のデータグリッド。
|
|
9
|
+
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](https://www.typescriptlang.org/)
|
|
12
|
+
[](https://www.npmjs.com/package/open-grid)
|
|
13
|
+
|
|
14
|
+
[English](README.md) · **日本語** · [中文](README.zh.md)
|
|
15
|
+
|
|
16
|
+
📖 **[開発ガイド](https://foxnail.kr/open-grid/demo/v2/guide/index.php)** — インストールから高度な API まで、段階を追って解説
|
|
17
|
+
🔗 **[デモ/ホームページ](https://foxnail.kr/open-grid/demo/v2/index.php)**
|
|
18
|
+
📚 **[API ドキュメント](https://foxnail.kr/open-grid/demo/v2/api-docs/)** — 韓国語・英語・日本語・中国語の 4 言語 JSDoc
|
|
19
|
+
|
|
20
|
+
## 機能
|
|
21
|
+
|
|
22
|
+
### コア
|
|
23
|
+
|
|
24
|
+
| 機能 | 状態 |
|
|
25
|
+
|---|---|
|
|
26
|
+
| 仮想スクロール(100 万行以上) | ✅ |
|
|
27
|
+
| インライン編集(クリック/ダブルクリック/F2) | ✅ |
|
|
28
|
+
| セルレンダラー(text、number、date、checkbox、button、badge、link、template、sparkline、…) | ✅ |
|
|
29
|
+
| 5 種のセルエディター(text、number、select、date、checkbox) | ✅ |
|
|
30
|
+
| マルチソート(Shift+クリック) | ✅ |
|
|
31
|
+
| 列フィルター UI(9 種の演算子) | ✅ |
|
|
32
|
+
| 列幅リサイズ(ドラッグ) | ✅ |
|
|
33
|
+
| 列の並べ替え(ヘッダーをドラッグ、`columnReorder: true`) | ✅ |
|
|
34
|
+
| 列の固定 | ✅ |
|
|
35
|
+
| 行/列グループ(ヘッダー結合) | ✅ |
|
|
36
|
+
| グルーピング+集計(SUM/AVG/MIN/MAX/COUNT) | ✅ |
|
|
37
|
+
| ツリーグリッド(フラット → 階層、展開/折りたたみ) | ✅ |
|
|
38
|
+
| OrgChart(テーマ対応の組織図) | ✅ |
|
|
39
|
+
| セル結合(手動+自動 rowSpan/colSpan) | ✅ |
|
|
40
|
+
| 行のドラッグ&ドロップ | ✅ |
|
|
41
|
+
| 変更追跡(`getChanges` / `getChangedColumns` / `getOriginalRow`) | ✅ |
|
|
42
|
+
| フッター集計(`setFooter`、`getFooterValue`、OGDecimal による精度保証) | ✅ |
|
|
43
|
+
| データマスキング(10 種類、セル/列単位の切り替え) | ✅ |
|
|
44
|
+
| ページネーション | ✅ |
|
|
45
|
+
| Excel / CSS テーマのエクスポート | ✅ |
|
|
46
|
+
| CSV / JSON エクスポート | ✅ |
|
|
47
|
+
| クリップボード(Ctrl+C / Ctrl+V) | ✅ |
|
|
48
|
+
| キーボード操作(矢印/Tab/F2/Esc) | ✅ |
|
|
49
|
+
| コアの依存ゼロ | ✅ |
|
|
50
|
+
|
|
51
|
+
### スプレッドシート級(v1.1)
|
|
52
|
+
|
|
53
|
+
| 機能 | 状態 |
|
|
54
|
+
|---|---|
|
|
55
|
+
| 範囲選択+フィル — セル範囲のドラッグ、連続データのフィル、TSV クリップボード、Ctrl+D/R(`rangeSelection`) | ✅ |
|
|
56
|
+
| マスター/ディテール — 行を展開して HTML パネルまたはサブグリッドを表示(`masterDetail`、`expandRow`) | ✅ |
|
|
57
|
+
| 数式セル — `=B1*C1`、`=SUM(C1:C10)`、19 個の関数、`[field]`/A1 参照、`#REF`/`#CYCLE` エラー(`formula`) | ✅ |
|
|
58
|
+
| 統合チャート — グリッドのデータから棒/折れ線を描画、LTTB ダウンサンプリング+サンプリングバッジ、組み込みの canvas レンダラー(`chart`) | ✅ |
|
|
59
|
+
|
|
60
|
+
### 書式とデータ(v1.3)
|
|
61
|
+
|
|
62
|
+
| 機能 | 状態 |
|
|
63
|
+
|---|---|
|
|
64
|
+
| 条件付き書式 — データバー、ヒートマップ、アイコンセット、ルールの優先順位 | ✅ |
|
|
65
|
+
| リアルタイムデータ — バックプレッシャー対応のストリーミング/ポーリングソース | ✅ |
|
|
66
|
+
| 外観の軸 — density と texture のセッター | ✅ |
|
|
67
|
+
|
|
68
|
+
### 見た目
|
|
69
|
+
|
|
70
|
+
| 機能 | 状態 |
|
|
71
|
+
|---|---|
|
|
72
|
+
| 15 種の組み込みテーマ(dark、ocean、forest、crimson、stitch、…) | ✅ |
|
|
73
|
+
| 6 種のスキン(色とは直交する形の軸)— sharp / rounded / stitch / flat / high-contrast / material | ✅ |
|
|
74
|
+
| 64 個のロールアイコン(Bootstrap Icons、MIT)— `renderIcon`、`grid.setIcon`、`OpenGrid.defineIconSet` | ✅ |
|
|
75
|
+
| ローカライズ/i18n(組み込みの `ko`・`en`、`setLocale`、カスタムロケール) | ✅ |
|
|
76
|
+
|
|
77
|
+
### 拡張性
|
|
78
|
+
|
|
79
|
+
| 機能 | 状態 |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `grid.override(...)` — コアに手を入れずに挙動をカスタマイズ(AI フレンドリーなガイド付き) | ✅ |
|
|
82
|
+
| 拡張レジストリ — `added`/`replaced`/`kept`/`rejected` の結果を返す `TypedRegistry`、予約済み `og:` のガード、`protect-builtin` | ✅ |
|
|
83
|
+
| Vue 3 コンポーネント | ✅ |
|
|
84
|
+
| React 18 コンポーネント | ✅ |
|
|
85
|
+
|
|
86
|
+
## インストール
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install open-grid
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## クイックスタート
|
|
93
|
+
|
|
94
|
+
### Vanilla JavaScript / TypeScript
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { OpenGrid } from 'open-grid';
|
|
98
|
+
import 'open-grid/style.css';
|
|
99
|
+
|
|
100
|
+
const grid = new OpenGrid('#container', {
|
|
101
|
+
columns: [
|
|
102
|
+
{ field: 'name', header: '이름', width: 120 },
|
|
103
|
+
{ field: 'price', header: '금액', width: 100, type: 'number', align: 'right' },
|
|
104
|
+
{ field: 'date', header: '날짜', width: 110, type: 'date' },
|
|
105
|
+
],
|
|
106
|
+
editable: true,
|
|
107
|
+
sortable: true,
|
|
108
|
+
rowNumber: true,
|
|
109
|
+
height: 500,
|
|
110
|
+
|
|
111
|
+
onReady: (g) => g.setData(myData),
|
|
112
|
+
onCellClick: (e) => console.log(e.field, e.value),
|
|
113
|
+
onEditEnd: (e) => console.log(e.oldValue, '→', e.newValue),
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Vue 3
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<template>
|
|
121
|
+
<OpenGrid
|
|
122
|
+
:columns="columns"
|
|
123
|
+
:data="rows"
|
|
124
|
+
:editable="true"
|
|
125
|
+
:sortable="true"
|
|
126
|
+
:height="500"
|
|
127
|
+
@cell-click="onCellClick"
|
|
128
|
+
@edit-end="onEditEnd"
|
|
129
|
+
@update:data="rows = $event"
|
|
130
|
+
/>
|
|
131
|
+
</template>
|
|
132
|
+
|
|
133
|
+
<script setup lang="ts">
|
|
134
|
+
import { ref } from 'vue';
|
|
135
|
+
import { OpenGrid } from 'open-grid/vue';
|
|
136
|
+
import 'open-grid/style.css';
|
|
137
|
+
|
|
138
|
+
const columns = [
|
|
139
|
+
{ field: 'name', header: '이름', width: 120 },
|
|
140
|
+
{ field: 'price', header: '금액', width: 100, type: 'number', align: 'right' },
|
|
141
|
+
];
|
|
142
|
+
const rows = ref(myData);
|
|
143
|
+
</script>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### React 18
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
import { OpenGrid } from 'open-grid/react';
|
|
150
|
+
import 'open-grid/style.css';
|
|
151
|
+
|
|
152
|
+
function App() {
|
|
153
|
+
const [data, setData] = useState(myData);
|
|
154
|
+
const gridRef = useRef(null);
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<OpenGrid
|
|
158
|
+
columns={columns}
|
|
159
|
+
data={data}
|
|
160
|
+
editable sortable
|
|
161
|
+
height={500}
|
|
162
|
+
onReady={(g) => { gridRef.current = g; }}
|
|
163
|
+
onDataChange={setData}
|
|
164
|
+
/>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## API リファレンス
|
|
170
|
+
|
|
171
|
+
### コンストラクター
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
new OpenGrid(container: string | HTMLElement, options: GridOptions)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### データ API
|
|
178
|
+
|
|
179
|
+
| メソッド | 説明 |
|
|
180
|
+
|---|---|
|
|
181
|
+
| `setData(data)` | データの設定。 |
|
|
182
|
+
| `getData()` | 現在表示中のデータを返す。 |
|
|
183
|
+
| `insertRow(item, position?)` | 行の追加(`'first'` / `'last'` / インデックス)。 |
|
|
184
|
+
| `deleteRow(rowIndex)` | 行の削除(ソフトデリート)。 |
|
|
185
|
+
| `pushRow(items)` | 末尾に行を追加。 |
|
|
186
|
+
| `unshiftRow(items)` | 先頭に行を追加。 |
|
|
187
|
+
| `readCell(rowIndex, field)` | セル値の読み取り。 |
|
|
188
|
+
| `writeCell(rowIndex, field, value)` | セル値の書き込み。 |
|
|
189
|
+
| `reorderRow(from, to)` | 行の順序を移動。 |
|
|
190
|
+
|
|
191
|
+
### 変更追跡 API(v0.1.2)
|
|
192
|
+
|
|
193
|
+
| メソッド | 説明 |
|
|
194
|
+
|---|---|
|
|
195
|
+
| `getChanges()` | `{ added, edited, removed }` をまとめて返す。edited の行には `_changedFields` を含む。 |
|
|
196
|
+
| `getEditedRows()` | 修正された行のみを返す。 |
|
|
197
|
+
| `getAddedRows()` | 追加された行を返す。 |
|
|
198
|
+
| `getRemovedRows()` | 削除された行を返す。 |
|
|
199
|
+
| `getChangedColumns()` | `{ row, fields, diff[] }` — 列単位の diff(oldValue/newValue)。 |
|
|
200
|
+
| `getOriginalRow(rowIndex)` | 修正前の元の行データを返す。 |
|
|
201
|
+
|
|
202
|
+
### フッター/小計 API(v0.1.2)
|
|
203
|
+
|
|
204
|
+
| メソッド | 説明 |
|
|
205
|
+
|---|---|
|
|
206
|
+
| `setFooter(FooterDef[])` | フッター集計の設定(SUM/AVG/MIN/MAX/COUNT、colspan、format)。 |
|
|
207
|
+
| `getFooterValue(field)` | 特定フィールドの集計結果を取得。 |
|
|
208
|
+
| `getFooterData()` | フッター集計データ全体を配列で返す。 |
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
grid.setFooter([
|
|
212
|
+
{ label: '합계', colspan: 2, align: 'left' },
|
|
213
|
+
{ field: 'salary', op: 'SUM', format: '#,##0', align: 'right' },
|
|
214
|
+
{ field: 'rate', op: 'SUM', format: '#,##0.00', align: 'right' }, // OGDecimal 정밀계산
|
|
215
|
+
{ field: 'score', op: 'AVG', format: '#,##0.0', align: 'right' },
|
|
216
|
+
]);
|
|
217
|
+
|
|
218
|
+
const total = grid.getFooterValue('salary'); // 숫자 반환
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### 列並べ替え API(v0.1.1)
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
const grid = new OpenGrid('#container', {
|
|
225
|
+
columns,
|
|
226
|
+
columnReorder: true, // 헤더 드래그 활성화
|
|
227
|
+
onColumnReorder: ({ fromIndex, toIndex, field }) => {
|
|
228
|
+
console.log(`컬럼 이동: ${fromIndex} → ${toIndex} (${field})`);
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
grid.applyColumns([...originalColumns]); // 원래 순서로 복원
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### ソート/フィルター
|
|
236
|
+
|
|
237
|
+
| メソッド | 説明 |
|
|
238
|
+
|---|---|
|
|
239
|
+
| `orderBy(field, dir?)` | ソート。 |
|
|
240
|
+
| `resetOrder()` | ソートの初期化。 |
|
|
241
|
+
| `setFilter(field, items)` | フィルターの設定。 |
|
|
242
|
+
| `resetFilter(field?)` | フィルターの初期化。 |
|
|
243
|
+
|
|
244
|
+
### グルーピング
|
|
245
|
+
|
|
246
|
+
| メソッド | 説明 |
|
|
247
|
+
|---|---|
|
|
248
|
+
| `groupBy(fields[])` | グループの設定。 |
|
|
249
|
+
| `clearGroup()` | グループの解除。 |
|
|
250
|
+
| `expandAll()` | すべて展開。 |
|
|
251
|
+
| `collapseAll()` | すべて折りたたみ。 |
|
|
252
|
+
|
|
253
|
+
### ツリーグリッド
|
|
254
|
+
|
|
255
|
+
| メソッド | 説明 |
|
|
256
|
+
|---|---|
|
|
257
|
+
| `enableTree()` | ツリーモードの有効化。 |
|
|
258
|
+
| `disableTree()` | ツリーモードの無効化。 |
|
|
259
|
+
| `expandNodes(ids, open?)` | 特定ノードの展開/折りたたみ。 |
|
|
260
|
+
| `expandAllNodes()` | すべて展開。 |
|
|
261
|
+
| `collapseAllNodes()` | すべて折りたたみ。 |
|
|
262
|
+
|
|
263
|
+
### セル結合
|
|
264
|
+
|
|
265
|
+
| メソッド | 説明 |
|
|
266
|
+
|---|---|
|
|
267
|
+
| `mergeCells(cells)` | 手動結合 `[{row, col, rowSpan?, colSpan?}]`。 |
|
|
268
|
+
| `autoMerge(fields[])` | 連続する同じ値を自動で rowSpan。 |
|
|
269
|
+
| `clearMerge()` | 結合の解除。 |
|
|
270
|
+
|
|
271
|
+
### エクスポート
|
|
272
|
+
|
|
273
|
+
| メソッド | 説明 |
|
|
274
|
+
|---|---|
|
|
275
|
+
| `exportExcel(options?)` | Excel(.xlsx)の書き出し。 |
|
|
276
|
+
| `exportCsv(options?)` | CSV の書き出し。 |
|
|
277
|
+
| `exportJson(options?)` | JSON の書き出し。 |
|
|
278
|
+
|
|
279
|
+
### UI
|
|
280
|
+
|
|
281
|
+
| メソッド | 説明 |
|
|
282
|
+
|---|---|
|
|
283
|
+
| `jumpToRow(rowIndex)` | 特定の行までスクロール。 |
|
|
284
|
+
| `setTheme(theme)` | テーマの変更(`'default'` / `'dark'`)。 |
|
|
285
|
+
| `resize(w?, h?)` | サイズの調整。 |
|
|
286
|
+
| `destroy()` | インスタンスの破棄。 |
|
|
287
|
+
|
|
288
|
+
## GridOptions
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
interface GridOptions {
|
|
292
|
+
columns: ColumnDef[]; // 컬럼 정의 (필수)
|
|
293
|
+
height?: number | string; // 그리드 높이 (기본: '100%')
|
|
294
|
+
width?: number | string; // 그리드 너비 (기본: '100%')
|
|
295
|
+
editable?: boolean; // 인라인 편집 활성화
|
|
296
|
+
editMode?: 'click' | 'dblclick'; // 편집 진입 방식
|
|
297
|
+
sortable?: boolean; // 정렬 활성화
|
|
298
|
+
multiSort?: boolean; // 멀티소트 (Shift+클릭)
|
|
299
|
+
filterable?: boolean; // 필터 UI 활성화
|
|
300
|
+
rowNumber?: boolean; // 행 번호 컬럼
|
|
301
|
+
checkColumn?: boolean; // 체크박스 컬럼
|
|
302
|
+
stateColumn?: boolean; // 상태 표시 컬럼 (✚/✎/✖)
|
|
303
|
+
frozenColumns?: number; // 고정 컬럼 수
|
|
304
|
+
selection?: 'single' | 'multiple' | 'row';
|
|
305
|
+
clipboard?: boolean; // Ctrl+C/V 클립보드
|
|
306
|
+
draggable?: boolean; // 행 드래그앤드롭
|
|
307
|
+
pagination?: boolean; // 페이징 UI
|
|
308
|
+
pageSize?: number; // 페이지당 행 수
|
|
309
|
+
treeId?: string; // 트리 id 필드명 (기본: 'id')
|
|
310
|
+
treeParentId?: string; // 트리 parentId 필드명 (기본: 'parentId')
|
|
311
|
+
expandOnLoad?: boolean; // 트리 초기 전체 펼침
|
|
312
|
+
summary?: SummaryOptions; // 그룹 소계 설정
|
|
313
|
+
theme?: 'default' | 'dark';
|
|
314
|
+
defaultSort?: SortItem[]; // 초기 정렬
|
|
315
|
+
|
|
316
|
+
// 이벤트 콜백
|
|
317
|
+
onReady?: (grid: OpenGridInstance) => void;
|
|
318
|
+
onCellClick?: (e: CellEvent) => void;
|
|
319
|
+
onCellDblClick?: (e: CellEvent) => void;
|
|
320
|
+
onRowClick?: (e: RowEvent) => void;
|
|
321
|
+
onEditStart?: (e: EditEvent) => void;
|
|
322
|
+
onEditEnd?: (e: EditEvent) => void;
|
|
323
|
+
onSortChange?: (e: SortEvent) => void;
|
|
324
|
+
onFilterChange?: (e: FilterEvent) => void;
|
|
325
|
+
onDataChange?: (data: any[]) => void;
|
|
326
|
+
onSelectionChange?: (e: SelectionEvent) => void;
|
|
327
|
+
onRowDrop?: (e: { fromIndex: number; toIndex: number }) => void;
|
|
328
|
+
onPageChange?: (e: PageEvent) => void;
|
|
329
|
+
// v0.1.1+
|
|
330
|
+
columnReorder?: boolean; // 헤더 드래그 컬럼 순서 변경
|
|
331
|
+
onColumnReorder?: (e: { fromIndex: number; toIndex: number; field: string }) => void;
|
|
332
|
+
// v0.1.2+
|
|
333
|
+
footer?: FooterDef[]; // 초기 푸터 설정
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## ColumnDef
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
interface ColumnDef {
|
|
341
|
+
field: string; // 데이터 필드명 (필수)
|
|
342
|
+
header?: string; // 헤더 텍스트
|
|
343
|
+
width?: number; // 컬럼 너비 (px)
|
|
344
|
+
type?: 'text' | 'number' | 'date' | 'checkbox' | 'button' | 'badge' | 'link' | 'template';
|
|
345
|
+
align?: 'left' | 'center' | 'right';
|
|
346
|
+
editable?: boolean | ((row, rowIndex) => boolean);
|
|
347
|
+
sortable?: boolean;
|
|
348
|
+
filterable?: boolean;
|
|
349
|
+
resizable?: boolean;
|
|
350
|
+
hidden?: boolean;
|
|
351
|
+
format?: string; // 숫자 포맷 (예: '#,##0')
|
|
352
|
+
children?: ColumnDef[]; // 그룹 헤더
|
|
353
|
+
cellStyle?: CSSProperties | ((value, row, rowIndex) => CSSProperties);
|
|
354
|
+
renderer?: (ctx: RenderContext) => HTMLElement;
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## パフォーマンス
|
|
359
|
+
|
|
360
|
+
10 万行を対象としたベンチマーク結果です。
|
|
361
|
+
|
|
362
|
+
| 処理 | 時間 |
|
|
363
|
+
|---|---|
|
|
364
|
+
| データ生成 | ~65ms |
|
|
365
|
+
| setData() | ~30ms |
|
|
366
|
+
| applySort(単一) | ~38ms |
|
|
367
|
+
| applySort(マルチ) | ~40ms |
|
|
368
|
+
| applyFilter | ~17ms |
|
|
369
|
+
| buildGroups | ~3ms |
|
|
370
|
+
| buildTree | ~25ms |
|
|
371
|
+
|
|
372
|
+
## CSS カスタマイズ
|
|
373
|
+
|
|
374
|
+
CSS 変数でテーマを完全にカスタマイズできます。
|
|
375
|
+
|
|
376
|
+
```css
|
|
377
|
+
.og-container {
|
|
378
|
+
--og-primary: #1976d2;
|
|
379
|
+
--og-header-bg: #f5f5f5;
|
|
380
|
+
--og-row-bg: #ffffff;
|
|
381
|
+
--og-row-alt-bg: #fafafa;
|
|
382
|
+
--og-row-selected-bg: #bbdefb;
|
|
383
|
+
--og-border-color: #e0e0e0;
|
|
384
|
+
--og-font-size: 13px;
|
|
385
|
+
--og-group-bg: #e8eaf6;
|
|
386
|
+
--og-tree-toggle-color: #1976d2;
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## ローカライズ(i18n)
|
|
391
|
+
|
|
392
|
+
組み込み UI の文字列 — ラベル、`aria-label`、ライブリージョンのアナウンス、ツールチップ、
|
|
393
|
+
プレースホルダー — はすべて、コアから切り離した差し替え可能なロケールカタログに置いています。
|
|
394
|
+
**`ko`(既定)と `en`** を同梱します。既存アプリへの影響はありません。`locale`/`messages` オプションを
|
|
395
|
+
指定しなければ、出力は従来とバイト単位で同一です。
|
|
396
|
+
|
|
397
|
+
```ts
|
|
398
|
+
import { OpenGrid, localeRegistry } from 'open-grid';
|
|
399
|
+
|
|
400
|
+
// 1) Pick a built-in locale per instance
|
|
401
|
+
const grid = new OpenGrid(el, { columns, locale: 'en' });
|
|
402
|
+
|
|
403
|
+
// 2) Switch at runtime (re-labels chrome, updates the `lang` attribute, emits `localeChange`)
|
|
404
|
+
grid.setLocale('ko');
|
|
405
|
+
|
|
406
|
+
// 3) Override just a few messages for one instance
|
|
407
|
+
new OpenGrid(el, { locale: 'en', messages: { contextMenu: { sortAsc: 'Sort A→Z' } } });
|
|
408
|
+
|
|
409
|
+
// 4) Register a custom locale globally (partial dictionaries are fine — missing keys fall back)
|
|
410
|
+
localeRegistry.register('ja', { contextMenu: { find: '検索' }, pagination: { rowsPerPage: '行/ページ:' } });
|
|
411
|
+
new OpenGrid(el, { locale: 'ja' });
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
フォールバックの流れ: インスタンスの上書き → 有効なロケール → `ko`(完全なカタログ) → 生のキー。
|
|
415
|
+
数値・日付の書式と開発者向けのエラーメッセージは、意図的に対象外としています
|
|
416
|
+
(書式は `Intl` を使い、ログは grep で追える形のまま保ちます)。キーの全リファレンスは
|
|
417
|
+
[ローカライズガイド](https://foxnail.kr/open-grid/demo/v2/guide/index.php) をご覧ください。
|
|
418
|
+
|
|
419
|
+
## 変更履歴
|
|
420
|
+
|
|
421
|
+
リリースの全履歴は [`CHANGELOG.md`](CHANGELOG.md) をご覧ください。
|
|
422
|
+
|
|
423
|
+
最近の主なトピック:
|
|
424
|
+
|
|
425
|
+
- **1.4.0** — 拡張レジストリを公開(`TypedRegistry`、予約ネームスペースのガード)。
|
|
426
|
+
公開 API の JSDoc を韓国語・英語・日本語・中国語の 4 言語に。
|
|
427
|
+
- **1.3.1** — 公開 API の JSDoc を人が読んで分かる形に書き直し(コメントのみ、ロジックの変更なし)。
|
|
428
|
+
- **1.3.0** — 条件付き書式、統合チャートのサブシステム、リアルタイムデータソース、
|
|
429
|
+
外観の軸(density/texture)。
|
|
430
|
+
- **1.2.0** — ロケールリソースを分離した国際化対応(`LocaleRegistry`)。
|
|
431
|
+
- **1.1.0** — 範囲選択+フィル、マスター/ディテール、数式セル、統合チャート。
|
|
432
|
+
- **1.0.0** — `grid.override()` によるカスタマイズ面。
|
|
433
|
+
|
|
434
|
+
## ライセンス
|
|
435
|
+
|
|
436
|
+
MIT © OPEN_GRID Contributors
|
|
437
|
+
|
|
438
|
+
### ランタイム依存ゼロ(Excel 出力はそのまま動きます)
|
|
439
|
+
|
|
440
|
+
`npm install open-grid` が引き込む**外部ランタイム依存はありません**。グリッドのコアは
|
|
441
|
+
完全に自己完結しています。
|
|
442
|
+
|
|
443
|
+
**Excel エクスポートは追加インストールなしで、そのまま動きます。** これは SheetJS
|
|
444
|
+
(`xlsx-js-style`)を使っており、**パッケージの中(`dist/` 配下)にバンドル済み**で、実際に
|
|
445
|
+
エクスポートするときだけオンデマンドで読み込まれます。`xlsx`/`xlsx-js-style` をプロジェクトに
|
|
446
|
+
追加する必要は**ありません** — OPEN_GRID の中に同梱されています。(`devDependencies` に載っているのは、
|
|
447
|
+
バンドルを*ビルドする*ために必要だからであって、*使う*ために必要だからではありません。)
|
|
448
|
+
|
|
449
|
+
### サードパーティライセンス
|
|
450
|
+
|
|
451
|
+
同梱の Excel エクスポートは **SheetJS Community Edition(`xlsx`)** と
|
|
452
|
+
**`xlsx-js-style`** を使用しており、いずれも **Apache License, Version 2.0** の下で
|
|
453
|
+
ライセンスされています(© SheetJS LLC、およびスタイル版フォークについては Brent Ely)。
|
|
454
|
+
これらの attribution notice とライセンス全文は [`NOTICE`](NOTICE) と
|
|
455
|
+
[`THIRD_PARTY_LICENSES.txt`](THIRD_PARTY_LICENSES.txt) に収録しています。
|
|
456
|
+
|
|
457
|
+
> **1.0.2 以降**、この `NOTICE` と `THIRD_PARTY_LICENSES.txt` は、同梱コンポーネントに対する
|
|
458
|
+
> Apache-2.0 の attribution 要件を満たすため、公開パッケージの中に同梱して配布しています。
|
|
459
|
+
> これにより、以前のリリース(1.0.1 以下)にあったライセンスコンプライアンス上の潜在的な
|
|
460
|
+
> 不備 — MIT ライセンスのみを同梱し、必要な Apache-2.0 の notice を欠いていた点 — を解消しました。
|
|
461
|
+
> OPEN_GRID 自身の MIT ライセンスに変更はありません。MIT と Apache-2.0 は互換性があるため、
|
|
462
|
+
> これは attribution の修正のみです。詳細は [`CHANGELOG.md`](CHANGELOG.md) をご覧ください。
|
package/README.md
CHANGED
|
@@ -9,18 +9,23 @@ High-performance, framework-agnostic data grid with virtual scrolling, inline ed
|
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
[](https://www.typescriptlang.org/)
|
|
12
|
-
[](https://www.npmjs.com/package/open-grid)
|
|
13
|
+
|
|
14
|
+
**English** · [日本語](README.ja.md) · [中文](README.zh.md)
|
|
13
15
|
|
|
14
16
|
📖 **[개발 가이드](https://foxnail.kr/open-grid/demo/v2/guide/index.php)** — 설치부터 고급 API까지 단계별 가이드
|
|
15
17
|
🔗 **[데모/홈페이지](https://foxnail.kr/open-grid/demo/v2/index.php)**
|
|
18
|
+
📚 **[API 문서](https://foxnail.kr/open-grid/demo/v2/api-docs/)** — 한·영·일·중 4개 국어 JSDoc
|
|
16
19
|
|
|
17
20
|
## Features
|
|
18
21
|
|
|
22
|
+
### Core
|
|
23
|
+
|
|
19
24
|
| Feature | Status |
|
|
20
25
|
|---|---|
|
|
21
|
-
| Virtual Scroll (
|
|
26
|
+
| Virtual Scroll (1M+ rows) | ✅ |
|
|
22
27
|
| Inline Editing (click / dblclick / F2) | ✅ |
|
|
23
|
-
|
|
|
28
|
+
| Cell Renderers (text, number, date, checkbox, button, badge, link, template, sparkline, …) | ✅ |
|
|
24
29
|
| 5 Cell Editors (text, number, select, date, checkbox) | ✅ |
|
|
25
30
|
| Multi-sort (Shift+click) | ✅ |
|
|
26
31
|
| Column Filter UI (9 operators) | ✅ |
|
|
@@ -28,7 +33,6 @@ High-performance, framework-agnostic data grid with virtual scrolling, inline ed
|
|
|
28
33
|
| Column Reorder (drag header, `columnReorder: true`) | ✅ |
|
|
29
34
|
| Frozen Columns | ✅ |
|
|
30
35
|
| Row/Column Groups (header merge) | ✅ |
|
|
31
|
-
| Localization / i18n (built-in `ko`·`en`, `setLocale`, custom locales) | ✅ |
|
|
32
36
|
| Grouping + Summary (SUM/AVG/MIN/MAX/COUNT) | ✅ |
|
|
33
37
|
| Tree Grid (flat → hierarchy, expand/collapse) | ✅ |
|
|
34
38
|
| OrgChart (organization chart with theme) | ✅ |
|
|
@@ -42,10 +46,42 @@ High-performance, framework-agnostic data grid with virtual scrolling, inline ed
|
|
|
42
46
|
| CSV / JSON Export | ✅ |
|
|
43
47
|
| Clipboard (Ctrl+C / Ctrl+V) | ✅ |
|
|
44
48
|
| Keyboard Navigation (Arrow / Tab / F2 / Esc) | ✅ |
|
|
45
|
-
|
|
|
49
|
+
| Zero core dependencies | ✅ |
|
|
50
|
+
|
|
51
|
+
### Spreadsheet-grade (v1.1)
|
|
52
|
+
|
|
53
|
+
| Feature | Status |
|
|
54
|
+
|---|---|
|
|
55
|
+
| Range Selection + Fill — drag a cell range, series fill, TSV clipboard, Ctrl+D/R (`rangeSelection`) | ✅ |
|
|
56
|
+
| Master/Detail — expand a row into an HTML panel or a subgrid (`masterDetail`, `expandRow`) | ✅ |
|
|
57
|
+
| Formula Cells — `=B1*C1`, `=SUM(C1:C10)`, 19 functions, `[field]`/A1 refs, `#REF`/`#CYCLE` errors (`formula`) | ✅ |
|
|
58
|
+
| Integrated Chart — draw bar/line from grid data, LTTB downsampling + sampling badge, built-in canvas renderer (`chart`) | ✅ |
|
|
59
|
+
|
|
60
|
+
### Formatting & data (v1.3)
|
|
61
|
+
|
|
62
|
+
| Feature | Status |
|
|
63
|
+
|---|---|
|
|
64
|
+
| Conditional Formatting — data bars, heatmap, icon sets, rule priority | ✅ |
|
|
65
|
+
| Realtime Data — streaming / polling sources with backpressure | ✅ |
|
|
66
|
+
| Appearance Axes — density & texture setters | ✅ |
|
|
67
|
+
|
|
68
|
+
### Look & feel
|
|
69
|
+
|
|
70
|
+
| Feature | Status |
|
|
71
|
+
|---|---|
|
|
72
|
+
| 15 Built-in Themes (dark, ocean, forest, crimson, stitch, …) | ✅ |
|
|
73
|
+
| 6 Skins (form axis, orthogonal to color) — sharp / rounded / stitch / flat / high-contrast / material | ✅ |
|
|
74
|
+
| 64 Role Icons (Bootstrap Icons, MIT) — `renderIcon`, `grid.setIcon`, `OpenGrid.defineIconSet` | ✅ |
|
|
75
|
+
| Localization / i18n (built-in `ko`·`en`, `setLocale`, custom locales) | ✅ |
|
|
76
|
+
|
|
77
|
+
### Extensibility
|
|
78
|
+
|
|
79
|
+
| Feature | Status |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `grid.override(...)` — customize behavior without touching the core (AI-friendly guide) | ✅ |
|
|
82
|
+
| Extension Registry — `TypedRegistry` with `added`/`replaced`/`kept`/`rejected` outcomes, reserved `og:` guard, `protect-builtin` | ✅ |
|
|
46
83
|
| Vue 3 Component | ✅ |
|
|
47
84
|
| React 18 Component | ✅ |
|
|
48
|
-
| Zero core dependencies | ✅ |
|
|
49
85
|
|
|
50
86
|
## Installation
|
|
51
87
|
|
|
@@ -381,20 +417,18 @@ Number/date formatting and developer-facing error messages are intentionally out
|
|
|
381
417
|
|
|
382
418
|
## Changelog
|
|
383
419
|
|
|
384
|
-
|
|
385
|
-
- 변경 추적 API: `getChanges()` / `getEditedRows()` / `getChangedColumns()` / `getOriginalRow()`
|
|
386
|
-
- 합계/소계 푸터: `setFooter()` / `getFooterValue()` / `getFooterData()` — OGDecimal 정밀계산 (0.1×10=1.00)
|
|
387
|
-
- 개발 가이드 28챕터 완성 (Ch26 변경 추적, Ch27 합계/소계, Ch28 컬럼 리오더)
|
|
388
|
-
- 5프레임워크 예제(Vanilla/Vue/React/jQuery/Angular)에 변경 추적 + 합계/소계 섹션 추가
|
|
389
|
-
- E2E 테스트 `sprint30.spec.ts` 18개 추가
|
|
420
|
+
See [`CHANGELOG.md`](CHANGELOG.md) for the full release history.
|
|
390
421
|
|
|
391
|
-
|
|
392
|
-
- 컬럼 드래그 리오더: `columnReorder: true` / `onColumnReorder` 이벤트
|
|
393
|
-
- 개발 가이드 24챕터 → 27챕터 확장 (Ch22 마스킹, Ch23 조직도, Ch24 페이지네이션, Ch25 키보드)
|
|
394
|
-
- Sprint 29 E2E 25개 추가
|
|
422
|
+
Recent highlights:
|
|
395
423
|
|
|
396
|
-
|
|
397
|
-
|
|
424
|
+
- **1.4.0** — Extension registry made public (`TypedRegistry`, reserved-namespace guard);
|
|
425
|
+
public API JSDoc in Korean, English, Japanese and Chinese.
|
|
426
|
+
- **1.3.1** — Public API JSDoc rewritten to be human-readable (comments only, no logic change).
|
|
427
|
+
- **1.3.0** — Conditional formatting, integrated chart subsystem, realtime data sources,
|
|
428
|
+
appearance axes (density/texture).
|
|
429
|
+
- **1.2.0** — Internationalization with separated locale resources (`LocaleRegistry`).
|
|
430
|
+
- **1.1.0** — Range selection + fill, master/detail, formula cells, integrated chart.
|
|
431
|
+
- **1.0.0** — `grid.override()` customization surface.
|
|
398
432
|
|
|
399
433
|
## License
|
|
400
434
|
|