open-grid 1.6.0 → 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.
Files changed (126) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/ExportProgressView-9Kt1SQxv.js +48 -0
  3. package/dist/ExportProgressView-B59uHIwt.cjs +48 -0
  4. package/dist/LcpMergeOrderer-BdUtV67j.js +114 -0
  5. package/dist/LcpMergeOrderer-C_ANVkGk.cjs +113 -0
  6. package/dist/OpenGrid-BUYQs1_w.cjs +9806 -0
  7. package/dist/OpenGrid-BmagF0yo.js +9819 -0
  8. package/dist/XlsxChannel-DOeHeP7h.cjs +95 -0
  9. package/dist/XlsxChannel-DdaiytFR.js +95 -0
  10. package/dist/XlsxWorkbookWriter-BTNtZ80J.js +199 -0
  11. package/dist/XlsxWorkbookWriter-_u5stfg4.cjs +198 -0
  12. package/dist/{index-Brnev66-.js → index-B9_g5Eg3.js} +2 -2
  13. package/dist/{index-B_e5BXnW.cjs → index-CnyumyPV.cjs} +2 -2
  14. package/dist/open-grid-a11y.cjs +216 -0
  15. package/dist/open-grid-a11y.js +219 -0
  16. package/dist/open-grid-base.css +9 -0
  17. package/dist/open-grid-header.css +6 -15
  18. package/dist/open-grid-react.cjs +1 -1
  19. package/dist/open-grid-react.js +1 -1
  20. package/dist/open-grid-vue.cjs +1 -1
  21. package/dist/open-grid-vue.js +1 -1
  22. package/dist/open-grid.cjs +5 -2
  23. package/dist/open-grid.js +6 -3
  24. package/dist/sinks-BWkWQexV.js +149 -0
  25. package/dist/sinks-DPK0VxYG.cjs +143 -0
  26. package/dist/types/a11y/index.d.ts +37 -0
  27. package/dist/types/core/CFRenderBridge.d.ts +5 -1
  28. package/dist/types/core/CellEditManager.d.ts +26 -2
  29. package/dist/types/core/CellEventHandler.d.ts +6 -2
  30. package/dist/types/core/ColumnLayout.d.ts +11 -3
  31. package/dist/types/core/DataLayer.d.ts +48 -1
  32. package/dist/types/core/DetailManager.d.ts +43 -2
  33. package/dist/types/core/ExportManager.d.ts +26 -6
  34. package/dist/types/core/FindBarManager.d.ts +6 -2
  35. package/dist/types/core/FlatRowModel.d.ts +69 -3
  36. package/dist/types/core/FooterManager.d.ts +43 -1
  37. package/dist/types/core/FormulaController.d.ts +4 -4
  38. package/dist/types/core/GridComposer.d.ts +11 -1
  39. package/dist/types/core/GridRenderer.d.ts +84 -19
  40. package/dist/types/core/GroupTreeManager.d.ts +6 -4
  41. package/dist/types/core/KeyboardManager.d.ts +3 -2
  42. package/dist/types/core/MergeEngine.d.ts +45 -5
  43. package/dist/types/core/MutationService.d.ts +14 -17
  44. package/dist/types/core/OpenGrid.d.ts +350 -12
  45. package/dist/types/core/OrgChart.d.ts +24 -0
  46. package/dist/types/core/RangeSelectionManager.d.ts +23 -2
  47. package/dist/types/core/RenderController.d.ts +126 -8
  48. package/dist/types/core/RowDragDrop.d.ts +2 -0
  49. package/dist/types/core/SortFilterManager.d.ts +18 -2
  50. package/dist/types/core/VirtualScroll.d.ts +12 -0
  51. package/dist/types/core/WorksheetManager.d.ts +2 -2
  52. package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +321 -20
  53. package/dist/types/core/a11y/LiveRegionController.d.ts +229 -27
  54. package/dist/types/core/a11y/VisualEquivRegistry.d.ts +199 -14
  55. package/dist/types/core/appearance/TextureRegistry.d.ts +10 -0
  56. package/dist/types/core/cf/CFRule.d.ts +145 -22
  57. package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
  58. package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
  59. package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
  60. package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
  61. package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
  62. package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
  63. package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
  64. package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
  65. package/dist/types/core/coordinate/ports.d.ts +5 -0
  66. package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
  67. package/dist/types/core/domain/footer/ports.d.ts +31 -0
  68. package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
  69. package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
  70. package/dist/types/core/domain/render/ports.d.ts +169 -0
  71. package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
  72. package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
  73. package/dist/types/core/domain/resize/ports.d.ts +64 -0
  74. package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
  75. package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
  76. package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
  77. package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
  78. package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
  79. package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
  80. package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
  81. package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
  82. package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
  83. package/dist/types/core/domain/sort/ports.d.ts +140 -0
  84. package/dist/types/core/export/ExportProgressView.d.ts +28 -0
  85. package/dist/types/core/export/channels/XlsxChannel.d.ts +29 -0
  86. package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +17 -0
  87. package/dist/types/core/export/index.d.ts +2 -0
  88. package/dist/types/core/export/sinks.d.ts +81 -0
  89. package/dist/types/core/host/archCheck.d.ts +16 -1
  90. package/dist/types/core/i18n/locales/en.d.ts +6 -0
  91. package/dist/types/core/i18n/locales/ko.d.ts +6 -0
  92. package/dist/types/core/i18n/types.d.ts +8 -0
  93. package/dist/types/core/render/FooterView.d.ts +121 -0
  94. package/dist/types/core/render/GeometryApplier.d.ts +55 -0
  95. package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
  96. package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
  97. package/dist/types/core/render/RenderScheduler.d.ts +225 -0
  98. package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
  99. package/dist/types/core/render/ScrollFollower.d.ts +34 -0
  100. package/dist/types/core/render/ScrollObserver.d.ts +47 -0
  101. package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
  102. package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
  103. package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
  104. package/dist/types/core/render/body/BodyView.d.ts +185 -0
  105. package/dist/types/core/render/body/CellLocator.d.ts +36 -0
  106. package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
  107. package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
  108. package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
  109. package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
  110. package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
  111. package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
  112. package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
  113. package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
  114. package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
  115. package/dist/types/core/render/dom.d.ts +10 -0
  116. package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
  117. package/dist/types/core/render/header/HeaderView.d.ts +84 -0
  118. package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
  119. package/dist/types/core/render/ports.d.ts +218 -0
  120. package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
  121. package/dist/types/core/types.d.ts +572 -22
  122. package/dist/types/index.d.ts +31 -1
  123. package/dist/types/vue/OpenGrid.vue.d.ts +2 -2
  124. package/package.json +8 -9
  125. package/dist/OpenGrid-DgZtbVD0.cjs +0 -7390
  126. package/dist/OpenGrid-E11B7Xa7.js +0 -7403
