open-grid 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +30 -1
- package/dist/OpenGrid-0r_543Kj.cjs +7192 -0
- package/dist/OpenGrid-HmhGVC2V.js +7203 -0
- package/dist/open-grid-react.cjs +27 -1
- package/dist/open-grid-react.js +22 -82
- package/dist/open-grid-vue.cjs +31 -1
- package/dist/open-grid-vue.js +29 -79
- package/dist/open-grid.cjs +272 -6
- package/dist/open-grid.js +174 -260
- package/dist/types/core/CellEditManager.d.ts +75 -0
- package/dist/types/core/CellEventHandler.d.ts +99 -2
- package/dist/types/core/ChartManager.d.ts +53 -3
- package/dist/types/core/ContextMenu.d.ts +48 -3
- package/dist/types/core/CrossGridController.d.ts +86 -15
- package/dist/types/core/CrossGridRegistry.d.ts +36 -2
- package/dist/types/core/DetailManager.d.ts +108 -15
- package/dist/types/core/ExportManager.d.ts +73 -1
- package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
- package/dist/types/core/FilterPanel.d.ts +21 -3
- package/dist/types/core/FilterSelect.d.ts +41 -14
- package/dist/types/core/FindBarManager.d.ts +32 -0
- package/dist/types/core/FlatRowModel.d.ts +54 -11
- package/dist/types/core/FooterManager.d.ts +53 -1
- package/dist/types/core/FormulaController.d.ts +141 -10
- package/dist/types/core/GridComposer.d.ts +57 -4
- package/dist/types/core/GridRenderer.d.ts +3 -0
- package/dist/types/core/GridShuttle.d.ts +44 -4
- package/dist/types/core/GroupTreeManager.d.ts +86 -2
- package/dist/types/core/IconRegistry.d.ts +56 -9
- package/dist/types/core/KeyboardManager.d.ts +90 -4
- package/dist/types/core/MaskingEngine.d.ts +10 -9
- package/dist/types/core/MutationService.d.ts +115 -10
- package/dist/types/core/OpenGrid.d.ts +393 -34
- package/dist/types/core/OrgChart.d.ts +56 -1
- package/dist/types/core/OverrideKernel.d.ts +59 -15
- package/dist/types/core/Pagination.d.ts +44 -5
- package/dist/types/core/RangeSelectionManager.d.ts +123 -7
- package/dist/types/core/RenderController.d.ts +56 -0
- package/dist/types/core/RowManager.d.ts +55 -0
- package/dist/types/core/SkinRegistry.d.ts +51 -15
- package/dist/types/core/SortFilterManager.d.ts +82 -1
- package/dist/types/core/TriggerManager.d.ts +46 -0
- package/dist/types/core/WorksheetManager.d.ts +65 -3
- package/dist/types/core/XmlConverter.d.ts +56 -23
- package/dist/types/core/chart/types.d.ts +107 -10
- package/dist/types/core/detail/DetailGlyph.d.ts +3 -1
- package/dist/types/core/editors/CellEditor.d.ts +29 -2
- package/dist/types/core/formula/types.d.ts +71 -8
- package/dist/types/core/i18n/LocaleRegistry.d.ts +0 -0
- package/dist/types/core/i18n/interpolate.d.ts +5 -0
- package/dist/types/core/i18n/locales/en.d.ts +166 -0
- package/dist/types/core/i18n/locales/ko.d.ts +166 -0
- package/dist/types/core/i18n/types.d.ts +249 -0
- package/dist/types/core/range/RangeQuery.d.ts +24 -2
- package/dist/types/core/renderers/CellRenderer.d.ts +105 -8
- package/dist/types/core/types.d.ts +352 -96
- package/dist/types/index.d.ts +22 -0
- package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
- package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
- package/package.json +4 -1
- package/dist/OpenGrid-LcZ5iixx.cjs +0 -97
- package/dist/OpenGrid-yg4mw6Ge.js +0 -9505
- package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
|
@@ -1,31 +1,55 @@
|
|
|
1
1
|
import { VirtualScroll } from './VirtualScroll.js';
|
|
2
2
|
import { FlatRowModel } from './FlatRowModel.js';
|
|
3
|
-
/** expandRow/collapseRow/toggleRow/isRowExpanded/getDetailInstance 공통 인자(§6.2, C0.2).
|
|
3
|
+
/** expandRow/collapseRow/toggleRow/isRowExpanded/getDetailInstance 공통 인자(§6.2, C0.2).
|
|
4
|
+
* / Common argument shape for expandRow/collapseRow/toggleRow/isRowExpanded/getDetailInstance (§6.2, C0.2). */
|
|
4
5
|
export type DetailRowRef = number | {
|
|
5
6
|
id: string;
|
|
6
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* DetailManager 가 OpenGrid 서브시스템을 읽기 위해 주입받는 클로저 묶음. / Closures injected into
|
|
10
|
+
* DetailManager so it can read OpenGrid subsystem state without owning it directly.
|
|
11
|
+
*/
|
|
7
12
|
export interface DetailManagerDeps<T extends Record<string, any> = any> {
|
|
8
|
-
/** this._options — masterDetail.* 를 이 안에서 읽는다(옵션 자체는 항상 최신값 참조).
|
|
13
|
+
/** this._options — masterDetail.* 를 이 안에서 읽는다(옵션 자체는 항상 최신값 참조).
|
|
14
|
+
* / this._options — reads masterDetail.* from it (always the latest option values). */
|
|
9
15
|
getOptions: () => any;
|
|
10
16
|
/** Phase 0 baseline. registerSplice 로 detail splice 를 등록하고, count()/resolveFlatRow 로
|
|
11
|
-
* rowIndex↔rowId 를 해소한다(F2 는 이 모델의 "소유자"가 아니라 "등록자" — C0.3 정정).
|
|
17
|
+
* rowIndex↔rowId 를 해소한다(F2 는 이 모델의 "소유자"가 아니라 "등록자" — C0.3 정정).
|
|
18
|
+
* / Phase 0 baseline. Registers the detail splice via registerSplice, and resolves
|
|
19
|
+
* rowIndex↔rowId through count()/resolveFlatRow (F2 is a "registrant" of this model,
|
|
20
|
+
* not its "owner" — C0.3 correction). */
|
|
12
21
|
getFlatModel: () => FlatRowModel;
|
|
22
|
+
/** 가상 스크롤 인스턴스(마운트 전이면 null). / Virtual scroll instance (null before mount). */
|
|
13
23
|
getVs: () => VirtualScroll | null;
|
|
14
|
-
/** DataLayer 가 부여한 stable id 필드값(OpenGrid 의 ROW_ID_FIELD). */
|
|
24
|
+
/** DataLayer 가 부여한 stable id 필드값(OpenGrid 의 ROW_ID_FIELD). / The stable id field value assigned by DataLayer (OpenGrid's ROW_ID_FIELD). */
|
|
15
25
|
getRowId: (row: T) => string;
|
|
16
|
-
/** stable rowId → 현재 행(삭제됐으면 undefined). DataLayer.getRowById 위임. */
|
|
26
|
+
/** stable rowId → 현재 행(삭제됐으면 undefined). DataLayer.getRowById 위임. / stable rowId → current row (undefined if deleted). Delegates to DataLayer.getRowById. */
|
|
17
27
|
getRowById: (rowId: string) => T | undefined;
|
|
18
|
-
/** group/tree rebuild 와 동일한 관용구 — 전체(0..n-1) 재렌더. */
|
|
28
|
+
/** group/tree rebuild 와 동일한 관용구 — 전체(0..n-1) 재렌더. / Same idiom as group/tree rebuild — re-renders the full (0..n-1) range. */
|
|
19
29
|
doRenderFull: (n: number) => void;
|
|
30
|
+
/** 그리드 이벤트 발행. / Emit a grid event. */
|
|
20
31
|
emit: (ev: string, payload: any) => void;
|
|
32
|
+
/** aria-live 영역에 메시지를 공지. / Announce a message via the aria-live region. */
|
|
21
33
|
announce: (msg: string) => void;
|
|
22
|
-
/**
|
|
34
|
+
/** i18n: 깊이 한계/펼침·접힘 announce 메시지 해석. / i18n: resolve depth-limit & expand/collapse announces. */
|
|
35
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
36
|
+
/** 이 그리드 인스턴스의 중첩 깊이(0=최상위, 부모가 자식 생성 시 depth+1 주입). / Nesting depth of this grid instance (0 = top level; a parent injects depth+1 when creating a child). */
|
|
23
37
|
getDepth: () => number;
|
|
24
|
-
/** masterDetail.renderer 의 DetailRenderApi.grid 에 실어줄 인스턴스. */
|
|
38
|
+
/** masterDetail.renderer 의 DetailRenderApi.grid 에 실어줄 인스턴스. / Instance handed to DetailRenderApi.grid inside masterDetail.renderer. */
|
|
25
39
|
getGridInstance: () => any;
|
|
26
|
-
/** masterDetail.subgridOptions(§5 ②) 소비 — 순환 import 회피 위해 OpenGrid.ts 가 주입. */
|
|
40
|
+
/** masterDetail.subgridOptions(§5 ②) 소비 — 순환 import 회피 위해 OpenGrid.ts 가 주입. / Consumes masterDetail.subgridOptions (§5 ②) — injected by OpenGrid.ts to avoid a circular import. */
|
|
27
41
|
createSubgrid?: (host: HTMLElement, subgridOptions: any, depth: number) => any;
|
|
28
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* F2 마스터/디테일 매니저. / F2 master/detail manager.
|
|
45
|
+
*
|
|
46
|
+
* 행 펼침 상태(DetailState)를 소유하고, FlatRowModel 합성 체인 끝에 detail head/filler 의사행을
|
|
47
|
+
* 등록(registerSplice)하며, 펼쳐진 행마다 서브그리드/커스텀 렌더러 host 를 mount-once 로
|
|
48
|
+
* 생명주기 관리(SubgridCache)한다. / Owns the row expand/collapse state (DetailState), registers
|
|
49
|
+
* detail head/filler pseudo-rows at the tail of the FlatRowModel composition chain
|
|
50
|
+
* (registerSplice), and manages the mount-once lifecycle of each expanded row's
|
|
51
|
+
* subgrid/custom-renderer host (SubgridCache).
|
|
52
|
+
*/
|
|
29
53
|
export declare class DetailManager<T extends Record<string, any> = any> {
|
|
30
54
|
private _d;
|
|
31
55
|
private _state;
|
|
@@ -36,37 +60,106 @@ export declare class DetailManager<T extends Record<string, any> = any> {
|
|
|
36
60
|
private _focusPendingRestore;
|
|
37
61
|
constructor(deps: DetailManagerDeps<T>);
|
|
38
62
|
private _mdOpts;
|
|
39
|
-
/** masterDetail.enabled 여부(옵션 자체 — 펼침 개수와 무관). */
|
|
63
|
+
/** masterDetail.enabled 여부(옵션 자체 — 펼침 개수와 무관). / Whether masterDetail.enabled is set (the option itself — independent of how many rows are expanded). */
|
|
40
64
|
get enabled(): boolean;
|
|
41
|
-
/** §3.2 v2: "isActive" = 기능 on + 실제 펼침 ≥1(FlatRowModel 합성/렌더 분기 판단용).
|
|
65
|
+
/** §3.2 v2: "isActive" = 기능 on + 실제 펼침 ≥1(FlatRowModel 합성/렌더 분기 판단용).
|
|
66
|
+
* / §3.2 v2: "isActive" = feature on AND at least one row expanded (used to branch
|
|
67
|
+
* FlatRowModel composition/rendering). */
|
|
42
68
|
get isActive(): boolean;
|
|
69
|
+
/** 현재 설정된 최대 중첩 깊이. / Currently configured maximum nesting depth. */
|
|
43
70
|
get maxDepth(): number;
|
|
44
71
|
private _resolveRowId;
|
|
72
|
+
/** stable rowId 기준 펼침 여부. / Whether the row is expanded, keyed by stable rowId.
|
|
73
|
+
*
|
|
74
|
+
* @param rowId - 대상 행의 stable id / Stable id of the target row
|
|
75
|
+
* @returns 펼쳐져 있으면 true / True if the row is expanded
|
|
76
|
+
*/
|
|
45
77
|
isExpandedId(rowId: string): boolean;
|
|
78
|
+
/** rowRef(flat index 또는 stable id) 기준 펼침 여부. / Whether the row is expanded, keyed by rowRef (flat index or stable id).
|
|
79
|
+
*
|
|
80
|
+
* @param ref - flat index 또는 `{ id }` 형태의 행 참조(C0.2) / Row reference as a flat index or `{ id }` (C0.2)
|
|
81
|
+
* @returns 펼쳐져 있으면 true / True if the row is expanded
|
|
82
|
+
*/
|
|
46
83
|
isRowExpanded(ref: DetailRowRef): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* 지정 행을 펼친다. / Expand the given row.
|
|
86
|
+
*
|
|
87
|
+
* maxDepth 초과면 렌더러 진입 전에 거부하고(자식 패널 미생성) announce 로 알린다(CON-4/FR-10).
|
|
88
|
+
* / If maxDepth would be exceeded, the expansion is rejected before reaching the renderer
|
|
89
|
+
* (no child panel is created) and the rejection is announced (CON-4/FR-10).
|
|
90
|
+
*
|
|
91
|
+
* @param ref - flat index 또는 `{ id }` 형태의 행 참조 / Row reference as a flat index or `{ id }`
|
|
92
|
+
*/
|
|
47
93
|
expandRow(ref: DetailRowRef): void;
|
|
94
|
+
/**
|
|
95
|
+
* 지정 행을 접는다. / Collapse the given row.
|
|
96
|
+
*
|
|
97
|
+
* @param ref - flat index 또는 `{ id }` 형태의 행 참조 / Row reference as a flat index or `{ id }`
|
|
98
|
+
*/
|
|
48
99
|
collapseRow(ref: DetailRowRef): void;
|
|
100
|
+
/**
|
|
101
|
+
* 펼침/접힘 상태를 반전한다. / Toggle the row's expanded/collapsed state.
|
|
102
|
+
*
|
|
103
|
+
* @param ref - flat index 또는 `{ id }` 형태의 행 참조 / Row reference as a flat index or `{ id }`
|
|
104
|
+
*/
|
|
49
105
|
toggleRow(ref: DetailRowRef): void;
|
|
106
|
+
/** 펼쳐진 모든 행을 접는다(변경 없으면 no-op). / Collapse every currently expanded row (no-op if none are expanded). */
|
|
50
107
|
collapseAllDetails(): void;
|
|
108
|
+
/**
|
|
109
|
+
* 펼쳐진 행의 서브그리드/커스텀 렌더러 인스턴스를 조회한다. / Look up the subgrid or custom-renderer
|
|
110
|
+
* instance mounted for an expanded row.
|
|
111
|
+
*
|
|
112
|
+
* @param ref - flat index 또는 `{ id }` 형태의 행 참조 / Row reference as a flat index or `{ id }`
|
|
113
|
+
* @returns 마운트된 인스턴스, 없으면 `undefined` / The mounted instance, or `undefined`
|
|
114
|
+
*/
|
|
51
115
|
getDetailInstance<D = any>(ref: DetailRowRef): D | undefined;
|
|
52
116
|
/** FR-11 공개 계약 — 실제로는 리사이즈 이후 발생하는 통상 재렌더가 panel width 를 최신
|
|
53
117
|
* totalColWidth 로 이미 재계산하므로(§4.3 GridRenderer 가 매 렌더 폭을 새로 그린다), 여기선
|
|
54
|
-
* 강제 재렌더 1회로 계약을 만족시킨다(중복 상태 없이 단일 진실원 유지).
|
|
118
|
+
* 강제 재렌더 1회로 계약을 만족시킨다(중복 상태 없이 단일 진실원 유지).
|
|
119
|
+
* / FR-11 public contract — in practice, the normal re-render that follows a resize already
|
|
120
|
+
* recomputes panel width against the latest totalColWidth (§4.3: GridRenderer redraws width on
|
|
121
|
+
* every render), so this simply forces one re-render to satisfy the contract (no duplicate
|
|
122
|
+
* state; single source of truth is preserved). */
|
|
55
123
|
resyncPanelWidths(): void;
|
|
56
|
-
/** GridRenderer 가 detailHead 를 그릴 때 호출 — 영속 host 를 최초 1회만 만들고 이후 재사용.
|
|
124
|
+
/** GridRenderer 가 detailHead 를 그릴 때 호출 — 영속 host 를 최초 1회만 만들고 이후 재사용.
|
|
125
|
+
* / Called by GridRenderer when it draws a detailHead — creates the persistent host only
|
|
126
|
+
* once and reuses it thereafter.
|
|
127
|
+
*
|
|
128
|
+
* @param rowId - 대상 행의 stable id / Stable id of the target row
|
|
129
|
+
* @returns 재사용 가능한 host div / A reusable host div
|
|
130
|
+
*/
|
|
57
131
|
getPanelHost(rowId: string): HTMLElement;
|
|
58
132
|
private _buildInstance;
|
|
59
133
|
/** §5(4) skip-rebuild(FR-8/NFR-2, MCCONNELL-04 → Phase1 승격): renderBody teardown 직전
|
|
60
134
|
* 호출된다. 편집 중인 host 는 detach 자체를 회피(document.body 로 hoist, 연결 유지 → blur
|
|
61
|
-
* 없음) 하고, 그 외는 정상 detach(연결 끊음, 참조는 Map 이 쥐고 있어 파괴 아님).
|
|
135
|
+
* 없음) 하고, 그 외는 정상 detach(연결 끊음, 참조는 Map 이 쥐고 있어 파괴 아님).
|
|
136
|
+
* / §5(4) skip-rebuild (FR-8/NFR-2, MCCONNELL-04 → promoted to Phase1): called immediately
|
|
137
|
+
* before renderBody teardown. A host that is currently being edited avoids detach altogether
|
|
138
|
+
* (hoisted into document.body, staying connected → no blur); every other host is detached
|
|
139
|
+
* normally (disconnected, but not destroyed — the Map still holds the reference). */
|
|
62
140
|
onBeforeTeardown(): void;
|
|
141
|
+
/** 서브그리드/커스텀 렌더러 인스턴스가 현재 편집 중인지 여부. / Whether the subgrid/custom-renderer
|
|
142
|
+
* instance for a row is currently being edited.
|
|
143
|
+
*
|
|
144
|
+
* @param rowId - 대상 행의 stable id / Stable id of the target row
|
|
145
|
+
* @returns 편집 중이면 true / True if currently being edited
|
|
146
|
+
*/
|
|
63
147
|
isEditing(rowId: string): boolean;
|
|
64
148
|
/** collapse 직후 렌더가 끝난 뒤 호출 — FR-9: 패널 내부에 포커스가 있었으면 해당 마스터 행의
|
|
65
|
-
* expander 로 복원한다. GridRenderer 가 expander 엘리먼트를 렌더한 다음 프레임에 호출.
|
|
149
|
+
* expander 로 복원한다. GridRenderer 가 expander 엘리먼트를 렌더한 다음 프레임에 호출.
|
|
150
|
+
* / Called right after the render that follows a collapse — FR-9: if focus had been inside the
|
|
151
|
+
* panel, restore it to that master row's expander. GridRenderer calls this on the frame after
|
|
152
|
+
* it renders the expander element.
|
|
153
|
+
*
|
|
154
|
+
* @returns 포커스를 복원해야 할 행의 stable id, 없으면 `null` / Stable id of the row whose focus
|
|
155
|
+
* should be restored, or `null`
|
|
156
|
+
*/
|
|
66
157
|
consumePendingFocusRestore(): string | null;
|
|
67
158
|
private _releaseInstance;
|
|
68
159
|
private _splice;
|
|
69
160
|
private _afterToggle;
|
|
70
161
|
private _rebuildAndRender;
|
|
162
|
+
/** 모든 서브그리드/커스텀 렌더러 인스턴스를 파괴하고 host 캐시를 비운다.
|
|
163
|
+
* / Destroy every subgrid/custom-renderer instance and clear the host cache. */
|
|
71
164
|
destroy(): void;
|
|
72
165
|
}
|
|
@@ -1,29 +1,101 @@
|
|
|
1
1
|
import { ColumnLayout } from './ColumnLayout.js';
|
|
2
2
|
import { WorksheetManager } from './WorksheetManager.js';
|
|
3
3
|
import { ExportOptions } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* ExportManager 의존성 주입 인터페이스. / Dependency-injection interface for ExportManager.
|
|
6
|
+
*
|
|
7
|
+
* OpenGrid 내부 상태(데이터·컬럼·옵션 등)를 export 로직에서 직접 참조하지 않고
|
|
8
|
+
* 콜백으로만 받도록 분리한다. / Decouples export logic from OpenGrid's internals —
|
|
9
|
+
* everything is read back through callbacks instead of direct references.
|
|
10
|
+
*/
|
|
4
11
|
export interface ExportDeps<T extends Record<string, any>> {
|
|
12
|
+
/** 내보낼 전체 행 데이터. / Full row data to export. */
|
|
5
13
|
getData: () => T[];
|
|
14
|
+
/** 현재 컬럼 레이아웃(가시 리프 컬럼 조회용). / Current column layout (for resolving visible leaf columns). */
|
|
6
15
|
getColLayout: () => ColumnLayout<T>;
|
|
16
|
+
/** 컬럼별 현재 폭(px) 배열. / Current per-column widths (px). */
|
|
7
17
|
getColWidths: () => number[];
|
|
18
|
+
/** 그리드 옵션 스냅샷. / Snapshot of grid options. */
|
|
8
19
|
getOptions: () => any;
|
|
20
|
+
/** 그리드 컨테이너 엘리먼트(테마 CSS 변수 조회용). / Grid container element (for reading theme CSS variables). */
|
|
9
21
|
getContainer: () => HTMLElement;
|
|
22
|
+
/** 필드별 마스킹 활성 여부. / Whether masking is enabled for a given field. */
|
|
10
23
|
getMaskEnabled: (field: string) => boolean;
|
|
24
|
+
/** 워크시트 매니저(다중 시트 내보내기용). 없으면 `null`. / Worksheet manager (for multi-sheet export); `null` if absent. */
|
|
11
25
|
getWsManager: () => WorksheetManager<T> | null;
|
|
12
|
-
/** Phase 2: OverrideKernel.getStrategy 주입(슬롯 cellSerializer 도달용). */
|
|
26
|
+
/** Phase 2: OverrideKernel.getStrategy 주입(슬롯 cellSerializer 도달용). / Phase 2: injected via OverrideKernel.getStrategy (reaches the `cellSerializer` slot). */
|
|
13
27
|
getStrategy?: <F extends Function>(slot: string, fallback: F) => F;
|
|
28
|
+
/** i18n: 인쇄 요약행 해석(미주입 시 ko 폴백). / i18n: resolve print summary row (ko fallback when absent). */
|
|
29
|
+
t?: (key: string, params?: Record<string, string | number>) => string;
|
|
30
|
+
/** i18n: 로케일 포맷 메타(인쇄 lang·날짜 로케일·Excel 폰트). / i18n: locale format meta (print lang, date locale, Excel font). */
|
|
31
|
+
getMeta?: () => {
|
|
32
|
+
intlLocale: string;
|
|
33
|
+
exportFont?: string;
|
|
34
|
+
};
|
|
14
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* 그리드 데이터 내보내기(Excel/CSV/JSON/인쇄) 관리자. / Manages exporting grid data (Excel/CSV/JSON/print).
|
|
38
|
+
*
|
|
39
|
+
* OpenGrid 상태를 {@link ExportDeps} 콜백으로만 읽으며, Excel 계열은 `xlsx-js-style` 을
|
|
40
|
+
* 동적 import 하여 필요할 때만 로드한다. / Reads OpenGrid state only through {@link ExportDeps}
|
|
41
|
+
* callbacks; Excel exports dynamically `import()` `xlsx-js-style` so it loads only on demand.
|
|
42
|
+
*/
|
|
15
43
|
export declare class ExportManager<T extends Record<string, any> = any> {
|
|
16
44
|
private _d;
|
|
17
45
|
constructor(deps: ExportDeps<T>);
|
|
46
|
+
/** @internal 컨테이너의 CSS 커스텀 프로퍼티 값을 읽는다. / Reads a CSS custom property value from the container. */
|
|
18
47
|
private _readCssVar;
|
|
48
|
+
/** @internal HEX/RGB 색상 문자열을 xlsx-js-style 이 요구하는 6자리 RGB 헥스로 변환. / Converts a HEX/RGB color string into the 6-digit RGB hex xlsx-js-style expects. */
|
|
19
49
|
private _hexToXlsxRgb;
|
|
50
|
+
/**
|
|
51
|
+
* 현재 그리드 데이터를 스타일이 적용된 `.xlsx` 로 내보낸다. / Export the current grid data as a styled `.xlsx` file.
|
|
52
|
+
*
|
|
53
|
+
* 헤더/데이터 배색은 `styleMode: 'theme'`(기본) 시 그리드 테마 CSS 변수(`--og-*`)에서
|
|
54
|
+
* 읽어 반영하고, `cellSerializer` override 슬롯이 있으면 셀 값 직렬화를 위임한다.
|
|
55
|
+
* / When `styleMode: 'theme'` (default), header/data colors are read from the grid's
|
|
56
|
+
* theme CSS variables (`--og-*`); if an `cellSerializer` override slot is registered,
|
|
57
|
+
* cell-value serialization is delegated to it.
|
|
58
|
+
*
|
|
59
|
+
* @param options - 파일명 문자열 또는 {@link ExportOptions} / A filename string, or {@link ExportOptions}
|
|
60
|
+
* @example
|
|
61
|
+
* grid.exportExcel({ filename: 'orders', maskOnExport: true });
|
|
62
|
+
*/
|
|
20
63
|
exportExcel(options?: ExportOptions | string): void;
|
|
64
|
+
/**
|
|
65
|
+
* 현재 그리드 데이터를 UTF-8 BOM 포함 CSV 로 내보낸다. / Export the current grid data as a UTF-8 (BOM) CSV file.
|
|
66
|
+
*
|
|
67
|
+
* @param options - 파일명 문자열 또는 {@link ExportOptions} / A filename string, or {@link ExportOptions}
|
|
68
|
+
*/
|
|
21
69
|
exportCsv(options?: ExportOptions | string): void;
|
|
70
|
+
/**
|
|
71
|
+
* 현재 그리드 데이터를 JSON 파일로 내보낸다. / Export the current grid data as a JSON file.
|
|
72
|
+
*
|
|
73
|
+
* @param options - 파일명 문자열 또는 `filename` 을 담은 옵션 / A filename string, or an options object with `filename`
|
|
74
|
+
*/
|
|
22
75
|
exportJson(options?: ExportOptions | string): void;
|
|
76
|
+
/**
|
|
77
|
+
* 새 창을 열어 현재 그리드 데이터를 인쇄용 HTML 표로 렌더하고 인쇄 대화상자를 띄운다.
|
|
78
|
+
* / Opens a new window, renders the current grid data as a print-ready HTML table, and triggers the print dialog.
|
|
79
|
+
*
|
|
80
|
+
* 인쇄 문서의 `lang`·날짜 로케일·요약행 문구는 활성 로케일(`getMeta`/`t`)을 따른다
|
|
81
|
+
* (미주입 시 ko 폴백, byte-identical). / The document `lang`, date locale, and summary
|
|
82
|
+
* line follow the active locale (`getMeta`/`t`); falls back to ko when not injected (byte-identical).
|
|
83
|
+
*
|
|
84
|
+
* @param options - 제목·제외 필드·인쇄 푸터 텍스트 / Title, excluded fields, and print-footer text
|
|
85
|
+
*/
|
|
23
86
|
print(options?: {
|
|
24
87
|
title?: string;
|
|
25
88
|
excludeFields?: string[];
|
|
26
89
|
footerText?: string;
|
|
27
90
|
}): void;
|
|
91
|
+
/**
|
|
92
|
+
* 워크시트 매니저의 모든 시트를 시트별 탭으로 갖는 단일 `.xlsx` 로 내보낸다.
|
|
93
|
+
* / Export every sheet from the worksheet manager into a single `.xlsx` file, one tab per sheet.
|
|
94
|
+
*
|
|
95
|
+
* 워크시트 매니저가 없으면 {@link exportExcel} 로 폴백한다.
|
|
96
|
+
* / Falls back to {@link exportExcel} when no worksheet manager is present.
|
|
97
|
+
*
|
|
98
|
+
* @param filename - 파일명(확장자 생략 가능) / Output filename (extension optional)
|
|
99
|
+
*/
|
|
28
100
|
exportSheetsExcel(filename?: string): void;
|
|
29
101
|
}
|
|
@@ -11,82 +11,228 @@ import { StrategySlot, StrategyMap, OverrideLayerFn, OverrideCallOptions, Overri
|
|
|
11
11
|
* 3범주(§4.1): (a) strategy 슬롯(값·계산) · (b) 컴포넌트 registry(렌더훅 포함) · (c) lifecycle hook.
|
|
12
12
|
* 이중구조(T-ζ): "SemVer 보증 카탈로그"(타입드 좁은 문) + "best-effort 임의 인터셉트 탈출구"(UC-11,
|
|
13
13
|
* 넓은 문). 문서·타입에서 둘을 명확히 분리하되 넓은 문을 닫지 않는다.
|
|
14
|
+
* / R11 (§4 T3, §3.1 C7): a **typed extension-point registry** layered on top of the kernel.
|
|
15
|
+
*
|
|
16
|
+
* `OverrideKernel` is the execution engine (reversible, host-agnostic, zero source lines,
|
|
17
|
+
* untouchable — not a single line of it is modified). This registry is the **typed facade**
|
|
18
|
+
* placed on top of it, making the extension surface explicit, typed, and discoverable. The
|
|
19
|
+
* burden of extending the grid shifts from "editing core (adding a hardcoded gate)" to
|
|
20
|
+
* "registering data" (A4).
|
|
21
|
+
*
|
|
22
|
+
* Three categories (§4.1): (a) strategy slots (value/computation) · (b) component registries
|
|
23
|
+
* (including render hooks) · (c) lifecycle hooks. Dual structure (T-ζ): a "SemVer-guaranteed
|
|
24
|
+
* catalog" (the typed narrow door) plus a "best-effort arbitrary intercept escape hatch"
|
|
25
|
+
* (UC-11, the wide door). Docs and types keep the two clearly separated without ever closing
|
|
26
|
+
* the wide door.
|
|
14
27
|
*/
|
|
15
28
|
/**
|
|
16
29
|
* 렌더 참여 훅(§4.2). 렌더층이 셀마다 참조하는 교체가능 지점.
|
|
17
30
|
* - `gate()` : 미설정(등록 override/strategy 없음)이면 false → 렌더층이 resolve 를 호출조차 안 함(제로코스트).
|
|
18
31
|
* - `resolve(rowIndex, field)` : 게이트 통과 시 렌더층에 줄 값(표시문자열/클래스/aria 등). null=미참여.
|
|
19
32
|
* 첫 등록 항목 = 기존 `getDisplayValue` 표시텍스트 동작(동일 출력 → 회귀0). 이후 새 훅은 등록만으로 열린다.
|
|
33
|
+
* / A render-participation hook (§4.2). A swappable point the render layer consults per cell.
|
|
34
|
+
* - `gate()`: `false` when unconfigured (no override/strategy registered) — the render layer
|
|
35
|
+
* won't even call `resolve` (zero cost).
|
|
36
|
+
* - `resolve(rowIndex, field)`: the value to hand to the render layer once the gate passes
|
|
37
|
+
* (display string/class/aria, etc.). `null` = does not participate.
|
|
38
|
+
* The first registered entry is the existing `getDisplayValue` display-text behavior (same
|
|
39
|
+
* output — zero regression). Any new hook opens up simply by registering.
|
|
20
40
|
*/
|
|
21
41
|
export interface RenderHook<R = string> {
|
|
42
|
+
/** 훅 식별자(등록/조회 키). / Hook identifier (registration/lookup key). */
|
|
22
43
|
readonly id: string;
|
|
44
|
+
/** 이 훅이 현재 활성인지. / Whether this hook is currently active. */
|
|
23
45
|
gate(): boolean;
|
|
46
|
+
/** 게이트 통과 시의 셀 값 해석. / Resolve the cell value once the gate passes. */
|
|
24
47
|
resolve(rowIndex: number, field: string): R | null;
|
|
25
48
|
}
|
|
26
49
|
/**
|
|
27
50
|
* 렌더훅 레지스트리(§4.2). 하드코딩 게이트 1개를 데이터 구동 훅 목록으로 일반화.
|
|
28
51
|
* 등록순 보존(첫 항목=표시텍스트). 렌더층은 이름을 하드코딩하지 않고 `resolve(id,…)` 로 순회 참조한다.
|
|
52
|
+
* / The render-hook registry (§4.2). Generalizes a single hardcoded gate into a
|
|
53
|
+
* data-driven list of hooks. Registration order is preserved (the first entry is the
|
|
54
|
+
* display-text hook). The render layer never hardcodes names — it consults hooks by
|
|
55
|
+
* iterating and calling `resolve(id, …)`.
|
|
29
56
|
*/
|
|
30
57
|
export declare class RenderHookRegistry {
|
|
31
58
|
private _order;
|
|
32
59
|
private _hooks;
|
|
60
|
+
/**
|
|
61
|
+
* 훅을 등록한다(신규 id 는 등록순 끝에 추가, 기존 id 는 갱신). / Register a hook (a new id
|
|
62
|
+
* is appended to registration order; an existing id is updated in place).
|
|
63
|
+
*
|
|
64
|
+
* @param hook - 등록할 렌더훅 / The render hook to register
|
|
65
|
+
*/
|
|
33
66
|
register(hook: RenderHook<any>): void;
|
|
67
|
+
/**
|
|
68
|
+
* id 로 등록된 훅을 조회한다. / Look up a registered hook by id.
|
|
69
|
+
*
|
|
70
|
+
* @param id - 훅 식별자 / Hook identifier
|
|
71
|
+
* @returns 등록된 훅, 없으면 undefined / The registered hook, or `undefined`
|
|
72
|
+
*/
|
|
34
73
|
get(id: string): RenderHook<any> | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* id 가 등록되어 있는지 확인한다. / Check whether an id is registered.
|
|
76
|
+
*
|
|
77
|
+
* @param id - 훅 식별자 / Hook identifier
|
|
78
|
+
* @returns 등록 여부 / Whether it is registered
|
|
79
|
+
*/
|
|
35
80
|
has(id: string): boolean;
|
|
36
|
-
/** 등록순 훅 id 목록(첫 항목=표시텍스트). */
|
|
81
|
+
/** 등록순 훅 id 목록(첫 항목=표시텍스트). / Registered hook ids in registration order (the first entry is display-text). */
|
|
37
82
|
ids(): string[];
|
|
38
83
|
/**
|
|
39
84
|
* 훅 해석. 미등록이거나 게이트가 닫혀 있으면 resolve 를 **호출하지 않고** null 반환(제로코스트 보존).
|
|
85
|
+
* / Resolve a hook. If unregistered or its gate is closed, `resolve` is **not called** and
|
|
86
|
+
* `null` is returned (preserving zero cost).
|
|
87
|
+
*
|
|
88
|
+
* @param id - 훅 식별자 / Hook identifier
|
|
89
|
+
* @param rowIndex - 대상 행 인덱스 / Target row index
|
|
90
|
+
* @param field - 대상 컬럼 field 명 / Target column field name
|
|
91
|
+
* @returns 해석된 값, 미참여 시 null / The resolved value, or `null` if it does not participate
|
|
40
92
|
*/
|
|
41
93
|
resolve(id: string, rowIndex: number, field: string): any;
|
|
42
|
-
/** 게이트가 열린(활성) 훅 id — 렌더층 스윕/디버깅용. */
|
|
94
|
+
/** 게이트가 열린(활성) 훅 id — 렌더층 스윕/디버깅용. / Ids of hooks whose gate is open (active) — for render-layer sweeps/debugging. */
|
|
43
95
|
activeIds(): string[];
|
|
44
96
|
}
|
|
45
|
-
/** 단일 커밋 초크포인트(C5 MutationService)가 트리거로 감싸는 변경 연산.
|
|
97
|
+
/** 단일 커밋 초크포인트(C5 MutationService)가 트리거로 감싸는 변경 연산.
|
|
98
|
+
* / A mutation operation wrapped in a trigger by the single commit chokepoint (C5 MutationService). */
|
|
46
99
|
export type MutationOp = 'setData' | 'insertRow' | 'deleteRow' | 'writeCell';
|
|
47
|
-
/** 카탈로그(매니페스트) 엔트리 — R-3d "지원 확장점 카탈로그" 산출물.
|
|
100
|
+
/** 카탈로그(매니페스트) 엔트리 — R-3d "지원 확장점 카탈로그" 산출물.
|
|
101
|
+
* / A catalog (manifest) entry — the R-3d "supported extension point catalog" artifact. */
|
|
48
102
|
export interface ExtensionCatalogEntry {
|
|
103
|
+
/** 확장점 이름. / Extension point name. */
|
|
49
104
|
readonly name: string;
|
|
105
|
+
/** 확장점 범주. / Extension point category. */
|
|
50
106
|
readonly category: 'strategy' | 'renderHook' | 'lifecycle' | 'override' | 'escapeHatch';
|
|
107
|
+
/** 사람이 읽는 시그니처 문자열. / Human-readable signature string. */
|
|
51
108
|
readonly signature: string;
|
|
52
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* ExtensionPointRegistry 의 의존성 계약. / Dependency contract for ExtensionPointRegistry.
|
|
112
|
+
*/
|
|
53
113
|
export interface ExtensionRegistryDeps {
|
|
54
|
-
/** 실행 엔진(불가침). 레지스트리는 소유·위임할 뿐 내부를 건드리지 않는다.
|
|
114
|
+
/** 실행 엔진(불가침). 레지스트리는 소유·위임할 뿐 내부를 건드리지 않는다.
|
|
115
|
+
* / The execution engine (untouchable). The registry only owns and delegates to it —
|
|
116
|
+
* it never reaches into its internals. */
|
|
55
117
|
kernel: OverrideKernel;
|
|
56
|
-
/** before/after 취소가능 훅을 부착할 커밋 초크포인트의 TriggerManager(늦은-null 견딤).
|
|
118
|
+
/** before/after 취소가능 훅을 부착할 커밋 초크포인트의 TriggerManager(늦은-null 견딤).
|
|
119
|
+
* / The commit chokepoint's TriggerManager, to which cancelable before/after hooks are
|
|
120
|
+
* attached (tolerates late-null). */
|
|
57
121
|
getTrigMgr: () => TriggerManager;
|
|
58
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* R11 확장점 레지스트리. / R11 extension-point registry.
|
|
125
|
+
*
|
|
126
|
+
* `OverrideKernel` 실행 엔진 위에 얹는 타입드 정면으로, strategy 슬롯·렌더훅·lifecycle 훅·
|
|
127
|
+
* override 카탈로그를 하나의 등록 표면으로 노출한다(§4.1~§4.3).
|
|
128
|
+
* / The typed facade layered on top of the `OverrideKernel` execution engine, exposing
|
|
129
|
+
* strategy slots, render hooks, lifecycle hooks, and the override catalog as a single
|
|
130
|
+
* registration surface (§4.1–§4.3).
|
|
131
|
+
*/
|
|
59
132
|
export declare class ExtensionPointRegistry<T = any> {
|
|
60
133
|
private _deps;
|
|
61
134
|
private _renderHooks;
|
|
62
135
|
constructor(deps: ExtensionRegistryDeps);
|
|
136
|
+
/** 렌더훅 레지스트리. / The render-hook registry. */
|
|
63
137
|
get renderHooks(): RenderHookRegistry;
|
|
64
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* 렌더훅 등록(코어 편집 없이 렌더층 참여 지점 추가 — OCP).
|
|
140
|
+
* / Register a render hook (adds a render-layer participation point without editing
|
|
141
|
+
* core — OCP).
|
|
142
|
+
*
|
|
143
|
+
* @param hook - 등록할 렌더훅 / The render hook to register
|
|
144
|
+
* @example
|
|
145
|
+
* registry.registerRenderHook({
|
|
146
|
+
* id: 'myBadge',
|
|
147
|
+
* gate: () => true,
|
|
148
|
+
* resolve: (rowIndex, field) => (field === 'status' ? 'badge-on' : null),
|
|
149
|
+
* });
|
|
150
|
+
*/
|
|
65
151
|
registerRenderHook(hook: RenderHook<any>): void;
|
|
66
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* 렌더층이 매 셀 호출 — 미등록/게이트닫힘이면 제로코스트 null.
|
|
154
|
+
* / Called by the render layer for every cell — zero-cost `null` when unregistered or the
|
|
155
|
+
* gate is closed.
|
|
156
|
+
*
|
|
157
|
+
* @param id - 렌더훅 식별자 / Render hook identifier
|
|
158
|
+
* @param rowIndex - 대상 행 인덱스 / Target row index
|
|
159
|
+
* @param field - 대상 컬럼 field 명 / Target column field name
|
|
160
|
+
* @returns 해석된 값, 미참여 시 null / The resolved value, or `null` if it does not participate
|
|
161
|
+
*/
|
|
67
162
|
resolveRenderHook(id: string, rowIndex: number, field: string): any;
|
|
68
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* 타입드 슬롯 등록(SemVer 보증 카탈로그). 런타임은 커널 문자열 기반(하위호환).
|
|
165
|
+
* / Register a typed slot (SemVer-guaranteed catalog). At runtime it is still
|
|
166
|
+
* string-keyed via the kernel (backward compatible).
|
|
167
|
+
*
|
|
168
|
+
* @param slot - strategy 슬롯 이름 / Strategy slot name
|
|
169
|
+
* @param fn - 슬롯 구현 함수 / The slot implementation function
|
|
170
|
+
* @example
|
|
171
|
+
* registry.strategy('displayFormatter', (value, field, row) => String(value).toUpperCase());
|
|
172
|
+
*/
|
|
69
173
|
strategy<K extends StrategySlot>(slot: K, fn: StrategyMap[K]): void;
|
|
70
174
|
strategy(slot: string, fn: Function): void;
|
|
71
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* 슬롯 조회(미등록 시 fallback — 매니저 read API, 제로코스트 철학 보존).
|
|
177
|
+
* / Look up a slot (falls back when unregistered — manager read API, preserving the
|
|
178
|
+
* zero-cost philosophy).
|
|
179
|
+
*
|
|
180
|
+
* @param slot - strategy 슬롯 이름 / Strategy slot name
|
|
181
|
+
* @param fallback - 미등록 시 사용할 기본 함수 / Default function used when unregistered
|
|
182
|
+
* @returns 등록된 함수 또는 fallback / The registered function, or the fallback
|
|
183
|
+
*/
|
|
72
184
|
getStrategy<F extends Function>(slot: string, fallback: F): F;
|
|
185
|
+
/**
|
|
186
|
+
* 슬롯 등록 여부를 확인한다. / Check whether a slot is registered.
|
|
187
|
+
*
|
|
188
|
+
* @param slot - strategy 슬롯 이름 / Strategy slot name
|
|
189
|
+
* @returns 등록 여부 / Whether it is registered
|
|
190
|
+
*/
|
|
73
191
|
hasStrategy(slot: string): boolean;
|
|
74
|
-
/** 타입드 오버로드: 좁은 "지원됨" 카탈로그(IDE 발견). */
|
|
192
|
+
/** 타입드 오버로드: 좁은 "지원됨" 카탈로그(IDE 발견). / Typed overload: the narrow "supported" catalog (IDE-discoverable). */
|
|
75
193
|
override<K extends keyof OverridePoints<T>>(name: K, fn: OverrideLayerFn, opts?: OverrideCallOptions): void;
|
|
76
|
-
/** 탈출구(UC-11): 임의 메서드 best-effort 인터셉트 — 넓은 문은 닫지 않는다. */
|
|
194
|
+
/** 탈출구(UC-11): 임의 메서드 best-effort 인터셉트 — 넓은 문은 닫지 않는다. / Escape hatch (UC-11): best-effort intercept of an arbitrary method — the wide door stays open. */
|
|
77
195
|
override(name: string, fn: OverrideLayerFn, opts?: OverrideCallOptions): void;
|
|
78
196
|
/**
|
|
79
197
|
* 취소가능 before 훅. 단일 커밋 초크포인트(C5 MutationService)가 이미 제공하는 `before:{op}`
|
|
80
198
|
* 트리거를 **타입드로 표면화**할 뿐 메커니즘을 재배선하지 않는다. 핸들러가 `ctx.cancel()` 하면 변경 취소.
|
|
199
|
+
* / A cancelable before-hook. Merely **surfaces as typed** the `before:{op}` trigger already
|
|
200
|
+
* provided by the single commit chokepoint (C5 MutationService) — it does not rewire the
|
|
201
|
+
* mechanism. If the handler calls `ctx.cancel()`, the mutation is cancelled.
|
|
202
|
+
*
|
|
203
|
+
* @param op - 대상 변경 연산 / Target mutation operation
|
|
204
|
+
* @param handler - 취소 가능한 before 핸들러 / Cancelable before handler
|
|
205
|
+
* @example
|
|
206
|
+
* registry.beforeMutation('deleteRow', (ctx) => {
|
|
207
|
+
* if (!confirm('삭제할까요?')) ctx.cancel();
|
|
208
|
+
* });
|
|
81
209
|
*/
|
|
82
210
|
beforeMutation(op: MutationOp, handler: TriggerHandler): void;
|
|
83
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* 관찰(취소불가) after 훅 — 커밋 완료 후 `after:{op}` 트리거를 타입드로 표면화.
|
|
213
|
+
* / An observation-only (non-cancelable) after-hook — surfaces the `after:{op}` trigger,
|
|
214
|
+
* fired once the commit completes, as typed.
|
|
215
|
+
*
|
|
216
|
+
* @param op - 대상 변경 연산 / Target mutation operation
|
|
217
|
+
* @param handler - 관찰용 after 핸들러 / Observation-only after handler
|
|
218
|
+
*/
|
|
84
219
|
afterMutation(op: MutationOp, handler: TriggerHandler): void;
|
|
85
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* 등록한 MutationHook 해제. / Remove a previously registered MutationHook.
|
|
222
|
+
*
|
|
223
|
+
* @param when - 'before' 또는 'after' / `'before'` or `'after'`
|
|
224
|
+
* @param op - 대상 변경 연산 / Target mutation operation
|
|
225
|
+
* @param handler - 제거할 핸들러(등록 시와 동일 참조) / Handler to remove (same reference used at registration)
|
|
226
|
+
*/
|
|
86
227
|
offMutation(when: 'before' | 'after', op: MutationOp, handler: TriggerHandler): void;
|
|
87
228
|
/**
|
|
88
229
|
* 타입드 확장점 카탈로그. render 훅 항목은 실제 등록분(`renderHooks.ids()`)에서 유도 —
|
|
89
230
|
* 유령 확장점(등록 없는 카탈로그 엔트리) 금지(DeMarco M9b).
|
|
231
|
+
* / The typed extension-point catalog. Render-hook entries are derived from the actual
|
|
232
|
+
* registrations (`renderHooks.ids()`) — no phantom extension points (catalog entries with
|
|
233
|
+
* no registration) are allowed (DeMarco M9b).
|
|
234
|
+
*
|
|
235
|
+
* @returns 확장점 카탈로그 엔트리 배열 / Array of extension-point catalog entries
|
|
90
236
|
*/
|
|
91
237
|
catalog(): ExtensionCatalogEntry[];
|
|
92
238
|
}
|
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
import { FilterItem } from './types.js';
|
|
2
|
+
/** 필터 적용 콜백. / Callback invoked when a filter is applied. */
|
|
2
3
|
export type FilterApplyFn = (field: string, items: FilterItem[]) => void;
|
|
4
|
+
/** 필터 해제 콜백. / Callback invoked when a filter is cleared. */
|
|
3
5
|
export type FilterClearFn = (field: string) => void;
|
|
6
|
+
/** i18n: 필터 라벨 로케일 해석기(주입 없으면 전역 t). / i18n: filter-label resolver (global t when not injected). */
|
|
7
|
+
export type FilterPanelT = (key: string, params?: Record<string, string | number>) => string;
|
|
4
8
|
/**
|
|
5
|
-
* 컬럼 헤더 필터 드롭다운 패널.
|
|
6
|
-
*
|
|
9
|
+
* 컬럼 헤더 필터 드롭다운 패널. / Column-header filter dropdown panel.
|
|
10
|
+
*
|
|
11
|
+
* 단일 인스턴스를 재사용하며, 열릴 때마다 대상 컬럼(`field`)과 앵커 기준 위치를
|
|
12
|
+
* 재계산한다. / Reuses a single instance; on each open it recomputes the target
|
|
13
|
+
* column (`field`) and its anchor-relative position.
|
|
7
14
|
*/
|
|
8
15
|
export declare class FilterPanel {
|
|
9
16
|
private _el;
|
|
10
17
|
private _field;
|
|
11
18
|
private _onApply;
|
|
12
19
|
private _onClear;
|
|
20
|
+
private _t;
|
|
13
21
|
private _outsideHandler;
|
|
14
|
-
constructor(container: HTMLElement, onApply: FilterApplyFn, onClear: FilterClearFn);
|
|
22
|
+
constructor(container: HTMLElement, onApply: FilterApplyFn, onClear: FilterClearFn, t?: FilterPanelT);
|
|
23
|
+
/**
|
|
24
|
+
* 지정 컬럼의 필터 패널을 앵커 엘리먼트 아래에 연다. / Open the filter panel for the given column, anchored below `anchorEl`.
|
|
25
|
+
*
|
|
26
|
+
* @param field - 필터 대상 컬럼 field 명 / Field name of the column to filter
|
|
27
|
+
* @param anchorEl - 위치 기준이 되는 헤더 엘리먼트(보통 필터 아이콘) / Header element used as the position anchor (typically the filter icon)
|
|
28
|
+
* @param currentFilters - 해당 컬럼에 이미 적용된 필터(있으면 입력값 프리필) / Filters already applied to this column (pre-fills the inputs, if any)
|
|
29
|
+
*/
|
|
15
30
|
open(field: string, anchorEl: HTMLElement, currentFilters: FilterItem[]): void;
|
|
31
|
+
/** 필터 패널을 숨기고 외부 클릭 리스너를 해제한다. / Hide the filter panel and detach the outside-click listener. */
|
|
16
32
|
close(): void;
|
|
33
|
+
/** 패널이 현재 열려 있는지 여부. / Whether the panel is currently open. */
|
|
17
34
|
get isOpen(): boolean;
|
|
35
|
+
/** 패널을 닫고 DOM 에서 제거한다. / Close the panel and remove it from the DOM. */
|
|
18
36
|
destroy(): void;
|
|
19
37
|
}
|