@molecule/app-spreadsheet-grid-angular 0.0.0-stage → 1.1.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/LICENSE +202 -0
- package/README.md +532 -2
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +167 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +183 -0
- package/dist/layout.js.map +1 -0
- package/dist/spreadsheet-grid.component.d.ts +220 -0
- package/dist/spreadsheet-grid.component.d.ts.map +1 -0
- package/dist/spreadsheet-grid.component.js +675 -0
- package/dist/spreadsheet-grid.component.js.map +1 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/utilities.d.ts +74 -0
- package/dist/utilities.d.ts.map +1 -0
- package/dist/utilities.js +122 -0
- package/dist/utilities.js.map +1 -0
- package/package.json +75 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-performance virtualized spreadsheet cell grid for Angular.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `<SpreadsheetGrid>` — the grid component (virtualized cells, frozen
|
|
6
|
+
* rows/columns, range selection, copy/paste as TSV, in-cell editing).
|
|
7
|
+
* - Types: `SpreadsheetGridProps`, `SpreadsheetSelection`, `CellMap`,
|
|
8
|
+
* `CellRef`, `CellValue`.
|
|
9
|
+
* - Helpers: `cellRef()`, `columnLetter()`, `normalizeSelection()`,
|
|
10
|
+
* `isInSelection()`, `formatCellValue()`, `parseClipboardTsv()`,
|
|
11
|
+
* `serializeSelectionTsv()`, `computeVisibleRange()`.
|
|
12
|
+
*
|
|
13
|
+
* Pairs with `@molecule/api-formula-engine` for formula evaluation —
|
|
14
|
+
* pass evaluated `cells` plus an optional `renderCell` to display
|
|
15
|
+
* formula results.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Component, signal } from '@angular/core'
|
|
20
|
+
* import { SpreadsheetGrid } from '@molecule/app-spreadsheet-grid-angular'
|
|
21
|
+
* import type { CellMap, SpreadsheetSelection } from '@molecule/app-spreadsheet-grid-angular'
|
|
22
|
+
*
|
|
23
|
+
* @Component({
|
|
24
|
+
* selector: 'app-sheet',
|
|
25
|
+
* standalone: true,
|
|
26
|
+
* imports: [SpreadsheetGrid],
|
|
27
|
+
* template: `
|
|
28
|
+
* <div
|
|
29
|
+
* mol-spreadsheet-grid
|
|
30
|
+
* [rows]="1000"
|
|
31
|
+
* [columns]="26"
|
|
32
|
+
* [cells]="cells()"
|
|
33
|
+
* [frozenRows]="1"
|
|
34
|
+
* [frozenCols]="1"
|
|
35
|
+
* [selection]="selection()"
|
|
36
|
+
* [onCellChange]="onCellChange"
|
|
37
|
+
* [onSelectionChange]="onSelectionChange"
|
|
38
|
+
* ></div>
|
|
39
|
+
* `,
|
|
40
|
+
* })
|
|
41
|
+
* export class Sheet {
|
|
42
|
+
* readonly cells = signal<CellMap>(new Map())
|
|
43
|
+
* readonly selection = signal<SpreadsheetSelection>({ r1: 0, c1: 0, r2: 0, c2: 0 })
|
|
44
|
+
*
|
|
45
|
+
* readonly onCellChange = (ref: string, value: string | number | boolean | null): void => {
|
|
46
|
+
* const next = new Map(this.cells())
|
|
47
|
+
* if (value === null) next.delete(ref)
|
|
48
|
+
* else next.set(ref, value)
|
|
49
|
+
* this.cells.set(next)
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* readonly onSelectionChange = (next: SpreadsheetSelection): void => {
|
|
53
|
+
* this.selection.set(next)
|
|
54
|
+
* }
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* - Must render with a ClassMap bond wired (`getClassMap()` throws
|
|
60
|
+
* otherwise), and inside the app's i18n provider (or with the bonded one).
|
|
61
|
+
* - The viewport is FIXED-PIXEL: `viewportWidth`/`viewportHeight`
|
|
62
|
+
* (defaults 720×360) — the grid does not auto-size to its container.
|
|
63
|
+
* Measure the container and pass px if you need it to fill.
|
|
64
|
+
* - Copy (Ctrl/Cmd+C) writes TSV through `copyTextWithFallback()` from
|
|
65
|
+
* `@molecule/app-clipboard`, which uses the bonded clipboard provider with
|
|
66
|
+
* a selection-and-copy fallback and never throws. Paste is handled through
|
|
67
|
+
* the native paste event, so the grid container must have focus (click a
|
|
68
|
+
* cell first). Keyboard support is Enter/F2 (edit) + copy/paste only; there
|
|
69
|
+
* is NO arrow-key cell navigation.
|
|
70
|
+
* - Committed edits and pasted cells auto-coerce number-like strings to
|
|
71
|
+
* numbers (`'42'` → `42`); empty string clears the cell (`null`).
|
|
72
|
+
* - Gridlines/selection/header styling uses Material-3 design-token
|
|
73
|
+
* utilities (`bg-surface`, `border-outline-variant`, …). Apps whose
|
|
74
|
+
* Tailwind theme does not define those tokens (the minimal scaffold
|
|
75
|
+
* theme does not) get a functional but unstyled grid.
|
|
76
|
+
*
|
|
77
|
+
* @module
|
|
78
|
+
*/
|
|
79
|
+
export * from './spreadsheet-grid.component.js';
|
|
80
|
+
export * from './types.js';
|
|
81
|
+
export * from './utilities.js';
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AAEH,cAAc,iCAAiC,CAAA;AAC/C,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry, ClassMap classes and inline-style strings for `<SpreadsheetGrid>`.
|
|
3
|
+
*
|
|
4
|
+
* The plan is framework-neutral: every framework's port computes the same one
|
|
5
|
+
* from the same props and state, so the rendered DOM (positions, classes,
|
|
6
|
+
* indices, text) cannot drift between frameworks.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
11
|
+
import type { CellMap, CellRef, CellValue, SpreadsheetSelection } from './types.js';
|
|
12
|
+
/** The open in-cell editor. */
|
|
13
|
+
export interface GridEditing {
|
|
14
|
+
/** 0-indexed row of the edited cell. */
|
|
15
|
+
row: number;
|
|
16
|
+
/** 0-indexed column of the edited cell. */
|
|
17
|
+
col: number;
|
|
18
|
+
/** The draft text the editor shows. */
|
|
19
|
+
draft: string;
|
|
20
|
+
}
|
|
21
|
+
/** Everything the plan is computed from. */
|
|
22
|
+
export interface GridGeometry {
|
|
23
|
+
/** Total number of rows. */
|
|
24
|
+
rows: number;
|
|
25
|
+
/** Total number of columns. */
|
|
26
|
+
columns: number;
|
|
27
|
+
/** Sparse cell data. */
|
|
28
|
+
cells: CellMap;
|
|
29
|
+
/** Current selection. */
|
|
30
|
+
selection: SpreadsheetSelection;
|
|
31
|
+
/** Rows frozen at the top. */
|
|
32
|
+
frozenRows: number;
|
|
33
|
+
/** Columns frozen on the left. */
|
|
34
|
+
frozenCols: number;
|
|
35
|
+
/** Per-cell width in pixels. */
|
|
36
|
+
cellWidth: number;
|
|
37
|
+
/** Per-cell height in pixels. */
|
|
38
|
+
cellHeight: number;
|
|
39
|
+
/** Width of the row-number gutter. */
|
|
40
|
+
gutterWidth: number;
|
|
41
|
+
/** Height of the column-letter header. */
|
|
42
|
+
headerHeight: number;
|
|
43
|
+
/** Visible viewport width. */
|
|
44
|
+
viewportWidth: number;
|
|
45
|
+
/** Visible viewport height. */
|
|
46
|
+
viewportHeight: number;
|
|
47
|
+
/** Horizontal scroll offset of the scrollable region. */
|
|
48
|
+
scrollLeft: number;
|
|
49
|
+
/** Vertical scroll offset of the scrollable region. */
|
|
50
|
+
scrollTop: number;
|
|
51
|
+
/** The open editor, or `null`. */
|
|
52
|
+
editing: GridEditing | null;
|
|
53
|
+
}
|
|
54
|
+
/** One column-letter or row-number label. */
|
|
55
|
+
export interface GridHeaderCell {
|
|
56
|
+
/** A stable key for the label. */
|
|
57
|
+
key: string;
|
|
58
|
+
/** The 0-indexed column (headers) or row (gutter). */
|
|
59
|
+
index: number;
|
|
60
|
+
/** The label text (`A`, `12`). */
|
|
61
|
+
text: string;
|
|
62
|
+
/** Its inline style. */
|
|
63
|
+
style: string;
|
|
64
|
+
/** Its ClassMap classes. */
|
|
65
|
+
classes: string;
|
|
66
|
+
}
|
|
67
|
+
/** One rendered cell, positioned for the region it renders in. */
|
|
68
|
+
export interface GridCell {
|
|
69
|
+
/** 0-indexed row. */
|
|
70
|
+
row: number;
|
|
71
|
+
/** 0-indexed column. */
|
|
72
|
+
col: number;
|
|
73
|
+
/** A1 reference. */
|
|
74
|
+
ref: CellRef;
|
|
75
|
+
/** The raw cell value. */
|
|
76
|
+
value: CellValue | undefined;
|
|
77
|
+
/** The value's display string (React's `formatCellValue`). */
|
|
78
|
+
text: string;
|
|
79
|
+
/** Its inline style for its region. */
|
|
80
|
+
style: string;
|
|
81
|
+
/** Its ClassMap classes. */
|
|
82
|
+
classes: string;
|
|
83
|
+
/** Whether the cell lies inside the selection. */
|
|
84
|
+
selected: boolean;
|
|
85
|
+
/** Whether it is the selection anchor (the cell in the tab order). */
|
|
86
|
+
anchor: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** The plan one render of the grid is built from. */
|
|
89
|
+
export interface GridLayout {
|
|
90
|
+
/** The root `<div role="grid">`. */
|
|
91
|
+
rootClasses: string;
|
|
92
|
+
/** Its inline style. */
|
|
93
|
+
rootStyle: string;
|
|
94
|
+
/** The top-left corner. */
|
|
95
|
+
cornerClasses: string;
|
|
96
|
+
/** Its inline style. */
|
|
97
|
+
cornerStyle: string;
|
|
98
|
+
/** The column-letter header lane. */
|
|
99
|
+
headerLaneClasses: string;
|
|
100
|
+
/** Its inline style. */
|
|
101
|
+
headerLaneStyle: string;
|
|
102
|
+
/** The scrolling column-letter container's inline style. */
|
|
103
|
+
headerScrollerStyle: string;
|
|
104
|
+
/** The letters of the frozen columns. */
|
|
105
|
+
frozenHeaderCells: GridHeaderCell[];
|
|
106
|
+
/** The letters of the scrolling columns. */
|
|
107
|
+
scrollingHeaderCells: GridHeaderCell[];
|
|
108
|
+
/** The row-number gutter lane. */
|
|
109
|
+
gutterLaneClasses: string;
|
|
110
|
+
/** Its inline style. */
|
|
111
|
+
gutterLaneStyle: string;
|
|
112
|
+
/** The scrolling row-number container's inline style. */
|
|
113
|
+
gutterScrollerStyle: string;
|
|
114
|
+
/** The numbers of the frozen rows. */
|
|
115
|
+
frozenGutterCells: GridHeaderCell[];
|
|
116
|
+
/** The numbers of the scrolling rows. */
|
|
117
|
+
scrollingGutterCells: GridHeaderCell[];
|
|
118
|
+
/** Whether the frozen-rows region renders. */
|
|
119
|
+
showFrozenRows: boolean;
|
|
120
|
+
/** Whether the frozen-cols region renders. */
|
|
121
|
+
showFrozenCols: boolean;
|
|
122
|
+
/** Whether the frozen-rows × frozen-cols corner renders. */
|
|
123
|
+
showFrozenCorner: boolean;
|
|
124
|
+
/** The frozen-rows region's inline style. */
|
|
125
|
+
frozenRowsRegionStyle: string;
|
|
126
|
+
/** Its inner (scrolling) container's inline style. */
|
|
127
|
+
frozenRowsInnerStyle: string;
|
|
128
|
+
/** The frozen-cols region's inline style. */
|
|
129
|
+
frozenColsRegionStyle: string;
|
|
130
|
+
/** Its inner (scrolling) container's inline style. */
|
|
131
|
+
frozenColsInnerStyle: string;
|
|
132
|
+
/** The frozen corner's inline style. */
|
|
133
|
+
frozenCornerStyle: string;
|
|
134
|
+
/** Cells of the frozen-rows × scrolling-cols region. */
|
|
135
|
+
frozenRowsCells: GridCell[];
|
|
136
|
+
/** Cells of the frozen-cols × scrolling-rows region. */
|
|
137
|
+
frozenColsCells: GridCell[];
|
|
138
|
+
/** Cells of the frozen-rows × frozen-cols corner. */
|
|
139
|
+
frozenCornerCells: GridCell[];
|
|
140
|
+
/** Cells of the main scrollable region. */
|
|
141
|
+
mainCells: GridCell[];
|
|
142
|
+
/** Every rendered cell, by A1 reference (a region's cells are disjoint from the others'). */
|
|
143
|
+
byRef: Map<string, GridCell>;
|
|
144
|
+
/** The scroll region's inline style. */
|
|
145
|
+
scrollRegionStyle: string;
|
|
146
|
+
/** The scroll spacer's inline style. */
|
|
147
|
+
scrollSpacerStyle: string;
|
|
148
|
+
/** The hidden total-size hint's classes. */
|
|
149
|
+
totalClasses: string;
|
|
150
|
+
/** Its inline style. */
|
|
151
|
+
totalStyle: string;
|
|
152
|
+
/** Its text (`720×360`). */
|
|
153
|
+
totalText: string;
|
|
154
|
+
/** The in-cell editor input's classes. */
|
|
155
|
+
editorClasses: string;
|
|
156
|
+
/** The cell content wrapper's classes. */
|
|
157
|
+
contentClasses: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Computes one render's plan from the grid's geometry and state.
|
|
161
|
+
*
|
|
162
|
+
* @param geometry - The grid geometry.
|
|
163
|
+
* @param cm - The bonded ClassMap.
|
|
164
|
+
* @returns The layout plan.
|
|
165
|
+
*/
|
|
166
|
+
export declare function computeLayout(geometry: GridGeometry, cm: UIClassMap): GridLayout;
|
|
167
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AASnF,+BAA+B;AAC/B,MAAM,WAAW,WAAW;IAC1B,wCAAwC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AAE,MAAM,CAAA;IAC7B,sDAAsD;IACtD,oBAAoB,EAAE,MAAM,CAAA;IAC5B,6CAA6C;IAC7C,qBAAqB,EAAE,MAAM,CAAA;IAC7B,sDAAsD;IACtD,oBAAoB,EAAE,MAAM,CAAA;IAC5B,wCAAwC;IACxC,iBAAiB,EAAE,MAAM,CAAA;IACzB,wDAAwD;IACxD,eAAe,EAAE,QAAQ,EAAE,CAAA;IAC3B,wDAAwD;IACxD,eAAe,EAAE,QAAQ,EAAE,CAAA;IAC3B,qDAAqD;IACrD,iBAAiB,EAAE,QAAQ,EAAE,CAAA;IAC7B,2CAA2C;IAC3C,SAAS,EAAE,QAAQ,EAAE,CAAA;IACrB,6FAA6F;IAC7F,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC5B,wCAAwC;IACxC,iBAAiB,EAAE,MAAM,CAAA;IACzB,wCAAwC;IACxC,iBAAiB,EAAE,MAAM,CAAA;IACzB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAA;CACvB;AA0ED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,UAAU,GAAG,UAAU,CAgMhF"}
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry, ClassMap classes and inline-style strings for `<SpreadsheetGrid>`.
|
|
3
|
+
*
|
|
4
|
+
* The plan is framework-neutral: every framework's port computes the same one
|
|
5
|
+
* from the same props and state, so the rendered DOM (positions, classes,
|
|
6
|
+
* indices, text) cannot drift between frameworks.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { cellRef, columnLetter, computeVisibleRange, formatCellValue, isInSelection, } from './utilities.js';
|
|
11
|
+
/**
|
|
12
|
+
* A pixel length, as React writes one.
|
|
13
|
+
*
|
|
14
|
+
* @param value - A length in pixels.
|
|
15
|
+
* @returns The CSS length (`28px`).
|
|
16
|
+
*/
|
|
17
|
+
const px = (value) => `${value}px`;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a cell is the selection anchor.
|
|
20
|
+
*
|
|
21
|
+
* @param selection - The selection.
|
|
22
|
+
* @param row - The cell's 0-indexed row.
|
|
23
|
+
* @param col - The cell's 0-indexed column.
|
|
24
|
+
* @returns `true` when the cell is the anchor.
|
|
25
|
+
*/
|
|
26
|
+
const isAnchor = (selection, row, col) => selection.r1 === row && selection.c1 === col;
|
|
27
|
+
/**
|
|
28
|
+
* Builds the cell box style of one region.
|
|
29
|
+
*
|
|
30
|
+
* @param geometry - The grid geometry.
|
|
31
|
+
* @param left - The cell's left offset in pixels.
|
|
32
|
+
* @param top - The cell's top offset in pixels.
|
|
33
|
+
* @returns The inline style.
|
|
34
|
+
*/
|
|
35
|
+
const cellBoxStyle = (geometry, left, top) => `position: absolute; left: ${px(left)}; top: ${px(top)}; width: ${px(geometry.cellWidth)}; height: ${px(geometry.cellHeight)}; box-sizing: border-box;`;
|
|
36
|
+
/**
|
|
37
|
+
* Describes one rendered cell.
|
|
38
|
+
*
|
|
39
|
+
* @param geometry - The grid geometry.
|
|
40
|
+
* @param cm - The ClassMap.
|
|
41
|
+
* @param row - The cell's 0-indexed row.
|
|
42
|
+
* @param col - The cell's 0-indexed column.
|
|
43
|
+
* @param left - Its left offset in pixels.
|
|
44
|
+
* @param top - Its top offset in pixels.
|
|
45
|
+
* @returns The cell.
|
|
46
|
+
*/
|
|
47
|
+
const cellAt = (geometry, cm, row, col, left, top) => {
|
|
48
|
+
const ref = cellRef(row, col);
|
|
49
|
+
const selected = isInSelection(geometry.selection, row, col);
|
|
50
|
+
const anchor = isAnchor(geometry.selection, row, col);
|
|
51
|
+
const value = geometry.cells.get(ref);
|
|
52
|
+
return {
|
|
53
|
+
row,
|
|
54
|
+
col,
|
|
55
|
+
ref,
|
|
56
|
+
value,
|
|
57
|
+
text: formatCellValue(value),
|
|
58
|
+
style: cellBoxStyle(geometry, left, top),
|
|
59
|
+
classes: cm.cn(cm.spreadsheetGridCellBorder, selected ? cm.spreadsheetGridCellSelected : cm.surface, anchor ? cm.spreadsheetGridCellAnchor : ''),
|
|
60
|
+
selected,
|
|
61
|
+
anchor,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Computes one render's plan from the grid's geometry and state.
|
|
66
|
+
*
|
|
67
|
+
* @param geometry - The grid geometry.
|
|
68
|
+
* @param cm - The bonded ClassMap.
|
|
69
|
+
* @returns The layout plan.
|
|
70
|
+
*/
|
|
71
|
+
export function computeLayout(geometry, cm) {
|
|
72
|
+
const { cellHeight, cellWidth, columns, frozenCols, frozenRows, gutterWidth, headerHeight } = geometry;
|
|
73
|
+
const frozenRowsHeight = frozenRows * cellHeight;
|
|
74
|
+
const frozenColsWidth = frozenCols * cellWidth;
|
|
75
|
+
const scrollableWidth = Math.max(0, geometry.viewportWidth - gutterWidth - frozenColsWidth);
|
|
76
|
+
const scrollableHeight = Math.max(0, geometry.viewportHeight - headerHeight - frozenRowsHeight);
|
|
77
|
+
const [colStart, colEnd] = computeVisibleRange(geometry.scrollLeft, scrollableWidth, cellWidth, Math.max(0, columns - frozenCols));
|
|
78
|
+
const [rowStart, rowEnd] = computeVisibleRange(geometry.scrollTop, scrollableHeight, cellHeight, Math.max(0, geometry.rows - frozenRows));
|
|
79
|
+
const visibleCols = [];
|
|
80
|
+
for (let c = frozenCols + colStart; c <= frozenCols + colEnd; c += 1) {
|
|
81
|
+
if (c >= columns)
|
|
82
|
+
break;
|
|
83
|
+
visibleCols.push(c);
|
|
84
|
+
}
|
|
85
|
+
const visibleRows = [];
|
|
86
|
+
for (let r = frozenRows + rowStart; r <= frozenRows + rowEnd; r += 1) {
|
|
87
|
+
if (r >= geometry.rows)
|
|
88
|
+
break;
|
|
89
|
+
visibleRows.push(r);
|
|
90
|
+
}
|
|
91
|
+
const frozenColumns = Array.from({ length: Math.min(frozenCols, columns) }, (_v, i) => i);
|
|
92
|
+
const frozenRowIndices = Array.from({ length: Math.min(frozenRows, geometry.rows) }, (_v, i) => i);
|
|
93
|
+
const totalScrollWidth = Math.max(0, columns - frozenCols) * cellWidth;
|
|
94
|
+
const totalScrollHeight = Math.max(0, geometry.rows - frozenRows) * cellHeight;
|
|
95
|
+
const totalGridWidth = gutterWidth + columns * cellWidth;
|
|
96
|
+
const totalGridHeight = headerHeight + geometry.rows * cellHeight;
|
|
97
|
+
const headerCellClasses = cm.cn(cm.spreadsheetGridHeaderCell, cm.textCenter, cm.textSize('xs'), cm.fontWeight('semibold'));
|
|
98
|
+
const headerCellStyle = (left) => `position: absolute; left: ${px(left)}; top: ${px(0)}; width: ${px(cellWidth)}; height: ${px(headerHeight)}; line-height: ${px(headerHeight)};`;
|
|
99
|
+
const gutterCellStyle = (top, width, height) => `position: absolute; left: ${px(0)}; top: ${px(top)}; width: ${px(width)}; height: ${px(height)}; line-height: ${px(height)};`;
|
|
100
|
+
const frozenRowsCells = [];
|
|
101
|
+
const frozenColsCells = [];
|
|
102
|
+
const frozenCornerCells = [];
|
|
103
|
+
const mainCells = [];
|
|
104
|
+
if (frozenRows > 0)
|
|
105
|
+
for (const row of frozenRowIndices)
|
|
106
|
+
for (const col of visibleCols)
|
|
107
|
+
frozenRowsCells.push(cellAt(geometry, cm, row, col, (col - frozenCols) * cellWidth, row * cellHeight));
|
|
108
|
+
if (frozenCols > 0)
|
|
109
|
+
for (const col of frozenColumns)
|
|
110
|
+
for (const row of visibleRows)
|
|
111
|
+
frozenColsCells.push(cellAt(geometry, cm, row, col, col * cellWidth, (row - frozenRows) * cellHeight));
|
|
112
|
+
if (frozenRows > 0 && frozenCols > 0)
|
|
113
|
+
for (const row of frozenRowIndices)
|
|
114
|
+
for (const col of frozenColumns)
|
|
115
|
+
frozenCornerCells.push(cellAt(geometry, cm, row, col, col * cellWidth, row * cellHeight));
|
|
116
|
+
for (const row of visibleRows)
|
|
117
|
+
for (const col of visibleCols)
|
|
118
|
+
mainCells.push(cellAt(geometry, cm, row, col, (col - frozenCols) * cellWidth, (row - frozenRows) * cellHeight));
|
|
119
|
+
return {
|
|
120
|
+
rootClasses: cm.cn(cm.spreadsheetGridRoot, cm.spreadsheetGridRootBorder),
|
|
121
|
+
rootStyle: `width: ${px(geometry.viewportWidth)}; height: ${px(geometry.viewportHeight)}; position: relative; overflow: hidden; outline: none;`,
|
|
122
|
+
cornerClasses: cm.spreadsheetGridCorner,
|
|
123
|
+
cornerStyle: `position: absolute; left: ${px(0)}; top: ${px(0)}; width: ${px(gutterWidth)}; height: ${px(headerHeight)};`,
|
|
124
|
+
headerLaneClasses: cm.spreadsheetGridLane,
|
|
125
|
+
headerLaneStyle: `position: absolute; left: ${px(gutterWidth)}; top: ${px(0)}; width: ${px(geometry.viewportWidth - gutterWidth)}; height: ${px(headerHeight)}; overflow: hidden;`,
|
|
126
|
+
headerScrollerStyle: `position: absolute; left: ${px(frozenColsWidth - geometry.scrollLeft)}; top: ${px(0)}; width: ${px(totalScrollWidth)}; height: ${px(headerHeight)};`,
|
|
127
|
+
frozenHeaderCells: frozenColumns.map((col) => ({
|
|
128
|
+
key: `hdr-frozen-${col}`,
|
|
129
|
+
index: col,
|
|
130
|
+
text: columnLetter(col),
|
|
131
|
+
style: headerCellStyle(col * cellWidth),
|
|
132
|
+
classes: headerCellClasses,
|
|
133
|
+
})),
|
|
134
|
+
scrollingHeaderCells: visibleCols.map((col) => ({
|
|
135
|
+
key: `hdr-${col}`,
|
|
136
|
+
index: col,
|
|
137
|
+
text: columnLetter(col),
|
|
138
|
+
style: headerCellStyle((col - frozenCols) * cellWidth),
|
|
139
|
+
classes: headerCellClasses,
|
|
140
|
+
})),
|
|
141
|
+
gutterLaneClasses: cm.spreadsheetGridLane,
|
|
142
|
+
gutterLaneStyle: `position: absolute; left: ${px(0)}; top: ${px(headerHeight)}; width: ${px(gutterWidth)}; height: ${px(geometry.viewportHeight - headerHeight)}; overflow: hidden;`,
|
|
143
|
+
gutterScrollerStyle: `position: absolute; left: ${px(0)}; top: ${px(frozenRowsHeight - geometry.scrollTop)}; width: ${px(gutterWidth)}; height: ${px(totalScrollHeight)};`,
|
|
144
|
+
frozenGutterCells: frozenRowIndices.map((row) => ({
|
|
145
|
+
key: `gutter-frozen-${row}`,
|
|
146
|
+
index: row,
|
|
147
|
+
text: String(row + 1),
|
|
148
|
+
style: gutterCellStyle(row * cellHeight, gutterWidth, cellHeight),
|
|
149
|
+
classes: headerCellClasses,
|
|
150
|
+
})),
|
|
151
|
+
scrollingGutterCells: visibleRows.map((row) => ({
|
|
152
|
+
key: `gutter-${row}`,
|
|
153
|
+
index: row,
|
|
154
|
+
text: String(row + 1),
|
|
155
|
+
style: gutterCellStyle((row - frozenRows) * cellHeight, gutterWidth, cellHeight),
|
|
156
|
+
classes: headerCellClasses,
|
|
157
|
+
})),
|
|
158
|
+
showFrozenRows: frozenRows > 0,
|
|
159
|
+
showFrozenCols: frozenCols > 0,
|
|
160
|
+
showFrozenCorner: frozenRows > 0 && frozenCols > 0,
|
|
161
|
+
frozenRowsRegionStyle: `position: absolute; left: ${px(gutterWidth + frozenColsWidth)}; top: ${px(headerHeight)}; width: ${px(scrollableWidth)}; height: ${px(frozenRowsHeight)}; overflow: hidden;`,
|
|
162
|
+
frozenRowsInnerStyle: `position: absolute; left: ${px(-geometry.scrollLeft)}; top: ${px(0)}; width: ${px(totalScrollWidth)}; height: ${px(frozenRowsHeight)};`,
|
|
163
|
+
frozenColsRegionStyle: `position: absolute; left: ${px(gutterWidth)}; top: ${px(headerHeight + frozenRowsHeight)}; width: ${px(frozenColsWidth)}; height: ${px(scrollableHeight)}; overflow: hidden;`,
|
|
164
|
+
frozenColsInnerStyle: `position: absolute; left: ${px(0)}; top: ${px(-geometry.scrollTop)}; width: ${px(frozenColsWidth)}; height: ${px(totalScrollHeight)};`,
|
|
165
|
+
frozenCornerStyle: `position: absolute; left: ${px(gutterWidth)}; top: ${px(headerHeight)}; width: ${px(frozenColsWidth)}; height: ${px(frozenRowsHeight)}; overflow: hidden;`,
|
|
166
|
+
frozenRowsCells,
|
|
167
|
+
frozenColsCells,
|
|
168
|
+
frozenCornerCells,
|
|
169
|
+
mainCells,
|
|
170
|
+
byRef: new Map([...frozenRowsCells, ...frozenColsCells, ...frozenCornerCells, ...mainCells].map((cell) => [
|
|
171
|
+
cell.ref,
|
|
172
|
+
cell,
|
|
173
|
+
])),
|
|
174
|
+
scrollRegionStyle: `position: absolute; left: ${px(gutterWidth + frozenColsWidth)}; top: ${px(headerHeight + frozenRowsHeight)}; width: ${px(scrollableWidth)}; height: ${px(scrollableHeight)}; overflow: auto;`,
|
|
175
|
+
scrollSpacerStyle: `width: ${px(totalScrollWidth)}; height: ${px(totalScrollHeight)}; position: relative;`,
|
|
176
|
+
totalClasses: cm.cn(cm.displayBlock),
|
|
177
|
+
totalStyle: `position: absolute; left: ${px(-10000)}; top: ${px(-10000)};`,
|
|
178
|
+
totalText: `${totalGridWidth}×${totalGridHeight}`,
|
|
179
|
+
editorClasses: cm.cn(cm.w('full'), cm.h('full'), cm.spreadsheetGridCellEditor),
|
|
180
|
+
contentClasses: cm.cn(cm.w('full'), cm.h('full'), cm.spreadsheetGridCellContent, cm.textSize('sm')),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAA;AA0JvB;;;;;GAKG;AACH,MAAM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