@@ -0,0 +1,58 @@
1
+ import { AppearanceResolver } from '../../../AppearanceResolver.js';
2
+ import { RendererCallbacks } from '../../../GridRenderer.js';
3
+ import { CellRegistry } from '../CellRegistry.js';
4
+ import { ExtraColumnId, IColumnWindow } from '../../../coordinate/geometryPorts.js';
5
+ import { ExtraCellPainter } from '../ExtraCellPainters.js';
6
+ import { BodyRowContext, BodyRowPainter } from './BodyRowContext.js';
7
+ /**
8
+ * 자료 행 하나를 그린다. 자료가 없으면(합성 배열 끝 너머 등) 그리지 않는다.
9
+ *
10
+ * Paints one data row; returns null when there is no row data.
11
+ */
12
+ export declare class DataRowPainter implements BodyRowPainter {
13
+ private readonly _ap;
14
+ private readonly _cbs;
15
+ private readonly _cellMap;
16
+ private readonly _tr;
17
+ private readonly _extras;
18
+ readonly kind: "data";
19
+ constructor(_ap: AppearanceResolver, _cbs: RendererCallbacks, _cellMap: CellRegistry, _tr: (key: string, params?: Record<string, string | number>) => string, _extras: Readonly<Record<ExtraColumnId, ExtraCellPainter>>);
20
+ private _t;
21
+ /** 렌더러에 넘기는 낱말 해석(그리개당 하나 — 칸마다 함수를 만들지 않으려고). / Translator handed to renderers (one per painter). */
22
+ private readonly _tFn;
23
+ paint(ri: number, flatItem: any, ctx: BodyRowContext): HTMLElement | null;
24
+ /**
25
+ * 창 차례(칸 구간·빈칸)대로 자료 칸을 행에 붙인다. 창이 전 컬럼이면 컬럼 0 부터 끝까지 — 걸음 전과 같은 DOM.
26
+ * 오른쪽 빈칸이 있을 때만 그 앞 칸에 `og-cell--last` 를 단다(창이 전 컬럼이면 달지 않음).
27
+ *
28
+ * Appends the data cells in window order (runs and gaps). A full window is columns 0..n-1 — the same DOM as before.
29
+ * `og-cell--last` goes on the cell before the right gap only when there is one.
30
+ */
31
+ private _paintColumns;
32
+ /**
33
+ * 창이 바뀔 때 행을 다시 만들지 않고 칸만 고친다: 나간 컬럼 칸을 떼고(지도에서도), 빈칸을 다시 놓고, 들어온 컬럼 칸만 새로 만들어
34
+ * 제자리에 끼운다. 그대로인 칸은 손대지 않는다(편집기·포커스·사용자 렌더러가 단 리스너가 산다). 들어온 칸은 늘 새로 그린다.
35
+ * `ctx.layout`·`ctx.columns` 는 이미 새 창이다. 행마다 새 배열·함수를 만들지 않는다.
36
+ *
37
+ * On a window change, fixes only the cells: removes cells of columns that left (and from the map), re-places the
38
+ * gaps and creates only the entering cells in place. Kept cells are untouched; entering cells are always fresh.
39
+ */
40
+ shift(rowEl: HTMLElement, ri: number, flatItem: any, from: IColumnWindow, ctx: BodyRowContext, onRemove: (cell: HTMLElement) => void): void;
41
+ /** 창 옮김에서 떼어 둔 빈칸(그리개당 하나를 돌려씀 — 행마다 배열을 만들지 않음). / Gap pool, one per painter. */
42
+ private readonly _gapPool;
43
+ /** 창 옮김에서 칸을 잠깐 받는 그릇(그리개당 하나 — 칸마다 만들지 않음). / Scratch fragment, one per painter. */
44
+ private readonly _buf;
45
+ /**
46
+ * 행 하나의 값(자료·나무 노드·행 상태·고정 칸 배경)을 문맥에 담는다. 자료가 없으면 false.
47
+ *
48
+ * Puts one row's values (data, tree node, row state, sticky background) into the context; false without data.
49
+ */
50
+ private _rowValues;
51
+ /**
52
+ * 컬럼 하나의 칸(또는 병합으로 가려진 자리채움)을 만들어 target 에 붙인다. 행 값은 문맥에서 읽는다.
53
+ * 지도: colMap 을 주면 거기에(행을 다 그린 뒤 통째로 넣음), 없으면 칸 지도에 바로.
54
+ *
55
+ * Builds one column's cell (or merge placeholder) into target, reading row values from the context.
56
+ */
57
+ private _cell;
58
+ }
@@ -0,0 +1,24 @@
1
+ import { AppearanceResolver } from '../../../AppearanceResolver.js';
2
+ import { BodyRowContext, BodyRowPainter } from './BodyRowContext.js';
3
+ /**
4
+ * 디테일 머리 행 → 전체 폭 패널. 디테일 배선이 없으면 아무것도 안 그린다(패널 없이 건너뜀).
5
+ * 보이는 구간 위에서 시작해 구간을 덮는 패널도 이 그리개로 그린다(ri 가 시작 행보다 작으면 top 이 음수 쪽).
6
+ *
7
+ * Detail head → full-width panel; nothing without detail wiring. Also used for a panel that starts above the
8
+ * visible range and covers it (ri below the start index gives a top above the offset).
9
+ */
10
+ export declare class DetailRowPainter implements BodyRowPainter {
11
+ private readonly _ap;
12
+ readonly kind: "detail-head";
13
+ constructor(_ap: AppearanceResolver);
14
+ paint(ri: number, head: any, ctx: BodyRowContext): HTMLElement | null;
15
+ }
16
+ /**
17
+ * 디테일 채움 행 — 머리의 패널이 이 띠를 덮으므로 그릴 것이 없다.
18
+ *
19
+ * Detail filler row — covered by the head's panel, so nothing to draw.
20
+ */
21
+ export declare class DetailFillerRowPainter implements BodyRowPainter {
22
+ readonly kind: "detail-filler";
23
+ paint(): HTMLElement | null;
24
+ }
@@ -0,0 +1,32 @@
1
+ import { AppearanceResolver } from '../../../AppearanceResolver.js';
2
+ import { BodyRowContext, BodyRowPainter } from './BodyRowContext.js';
3
+ /**
4
+ * 묶음 머리 행 하나를 그린다(누르면 펼침/접힘).
5
+ *
6
+ * Paints one group header row (click toggles it).
7
+ */
8
+ export declare class GroupRowPainter implements BodyRowPainter {
9
+ private readonly _ap;
10
+ private readonly _tr;
11
+ readonly kind: "group";
12
+ constructor(_ap: AppearanceResolver, _tr: (key: string, params?: Record<string, string | number>) => string);
13
+ private _t;
14
+ paint(ri: number, flatItem: any, ctx: BodyRowContext): HTMLElement | null;
15
+ /**
16
+ * 창이 바뀔 때: 묶음 행의 컬럼 몫(여분 자리 뒤)만 걷어 새 창으로 다시 놓는다. 묶음 행은 화면에 적고 칸에 상태가 없어
17
+ * (편집기·사용자 렌더러 없음) 컬럼 몫을 통째로 다시 놓아도 같은 창으로 그린 것과 같다. 행 요소는 그대로.
18
+ *
19
+ * On a window change, replaces only the column part (after the extra spot) with the new window. Group rows are few
20
+ * and their cells hold no state, so re-laying the column part equals painting with the new window. The row stays.
21
+ */
22
+ shift(rowEl: HTMLElement, flatItem: any, ctx: BodyRowContext): void;
23
+ /**
24
+ * 컬럼 칸과 빈칸을 창 차례대로 붙이고 폭 자리를 기억시킨다. 마지막 칸 구간은 행 하나로 등록하고(칸이 컬럼 순서대로 하나씩
25
+ * 붙으므로), 그 앞 구간(고정 컬럼)은 칸마다 — 등록기는 한 행에 행 등록을 하나만 들므로. 빈칸은 빈칸 등록.
26
+ * 묶음 이름은 창과 무관하게 「소계가 없는 첫 컬럼」에 둔다(전 컬럼을 그릴 때와 같은 칸). 그 컬럼이 창 밖이면 행의 aria-label 로 읽히게 한다.
27
+ *
28
+ * Appends cells and gaps in window order and registers width spots: the last run as one row registration, earlier
29
+ * runs (frozen) per cell, gaps as gaps. The label column is fixed regardless of the window.
30
+ */
31
+ private _columns;
32
+ }
@@ -0,0 +1,24 @@
1
+ import { RowKind } from '../../ports.js';
2
+ import { BodyRowPainter } from './BodyRowContext.js';
3
+ /**
4
+ * 행 종류 → 그리개 표. 종류마다 그리개 하나(인스턴스는 BodyView 가 한 번 만든다).
5
+ *
6
+ * Row kind → painter table; one painter per kind, created once by the body view.
7
+ */
8
+ export declare class RowPainterTable {
9
+ private readonly _byKind;
10
+ constructor(painters: readonly BodyRowPainter[]);
11
+ /**
12
+ * 합성 행 배열의 한 칸이 어떤 종류의 행인가. 합성 배열이 없을 때(null)·끝을 넘은 칸(undefined)은 자료 행으로 본다 —
13
+ * 자료 행 그리개가 자료를 못 찾으면 그리지 않는다. 판정 순서는 채움 → 디테일 머리 → 묶음 → 자료(나무 노드 포함).
14
+ *
15
+ * Which kind of row a composed item is. null/undefined count as data (the data painter skips missing rows).
16
+ */
17
+ kindOf(item: unknown): RowKind;
18
+ /**
19
+ * 그 종류의 그리개. 모르는 종류면 던진다 — 행이 소리 없이 사라지는 것보다 낫다.
20
+ *
21
+ * The painter for a kind; throws on an unknown kind rather than silently dropping rows.
22
+ */
23
+ painterFor(kind: RowKind): BodyRowPainter;
24
+ }
@@ -0,0 +1,38 @@
1
+ import { IColumnWindow } from '../../../coordinate/geometryPorts.js';
2
+ import { BodyRowContext } from './BodyRowContext.js';
3
+ /** 차례의 한 토막 — 칸 구간 또는 빈칸(둘 다 닫힌 구간 [from, to]). / One piece: a cell run or a gap (closed range). */
4
+ export interface WindowPiece {
5
+ readonly gap: boolean;
6
+ readonly from: number;
7
+ readonly to: number;
8
+ }
9
+ /**
10
+ * 창 하나의 그리기 차례.
11
+ *
12
+ * Paint order of one window.
13
+ */
14
+ export interface WindowLayout {
15
+ readonly pieces: readonly WindowPiece[];
16
+ /** 오른쪽 빈칸 바로 앞 칸의 컬럼(오른쪽 빈칸이 없으면 -1 — 창이 전 컬럼이면 늘 -1). / Column just before the right gap, or -1. */
17
+ readonly lastBeforeGap: number;
18
+ }
19
+ /**
20
+ * 창의 구간과 빈칸을 컬럼 차례대로 섞는다(DOM 차례 = 컬럼 차례 — 고정 칸 뒤에 빈칸이 와야 sticky 가 산다).
21
+ *
22
+ * Interleaves runs and gaps in column order (DOM order = column order, gaps after the frozen cells).
23
+ */
24
+ export declare function layoutOf(w: IColumnWindow): WindowLayout;
25
+ /**
26
+ * 빈칸 하나 — 칸 요소가 아니다(`og-cell`·`role`·`aria-colindex` 없음 — 칸을 찾는 길이 빈칸을 칸으로 오인하지 않게).
27
+ * 폭은 기하에서 읽고 폭 쓰는 객체에 기억시켜, 끄는 동안 창 밖 컬럼 폭이 바뀌면 같은 프레임에 따라온다.
28
+ *
29
+ * A gap: not a cell (no `og-cell`/`role`/`aria-colindex`). Its width comes from the geometry and is registered so it
30
+ * follows column-width changes outside the window in the same frame.
31
+ */
32
+ export declare function paintGap(from: number, to: number, ctx: BodyRowContext): HTMLElement;
33
+ /**
34
+ * 이미 있는 빈칸 요소를 새 구간으로 다시 쓴다(창 옮김에서 행마다 빈칸을 새로 만들지 않으려고). 폭은 기하에서, 등록은 갈아 끼움.
35
+ *
36
+ * Reuses an existing gap element for a new range (no new gap per row on a shift); width from the geometry, registration replaced.
37
+ */
38
+ export declare function reuseGap(el: HTMLElement, from: number, to: number, ctx: BodyRowContext): HTMLElement;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 태그(+선택 className)로 요소를 만든다. / Create an element from a tag (+optional className).
3
+ * @internal
4
+ */
5
+ export declare function _el(tag: string, className?: string): HTMLElement;
6
+ /**
7
+ * 요소 style 에 부분 스타일을 병합한다. / Merge a partial style bag into an element's style.
8
+ * @internal
9
+ */
10
+ export declare function _style(el: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
@@ -0,0 +1,39 @@
1
+ import { IHeaderSortIndicator } from '../ports.js';
2
+ type Dir = 'asc' | 'desc';
3
+ /**
4
+ * 머리글 칸들의 정렬 표시를 고치는 유일한 곳. 머리글을 그린 쪽이 칸마다 bind 하고, 정렬이 끝나면 update 한 번.
5
+ *
6
+ * The single place that patches sort marks on header cells; the header painter binds each cell, and update()
7
+ * runs once when a sort finishes.
8
+ */
9
+ export declare class HeaderSortIndicator implements IHeaderSortIndicator {
10
+ private _bound;
11
+ private _pressed;
12
+ /**
13
+ * 머리글 칸 하나를 묶는다. 지금 그 칸에 그려진 방향은 칸에서 읽는다(머리글을 그린 쪽이 이미 그렸으므로).
14
+ * Binds one header cell; its current direction is read from the cell (the painter already drew it).
15
+ */
16
+ bind(th: HTMLElement, field: string, sortable: boolean): void;
17
+ /** 끝나는 프레임에 한 번 — 방향이 바뀐 칸만 쓴다(안 바뀐 칸은 읽기·쓰기 0). */
18
+ update(sortList: readonly {
19
+ readonly field: string;
20
+ readonly dir: Dir;
21
+ }[]): void;
22
+ /** 누른 칸에 눌림 표시(og-sorting). null 이면 지운다. / Pressed mark on the field's cells; null clears it. */
23
+ setPressed(field: string | null): void;
24
+ /**
25
+ * 오래 걸리는 정렬이 진행 중인 칸에 aria-busy. 진행 막대·다음 방향 표시는 조각 정렬이 들어올 때 이 메서드 안에서 더한다.
26
+ * aria-busy on the cells of a long-running sort; the progress bar and next-direction hint belong here when sliced sorting lands.
27
+ */
28
+ setBusy(field: string, busy: boolean, _nextDir?: Dir): void;
29
+ /** 묶음을 모두 푼다(머리글을 통째로 다시 그리기 전). 칸은 건드리지 않는다. / Drops all bindings without touching cells. */
30
+ release(): void;
31
+ /**
32
+ * 머리글을 처음 그릴 때와 같은 모양으로 고친다: og-sorted 는 클래스 끝에, 화살표는 제목 글자 바로 뒤에,
33
+ * aria-sort 는 정렬 가능한 칸에만.
34
+ * Patches to the fresh-paint shape: og-sorted appended, the arrow right after the label, aria-sort only when sortable.
35
+ */
36
+ private _paint;
37
+ private _icon;
38
+ }
39
+ export {};
@@ -0,0 +1,84 @@
1
+ import { AppearanceResolver } from '../../AppearanceResolver.js';
2
+ import { ColumnDef, SortItem } from '../../types.js';
3
+ import { RenderOptions, RendererCallbacks } from '../../GridRenderer.js';
4
+ import { ResizeHandleBinder } from './ResizeHandleBinder.js';
5
+ import { IColumnGeometry } from '../../coordinate/geometryPorts.js';
6
+ import { IGeometryApplier, IHeaderSortIndicator } from '../ports.js';
7
+ /**
8
+ * 머리글 표(여분 th·잎/묶음 th·정렬과 필터 표시·aria·키보드 이동·끌어 옮기기·너비 손잡이)를 만드는 객체.
9
+ * 머리글을 그리는 일을 렌더러 앞면에서 떼어 내 한 곳에 두려고 만들었다. 지금은 부를 때마다 머리글 표를 통째로 다시 만든다.
10
+ * 너비 손잡이의 동작은 `ResizeHandleBinder` 에 맡긴다.
11
+ *
12
+ * Builds the header table (extra ths, leaf/group ths, sort and filter marks, aria, keyboard moves, drag reorder,
13
+ * width handles). Split out of the renderer facade so header painting lives in one place. For now each call rebuilds
14
+ * the whole header table. Width-handle behaviour is delegated to `ResizeHandleBinder`.
15
+ */
16
+ export declare class HeaderView {
17
+ private readonly _header;
18
+ private readonly _ap;
19
+ private readonly _cbs;
20
+ private readonly _resize;
21
+ private readonly _tr;
22
+ constructor(_header: HTMLElement, _ap: AppearanceResolver, _cbs: RendererCallbacks, _resize: ResizeHandleBinder, _tr: (key: string, params?: Record<string, string | number>) => string);
23
+ private _geometry;
24
+ /**
25
+ * 컬럼 기하를 받는다(그리드가 한 번 넘겨 준다). 머리글의 폭·고정 left·전체 폭은 이 기하에 묻는다 —
26
+ * 같은 계산을 머리글이 따로 들고 있으면 본문·푸터와 어긋나기 때문이다. 받기 전에는 그리지 않는 것으로 본다.
27
+ *
28
+ * Receives the column geometry once from the grid. Header widths, frozen lefts and total width are asked of it so
29
+ * the header can never drift from body and footer. The view is not painted before this is called.
30
+ */
31
+ setGeometry(geometry: IColumnGeometry): void;
32
+ /** 머리글 table 의 오른쪽 끝 여백(px) — 0 이면 아무것도 안 씀. */
33
+ private _gutter;
34
+ private _table;
35
+ /**
36
+ * 본문 세로 스크롤바 폭만큼의 끝 여백을 받는다 — 머리글의 가로 스크롤 끝이 본문 끝과 같아져 오른쪽 끝까지 긁어도 선이 맞는다.
37
+ * 0 이면 여백을 두지 않는다(스크롤바가 없는·겹쳐 뜨는 환경의 DOM 은 그대로). 다시 그릴 때도 같은 값을 쓴다.
38
+ *
39
+ * Receives the end gutter (the body's vertical scrollbar width) so the header can scroll as far right as the body.
40
+ * Zero writes nothing (DOM unchanged where scrollbars take no space); repaints reuse the value.
41
+ */
42
+ setEndGutter(px: number): void;
43
+ private _applier;
44
+ private _sort;
45
+ /**
46
+ * 정렬 표시만 고치는 객체를 받는다(그리드가 한 번 넘겨 준다). 정렬이 바뀔 때 머리글을 통째로 다시 만들지 않고
47
+ * 그 객체가 화살표·클래스·aria 만 고치게, 그릴 때마다 잎 칸을 묶어 준다. 받기 전에는 묶지 않고 그리기만 한다.
48
+ *
49
+ * Receives the sort-indicator object; each paint binds the leaf cells to it so a sort change patches only the arrow,
50
+ * class and aria instead of rebuilding the header. Without it, painting simply skips binding.
51
+ */
52
+ setSortIndicator(sort: IHeaderSortIndicator): void;
53
+ /** 머리글 한 판의 리스너 묶음 — 다시 그리거나 지울 때 한 번에 뗀다(떼어 낸 th 에 콜백이 남지 않게). */
54
+ private _listeners;
55
+ /**
56
+ * 머리글 리스너를 모두 떼고 손잡이 객체도 정리한다. 그리드를 지운 뒤 남은 th 에 사건이 와도 콜백이 불리지 않게.
57
+ *
58
+ * Detach every header listener and the handle binder, so events on leftover ths never reach callbacks after destroy.
59
+ */
60
+ destroy(): void;
61
+ /**
62
+ * 기하 px 를 DOM 에 쓰는 객체를 받는다. 머리글은 폭을 품은 자리(잎 칸 폭·고정 칸 left·표 전체 폭)를 여기에 등록해,
63
+ * 컬럼 폭이 바뀔 때 머리글을 다시 만들지 않고 그 자리만 고칠 수 있게 한다. 받기 전에는 등록 없이 그리기만 한다.
64
+ *
65
+ * Receives the geometry applier. The header registers its width-bearing spots so a width change can patch them
66
+ * instead of rebuilding the header. Without it, painting simply skips registration.
67
+ */
68
+ setApplier(applier: IGeometryApplier): void;
69
+ private _t;
70
+ /**
71
+ * 지금 그려진 머리글 영역의 실제 높이(px). 줄바꿈 머리글로 늘어난 높이를 배치에 되돌릴 때 쓴다.
72
+ *
73
+ * The actual height (px) of the currently rendered header, used to feed height grown by header wrapping back into layout.
74
+ */
75
+ height(): number;
76
+ /**
77
+ * 머리글 표를 통째로 다시 그린다(머리글 칸 표·잎·정렬 목록·옵션을 받아서). 폭은 받은 `widths` 가 아니라 기하에 묻는다 —
78
+ * 인자는 부르는 쪽 서명을 지키려고 남겨 둔 것이고 기하와 같은 값이다.
79
+ *
80
+ * Rebuild the whole header table. Widths are asked of the geometry; the `widths` argument is kept for the caller's
81
+ * signature and carries the same values.
82
+ */
83
+ paint(headerRows: any[][], leaves: ColumnDef[], widths: readonly number[], sortList: SortItem[], opts: RenderOptions): void;
84
+ }
@@ -0,0 +1,110 @@
1
+ import { IResizeSink } from '../../domain/resize/ports.js';
2
+ import { IColumnGeometry, IColumnWidthWriter } from '../../coordinate/geometryPorts.js';
3
+ import { IRenderScheduler } from '../ports.js';
4
+ /** 끌기 새 흐름에 필요한 협력자들(그리드가 한 번 넘겨 준다). / Collaborators of the live-resize flow. */
5
+ export interface ResizeBinderPorts {
6
+ /** 폭 주인(날 배열과 기하에 같은 정수를 쓴다). / The width owner (same integer to raw widths and geometry). */
7
+ readonly widths: IColumnWidthWriter;
8
+ readonly scheduler: IRenderScheduler;
9
+ readonly sink: IResizeSink;
10
+ readonly geometry: IColumnGeometry;
11
+ }
12
+ /**
13
+ * 머리글 너비 손잡이의 DOM 이벤트(누름 → 끌기 → 놓기)를 맡는 객체.
14
+ * 상태와 폭 계산은 헤드리스 상태 기계(`ResizeGesture`)가, 「이 점이 어느 컬럼의 손잡이인가」는 헤드리스 판정(`ResizeHitZone`)이 맡고,
15
+ * 이 객체는 DOM 이벤트를 그리로 옮기기만 한다.
16
+ * 손잡이를 놓은 뒤 따라오는 click 하나는 정렬로 넘기지 않는다(머리글 click 처리기가 `shouldSwallowClick` 으로 묻는다) —
17
+ * 너비를 조절하고 손을 떼는 순간 머리글이 정렬돼 자료가 뒤섞이는 일을 막으려고.
18
+ * 컬럼 경계 양쪽 몇 px 도 손잡이로 친다(경계 어느 쪽을 잡아도 경계 왼쪽 컬럼이 끌림). 그 자리는 요소·스타일시트 규칙을 더하지 않고
19
+ * 머리글에 단 위임 듣개 하나가 포인터 자리를 판정해, 손잡이 영역이면 그 th 에 커서를 잠깐 쓰고 누르면 끌기를 시작한다.
20
+ * 협력자(`connect`)를 받은 뒤로 끄는 동안에는 폭 주인에게 폭을 쓰고 스케줄러에 요청만 한다(DOM 은 스케줄러가 등록 자리에 씀) —
21
+ * 놓을 때는 사용자 폭을 저장할 뿐 다시 그리지 않는다. 협력자가 없으면 끄는 동안 아무것도 안 쓰고 놓을 때 옛 `commit` 만 부른다.
22
+ * 누름은 취소하지 않는다(포인터 누름을 취소하면 브라우저가 호환 마우스 사건을 페이지에 안 보낸다) — 글자 선택은 호환 mousedown 에서 막는다.
23
+ *
24
+ * Owns the DOM events of header width handles; state/width math live in the headless `ResizeGesture`, and which column a
25
+ * point grips lives in the headless `ResizeHitZone`. The click that follows a release is swallowed so finishing a resize
26
+ * never sorts the header. A few px on both sides of a column boundary also act as the grip: no element or stylesheet rule
27
+ * is added — one delegated listener on the header classifies the pointer, sets the cursor on that th while it is over the
28
+ * zone and starts the drag on press.
29
+ */
30
+ export declare class ResizeHandleBinder {
31
+ private readonly _readWidth;
32
+ private readonly _commit;
33
+ private readonly _gesture;
34
+ private readonly _zone;
35
+ /** 끌 수 있는 잎 번호 → 그 잎의 th. 머리글을 다시 그릴 때 비운다. */
36
+ private readonly _resizable;
37
+ /** 끌 수 있는 잎의 필드 → 지금 판의 잎 번호(끄는 중 머리글이 다시 그려져 번호가 밀려도 같은 컬럼을 찾으려고). */
38
+ private readonly _leafOfField;
39
+ /** 잎 th → 잎 번호(끌 수 없는 잎 포함 — 그 왼쪽 경계가 앞 컬럼 손잡이가 될 수 있다). */
40
+ private _leafOf;
41
+ /** 머리글 한 판의 리스너 묶음 신호(머리글 뷰가 준다) — 그 판을 버리면 손잡이 리스너도 함께 떨어진다. */
42
+ private _signal;
43
+ /** 머리글 위임 듣개(머리글 요소의 수명 동안 하나). */
44
+ private _headerListeners;
45
+ /** 지금 커서를 바꿔 둔 th 와 그 전 인라인 커서. */
46
+ private _cursorTh;
47
+ private _savedCursor;
48
+ /** 새 흐름의 협력자(없으면 놓을 때만 옛 commit). */
49
+ private _ports;
50
+ /** 지금 끄는 중이면 그 끌기. */
51
+ private _drag;
52
+ /** Esc 뒤 「놓음 대기」 듣개 묶음 — destroy 때 함께 푼다(Esc 와 놓음 사이 파괴 누수 방지). / Post-Esc release listeners; aborted on destroy. */
53
+ private _escRel;
54
+ constructor(_readWidth: (th: HTMLElement) => number, _commit: (leafIndex: number, width: number) => void);
55
+ /** 잎 컬럼의 지금 폭(px) — th 안 점이 경계에서 얼마나 떨어졌나를 배치 읽기 없이 재려고(컬럼 기하가 안다). */
56
+ private _leafWidth;
57
+ /**
58
+ * 머리글을 새로 그리기 전에 부른다 — 잎 기억을 버리고 새 판의 리스너 묶음 신호를 받는다(옛 손잡이 리스너는 머리글 뷰가
59
+ * 옛 판을 버릴 때 함께 떨어진다). 진행 중인 끌기·「놓음」 상태는 그대로 — 끌기는 컬럼 정체(필드)로 잡고 있으므로
60
+ * 새 판이 그 필드를 다시 알려 주면 바뀐 번호로 이어진다.
61
+ *
62
+ * Call before repainting the header: drops leaf maps and takes the new paint's listener signal (old handle listeners
63
+ * go away when the header view aborts the old paint); an ongoing gesture is kept — it holds the column by field, so it
64
+ * continues at the new index once the new paint registers that field.
65
+ */
66
+ clear(signal?: AbortSignal): void;
67
+ /**
68
+ * 끌기 새 흐름의 협력자를 받는다(그리드가 그리기 전에 한 번). 받은 뒤로는 끄는 동안 폭 주인에게 폭을 쓰고 스케줄러에 요청만 한다 —
69
+ * DOM 은 스케줄러가 다음 프레임에 한 번, 등록된 폭 자리에만 쓴다(본문을 다시 만들지 않음). 놓을 때는 사용자 폭을 저장할 뿐 다시 그리지 않는다.
70
+ *
71
+ * Receives the live-resize collaborators once. From then on a drag only writes widths to the width owner and submits
72
+ * requests; the scheduler writes the DOM once per frame into registered width spots. Releasing just stores the user width.
73
+ */
74
+ connect(ports: ResizeBinderPorts): void;
75
+ /** 지운다(리스너 모두 뗌 — 끄는 중이면 확정하지 않고 끝냄). / Detach everything (an ongoing drag ends without commit). */
76
+ destroy(): void;
77
+ /**
78
+ * 머리글 요소에 위임 듣개(포인터 이동·누름·나감)를 한 번 단다 — 경계 양쪽 손잡이 영역의 커서와 누름을 맡는다.
79
+ *
80
+ * Attach the delegated listeners (move · press · leave) to the header element once; they own the boundary grip zone.
81
+ *
82
+ * @param leafWidth 잎 컬럼의 지금 폭(px) — 컬럼 기하에 묻는 함수 / current leaf width, asked of the column geometry
83
+ */
84
+ bindHeader(header: HTMLElement, leafWidth: (leafIndex: number) => number): void;
85
+ /**
86
+ * 잎 th 를 알려 둔다(끌 수 없는 잎도). 손잡이 영역 판정이 「이 점이 어느 잎 칸 안인가」를 묻는 데 쓴다.
87
+ *
88
+ * Register a leaf th (resizable or not) so the grip zone can tell which leaf cell a point is in.
89
+ */
90
+ leaf(th: HTMLElement, leafIndex: number): void;
91
+ /**
92
+ * 손잡이 하나에 누름 처리기를 붙인다. leafIndex 가 0 보다 작으면(묶음 머리글) 놓아도 넘기지 않는다.
93
+ * field 는 그 잎 컬럼의 정체 — 끄는 중 머리글이 다시 그려져도 같은 컬럼을 이어 끌고, 없어지면 끌기를 끝내는 데 쓴다.
94
+ *
95
+ * Attach the press handler to one handle. A negative leafIndex (group header) commits nothing on release. field
96
+ * identifies the leaf column so a drag survives a header repaint and ends only when the column is gone.
97
+ */
98
+ attach(handle: HTMLElement, th: HTMLElement, leafIndex: number, field?: string): void;
99
+ /**
100
+ * 머리글 click 처리기가 묻는다: 이 click 을 삼켜야 하나(손잡이를 놓은 뒤 따라온 click 이면 true, 한 번만).
101
+ *
102
+ * Asked by the header click handler: swallow this click? True once for the click that follows a release.
103
+ */
104
+ shouldSwallowClick(_e: MouseEvent): boolean;
105
+ /** 점이 손잡이 영역이면 끌 컬럼과 그 th. 손잡이 요소 자체(제 처리기가 있음)·묶음 칸·잎 밖이면 null. */
106
+ private _hitAt;
107
+ private _hover;
108
+ private _restoreCursor;
109
+ private _begin;
110
+ }
@@ -0,0 +1,218 @@
1
+ import { IColumnGeometry, IColumnWindow, IColumnWindowPolicy, ICellTextPolicy, GeometryChange, ViewportBox, RowSpan } from '../coordinate/geometryPorts.js';
2
+ import { IRenderRequest, IRenderPlan, IRenderPlanner, DrawnState, NextState, RowWork, ColWork } from '../domain/render/ports.js';
3
+ /** 프레임 시계(rAF 를 감싼 포트 — 시험에서 가짜 시계). */
4
+ export interface FramePort {
5
+ request(cb: () => void): number;
6
+ cancel(id: number): void;
7
+ }
8
+ /** 지금 DOM 에 붙은 칸 요소의 유일한 지도(기존 _cellMap). 떼면 지도에서도 지운다. */
9
+ export interface ICellRegistry {
10
+ set(ri: number, ci: number, el: HTMLElement): void;
11
+ get(ri: number, ci: number): HTMLElement | undefined;
12
+ /** 컬럼 ci 의 지금 그려진 칸들(행 순서 무관). 매 프레임 이것을 묻는다(누를 때 목록을 붙들지 않음 → 끄는 도중 행이 바뀌어도 맞음). */
13
+ cellsOfColumn(ci: number): Iterable<HTMLElement>;
14
+ dropRow(ri: number): void;
15
+ dropColumn(ri: number, ci: number): void;
16
+ clear(): void;
17
+ readonly size: number;
18
+ }
19
+ /** 'w' = width, 'wm' = +min-width, 'wmm' = +max-width (지금 코드가 쓰는 조합 그대로). */
20
+ export type WidthProps = 'w' | 'wm' | 'wmm';
21
+ export type ProjectionScope = 'header' | 'body' | 'footer';
22
+ /**
23
+ * 기하에서 나온 px 를 DOM 에 쓰는 유일한 객체. 칸 요소는 ICellRegistry 에 묻고, 칸이 아닌 자리만 스스로 기억한다.
24
+ * 불변: applyChange 뒤 살아 있는 모든 폭 자리의 px == 기하 값(시험: 「applyChange 결과 == 처음부터 그린 결과」).
25
+ * 컬럼별 「마지막에 쓴 폭」을 기억해 같으면 쓰지 않는다(칸 객체 없이).
26
+ * 이 객체를 부르는 것은 RenderScheduler(프레임당 한 번)와 처음 그리는 그리개뿐 — 너비 조절 binder 는 직접 부르지 않는다.
27
+ * / Sole writer of geometry-derived px into the DOM.
28
+ */
29
+ export interface IGeometryApplier {
30
+ /** 쓰기 + 등록(새 코드는 이것만). 칸 요소는 등록하지 않고 쓰기만(지도는 ICellRegistry). */
31
+ writeCellWidth(el: HTMLElement, ci: number, p: WidthProps): void;
32
+ /** 등록만(동작을 바꾸지 않는 옮기기 동안 cssText 글자 순서를 그대로 두려고 — 값은 이미 쓰여 있음). */
33
+ trackHeaderCell(th: HTMLElement, ci: number, p: WidthProps): void;
34
+ /** extraPx: 기하가 모르는 몫을 더함(마지막 컬럼을 넘는 병합의 넘은 컬럼 × 기본 폭 등). 기본 0. */
35
+ trackSpan(el: HTMLElement, ci: number, span: number, p: WidthProps, s: ProjectionScope, extraPx?: number): void;
36
+ /**
37
+ * 행 하나로 칸 여럿 등록: row 의 자식 [firstChild, firstChild + (to − from)] 가 컬럼 [from, to] 의 칸 폭 자리.
38
+ * 칸 지도 밖 칸이 컬럼마다 있는 행(묶음 행 등)을 칸마다 등록하지 않으려고.
39
+ */
40
+ trackRowCells(row: HTMLElement, firstChild: number, from: number, to: number, p: WidthProps, s: ProjectionScope): void;
41
+ /** 세로 병합 마스터처럼 행 밖에 있는 absolute 요소의 left. */
42
+ trackLeft(el: HTMLElement, ci: number, s: ProjectionScope): void;
43
+ trackTotal(el: HTMLElement, prop: 'width' | 'minWidth', s: ProjectionScope): void;
44
+ trackExtra(el: HTMLElement, s: ProjectionScope): void;
45
+ /** 가상화 빈칸: [from, to] 컬럼 폭의 합. */
46
+ trackGap(el: HTMLElement, from: number, to: number, s: ProjectionScope, extraPx?: number): void;
47
+ /** CF 데이터 막대: ratio × spanWidth. 등록하는 쪽은 CFRenderBridge. */
48
+ trackBar(el: HTMLElement, ci: number, span: number, ratio: number): void;
49
+ untrack(el: HTMLElement): void;
50
+ release(s: ProjectionScope): void;
51
+ /**
52
+ * 바뀐 컬럼의 칸(ICellRegistry)·th·병합·빈칸·막대, 오른쪽 고정 칸 left, 전체 폭 자리만 다시 쓴다.
53
+ * skipScope 'body': 본문 칸(칸 지도)·본문 등록 자리를 건너뛴다 — 같은 프레임에 행을 통째로 다시 그려 곧 버릴 칸에 px 를 먼저 쓰지 않으려고
54
+ * (머리글·푸터는 그대로 씀). 넘긴 쪽이 그 프레임에 본문을 기하로 다시 그릴 책임을 진다.
55
+ * skipScope 'body' skips body cells and body spots — for frames that rebuild the rows anyway (header/footer still written).
56
+ */
57
+ applyChange(change: GeometryChange, opts?: {
58
+ skipScope?: 'body';
59
+ }): void;
60
+ }
61
+ /** 본문 가로 위치를 머리글·푸터가 따라가는 일의 주인. 지금 구현은 scrollLeft 를 옮겨 쓰고, sticky 방식으로 바꿔도 이 포트는 그대로. */
62
+ export interface IScrollFollower {
63
+ follow(el: HTMLElement): void;
64
+ unfollow(el: HTMLElement): void;
65
+ /** scroll 이벤트에서 한 번 — 쓰기만, 읽기 없음. */
66
+ sync(scrollLeft: number): void;
67
+ destroy(): void;
68
+ }
69
+ /** 「이 컬럼이 보이게」 가로 스크롤. 기하에 묻고 scrollLeft 만 쓴다. */
70
+ export interface IHorizontalReveal {
71
+ revealColumn(ci: number): void;
72
+ }
73
+ /** 스크롤·크기 입력을 읽는 유일한 곳(DOM 읽기는 여기서만 — arch:check 가 기계로 지킨다). 읽은 값은 요청으로 낸다. */
74
+ export interface IScrollObserver {
75
+ readonly box: ViewportBox;
76
+ readonly scrollTop: number;
77
+ destroy(): void;
78
+ }
79
+ /** 머리글의 정렬 표시(화살표·og-sorted·aria-sort·눌림 og-sorting·진행 막대·aria-busy)만 고친다. 머리글을 다시 만들지 않는다. */
80
+ export interface IHeaderSortIndicator {
81
+ bind(th: HTMLElement, field: string, sortable: boolean): void;
82
+ /** 끝나는 프레임에 한 번(바뀐 th 만). */
83
+ update(sortList: readonly {
84
+ readonly field: string;
85
+ readonly dir: 'asc' | 'desc';
86
+ }[]): void;
87
+ /** 누른 프레임에 눌림 표시. */
88
+ setPressed(field: string | null): void;
89
+ /** 300ms 지나도 진행 중이면 true(막대 서서히 나타남, aria-busy). */
90
+ setBusy(field: string, busy: boolean, nextDir?: 'asc' | 'desc'): void;
91
+ release(): void;
92
+ }
93
+ /** 스케줄러가 머리글에 시키는 일(구현 HeaderView). */
94
+ export interface IHeaderView {
95
+ /** 머리글 표 통째로(컬럼 구성·테마 변경 — 지금 renderHeader 와 같은 일). */
96
+ paintAll(): void;
97
+ /** 머리글 높이(px). 줄바꿈 머리글이면 기하 반영 뒤 한 번 읽는다(강제 배치 1회 허용). */
98
+ height(): number;
99
+ }
100
+ /** 스케줄러가 푸터에 시키는 일(구현 FooterView). 값 계산은 IFooterValues(헤드리스). */
101
+ export interface IFooterView {
102
+ /** 푸터 막대를 통째로(정의 변경). */
103
+ paint(): void;
104
+ /** 값만 다시 계산·표시(RenderPlan.footer === 'values'). */
105
+ updateValues(): void;
106
+ }
107
+ /**
108
+ * 범위 선택 테두리 다시 그리기(구현: RangeSelectionManager 의 repaint 를 감싼 어댑터). 좌표는 IRangeRectCalculator.
109
+ * 그려 둔 칸의 `og-range-selected` 클래스 고치기도 여기서(계획의 overlay 하나가 둘 다 뜻함).
110
+ */
111
+ export interface IRangeOverlay {
112
+ repaint(): void;
113
+ }
114
+ export type RowKind = 'data' | 'group' | 'detail-head' | 'detail-filler';
115
+ /** 행 그리개가 받는 문맥(그리기 한 번에 하나 — 행·칸마다 만들지 않음). */
116
+ export interface RowPaintContext {
117
+ readonly columns: IColumnWindow;
118
+ readonly geometry: IColumnGeometry;
119
+ readonly cells: ICellRegistry;
120
+ readonly applier: IGeometryApplier;
121
+ }
122
+ /** 행 종류 하나를 그린다(종류별 객체 — BodyView 당 하나씩). 같은 행·자료·창이면 같은 DOM(멱등). */
123
+ export interface IRowPainter<TItem = unknown> {
124
+ readonly kind: RowKind;
125
+ paint(ri: number, item: TItem, ctx: RowPaintContext): HTMLElement | null;
126
+ /** 창이 바뀔 때 행 끝 칸만 붙이고 떼고 빈칸 폭을 고친다. */
127
+ shiftWindow(row: HTMLElement, ri: number, item: TItem, prev: IColumnWindow, next: IColumnWindow, ctx: RowPaintContext): void;
128
+ }
129
+ /**
130
+ * 본문 DOM 의 주인 — 무엇이 그려져 있는지(행·칸·창·잘린 칸 덮는 폭)를 유일하게 안다. 계획을 실행하는 작은 연산을 준다.
131
+ * 행·창 두 축을 한 번에 받는 update 하나 — 순서는 「행 차분(나간 행 떼기·들어온 행은 새 창으로 만들기) → 남은 행만 창 옮김」.
132
+ * 쓰는 쪽별로 좁힌 포트: 스케줄러는 IBodyView 전부, 편집은 IBodyPin, binder 는 아무것도 안 씀.
133
+ * / Sole owner of the body DOM and of what is currently drawn.
134
+ */
135
+ export interface IBodyView extends IBodyPin {
136
+ readonly drawn: DrawnState;
137
+ update(next: NextState, rows: RowWork, cols: ColWork): void;
138
+ refreshCells(keys: readonly {
139
+ readonly ri: number;
140
+ readonly ci: number;
141
+ }[]): void;
142
+ /** to 가 null 이면 옛 포커스 칸 표시만 지운다. */
143
+ moveFocus(from: {
144
+ ri: number;
145
+ ci: number;
146
+ } | null, to: {
147
+ ri: number;
148
+ ci: number;
149
+ } | null): void;
150
+ repaintRowState(ris: readonly number[]): void;
151
+ refillColumns(cis: readonly number[]): void;
152
+ cell(ri: number, ci: number): HTMLElement | undefined;
153
+ }
154
+ /** 편집·포커스가 쓰는 좁은 포트. */
155
+ export interface IBodyPin {
156
+ pin(p: {
157
+ editRow?: number | null;
158
+ editCol?: number | null;
159
+ focusRow?: number | null;
160
+ }): void;
161
+ }
162
+ /** 세로 창의 원천(VirtualScroll 이 구현). */
163
+ export interface IRowsSource {
164
+ getVisibleRange(): RowSpan;
165
+ }
166
+ /** 스케줄러 협력자 — 모두 포트. NextState 는 스케줄러가 rows·window·geometry 에 물어 만든다. */
167
+ export interface RenderSchedulerDeps {
168
+ readonly planner: IRenderPlanner;
169
+ readonly body: IBodyView;
170
+ readonly header: IHeaderView;
171
+ readonly sort: IHeaderSortIndicator;
172
+ readonly footer: IFooterView | null;
173
+ readonly overlay: IRangeOverlay;
174
+ readonly applier: IGeometryApplier;
175
+ readonly geometry: IColumnGeometry;
176
+ readonly window: IColumnWindowPolicy;
177
+ readonly rows: IRowsSource;
178
+ readonly scroll: IScrollObserver;
179
+ }
180
+ /**
181
+ * 요청을 모아 프레임당 한 번, 계획이 말하는 최소 일만 실행하는 유일한 곳.
182
+ * 불변: 본문·기하 DOM 쓰기는 프레임당 많아야 한 번(끄는 동안도) · sync 요청은 쌓인 것까지 합쳐 즉시 한 번(예약 프레임 취소) ·
183
+ * 실행 중 요청은 다음 프레임(재진입 없음). 할 일 결정은 하지 않는다(Planner).
184
+ * / Batches requests and runs the planner's minimal work at most once per frame.
185
+ */
186
+ export interface IRenderScheduler {
187
+ submit(req: IRenderRequest): void;
188
+ flushNow(): void;
189
+ /** 시험·진단용. */
190
+ readonly lastPlan: IRenderPlan | null;
191
+ destroy(): void;
192
+ }
193
+ /**
194
+ * 기존 RendererCallbacks 의 부분집합. 구현 시 `Pick<RendererCallbacks, 이 키들>` 로 바꿔 끼운다(키 이름·뜻은 지금 그대로).
195
+ */
196
+ export interface CellCallbacksLike {
197
+ getRowState?(ri: number): string;
198
+ getFormulaMeta?(ri: number, field: string): {
199
+ src: string;
200
+ error: string | null;
201
+ approx: boolean;
202
+ } | null;
203
+ /**
204
+ * 지금 호출 `applyCF?.(cellEl, ri, col.field, value, mergedWidth, mergedHeight)` 의 여섯 인자 그대로 +
205
+ * 일곱째 `track` 을 더하기만. 동작을 바꾸지 않는 동안 막대는 여전히 mergedWidth 로 px 를 쓰고, track 은 등록만 한다.
206
+ */
207
+ applyCF?(cellEl: HTMLElement, ri: number, field: string, value: unknown, mergedWidth: number, mergedHeight: number, track?: (bar: HTMLElement, ratio: number) => void): void;
208
+ }
209
+ export interface CellPainterDeps {
210
+ readonly callbacks: CellCallbacksLike;
211
+ readonly text: ICellTextPolicy;
212
+ readonly applier: IGeometryApplier;
213
+ }
214
+ export interface IPageScrollObserver {
215
+ attach(): void;
216
+ detach(): void;
217
+ readonly attached: boolean;
218
+ }