open-grid 1.6.1 → 1.7.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/dist/ExportProgressView-9Kt1SQxv.js +48 -0
- package/dist/ExportProgressView-B59uHIwt.cjs +48 -0
- package/dist/LcpMergeOrderer-BdUtV67j.js +114 -0
- package/dist/LcpMergeOrderer-C_ANVkGk.cjs +113 -0
- package/dist/OpenGrid-BUYQs1_w.cjs +9806 -0
- package/dist/OpenGrid-BmagF0yo.js +9819 -0
- package/dist/XlsxChannel-DOeHeP7h.cjs +95 -0
- package/dist/XlsxChannel-DdaiytFR.js +95 -0
- package/dist/XlsxWorkbookWriter-BTNtZ80J.js +199 -0
- package/dist/XlsxWorkbookWriter-_u5stfg4.cjs +198 -0
- package/dist/{index-VkKgQ506.js → index-B9_g5Eg3.js} +2 -2
- package/dist/{index-D0DJtKYI.cjs → index-CnyumyPV.cjs} +2 -2
- 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/sinks-BWkWQexV.js +149 -0
- package/dist/sinks-DPK0VxYG.cjs +143 -0
- package/dist/types/core/CFRenderBridge.d.ts +5 -1
- package/dist/types/core/CellEditManager.d.ts +26 -2
- package/dist/types/core/CellEventHandler.d.ts +6 -2
- package/dist/types/core/ColumnLayout.d.ts +8 -0
- package/dist/types/core/DataLayer.d.ts +48 -1
- package/dist/types/core/DetailManager.d.ts +43 -2
- package/dist/types/core/ExportManager.d.ts +24 -0
- package/dist/types/core/FindBarManager.d.ts +6 -2
- package/dist/types/core/FlatRowModel.d.ts +61 -3
- package/dist/types/core/FooterManager.d.ts +43 -1
- package/dist/types/core/FormulaController.d.ts +4 -4
- package/dist/types/core/GridComposer.d.ts +11 -1
- package/dist/types/core/GridRenderer.d.ts +84 -19
- package/dist/types/core/GroupTreeManager.d.ts +6 -4
- package/dist/types/core/KeyboardManager.d.ts +3 -2
- package/dist/types/core/MutationService.d.ts +10 -8
- package/dist/types/core/OpenGrid.d.ts +7 -5
- package/dist/types/core/RangeSelectionManager.d.ts +23 -2
- package/dist/types/core/RenderController.d.ts +126 -8
- package/dist/types/core/SortFilterManager.d.ts +10 -2
- package/dist/types/core/VirtualScroll.d.ts +12 -0
- package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
- package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
- package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
- package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
- package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
- package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
- package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
- package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
- package/dist/types/core/coordinate/ports.d.ts +5 -0
- package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
- package/dist/types/core/domain/footer/ports.d.ts +31 -0
- package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
- package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
- package/dist/types/core/domain/render/ports.d.ts +169 -0
- package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
- package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
- package/dist/types/core/domain/resize/ports.d.ts +64 -0
- package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
- package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
- package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
- package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
- package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
- package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
- package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
- package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
- package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
- package/dist/types/core/domain/sort/ports.d.ts +140 -0
- package/dist/types/core/export/ExportProgressView.d.ts +28 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +29 -0
- package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +17 -0
- package/dist/types/core/export/index.d.ts +2 -0
- package/dist/types/core/export/sinks.d.ts +81 -0
- package/dist/types/core/host/archCheck.d.ts +16 -1
- package/dist/types/core/i18n/locales/en.d.ts +6 -0
- package/dist/types/core/i18n/locales/ko.d.ts +6 -0
- package/dist/types/core/i18n/types.d.ts +8 -0
- package/dist/types/core/render/FooterView.d.ts +121 -0
- package/dist/types/core/render/GeometryApplier.d.ts +55 -0
- package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
- package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
- package/dist/types/core/render/RenderScheduler.d.ts +225 -0
- package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
- package/dist/types/core/render/ScrollFollower.d.ts +34 -0
- package/dist/types/core/render/ScrollObserver.d.ts +47 -0
- package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
- package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
- package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
- package/dist/types/core/render/body/BodyView.d.ts +185 -0
- package/dist/types/core/render/body/CellLocator.d.ts +36 -0
- package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
- package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
- package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
- package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
- package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
- package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
- package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
- package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
- package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
- package/dist/types/core/render/dom.d.ts +10 -0
- package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
- package/dist/types/core/render/header/HeaderView.d.ts +84 -0
- package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
- package/dist/types/core/render/ports.d.ts +218 -0
- package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
- package/dist/types/core/types.d.ts +70 -0
- package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
- package/package.json +2 -8
- package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
- package/dist/OpenGrid-D6YxCsnV.js +0 -7472
|
@@ -11,11 +11,16 @@ import { CellEditManager } from './CellEditManager.js';
|
|
|
11
11
|
import { GroupTreeManager } from './GroupTreeManager.js';
|
|
12
12
|
import { DetailManager } from './DetailManager.js';
|
|
13
13
|
import { RangeSelectionManager } from './RangeSelectionManager.js';
|
|
14
|
-
import { GridOptions } from './types.js';
|
|
14
|
+
import { GridOptions, CellRange } from './types.js';
|
|
15
|
+
import { ColumnGeometry } from './coordinate/ColumnGeometry.js';
|
|
16
|
+
import { IColumnGeometry, GeometryChange, IColumnWindow, GridShape } from './coordinate/geometryPorts.js';
|
|
17
|
+
import { ColumnWindowPolicy } from './coordinate/ColumnWindowPolicy.js';
|
|
18
|
+
import { ScrollObserver } from './render/ScrollObserver.js';
|
|
19
|
+
import { IRenderRequest } from './domain/render/ports.js';
|
|
15
20
|
/**
|
|
16
21
|
* R5(§3.1 C4, §6-R5): 렌더 루프의 유일 진입점. `OpenGrid` God object 에서
|
|
17
22
|
* `_onResize`/`_recalcWidths`/`_renderHeader`/`_syncHeaderLayout`/`_doRender`/`_visRange`
|
|
18
|
-
* (+ 전용 헬퍼 `
|
|
23
|
+
* (+ 전용 헬퍼 `_paginationHeight`)를 **동작 불변**으로 옮긴 것.
|
|
19
24
|
*
|
|
20
25
|
* 스트랭글러 원칙(A2): 협력자(GridRenderer/VirtualScroll/Pagination 등)는 여전히
|
|
21
26
|
* `OpenGrid._mount` 가 생성·소유하며, 여기에는 `*Deps` 클로저 역전 패턴으로 **주입**만 된다.
|
|
@@ -24,7 +29,7 @@ import { GridOptions } from './types.js';
|
|
|
24
29
|
* 원본과 1:1 동일하다(회귀 0).
|
|
25
30
|
* / Dependency contract for the sole entry point of the render loop (R5, §3.1 C4, §6-R5),
|
|
26
31
|
* moving `_onResize`/`_recalcWidths`/`_renderHeader`/`_syncHeaderLayout`/`_doRender`/`_visRange`
|
|
27
|
-
* (plus the private
|
|
32
|
+
* (plus the private helper `_paginationHeight`) out of the `OpenGrid` God object
|
|
28
33
|
* with **behavior unchanged**.
|
|
29
34
|
*
|
|
30
35
|
* Strangler principle (A2): collaborators (GridRenderer/VirtualScroll/Pagination, etc.) are
|
|
@@ -56,8 +61,12 @@ export interface RenderControllerDeps<T extends Record<string, any> = any> {
|
|
|
56
61
|
getRangeMgr: () => RangeSelectionManager<T>;
|
|
57
62
|
/** F2: detail 렌더 컨텍스트 조립(비활성 시 undefined). / F2: build the detail render context (undefined when inactive). */
|
|
58
63
|
buildDetailRenderContext: () => DetailRenderContext | undefined;
|
|
59
|
-
/**
|
|
60
|
-
|
|
64
|
+
/**
|
|
65
|
+
* 그리기 요청을 낸다(그리드의 요청 입구로). 크기 바뀜 뒤 본문 그리기도 이 입구를 지나 다른 요청과 같은 길로 센다.
|
|
66
|
+
*
|
|
67
|
+
* Submit a render request to the grid's single entry, so the body repaint after a resize takes the same path as every other request.
|
|
68
|
+
*/
|
|
69
|
+
submitRender: (req: IRenderRequest) => void;
|
|
61
70
|
}
|
|
62
71
|
/**
|
|
63
72
|
* 렌더 루프의 유일 진입점. / Sole entry point of the render loop.
|
|
@@ -69,6 +78,68 @@ export interface RenderControllerDeps<T extends Record<string, any> = any> {
|
|
|
69
78
|
export declare class RenderController<T extends Record<string, any> = any> {
|
|
70
79
|
private _deps;
|
|
71
80
|
private _autoHeightWarned;
|
|
81
|
+
private _headerMeasured;
|
|
82
|
+
private readonly _geometry;
|
|
83
|
+
private readonly _windowPolicy;
|
|
84
|
+
private _scroll;
|
|
85
|
+
private _reveal;
|
|
86
|
+
private readonly _rangeRects;
|
|
87
|
+
/** 가로 창 정책. / The column-window policy. */
|
|
88
|
+
get windowPolicy(): ColumnWindowPolicy;
|
|
89
|
+
/** 본문 상자의 스크롤 관찰자(렌더러가 없으면 null). / The body box scroll observer (null without a renderer). */
|
|
90
|
+
get scroll(): ScrollObserver | null;
|
|
91
|
+
/**
|
|
92
|
+
* 가로 창 규칙이 묻는 이 그리드의 모양 — 자동 높이·보이는 폭·병합 유무·사용자 옵션.
|
|
93
|
+
*
|
|
94
|
+
* The grid shape the column-window rules ask about — auto height, visible width, merges, user option.
|
|
95
|
+
*/
|
|
96
|
+
shape(): GridShape;
|
|
97
|
+
/**
|
|
98
|
+
* 컬럼 ci 가 보이게 가로로 옮긴다(이미 보이거나 보이는 폭을 모르면 그대로). 기하에 묻고 스크롤 관찰자로만 옮긴다 — DOM 읽기 없음.
|
|
99
|
+
*
|
|
100
|
+
* Scroll horizontally so column ci is visible (no-op when already visible or the width is unknown). Asks the geometry and
|
|
101
|
+
* moves only through the scroll observer — no DOM reads.
|
|
102
|
+
*/
|
|
103
|
+
revealColumn(ci: number): void;
|
|
104
|
+
/**
|
|
105
|
+
* 범위 선택 테두리 사각형을 칸 요소 없이 기하와 행 번호로 셈한다(본문 상자 보이는 왼쪽 위 기준). 보이는 상자를 모르면 null.
|
|
106
|
+
*
|
|
107
|
+
* The range-selection border rectangle from geometry and row numbers, without cell elements (relative to the body box's
|
|
108
|
+
* visible top-left). Null when the visible box is unknown.
|
|
109
|
+
*/
|
|
110
|
+
rangeRect(range: CellRange): {
|
|
111
|
+
left: number;
|
|
112
|
+
top: number;
|
|
113
|
+
width: number;
|
|
114
|
+
height: number;
|
|
115
|
+
} | null;
|
|
116
|
+
/** 스크롤 관찰자를 놓는다(그리드를 없앨 때). / Release the scroll observer (on grid destroy). */
|
|
117
|
+
destroy(): void;
|
|
118
|
+
/** 그리는 쪽(머리글·본문·푸터)이 묻는 컬럼 기하. / The column geometry painters (header/body/footer) ask. */
|
|
119
|
+
get geometry(): IColumnGeometry;
|
|
120
|
+
/**
|
|
121
|
+
* 지금 입력에 맞춘 컬럼 기하(읽기 포트). 그리는 쪽(푸터 등)이 그릴 때마다 이것을 부른다 — 조립하는 쪽이 맞추는 일을 직접 부르지 않게.
|
|
122
|
+
*
|
|
123
|
+
* The column geometry aligned to current inputs (read port). Painters such as the footer call this each paint, so the composer never calls the alignment itself.
|
|
124
|
+
*/
|
|
125
|
+
currentGeometry(): IColumnGeometry;
|
|
126
|
+
/**
|
|
127
|
+
* 기하를 지금 입력에 맞추고 돌려준다 — 폭 계산 결과(빈 자리는 기본 폭, 그리는 쪽이 쓰던 값과 같음)·여분 컬럼 옵션·고정 수.
|
|
128
|
+
* 값이 같으면 판을 올리지 않는다. 머리글·본문을 그리기 직전과 푸터가 기하를 물을 때 불린다.
|
|
129
|
+
*
|
|
130
|
+
* Align the geometry to the current inputs — computed widths (gaps filled with the default width, as painters did),
|
|
131
|
+
* extra-column options and the frozen count — and return it. Same values keep the version. Called right before
|
|
132
|
+
* header/body painting and when the footer asks for the geometry.
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* 지금 옵션의 여분 컬럼(상태·끌기·행번호·체크·디테일 펼침 칸). 폭 배분과 기하가 같은 값을 쓰게 한 곳에서 만든다 — 디테일 펼침 칸은
|
|
136
|
+
* 디테일이 켜져 있고 토글 방식이 펼침 칸일 때만.
|
|
137
|
+
*
|
|
138
|
+
* Extra columns for the current options (state, drag, row number, check, detail expander). Built in one place so width
|
|
139
|
+
* allocation and the geometry use the same value — the detail expander only when detail is on with the expander-column toggle.
|
|
140
|
+
*/
|
|
141
|
+
private _extraColumns;
|
|
142
|
+
syncGeometry(): ColumnGeometry;
|
|
72
143
|
constructor(deps: RenderControllerDeps<T>);
|
|
73
144
|
/** @internal */
|
|
74
145
|
private _paginationHeight;
|
|
@@ -78,6 +149,14 @@ export declare class RenderController<T extends Record<string, any> = any> {
|
|
|
78
149
|
* re-renders the body.
|
|
79
150
|
*/
|
|
80
151
|
onResize(): void;
|
|
152
|
+
/**
|
|
153
|
+
* 본문 상자의 보이는 폭을 스크롤 관찰자에 넘긴다(가로 창·보이게 옮기기의 원천 — 같은 값이면 아무 일 없음).
|
|
154
|
+
* 크기가 바뀔 때와 세로 스크롤바가 생기거나 없어질 때 부른다.
|
|
155
|
+
*
|
|
156
|
+
* Hand the body box's visible width to the scroll observer (source of the column window and of reveal; no-op when unchanged).
|
|
157
|
+
* Called on resize and when the vertical scrollbar appears or disappears.
|
|
158
|
+
*/
|
|
159
|
+
syncViewportWidth(): void;
|
|
81
160
|
/**
|
|
82
161
|
* 전체 폭에서 고정 UI 요소(state/드래그/행번호/체크 컬럼)를 뺀 뒤 컬럼폭을 재계산한다.
|
|
83
162
|
* 사용자가 직접 조절한 폭은 보존한다.
|
|
@@ -87,6 +166,39 @@ export declare class RenderController<T extends Record<string, any> = any> {
|
|
|
87
166
|
* @param totalWidth - 컨테이너 전체 폭(px) / Total container width in px
|
|
88
167
|
*/
|
|
89
168
|
recalcWidths(totalWidth: number): void;
|
|
169
|
+
/**
|
|
170
|
+
* 너비 조절을 놓은 뒤(렌더러 콜백 onColResize 를 거쳐 옴): 사용자 폭으로 기억한다(필드 이름 열쇠 — 다음 폭 재계산에서도 남게).
|
|
171
|
+
* 놓기 길에서는 손잡이가 이미 같은 폭을 쓰고 그리기 요청을 냈으므로 여기서는 기억만 한다. 폭이 지금과 다를 때(손잡이를 잇기 전
|
|
172
|
+
* 길이나 직접 부름)만 폭을 쓰고 폭 자리 고치기를 요청한다 — 머리글·본문을 다시 만들지 않는다.
|
|
173
|
+
*
|
|
174
|
+
* After a width-resize release (arriving through the renderer callback onColResize): remember it as a user width (keyed by
|
|
175
|
+
* field, so recalculation keeps it). On the release path the handle has already written the same width and submitted the
|
|
176
|
+
* repaint request, so this only remembers. Only when the width differs (the pre-wiring path or a direct call) does it write
|
|
177
|
+
* the width and request a width-spot patch — header and body are never rebuilt.
|
|
178
|
+
*
|
|
179
|
+
* @param colIndex - 표시 잎 컬럼 번호 / Visible leaf column index
|
|
180
|
+
* @param newWidth - 새 폭(px) / New width (px)
|
|
181
|
+
*/
|
|
182
|
+
commitColumnWidth(colIndex: number, newWidth: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* 폭 입력의 주인이 컬럼 하나의 폭을 바꾼다: 정수로 만든 뒤 계산 결과 배열(자리가 있을 때만)과 기하에 같은 값을 쓰고 기하의 바뀐 몫을 돌려준다.
|
|
185
|
+
* 너비 조절이 폭을 바꾸는 유일한 길 — 기하에 직접 쓰는 곳은 이것과 syncGeometry 의 reset 둘뿐이라, 다음 맞춤이 끈 폭을 덮지 않는다.
|
|
186
|
+
*
|
|
187
|
+
* The width owner changes one column: round to an integer, write the same value to the computed-width array (if the slot
|
|
188
|
+
* exists) and the geometry, and return the geometry change. The only way resizing changes a width — the geometry is written
|
|
189
|
+
* only here and in syncGeometry's reset, so the next alignment never overwrites a dragged width.
|
|
190
|
+
*
|
|
191
|
+
* @param ci - 표시 잎 컬럼 번호 / Visible leaf column index
|
|
192
|
+
* @param width - 새 폭(px) / New width (px)
|
|
193
|
+
* @returns 기하의 바뀐 몫 / The geometry change
|
|
194
|
+
*/
|
|
195
|
+
setUserWidth(ci: number, width: number): GeometryChange;
|
|
196
|
+
/**
|
|
197
|
+
* 줄바꿈 머리글이 하나라도 있나(머리글 높이를 다시 재야 하는지). 「줄바꿈 켬」 또는 제목에 줄바꿈 문자가 있는 표시 잎.
|
|
198
|
+
*
|
|
199
|
+
* Whether any visible leaf header wraps (headerWrap on, or a newline in its title) — i.e. whether the header height must be re-measured.
|
|
200
|
+
*/
|
|
201
|
+
hasWrappedHeader(): boolean;
|
|
90
202
|
/**
|
|
91
203
|
* 헤더(컬럼 제목 행)를 다시 그린다. / Re-render the header (column title row).
|
|
92
204
|
*/
|
|
@@ -100,6 +212,14 @@ export declare class RenderController<T extends Record<string, any> = any> {
|
|
|
100
212
|
* so existing fixed-height behavior is unchanged. (Public: `OpenGrid` exposes this via a
|
|
101
213
|
* `_syncHeaderLayout` delegate — characterization tests call it directly.)
|
|
102
214
|
*/
|
|
215
|
+
/**
|
|
216
|
+
* 머리글 높이를 한 번 재어, 마지막으로 맞춘 높이와 다를 때만 본문 높이를 다시 맞춘다(줄바꿈 머리글을 끄는 프레임마다 불림).
|
|
217
|
+
* 「달라졌나」의 기준은 여기 하나 — 머리글을 다른 길로 다시 그려도 그 길의 맞춤이 기준을 함께 고친다.
|
|
218
|
+
*
|
|
219
|
+
* Measure the header height once and re-fit the body only when it differs from the last fitted height (called on each
|
|
220
|
+
* resize frame with wrapped headers). The single baseline lives here, so re-painting the header elsewhere also refreshes it.
|
|
221
|
+
*/
|
|
222
|
+
relayoutHeaderIfChanged(): void;
|
|
103
223
|
syncHeaderLayout(): void;
|
|
104
224
|
/**
|
|
105
225
|
* 지정 범위의 본문 행을 렌더한다(autoHeight 활성 시 범위 인자를 무시하고 전체 행을 렌더).
|
|
@@ -109,13 +229,11 @@ export declare class RenderController<T extends Record<string, any> = any> {
|
|
|
109
229
|
* @param startIndex - 렌더 시작 flat index / Starting flat index to render
|
|
110
230
|
* @param endIndex - 렌더 끝 flat index / Ending flat index to render
|
|
111
231
|
*/
|
|
112
|
-
doRender(startIndex: number, endIndex: number): void;
|
|
232
|
+
doRender(startIndex: number, endIndex: number, columns?: IColumnWindow, rowWork?: 'diff'): void;
|
|
113
233
|
/**
|
|
114
234
|
* 현재 화면에 보이는 행 범위를 반환한다. / Return the currently visible row range.
|
|
115
235
|
*
|
|
116
236
|
* @returns `[시작, 끝]` flat index 쌍 / `[start, end]` flat index pair
|
|
117
237
|
*/
|
|
118
238
|
visRange(): [number, number];
|
|
119
|
-
/** @internal */
|
|
120
|
-
private _visCount;
|
|
121
239
|
}
|
|
@@ -3,6 +3,8 @@ import { ColumnLayout } from './ColumnLayout.js';
|
|
|
3
3
|
import { VirtualScroll } from './VirtualScroll.js';
|
|
4
4
|
import { Pagination } from './Pagination.js';
|
|
5
5
|
import { SortItem, FilterItem } from './types.js';
|
|
6
|
+
import { IRenderRequest } from './domain/render/ports.js';
|
|
7
|
+
import { IHeaderSortIndicator } from './render/ports.js';
|
|
6
8
|
/**
|
|
7
9
|
* {@link SortFilterManager} 의존성 주입 계약. / Dependency-injection contract for {@link SortFilterManager}.
|
|
8
10
|
*
|
|
@@ -25,8 +27,9 @@ export interface SortFilterDeps<T extends Record<string, any>> {
|
|
|
25
27
|
getOptions: () => any;
|
|
26
28
|
/** 헤더(정렬/필터 표시)를 다시 그린다. / Re-render the header (sort/filter indicators). */
|
|
27
29
|
renderHeader: () => void;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
+
/** 그리기 요청을 낸다 — 정렬·필터 뒤 보이는 범위를 다시 그린다. 그리기는 요청 통로 하나로만 들어가 횟수·범위를 한곳에서 정한다.
|
|
31
|
+
* / Submit a render request — after sort/filter, repaint the visible range. Rendering enters through a single request channel so count and range are decided in one place. */
|
|
32
|
+
submitRender: (req: IRenderRequest) => void;
|
|
30
33
|
/** 스크린리더용 상태 안내. / Announce a status message for screen readers. */
|
|
31
34
|
announce: (msg: string) => void;
|
|
32
35
|
/** i18n: 정렬 상태어 + announce 해석. / i18n: resolve sort state words + announce. */
|
|
@@ -37,6 +40,9 @@ export interface SortFilterDeps<T extends Record<string, any>> {
|
|
|
37
40
|
* / C0.5/§2.5: after sort/filter, re-project the F1 range selection by its rowId
|
|
38
41
|
* set instead of clearing it. */
|
|
39
42
|
onReproject?: () => void;
|
|
43
|
+
/** 머리글 정렬 표시만 고치는 곳. 있으면 정렬 때 머리글을 다시 만들지 않고 이것에 정렬 목록을 알린다(없으면 renderHeader).
|
|
44
|
+
* / Patches header sort marks only; when given, sorting notifies it instead of rebuilding the header (otherwise renderHeader). */
|
|
45
|
+
sortIndicator?: IHeaderSortIndicator;
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* 정렬·필터 상태와 적용을 담당하는 매니저. / Manages sort/filter state and their application.
|
|
@@ -85,6 +91,8 @@ export declare class SortFilterManager<T extends Record<string, any> = any> {
|
|
|
85
91
|
* when no single column changed (everything cleared).
|
|
86
92
|
*/
|
|
87
93
|
private _emitSortChange;
|
|
94
|
+
/** 정렬 표시를 지금 목록에 맞춘다 — 표시 객체가 있으면 그것만, 없으면 머리글을 다시 그림. / Sync sort marks to the list. */
|
|
95
|
+
private _showSort;
|
|
88
96
|
/** 모든 정렬을 해제한다. / Clear all sorting. */
|
|
89
97
|
resetSort(): void;
|
|
90
98
|
/**
|
|
@@ -6,6 +6,16 @@ export interface VirtualScrollOptions {
|
|
|
6
6
|
overscan?: number;
|
|
7
7
|
/** 가시 범위 변화 시 호출되는 렌더 콜백. / Render callback fired when the visible range changes. */
|
|
8
8
|
onRender: (startIndex: number, endIndex: number) => void;
|
|
9
|
+
/**
|
|
10
|
+
* 주면 자체 rAF 를 쓰지 않고, 다시 그려야 할 때 그 자리에서 지금 범위로 이 함수를 부른다(프레임 맞추기·같은 프레임
|
|
11
|
+
* 요청 합치기는 받는 쪽 몫). 안 주면 지금처럼 자체 rAF 로 한 프레임에 한 번 `onRender`.
|
|
12
|
+
* 셋째 인자는 「스크롤 위치만 바뀌었나」(행 수·행 높이·보이는 높이가 바뀐 것과 가르려고 — 받는 쪽이 푸터 계산 등을 거름).
|
|
13
|
+
*
|
|
14
|
+
* When given, no own rAF is used: on every repaint need this is called right away with the current range
|
|
15
|
+
* (the receiver aligns to frames and merges requests). Otherwise the own rAF calls `onRender` once per frame.
|
|
16
|
+
* The third argument tells whether only the scroll position changed.
|
|
17
|
+
*/
|
|
18
|
+
requestRender?: (startIndex: number, endIndex: number, scrolledOnly: boolean) => void;
|
|
9
19
|
}
|
|
10
20
|
/** 현재 가시 행 범위와 스크롤 오프셋. / Current visible row range and scroll offset. */
|
|
11
21
|
export interface VirtualScrollRange {
|
|
@@ -39,6 +49,7 @@ export declare class VirtualScroll {
|
|
|
39
49
|
private _viewportHeight;
|
|
40
50
|
private _rafId;
|
|
41
51
|
private onRender;
|
|
52
|
+
private readonly _request;
|
|
42
53
|
/**
|
|
43
54
|
* 가상 스크롤 엔진 생성 및 컨테이너 scroll 리스너 부착. / Create the engine and attach the container scroll listener.
|
|
44
55
|
*
|
|
@@ -47,6 +58,7 @@ export declare class VirtualScroll {
|
|
|
47
58
|
*/
|
|
48
59
|
constructor(container: HTMLElement, options: VirtualScrollOptions);
|
|
49
60
|
private _onScroll;
|
|
61
|
+
/** @param scrolledOnly - 스크롤 위치만 바뀜(행 수·높이는 그대로) / only the scroll position changed */
|
|
50
62
|
private _scheduleRender;
|
|
51
63
|
/**
|
|
52
64
|
* 현재 스크롤 상태 기준 가시 행 범위 계산. / Compute the visible row range for the current scroll state.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ICellTextPolicy, TextSpec } from './geometryPorts.js';
|
|
2
|
+
export interface CellTextPolicyOptions {
|
|
3
|
+
/** 최소 글자 폭을 글꼴 크기의 몇 배로 볼지(기본 0.2). / Narrowest glyph as a fraction of font size. */
|
|
4
|
+
minGlyphEm?: number;
|
|
5
|
+
/** 덮는 폭을 컬럼 안쪽 폭의 몇 배로 잡을지(기본 2). / Covered width as a multiple of the inner width. */
|
|
6
|
+
headroom?: number;
|
|
7
|
+
/** 한 줄 몫에 더하는 글자 수(기본 16). / Extra characters per line. */
|
|
8
|
+
slack?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 칸에 넣을 글자 수 상한과 그 상한이 덮는 폭을 정하고 안전하게 자르는 유일한 곳. 상태가 없다.
|
|
12
|
+
* 불변: 결과는 원문의 앞부분 · 서로게이트 쌍·결합 문자를 가르지 않음 · 폭 없는 글자가 자를 자리 앞에 있으면 전문.
|
|
13
|
+
*
|
|
14
|
+
* Sole owner of the per-cell character limit, the width it covers, and safe truncation. Stateless.
|
|
15
|
+
*/
|
|
16
|
+
export declare class CellTextPolicy implements ICellTextPolicy {
|
|
17
|
+
private readonly _em;
|
|
18
|
+
private readonly _headroom;
|
|
19
|
+
private readonly _slack;
|
|
20
|
+
constructor(opts?: CellTextPolicyOptions);
|
|
21
|
+
/**
|
|
22
|
+
* 상한(글자 수). 자르지 않아야 할 때(상한 끔·자동 높이·템플릿, 보이는 폭 모름, 글꼴 지표가 이상함)는 Infinity.
|
|
23
|
+
* 한 줄: ceil(max(안쪽 폭 × 여유, 보이는 폭) / g) + slack.
|
|
24
|
+
* 여러 줄(행 높이 고정 + 줄바꿈): 줄 수 × (ceil(안쪽 폭 × 여유 / g) + slack).
|
|
25
|
+
*
|
|
26
|
+
* Infinity when the text must not be cut (unlimited, unknown viewport width, bad metrics).
|
|
27
|
+
*/
|
|
28
|
+
limit(spec: TextSpec): number;
|
|
29
|
+
/**
|
|
30
|
+
* 이 상한으로 채운 칸이 말줄임을 지키는 최대 컬럼 폭 — 컬럼이 이보다 넓어지면 다시 채운다.
|
|
31
|
+
* 한 줄: (limit − slack) × g + 좌우 여백. 여러 줄: 줄당 글자 수(limit ÷ 줄 수)로 같은 식.
|
|
32
|
+
*
|
|
33
|
+
* Widest column for which this limit still overflows; widen past it and the cell is refilled.
|
|
34
|
+
*/
|
|
35
|
+
coverWidth(limit: number, spec: TextSpec): number;
|
|
36
|
+
/**
|
|
37
|
+
* 앞부분 limit 자로 자른다. 자를 자리가 서로게이트 쌍 가운데면 한 자 더 넣는다(길이 ≤ limit + 1).
|
|
38
|
+
* 자를 자리까지(그 바로 뒤 한 자 포함)에 폭 없는 글자가 있으면 전문을 돌려준다 — 결합 문자를 가르지 않는 것도 이 규칙이 맡는다.
|
|
39
|
+
* 짧은 글·Infinity 는 그대로라 새 문자열을 만들지 않는다.
|
|
40
|
+
*
|
|
41
|
+
* Keeps the first `limit` code units, extending by one to keep a surrogate pair whole. Returns the
|
|
42
|
+
* whole text when a zero-width character sits at or before the cut (this also keeps combining sequences intact).
|
|
43
|
+
*/
|
|
44
|
+
fit(text: string, limit: number): string;
|
|
45
|
+
/** 최소 글자 폭 px. / Narrowest glyph width in px. */
|
|
46
|
+
private _glyph;
|
|
47
|
+
/** 컬럼 안쪽 폭(여백을 뺀 값, 0 아래로 안 감). / Inner column width, never negative. */
|
|
48
|
+
private _inner;
|
|
49
|
+
/** 여러 줄 칸 한 줄 몫 글자 수. / Characters per line of a wrapped cell. */
|
|
50
|
+
private _perLine;
|
|
51
|
+
/**
|
|
52
|
+
* 넣을 줄 수 = 보이는 줄 수(올림) + 1. 행이 한 줄보다 낮아도 2 줄 아래로 안 내린다(첫 줄을 늘 채움).
|
|
53
|
+
* 줄 높이가 이상하면(0·NaN) Infinity.
|
|
54
|
+
*
|
|
55
|
+
* Visible lines rounded up plus one, never below two. Infinity for a bad line height.
|
|
56
|
+
*/
|
|
57
|
+
private _lines;
|
|
58
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Px, LeafColIndex } from './types.js';
|
|
2
|
+
import { GeometryChange, IColumnGeometryWriter, IExtraColumns } from './geometryPorts.js';
|
|
3
|
+
/**
|
|
4
|
+
* 표시 잎 컬럼의 폭·left·전체 폭·고정 오른쪽 끝의 유일한 주인.
|
|
5
|
+
* 불변: leftOf(0) = extra.width() · leftOf(i+1) − leftOf(i) = widthOf(i) · totalWidth() = leftOf(count) ·
|
|
6
|
+
* 값이 바뀌면 version 이 1 오르고, 안 바뀌면 change.none(판 그대로).
|
|
7
|
+
* 반올림의 주인: 끌어서 정한 폭(resize)은 정수 px 로 든다(Math.round). 화면 배율 125%·150% 에서는 포인터 좌표가
|
|
8
|
+
* 소수라 제스처가 소수 폭을 내는데, 그것을 그대로 들면 머리글(표 흐름)과 본문(기하 위치)이 서로 다르게 반올림해
|
|
9
|
+
* 1px 어긋난다. 반올림을 여기 한 곳에서 해 두면 두 쪽이 같은 정수를 본다. 생성자·reset 이 받는 폭은 그대로 든다.
|
|
10
|
+
*
|
|
11
|
+
* Sole owner of column geometry. Version bumps by one on every real change; no-ops return change.none.
|
|
12
|
+
* Widths set by resize are rounded to whole px here (single owner of rounding); constructor/reset keep values as given.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ColumnGeometry implements IColumnGeometryWriter {
|
|
15
|
+
private _metrics;
|
|
16
|
+
private _widths;
|
|
17
|
+
private _extra;
|
|
18
|
+
private _offset;
|
|
19
|
+
private _version;
|
|
20
|
+
private _none;
|
|
21
|
+
/** _history[k] = 판 _base + k + 1 로 넘어간 변화. */
|
|
22
|
+
private readonly _history;
|
|
23
|
+
private _base;
|
|
24
|
+
/**
|
|
25
|
+
* @param widths 표시 잎 순서의 폭(px). 복사해서 쥔다 — 바깥 배열을 나중에 고쳐도 기하는 그대로. / copied
|
|
26
|
+
* @param extra 여분 컬럼 / extra columns
|
|
27
|
+
* @param frozenCount 왼쪽 고정 잎 컬럼 수 / left-frozen leaf count
|
|
28
|
+
*/
|
|
29
|
+
constructor(widths: readonly number[], extra: IExtraColumns, frozenCount: number);
|
|
30
|
+
get version(): number;
|
|
31
|
+
get count(): number;
|
|
32
|
+
get frozenCount(): number;
|
|
33
|
+
get extra(): IExtraColumns;
|
|
34
|
+
/** 정수가 아닌 번호(NaN 포함)·범위 밖이면 0. */
|
|
35
|
+
widthOf(ci: LeafColIndex): Px;
|
|
36
|
+
/** 범위 밖은 끝으로 자르고, 숫자가 아닌 번호는 0 번으로 본다(NaN 이 퍼지지 않게). */
|
|
37
|
+
leftOf(ci: LeafColIndex): Px;
|
|
38
|
+
/** [ci, ci+span) 폭의 합. 끝을 넘으면 끝에서 자르고, span ≤ 0 이면 0. / Clipped at the end; 0 for span ≤ 0. */
|
|
39
|
+
spanWidth(ci: LeafColIndex, span: number): Px;
|
|
40
|
+
totalWidth(): Px;
|
|
41
|
+
frozenRight(): Px;
|
|
42
|
+
/** 내용 x → 그 x 를 담는 잎 컬럼. 여분 구역·음수면 0, 끝을 넘으면 count−1, 컬럼이 없으면 0. */
|
|
43
|
+
colAt(x: Px): LeafColIndex;
|
|
44
|
+
/** 읽기 전용(얼린) 폭 배열 — 바뀔 때마다 새 배열이라 받아 둔 쪽의 값은 그 판 그대로다. */
|
|
45
|
+
widths(): readonly number[];
|
|
46
|
+
changesSince(version: number): GeometryChange;
|
|
47
|
+
reset(widths: readonly number[], extra: IExtraColumns, frozenCount: number): GeometryChange;
|
|
48
|
+
/**
|
|
49
|
+
* 컬럼 하나의 폭. 끄는 동안 입력마다 불린다. 폭은 정수 px 로 반올림해 [1, 상한] 으로 자르고, 숫자가 아니면 아무것도 안 한다.
|
|
50
|
+
* 번호가 범위 밖·정수 아님이면 RangeError — 배열 밖에 써서 컬럼 수가 늘어나는 일을 막는다.
|
|
51
|
+
*
|
|
52
|
+
* Called per input while dragging. Rounded to whole px and clamped to [1, max]; non-finite is a no-op;
|
|
53
|
+
* bad index throws RangeError.
|
|
54
|
+
*/
|
|
55
|
+
resize(ci: LeafColIndex, width: number): GeometryChange;
|
|
56
|
+
private _install;
|
|
57
|
+
private _commit;
|
|
58
|
+
private _structuralBody;
|
|
59
|
+
private _structuralChange;
|
|
60
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LeafColIndex } from './types.js';
|
|
2
|
+
import { IColumnWindow, WindowSegment } from './geometryPorts.js';
|
|
3
|
+
/**
|
|
4
|
+
* DOM 으로 둘 컬럼 집합. 구간은 정규형(오름차순·안 겹침·붙은 구간은 하나로 합침)으로만 들고 있어서,
|
|
5
|
+
* 같은 컬럼 집합이면 늘 같은 구간 목록이다 — `equals` 가 구간을 그대로 견주면 된다.
|
|
6
|
+
* 전 컬럼을 덮으면 `full` 이고 빈칸이 없다(가상화를 안 한 지금 DOM 과 같은 모양).
|
|
7
|
+
*
|
|
8
|
+
* The segments are kept canonical (ascending, disjoint, adjacent ones merged), so equal column sets
|
|
9
|
+
* always have equal segment lists. A window covering every column is `full` and has no gaps.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ColumnWindow implements IColumnWindow {
|
|
12
|
+
readonly full: boolean;
|
|
13
|
+
readonly segments: readonly WindowSegment[];
|
|
14
|
+
/** 표시 잎 컬럼 수(창이 어떤 컬럼 구성에서 계산됐나 — 구성이 바뀌면 낡은 창). */
|
|
15
|
+
readonly count: number;
|
|
16
|
+
private readonly _gaps;
|
|
17
|
+
private constructor();
|
|
18
|
+
/** 전 컬럼 창. / Window covering every column. */
|
|
19
|
+
static full(count: number): ColumnWindow;
|
|
20
|
+
/**
|
|
21
|
+
* 구간 목록으로 만든다. 겹치거나 거꾸로 놓였거나 범위 밖이면 RangeError — 그리는 쪽이 같은 칸을 두 번 만들거나
|
|
22
|
+
* 없는 컬럼 정의를 읽는 일을 여기서 막는다. 붙은 구간은 합치고, 넘겨준 배열은 복사해 든다.
|
|
23
|
+
*
|
|
24
|
+
* Throws RangeError on overlap, wrong order or out-of-range indices; adjacent segments are merged
|
|
25
|
+
* and the input array is copied.
|
|
26
|
+
*/
|
|
27
|
+
static of(segments: readonly WindowSegment[], count: number): ColumnWindow;
|
|
28
|
+
contains(ci: LeafColIndex): boolean;
|
|
29
|
+
forEachColumn(fn: (ci: LeafColIndex) => void): void;
|
|
30
|
+
/**
|
|
31
|
+
* 빈칸이 덮을 구간: 첫 구간 앞 · 구간 사이 · 마지막 구간 뒤. 첫 구간 앞도 내야 고정 컬럼 없는 그리드에서
|
|
32
|
+
* 가로로 옮긴 창이 왼쪽 0 에 붙어 그려지지 않는다.
|
|
33
|
+
*
|
|
34
|
+
* Gaps before the first segment, between segments and after the last one.
|
|
35
|
+
*/
|
|
36
|
+
gaps(): readonly WindowSegment[];
|
|
37
|
+
equals(other: IColumnWindow): boolean;
|
|
38
|
+
private static _checkCount;
|
|
39
|
+
private static _gapsOf;
|
|
40
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Px, LeafColIndex } from './types.js';
|
|
2
|
+
import { IColumnGeometry, IColumnWindow, IColumnWindowPolicy, GridShape, WindowQuery, WindowRule } from './geometryPorts.js';
|
|
3
|
+
import { IWindowingPort } from './ports.js';
|
|
4
|
+
import { ColumnWindow } from './ColumnWindow.js';
|
|
5
|
+
/**
|
|
6
|
+
* 가로 가상화 정책. 「창을 써도 되나」는 조건문이 아니라 규칙 목록이 답한다 — 규칙 하나라도 false 면 전 컬럼.
|
|
7
|
+
* 창 = 고정 컬럼 구간 + 보이는 범위 양옆으로 `max(minMarginPx, 보이는 폭 × marginRatio)` px 를 더한 연속 구간 하나
|
|
8
|
+
* (꼭 넣을 컬럼이 밖에 있으면 그 컬럼까지 넓힌 껍질). 그려 둔 창이 「보이는 범위 + 여유의 절반」을 아직 덮는 동안은
|
|
9
|
+
* 창을 바꾸지 않는다(이력) — 스크롤 몇 px 마다 끝 칸을 붙였다 뗐다 하지 않게.
|
|
10
|
+
* 가로 좌표는 기하의 내용 좌표(여분 칸 왼쪽 끝 = 0)이고, 스크롤 값도 같은 원점으로 받는다.
|
|
11
|
+
*
|
|
12
|
+
* Window = frozen segment + one contiguous segment spanning the visible range plus a pixel margin on each side
|
|
13
|
+
* (hull-widened to include pinned columns). Hysteresis: a drawn window is kept while it still covers the
|
|
14
|
+
* visible range plus half the margin. x is the geometry content coordinate (left edge of extra columns = 0).
|
|
15
|
+
*/
|
|
16
|
+
export declare class ColumnWindowPolicy implements IColumnWindowPolicy, Pick<IWindowingPort, 'horizontalWindow'> {
|
|
17
|
+
private readonly _geometry;
|
|
18
|
+
private readonly _rules;
|
|
19
|
+
private readonly _minMargin;
|
|
20
|
+
private readonly _ratio;
|
|
21
|
+
/** 같은 컬럼 수의 전 컬럼 창은 하나만 만들어 돌려쓴다(스크롤마다 새 값을 만들지 않게). */
|
|
22
|
+
private _full;
|
|
23
|
+
/** `next` 가 본 직전 스크롤 값(나아가는 방향·속도). 처음엔 모름(NaN). / Previous scroll seen by `next`. */
|
|
24
|
+
private _lastScroll;
|
|
25
|
+
constructor(geometry: IColumnGeometry, rules: readonly WindowRule[], opts?: {
|
|
26
|
+
minMarginPx?: number;
|
|
27
|
+
marginRatio?: number;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* 기본 규칙 넷. 서로 모르고 순서도 상관없다. 전 컬럼으로 그리는 경우는 자동 높이(화면 밖 긴 칸이 행 높이를 정함) ·
|
|
31
|
+
* 폭 모름(숨은 컨테이너 등 — 지금처럼 전 칸) · 병합(가려진 칸 자리를 지금 모양 그대로 지키려고) · 사용자가 끔.
|
|
32
|
+
* 줄바꿈 칸은 행 높이가 옵션 값이라 규칙에 없다 — 줄바꿈 + 고정 행 높이에서도 창을 쓴다.
|
|
33
|
+
* 「병합이 있나」는 모양의 `mergeEmpty` 하나만 본다 — 그 값을 병합 원천에서 읽어 채우는 일은 모양을 만드는 쪽 몫
|
|
34
|
+
* (원천이 둘이면 어긋날 때 어느 쪽이 맞는지 정책이 모른다).
|
|
35
|
+
*
|
|
36
|
+
* Four independent, order-free rules. Wrapped cells with a fixed row height keep the window on.
|
|
37
|
+
* Merge presence is read from `GridShape.mergeEmpty` only.
|
|
38
|
+
*/
|
|
39
|
+
static defaultRules(): readonly WindowRule[];
|
|
40
|
+
/**
|
|
41
|
+
* 프레임마다 부르는 입구: 그려 둔 창을 그대로 둘지(모양이 창을 허용하고 이력상 아직 덮음) 새로 셀지를 한 번에 답한다.
|
|
42
|
+
* 새로 셀 때는 직전 프레임에서 움직인 만큼 나아가는 쪽 여유를 더 넓힌다 — 빠르게 긁어도 다음 프레임 자리가 이미 그려져
|
|
43
|
+
* 있게. 뒤쪽은 기본 여유 그대로라 방향을 바꿔도 빈 칸이 생기지 않는다. 더하는 몫은 보이는 폭 한 장까지.
|
|
44
|
+
* 움직임 이력은 이 입구만 쓴다(`compute`·`covers` 는 같은 입력에 늘 같은 답).
|
|
45
|
+
*
|
|
46
|
+
* Per-frame entry: keep the drawn window (shape allows it and it still covers) or compute a new one whose
|
|
47
|
+
* leading margin grows with the last frame's movement. Only this entry keeps movement history.
|
|
48
|
+
*/
|
|
49
|
+
next(drawn: IColumnWindow | null, q: WindowQuery, shape: GridShape): IColumnWindow;
|
|
50
|
+
compute(q: WindowQuery, shape: GridShape): ColumnWindow;
|
|
51
|
+
private _window;
|
|
52
|
+
/**
|
|
53
|
+
* 그려 둔 창이 「보이는 범위 + 여유의 절반」을 px 로 아직 덮나. 덮으면 창을 바꾸지 않는다.
|
|
54
|
+
* 컬럼 구성이 바뀐 창(컬럼 수가 다르거나 지금 고정 구간을 담지 않음)은 덮지 않는다 — 옛 번호가 새 구성에서 뜻이 달라지므로.
|
|
55
|
+
* 전 컬럼 창은 늘 false: 그 창이 규칙 때문에 전 컬럼인지(자동 높이·폭 모름 …) 여기서는 모양을 모르므로 compute 에 맡긴다.
|
|
56
|
+
* 규칙이 여전히 전 컬럼을 요구하면 compute 가 같은 전 컬럼 창 객체를 돌려주어 `equals` 가 바로 같다고 답한다.
|
|
57
|
+
* 꼭 넣을 컬럼이 창 밖이면 덮지 않는다.
|
|
58
|
+
*
|
|
59
|
+
* Hysteresis test in pixels. A window built for another column layout never covers; a full window always
|
|
60
|
+
* answers false so that compute (which returns the same cached full window) decides.
|
|
61
|
+
*/
|
|
62
|
+
covers(drawn: IColumnWindow, q: WindowQuery): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 기존 포트 호환: 같은 규칙·같은 여유로 계산한 창의 껍질을 반열림 `{start, end}` 로 돌려준다.
|
|
65
|
+
* 그 포트는 폭 말고는 모양을 모르므로 나머지 규칙 입력은 「허용」으로 둔다(폭 0 이면 여전히 전 컬럼).
|
|
66
|
+
* 고정 컬럼이 있으면 껍질이 0 부터라 가상화 없는 넓은 집합(0..창 끝)이 된다 — 호환용일 뿐, 새 코드는 compute 를 쓴다.
|
|
67
|
+
*
|
|
68
|
+
* Legacy port: hull of the computed window as half-open {start, end}; with frozen columns the hull starts at 0.
|
|
69
|
+
*/
|
|
70
|
+
horizontalWindow(scrollLeft: Px, viewportW: Px): {
|
|
71
|
+
start: LeafColIndex;
|
|
72
|
+
end: LeafColIndex;
|
|
73
|
+
};
|
|
74
|
+
private _allows;
|
|
75
|
+
/** 보이는 폭: 유한한 양수가 아니면 0(모름). */
|
|
76
|
+
private static _width;
|
|
77
|
+
/**
|
|
78
|
+
* 스크롤 값을 브라우저처럼 [0, 전체 폭 − 보이는 폭] 에 묶는다. 컬럼을 숨기거나 좁힌 직후 관찰자가 든 값이 한 프레임
|
|
79
|
+
* 낡아 끝 너머여도 실제로 보일 컬럼을 빠뜨리지 않게. 유한수가 아니면 0.
|
|
80
|
+
*/
|
|
81
|
+
private _scroll;
|
|
82
|
+
/** 차례대로 놓인 겹침 없는 구간 목록에 컬럼 하나짜리 토막을 제자리에 끼운다(이미 담겨 있으면 그대로). / Inserts a one-column segment in order. */
|
|
83
|
+
private static _insertColumn;
|
|
84
|
+
private _margin;
|
|
85
|
+
/** 내용 x → 컬럼(기하에 물음). 음수·여분 구역은 0, 끝 너머는 마지막 컬럼. */
|
|
86
|
+
private _col;
|
|
87
|
+
private _fullWindow;
|
|
88
|
+
private static _nonNegative;
|
|
89
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Px } from './types.js';
|
|
2
|
+
import { ExtraColumnId, IExtraColumns } from './geometryPorts.js';
|
|
3
|
+
/** fromOptions 가 읽는 옵션. 참거짓은 지금 코드처럼 truthy 로 본다(`=== true` 가 아님). */
|
|
4
|
+
export interface ExtraColumnOptions {
|
|
5
|
+
stateColumn?: boolean;
|
|
6
|
+
draggable?: boolean;
|
|
7
|
+
rowNumber?: boolean;
|
|
8
|
+
checkColumn?: boolean;
|
|
9
|
+
detailExpanderCol?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 여분 컬럼의 켜짐·순서·폭을 아는 유일한 곳(불변 값).
|
|
13
|
+
* 불변: width() = Σ 켜진 폭, ids 순서 = state→drag→rowNumber→check→detail.
|
|
14
|
+
*
|
|
15
|
+
* Sole owner of extra-column on/off, order and width (immutable value).
|
|
16
|
+
*/
|
|
17
|
+
export declare class ExtraColumns implements IExtraColumns {
|
|
18
|
+
readonly ids: readonly ExtraColumnId[];
|
|
19
|
+
private readonly _width;
|
|
20
|
+
private readonly _left;
|
|
21
|
+
private readonly _total;
|
|
22
|
+
private constructor();
|
|
23
|
+
/**
|
|
24
|
+
* 그리드 옵션에서 만든다. 옵션이 없어도(undefined) 던지지 않고 「여분 없음」을 돌려준다 — 래퍼가 옵션 없이 부를 수 있다.
|
|
25
|
+
*
|
|
26
|
+
* Builds from grid options; undefined yields the empty set instead of throwing.
|
|
27
|
+
*/
|
|
28
|
+
static fromOptions(o: ExtraColumnOptions | null | undefined): ExtraColumns;
|
|
29
|
+
/** 꺼진 컬럼이면 0. / 0 when that column is off. */
|
|
30
|
+
widthOf(id: ExtraColumnId): Px;
|
|
31
|
+
/**
|
|
32
|
+
* 고정(sticky) 때 left. 꺼진 컬럼이면 width() — 묻는 쪽에 NaN·undefined 가 퍼지지 않게 끝자리를 준다.
|
|
33
|
+
*
|
|
34
|
+
* Sticky left; for an off column returns width() so callers never see NaN.
|
|
35
|
+
*/
|
|
36
|
+
leftOf(id: ExtraColumnId): Px;
|
|
37
|
+
/** Σ 켜진 여분 컬럼 폭. / Sum of enabled extra-column widths. */
|
|
38
|
+
width(): Px;
|
|
39
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CellRangeLike, IColumnGeometry, IRangeRectCalculator } from './geometryPorts.js';
|
|
2
|
+
export interface RangeRectOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 행 아래 테두리 두께(px). 행은 border-box 라 칸 높이 = rowHeight − 이 값이고, 지금 테두리 높이도 그 칸 높이로 잰다(기본 1).
|
|
5
|
+
*
|
|
6
|
+
* Row bottom border thickness; cells are rowHeight minus this, and today's border is measured from cells (default 1).
|
|
7
|
+
*/
|
|
8
|
+
rowBorderPx?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 범위 테두리 좌표를 기하·행 번호로 계산하는 곳. 상태가 없어 기하가 바뀌면 다음 호출에 그대로 반영된다.
|
|
12
|
+
* 불변: 칸이 DOM 에 없어도 같은 좌표 · DOM 읽기 0.
|
|
13
|
+
*
|
|
14
|
+
* Stateless: geometry changes show up on the next call.
|
|
15
|
+
*/
|
|
16
|
+
export declare class RangeRectCalculator implements IRangeRectCalculator {
|
|
17
|
+
private readonly _geometry;
|
|
18
|
+
private readonly _rowBorder;
|
|
19
|
+
constructor(geometry: IColumnGeometry, opts?: RangeRectOptions);
|
|
20
|
+
/**
|
|
21
|
+
* @param scroll 본문 상자의 scrollTop·scrollLeft / body scroller offsets
|
|
22
|
+
* @param headerHeight top 에 더할 값. 본문 상자 기준이면 0, 컨테이너 기준이면 머리글 높이. / added to top
|
|
23
|
+
*/
|
|
24
|
+
rect(range: CellRangeLike, scroll: {
|
|
25
|
+
readonly top: number;
|
|
26
|
+
readonly left: number;
|
|
27
|
+
}, rowHeight: number, headerHeight: number): {
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
/** 칸 하나의 보이는 x. 고정 컬럼은 sticky 라 스크롤을 안 탄다. */
|
|
34
|
+
private _cellX;
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IViewportHeightJudge, ViewportSample, ViewportVerdict } from './geometryPorts.js';
|
|
2
|
+
export interface ViewportHeightJudgeOptions {
|
|
3
|
+
/** 보이는 구간 앞뒤로 더 그릴 높이 px(기본 200). / Extra px drawn above and below the visible part. */
|
|
4
|
+
overscanPx?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 컨테이너 높이가 정해졌는지·내용이 높이를 정하는지 판정하고 세로 창에 쓸 높이·잘림을 내는 유일한 곳.
|
|
8
|
+
* 상태가 없다(표본만 읽고 고치지 않음).
|
|
9
|
+
* 불변: 높이가 정해진 컨테이너엔 지금과 같은 값 · 옵트인 사용자엔 지금 클램프 값 · 배치 높이 0(jsdom)엔 bounded ·
|
|
10
|
+
* 이상한 표본엔 bounded · clip ⊂ [0, 전체 내용 높이].
|
|
11
|
+
*
|
|
12
|
+
* Sole owner of the viewport-height verdict. Stateless; never mutates the sample.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ViewportHeightJudge implements IViewportHeightJudge {
|
|
15
|
+
private readonly _overscan;
|
|
16
|
+
constructor(opts?: ViewportHeightJudgeOptions);
|
|
17
|
+
judge(sample: ViewportSample): ViewportVerdict;
|
|
18
|
+
/** 「내용이 높이를 정함」 조건. 표본 값이 이상하면 false(지금 동작 쪽). / Content-driven test; odd samples give false. */
|
|
19
|
+
private _isContentDriven;
|
|
20
|
+
/**
|
|
21
|
+
* 보이는 구간을 본문 좌표로 옮겨 내용 범위로 자르고 앞뒤 여유를 더한다.
|
|
22
|
+
* 그리드가 화면 아래에 있으면 맨 위 여유만큼, 이미 지나쳤으면 맨 끝 여유만큼을 낸다(빈 구간을 내지 않음).
|
|
23
|
+
*
|
|
24
|
+
* Visible part in body coordinates, clamped to content, plus overscan. Below the screen: the
|
|
25
|
+
* first overscan px; scrolled past: the last overscan px.
|
|
26
|
+
*/
|
|
27
|
+
private _clip;
|
|
28
|
+
}
|