open-grid 1.6.1 → 1.7.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 +62 -0
- package/dist/ExportProgressView-BYPw8osg.cjs +2 -0
- package/dist/ExportProgressView-Bt5-z7rE.js +2 -0
- package/dist/LcpMergeOrderer-CeP6C6G1.cjs +2 -0
- package/dist/LcpMergeOrderer-Ebwuir-r.js +2 -0
- package/dist/OpenGrid-Bh1NMOcm.cjs +98 -0
- package/dist/OpenGrid-CeXt04ho.js +98 -0
- package/dist/Registry-CrT46EAO.js +2 -0
- package/dist/Registry-DpHOpU5V.cjs +2 -0
- package/dist/XlsxChannel-CuOZ3LQz.js +2 -0
- package/dist/XlsxChannel-DQHLGend.cjs +2 -0
- package/dist/XlsxWorkbookWriter-DixuNGtw.cjs +3 -0
- package/dist/XlsxWorkbookWriter-VgbibI0Z.js +3 -0
- package/dist/fflate-Cs3txMgg.js +2 -0
- package/dist/fflate-G9RAFEgF.cjs +2 -0
- package/dist/index-1OXjJmct.js +2 -0
- package/dist/index-B5V7e4Xc.js +2 -0
- package/dist/index-DbKDox8y.cjs +2 -0
- package/dist/index-HaDoF1HM.cjs +2 -0
- package/dist/open-grid-react.cjs +1 -27
- package/dist/open-grid-react.js +1 -30
- package/dist/open-grid-vue.cjs +1 -31
- package/dist/open-grid-vue.js +1 -33
- package/dist/open-grid.cjs +6 -275
- package/dist/open-grid.js +6 -293
- package/dist/sinks-BCZFMGQJ.cjs +2 -0
- package/dist/sinks-qkBJ5bKn.js +2 -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 +25 -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 +38 -1
- package/dist/types/core/export/channels/XlsxRichTextRun.d.ts +14 -0
- package/dist/types/core/export/channels/XlsxSheetXml.d.ts +19 -0
- package/dist/types/core/export/channels/XlsxStyleEntries.d.ts +80 -0
- package/dist/types/core/export/channels/XlsxStylesRegistry.d.ts +20 -0
- package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +20 -0
- package/dist/types/core/export/channels/XlsxXml.d.ts +6 -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/export/types.d.ts +63 -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 +94 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
- package/dist/xlsx.min-CMvrM6b4.cjs +138 -0
- package/dist/xlsx.min-i_b-4PvU.js +138 -0
- package/package.json +3 -8
- package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
- package/dist/OpenGrid-D6YxCsnV.js +0 -7472
- package/dist/Registry-CPJYOqCn.js +0 -74
- package/dist/Registry-D74ZmdDz.cjs +0 -71
- package/dist/index-CeJ-0-80.cjs +0 -260
- package/dist/index-D0DJtKYI.cjs +0 -452
- package/dist/index-DnarQ4eR.js +0 -266
- package/dist/index-VkKgQ506.js +0 -481
- package/dist/xlsx.min-BQ1o3sB6.cjs +0 -11793
- package/dist/xlsx.min-Bbz2ZypC.js +0 -11794
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { GridShape, IColumnWindow, WindowQuery, IColumnGeometry } from '../coordinate/geometryPorts.js';
|
|
2
|
+
import { ColWork, IRenderPlan, IRenderPlanner, IRenderRequest, NextState, RowWork } from '../domain/render/ports.js';
|
|
3
|
+
import { FramePort, IFooterView, IGeometryApplier, IHeaderSortIndicator, IRangeOverlay, IRenderScheduler, IScrollObserver } from './ports.js';
|
|
4
|
+
/**
|
|
5
|
+
* 옛 그리기 길 — 본문을 행 범위로 통째 다시 그리는 함수와, 「보이는 범위」를 묻는 함수.
|
|
6
|
+
* 끝 번호는 포함(지금 `_doRender(시작, 끝)` 과 같은 뜻), `(0, −1)` 은 본문 비우기.
|
|
7
|
+
*
|
|
8
|
+
* Legacy paint path: full body repaint over an inclusive row range, plus the current visible range.
|
|
9
|
+
*/
|
|
10
|
+
export interface LegacyPaintPort {
|
|
11
|
+
/**
|
|
12
|
+
* `columns` = 그릴 가로 창(가로 창을 쓰지 않으면 넘기지 않음 — 받는 쪽은 전 컬럼). `rowWork` = `'diff'` 면 행 차분
|
|
13
|
+
* (남는 행은 그대로 두고 들어온 행만 만들고 나간 행만 뗌 — 남는 행의 창 옮김까지 함께), 없으면 그 범위를 통째로.
|
|
14
|
+
*
|
|
15
|
+
* `columns` = column window (omitted = all columns); `rowWork: 'diff'` asks for a row diff (keep remaining rows,
|
|
16
|
+
* create entering, remove leaving — including the window shift of remaining rows); omitted = full repaint of the range.
|
|
17
|
+
*/
|
|
18
|
+
paintRows(startIndex: number, endIndex: number, columns?: IColumnWindow, rowWork?: 'diff'): void;
|
|
19
|
+
visibleRows(): readonly [number, number];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 스케줄러 협력자 — 그리기 객체가 하나씩 물릴 때마다 칸이 자란다(없는 칸은 옛 그리기 길이 맡음).
|
|
23
|
+
*
|
|
24
|
+
* Collaborators; a slot is added as each paint object is wired in (missing slots are still handled by the legacy path).
|
|
25
|
+
*/
|
|
26
|
+
export interface RenderSchedulerStartDeps {
|
|
27
|
+
readonly planner: IRenderPlanner;
|
|
28
|
+
readonly paint: LegacyPaintPort;
|
|
29
|
+
/** 푸터 막대(있으면 계획의 footer 일을 여기서 시킴). / Footer bar; when present the plan's footer work runs here. */
|
|
30
|
+
readonly footer?: IFooterView;
|
|
31
|
+
/**
|
|
32
|
+
* 머리글 정렬 표시(있으면 계획의 `header: 'sortIndicator'` 를 여기서 — 머리글을 다시 만들지 않고 화살표·aria-sort 만).
|
|
33
|
+
* 지금 정렬 목록은 `sortList` 로 묻는다(둘이 함께 있어야 실행).
|
|
34
|
+
*
|
|
35
|
+
* Header sort marks; when present the plan's `header: 'sortIndicator'` patches arrows/aria-sort here (no header rebuild).
|
|
36
|
+
*/
|
|
37
|
+
readonly sort?: IHeaderSortIndicator;
|
|
38
|
+
readonly sortList?: () => readonly {
|
|
39
|
+
readonly field: string;
|
|
40
|
+
readonly dir: 'asc' | 'desc';
|
|
41
|
+
}[];
|
|
42
|
+
/**
|
|
43
|
+
* 기하와 그 투영(있으면 계획의 `geometry` 를 여기서 — 등록해 둔 폭 자리에만 px 를 씀, 본문을 다시 만들지 않음).
|
|
44
|
+
* 둘이 함께 있어야 실행. 스케줄러가 「마지막으로 DOM 에 반영한 기하 판」을 든다.
|
|
45
|
+
* 값 대신 「지금 것을 돌려주는 함수」도 받는다 — 스케줄러는 그리드를 붙이기(마운트) 전에 생기고 기하·투영은 그 뒤에 생기므로
|
|
46
|
+
* (아직 없으면 null → 그 일을 건너뜀). 쓰는 몫만 받는다(판 번호·폭 목록·바뀐 몫 / 바뀐 몫 반영).
|
|
47
|
+
*
|
|
48
|
+
* Geometry and its projector, or functions returning the current ones (they appear after the scheduler, at mount;
|
|
49
|
+
* null skips the work). Only the members the scheduler uses are required.
|
|
50
|
+
*/
|
|
51
|
+
readonly geometry?: Late<Pick<IColumnGeometry, 'version' | 'widths' | 'changesSince'>>;
|
|
52
|
+
readonly applier?: Late<Pick<IGeometryApplier, 'applyChange'>>;
|
|
53
|
+
/**
|
|
54
|
+
* 줄바꿈 머리글이면 기하를 반영한 프레임마다 부른다 — 머리글 높이를 재어 달라졌을 때만 본문 자리를 맞추는 일은 그 주인 몫
|
|
55
|
+
* (높이 기준을 한 곳만 들어야 머리글을 다른 길로 다시 그려도 기준이 낡지 않는다).
|
|
56
|
+
*
|
|
57
|
+
* Called once per geometry frame for wrapping headers; comparing the header height with the last laid-out one is the
|
|
58
|
+
* owner's job (one baseline, so a header redrawn by another path never leaves it stale).
|
|
59
|
+
*/
|
|
60
|
+
readonly headerLayout?: () => void; /** 머리글이 줄바꿈되나(아니면 높이를 묻지 않음 — 끄는 프레임마다 배치를 강제하지 않게). / Whether the header wraps. */
|
|
61
|
+
readonly headerWraps?: () => boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 범위 덧그림. 행을 다시 그리지 않는 계획(폭만 바뀜 등)에서 계획의 `overlay` 를 여기서 — 행을 다시 그리는 계획은 옛 그리기 길이
|
|
64
|
+
* 이미 덧그림을 고친다. 고를 범위가 없으면 덧그림 쪽이 바로 돌아간다.
|
|
65
|
+
*
|
|
66
|
+
* Range overlay; runs the plan's `overlay` for plans without row work (the legacy row path already repaints it).
|
|
67
|
+
*/
|
|
68
|
+
readonly overlay?: IRangeOverlay;
|
|
69
|
+
/**
|
|
70
|
+
* 가로 창(넷이 다 있어야 씀 — 하나라도 없으면 전 컬럼으로 그려 지금과 같다).
|
|
71
|
+
* `window` = 창 정책의 프레임 입구(그려 둔 창을 둘지·새로 셀지), `scroll` = 이벤트에서 이미 읽은 가로 위치·보이는 폭,
|
|
72
|
+
* `shape` = 창 규칙의 입력(자동 높이·병합·옵션), `body` = 그려 둔 창을 아는 본문과 「창만 옮기기」.
|
|
73
|
+
* `pinnedColumns` = 화면 밖이어도 그릴 컬럼(편집 중·포커스 — 없으면 빈 목록).
|
|
74
|
+
*
|
|
75
|
+
* Column window; used only when all four are present, otherwise every column is painted exactly as before.
|
|
76
|
+
*/
|
|
77
|
+
readonly window?: Late<WindowEntry>;
|
|
78
|
+
readonly scroll?: Late<Pick<IScrollObserver, 'box'>>;
|
|
79
|
+
readonly shape?: () => GridShape;
|
|
80
|
+
readonly body?: Late<BodyWindowPort>;
|
|
81
|
+
readonly pinnedColumns?: () => readonly number[];
|
|
82
|
+
}
|
|
83
|
+
/** 값, 또는 지금 값을 돌려주는 함수(아직 없으면 null). / A value, or a function returning the current one (null = not yet). */
|
|
84
|
+
export type Late<T extends object> = T | (() => T | null);
|
|
85
|
+
/** 창 정책의 프레임 입구. / The window policy's per-frame entry. */
|
|
86
|
+
export interface WindowEntry {
|
|
87
|
+
next(drawn: IColumnWindow | null, q: WindowQuery, shape: GridShape): IColumnWindow;
|
|
88
|
+
}
|
|
89
|
+
/** 본문 쪽 창 몫: 그려 둔 창과 「창만 옮기기」. / The body's window share: drawn window and window-only update. */
|
|
90
|
+
export interface BodyWindowPort {
|
|
91
|
+
/**
|
|
92
|
+
* 그려 둔 창과, 그려 둔 행에 행 차분을 막는 종류(세로 병합·묶음·나무·디테일·자동 높이)가 있는지 — 본문만 안다.
|
|
93
|
+
* `diffBlocked` 를 주지 않으면 막힘으로 본다(통째 — 안전한 쪽).
|
|
94
|
+
*
|
|
95
|
+
* Drawn window, and whether the drawn rows block a row diff; a missing `diffBlocked` counts as blocked.
|
|
96
|
+
*/
|
|
97
|
+
readonly drawn: {
|
|
98
|
+
readonly columns: IColumnWindow | null;
|
|
99
|
+
readonly diffBlocked?: boolean;
|
|
100
|
+
};
|
|
101
|
+
update(next: NextState, rows: RowWork, cols: ColWork): void;
|
|
102
|
+
}
|
|
103
|
+
/** rAF 를 감싼 프레임 시계. / requestAnimationFrame-backed frame clock. */
|
|
104
|
+
export declare const RAF_FRAME: FramePort;
|
|
105
|
+
/**
|
|
106
|
+
* 요청을 모았다가 계획을 받아 실행하는 유일한 곳. 「할 일 결정」은 하지 않는다(계획 객체 몫).
|
|
107
|
+
* - sync 요청: 쌓인 요청까지 합쳐 그 자리에서 한 번 실행(예약 프레임 취소) — 공개 API 의 「호출이 끝나면 DOM 이 맞음」.
|
|
108
|
+
* - sync 아닌 요청: 합쳐 두고 다음 프레임에 한 번.
|
|
109
|
+
* - 실행 중 들어온 요청: sync 아니면 다음 프레임으로. sync 면 안쪽으로 재귀하지 않고 지금 실행이 끝난 바로 뒤
|
|
110
|
+
* 같은 호출 안에서 한 번 더(부른 쪽이 돌아올 때 DOM 이 맞음 · 재진입 없음).
|
|
111
|
+
* - 쌓인 sync 아닌 요청(세로 스크롤 쪽)은 sync 요청이 오면 함께 얼려 한 번에 그린다 — 같은 프레임에 두 번 그리지 않게.
|
|
112
|
+
* - 프레임에서 실행하다 던진 오류는 보고만 하고 다음 요청을 계속 받는다. sync 실행의 오류는 부른 쪽으로 그대로 던진다.
|
|
113
|
+
* - 합치기 규칙은 요청 쪽 누적기(`RenderRequestAccumulator`)가 안다 — 여기서는 하나를 들고 더하기만 하고 실행할 때 얼린다.
|
|
114
|
+
*
|
|
115
|
+
* Single place that batches requests and runs the planner's plan. Sync requests flush everything now; others wait
|
|
116
|
+
* for the next frame; mid-run requests never recurse (sync ones run again right after the current run, others next frame).
|
|
117
|
+
* The merge rules belong to the request-side accumulator; this object only adds to one and freezes it per run.
|
|
118
|
+
*/
|
|
119
|
+
export declare class RenderScheduler implements IRenderScheduler {
|
|
120
|
+
private readonly _frame;
|
|
121
|
+
private readonly _planner;
|
|
122
|
+
private readonly _paint;
|
|
123
|
+
private readonly _footer;
|
|
124
|
+
private readonly _sort;
|
|
125
|
+
private readonly _geometry;
|
|
126
|
+
private readonly _applier;
|
|
127
|
+
private readonly _headerLayout;
|
|
128
|
+
private readonly _headerWraps;
|
|
129
|
+
private readonly _overlay;
|
|
130
|
+
private readonly _win;
|
|
131
|
+
/** 마지막으로 DOM 에 반영한 기하 판(처음엔 지금 판 — 처음 그림이 그 판으로 그려짐). / Last geometry version projected to the DOM. */
|
|
132
|
+
private _applied;
|
|
133
|
+
private readonly _sortList;
|
|
134
|
+
private readonly _queue;
|
|
135
|
+
private _lastPlan;
|
|
136
|
+
private _frameId;
|
|
137
|
+
private _depth;
|
|
138
|
+
private _destroyed;
|
|
139
|
+
/**
|
|
140
|
+
* 그려 둔 행 범위(아직 안 그림·그리다 실패함 = null). 본문 객체가 물리면 그쪽이 그려 둔 상태의 주인이 된다.
|
|
141
|
+
*
|
|
142
|
+
* Row range drawn last (null = never drawn or the last paint threw). The body view takes this over once wired in.
|
|
143
|
+
*/
|
|
144
|
+
private _drawnRows;
|
|
145
|
+
/** 그리기를 시작한 차례 번호(안쪽 실행을 가려내려고). / Paint sequence number (to detect nested paints). */
|
|
146
|
+
private _paintSeq;
|
|
147
|
+
/** 실행 중 sync 요청이 들어와 끝난 뒤 한 번 더 돌아야 함. / A sync request arrived mid-run; run again afterwards. */
|
|
148
|
+
private _rerun;
|
|
149
|
+
constructor(frame: FramePort, deps: RenderSchedulerStartDeps);
|
|
150
|
+
get lastPlan(): IRenderPlan | null;
|
|
151
|
+
/** 지금 실행 중인 깊이(0 = 실행 중 아님). 진단용. / Current run depth (diagnostics). */
|
|
152
|
+
get depth(): number;
|
|
153
|
+
submit(req: IRenderRequest): void;
|
|
154
|
+
flushNow(): void;
|
|
155
|
+
destroy(): void;
|
|
156
|
+
private _schedule;
|
|
157
|
+
private _cancelFrame;
|
|
158
|
+
/**
|
|
159
|
+
* 쌓인 요청을 한 번 얼려 계획을 받고 실행한다.
|
|
160
|
+
*
|
|
161
|
+
* Freezes the accumulated request once, asks the planner and runs the plan.
|
|
162
|
+
*/
|
|
163
|
+
private _run;
|
|
164
|
+
/**
|
|
165
|
+
* 다음 상태를 만드는 유일한 곳: 행은 요청의 명시 범위, 없으면 지금 보이는 범위 하나(세로 창 범위 — 끝 포함 → 반열림).
|
|
166
|
+
* 범위는 요청을 낸 때가 아니라 그릴 때 묻는다(그 사이에 바뀐 보이는 높이·행 수가 들어가게).
|
|
167
|
+
*
|
|
168
|
+
* Sole builder of the next state: explicit rows, else the single visible range (the vertical window, inclusive →
|
|
169
|
+
* half-open), asked at paint time rather than at submit time.
|
|
170
|
+
*/
|
|
171
|
+
private _next;
|
|
172
|
+
/**
|
|
173
|
+
* 다음 창: 창 정책의 프레임 입구에 그려 둔 창·가로 위치·꼭 넣을 컬럼·모양을 넘긴다(그대로 둘지·새로 셀지는 정책이 정함 —
|
|
174
|
+
* 그대로면 같은 객체라 계획이 「창 일 0」을 낸다). 창을 쓰지 않으면 늘 같은 「없음」 창.
|
|
175
|
+
*
|
|
176
|
+
* Next window from the policy's per-frame entry (the same object back means no window work); a fixed empty window otherwise.
|
|
177
|
+
*/
|
|
178
|
+
private _nextColumns;
|
|
179
|
+
/** 본문이 그려 둔 창(창을 안 쓰면 늘 같은 「없음」 창, 본문이 아직 없으면 null). / Window drawn by the body. */
|
|
180
|
+
private _drawnColumns;
|
|
181
|
+
private _drawn;
|
|
182
|
+
/**
|
|
183
|
+
* 계획을 실행한다: 행 일은 옛 그리기 길로, 정렬 표시·푸터 일은 그 포트가 있으면 그리로. 머리글 통째·덧그림 칸은 옛 길이
|
|
184
|
+
* 지금처럼 맡으므로(본문 다시 그리기가 범위 덧그림을 함께 하고, 머리글 통째는 부르는 쪽이 그림) 기록(lastPlan)만 한다.
|
|
185
|
+
* 「그려 둔 범위」는 그린 뒤에 적는다 — 그리다 던지면 무엇이 그려져 있는지 모르므로 null.
|
|
186
|
+
*
|
|
187
|
+
* Runs the plan: row work through the legacy paint path, sort-mark and footer work through their ports when present;
|
|
188
|
+
* full header and overlay cells are only recorded. The drawn range is recorded after painting (null if the paint throws).
|
|
189
|
+
*/
|
|
190
|
+
private _execute;
|
|
191
|
+
/**
|
|
192
|
+
* 기하 일: 마지막으로 반영한 판 이후 바뀐 몫을 투영에 한 번 넘긴다(등록 자리에만 px — 읽기 0). 행을 다시 그리는 계획이어도
|
|
193
|
+
* 먼저 한다(머리글·푸터 자리는 행 다시 그리기가 안 고침) — 다만 그때 본문 자리는 곧 새로 그려 버려지므로 건너뛰게 한다.
|
|
194
|
+
* 줄바꿈 머리글이면 그 뒤 자리 맞춤 주인을 한 번 부른다(높이가 마지막으로 맞춘 값과 다를 때만 맞추는 것은 그쪽 몫).
|
|
195
|
+
*
|
|
196
|
+
* Geometry work: hand the change since the last projected version to the applier once (tracked slots only, no reads);
|
|
197
|
+
* body slots are skipped when rows are about to be rebuilt. For wrapping headers, the layout owner is called once and
|
|
198
|
+
* relayouts only when the height differs from the last laid-out one.
|
|
199
|
+
*/
|
|
200
|
+
private _executeGeometry;
|
|
201
|
+
/** 덧그림: 행을 다시 그리지 않는 계획에서만(행 다시 그리기는 옛 길이 덧그림까지 고침). / Overlay only when no row work. */
|
|
202
|
+
private _executeOverlay;
|
|
203
|
+
/**
|
|
204
|
+
* 머리글 일: 정렬 표시만이면(`sortIndicator`) 표시 객체에 지금 정렬 목록을 알린다(바뀐 칸만 고침 — 같은 목록이면 일 0).
|
|
205
|
+
* 머리글 통째(`rebuild`)는 아직 옛 길(부르는 쪽의 renderHeader)이 맡는다.
|
|
206
|
+
*
|
|
207
|
+
* Header work: `sortIndicator` notifies the indicator with the current sort list (only changed cells are patched);
|
|
208
|
+
* a full header rebuild is still done by the legacy path.
|
|
209
|
+
*/
|
|
210
|
+
private _executeHeader;
|
|
211
|
+
/**
|
|
212
|
+
* 창 일: 행은 그대로 두고 창만 옮긴다(들어온 컬럼 칸만 만들고 나간 컬럼 칸만 뗌 — 본문 쪽 몫). 계획은 창이 실제로
|
|
213
|
+
* 달라졌을 때만, 그리고 행을 새로 그리지 않을 때만 이 일을 낸다(새로 그리면 이미 새 창으로 그려짐).
|
|
214
|
+
*
|
|
215
|
+
* Window work: move the window without touching rows; planned only when the window really changed and rows are not rebuilt.
|
|
216
|
+
*/
|
|
217
|
+
private _executeCols;
|
|
218
|
+
private _executeRows;
|
|
219
|
+
/**
|
|
220
|
+
* 푸터 일은 행 일 뒤에, 행 일이 없어도 계획대로: 막대 다시 → paint, 값만 → updateValues. 푸터 포트가 없으면 옛 길이 맡는다.
|
|
221
|
+
*
|
|
222
|
+
* Footer work runs after the row work, even when there is none: rebuild → paint, values → updateValues.
|
|
223
|
+
*/
|
|
224
|
+
private _executeFooter;
|
|
225
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IResizeSink, ResizeBounds } from '../domain/resize/ports.js';
|
|
2
|
+
/** 받는 쪽이 이 어댑터에 내주는 일(폭 입력의 주인과 머리글 높이 맞추기). / What the host lends this adapter. */
|
|
3
|
+
export interface ResizeSinkHost {
|
|
4
|
+
/**
|
|
5
|
+
* 놓은 폭을 그리드의 기존 너비 조절 입구로 넘긴다(렌더러 콜백 onColResize → 사용자 폭 기억 — 다시 그리기 없음).
|
|
6
|
+
* 기존 입구를 지나게 해 그 콜백을 지켜보는 코드가 지금처럼 놓기 한 번에 한 번 본다.
|
|
7
|
+
*
|
|
8
|
+
* Hand the released width to the grid's existing resize entry (renderer callback onColResize → remember user width, no redraw),
|
|
9
|
+
* so code observing that callback still sees it once per release.
|
|
10
|
+
*/
|
|
11
|
+
commitWidth(ci: number, width: number): void;
|
|
12
|
+
/** 줄바꿈 머리글이 하나라도 있나. / Whether any header wraps. */
|
|
13
|
+
hasWrappedHeader(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 머리글 높이를 한 번 재어, 마지막으로 맞춘 높이와 다를 때만 본문 위치를 맞춘다(같으면 배치를 다시 하지 않음).
|
|
16
|
+
*
|
|
17
|
+
* Measure the header height once and realign the body only when it differs from the last fitted height (no relayout when equal).
|
|
18
|
+
*/
|
|
19
|
+
relayoutHeaderIfChanged(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 너비 조절을 놓았을 때 바깥에 알리는 작은 어댑터. 사용자 폭을 기억하고, 줄바꿈 머리글이면 높이를 한 번 다시 잰다.
|
|
23
|
+
* 다시 그리기를 부르지 않는다 — 놓은 폭은 이미 끄는 동안 기하와 화면에 반영돼 있기 때문이다.
|
|
24
|
+
*
|
|
25
|
+
* Small adapter notified when a width resize is released. It remembers the user width and re-measures the header once
|
|
26
|
+
* if headers wrap. It never triggers a redraw, because the released width is already in the geometry and on screen.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ResizeSinkAdapter implements IResizeSink {
|
|
29
|
+
private readonly _host;
|
|
30
|
+
constructor(_host: ResizeSinkHost);
|
|
31
|
+
boundsOf(_ci: number): ResizeBounds;
|
|
32
|
+
commit(ci: number, width: number): void;
|
|
33
|
+
needsHeaderRemeasure(): boolean;
|
|
34
|
+
remeasureHeader(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IScrollFollower } from './ports.js';
|
|
2
|
+
/**
|
|
3
|
+
* scrollLeft 를 따라 쓰는 구현. 상태: 따라가는 요소 목록과 (있으면) 듣고 있는 원천 하나.
|
|
4
|
+
*
|
|
5
|
+
* scrollLeft-copying implementation. State: the followers and at most one listened source.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ScrollLeftFollower implements IScrollFollower {
|
|
8
|
+
private readonly _targets;
|
|
9
|
+
private _source;
|
|
10
|
+
/** 마지막으로 쓴 값 — 나중에 붙는 요소(다시 그린 푸터 막대 등)를 같은 자리에서 시작하게. / Last written value. */
|
|
11
|
+
private _last;
|
|
12
|
+
private readonly _onScroll;
|
|
13
|
+
/**
|
|
14
|
+
* 따라갈 요소를 더한다. 이미 있으면 그대로(두 번 쓰지 않으려고). 본문이 이미 가로로 옮겨져 있으면(마지막 값이 0 이 아니면)
|
|
15
|
+
* 새 요소에 그 값을 바로 쓴다 — 옮긴 상태에서 다시 그려진 푸터가 맨 왼쪽에서 나타났다가 튀지 않게. 0 이면 쓰지 않는다(새 요소는 이미 0).
|
|
16
|
+
*
|
|
17
|
+
* Adds a follower once; when the body is already scrolled, writes the last value to it right away.
|
|
18
|
+
*/
|
|
19
|
+
follow(el: HTMLElement): void;
|
|
20
|
+
/** 따라가기에서 뺀다. / Removes a follower. */
|
|
21
|
+
unfollow(el: HTMLElement): void;
|
|
22
|
+
/** 따라가는 요소 전부에 같은 scrollLeft 를 쓴다(더한 차례대로, 읽기 없음). / Writes scrollLeft to every follower. */
|
|
23
|
+
sync(scrollLeft: number): void;
|
|
24
|
+
/**
|
|
25
|
+
* 원천(본문 스크롤 상자)의 scroll 이벤트를 듣는다 — passive 듣개 하나. 이벤트마다 원천의 scrollLeft 를 읽어 sync 로 넘긴다.
|
|
26
|
+
* 같은 원천을 다시 주면 아무것도 안 하고, 다른 원천을 주면 앞의 듣개를 떼고 옮긴다.
|
|
27
|
+
*
|
|
28
|
+
* Listens to the source's scroll event with one passive listener and forwards its scrollLeft to sync.
|
|
29
|
+
*/
|
|
30
|
+
listenTo(source: HTMLElement): void;
|
|
31
|
+
/** 듣개를 떼고 따라가는 요소를 비운다. / Detaches the listener and clears followers. */
|
|
32
|
+
destroy(): void;
|
|
33
|
+
private _detach;
|
|
34
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ViewportBox } from '../coordinate/geometryPorts.js';
|
|
2
|
+
import { IRenderScheduler, IScrollObserver } from './ports.js';
|
|
3
|
+
/**
|
|
4
|
+
* 본문 상자의 가로 위치·보이는 폭을 들고, 바뀌면 `ColsScrolled`(위치)·`Viewport`(폭) 요청을 낸다.
|
|
5
|
+
* scroll 이벤트마다 DOM 읽기는 한 번(scrollLeft·scrollTop) — 그 밖에 읽는 곳은 없다.
|
|
6
|
+
*
|
|
7
|
+
* Holds scrollLeft and visible width; submits `ColsScrolled` / `Viewport` only on real change.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ScrollObserver implements IScrollObserver {
|
|
10
|
+
private readonly _el;
|
|
11
|
+
private readonly _scheduler;
|
|
12
|
+
private _left;
|
|
13
|
+
private _top;
|
|
14
|
+
private _width;
|
|
15
|
+
private _box;
|
|
16
|
+
private _alive;
|
|
17
|
+
/**
|
|
18
|
+
* 오른쪽에서 왼쪽으로 쓰는 상자(dir=rtl)인가. 그런 상자의 가로 위치는 0 에서 음수로 가서 창 정책의 왼쪽 원점 좌표와
|
|
19
|
+
* 맞지 않으므로, 이때는 보이는 폭을 「모름」(0)으로 답해 창 규칙이 전 컬럼을 그리게 한다(가상화를 끄는 안전한 쪽).
|
|
20
|
+
*
|
|
21
|
+
* Right-to-left box: its scrollLeft runs from 0 to negative and does not match the policy's left-origin x, so the
|
|
22
|
+
* width is reported as unknown (0) and the window rules fall back to all columns.
|
|
23
|
+
*/
|
|
24
|
+
private _rtl;
|
|
25
|
+
constructor(el: HTMLElement, scheduler: Pick<IRenderScheduler, 'submit'>);
|
|
26
|
+
/** 마지막으로 읽은 가로 위치·보이는 폭(값 객체 — 바뀔 때만 새로 만듦). / Last read position and width. */
|
|
27
|
+
get box(): ViewportBox;
|
|
28
|
+
get scrollTop(): number;
|
|
29
|
+
/**
|
|
30
|
+
* 크기 관찰이 읽은 보이는 폭을 넘긴다. 같은 값이면 아무것도 안 하고, 다르면 `Viewport` 요청을 낸다
|
|
31
|
+
* (폭이 바뀌면 창도 바뀔 수 있으므로).
|
|
32
|
+
*
|
|
33
|
+
* Receives the width read by the resize observer; submits `Viewport` only when it changed.
|
|
34
|
+
*/
|
|
35
|
+
setWidth(width: number): void;
|
|
36
|
+
/**
|
|
37
|
+
* 가로 위치를 코드로 옮긴다(칸 드러내기 등). DOM 에 쓰고 값을 바로 갱신해, 뒤따르는 scroll 이벤트는 같은 값이라 요청을
|
|
38
|
+
* 다시 내지 않는다. 브라우저가 끝에서 잘라 낸 값은 다음 scroll 이벤트가 바로잡는다.
|
|
39
|
+
*
|
|
40
|
+
* Moves the horizontal position from code; the trailing scroll event then carries the same value.
|
|
41
|
+
*/
|
|
42
|
+
scrollLeftTo(x: number): void;
|
|
43
|
+
destroy(): void;
|
|
44
|
+
private _onScroll;
|
|
45
|
+
private static _isRtl;
|
|
46
|
+
private _setLeft;
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 본문 상자의 크기 관찰(세로 스크롤바가 생기고 없어질 때도 내용 상자가 바뀌어 불린다)마다 모자란 폭을 재서 바뀌었을 때만 알린다.
|
|
3
|
+
*
|
|
4
|
+
* On each size observation of the body box (also fired when its vertical scrollbar appears or goes away) measures the
|
|
5
|
+
* shortfall and reports it only when it changed.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ScrollbarGutter {
|
|
8
|
+
private readonly _body;
|
|
9
|
+
private readonly _header;
|
|
10
|
+
private readonly _apply;
|
|
11
|
+
private _ro;
|
|
12
|
+
private _px;
|
|
13
|
+
constructor(_body: HTMLElement, _header: HTMLElement, _apply: (px: number) => void);
|
|
14
|
+
/** 지금 모자란 폭(px, 정수). / The current shortfall in px. */
|
|
15
|
+
get px(): number;
|
|
16
|
+
/** 한 번 잰다(크기 관찰 밖에서 부를 때 — 예: 행 수가 바뀐 뒤). / Measure once. */
|
|
17
|
+
measure(): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RendererCallbacks } from '../../GridRenderer.js';
|
|
2
|
+
import { CellLocator } from './CellLocator.js';
|
|
3
|
+
/**
|
|
4
|
+
* 칸 콜백 말고 본문 뷰가 직접 아는 일 두 가지(묶음 행·나무 아이콘). 뷰가 그릴 때 기억해 둔 요소로 판단한다.
|
|
5
|
+
*
|
|
6
|
+
* The two things only the body view knows (group rows and tree icons), judged by elements it remembered while painting.
|
|
7
|
+
*/
|
|
8
|
+
export interface BodyEventHooks {
|
|
9
|
+
/** 칸도 자료 행도 아닌 본문 바로 아래 요소의 click(묶음 행이면 펴고 접는다). / Click on a non-data top element. */
|
|
10
|
+
otherRowClick(top: HTMLElement): void;
|
|
11
|
+
/** 대상이 이 본문의 나무 펼침 아이콘이면 펴고 접고 true. / Toggles and returns true when the target is a tree icon. */
|
|
12
|
+
treeToggle(target: EventTarget | null): boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 본문 요소 하나의 마우스 이벤트를 받아 칸·행 콜백으로 바꿔 넘긴다. 리스너 함수를 종류마다 만들지 않고 이 객체 하나를
|
|
16
|
+
* 리스너로 붙인다(handleEvent).
|
|
17
|
+
*
|
|
18
|
+
* Receives the body's mouse events and forwards them as cell/row callbacks; this object itself is the listener
|
|
19
|
+
* (handleEvent), so no function per type is created.
|
|
20
|
+
*/
|
|
21
|
+
export declare class BodyEventRouter implements EventListenerObject {
|
|
22
|
+
private readonly _body;
|
|
23
|
+
private readonly _locator;
|
|
24
|
+
private readonly _cbs;
|
|
25
|
+
private readonly _hooks;
|
|
26
|
+
/**
|
|
27
|
+
* 마지막으로 누른 칸과 그 (행, 컬럼). 칸 click 은 본문을 다시 그리게 하므로, 브라우저는 dblclick 을 둘째 click 이 떨어진
|
|
28
|
+
* (그 click 의 다시 그리기로 이제 떼어진) 칸 쪽으로 보낸다 — 본문에 붙인 듣개에는 닿지 않는다. 그래서 click 마다 누른 칸 하나에만
|
|
29
|
+
* dblclick 듣개를 옮겨 걸고, 그 칸이 dblclick 을 받았는데 이미 떼어져 있으면·창에서 나가면·지우기 때 놓는다(늘 많아야 하나).
|
|
30
|
+
*
|
|
31
|
+
* The last clicked cell and its (row, column). A cell click repaints the body, so the browser sends dblclick toward the
|
|
32
|
+
* cell the second click landed on (now detached by that click's repaint), never reaching the body listener. Each click
|
|
33
|
+
* moves a dblclick listener to the clicked cell; it is dropped once that cell got its dblclick while detached, when the
|
|
34
|
+
* cell leaves the window, or on destroy (at most one at a time).
|
|
35
|
+
*/
|
|
36
|
+
private _armed;
|
|
37
|
+
private _armedRi;
|
|
38
|
+
private _armedCi;
|
|
39
|
+
/** 걸어 둔 칸이 받은 dblclick — 같은 사건이 본문까지 올라오면 두 번 부르지 않게 기억한다. / Remembered so the body path skips it. */
|
|
40
|
+
private _armedEvent;
|
|
41
|
+
private readonly _onArmedDbl;
|
|
42
|
+
constructor(_body: HTMLElement, _locator: CellLocator, _cbs: RendererCallbacks, _hooks: BodyEventHooks);
|
|
43
|
+
/**
|
|
44
|
+
* 리스너를 모두 뗀다(그리드를 지울 때).
|
|
45
|
+
*
|
|
46
|
+
* Removes all listeners (when the grid is destroyed).
|
|
47
|
+
*/
|
|
48
|
+
destroy(): void;
|
|
49
|
+
/**
|
|
50
|
+
* 그 칸이 본문에서 떨어져 나갈 때(창에서 나감) 걸어 둔 dblclick 듣개를 푼다 — 떼어 낸 칸이 듣개를 붙든 채 남지 않게.
|
|
51
|
+
*
|
|
52
|
+
* Drops the armed dblclick listener when that cell leaves the body (window shift), so no detached cell keeps it.
|
|
53
|
+
*/
|
|
54
|
+
forget(cell: HTMLElement): void;
|
|
55
|
+
/** 누른 칸 하나에만 dblclick 듣개를 건다(옛 칸에서는 뗀다). / Keep the dblclick listener on the clicked cell only. */
|
|
56
|
+
private _arm;
|
|
57
|
+
handleEvent(e: Event): void;
|
|
58
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RowSpan } from '../../coordinate/geometryPorts.js';
|
|
2
|
+
/**
|
|
3
|
+
* 지금 본문 DOM 에 있는 행 요소를 행 번호로 기억하는 곳(행 번호 하나에 행 요소 하나). 세로 스크롤에서 남는 행·들어온 행·나간 행을
|
|
4
|
+
* 가르는 셈도 여기서 한다 — 무엇이 그려져 있는지 아는 곳이 하나로 남게.
|
|
5
|
+
*
|
|
6
|
+
* Remembers the row elements currently in the body DOM by row index (one element per index). It also computes which
|
|
7
|
+
* rows stay, enter and leave on a vertical scroll, so the knowledge of what is drawn stays in one place.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BodyRowSet {
|
|
10
|
+
private readonly _rows;
|
|
11
|
+
get size(): number;
|
|
12
|
+
has(ri: number): boolean;
|
|
13
|
+
get(ri: number): HTMLElement | undefined;
|
|
14
|
+
add(ri: number, el: HTMLElement): void;
|
|
15
|
+
remove(ri: number): HTMLElement | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* 다음 범위(반열림)로 갈 때 들어올 행 번호와 나갈 행 번호(둘 다 오름차순). keep 에 든 행은 범위 밖이어도 나가지 않는다.
|
|
18
|
+
*
|
|
19
|
+
* Row indices entering and leaving for the next (half-open) span, both ascending; rows in keep never leave.
|
|
20
|
+
*/
|
|
21
|
+
diff(next: RowSpan, keep: readonly number[]): {
|
|
22
|
+
enter: number[];
|
|
23
|
+
leave: number[];
|
|
24
|
+
};
|
|
25
|
+
/** 행 번호 오름차순으로 돈다. / Iterates in ascending row index order. */
|
|
26
|
+
forEach(fn: (ri: number, el: HTMLElement) => void): void;
|
|
27
|
+
clear(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { AppearanceResolver } from '../../AppearanceResolver.js';
|
|
2
|
+
import { RenderFrame, RendererCallbacks } from '../../GridRenderer.js';
|
|
3
|
+
import { CellRegistry } from './CellRegistry.js';
|
|
4
|
+
import { IColumnGeometry, IColumnWindow } from '../../coordinate/geometryPorts.js';
|
|
5
|
+
import { IGeometryApplier } from '../ports.js';
|
|
6
|
+
import { RowWork, ColWork } from '../../domain/render/ports.js';
|
|
7
|
+
/**
|
|
8
|
+
* 본문 DOM(행·칸·디테일 패널·빈 자료 안내)을 그리는 객체. 본문에 무엇이 그려져 있는지 아는 곳을 렌더러 앞면에서 떼어 냈다.
|
|
9
|
+
* 지금은 부를 때마다 보이는 구간을 통째로 다시 만들고, 그린 칸은 칸 지도(`CellRegistry`)에 행 단위로 넣는다.
|
|
10
|
+
* 행을 어떻게 그리는지는 행 종류마다 그리개가 맡고(종류 판정은 `RowPainterTable`), 이 객체는 구간을 돌며 맡기기만 한다.
|
|
11
|
+
*
|
|
12
|
+
* Paints the body DOM (rows, cells, detail panels, empty-data message). Split out of the renderer facade so the
|
|
13
|
+
* knowledge of what is drawn in the body lives in one place. For now each call rebuilds the visible range as a whole
|
|
14
|
+
* and puts the painted cells into the cell map (`CellRegistry`) row by row. How a row is drawn belongs to the
|
|
15
|
+
* painter of its kind (kind lookup in `RowPainterTable`); this object walks the range and delegates.
|
|
16
|
+
*/
|
|
17
|
+
export declare class BodyView {
|
|
18
|
+
private readonly _body;
|
|
19
|
+
private readonly _ap;
|
|
20
|
+
private readonly _cbs;
|
|
21
|
+
private readonly _cellMap;
|
|
22
|
+
private readonly _tr;
|
|
23
|
+
/**
|
|
24
|
+
* 행 종류 → 그리개(그리개는 여기서 한 번만 만든다 — 행마다 만들지 않음).
|
|
25
|
+
*
|
|
26
|
+
* Row kind → painter (painters are created once here, never per row).
|
|
27
|
+
*/
|
|
28
|
+
private readonly _rows;
|
|
29
|
+
/**
|
|
30
|
+
* 행 밖 세로 병합 마스터 → 행 번호, 묶음 행 → 묶음 열쇠. 그릴 때마다 비우고 다시 채운다(떼어 낸 요소를 붙들지 않게).
|
|
31
|
+
* 본문 이벤트 위임이 칸·묶음 행을 알아볼 때 읽는다.
|
|
32
|
+
*
|
|
33
|
+
* Row-spanning master → row index and group row → group key; cleared and refilled every paint (detached elements
|
|
34
|
+
* are not retained). Read by the body event delegation to recognise cells and group rows.
|
|
35
|
+
*/
|
|
36
|
+
private readonly _masters;
|
|
37
|
+
private readonly _groupKeys;
|
|
38
|
+
private readonly _treeIcons;
|
|
39
|
+
/** 마지막 그리기의 묶음·나무 펴고 접기 콜백. / Group and tree toggle callbacks of the latest paint. */
|
|
40
|
+
private _onGroupToggle;
|
|
41
|
+
private _onTreeToggle;
|
|
42
|
+
/** 본문 마우스 이벤트를 한 곳에서 받는 객체. / Receives the body's mouse events in one place. */
|
|
43
|
+
private readonly _events;
|
|
44
|
+
/**
|
|
45
|
+
* 지금 본문에 그려 둔 컬럼 창 — 이것을 아는 곳은 이 객체 하나다(스케줄러가 다음 창과 견줘 옮길지 정한다). 아직 안 그렸으면 null.
|
|
46
|
+
*
|
|
47
|
+
* The column window currently drawn — only this object knows it (the scheduler compares it with the next window).
|
|
48
|
+
*/
|
|
49
|
+
private readonly _drawn;
|
|
50
|
+
/**
|
|
51
|
+
* 그려 둔 창과, 그려 둔 행으로는 세로 행 차분을 못 하는지(세로 병합·묶음·나무·디테일·autoHeight 가 있으면 참 — 아직 안 그렸어도 참).
|
|
52
|
+
*
|
|
53
|
+
* The drawn window and whether the drawn rows rule out a vertical row diff (merges, group, tree, detail, autoHeight; true before any paint).
|
|
54
|
+
*/
|
|
55
|
+
get drawn(): {
|
|
56
|
+
readonly columns: IColumnWindow | null;
|
|
57
|
+
readonly diffBlocked: boolean;
|
|
58
|
+
};
|
|
59
|
+
/** 지금 DOM 에 있는 자료 행(행 번호 → 요소). / Data rows currently in the DOM (row index → element). */
|
|
60
|
+
private readonly _rowSet;
|
|
61
|
+
/**
|
|
62
|
+
* 행마다 그릴 때의 상태 열쇠(행 상태·선택·체크·포커스 칸·범위 칸) — 남는 행이 지금 프레임과 다르면 그 행만 다시 만든다.
|
|
63
|
+
*
|
|
64
|
+
* Per-row state key at paint time; a staying row whose key differs from the current frame is repainted alone.
|
|
65
|
+
*/
|
|
66
|
+
private readonly _rowKeys;
|
|
67
|
+
/** 편집 중이라 창 밖으로 나가도 떼지 않는 행(없으면 null). / Row kept while editing even when it leaves the range. */
|
|
68
|
+
private _editRow;
|
|
69
|
+
/** 마지막으로 그린 행 범위(끝 포함). / Last painted row range (inclusive). */
|
|
70
|
+
private _start;
|
|
71
|
+
private _end;
|
|
72
|
+
/** 마지막 통째 그리기의 문맥과 프레임(창 옮김·다시 그리기에 다시 씀). / Context and frame of the last full paint. */
|
|
73
|
+
private _ctx;
|
|
74
|
+
private _frame;
|
|
75
|
+
private readonly _dataRows;
|
|
76
|
+
private readonly _groupRows;
|
|
77
|
+
/**
|
|
78
|
+
* 창에서 나간 칸을 뗄 때: 위임이 그 칸에 걸어 둔 한 번짜리 듣개를 풀고, 칸 안 조건부 서식 막대의 폭 등록과 나무 아이콘 지도 몫을 푼다.
|
|
79
|
+
*
|
|
80
|
+
* When a cell leaves the window: drop the delegation's one-shot listener on it, its CF bar registration and its tree-icon entry.
|
|
81
|
+
*/
|
|
82
|
+
private readonly _onRemoveCell;
|
|
83
|
+
/** 그 요소 안 나무 아이콘을 아이콘 지도에서 지운다. / Removes the tree icons inside the element from the icon map. */
|
|
84
|
+
private _forgetIcons;
|
|
85
|
+
constructor(_body: HTMLElement, _ap: AppearanceResolver, _cbs: RendererCallbacks, _cellMap: CellRegistry, _tr: (key: string, params?: Record<string, string | number>) => string);
|
|
86
|
+
/**
|
|
87
|
+
* 본문 리스너를 뗀다(그리드를 지울 때).
|
|
88
|
+
*
|
|
89
|
+
* Detaches the body listeners (when the grid is destroyed).
|
|
90
|
+
*/
|
|
91
|
+
destroy(): void;
|
|
92
|
+
/**
|
|
93
|
+
* 컬럼 폭·왼쪽 위치·전체 폭·여분 칸 폭을 묻는 곳. 그리드가 하나 쥔 기하 객체를 한 번 넘겨받아 든다.
|
|
94
|
+
* 폭을 이 뷰 안에서 다시 더하지 않고 기하에 묻게 해야, 폭을 아는 곳이 하나로 남는다.
|
|
95
|
+
*
|
|
96
|
+
* Where column widths, lefts, total width and extra-cell widths are asked. The grid hands over its
|
|
97
|
+
* single geometry object once; asking it (instead of re-summing here) keeps one owner of widths.
|
|
98
|
+
*/
|
|
99
|
+
private _geometry;
|
|
100
|
+
/**
|
|
101
|
+
* 기하 객체를 넘겨받는다(그리기 전에 한 번). 그리드가 그리기 직전마다 같은 객체를 지금 폭으로 맞춰 둔다.
|
|
102
|
+
*
|
|
103
|
+
* Receive the geometry object (once, before painting). The grid keeps that same object in sync before each paint.
|
|
104
|
+
*/
|
|
105
|
+
setGeometry(geometry: IColumnGeometry): void;
|
|
106
|
+
/**
|
|
107
|
+
* 기하에서 나온 px 를 DOM 에 쓰는 객체. 본문은 칸이 아닌 폭 자리를 여기에 기억시키기만 한다(칸은 칸 지도가 안다).
|
|
108
|
+
*
|
|
109
|
+
* Writer of geometry-derived px. The body only registers its non-cell width spots here (cells live in the cell map).
|
|
110
|
+
*/
|
|
111
|
+
private _applier;
|
|
112
|
+
/**
|
|
113
|
+
* 폭 쓰는 객체를 넘겨받는다(그리기 전에 한 번 — 기하가 바뀌면 다시).
|
|
114
|
+
*
|
|
115
|
+
* Receive the width writer (once before painting; again when the geometry is replaced).
|
|
116
|
+
*/
|
|
117
|
+
setApplier(applier: IGeometryApplier): void;
|
|
118
|
+
private _t;
|
|
119
|
+
/**
|
|
120
|
+
* 그려진 칸 요소(없으면 undefined — 보이는 구간 밖이거나 병합으로 가려진 칸).
|
|
121
|
+
*
|
|
122
|
+
* The painted cell element (undefined when outside the visible range or hidden by a merge).
|
|
123
|
+
*/
|
|
124
|
+
cell(ri: number, ci: number): HTMLElement | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* 본문 보이는 구간을 통째로 다시 그린다(칸 지도도 비우고 다시 채운다).
|
|
127
|
+
*
|
|
128
|
+
* Rebuild the visible body range as a whole (the cell map is cleared and refilled too).
|
|
129
|
+
*/
|
|
130
|
+
rebuildWindow(frame: RenderFrame): void;
|
|
131
|
+
/**
|
|
132
|
+
* 그리기 한 번의 문맥 — 행 그리개·여분 칸 그리개가 나눠 쓴다(행마다 바뀌는 칸은 자료 행 그리개가 채움).
|
|
133
|
+
*
|
|
134
|
+
* One context per paint, shared by the row and extra-cell painters (per-row fields filled by the data-row painter).
|
|
135
|
+
*/
|
|
136
|
+
private _context;
|
|
137
|
+
/**
|
|
138
|
+
* 행이 그려질 때의 상태 열쇠 — 행 상태·선택·체크·그 행의 포커스 칸·그 행에 걸친 범위 칸 구간. 같은 열쇠면 그 행 DOM 은 같다.
|
|
139
|
+
*
|
|
140
|
+
* State key of a row at paint time (row state, selection, check, focused cell, range spans on the row).
|
|
141
|
+
*/
|
|
142
|
+
private _stateKey;
|
|
143
|
+
/**
|
|
144
|
+
* 세로 행 차분을 해도 되나 — 그려 둔 행이 막힌 종류가 아니고, 자료·컬럼 구성이 그대로고, 두 범위가 겹칠 때만.
|
|
145
|
+
*
|
|
146
|
+
* Whether a vertical row diff is allowed: drawn rows not blocked, same data and columns, overlapping ranges.
|
|
147
|
+
*/
|
|
148
|
+
private _canDiff;
|
|
149
|
+
/**
|
|
150
|
+
* 세로 행 차분: 나간 행만 떼고(지도·등록·듣개도 풂), 들어온 행만 새 창으로 만들어 제자리에 끼우고, 남는 행은 요소 그대로 둔다.
|
|
151
|
+
* 남는 행의 상태가 이 프레임과 다르면 그 행만 다시 만들고, 창이 바뀌었으면(대각선) 남는 행은 끝 칸만 옮긴다. 편집 중인 행은 범위 밖이어도 남긴다.
|
|
152
|
+
*
|
|
153
|
+
* Vertical row diff: remove leaving rows only (with their map entries, registrations and listeners), build entering rows
|
|
154
|
+
* with the new window in place, keep staying elements. A staying row whose state differs is repainted alone; on a
|
|
155
|
+
* window change (diagonal scroll) staying rows only shift their edge cells. The row being edited stays even out of range.
|
|
156
|
+
*/
|
|
157
|
+
private _diffRows;
|
|
158
|
+
/**
|
|
159
|
+
* 그려 둔 행 하나를 뗀다: 칸 지도에서 지우고, 행과 그 안 요소의 폭 등록·한 번짜리 듣개를 푼다. keepEl 이면 DOM 에서는 떼지 않는다.
|
|
160
|
+
*
|
|
161
|
+
* Removes one drawn row: drops it from the cell map and unregisters the row and its descendants. keepEl leaves it in the DOM.
|
|
162
|
+
*/
|
|
163
|
+
private _dropRow;
|
|
164
|
+
/**
|
|
165
|
+
* 편집·포커스가 쓰는 고정 — 편집 중인 행은 세로 차분에서 범위 밖이어도 떼지 않는다. 편집이 끝났는데 그 행이 범위 밖이면 그 자리에서 뗀다.
|
|
166
|
+
*
|
|
167
|
+
* Pin used by editing: the edited row survives a row diff out of range; when editing ends and it is out of range it is removed at once.
|
|
168
|
+
*/
|
|
169
|
+
pin(p: {
|
|
170
|
+
editRow?: number | null;
|
|
171
|
+
editCol?: number | null;
|
|
172
|
+
focusRow?: number | null;
|
|
173
|
+
}): void;
|
|
174
|
+
/**
|
|
175
|
+
* 계획을 실행한다. 행 축이 통째(rebuild·clear)면 마지막 프레임을 새 창으로 다시 그리고, 행은 그대로에 창만 바뀌면(shift)
|
|
176
|
+
* 그려 둔 행마다 칸만 고친다 — 들어온 컬럼 칸만 만들고 나간 컬럼 칸만 뗀다(행은 다시 만들지 않음). 디테일 패널은 컬럼이 없어
|
|
177
|
+
* 그대로다. 창이 같으면 아무것도 안 한다. 컬럼 구성이 바뀐 창이면(낡은 창) 통째로 다시 그린다.
|
|
178
|
+
*
|
|
179
|
+
* Executes a plan: a full row rebuild repaints the last frame with the new window; a pure window shift fixes only
|
|
180
|
+
* the cells of each drawn row (create entering cells, remove leaving ones — rows are not rebuilt).
|
|
181
|
+
*/
|
|
182
|
+
update(next: {
|
|
183
|
+
readonly columns: IColumnWindow;
|
|
184
|
+
}, rows: RowWork, cols: ColWork): void;
|
|
185
|
+
}
|