open-grid 1.0.8 → 1.1.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 +44 -0
- package/THIRD_PARTY_LICENSES.txt +43 -0
- package/dist/OpenGrid-LcZ5iixx.cjs +97 -0
- package/dist/OpenGrid-yg4mw6Ge.js +9505 -0
- package/dist/open-grid-base.css +66 -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-themes.css +96 -1
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid.cjs +3 -3
- package/dist/open-grid.js +129 -119
- package/dist/types/core/AppearanceResolver.d.ts +100 -0
- package/dist/types/core/CellEditManager.d.ts +4 -0
- package/dist/types/core/CellEventHandler.d.ts +6 -0
- package/dist/types/core/ChartManager.d.ts +58 -0
- package/dist/types/core/CrossGridController.d.ts +70 -0
- package/dist/types/core/DataLayer.d.ts +17 -0
- package/dist/types/core/DetailManager.d.ts +72 -0
- package/dist/types/core/ExtensionPointRegistry.d.ts +92 -0
- package/dist/types/core/FlatRowModel.d.ts +56 -0
- package/dist/types/core/FormulaController.d.ts +79 -0
- package/dist/types/core/GridComposer.d.ts +137 -0
- package/dist/types/core/GridRenderer.d.ts +73 -4
- package/dist/types/core/GroupTreeManager.d.ts +13 -0
- package/dist/types/core/IconRegistry.d.ts +55 -0
- package/dist/types/core/KeyboardManager.d.ts +19 -0
- package/dist/types/core/MutationService.d.ts +126 -0
- package/dist/types/core/OpenGrid.d.ts +167 -22
- package/dist/types/core/OrgChart.d.ts +2 -0
- package/dist/types/core/RangeSelectionManager.d.ts +95 -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/chart/CanvasAdapter.d.ts +52 -0
- package/dist/types/core/chart/DataExtractor.d.ts +49 -0
- package/dist/types/core/chart/a11y.d.ts +21 -0
- package/dist/types/core/chart/downsample.d.ts +25 -0
- package/dist/types/core/chart/hittest.d.ts +20 -0
- package/dist/types/core/chart/palette.d.ts +56 -0
- package/dist/types/core/chart/scales.d.ts +24 -0
- package/dist/types/core/chart/types.d.ts +181 -0
- package/dist/types/core/detail/DetailGlyph.d.ts +48 -0
- package/dist/types/core/detail/DetailSplice.d.ts +67 -0
- package/dist/types/core/detail/DetailState.d.ts +67 -0
- package/dist/types/core/detail/SubgridCache.d.ts +73 -0
- package/dist/types/core/detail/index.d.ts +14 -0
- package/dist/types/core/editors/CellEditor.d.ts +17 -1
- package/dist/types/core/formula/FormulaEvaluator.d.ts +15 -0
- package/dist/types/core/formula/FormulaGraph.d.ts +43 -0
- package/dist/types/core/formula/FormulaParser.d.ts +6 -0
- package/dist/types/core/formula/FormulaStore.d.ts +17 -0
- package/dist/types/core/formula/RecalcCoordinator.d.ts +85 -0
- package/dist/types/core/formula/normalizeRefs.d.ts +15 -0
- package/dist/types/core/formula/numericLiteral.d.ts +7 -0
- package/dist/types/core/formula/serializeFormula.d.ts +6 -0
- package/dist/types/core/formula/types.d.ts +104 -0
- package/dist/types/core/icons/bootstrap-icons.d.ts +9 -0
- package/dist/types/core/range/ClipboardCodec.d.ts +30 -0
- package/dist/types/core/range/FillEngine.d.ts +63 -0
- package/dist/types/core/range/RangeModel.d.ts +53 -0
- package/dist/types/core/range/RangeQuery.d.ts +16 -0
- package/dist/types/core/range/types.d.ts +47 -0
- package/dist/types/core/renderers/CellRenderer.d.ts +40 -2
- package/dist/types/core/types.d.ts +285 -3
- package/dist/types/index.d.ts +6 -1
- package/package.json +1 -1
- package/dist/OpenGrid-CZRcxruq.cjs +0 -90
- package/dist/OpenGrid-Cjv7Os5a.js +0 -4871
|
@@ -11,6 +11,19 @@ export interface GroupTreeDeps<T extends Record<string, any>> {
|
|
|
11
11
|
doRender: () => void;
|
|
12
12
|
/** Phase 2: OverrideKernel.getStrategy 주입(슬롯 groupKeyFn 도달용). */
|
|
13
13
|
getStrategy?: <F extends Function>(slot: string, fallback: F) => F;
|
|
14
|
+
/**
|
|
15
|
+
* Phase 0(C0.3): FlatRowModel 의 baseline backing 등록점. group/tree 진입 시 자기
|
|
16
|
+
* flat 배열(`_groupFlatRows`/`_treeFlatRows`)로 교체하고, 해제 시 null(plain 복귀)로 되돌린다.
|
|
17
|
+
*/
|
|
18
|
+
setFlatBacking: (provider: (() => Array<any>) | null) => void;
|
|
19
|
+
/**
|
|
20
|
+
* F2(11_design_F2_v2.md §3.2 R3 "flat 소유 경합" 해소): setFlatBacking 직후 이 값을 조회해
|
|
21
|
+
* VirtualScroll.setTotalRows/doRenderFull 에 넘긴다. FlatRowModel.count() 는 방금 교체한
|
|
22
|
+
* backing 위에 DetailManager 가 등록한 detail splice 까지 합성한 "최종" 총 행수이므로,
|
|
23
|
+
* GroupTreeManager 는 자기 배열 길이(`_groupFlatRows.length` 등)를 직접 쓰지 않는다
|
|
24
|
+
* (detail 활성 시 그 값은 실제보다 작아 스크롤/렌더 범위가 잘린다).
|
|
25
|
+
*/
|
|
26
|
+
getFlatCount: () => number;
|
|
14
27
|
}
|
|
15
28
|
export declare class GroupTreeManager<T extends Record<string, any> = any> {
|
|
16
29
|
private _groupFields;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** render() 옵션. size 미지정 시 svg 는 viewBox/CSS 로 크기를 상속(width/height 속성 생략). */
|
|
2
|
+
export interface IconRenderOptions {
|
|
3
|
+
/** px 정사각 크기(width=height). 미지정 시 속성 생략(CSS/컨테이너가 결정). */
|
|
4
|
+
size?: number;
|
|
5
|
+
/** 접근성 제목. 지정 시 <title> + role="img" 추가(스크린리더). 미지정 시 장식용(부모가 aria 담당). */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** true → SVGElement(DOMParser) 반환. 기본 false → SVG 마크업 문자열. */
|
|
8
|
+
el?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 시맨틱 ROLE → 아이콘 key(`BOOTSTRAP_ICONS` 의 symbolId) 기본 매핑.
|
|
12
|
+
* 렌더 코드는 이 역할 이름만 참조한다. key 교체는 이 표(혹은 register/setIcon)만 고치면 된다.
|
|
13
|
+
* 참고 스왑: `row.delete`→`trash3`(Bootstrap 의 표준 휴지통, task 의 'trash' 동족), `chart.line`→`graph-up`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_ICON_ROLES: Readonly<Record<string, string>>;
|
|
16
|
+
/**
|
|
17
|
+
* IconRegistry — role → 글리프 본문(inner SVG markup) 해석 + svg 래핑.
|
|
18
|
+
*
|
|
19
|
+
* 저장 단위는 **글리프 본문 문자열**(<path>/<g> 마크업). register(role, svgOrKey) 는
|
|
20
|
+
* - svgOrKey 가 `BOOTSTRAP_ICONS` 의 알려진 key 면 그 본문으로,
|
|
21
|
+
* - 아니면 **원시 SVG 본문**(사용자 커스텀 <path…>)으로 저장한다.
|
|
22
|
+
* 부모 체인(_parent)으로 per-instance 오버라이드 레지스트리를 전역 위에 얹는다(멀티그리드 격리).
|
|
23
|
+
*/
|
|
24
|
+
export declare class IconRegistry {
|
|
25
|
+
private _roles;
|
|
26
|
+
private _parent;
|
|
27
|
+
constructor(seed?: Readonly<Record<string, string>>, parent?: IconRegistry);
|
|
28
|
+
/**
|
|
29
|
+
* role 에 글리프를 등록/교체. svgOrKey 가 알려진 아이콘 key 면 그 본문을, 아니면 원시 SVG
|
|
30
|
+
* 본문 마크업으로 간주한다(코어 편집 없이 아이콘 교체 — OCP).
|
|
31
|
+
*/
|
|
32
|
+
register(role: string, svgOrKey: string): this;
|
|
33
|
+
/** role 이 (자신 또는 부모 체인에) 등록돼 있는가. */
|
|
34
|
+
has(role: string): boolean;
|
|
35
|
+
/** role → 글리프 본문(inner markup). 미등록이면 null(부모 체인까지 조회). */
|
|
36
|
+
resolveBody(role: string): string | null;
|
|
37
|
+
/** 이 레지스트리를 부모로 하는 자식(per-instance 오버라이드용) 생성. */
|
|
38
|
+
child(): IconRegistry;
|
|
39
|
+
/**
|
|
40
|
+
* role 을 `<svg viewBox=ICON_VIEWBOX>` 로 렌더. 기본 반환은 SVG 마크업 문자열(innerHTML 용);
|
|
41
|
+
* opts.el 이면 SVGElement. 미지원 role 은 빈 svg 폴백(never throw).
|
|
42
|
+
* 스킨 토큰: fill=currentColor(presentation attr) + stroke-linejoin=var(--og-icon-corner,miter).
|
|
43
|
+
*/
|
|
44
|
+
render(role: string, opts?: IconRenderOptions): string | SVGElement;
|
|
45
|
+
/** 등록된 role 목록(자신만, 디버깅/테스트용). */
|
|
46
|
+
roles(): string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 프로세스 공유 기본 아이콘 레지스트리(시맨틱 role 시드 완료).
|
|
50
|
+
* CellRenderer 등 팩토리 생성 렌더러(인스턴스 컨텍스트 없음)가 이 초크포인트로 아이콘을 얻는다.
|
|
51
|
+
* per-instance 교체는 `grid.setIcon()`(이 레지스트리의 child) 로, 전역 확장은 `defineIconSet()` 로.
|
|
52
|
+
*/
|
|
53
|
+
export declare const iconRegistry: IconRegistry;
|
|
54
|
+
/** 편의 정적 render — 공유 기본 레지스트리로 위임(`IconRegistry.render(role, opts)`). */
|
|
55
|
+
export declare function renderIcon(role: string, opts?: IconRenderOptions): string | SVGElement;
|
|
@@ -2,6 +2,18 @@ import { DataLayer } from './DataLayer.js';
|
|
|
2
2
|
import { ColumnLayout } from './ColumnLayout.js';
|
|
3
3
|
import { CellEditManager } from './CellEditManager.js';
|
|
4
4
|
import { RowManager } from './RowManager.js';
|
|
5
|
+
/** F1 범위 선택 배선 훅(M-3/M-4/M-5) — RangeSelectionManager 가 그대로 구현한다. */
|
|
6
|
+
export interface RangeKeyboardHooks {
|
|
7
|
+
isEnabled(): boolean;
|
|
8
|
+
hasSelection(): boolean;
|
|
9
|
+
extendFocus(dir: 'up' | 'down' | 'left' | 'right'): void;
|
|
10
|
+
ctrlFill(axis: 'down' | 'right'): void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
/** 범위 없으면 null(호출측이 기존 focusCell/selectedRows 경로로 폴백) */
|
|
13
|
+
copyText(): string | null;
|
|
14
|
+
/** true = 배치 경유로 처리함, false = 범위 없음(폴백) */
|
|
15
|
+
pasteText(text: string): boolean;
|
|
16
|
+
}
|
|
5
17
|
export interface KeyboardDeps<T extends Record<string, any>> {
|
|
6
18
|
getEditMgr: () => CellEditManager<T>;
|
|
7
19
|
getRowMgr: () => RowManager<T>;
|
|
@@ -15,6 +27,13 @@ export interface KeyboardDeps<T extends Record<string, any>> {
|
|
|
15
27
|
emit: (event: string, ...args: any[]) => void;
|
|
16
28
|
visRange: () => [number, number];
|
|
17
29
|
handleCellKeyEvt: (eventName: 'cellKeyDown' | 'cellKeyUp' | 'cellKeyPress', e: KeyboardEvent) => void;
|
|
30
|
+
/** M-4: 붙여넣기 쓰기 퍼널을 writeCell(배치)로 교체(CON-2, 의도적 동작 변경) */
|
|
31
|
+
writeCells?: (patches: Array<{
|
|
32
|
+
rowIndex: number;
|
|
33
|
+
field: string;
|
|
34
|
+
value: any;
|
|
35
|
+
}>) => number;
|
|
36
|
+
getRangeHooks?: () => RangeKeyboardHooks | null;
|
|
18
37
|
}
|
|
19
38
|
export declare class KeyboardManager<T extends Record<string, any> = any> {
|
|
20
39
|
private _d;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { DataLayer } from './DataLayer.js';
|
|
2
|
+
import { FlatRowModel } from './FlatRowModel.js';
|
|
3
|
+
import { VirtualScroll } from './VirtualScroll.js';
|
|
4
|
+
import { Pagination } from './Pagination.js';
|
|
5
|
+
import { ColumnLayout } from './ColumnLayout.js';
|
|
6
|
+
import { RowManager } from './RowManager.js';
|
|
7
|
+
import { GroupTreeManager } from './GroupTreeManager.js';
|
|
8
|
+
import { TriggerManager } from './TriggerManager.js';
|
|
9
|
+
import { GridOptions, Position } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* R4(§3.4, R-9a/R-9b): 모든 데이터 변경의 mutate→render→emit 꼬리를 단일 초크포인트
|
|
12
|
+
* `commit(spec)` 로 수렴시키기 위한 명시 데이터계약(CommitSpec DTO). 각 mutator 의
|
|
13
|
+
* **관측 가능한 발화 순서 차이는 정규화 대상이 아니라 이 필드들로 인코딩**한다
|
|
14
|
+
* (R-9c 회귀0: R0 골든 `mutation-event-sequence.test.ts` 순서 보존).
|
|
15
|
+
*
|
|
16
|
+
* - `totals` : VS/Pagination 행수 갱신. 'count'=현재 행수(insert/delete/push/unshift),
|
|
17
|
+
* 'zero'=0(clearData). 생략=미갱신(writeCell/setData — 행수 불변 or 인라인 처리).
|
|
18
|
+
* - `renderMode` : 'sync-window'=`_doRender(...visRange)`(insert/delete/write/endBatch),
|
|
19
|
+
* 'full'=`_doRender(0,-1)`(clearData),
|
|
20
|
+
* 'async-vs'=명령형 렌더 없음. setData 는 setTotalRows/rebuild 로 VS 가
|
|
21
|
+
* rAF 스케줄(비동기)하므로 `commit` 은 동기 `_doRender` 를 **하지 않는다**.
|
|
22
|
+
* - `emitBeforeRender` : true=emit 을 render 앞에(writeCell/endBatch — 현행 순서), 기본 false=render 먼저(insert/delete).
|
|
23
|
+
* - `emitPayload` : `emit('dataChange', …)` 페이로드 지연 평가(thunk). getData() 시점을
|
|
24
|
+
* 현행과 동일(render 뒤 or 앞)하게 유지 + 명시 onDataChange 재호출 시 2회 평가 보존.
|
|
25
|
+
* - `fireOnDataChangeExplicitly` : true=`_options.onDataChange?.()` 를 **명시 재호출**(bound listener 와 합쳐 DOUBLE-fire).
|
|
26
|
+
* row mutator=true, setData/clearData=false(bound listener 로 ONCE).
|
|
27
|
+
* - `flushFormula` : true=emit 전에 `_flushFormulaRecalc()`(writeCell/endBatch).
|
|
28
|
+
* - `preRender` : render 직전 훅(deleteRow 의 removedRowId invalidate 루프).
|
|
29
|
+
* - `coalescable` : true 인 커밋만 배치 개구 중 render/emit 을 no-op 하고 `_batchDirty` 를 세운다.
|
|
30
|
+
* **writeCell 만 원래 배치를 감지**했으므로 나머지 mutator(coalescable 생략)는
|
|
31
|
+
* 배치 안에서도 즉시 렌더(현행 보존 — 배치 게이트를 전 mutator 로 확대하지 않는다).
|
|
32
|
+
*/
|
|
33
|
+
export interface CommitSpec {
|
|
34
|
+
totals?: 'count' | 'zero';
|
|
35
|
+
renderMode: 'sync-window' | 'full' | 'async-vs';
|
|
36
|
+
emitBeforeRender?: boolean;
|
|
37
|
+
emitPayload: () => any;
|
|
38
|
+
fireOnDataChangeExplicitly?: boolean;
|
|
39
|
+
flushFormula?: boolean;
|
|
40
|
+
preRender?: () => void;
|
|
41
|
+
coalescable?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* R6(§3.1 C5, §6-R6): 데이터 변경 표면(setData/insert/push/delete/writeCell/writeCells + 배치 API)
|
|
45
|
+
* 와 R4 가 도입한 단일 커밋 초크포인트 `commit(CommitSpec)` 를 `OpenGrid` God object 에서
|
|
46
|
+
* **동작 불변**으로 옮긴 것. `OpenGrid` 는 얇은 위임 공개 메서드만 남긴다(공개 API 불변).
|
|
47
|
+
*
|
|
48
|
+
* 스트랭글러 원칙(A2): DataLayer 는 여전히 `OpenGrid` 가 소유하며, 여기에는 `*Deps`
|
|
49
|
+
* 클로저 역전 패턴으로 **주입**만 된다. **서비스는 렌더를 직접 모른다**(Yourdon I/O 분리):
|
|
50
|
+
* render 는 주입된 `doRenderWindow`/`doRenderFull` 콜백으로만 유발한다. 값(vs/pagination/recalc
|
|
51
|
+
* 등)은 늦은-null / 재할당(worksheet 전환)을 견디도록 전부 getter 클로저로 읽는다.
|
|
52
|
+
* 배치 코얼레싱(`_batchDepth`/`_batchDirty`) 시맨틱은 R4 와 1:1 동일하다(회귀 0).
|
|
53
|
+
*/
|
|
54
|
+
export interface MutationServiceDeps<T extends Record<string, any> = any> {
|
|
55
|
+
getData: () => DataLayer<T>;
|
|
56
|
+
getVs: () => VirtualScroll | null;
|
|
57
|
+
getPagination: () => Pagination | null;
|
|
58
|
+
getFlatModel: () => FlatRowModel;
|
|
59
|
+
getColLayout: () => ColumnLayout<T>;
|
|
60
|
+
getContainer: () => HTMLElement;
|
|
61
|
+
getTrigMgr: () => TriggerManager;
|
|
62
|
+
getRowMgr: () => RowManager<T>;
|
|
63
|
+
getGrpMgr: () => GroupTreeManager<T>;
|
|
64
|
+
getOptions: () => Required<GridOptions<T>>;
|
|
65
|
+
/** EventEmitter fan (this.emit) — 'dataChange'/'editEnd'/'writeCellsSkip'. */
|
|
66
|
+
emit: (event: string, payload?: any) => void;
|
|
67
|
+
/** aria-live announce (C8.1 공용 인프라). */
|
|
68
|
+
announce: (msg: string) => void;
|
|
69
|
+
/** sort/filter 재적용(setData). */
|
|
70
|
+
applyFilters: () => void;
|
|
71
|
+
/** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. */
|
|
72
|
+
flushFormula: () => void;
|
|
73
|
+
/** 현재 가시 범위 렌더(this._doRender(...this._visRange())). 서비스는 렌더 내부를 모른다. */
|
|
74
|
+
doRenderWindow: () => void;
|
|
75
|
+
/** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. */
|
|
76
|
+
doRenderFull: () => void;
|
|
77
|
+
/** setData: 수식 dirty seed clear + RecalcCoordinator 재생성(rowId 재발급 대응). */
|
|
78
|
+
resetFormulaState: () => void;
|
|
79
|
+
/** writeCell: 값이 바뀐 셀을 수식 dirty seed 로 적립(kind==='data' 일 때만). */
|
|
80
|
+
seedFormulaDirty: (rowIndex: number, field: string) => void;
|
|
81
|
+
/** deleteRow: 제거된 rowId 를 deps 로 갖는 수식들을 #REF 로 무효화(preRender). */
|
|
82
|
+
invalidateRemovedRows: (rowIds: string[]) => void;
|
|
83
|
+
/** deleteRow: 제거 전 flat index 의 안정 rowId 확보. */
|
|
84
|
+
getRowIdAt: (rowIndex: number) => string | undefined;
|
|
85
|
+
}
|
|
86
|
+
export declare class MutationService<T extends Record<string, any> = any> {
|
|
87
|
+
private _deps;
|
|
88
|
+
/** reentrant 카운터. 0 초과면 배치 중(writeCell 이 render/dataChange 를 지연). */
|
|
89
|
+
private _batchDepth;
|
|
90
|
+
/** 배치 구간 중 실제 쓰기가 1건이라도 있었는지(빈 배치는 endBatch 에서 아무 것도 안 함). */
|
|
91
|
+
private _batchDirty;
|
|
92
|
+
constructor(deps: MutationServiceDeps<T>);
|
|
93
|
+
/**
|
|
94
|
+
* R4(§3.4, R-9a): 단일 커밋 초크포인트. mutate 완료 후의 totals→(preRender)→flush→render/emit
|
|
95
|
+
* 꼬리를 여기로 수렴. **관측 순서는 spec 필드로 인코딩**(정규화 아님 — R0 골든 diff=0).
|
|
96
|
+
* 배치 코얼레싱을 내재화: `coalescable` 커밋은 배치 개구 중 render/emit 을 지연하고
|
|
97
|
+
* `_batchDirty` 만 세운다(가장 바깥 endBatch 에서 1회 flush).
|
|
98
|
+
*/
|
|
99
|
+
commit(spec: CommitSpec): void;
|
|
100
|
+
setData(data: T[]): void;
|
|
101
|
+
insertRow(item: Partial<T>, position?: Position): void;
|
|
102
|
+
pushRow(items: Partial<T> | Partial<T>[]): void;
|
|
103
|
+
deleteRow(rowIndex: number | number[]): void;
|
|
104
|
+
writeCell(rowIndex: number, field: string, value: any): void;
|
|
105
|
+
/**
|
|
106
|
+
* 배치 쓰기 시작(C2.1). 이후 writeCell 호출들은 render/dataChange 를 지연·coalesce 한다.
|
|
107
|
+
* 중첩 호출은 카운팅(reentrant) — 가장 바깥 endBatch 에서만 실제로 flush 된다.
|
|
108
|
+
*/
|
|
109
|
+
beginBatch(): void;
|
|
110
|
+
/**
|
|
111
|
+
* 배치 종료(C2.1). 카운터가 0 이 되는 시점에 한해 배치 중 발생한 쓰기가 있으면
|
|
112
|
+
* _doRender 1회 + dataChange 1회를 발생시킨다(둘 다 0회 또는 1회 — 폭주 차단).
|
|
113
|
+
*/
|
|
114
|
+
endBatch(): void;
|
|
115
|
+
/**
|
|
116
|
+
* beginBatch+루프+endBatch 래퍼(C2.1). patches 의 rowIndex 는 flat index — 대상이
|
|
117
|
+
* FlatRowModel.resolveFlatRow 로 해소해 kind!=='data' (group/tree/detail 의사행)이면
|
|
118
|
+
* 쓰기 전에 skip 한다(C0.3 쓰기 안전, filler 에 writeCell 절대 금지).
|
|
119
|
+
* 건너뛴 셀 수를 반환하고, 1건이라도 있으면 announce + 'writeCellsSkip' 이벤트로 표면화한다.
|
|
120
|
+
*/
|
|
121
|
+
writeCells(patches: Array<{
|
|
122
|
+
rowIndex: number;
|
|
123
|
+
field: string;
|
|
124
|
+
value: any;
|
|
125
|
+
}>): number;
|
|
126
|
+
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { EventEmitter } from './EventEmitter.js';
|
|
2
|
+
import { SkinTokenDelta, GridOptions, OpenGridInstance, ColumnDef, SortItem, FilterItem, ExportOptions, Position, TriggerHandler, TriggerEvent, OverrideApi, OverrideCallOptions, CellRange, RangeStats } from './types.js';
|
|
2
3
|
import { FilterSelectConfig } from './FilterSelect.js';
|
|
3
4
|
import { MergeCell } from './MergeEngine.js';
|
|
5
|
+
import { RendererFactory } from './renderers/CellRenderer.js';
|
|
6
|
+
import { EditorFactory } from './editors/CellEditor.js';
|
|
7
|
+
import { FlatRowModel } from './FlatRowModel.js';
|
|
8
|
+
import { ChartInstance } from './ChartManager.js';
|
|
9
|
+
import { ChartConfig } from './chart/types.js';
|
|
4
10
|
import { OverrideLayer } from './OverrideKernel.js';
|
|
5
|
-
import {
|
|
11
|
+
import { ExtensionPointRegistry } from './ExtensionPointRegistry.js';
|
|
12
|
+
import { FormulaErrorCode } from './formula/types.js';
|
|
6
13
|
export declare class OpenGrid<T extends Record<string, any> = any> extends EventEmitter implements OpenGridInstance<T> {
|
|
7
14
|
private _container;
|
|
8
15
|
private _options;
|
|
@@ -11,12 +18,22 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
11
18
|
private _vs;
|
|
12
19
|
private _ro;
|
|
13
20
|
private _renderer;
|
|
21
|
+
private _appearance;
|
|
22
|
+
/** R12c: per-instance 아이콘 오버라이드 레지스트리(전역 iconRegistry 의 child). 첫 setIcon 때 지연 생성. */
|
|
23
|
+
private _icons;
|
|
14
24
|
private _sfMgr;
|
|
15
25
|
private _rowMgr;
|
|
16
26
|
private _editMgr;
|
|
17
27
|
private _trigMgr;
|
|
18
28
|
private _destroyed;
|
|
19
|
-
|
|
29
|
+
/** R5(§3.1 C4): 렌더 루프 컨트롤러. `_mount` 에서 renderer/vs 배선 초입에 생성. */
|
|
30
|
+
private _render;
|
|
31
|
+
/** R6(§3.1 C5): 데이터 변경 서비스(setData/insert/push/delete/writeCell/writeCells + batch + commit). */
|
|
32
|
+
private _mutation;
|
|
33
|
+
/** R7(§3.1 C9): F3 수식 컨트롤러(accessor 조립·recalc flush·에러 표현 + 공개 수식 API). */
|
|
34
|
+
private _formula;
|
|
35
|
+
/** R7(§3.1 C8): 크로스그리드 컨트롤러(moveRowsTo/매핑/3단계 드롭 발화). */
|
|
36
|
+
private _cross;
|
|
20
37
|
private _colWidths;
|
|
21
38
|
/** 사용자가 헤더 드래그로 직접 조절한 컬럼 폭 (field 기준). _recalcWidths 가 덮어쓰지 않도록 보존 */
|
|
22
39
|
private _userWidths;
|
|
@@ -36,9 +53,25 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
36
53
|
private _findMgr;
|
|
37
54
|
private _grpMgr;
|
|
38
55
|
private _cellEvt;
|
|
56
|
+
/** F1: 범위 선택 + 채우기 핸들 배선 관리자(11_design_F1_v2.md). */
|
|
57
|
+
private _rangeMgr;
|
|
58
|
+
/** F2: 마스터/디테일 배선(11_design_F2_v2.md). 헤드리스 코어(core/detail/*)를 소비. */
|
|
59
|
+
private _detailMgr;
|
|
60
|
+
/** F4: 그리드 데이터 통합 차트 오케스트레이터(11_design_F4_v2.md). 헤드리스 chart/* 소비. */
|
|
61
|
+
private _chartMgr;
|
|
62
|
+
/** Phase 0(C0.3): flat/visual index ↔ data 리졸버. 어떤 기능도 켜지지 않아도 항상 존재. */
|
|
63
|
+
private _flatModel;
|
|
64
|
+
/** F3: 셀 수식 헤드리스 오케스트레이터(core/formula/* 소비, 재구현 아님). 항상 존재(헤드리스라 유휴 비용 0). */
|
|
65
|
+
private _recalc;
|
|
66
|
+
/** F3(C2): writeCell 단건 쓰기가 쌓아두는 dirty seed. endBatch/즉시 flush 시 onValuesChanged 1회로 소비. */
|
|
67
|
+
private _formulaDirtySeeds;
|
|
39
68
|
private _ovk;
|
|
40
69
|
/** 공개 override API (호출가능 + .strategy). 생성자 말미에 부착. */
|
|
41
70
|
override: OverrideApi<T>;
|
|
71
|
+
/** R11(§3.1 C7): 커널 위 타입드 확장점 레지스트리. _mount 초입에 생성(커널 준비 후). */
|
|
72
|
+
private _extensions;
|
|
73
|
+
/** R11: 타입드 확장점 레지스트리 정면(렌더훅 등록·strategy/override 타입드 카탈로그·MutationHook·catalog). */
|
|
74
|
+
get extensions(): ExtensionPointRegistry<T>;
|
|
42
75
|
/** 정적 전역 override 레이어 (모든 신규 인스턴스에 생성자 말미 적용). */
|
|
43
76
|
private static _defaultOverrides;
|
|
44
77
|
/** 정적 전역 strategy 슬롯. */
|
|
@@ -49,6 +82,31 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
49
82
|
static defaults: {
|
|
50
83
|
strategy(slot: string, fn: Function): typeof OpenGrid;
|
|
51
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* 커스텀 셀 렌더러 타입을 코어 편집 없이 등록. `col.type`/`col.renderer`(문자열 또는 `{type}`)가
|
|
87
|
+
* `typeName` 과 일치하면 등록 팩토리가 렌더러를 생성한다. 프로세스 전역(모든 그리드 인스턴스 공유).
|
|
88
|
+
*/
|
|
89
|
+
static registerRenderer(typeName: string, factory: RendererFactory): typeof OpenGrid;
|
|
90
|
+
/** 커스텀 셀 에디터 타입을 코어 편집 없이 등록(OCP). 프로세스 전역. */
|
|
91
|
+
static registerEditor(typeName: string, factory: EditorFactory): typeof OpenGrid;
|
|
92
|
+
/**
|
|
93
|
+
* R12b(item3 §6.2): 커스텀 스킨을 코어 편집 없이 등록(defaultOverride 와 동형의 전역 정책).
|
|
94
|
+
* FORM-only 검증(색 리터럴 거부 = 색⊥형태 직교성) + HANMS 접근성 가드레일(포커스 <2px/none 클램프)
|
|
95
|
+
* 적용 후, 런타임 `<style>` 로 `.og-container[data-og-skin="name"]` 블록을 주입한다. 이후 어떤
|
|
96
|
+
* 인스턴스도 `grid.setSkin(name)` 으로 사용. 색값이 델타에 있으면 **throw**.
|
|
97
|
+
*
|
|
98
|
+
* 예) Neumorph 는 기본 카탈로그에서 컷(HANMS §1.3)됐으나 여기서 레시피로 재현 가능:
|
|
99
|
+
* OpenGrid.defineSkin('neumorph', { '--og-radius-md':'14px', '--og-elevation-inset':'inset -4px -4px 8px', … })
|
|
100
|
+
*/
|
|
101
|
+
static defineSkin(name: string, delta: SkinTokenDelta): typeof OpenGrid;
|
|
102
|
+
/**
|
|
103
|
+
* R12c(item3 §5.1, 계약 C13): 시맨틱 아이콘 role 세트를 코어 편집 없이 **전역** 등록/교체
|
|
104
|
+
* (defineSkin/registerRenderer 와 동형의 프로세스 전역 정책). 값은 알려진 아이콘 key(`BOOTSTRAP_ICONS`)
|
|
105
|
+
* 이거나 원시 SVG 본문 마크업. 이후 모든 인스턴스의 아이콘 해석에 반영된다. per-instance 교체는
|
|
106
|
+
* `grid.setIcon(role, svg)` 참조.
|
|
107
|
+
* 예) OpenGrid.defineIconSet({ 'sort.asc': 'arrow-up', 'row.delete': '<path d="…"/>' })
|
|
108
|
+
*/
|
|
109
|
+
static defineIconSet(map: Record<string, string>): typeof OpenGrid;
|
|
52
110
|
constructor(container: string | HTMLElement, options: GridOptions<T>);
|
|
53
111
|
restore(name: string): this;
|
|
54
112
|
restoreAll(): this;
|
|
@@ -78,19 +136,15 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
78
136
|
getWorksheet(name: string): import('./types').WorksheetState<T> | undefined;
|
|
79
137
|
getWorksheetNames(): string[];
|
|
80
138
|
exportSheetsExcel(filename?: string): void;
|
|
81
|
-
private _paginationHeight;
|
|
82
139
|
private _onResize;
|
|
83
140
|
private _recalcWidths;
|
|
84
141
|
private _renderHeader;
|
|
85
|
-
/**
|
|
86
|
-
* 렌더된 헤더의 실제 높이를 측정해 본문(bodyWrap) 높이와 뷰포트 높이에 반영한다.
|
|
87
|
-
* 줄바꿈이 없는 헤더는 측정 높이가 headerHeight 이하라 기존 고정 동작과 동일하다.
|
|
88
|
-
*/
|
|
89
142
|
private _syncHeaderLayout;
|
|
90
143
|
private _doRender;
|
|
144
|
+
/** F2(§4.5/§6.1): masterDetail.enabled 아니면 undefined(GridRenderer 는 기존 경로 그대로). */
|
|
145
|
+
private _buildDetailRenderContext;
|
|
91
146
|
private _handleGroupToggle;
|
|
92
147
|
private _visRange;
|
|
93
|
-
private _visCount;
|
|
94
148
|
private _handleSortClick;
|
|
95
149
|
private _isToggleCol;
|
|
96
150
|
private _handleCellClick;
|
|
@@ -109,27 +163,13 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
109
163
|
_crossBodyEl(): HTMLElement;
|
|
110
164
|
/** fromIndex 를 잡고 드래그할 때 함께 이동할 행 집합 (다중선택에 포함되면 선택 전체) */
|
|
111
165
|
private _dragRowSet;
|
|
112
|
-
/** 드래그 드롭 어댑터 → 공개 moveRowsTo 로 위임 */
|
|
113
|
-
private _handleCrossGridDrop;
|
|
114
166
|
/**
|
|
115
167
|
* 이 그리드의 행들을 다른 그리드로 이동(move)한다. 드래그·화살표 셔틀 공통 경로.
|
|
116
168
|
* 3단계 이벤트(before→after→complete)와 crossGridMapping(필드 매핑)을 적용한다.
|
|
117
|
-
* @param targetGrid 대상 그리드
|
|
118
|
-
* @param sourceIndexes 이동할 (표시)행 인덱스들
|
|
119
|
-
* @param targetIndex 대상에서 삽입 위치 (생략 시 맨 끝에 추가)
|
|
120
|
-
* @returns 이동 성공 true, 취소/무효 false
|
|
121
169
|
*/
|
|
122
170
|
moveRowsTo(target: OpenGridInstance<T>, sourceIndexes: number[], targetIndex?: number): Promise<boolean>;
|
|
123
171
|
/** 체크된 행을 다른 그리드로 이동 (화살표 셔틀용). 체크 없으면 무시. */
|
|
124
172
|
moveCheckedTo(target: OpenGridInstance<T>): Promise<boolean>;
|
|
125
|
-
/**
|
|
126
|
-
* 크로스그리드 이동의 행 변환 함수를 결정한다.
|
|
127
|
-
* 반환: null=변환 불필요(그대로) / 함수=변환 적용 / false=매핑 모달 취소(이동 중단)
|
|
128
|
-
*/
|
|
129
|
-
private _resolveCrossTransform;
|
|
130
|
-
private _fireGridDropBefore;
|
|
131
|
-
private _fireGridDropAfter;
|
|
132
|
-
private _fireGridDropComplete;
|
|
133
173
|
/** 행을 드롭으로 이동할 때 실행된다 */
|
|
134
174
|
/** ???꾩튂 ?대룞 */
|
|
135
175
|
reorderRow(fromIndex: number, toIndex: number): void;
|
|
@@ -152,11 +192,57 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
152
192
|
/** @deprecated 하위호환 alias → unshiftRow */
|
|
153
193
|
prependRows(items: Partial<T> | Partial<T>[]): void;
|
|
154
194
|
deleteRow(rowIndex: number | number[]): void;
|
|
195
|
+
/**
|
|
196
|
+
* @deprecated no-op stub — id 기반 삭제는 미구현(본문 없음). 인덱스로 지우려면 `deleteRow(rowIndex)`
|
|
197
|
+
* 를, id→인덱스 변환은 `getFlatRowModel()`/`getData()` 조회 후 `deleteRow` 를 사용.
|
|
198
|
+
*/
|
|
155
199
|
deleteById(_ids: string[]): void;
|
|
156
200
|
readCell(rowIndex: number, field: string): any;
|
|
157
201
|
getDisplayValue(rowIndex: number, field: string): string;
|
|
158
202
|
writeCell(rowIndex: number, field: string, value: any): void;
|
|
159
203
|
getRowAt(rowIndex: number): T;
|
|
204
|
+
/** flat/visual index ↔ data 리졸버(C0.3). F1/F3/F4 는 이 모델만 경유해야 한다. */
|
|
205
|
+
getFlatRowModel(): FlatRowModel;
|
|
206
|
+
beginBatch(): void;
|
|
207
|
+
endBatch(): void;
|
|
208
|
+
setCellFormula(rowIndex: number, field: string, formula: string): void;
|
|
209
|
+
getCellFormula(rowIndex: number, field: string): string | null;
|
|
210
|
+
hasCellFormula(rowIndex: number, field: string): boolean;
|
|
211
|
+
clearCellFormula(rowIndex: number, field: string): void;
|
|
212
|
+
getCellError(rowIndex: number, field: string): FormulaErrorCode | null;
|
|
213
|
+
getDependents(rowIndex: number, field: string): Array<{
|
|
214
|
+
rowIndex: number;
|
|
215
|
+
field: string;
|
|
216
|
+
}>;
|
|
217
|
+
getPrecedents(rowIndex: number, field: string): Array<{
|
|
218
|
+
rowIndex: number;
|
|
219
|
+
field: string;
|
|
220
|
+
}>;
|
|
221
|
+
recalculate(): void;
|
|
222
|
+
recalculateCell(rowIndex: number, field: string): void;
|
|
223
|
+
/** C3(F1 fill 전용): srcRowId/srcField 수식의 상대축만 dRow/dCol 오프셋한 새 수식 원문. */
|
|
224
|
+
offsetFormula(srcRowId: string, srcField: string, dRow: number, dCol: number): string;
|
|
225
|
+
/**
|
|
226
|
+
* beginBatch+루프+endBatch 래퍼(C2.1). patches 의 rowIndex 는 flat index — 대상이
|
|
227
|
+
* FlatRowModel.resolveFlatRow 로 해소해 kind!=='data' (group/tree/detail 의사행)이면
|
|
228
|
+
* 쓰기 전에 skip 한다(C0.3 쓰기 안전, filler 에 writeCell 절대 금지).
|
|
229
|
+
* 건너뛴 셀 수를 반환하고, 1건이라도 있으면 announce + 'writeCellsSkip' 이벤트로 표면화한다.
|
|
230
|
+
*/
|
|
231
|
+
writeCells(patches: Array<{
|
|
232
|
+
rowIndex: number;
|
|
233
|
+
field: string;
|
|
234
|
+
value: any;
|
|
235
|
+
}>): number;
|
|
236
|
+
getRangeSelection(): CellRange[];
|
|
237
|
+
getActiveRange(): CellRange | null;
|
|
238
|
+
setRangeSelection(range: CellRange | CellRange[]): void;
|
|
239
|
+
clearRangeSelection(): void;
|
|
240
|
+
getRangeValues(): any[][];
|
|
241
|
+
getRangeStats(): RangeStats | null;
|
|
242
|
+
fillRange(source: CellRange, target: CellRange, mode?: 'copy' | 'series'): void;
|
|
243
|
+
createChart(config: ChartConfig): ChartInstance;
|
|
244
|
+
getCharts(): ChartInstance[];
|
|
245
|
+
destroyCharts(): void;
|
|
160
246
|
getChanges(): {
|
|
161
247
|
added: T[];
|
|
162
248
|
edited: T[];
|
|
@@ -177,8 +263,12 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
177
263
|
getRemovedRows(): T[];
|
|
178
264
|
getOriginalRow(rowIndex: number): T | undefined;
|
|
179
265
|
getRowsWithState(stateField: string): T[];
|
|
266
|
+
/** @deprecated no-op stub — undo/redo 히스토리는 미구현. 변이 가드는 TriggerManager `before:*` 훅,
|
|
267
|
+
* 변경 추적은 `getChanges()`/`getOriginalRow()` 를 사용. */
|
|
180
268
|
undo(): void;
|
|
269
|
+
/** @deprecated no-op stub — undo/redo 히스토리 미구현(위 `undo()` 참조). */
|
|
181
270
|
redo(): void;
|
|
271
|
+
/** @deprecated no-op stub — undo/redo 히스토리 자체가 없어 비울 것도 없음(위 `undo()` 참조). */
|
|
182
272
|
clearHistory(): void;
|
|
183
273
|
getColumnDefs(): ColumnDef<T>[];
|
|
184
274
|
getAllColumnDefs(): ColumnDef<T>[];
|
|
@@ -193,7 +283,10 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
193
283
|
getFieldAt(idx: number): string;
|
|
194
284
|
getColValues(field: string, _all?: boolean): any[];
|
|
195
285
|
getUniqueValues(field: string, all?: boolean): any[];
|
|
286
|
+
/** @deprecated no-op stub — 컬럼 폭 일괄 설정 미구현. 폭은 `ColumnDef.width` 또는 헤더 드래그로
|
|
287
|
+
* 지정하며 내부 `_recalcWidths` 가 자동 배분한다. */
|
|
196
288
|
setColWidths(_widths: number[]): void;
|
|
289
|
+
/** @deprecated no-op stub — 항상 빈 배열 반환(폭 계산 미구현). 자동 배분은 내부 `_recalcWidths` 담당. */
|
|
197
290
|
calcColWidths(_fitToGrid?: boolean): number[];
|
|
198
291
|
getSelections(): T[];
|
|
199
292
|
getActiveRow(): number;
|
|
@@ -204,15 +297,20 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
204
297
|
rowIndex: number;
|
|
205
298
|
}>;
|
|
206
299
|
getAllChecked(): T[];
|
|
300
|
+
/** @deprecated no-op stub — id 기반 체크 미구현. 값 기준 체크는 `checkByValue(field, values)` 사용. */
|
|
207
301
|
checkById(_ids: string[]): void;
|
|
302
|
+
/** @deprecated no-op stub — id 기반 체크 추가 미구현(위 `checkById()` 참조). `checkByValue` 사용. */
|
|
208
303
|
addCheckById(_ids: string[]): void;
|
|
209
304
|
checkByValue(field: string, values: any[]): void;
|
|
305
|
+
/** @deprecated no-op stub — id 기반 체크 해제 미구현. 전체 해제는 `uncheckAll()` 사용. */
|
|
210
306
|
uncheckById(_ids: string[]): void;
|
|
211
307
|
uncheckAll(): void;
|
|
212
308
|
orderBy(fieldOrList: string | SortItem[], dir?: 'asc' | 'desc'): void;
|
|
213
309
|
resetOrder(): void;
|
|
214
310
|
setFilter(field: string, filterItems: FilterItem[]): void;
|
|
215
311
|
resetFilter(field?: string): void;
|
|
312
|
+
/** F3-R13/MCCONNELL-03(P0): 정렬/필터 후 범위-보유(hasRangeRef) 수식 전부 dirty(§3.5). */
|
|
313
|
+
private _recalcRangeBearingFormulas;
|
|
216
314
|
getFilterState(): Record<string, FilterItem[]>;
|
|
217
315
|
restoreFilter(state: Record<string, FilterItem[]>): void;
|
|
218
316
|
private _applyFilters;
|
|
@@ -224,6 +322,7 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
224
322
|
autoMerge(fields: string[]): void;
|
|
225
323
|
/** 蹂묓빀 ?댁젣 */
|
|
226
324
|
clearMerge(): void;
|
|
325
|
+
/** @deprecated no-op stub — 행 고정(freeze rows) 미구현. 컬럼 고정만 지원하며 `freeze(n)` 사용. */
|
|
227
326
|
freezeRows(_n: number): void;
|
|
228
327
|
groupBy(fields: string[]): void;
|
|
229
328
|
clearGroup(): void;
|
|
@@ -234,6 +333,25 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
234
333
|
expandNodes(ids: any | any[], open?: boolean): void;
|
|
235
334
|
expandAllNodes(): void;
|
|
236
335
|
collapseAllNodes(): void;
|
|
336
|
+
expandRow(rowRef: number | {
|
|
337
|
+
id: string;
|
|
338
|
+
}): void;
|
|
339
|
+
collapseRow(rowRef: number | {
|
|
340
|
+
id: string;
|
|
341
|
+
}): void;
|
|
342
|
+
toggleRow(rowRef: number | {
|
|
343
|
+
id: string;
|
|
344
|
+
}): void;
|
|
345
|
+
isRowExpanded(rowRef: number | {
|
|
346
|
+
id: string;
|
|
347
|
+
}): boolean;
|
|
348
|
+
collapseAllDetails(): void;
|
|
349
|
+
getDetailInstance<D = any>(rowRef: number | {
|
|
350
|
+
id: string;
|
|
351
|
+
}): D | undefined;
|
|
352
|
+
resyncPanelWidths(): void;
|
|
353
|
+
/** @deprecated no-op stub — 부모 지정 트리행 삽입 미구현. 평면 삽입은 `insertRow(item, pos)`,
|
|
354
|
+
* 트리 구성은 `enableTree()`/`groupBy(fields)` 사용. */
|
|
237
355
|
addTreeRow(_item: Partial<T>, _pid: string, _pos?: Position): void;
|
|
238
356
|
exportExcel(options?: ExportOptions | string): void;
|
|
239
357
|
exportCsv(options?: ExportOptions | string): void;
|
|
@@ -244,6 +362,7 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
244
362
|
}): void;
|
|
245
363
|
toArray(keyValue?: boolean): any[];
|
|
246
364
|
jumpToRow(rowIndex: number): void;
|
|
365
|
+
/** @deprecated no-op stub — 특정 컬럼으로 가로 스크롤 이동 미구현. 행 이동은 `jumpToRow(rowIndex)` 사용. */
|
|
247
366
|
jumpToCol(_field: string): void;
|
|
248
367
|
getScrollPos(): {
|
|
249
368
|
x: number;
|
|
@@ -256,6 +375,32 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
256
375
|
resize(w?: number, h?: number): void;
|
|
257
376
|
setTheme(theme: string): void;
|
|
258
377
|
setThemeVar(k: string, v: string): void;
|
|
378
|
+
/**
|
|
379
|
+
* R12b: 스킨(FORM 축) 전환. data-og-skin 설정 + resolver 컨텍스트 교체 + 인라인 form 사이트 재해석.
|
|
380
|
+
* 색 테마와 직교(색 토큰 무변경). default→named 전환 시 인라인 보더가 리터럴→var() 로 승격되므로
|
|
381
|
+
* 헤더/본문을 한 번 재렌더한다(opt-in 비용). named→named/…→default 도 동일 경로로 안전.
|
|
382
|
+
*/
|
|
383
|
+
setSkin(skin: string): void;
|
|
384
|
+
/** R12b: 현재 스킨 id('default' = 오늘). */
|
|
385
|
+
getSkin(): string;
|
|
386
|
+
/**
|
|
387
|
+
* R12c(계약 C13): 이 그리드 인스턴스에 한해 시맨틱 아이콘 role 을 교체(멀티그리드 격리 —
|
|
388
|
+
* 전역 iconRegistry 를 부모로 하는 child 에만 기록). svgOrKey 는 알려진 아이콘 key 또는 원시 SVG 본문.
|
|
389
|
+
* R11 확장점과의 연결: 오버라이드를 `extensions.iconResolver` strategy 슬롯으로도 표면화해 발견가능하게 한다.
|
|
390
|
+
* 반환은 this(체이닝). 미지정 role/글리프는 안전 폴백(never throw).
|
|
391
|
+
*/
|
|
392
|
+
setIcon(role: string, svgOrKey: string): this;
|
|
393
|
+
/** R12c: 이 인스턴스의 아이콘 role 해석(오버라이드 우선, 없으면 전역). 렌더 마크업/SVGElement. */
|
|
394
|
+
renderIcon(role: string, opts?: {
|
|
395
|
+
size?: number;
|
|
396
|
+
title?: string;
|
|
397
|
+
el?: boolean;
|
|
398
|
+
}): string | SVGElement;
|
|
399
|
+
/**
|
|
400
|
+
* R12b: FORM 축 단일 토큰 런타임 오버라이드(setThemeVar 의 형태-축 형제). 컨테이너 인라인이라
|
|
401
|
+
* 스타일시트를 항상 이긴다. 색⊥형태 직교성 보호를 위해 색 값은 거부한다.
|
|
402
|
+
*/
|
|
403
|
+
setSkinVar(k: string, v: string): void;
|
|
259
404
|
addTrigger(event: TriggerEvent | string, handler: TriggerHandler): this;
|
|
260
405
|
removeTrigger(event: TriggerEvent | string, handler: TriggerHandler): this;
|
|
261
406
|
clearTriggers(event?: TriggerEvent | string): this;
|
|
@@ -25,6 +25,8 @@ export declare class OrgChart {
|
|
|
25
25
|
constructor(selector: string | HTMLElement, opts: OrgChartOptions);
|
|
26
26
|
setData(data: Record<string, any>[]): void;
|
|
27
27
|
setTheme(theme: string): void;
|
|
28
|
+
/** R12b: FORM(스킨) 축 — data-og-skin 을 자기 컨테이너에 설정(setTheme 과 동형, 색과 직교). */
|
|
29
|
+
setSkin(skin: string): void;
|
|
28
30
|
expandAll(): void;
|
|
29
31
|
collapseAll(): void;
|
|
30
32
|
private _toggle;
|