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.
Files changed (134) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/ExportProgressView-BYPw8osg.cjs +2 -0
  3. package/dist/ExportProgressView-Bt5-z7rE.js +2 -0
  4. package/dist/LcpMergeOrderer-CeP6C6G1.cjs +2 -0
  5. package/dist/LcpMergeOrderer-Ebwuir-r.js +2 -0
  6. package/dist/OpenGrid-Bh1NMOcm.cjs +98 -0
  7. package/dist/OpenGrid-CeXt04ho.js +98 -0
  8. package/dist/Registry-CrT46EAO.js +2 -0
  9. package/dist/Registry-DpHOpU5V.cjs +2 -0
  10. package/dist/XlsxChannel-CuOZ3LQz.js +2 -0
  11. package/dist/XlsxChannel-DQHLGend.cjs +2 -0
  12. package/dist/XlsxWorkbookWriter-DixuNGtw.cjs +3 -0
  13. package/dist/XlsxWorkbookWriter-VgbibI0Z.js +3 -0
  14. package/dist/fflate-Cs3txMgg.js +2 -0
  15. package/dist/fflate-G9RAFEgF.cjs +2 -0
  16. package/dist/index-1OXjJmct.js +2 -0
  17. package/dist/index-B5V7e4Xc.js +2 -0
  18. package/dist/index-DbKDox8y.cjs +2 -0
  19. package/dist/index-HaDoF1HM.cjs +2 -0
  20. package/dist/open-grid-react.cjs +1 -27
  21. package/dist/open-grid-react.js +1 -30
  22. package/dist/open-grid-vue.cjs +1 -31
  23. package/dist/open-grid-vue.js +1 -33
  24. package/dist/open-grid.cjs +6 -275
  25. package/dist/open-grid.js +6 -293
  26. package/dist/sinks-BCZFMGQJ.cjs +2 -0
  27. package/dist/sinks-qkBJ5bKn.js +2 -0
  28. package/dist/types/core/CFRenderBridge.d.ts +5 -1
  29. package/dist/types/core/CellEditManager.d.ts +26 -2
  30. package/dist/types/core/CellEventHandler.d.ts +6 -2
  31. package/dist/types/core/ColumnLayout.d.ts +8 -0
  32. package/dist/types/core/DataLayer.d.ts +48 -1
  33. package/dist/types/core/DetailManager.d.ts +43 -2
  34. package/dist/types/core/ExportManager.d.ts +25 -0
  35. package/dist/types/core/FindBarManager.d.ts +6 -2
  36. package/dist/types/core/FlatRowModel.d.ts +61 -3
  37. package/dist/types/core/FooterManager.d.ts +43 -1
  38. package/dist/types/core/FormulaController.d.ts +4 -4
  39. package/dist/types/core/GridComposer.d.ts +11 -1
  40. package/dist/types/core/GridRenderer.d.ts +84 -19
  41. package/dist/types/core/GroupTreeManager.d.ts +6 -4
  42. package/dist/types/core/KeyboardManager.d.ts +3 -2
  43. package/dist/types/core/MutationService.d.ts +10 -8
  44. package/dist/types/core/OpenGrid.d.ts +7 -5
  45. package/dist/types/core/RangeSelectionManager.d.ts +23 -2
  46. package/dist/types/core/RenderController.d.ts +126 -8
  47. package/dist/types/core/SortFilterManager.d.ts +10 -2
  48. package/dist/types/core/VirtualScroll.d.ts +12 -0
  49. package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
  50. package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
  51. package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
  52. package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
  53. package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
  54. package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
  55. package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
  56. package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
  57. package/dist/types/core/coordinate/ports.d.ts +5 -0
  58. package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
  59. package/dist/types/core/domain/footer/ports.d.ts +31 -0
  60. package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
  61. package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
  62. package/dist/types/core/domain/render/ports.d.ts +169 -0
  63. package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
  64. package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
  65. package/dist/types/core/domain/resize/ports.d.ts +64 -0
  66. package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
  67. package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
  68. package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
  69. package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
  70. package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
  71. package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
  72. package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
  73. package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
  74. package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
  75. package/dist/types/core/domain/sort/ports.d.ts +140 -0
  76. package/dist/types/core/export/ExportProgressView.d.ts +28 -0
  77. package/dist/types/core/export/channels/XlsxChannel.d.ts +38 -1
  78. package/dist/types/core/export/channels/XlsxRichTextRun.d.ts +14 -0
  79. package/dist/types/core/export/channels/XlsxSheetXml.d.ts +19 -0
  80. package/dist/types/core/export/channels/XlsxStyleEntries.d.ts +80 -0
  81. package/dist/types/core/export/channels/XlsxStylesRegistry.d.ts +20 -0
  82. package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +20 -0
  83. package/dist/types/core/export/channels/XlsxXml.d.ts +6 -0
  84. package/dist/types/core/export/index.d.ts +2 -0
  85. package/dist/types/core/export/sinks.d.ts +81 -0
  86. package/dist/types/core/export/types.d.ts +63 -0
  87. package/dist/types/core/host/archCheck.d.ts +16 -1
  88. package/dist/types/core/i18n/locales/en.d.ts +6 -0
  89. package/dist/types/core/i18n/locales/ko.d.ts +6 -0
  90. package/dist/types/core/i18n/types.d.ts +8 -0
  91. package/dist/types/core/render/FooterView.d.ts +121 -0
  92. package/dist/types/core/render/GeometryApplier.d.ts +55 -0
  93. package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
  94. package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
  95. package/dist/types/core/render/RenderScheduler.d.ts +225 -0
  96. package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
  97. package/dist/types/core/render/ScrollFollower.d.ts +34 -0
  98. package/dist/types/core/render/ScrollObserver.d.ts +47 -0
  99. package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
  100. package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
  101. package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
  102. package/dist/types/core/render/body/BodyView.d.ts +185 -0
  103. package/dist/types/core/render/body/CellLocator.d.ts +36 -0
  104. package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
  105. package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
  106. package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
  107. package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
  108. package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
  109. package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
  110. package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
  111. package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
  112. package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
  113. package/dist/types/core/render/dom.d.ts +10 -0
  114. package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
  115. package/dist/types/core/render/header/HeaderView.d.ts +84 -0
  116. package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
  117. package/dist/types/core/render/ports.d.ts +218 -0
  118. package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
  119. package/dist/types/core/types.d.ts +94 -0
  120. package/dist/types/index.d.ts +1 -0
  121. package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
  122. package/dist/xlsx.min-CMvrM6b4.cjs +138 -0
  123. package/dist/xlsx.min-i_b-4PvU.js +138 -0
  124. package/package.json +3 -8
  125. package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
  126. package/dist/OpenGrid-D6YxCsnV.js +0 -7472
  127. package/dist/Registry-CPJYOqCn.js +0 -74
  128. package/dist/Registry-D74ZmdDz.cjs +0 -71
  129. package/dist/index-CeJ-0-80.cjs +0 -260
  130. package/dist/index-D0DJtKYI.cjs +0 -452
  131. package/dist/index-DnarQ4eR.js +0 -266
  132. package/dist/index-VkKgQ506.js +0 -481
  133. package/dist/xlsx.min-BQ1o3sB6.cjs +0 -11793
  134. package/dist/xlsx.min-Bbz2ZypC.js +0 -11794
