open-grid 0.4.0 → 1.0.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/dist/OpenGrid-C6SK6VeK.cjs +90 -0
- package/dist/OpenGrid-C6SK6VeK.cjs.map +1 -0
- package/dist/OpenGrid-D7EJOVi1.js +4864 -0
- package/dist/OpenGrid-D7EJOVi1.js.map +1 -0
- 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 +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/types/core/CellEditManager.d.ts +2 -3
- package/dist/types/core/CellEventHandler.d.ts +4 -5
- package/dist/types/core/CellTypeRegistry.d.ts +1 -2
- package/dist/types/core/ColumnLayout.d.ts +1 -2
- package/dist/types/core/ContextMenu.d.ts +1 -2
- package/dist/types/core/CrossGridRegistry.d.ts +1 -2
- package/dist/types/core/DataLayer.d.ts +4 -2
- package/dist/types/core/ExportManager.d.ts +4 -3
- package/dist/types/core/FilterPanel.d.ts +1 -2
- package/dist/types/core/FilterSelect.d.ts +1 -2
- package/dist/types/core/FindBarManager.d.ts +4 -5
- package/dist/types/core/FooterManager.d.ts +2 -1
- package/dist/types/core/FormulaEngine.d.ts +1 -2
- package/dist/types/core/GridRenderer.d.ts +3 -2
- package/dist/types/core/GridShuttle.d.ts +1 -2
- package/dist/types/core/GroupEngine.d.ts +7 -4
- package/dist/types/core/GroupTreeManager.d.ts +6 -3
- package/dist/types/core/KeyboardManager.d.ts +4 -5
- package/dist/types/core/OpenGrid.d.ts +27 -4
- package/dist/types/core/OverrideKernel.d.ts +70 -0
- package/dist/types/core/PivotEngine.d.ts +1 -2
- package/dist/types/core/RowManager.d.ts +0 -1
- package/dist/types/core/SortFilterManager.d.ts +5 -6
- package/dist/types/core/TriggerManager.d.ts +1 -2
- package/dist/types/core/WorksheetManager.d.ts +1 -2
- package/dist/types/core/editors/CellEditor.d.ts +2 -3
- package/dist/types/core/editors/DateEditor.d.ts +2 -3
- package/dist/types/core/editors/SelectEditor.d.ts +2 -3
- package/dist/types/core/renderers/CellRenderer.d.ts +4 -4
- package/dist/types/core/types.d.ts +58 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/react/OpenGrid.d.ts +3 -3
- package/dist/types/vue/types.d.ts +1 -2
- package/package.json +99 -99
- package/dist/OpenGrid-ClmeIJYR.cjs +0 -88
- package/dist/OpenGrid-ClmeIJYR.cjs.map +0 -1
- package/dist/OpenGrid-doS5aFVl.js +0 -4669
- package/dist/OpenGrid-doS5aFVl.js.map +0 -1
|
@@ -157,6 +157,12 @@ export interface ColumnDef<T = any> {
|
|
|
157
157
|
frozen?: boolean;
|
|
158
158
|
/** 셀 줄바꿈: true 면 nowrap+ellipsis 대신 여러 줄로 표시(rowHeight 확대와 함께 사용) */
|
|
159
159
|
wrap?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* 헤더(컬럼 머리글) 줄바꿈: true 면 헤더 텍스트가 잘리지 않고 여러 줄로 줄바꿈된다.
|
|
162
|
+
* (셀 본문용 wrap 과 별개로 헤더에만 적용. header 문자열의 '\n' 은 headerWrap 여부와 무관하게 항상 줄바꿈됨)
|
|
163
|
+
* 줄바꿈된 헤더에 맞춰 헤더 행 높이가 자동으로 늘어난다.
|
|
164
|
+
*/
|
|
165
|
+
headerWrap?: boolean;
|
|
160
166
|
colSpan?: boolean | ((row: T, rowIndex: number) => boolean);
|
|
161
167
|
rowSpan?: boolean;
|
|
162
168
|
children?: ColumnDef<T>[];
|
|
@@ -319,6 +325,7 @@ export interface GridOptions<T = any> {
|
|
|
319
325
|
worksheets?: WorksheetDef[];
|
|
320
326
|
calcPrecision?: number;
|
|
321
327
|
columnReorder?: boolean;
|
|
328
|
+
overrideStrict?: boolean;
|
|
322
329
|
onReady?: (grid: OpenGridInstance<T>) => void;
|
|
323
330
|
onCellClick?: (e: CellEvent<T>) => void;
|
|
324
331
|
onCellDblClick?: (e: CellEvent<T>) => void;
|
|
@@ -364,7 +371,58 @@ export interface GridOptions<T = any> {
|
|
|
364
371
|
onCellKeyUp?: (e: CellKeyEvent<T>) => void;
|
|
365
372
|
onCellKeyPress?: (e: CellKeyEvent<T>) => void;
|
|
366
373
|
}
|
|
374
|
+
/** override 레이어 함수: 첫 인자는 안쪽(원본 근접) 함수. orig(...) 호출이 super 처럼 동작. */
|
|
375
|
+
export type OverrideLayerFn = (orig: (...args: any[]) => any, ...args: any[]) => any;
|
|
376
|
+
export interface OverrideCallOptions {
|
|
377
|
+
/** 동일 메서드 재진입 허용(정당한 재귀). 기본 false. */
|
|
378
|
+
reentrant?: boolean;
|
|
379
|
+
/** 'fallback' → 레이어 예외 시 경고 후 원본 실행(멱등 가정, 롤백 불가). 미지정 시 strict. */
|
|
380
|
+
onError?: 'fallback';
|
|
381
|
+
}
|
|
382
|
+
/** 등록 가능한 알고리즘 슬롯 이름(6종). */
|
|
383
|
+
export type StrategySlot = 'sortComparator' | 'filterPredicate' | 'displayFormatter' | 'cellSerializer' | 'groupKeyFn' | 'summaryOp';
|
|
384
|
+
/** 단일키 정렬 비교자. dir 부호는 호출자(DataLayer)가 적용 — 슬롯은 비교만 반환. */
|
|
385
|
+
export type SortComparatorFn = (a: any, b: any, field: string, dir: 'asc' | 'desc') => number;
|
|
386
|
+
/** 필터 술어. true → 행 포함. */
|
|
387
|
+
export type FilterPredicateFn = (value: any, fi: FilterItem, field: string) => boolean;
|
|
388
|
+
/** 표시값 포맷. getDisplayValue(인스턴스 안전) + 렌더러(formatNumber/formatDate) 공유. */
|
|
389
|
+
export type DisplayFormatterFn = (value: any, field: string, row: any) => string;
|
|
390
|
+
/** export 셀 직렬화. */
|
|
391
|
+
export type CellSerializerFn = (value: any, col: any, row: any) => any;
|
|
392
|
+
/** 그룹 키 산출. remainingFields = 현재 깊이부터의 잔여 필드. */
|
|
393
|
+
export type GroupKeyFn = (row: any, remainingFields: string[]) => any;
|
|
394
|
+
/** 집계 연산. null 반환 시 기본 SUM/AVG/COUNT/MAX/MIN 분기로 폴백. */
|
|
395
|
+
export type SummaryOpFn = (op: string, nums: any[], field: string) => number | null;
|
|
396
|
+
/** 슬롯명 → 시그니처 매핑. */
|
|
397
|
+
export interface StrategyMap {
|
|
398
|
+
sortComparator: SortComparatorFn;
|
|
399
|
+
filterPredicate: FilterPredicateFn;
|
|
400
|
+
displayFormatter: DisplayFormatterFn;
|
|
401
|
+
cellSerializer: CellSerializerFn;
|
|
402
|
+
groupKeyFn: GroupKeyFn;
|
|
403
|
+
summaryOp: SummaryOpFn;
|
|
404
|
+
}
|
|
405
|
+
/** 호출가능 + .strategy 멤버를 가진 하이브리드 override API. */
|
|
406
|
+
export interface OverrideApi<T = any> {
|
|
407
|
+
/** 메서드 본문 무수정 런타임 래핑(C1-clean). 체이닝 위해 grid 인스턴스 반환. */
|
|
408
|
+
(name: string, fn: OverrideLayerFn, opts?: OverrideCallOptions): OpenGridInstance<T>;
|
|
409
|
+
/** 알고리즘 슬롯 등록(Phase 2 매니저 훅포인트). 체이닝 위해 grid 인스턴스 반환. */
|
|
410
|
+
strategy<K extends StrategySlot>(slot: K, fn: StrategyMap[K]): OpenGridInstance<T>;
|
|
411
|
+
strategy(slot: string, fn: Function): OpenGridInstance<T>;
|
|
412
|
+
}
|
|
367
413
|
export interface OpenGridInstance<T = any> {
|
|
414
|
+
/** 공개 메서드를 런타임 래핑하거나(.override) 알고리즘 슬롯을 등록(.strategy). */
|
|
415
|
+
override: OverrideApi<T>;
|
|
416
|
+
/** 단일 메서드 원본 복구. */
|
|
417
|
+
restore(name: string): OpenGridInstance<T>;
|
|
418
|
+
/** 전체 override + strategy 복구(destroy 시 자동). */
|
|
419
|
+
restoreAll(): OpenGridInstance<T>;
|
|
420
|
+
/** 해당 메서드가 override 되어 있는지. */
|
|
421
|
+
hasOverride(name: string): boolean;
|
|
422
|
+
/** override 등록된 메서드 이름 목록. */
|
|
423
|
+
getOverrideNames(): string[];
|
|
424
|
+
/** strategy 슬롯 조회(미등록 시 fallback 반환). 매니저 read API. */
|
|
425
|
+
getStrategy<F extends Function>(slot: string, fallback: F): F;
|
|
368
426
|
setData(data: T[]): void;
|
|
369
427
|
getData(): T[];
|
|
370
428
|
getSourceRows(): T[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GridOptions, ColumnDef, OpenGridInstance } from '../core/types.js';
|
|
3
|
-
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import type { GridOptions, ColumnDef, OpenGridInstance } from '../core/types.js';
|
|
3
|
+
import '../styles/base.css';
|
|
4
4
|
export interface OpenGridProps<T extends Record<string, any> = any> {
|
|
5
5
|
data?: T[];
|
|
6
6
|
columns: ColumnDef<T>[];
|
package/package.json
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "open-grid",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "High-performance, framework-agnostic data grid with Vue 3 and React 18 support",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/open-grid.cjs",
|
|
7
|
-
"module": "dist/open-grid.js",
|
|
8
|
-
"types": "dist/types/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/open-grid.js",
|
|
12
|
-
"require": "./dist/open-grid.cjs",
|
|
13
|
-
"types": "./dist/types/index.d.ts"
|
|
14
|
-
},
|
|
15
|
-
"./vue": {
|
|
16
|
-
"import": "./dist/open-grid-vue.js",
|
|
17
|
-
"require": "./dist/open-grid-vue.cjs",
|
|
18
|
-
"types": "./dist/types/vue/index.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"./react": {
|
|
21
|
-
"import": "./dist/open-grid-react.js",
|
|
22
|
-
"require": "./dist/open-grid-react.cjs",
|
|
23
|
-
"types": "./dist/types/react/index.d.ts"
|
|
24
|
-
},
|
|
25
|
-
"./style.css": "./dist/style.css"
|
|
26
|
-
},
|
|
27
|
-
"files": [
|
|
28
|
-
"dist",
|
|
29
|
-
"README.md",
|
|
30
|
-
"LICENSE"
|
|
31
|
-
],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"dev": "vite",
|
|
34
|
-
"build": "tsc && vite build",
|
|
35
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
36
|
-
"test": "vitest run",
|
|
37
|
-
"test:watch": "vitest",
|
|
38
|
-
"test:coverage": "vitest run --coverage",
|
|
39
|
-
"test:e2e": "playwright test",
|
|
40
|
-
"lint": "eslint src --ext .ts,.tsx,.vue",
|
|
41
|
-
"preview": "vite preview",
|
|
42
|
-
"build:deploy": "vite build --config vite.config.deploy.ts",
|
|
43
|
-
"obfuscate": "node scripts/obfuscate.mjs",
|
|
44
|
-
"deploy": "npm run build && npm run build:deploy && npm run obfuscate"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"react": ">=18.0.0",
|
|
48
|
-
"react-dom": ">=18.0.0",
|
|
49
|
-
"vue": ">=3.0.0"
|
|
50
|
-
},
|
|
51
|
-
"peerDependenciesMeta": {
|
|
52
|
-
"react": {
|
|
53
|
-
"optional": true
|
|
54
|
-
},
|
|
55
|
-
"react-dom": {
|
|
56
|
-
"optional": true
|
|
57
|
-
},
|
|
58
|
-
"vue": {
|
|
59
|
-
"optional": true
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"@playwright/test": "^1.44.0",
|
|
64
|
-
"@types/react": "^18.3.0",
|
|
65
|
-
"@types/react-dom": "^18.3.0",
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
67
|
-
"@typescript-eslint/parser": "^7.0.0",
|
|
68
|
-
"@vitejs/plugin-react": "^4.3.0",
|
|
69
|
-
"@vitejs/plugin-vue": "^5.0.0",
|
|
70
|
-
"@vitest/coverage-v8": "^1.6.1",
|
|
71
|
-
"eslint": "^9.0.0",
|
|
72
|
-
"javascript-obfuscator": "^5.4.3",
|
|
73
|
-
"jsdom": "^29.1.1",
|
|
74
|
-
"react": "^18.3.0",
|
|
75
|
-
"react-dom": "^18.3.0",
|
|
76
|
-
"typescript": "^5.4.0",
|
|
77
|
-
"vite": "^5.2.0",
|
|
78
|
-
"vite-plugin-dts": "^3.9.0",
|
|
79
|
-
"vitest": "^1.6.0",
|
|
80
|
-
"vue": "^3.4.0"
|
|
81
|
-
},
|
|
82
|
-
"dependencies": {
|
|
83
|
-
"xlsx": "^0.18.5",
|
|
84
|
-
"xlsx-js-style": "^1.2.0"
|
|
85
|
-
},
|
|
86
|
-
"keywords": [
|
|
87
|
-
"grid",
|
|
88
|
-
"datagrid",
|
|
89
|
-
"table",
|
|
90
|
-
"vue",
|
|
91
|
-
"react",
|
|
92
|
-
"typescript",
|
|
93
|
-
"virtual-scroll",
|
|
94
|
-
"editable"
|
|
95
|
-
],
|
|
96
|
-
"license": "MIT",
|
|
97
|
-
"author": "OPEN_GRID Contributors",
|
|
98
|
-
"homepage": "https://foxnail.kr/open-grid/demo/v2/index.php"
|
|
99
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "open-grid",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "High-performance, framework-agnostic data grid with Vue 3 and React 18 support",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/open-grid.cjs",
|
|
7
|
+
"module": "dist/open-grid.js",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/open-grid.js",
|
|
12
|
+
"require": "./dist/open-grid.cjs",
|
|
13
|
+
"types": "./dist/types/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./vue": {
|
|
16
|
+
"import": "./dist/open-grid-vue.js",
|
|
17
|
+
"require": "./dist/open-grid-vue.cjs",
|
|
18
|
+
"types": "./dist/types/vue/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./react": {
|
|
21
|
+
"import": "./dist/open-grid-react.js",
|
|
22
|
+
"require": "./dist/open-grid-react.cjs",
|
|
23
|
+
"types": "./dist/types/react/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./style.css": "./dist/style.css"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "vite",
|
|
34
|
+
"build": "tsc && vite build",
|
|
35
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest",
|
|
38
|
+
"test:coverage": "vitest run --coverage",
|
|
39
|
+
"test:e2e": "playwright test",
|
|
40
|
+
"lint": "eslint src --ext .ts,.tsx,.vue",
|
|
41
|
+
"preview": "vite preview",
|
|
42
|
+
"build:deploy": "vite build --config vite.config.deploy.ts",
|
|
43
|
+
"obfuscate": "node scripts/obfuscate.mjs",
|
|
44
|
+
"deploy": "npm run build && npm run build:deploy && npm run obfuscate"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": ">=18.0.0",
|
|
48
|
+
"react-dom": ">=18.0.0",
|
|
49
|
+
"vue": ">=3.0.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"react": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"react-dom": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"vue": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@playwright/test": "^1.44.0",
|
|
64
|
+
"@types/react": "^18.3.0",
|
|
65
|
+
"@types/react-dom": "^18.3.0",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
67
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
68
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
69
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
70
|
+
"@vitest/coverage-v8": "^1.6.1",
|
|
71
|
+
"eslint": "^9.0.0",
|
|
72
|
+
"javascript-obfuscator": "^5.4.3",
|
|
73
|
+
"jsdom": "^29.1.1",
|
|
74
|
+
"react": "^18.3.0",
|
|
75
|
+
"react-dom": "^18.3.0",
|
|
76
|
+
"typescript": "^5.4.0",
|
|
77
|
+
"vite": "^5.2.0",
|
|
78
|
+
"vite-plugin-dts": "^3.9.0",
|
|
79
|
+
"vitest": "^1.6.0",
|
|
80
|
+
"vue": "^3.4.0"
|
|
81
|
+
},
|
|
82
|
+
"dependencies": {
|
|
83
|
+
"xlsx": "^0.18.5",
|
|
84
|
+
"xlsx-js-style": "^1.2.0"
|
|
85
|
+
},
|
|
86
|
+
"keywords": [
|
|
87
|
+
"grid",
|
|
88
|
+
"datagrid",
|
|
89
|
+
"table",
|
|
90
|
+
"vue",
|
|
91
|
+
"react",
|
|
92
|
+
"typescript",
|
|
93
|
+
"virtual-scroll",
|
|
94
|
+
"editable"
|
|
95
|
+
],
|
|
96
|
+
"license": "MIT",
|
|
97
|
+
"author": "OPEN_GRID Contributors",
|
|
98
|
+
"homepage": "https://foxnail.kr/open-grid/demo/v2/index.php"
|
|
99
|
+
}
|