open-grid 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/ExportProgressView-9Kt1SQxv.js +48 -0
- package/dist/ExportProgressView-B59uHIwt.cjs +48 -0
- package/dist/LcpMergeOrderer-BdUtV67j.js +114 -0
- package/dist/LcpMergeOrderer-C_ANVkGk.cjs +113 -0
- package/dist/OpenGrid-BUYQs1_w.cjs +9806 -0
- package/dist/OpenGrid-BmagF0yo.js +9819 -0
- package/dist/XlsxChannel-DOeHeP7h.cjs +95 -0
- package/dist/XlsxChannel-DdaiytFR.js +95 -0
- package/dist/XlsxWorkbookWriter-BTNtZ80J.js +199 -0
- package/dist/XlsxWorkbookWriter-_u5stfg4.cjs +198 -0
- package/dist/{index-VkKgQ506.js → index-B9_g5Eg3.js} +2 -2
- package/dist/{index-D0DJtKYI.cjs → index-CnyumyPV.cjs} +2 -2
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/sinks-BWkWQexV.js +149 -0
- package/dist/sinks-DPK0VxYG.cjs +143 -0
- package/dist/types/core/CFRenderBridge.d.ts +5 -1
- package/dist/types/core/CellEditManager.d.ts +26 -2
- package/dist/types/core/CellEventHandler.d.ts +6 -2
- package/dist/types/core/ColumnLayout.d.ts +8 -0
- package/dist/types/core/DataLayer.d.ts +48 -1
- package/dist/types/core/DetailManager.d.ts +43 -2
- package/dist/types/core/ExportManager.d.ts +24 -0
- package/dist/types/core/FindBarManager.d.ts +6 -2
- package/dist/types/core/FlatRowModel.d.ts +61 -3
- package/dist/types/core/FooterManager.d.ts +43 -1
- package/dist/types/core/FormulaController.d.ts +4 -4
- package/dist/types/core/GridComposer.d.ts +11 -1
- package/dist/types/core/GridRenderer.d.ts +84 -19
- package/dist/types/core/GroupTreeManager.d.ts +6 -4
- package/dist/types/core/KeyboardManager.d.ts +3 -2
- package/dist/types/core/MutationService.d.ts +10 -8
- package/dist/types/core/OpenGrid.d.ts +7 -5
- package/dist/types/core/RangeSelectionManager.d.ts +23 -2
- package/dist/types/core/RenderController.d.ts +126 -8
- package/dist/types/core/SortFilterManager.d.ts +10 -2
- package/dist/types/core/VirtualScroll.d.ts +12 -0
- package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
- package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
- package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
- package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
- package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
- package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
- package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
- package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
- package/dist/types/core/coordinate/ports.d.ts +5 -0
- package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
- package/dist/types/core/domain/footer/ports.d.ts +31 -0
- package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
- package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
- package/dist/types/core/domain/render/ports.d.ts +169 -0
- package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
- package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
- package/dist/types/core/domain/resize/ports.d.ts +64 -0
- package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
- package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
- package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
- package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
- package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
- package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
- package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
- package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
- package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
- package/dist/types/core/domain/sort/ports.d.ts +140 -0
- package/dist/types/core/export/ExportProgressView.d.ts +28 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +29 -0
- package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +17 -0
- package/dist/types/core/export/index.d.ts +2 -0
- package/dist/types/core/export/sinks.d.ts +81 -0
- package/dist/types/core/host/archCheck.d.ts +16 -1
- package/dist/types/core/i18n/locales/en.d.ts +6 -0
- package/dist/types/core/i18n/locales/ko.d.ts +6 -0
- package/dist/types/core/i18n/types.d.ts +8 -0
- package/dist/types/core/render/FooterView.d.ts +121 -0
- package/dist/types/core/render/GeometryApplier.d.ts +55 -0
- package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
- package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
- package/dist/types/core/render/RenderScheduler.d.ts +225 -0
- package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
- package/dist/types/core/render/ScrollFollower.d.ts +34 -0
- package/dist/types/core/render/ScrollObserver.d.ts +47 -0
- package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
- package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
- package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
- package/dist/types/core/render/body/BodyView.d.ts +185 -0
- package/dist/types/core/render/body/CellLocator.d.ts +36 -0
- package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
- package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
- package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
- package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
- package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
- package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
- package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
- package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
- package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
- package/dist/types/core/render/dom.d.ts +10 -0
- package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
- package/dist/types/core/render/header/HeaderView.d.ts +84 -0
- package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
- package/dist/types/core/render/ports.d.ts +218 -0
- package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
- package/dist/types/core/types.d.ts +70 -0
- package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
- package/package.json +2 -8
- package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
- package/dist/OpenGrid-D6YxCsnV.js +0 -7472
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 찾은 결과. 다음 호출 때 같은 객체를 다시 채우므로 받은 자리에서만 읽는다(마우스 이동마다 객체를 만들지 않으려고).
|
|
3
|
+
*
|
|
4
|
+
* The result; the same object is refilled on the next call, so read it on the spot (no object per mouse move).
|
|
5
|
+
*/
|
|
6
|
+
export interface BodyHit {
|
|
7
|
+
/** 본문 바로 아래 요소(자료 행·묶음 행·세로 병합 마스터·디테일 패널 등). / Direct child of the body. */
|
|
8
|
+
top: HTMLElement;
|
|
9
|
+
/** 그 대상이 든 자료 칸(없으면 null — 여분 칸·자리채움·묶음 행·패널 등). / The data cell, or null. */
|
|
10
|
+
cell: HTMLElement | null;
|
|
11
|
+
/** 행 번호(자료 행·세로 병합 마스터일 때, 그 밖엔 -1). / Row index for data rows and masters, else -1. */
|
|
12
|
+
ri: number;
|
|
13
|
+
/** 컬럼 번호(칸일 때, 그 밖엔 -1). / Column index for cells, else -1. */
|
|
14
|
+
ci: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 본문 요소 하나에 대한 칸 찾기. 그 본문의 칸만 찾는다 — 디테일 패널 안에 든 다른 그리드의 칸은 이 본문의 칸이 아니다.
|
|
18
|
+
*
|
|
19
|
+
* Cell lookup for one body element; only this body's cells count (a grid nested in a detail panel is not this body).
|
|
20
|
+
*/
|
|
21
|
+
export declare class CellLocator {
|
|
22
|
+
private readonly _body;
|
|
23
|
+
/** 행 밖에 붙은 세로 병합 마스터 칸 → 행 번호(그리는 쪽이 채운다). / Row-spanning master → row index (filled by the painter). */
|
|
24
|
+
private readonly _masters;
|
|
25
|
+
private readonly _hit;
|
|
26
|
+
constructor(_body: HTMLElement,
|
|
27
|
+
/** 행 밖에 붙은 세로 병합 마스터 칸 → 행 번호(그리는 쪽이 채운다). / Row-spanning master → row index (filled by the painter). */
|
|
28
|
+
_masters: ReadonlyMap<HTMLElement, number>);
|
|
29
|
+
/**
|
|
30
|
+
* 대상이 이 본문 안이면 결과를, 밖이면 null. 칸은 「본문 바로 아래 행의 자식」이거나 「본문 바로 아래의 세로 병합 마스터」만이다.
|
|
31
|
+
*
|
|
32
|
+
* The hit when the target is inside this body, else null. A cell is either a child of a row directly under the body
|
|
33
|
+
* or a row-spanning master directly under the body.
|
|
34
|
+
*/
|
|
35
|
+
locate(target: EventTarget | null): BodyHit | null;
|
|
36
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ICellRegistry } from '../ports.js';
|
|
2
|
+
/**
|
|
3
|
+
* 지금 본문 DOM 에 붙어 있는 칸 요소의 유일한 지도(행 번호 → 컬럼 번호 → 칸 요소).
|
|
4
|
+
* 칸을 찾는 길(`GridRenderer.getCellEl`, 편집·범위 선택)과 칸을 그리는 쪽이 같은 지도를 보게 하려고 한 객체에 모았다.
|
|
5
|
+
* 행 지도를 통째로 넣는 `setRow` 는 「행을 다 그린 뒤에야 그 행의 칸이 지도에 보인다」는 지금 시점을 지키려고 둔다.
|
|
6
|
+
*
|
|
7
|
+
* The single map of cell elements currently attached to the body DOM (row index → column index → cell element).
|
|
8
|
+
* Kept in one object so the lookup path (`GridRenderer.getCellEl`, editing, range selection) and the painting side
|
|
9
|
+
* see the same map. `setRow` replaces a whole row map so a row's cells become visible only after the row is fully
|
|
10
|
+
* painted, which is the existing timing.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CellRegistry implements ICellRegistry {
|
|
13
|
+
private readonly _rows;
|
|
14
|
+
/** 칸 하나를 넣는다(같은 자리에 있던 요소는 바뀐다). / Put one cell (replaces any element at the same spot). */
|
|
15
|
+
set(ri: number, ci: number, el: HTMLElement): void;
|
|
16
|
+
/** 한 행의 칸 지도를 통째로 넣는다(옛 행 지도는 버린다). / Replace a whole row's cell map. */
|
|
17
|
+
setRow(ri: number, cols: Map<number, HTMLElement>): void;
|
|
18
|
+
get(ri: number, ci: number): HTMLElement | undefined;
|
|
19
|
+
cellsOfColumn(ci: number): Iterable<HTMLElement>;
|
|
20
|
+
dropRow(ri: number): void;
|
|
21
|
+
dropColumn(ri: number, ci: number): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
get size(): number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CellRenderer } from '../../renderers/CellRenderer.js';
|
|
2
|
+
import { ColumnDef } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* 한 컬럼의 그리기 준비물(그리기 한 번에 컬럼당 하나).
|
|
5
|
+
*
|
|
6
|
+
* Paint preparation for one column (one per column per paint).
|
|
7
|
+
*/
|
|
8
|
+
export declare class ColumnPaintPlan {
|
|
9
|
+
private readonly _col;
|
|
10
|
+
/** 내장 렌더러면 컬럼 칸들이 나눠 쓰는 인스턴스, 사용자 팩토리면 null. / Shared built-in renderer, or null for a user factory. */
|
|
11
|
+
private readonly _shared;
|
|
12
|
+
constructor(_col: ColumnDef);
|
|
13
|
+
/**
|
|
14
|
+
* 칸 하나에 쓸 렌더러 — 내장이면 나눠 쓰는 인스턴스, 사용자 팩토리면 이번 칸을 위해 새로 부른 것.
|
|
15
|
+
*
|
|
16
|
+
* The renderer for one cell — the shared built-in instance, or a fresh one from the user factory.
|
|
17
|
+
*/
|
|
18
|
+
renderer(): CellRenderer;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RendererCallbacks } from '../../GridRenderer.js';
|
|
2
|
+
import { ExtraColumnId } from '../../coordinate/geometryPorts.js';
|
|
3
|
+
import { BodyRowContext } from './rows/BodyRowContext.js';
|
|
4
|
+
type Translate = (key: string, params?: Record<string, string | number>) => string;
|
|
5
|
+
/**
|
|
6
|
+
* 여분 칸 하나의 내용과 고정 위치를 그린다. 그리기 한 번에 칸 하나씩 행에 붙인다(붙일 것이 없으면 아무것도 안 함).
|
|
7
|
+
*
|
|
8
|
+
* Paints one extra cell (content + sticky position) and appends it to the row; does nothing when there is nothing to draw.
|
|
9
|
+
*/
|
|
10
|
+
export interface ExtraCellPainter {
|
|
11
|
+
readonly id: ExtraColumnId;
|
|
12
|
+
paint(row: HTMLElement, ri: number, rowData: any, ctx: BodyRowContext): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 다섯 그리개를 여분 컬럼 이름으로 찾는 표(BodyView 당 한 번 만든다).
|
|
16
|
+
*
|
|
17
|
+
* Table of the five painters keyed by extra-column id (built once per body view).
|
|
18
|
+
*/
|
|
19
|
+
export declare function createExtraCellPainters(cbs: RendererCallbacks, t: Translate): Readonly<Record<ExtraColumnId, ExtraCellPainter>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { RowDragDrop } from '../../../RowDragDrop.js';
|
|
2
|
+
import { DataLayer } from '../../../DataLayer.js';
|
|
3
|
+
import { MergeEngine } from '../../../MergeEngine.js';
|
|
4
|
+
import { RenderOptions, DetailRenderContext } from '../../../GridRenderer.js';
|
|
5
|
+
import { IColumnGeometry, ExtraColumnId, IColumnWindow } from '../../../coordinate/geometryPorts.js';
|
|
6
|
+
import { WindowLayout } from './WindowLayout.js';
|
|
7
|
+
import { RowKind, IGeometryApplier } from '../../ports.js';
|
|
8
|
+
import { ColumnPaintPlan } from '../ColumnPaintPlan.js';
|
|
9
|
+
/**
|
|
10
|
+
* 본문 한 번 그리기 동안의 값. 앞쪽 읽기 전용 칸은 그리기 하나 동안 그대로이고, 뒤쪽 「행마다」 칸은 자료 행 그리개가 행을 시작할 때 채운다.
|
|
11
|
+
*
|
|
12
|
+
* Values for one body paint. Read-only fields stay fixed for the paint; the "per row" fields are filled by the
|
|
13
|
+
* data-row painter when it starts a row.
|
|
14
|
+
*/
|
|
15
|
+
export interface BodyRowContext {
|
|
16
|
+
readonly opts: RenderOptions;
|
|
17
|
+
readonly data: DataLayer<any>;
|
|
18
|
+
readonly leaves: any[];
|
|
19
|
+
readonly startIndex: number;
|
|
20
|
+
readonly endIndex: number;
|
|
21
|
+
readonly offsetY: number;
|
|
22
|
+
readonly selectedRows: Set<number>;
|
|
23
|
+
readonly checkedRows: Set<number>;
|
|
24
|
+
/**
|
|
25
|
+
* 묶음·나무·디테일 합성 행 배열(없으면 null — 자료 행은 DataLayer 에서 읽는다).
|
|
26
|
+
*
|
|
27
|
+
* Composed group/tree/detail rows (null when absent — data rows are then read from the DataLayer).
|
|
28
|
+
*/
|
|
29
|
+
readonly groupFlatRows: Array<any> | null;
|
|
30
|
+
readonly mergeEngine: MergeEngine | undefined;
|
|
31
|
+
readonly detailApi: DetailRenderContext | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* 디테일 펼침 전용 칸을 그리나(디테일 켜짐 + 펼침 단추가 전용 칸 모드).
|
|
34
|
+
*
|
|
35
|
+
* Whether the dedicated detail-expander cell is drawn (detail on and the expander in its own column).
|
|
36
|
+
*/
|
|
37
|
+
readonly detailColOn: boolean;
|
|
38
|
+
readonly auto: boolean;
|
|
39
|
+
readonly frozenCount: number;
|
|
40
|
+
readonly geometry: IColumnGeometry;
|
|
41
|
+
readonly totalColWidth: number;
|
|
42
|
+
/**
|
|
43
|
+
* 그릴 컬럼 창과 그 그리기 차례(구간·빈칸). 창 옮김 때 본문 뷰가 새 창으로 갈아 끼운다.
|
|
44
|
+
*
|
|
45
|
+
* The column window to paint and its order (runs and gaps); the body view swaps them on a window shift.
|
|
46
|
+
*/
|
|
47
|
+
columns: IColumnWindow;
|
|
48
|
+
layout: WindowLayout;
|
|
49
|
+
/**
|
|
50
|
+
* 켜진 여분 컬럼과 그 고정 left·폭 — 그리기당 한 번 기하에서 읽어 둔다. 보이는 행마다 여분 칸이 같은 값을 쓰므로
|
|
51
|
+
* 행마다 기하에 다시 묻지 않으려는 것.
|
|
52
|
+
*
|
|
53
|
+
* Enabled extra columns and their sticky lefts/widths, read from the geometry once per paint so the same
|
|
54
|
+
* values are not re-asked for every visible row.
|
|
55
|
+
*/
|
|
56
|
+
readonly extraIds: readonly ExtraColumnId[];
|
|
57
|
+
readonly extraLeft: Readonly<Record<ExtraColumnId, number>>;
|
|
58
|
+
/** 여분 컬럼 폭 합. / Sum of extra-column widths. */
|
|
59
|
+
readonly extraWidth: number;
|
|
60
|
+
readonly dragWidth: number;
|
|
61
|
+
readonly detailWidth: number;
|
|
62
|
+
/**
|
|
63
|
+
* 세로 병합 마스터 칸처럼 행 밖(본문 바로 아래)에 붙는 요소를 받는 곳.
|
|
64
|
+
*
|
|
65
|
+
* Receives elements placed outside the row (directly under the body), such as row-spanning master cells.
|
|
66
|
+
*/
|
|
67
|
+
readonly frag: DocumentFragment;
|
|
68
|
+
/**
|
|
69
|
+
* 컬럼마다 그리기 준비물(그리기당 컬럼 하나씩 — 칸마다 렌더러를 만들지 않으려고).
|
|
70
|
+
*
|
|
71
|
+
* Per-column paint preparation (one per column per paint, so renderers are not built per cell).
|
|
72
|
+
*/
|
|
73
|
+
readonly plans: readonly ColumnPaintPlan[];
|
|
74
|
+
/**
|
|
75
|
+
* 행 밖에 붙는 세로 병합 마스터 칸 → 행 번호. 이벤트 위임이 칸을 찾을 때 읽는다(DOM 에 속성을 더하지 않으려고).
|
|
76
|
+
*
|
|
77
|
+
* Row-spanning master cell → row index, read by event delegation to locate it (so no DOM attribute is added).
|
|
78
|
+
*/
|
|
79
|
+
readonly masters: Map<HTMLElement, number>;
|
|
80
|
+
/**
|
|
81
|
+
* 묶음 행 요소 → 묶음 열쇠. 묶음 행 click 을 위임에서 받아 펴고 접을 때 읽는다.
|
|
82
|
+
*
|
|
83
|
+
* Group row element → group key, read when the delegated click toggles the group.
|
|
84
|
+
*/
|
|
85
|
+
readonly groupKeys: Map<HTMLElement, string>;
|
|
86
|
+
/**
|
|
87
|
+
* 나무 펼침 아이콘 → 노드 번호. 아이콘 누르기·Enter/Space 를 위임에서 받아 펴고 접을 때 읽는다.
|
|
88
|
+
*
|
|
89
|
+
* Tree toggle icon → node id, read when the delegated click/Enter/Space toggles the node.
|
|
90
|
+
*/
|
|
91
|
+
readonly treeIcons: Map<Element, unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* 칸이 아닌 폭 자리(병합 칸·자리채움·묶음 칸·디테일 패널·막대)를 기억시킬 곳. 아직 없으면(뷰를 따로 만든 시험) 등록을 건너뛴다.
|
|
94
|
+
* 등록은 그려진 DOM 을 바꾸지 않는다 — 나중에 컬럼 폭이 바뀔 때 그 자리만 다시 쓰려고 기억시키는 것.
|
|
95
|
+
*
|
|
96
|
+
* Where non-cell width spots (merged cells, placeholders, group cells, detail panels, bars) are registered;
|
|
97
|
+
* skipped when absent (a view built alone in a test). Registering never changes the DOM — it only lets those
|
|
98
|
+
* spots be rewritten later when a column width changes.
|
|
99
|
+
*/
|
|
100
|
+
readonly applier: IGeometryApplier | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* 조건부 서식 막대 알림(그리기당 하나 — 칸마다 함수를 만들지 않으려고 지금 칸 번호·병합 폭을 아래 두 칸에서 읽는다).
|
|
103
|
+
*
|
|
104
|
+
* Conditional-format bar callback (one per paint; reads the current cell index/span from the two fields below
|
|
105
|
+
* instead of creating a function per cell).
|
|
106
|
+
*/
|
|
107
|
+
trackBar: ((bar: HTMLElement, ratio: number) => void) | undefined;
|
|
108
|
+
rowState: string;
|
|
109
|
+
/**
|
|
110
|
+
* 고정 칸 배경(상태·선택 색을 반영).
|
|
111
|
+
*
|
|
112
|
+
* Background for sticky cells (reflects row-state and selection colours).
|
|
113
|
+
*/
|
|
114
|
+
bg: string;
|
|
115
|
+
dnd: RowDragDrop | null;
|
|
116
|
+
/**
|
|
117
|
+
* 끌기 옵션은 켜졌는데 손잡이를 못 그리는 행에서 뒤 여분 칸을 당기는 폭(그 밖엔 0).
|
|
118
|
+
*
|
|
119
|
+
* How far later extra cells shift left when draggable is on but no handle can be drawn (0 otherwise).
|
|
120
|
+
*/
|
|
121
|
+
dragGap: number;
|
|
122
|
+
/** 행 자료와 나무 노드(나무 행이 아니면 null). / Row data and tree node (null when not a tree row). */
|
|
123
|
+
rowData: any;
|
|
124
|
+
treeNode: any;
|
|
125
|
+
/** 자료 행 앞머리 여분 칸 수(한 그리기 안에서는 모든 자료 행이 같다). / Number of leading extra cells in a data row. */
|
|
126
|
+
extraCount: number;
|
|
127
|
+
cellCi: number;
|
|
128
|
+
cellSpan: number;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 행 종류 하나를 그린다(종류마다 BodyView 당 하나). 그린 행 요소를 돌려주고, 그릴 것이 없으면 null.
|
|
132
|
+
*
|
|
133
|
+
* Paints one row kind (one instance per kind per BodyView). Returns the row element, or null when nothing is drawn.
|
|
134
|
+
*/
|
|
135
|
+
export interface BodyRowPainter {
|
|
136
|
+
readonly kind: RowKind;
|
|
137
|
+
paint(ri: number, item: any, ctx: BodyRowContext): HTMLElement | null;
|
|
138
|
+
}
|