@@ -2,7 +2,12 @@ import { DataLayer } from './DataLayer.js';
2
2
  import { RowDragDrop } from './RowDragDrop.js';
3
3
  import { MergeEngine } from './MergeEngine.js';
4
4
  import { AppearanceResolver } from './AppearanceResolver.js';
5
+ import { _el, _style } from './render/dom.js';
6
+ import { ResizeBinderPorts } from './render/header/ResizeHandleBinder.js';
7
+ import { BodyView } from './render/body/BodyView.js';
5
8
  import { ColumnDef, SortItem, CellRange, GridOptions, FilterItem } from './types.js';
9
+ import { IColumnGeometry, IColumnWindow } from './coordinate/geometryPorts.js';
10
+ import { IScrollFollower, IHeaderSortIndicator, IGeometryApplier } from './render/ports.js';
6
11
  /**
7
12
  * R9(§6-R9 / §2.5 R-4a): 렌더러가 소비하는 opts 타입. 공개 GridOptions(생성 시 기본값 병합
8
13
  * 완료 = Required) 위에, 렌더 파이프라인이 매 프레임 주입하는 내부 증강 필드(언더스코어 접두)를
@@ -45,8 +50,8 @@ export interface RenderFrame {
45
50
  data: DataLayer<any>;
46
51
  /** 리프 컬럼 정의 배열. / Leaf column definitions. */
47
52
  leaves: ColumnDef[];
48
- /** 리프 컬럼별 너비(px). / Per-leaf column widths (px). */
49
- widths: number[];
53
+ /** 리프 컬럼별 너비(px, 읽기 전용 — 그리는 쪽은 기하에 묻는다). / Per-leaf column widths (px, read-only — painters ask the geometry). */
54
+ widths: readonly number[];
50
55
  /** 렌더 옵션(내부 증강 포함). / Render options (with internal augmentation). */
51
56
  opts: RenderOptions;
52
57
  /** 가상 스크롤 상단 오프셋(px). / Virtual-scroll top offset (px). */
@@ -69,6 +74,10 @@ export interface RenderFrame {
69
74
  mergeEngine?: MergeEngine | undefined;
70
75
  /** 마스터/디테일 렌더 배선(F2, 비활성 시 undefined). / Master/detail render wiring (F2; undefined when disabled). */
71
76
  detailApi?: DetailRenderContext | undefined;
77
+ /** 이번에 그릴 컬럼 창(없으면 전 컬럼). / Column window to paint this time (absent = all columns). */
78
+ columns?: IColumnWindow | undefined;
79
+ /** 'diff' 이면 세로로 겹치는 행은 그대로 두고 들어온 행만 만들고 나간 행만 뗀다(없으면 통째). / 'diff' keeps overlapping rows and only adds/removes rows that enter/leave (absent = rebuild). */
80
+ rowWork?: 'diff';
72
81
  }
73
82
  /**
74
83
  * 렌더러가 상위(RenderController/OpenGrid)로 이벤트를 되돌리고 상태를 질의하는 콜백 묶음.
@@ -103,7 +112,7 @@ export interface RendererCallbacks {
103
112
  approx: boolean;
104
113
  } | null;
105
114
  t?: (key: string, params?: Record<string, string | number>) => string;
106
- applyCF?: (cellEl: HTMLElement, rowIndex: number, field: string, value: unknown, cellW: number, cellH: number) => void;
115
+ applyCF?: (cellEl: HTMLElement, rowIndex: number, field: string, value: unknown, cellW: number, cellH: number, track?: (bar: HTMLElement, ratio: number) => void) => void;
107
116
  }
108
117
  /**
109
118
  * F2(§4/§5, C6/C10): renderBody 가 detail head/filler 분기·expander 셀을 그릴 때 소비하는 배선
@@ -152,9 +161,54 @@ export declare class GridRenderer {
152
161
  private _bodyWrap;
153
162
  private _body;
154
163
  private _opts;
155
- private _cbs;
164
+ private readonly _cbs;
156
165
  private _ap;
157
166
  private _cellMap;
167
+ private _resize;
168
+ private _headerView;
169
+ private _bodyView;
170
+ private readonly _follower;
171
+ private _applier;
172
+ private _gutter;
173
+ private _gutterSink;
174
+ /**
175
+ * 본문 가로 위치를 따라가는 객체(읽기만). 푸터 막대처럼 본문과 같이 가로로 움직여야 하는 요소가 같은 객체에 붙는다.
176
+ *
177
+ * The follower of the body's horizontal position (read-only). Elements that must scroll with the body, such as the footer bar, attach to the same object.
178
+ */
179
+ get follower(): IScrollFollower;
180
+ /**
181
+ * 기하 px 를 DOM 에 쓰는 객체(읽기만 — 기하를 받기 전엔 null). 스케줄러·푸터가 같은 객체로 폭 자리를 고친다.
182
+ *
183
+ * The geometry-to-DOM writer (read-only; null before the geometry arrives). The scheduler and the footer patch width spots through it.
184
+ */
185
+ get applier(): IGeometryApplier | null;
186
+ /**
187
+ * 본문 그리개(읽기만). 스케줄러가 가로 창이 바뀐 프레임에 이것에 「창 옮김」을 시킨다.
188
+ *
189
+ * The body painter (read-only). The scheduler asks it to shift the column window in frames where the window changes.
190
+ */
191
+ get bodyView(): BodyView;
192
+ /**
193
+ * 오른쪽 끝 여백 값을 받을 입구를 둔다(푸터 막대가 머리글과 같은 여백을 갖게). 이미 잰 값이 있으면 바로 한 번 넘긴다.
194
+ *
195
+ * Register the sink for the end-gutter value (so the footer bar gets the same gutter as the header); an already measured value is passed once right away.
196
+ */
197
+ onEndGutter(fn: (px: number) => void): void;
198
+ /**
199
+ * 너비 손잡이에 실시간 조절 포트(폭 쓰기·스케줄러·놓음 알림·기하)를 한 번 넘긴다. 넘긴 뒤로 끄는 동안 폭은 요청으로만 반영된다.
200
+ *
201
+ * Hand the width handles the live-resize ports (width writer, scheduler, release sink, geometry) once; afterwards drags reach the screen only through requests.
202
+ *
203
+ * @param ports - 실시간 조절 포트 / Live-resize ports
204
+ */
205
+ connectResize(ports: ResizeBinderPorts): void;
206
+ /**
207
+ * 놓은 폭을 렌더러 콜백(onColResize)으로 넘긴다 — 손잡이를 실시간 조절에 이은 뒤에도 놓기 한 번에 콜백 한 번이 지금처럼 불리게.
208
+ *
209
+ * Forward a released width to the renderer callback (onColResize), so the callback still fires once per release after live resize is wired.
210
+ */
211
+ commitColumnResize(ci: number, width: number): void;
158
212
  /** 본문 스크롤 래퍼 요소(스크롤/뷰포트 계산 접근용). / The body scroll-wrapper element (for scroll/viewport calculations). */
159
213
  get bodyWrapper(): HTMLElement;
160
214
  /** i18n: 렌더 로케일 해석기 — cbs.t(인스턴스 로케일) 우선, 미주입 시 전역 t. / i18n: cbs.t (instance locale) first, global t otherwise. */
@@ -177,6 +231,21 @@ export declare class GridRenderer {
177
231
  * @param headerHeight - 헤더 높이(px) / Header height (px)
178
232
  */
179
233
  updateSize(totalHeight: number, headerHeight: number): void;
234
+ /**
235
+ * 머리글의 정렬 표시만 고치는 객체를 머리글 그리개에 넘긴다(그리드마다 하나). 첫 머리글을 그리기 전에 한 번.
236
+ *
237
+ * Hand the header painter the object that patches only sort marks (one per grid). Once, before the first header paint.
238
+ *
239
+ * @param sort - 정렬 표시 객체 / The sort-indicator object
240
+ */
241
+ setSortIndicator(sort: IHeaderSortIndicator): void;
242
+ /**
243
+ * 머리글·본문 그리개에 컬럼 기하를 넘긴다(그리드마다 하나 — 폭·왼쪽 위치·전체 폭은 여기에 묻는다). 마운트 때 한 번.
244
+ * / Hand the header/body painters the column geometry (one per grid — they ask it for width, left and total). Once at mount.
245
+ *
246
+ * @param geometry - 컬럼 기하 / The column geometry
247
+ */
248
+ setGeometry(geometry: IColumnGeometry): void;
180
249
  /**
181
250
  * 현재 렌더된 헤더 영역의 실제 높이(px). 헤더 줄바꿈으로 늘어난 높이를 레이아웃에 반영할 때 사용.
182
251
  * / The actual height (px) of the currently rendered header. Used to reflect height grown by
@@ -197,7 +266,7 @@ export declare class GridRenderer {
197
266
  * @param sortList - 활성 정렬 항목 / Active sort items
198
267
  * @param opts - 렌더 옵션(고정 컬럼 수·필터 등) / Render options (frozen count, filters, …)
199
268
  */
200
- renderHeader(headerRows: any[][], leaves: ColumnDef[], widths: number[], sortList: SortItem[], opts: RenderOptions): void;
269
+ renderHeader(headerRows: any[][], leaves: ColumnDef[], widths: readonly number[], sortList: SortItem[], opts: RenderOptions): void;
201
270
  /**
202
271
  * 본문 가시 구간을 다시 그린다 — 그룹/트리 행·상태/선택 배경·고정 컬럼·셀 병합·마스터/디테일
203
272
  * 패널·수식 메타를 반영하고, rowIndex→colIndex→cellEl 맵을 재구성한다(getCellEl 근거).
@@ -218,13 +287,6 @@ export declare class GridRenderer {
218
287
  * @returns 셀 요소 또는 undefined / The cell element, or undefined
219
288
  */
220
289
  getCellEl(rowIndex: number, colIndex: number): HTMLElement | undefined;
221
- /**
222
- * F2(§4.3 C6): full-width 디테일 패널을 body-absolute 로 그린다(병합 마스터셀 선례
223
- * `:783-806` 재사용 — flex flow 밖). host 는 detailApi.getPanelHost() 가 반환하는 영속
224
- * div(mount-once, §5) — 이 함수는 그 host 를 새 패널 wrapper 에 appendChild 할 뿐이며,
225
- * DOM 이동만 발생하므로(파괴 아님) 재렌더/스크롤 왕복에도 인스턴스 상태가 생존한다.
226
- */
227
- private _appendDetailPanel;
228
290
  /**
229
291
  * 렌더러가 마운트한 DOM 을 전부 제거해 루트를 비운다.
230
292
  * / Remove all DOM the renderer mounted, emptying the root.
@@ -232,15 +294,18 @@ export declare class GridRenderer {
232
294
  destroy(): void;
233
295
  }
234
296
  /**
235
- * 태그(+선택 className)로 요소를 만든다. / Create an element from a tag (+optional className).
297
+ * 디테일 펼침 단추(F2 §4.5) 하나를 만든다. 기존 시험이 이 파일의 글자에서 단추의 시각 크기(min-width/min-height)를
298
+ * 읽어 터치 히트 영역을 확인하므로, 본문 그리기를 옮긴 뒤에도 단추를 만드는 줄은 이 파일에 둔다.
299
+ * / Build one detail expander button (F2 §4.5). An existing test reads the button's visual size from this file's text
300
+ * to check the touch hit area, so the lines that build it stay in this file after body painting moved out.
236
301
  * @internal
237
302
  */
238
- export declare function _el(tag: string, className?: string): HTMLElement;
239
- /**
240
- * 요소 style 에 부분 스타일을 병합한다. / Merge a partial style bag into an element's style.
241
- * @internal
242
- */
243
- export declare function _style(el: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
303
+ export declare function _detailExpanderButton(glyphInfo: {
304
+ glyph: string;
305
+ ariaLabel: string;
306
+ title: string;
307
+ }, rid: string, ri: number, detailApi: DetailRenderContext): HTMLElement;
308
+ export { _el, _style };
244
309
  /**
245
310
  * 문자열 내용을 파일로 다운로드시킨다(Blob URL 생성 후 즉시 해제).
246
311
  * / Trigger a file download of string content (creates then immediately revokes a Blob URL).
@@ -2,6 +2,7 @@ import { DataLayer } from './DataLayer.js';
2
2
  import { VirtualScroll } from './VirtualScroll.js';
3
3
  import { GroupRow } from './GroupEngine.js';
4
4
  import { TreeNode } from './TreeEngine.js';
5
+ import { IRenderRequest } from './domain/render/ports.js';
5
6
  /**
6
7
  * {@link GroupTreeManager} 의존성 주입 계약. / Dependency-injection contract for {@link GroupTreeManager}.
7
8
  *
@@ -18,10 +19,11 @@ export interface GroupTreeDeps<T extends Record<string, any>> {
18
19
  getOptions: () => any;
19
20
  /** 가상 스크롤 인스턴스 조회(없으면 `null`). / Look up the virtual-scroll instance (or `null`). */
20
21
  getVs: () => VirtualScroll | null;
21
- /** 전체 재계산 렌더(총 행수 갱신 포함). / Full re-render including a total-row-count refresh. */
22
- doRenderFull: (totalRows: number) => void;
23
- /** 바디를 다시 그린다. / Re-render the body. */
24
- doRender: () => void;
22
+ /**
23
+ * 그리기 요청을 낸다(받는 쪽이 계획대로 그린다). 이 객체는 무엇을 그릴지 정하지 않고 「무엇이 바뀌었나」만 알린다.
24
+ * / Submit a render request (the receiver paints per plan). This object reports what changed, not what to paint.
25
+ */
26
+ submitRender: (req: IRenderRequest) => void;
25
27
  /** Phase 2: OverrideKernel.getStrategy 주입(슬롯 groupKeyFn 도달용).
26
28
  * / Phase 2: injected `OverrideKernel.getStrategy` (reaches the `groupKeyFn` slot). */
27
29
  getStrategy?: <F extends Function>(slot: string, fallback: F) => F;
@@ -2,6 +2,7 @@ import { DataLayer } from './DataLayer.js';
2
2
  import { ColumnLayout } from './ColumnLayout.js';
3
3
  import { CellEditManager } from './CellEditManager.js';
4
4
  import { RowManager } from './RowManager.js';
5
+ import { IRenderRequest } from './domain/render/ports.js';
5
6
  /**
6
7
  * F1 범위 선택 배선 훅(M-3/M-4/M-5) — RangeSelectionManager 가 그대로 구현한다.
7
8
  * / F1 range-selection wiring hooks (M-3/M-4/M-5) — implemented directly by
@@ -57,8 +58,8 @@ export interface KeyboardDeps<T extends Record<string, any>> {
57
58
  setFocusCell: (ri: number, ci: number) => void;
58
59
  /** 행 드래그(Ctrl+화살표) 이동을 처리한다. / Handle a row drag (Ctrl+Arrow) move. */
59
60
  handleRowDrop: (from: number, to: number) => void;
60
- /** 바디를 다시 그린다. / Re-render the body. */
61
- doRender: () => void;
61
+ /** 그리기 요청을 낸다(보이는 범위 다시 그리기 등). / Submit a render request (e.g. repaint the visible range). */
62
+ submitRender: (req: IRenderRequest) => void;
62
63
  /** 스크린리더용 상태 안내. / Announce a status message for screen readers. */
63
64
  announce: (msg: string) => void;
64
65
  /** i18n: 행 이동 announce 해석. / i18n: resolve row-move announce. */
@@ -7,6 +7,7 @@ import { RowManager } from './RowManager.js';
7
7
  import { GroupTreeManager } from './GroupTreeManager.js';
8
8
  import { TriggerManager } from './TriggerManager.js';
9
9
  import { GridOptions, Position } from './types.js';
10
+ import { IRenderRequest } from './domain/render/ports.js';
10
11
  /**
11
12
  * R4(§3.4, R-9a/R-9b): 모든 데이터 변경의 mutate→render→emit 꼬리를 단일 초크포인트
12
13
  * `commit(spec)` 로 수렴시키기 위한 명시 데이터계약(CommitSpec DTO). 각 mutator 의
@@ -23,12 +24,12 @@ import { GridOptions, Position } from './types.js';
23
24
  * / Updates the VS/Pagination row count. `'count'` = current row count
24
25
  * (insert/delete/push/unshift), `'zero'` = 0 (clearData). Omitted = no update
25
26
  * (writeCell/setData — row count unchanged, or handled inline).
26
- * - `renderMode` : 'sync-window'=`_doRender(...visRange)`(insert/delete/write/endBatch),
27
- * 'full'=`_doRender(0,-1)`(clearData),
27
+ * - `renderMode` : 'sync-window'=보이는 범위 그리기 요청(insert/delete/write/endBatch),
28
+ * 'full'=본문 비우기 요청 rows:'clear'(clearData),
28
29
  * 'async-vs'=명령형 렌더 없음. setData 는 setTotalRows/rebuild 로 VS 가
29
30
  * rAF 스케줄(비동기)하므로 `commit` 은 동기 `_doRender` 를 **하지 않는다**.
30
- * / `'sync-window'` = `_doRender(...visRange)` (insert/delete/write/endBatch),
31
- * `'full'` = `_doRender(0,-1)` (clearData), `'async-vs'` = no imperative render.
31
+ * / `'sync-window'` = a visible-range render request (insert/delete/write/endBatch),
32
+ * `'full'` = a clear-body request, rows:'clear' (clearData), `'async-vs'` = no imperative render.
32
33
  * For setData, VS schedules via rAF through setTotalRows/rebuild, so `commit`
33
34
  * **does not** invoke a synchronous `_doRender`.
34
35
  * - `emitBeforeRender` : true=emit 을 render 앞에(writeCell/endBatch — 현행 순서), 기본 false=render 먼저(insert/delete).
@@ -108,10 +109,11 @@ export interface MutationServiceDeps<T extends Record<string, any> = any> {
108
109
  applyFilters: () => void;
109
110
  /** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. / Consume formula dirty seeds right before the writeCell/endBatch commit emit. */
110
111
  flushFormula: () => void;
111
- /** 현재 가시 범위 렌더(this._doRender(...this._visRange())). 서비스는 렌더 내부를 모른다. / Render the current visible range (this._doRender(...this._visRange())). The service has no knowledge of render internals. */
112
- doRenderWindow: () => void;
113
- /** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. / Full render (this._doRender(0, -1)) — clearData's full mode. */
114
- doRenderFull: () => void;
112
+ /**
113
+ * 그리기 요청을 낸다. 'sync-window' 는 보이는 범위, 'full'(clearData) 은 본문 비우기 요청. 서비스는 렌더 내부를 모른다.
114
+ * / Submit a render request: 'sync-window' = visible range, 'full' (clearData) = clear the body. The service has no knowledge of render internals.
115
+ */
116
+ submitRender: (req: IRenderRequest) => void;
115
117
  /** setData: 수식 dirty seed clear + RecalcCoordinator 재생성(rowId 재발급 대응). / setData: clears formula dirty seeds and recreates the RecalcCoordinator (to cope with rowId reissuance). */
116
118
  resetFormulaState: () => void;
117
119
  /** writeCell: 값이 바뀐 셀을 수식 dirty seed 로 적립(kind==='data' 일 때만). / writeCell: accumulates a changed cell as a formula dirty seed (only when kind === 'data'). */
@@ -135,6 +135,8 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
135
135
  private _vs;
136
136
  private _ro;
137
137
  private _renderer;
138
+ private _scheduler;
139
+ private _sortIndicator;
138
140
  private _appearance;
139
141
  /**
140
142
  * R12c: per-instance 아이콘 오버라이드 레지스트리(전역 iconRegistry 의 child). 첫 setIcon 때 지연 생성.
@@ -3136,15 +3138,15 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
3136
3138
  */
3137
3139
  jumpToRow(rowIndex: number): void;
3138
3140
  /**
3139
- * @deprecated no-op stub — 특정 컬럼으로 가로 스크롤 이동 미구현. 행 이동은 `jumpToRow(rowIndex)` 사용.
3141
+ * 필드 이름의 컬럼이 보이게 가로로 스크롤한다(가로 가상화로 칸이 DOM 에 없어도 됨). 없는 필드·숨은 컬럼이면 아무 일 없음.
3140
3142
  *
3141
- * no-op stub — horizontal jump-to-column is not implemented; use `jumpToRow(rowIndex)`.
3143
+ * Scroll horizontally so the column with this field is visible (works even when column virtualization keeps its cells out of the DOM). Unknown or hidden fields do nothing.
3142
3144
  *
3143
- * no-op スタブ — 特定の列への横スクロール移動は未実装です。行の移動は `jumpToRow(rowIndex)` を使ってください。
3145
+ * フィールド名の列が見えるように横スクロールします(列の仮想化でセルが DOM に無くても動きます)。存在しない・非表示の列なら何もしません。
3144
3146
  *
3145
- * no-op 桩 — 向特定列的横向滚动移动未实现。行的移动请用 `jumpToRow(rowIndex)`。
3147
+ * 横向滚动使该字段的列可见(即使列虚拟化使其单元格不在 DOM 中也可)。不存在或隐藏的字段不做任何事。
3146
3148
  */
3147
- jumpToCol(_field: string): void;
3149
+ jumpToCol(field: string): void;
3148
3150
  /**
3149
3151
  * 현재 스크롤 좌표.
3150
3152
  *
@@ -6,6 +6,7 @@ import { FlatRowModel } from './FlatRowModel.js';
6
6
  import { GridOptions } from './types.js';
7
7
  import { RangeStats } from './range/RangeQuery.js';
8
8
  import { CellRange, Direction, FillMode, FillPreview } from './range/types.js';
9
+ import { IRenderRequest } from './domain/render/ports.js';
9
10
  /**
10
11
  * RangeSelectionManager 가 OpenGrid 서브시스템을 읽고 쓰기 위해 주입받는 클로저 묶음.
11
12
  * / Closures injected into RangeSelectionManager so it can read and write OpenGrid subsystem
@@ -30,8 +31,8 @@ export interface RangeSelectionDeps<T extends Record<string, any>> {
30
31
  getDisplayValue: (ri: number, field: string) => string;
31
32
  /** 그리드 이벤트 발행. / Emit a grid event. */
32
33
  emit: (event: string, ...args: any[]) => void;
33
- /** 현재 가시 범위를 재렌더. / Re-render the currently visible range. */
34
- doRender: () => void;
34
+ /** 그리기 요청을 낸다(보이는 범위 다시 그리기 등). / Submit a render request (e.g. repaint the visible range). */
35
+ submitRender: (req: IRenderRequest) => void;
35
36
  /** aria-live 영역에 메시지를 공지. / Announce a message via the aria-live region. */
36
37
  announce: (msg: string) => void;
37
38
  /** i18n: 범위 선택/채우기 announce·aria 해석. / i18n: resolve range selection/fill announce & aria. */
@@ -39,6 +40,18 @@ export interface RangeSelectionDeps<T extends Record<string, any>> {
39
40
  hasCellFormula?: (rowId: string, field: string) => boolean;
40
41
  offsetFormula?: (rowId: string, field: string, dRow: number, dCol: number) => string;
41
42
  setCellFormulaByRowId?: (rowId: string, field: string, formula: string) => void;
43
+ /**
44
+ * 범위의 화면 사각형을 기하로 계산(본문 상자 보이는 왼쪽 위 기준, 두 모서리 칸의 합집합 — 칸을 재는 것과 같은 뜻).
45
+ * 모서리 칸이 가로 창 밖이라 DOM 에 없을 때 쓴다. 없으면 그때 테두리를 숨긴다(지금 동작).
46
+ * / Geometry-based screen rectangle of a range (body scroller's visible top-left, union of the corner cells);
47
+ * used when a corner cell is outside the column window. Without it the border is hidden then.
48
+ */
49
+ rangeRect?: (range: CellRange) => {
50
+ left: number;
51
+ top: number;
52
+ width: number;
53
+ height: number;
54
+ } | null;
42
55
  }
43
56
  /**
44
57
  * F1 범위 선택 + 채우기 매니저. / F1 range selection + fill manager.
@@ -195,6 +208,14 @@ export declare class RangeSelectionManager<T extends Record<string, any> = any>
195
208
  * / Runs after every _doRender call (M-6 integration point) — measures the corner cells and
196
209
  * updates the contiguous border/handle/preview overlay (QA-2, CON-4). */
197
210
  repaint(): void;
211
+ /**
212
+ * 범위의 본문 상자 기준 사각형. 두 모서리 칸이 다 그려져 있으면 지금처럼 칸을 재고(창이 전 컬럼이면 결과가 지금과 같다),
213
+ * 하나라도 가로 창 밖이라 없으면 기하로 계산한다(넓은 범위의 테두리가 창 밖 모서리 때문에 사라지지 않게). 둘 다 안 되면 null.
214
+ *
215
+ * Body-scroller box of a range: measure the corner cells when both are rendered (identical to before for a full
216
+ * window); otherwise compute it from geometry so a wide range keeps its border. null when neither works.
217
+ */
218
+ private _boxOf;
198
219
  private _hideOverlay;
199
220
  /** OpenGrid._doRender 가 renderBody extraOpts 로 전달(M-6).
200
221
  * / Passed by OpenGrid._doRender as renderBody's extraOpts (M-6).
@@ -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
- * (+ 전용 헬퍼 `_visCount`/`_paginationHeight`)를 **동작 불변**으로 옮긴 것.
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 helpers `_visCount`/`_paginationHeight`) out of the `OpenGrid` God object
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
- /** 푸터 합계 영역 재렌더. / Re-render the footer summary area. */
60
- renderFooterEl: () => void;
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
- /** 바디를 다시 그린다. / Re-render the body. */
29
- doRender: () => void;
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.