@ember-lattice/ember 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/CHANGELOG.md +71 -0
- package/LICENSE.md +21 -0
- package/NOTICE +30 -0
- package/README.md +176 -2
- package/addon-main.cjs +4 -0
- package/declarations/board/declarations.d.ts +129 -0
- package/declarations/board/declarations.d.ts.map +1 -0
- package/declarations/board/lattice-board.d.ts +153 -0
- package/declarations/board/lattice-board.d.ts.map +1 -0
- package/declarations/grid/alignment.d.ts +30 -0
- package/declarations/grid/alignment.d.ts.map +1 -0
- package/declarations/grid/auto-columns.d.ts +22 -0
- package/declarations/grid/auto-columns.d.ts.map +1 -0
- package/declarations/grid/cell-state.d.ts +17 -0
- package/declarations/grid/cell-state.d.ts.map +1 -0
- package/declarations/grid/clipboard.d.ts +7 -0
- package/declarations/grid/clipboard.d.ts.map +1 -0
- package/declarations/grid/columns/column-def.d.ts +120 -0
- package/declarations/grid/columns/column-def.d.ts.map +1 -0
- package/declarations/grid/columns/declarations.d.ts +212 -0
- package/declarations/grid/columns/declarations.d.ts.map +1 -0
- package/declarations/grid/columns/memo.d.ts +32 -0
- package/declarations/grid/columns/memo.d.ts.map +1 -0
- package/declarations/grid/columns/owned-table.d.ts +40 -0
- package/declarations/grid/columns/owned-table.d.ts.map +1 -0
- package/declarations/grid/columns/registry.d.ts +13 -0
- package/declarations/grid/columns/registry.d.ts.map +1 -0
- package/declarations/grid/keyboard.d.ts +24 -0
- package/declarations/grid/keyboard.d.ts.map +1 -0
- package/declarations/grid/lattice-grid.d.ts +854 -0
- package/declarations/grid/lattice-grid.d.ts.map +1 -0
- package/declarations/grid/row-number.d.ts +24 -0
- package/declarations/grid/row-number.d.ts.map +1 -0
- package/declarations/grid/selection.d.ts +24 -0
- package/declarations/grid/selection.d.ts.map +1 -0
- package/declarations/grid/state-host.d.ts +66 -0
- package/declarations/grid/state-host.d.ts.map +1 -0
- package/declarations/grid/types.d.ts +417 -0
- package/declarations/grid/types.d.ts.map +1 -0
- package/declarations/index.d.ts +27 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/list/lattice-list.d.ts +184 -0
- package/declarations/list/lattice-list.d.ts.map +1 -0
- package/dist/index.js +5031 -0
- package/dist/index.js.map +1 -0
- package/package.json +92 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @ember-lattice/ember
|
|
2
|
+
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f931851: `LatticeBoard` has a template form (ADR 0028, FR-10). With no `@lanes`, the block declares the
|
|
8
|
+
lanes and the card: one `<b.Lane @key @label>` for each lane, in template order, and
|
|
9
|
+
`<b.Card as |item|>` for the content of each card. An optional `<:header as |lane|>` block in a
|
|
10
|
+
lane replaces the label and the count in the lane title. `@label` of a lane is the lane name:
|
|
11
|
+
the title, the name of the lane listbox and the text of the announcements. A lane in an
|
|
12
|
+
`{{#if}}` block takes its place in the template.
|
|
13
|
+
|
|
14
|
+
The engine form does not change: with `@lanes` and `@laneLabel`, the block is the content of
|
|
15
|
+
each card. `@getItemId` is now optional. The default is the `id` key of the item, as text.
|
|
16
|
+
|
|
17
|
+
The package also exports `DeclarationRegistry`, the registry of the declarations of the
|
|
18
|
+
template form, for the other Lattice packages.
|
|
19
|
+
|
|
20
|
+
- f931851: Configure a grid in its template (ADR 0028). `LatticeGrid` takes the rows as `@data` and makes the
|
|
21
|
+
table from the declarations in its block: `g.Column`, `g.ColumnGroup`, `g.SelectionColumn` and
|
|
22
|
+
`g.RowNumberColumn`. A column takes `<:cell>`, `<:header>`, `<:headerEnd>` and `<:editor>` blocks.
|
|
23
|
+
The grid also takes `@features`, `@initialState`, `@state`, `@onStateChange` and `@tableOptions`.
|
|
24
|
+
|
|
25
|
+
- `<:toolbar>`, `<:statusBar>` and `<:sideBar>` get the table and the grid root.
|
|
26
|
+
- `@rowModel` takes a function that makes the model from the table of the grid:
|
|
27
|
+
`ServerRowModel.forGrid({ source })`. The pivot columns of the server row model go after the
|
|
28
|
+
declared columns.
|
|
29
|
+
- `persistGridState` takes the `@stateHost` handle and waits for the table of the grid.
|
|
30
|
+
- The chrome blocks and the `@stateHost` handle give the table as `GridEngineTable`, the engine
|
|
31
|
+
table type. The components of `@ember-lattice/ui` and `persistGridState` take it.
|
|
32
|
+
- `GridRowModel<T>` has the row type, and `forGrid` of each row model keeps the row type of its
|
|
33
|
+
source. The grid gets its row type from `@rowModel`, as it does from `@data`.
|
|
34
|
+
- The grid disconnects a row model that it made from a `@rowModel` function: when the grid goes,
|
|
35
|
+
or when a new function replaces the model.
|
|
36
|
+
- `g.SelectionColumn` and `g.RowNumberColumn` take `@pinned` and `@hidden`.
|
|
37
|
+
- The editing args (`@editor`, `@editable`, `@schema`, `@parse`, `@options`) and the filter arg
|
|
38
|
+
(`@filter`) are args of `g.Column`.
|
|
39
|
+
|
|
40
|
+
`@table` and `constructTable` stay. Nothing is removed or deprecated.
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- f931851: A scroll restyles fewer elements. The theme wrapped the text of a measured row
|
|
45
|
+
(`@rowHeight="auto"`) by a rule on the `style` attribute of the row. The grid writes that attribute
|
|
46
|
+
on each scroll, so the browser restyled each cell of each row on each scroll. The grid now sets
|
|
47
|
+
`data-measured` on a measured row, and the theme selects the row by that attribute. A `<:cell>`
|
|
48
|
+
block of the template form keeps the anchor element of its slot, so a scroll adds no anchor
|
|
49
|
+
element. A full cell still renders its block again for a new row. Update `@ember-lattice/theme` and
|
|
50
|
+
`@ember-lattice/ember` together: the new theme needs `data-measured` from the grid.
|
|
51
|
+
- Updated dependencies [f931851]
|
|
52
|
+
- @ember-lattice/data@1.1.0
|
|
53
|
+
- @ember-lattice/core@1.1.0
|
|
54
|
+
- @ember-lattice/virtual@1.1.0
|
|
55
|
+
|
|
56
|
+
## 1.0.0
|
|
57
|
+
|
|
58
|
+
### Major Changes
|
|
59
|
+
|
|
60
|
+
- 7ce4af2: Lattice 1.0: one grid for every collection in Ember. Lists, feeds, tables, boards and
|
|
61
|
+
spreadsheets come from one headless engine, a port of TanStack Table. It has 80 of the 81
|
|
62
|
+
AG Grid features in the parity matrix; the external filter runs after grouping. The release has the client row models, the Lattice wire protocol with servers for Node,
|
|
63
|
+
Rails and Python, an IronCalc spreadsheet with live collaboration, themes, test harnesses, Jig
|
|
64
|
+
stories and Marquetry catalog entries.
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies [7ce4af2]
|
|
69
|
+
- @ember-lattice/core@1.0.0
|
|
70
|
+
- @ember-lattice/data@1.0.0
|
|
71
|
+
- @ember-lattice/virtual@1.0.0
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Gaudet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Lattice
|
|
2
|
+
Copyright (c) 2026 Joe Gaudet. MIT licensed; see LICENSE.md.
|
|
3
|
+
|
|
4
|
+
Lattice ports code from two MIT-licensed TanStack projects into Ember-native code. Lattice does
|
|
5
|
+
not depend on either package. PORT_MAP.md names each ported file and its source.
|
|
6
|
+
|
|
7
|
+
TanStack Table (@tanstack/table-core 9.3.1)
|
|
8
|
+
https://github.com/TanStack/table
|
|
9
|
+
Copyright (c) 2016 Tanner Linsley
|
|
10
|
+
|
|
11
|
+
TanStack Virtual (@tanstack/virtual-core 3.19.16)
|
|
12
|
+
https://github.com/TanStack/virtual
|
|
13
|
+
Copyright (c) 2021-present Tanner Linsley
|
|
14
|
+
|
|
15
|
+
Both are licensed under the MIT License:
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
18
|
+
and associated documentation files (the "Software"), to deal in the Software without
|
|
19
|
+
restriction, including without limitation the rights to use, copy, modify, merge, publish,
|
|
20
|
+
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
|
|
21
|
+
Software is furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all copies or
|
|
24
|
+
substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
27
|
+
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
28
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
29
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,177 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ember-lattice/ember
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lattice surfaces for Ember: Grid, List, Board and Sheet. Milestone M2 ships the Grid.
|
|
4
|
+
|
|
5
|
+
Part of [Lattice](https://joegaudet.com/ember-lattice/). Not released yet.
|
|
6
|
+
|
|
7
|
+
## The Grid
|
|
8
|
+
|
|
9
|
+
`LatticeGrid` shows rows in a grid. It virtualizes the rows and the columns, and it uses the
|
|
10
|
+
ARIA grid pattern. The contract is in `docs/prd/2026-12-01-m2-grid-contract/index.html`.
|
|
11
|
+
|
|
12
|
+
Configure the grid in its template (ADR 0028). Give it the rows as `@data`, and declare one
|
|
13
|
+
`g.Column` for each column in its block. The grid makes the table from the declarations:
|
|
14
|
+
|
|
15
|
+
```gts
|
|
16
|
+
import { LatticeGrid } from '@ember-lattice/ember'
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<LatticeGrid @data={{orders}} @label='Orders' @rowHeight={{32}} @overscan={{4}} as |g|>
|
|
20
|
+
<g.SelectionColumn />
|
|
21
|
+
<g.Column @id='id' @label='Order' @align='end' @sortable={{true}} />
|
|
22
|
+
<g.Column @id='customer' @label='Customer' @sortable={{true}} @resizable={{true}} />
|
|
23
|
+
<g.Column @id='total' @label='Total' @align='end'>
|
|
24
|
+
<:cell as |c|>{{money c.value}}</:cell>
|
|
25
|
+
</g.Column>
|
|
26
|
+
</LatticeGrid>
|
|
27
|
+
</template>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Arguments
|
|
31
|
+
|
|
32
|
+
- `@data`: the rows. The grid makes the table from the declarations in its block. With no
|
|
33
|
+
declarations, it makes one column for each key of the first rows.
|
|
34
|
+
- `@table`: a table from `constructTable`, in place of `@data` (the engine form, below).
|
|
35
|
+
- `@label` (required): the accessible name of the grid.
|
|
36
|
+
- `@features`: more table features, with their row models, for example grouping or filtering.
|
|
37
|
+
The grid has sizing, resizing, sorting, visibility, order, pinning and row selection.
|
|
38
|
+
- `@initialState`, `@state` and `@onStateChange`: the table state. `@onStateChange` gets the
|
|
39
|
+
whole state after each change.
|
|
40
|
+
- `@tableOptions`: more table options, for a feature that has no arg (`globalFilterFn`).
|
|
41
|
+
- `@rowHeight`: the row height in px. When you do not give it, the grid reads the
|
|
42
|
+
`--lt-row-height` CSS property, so the density presets of the theme work.
|
|
43
|
+
- `@overscan`: the number of rows outside the view on each side. Default: 4.
|
|
44
|
+
- `@getRowId`: the ID of a row. With `@data`, it gets the data row. Default: the table row ID.
|
|
45
|
+
- `@onCellActivate`: the grid calls it on Enter or a double click on a data cell, with
|
|
46
|
+
`{ row, column }`.
|
|
47
|
+
- `@rowModel`: a row model from `@ember-lattice/data` (infinite, cursor, server or viewport).
|
|
48
|
+
The grid then shows the rows of the model, not `table.getRowModel()`. Rows that are not
|
|
49
|
+
loaded show as skeleton rows. With `@data` or no table, give a function that makes the model
|
|
50
|
+
from the table of the grid: `ServerRowModel.forGrid({ source })`. The grid then gives its
|
|
51
|
+
table the `manual*` options. Contract: `docs/prd/2026-12-01-m2-grid-contract/index.html`,
|
|
52
|
+
section 7.
|
|
53
|
+
- `@stateHost`: a handle from `LatticeGrid.stateHost()`. The grid saves and restores the
|
|
54
|
+
scroll offset and the active cell through it. Give the same handle to
|
|
55
|
+
`persistGridState({ host })`. Make it before the grid renders (ADR 0011). With `@data`,
|
|
56
|
+
`host.table` is the table of the grid, and `persistGridState(host, options)` waits for it.
|
|
57
|
+
|
|
58
|
+
### Blocks
|
|
59
|
+
|
|
60
|
+
- The default block, or `<:columns>` when the grid has other named blocks: the declarations.
|
|
61
|
+
It yields `g.Column`, `g.ColumnGroup`, `g.SelectionColumn` and `g.RowNumberColumn`.
|
|
62
|
+
- `<:cell as |c|>` of a `g.Column`: the content of each cell. `c` has `value`, `text`, `data`
|
|
63
|
+
(the data row), `row`, `column`, `cell` and `state`.
|
|
64
|
+
- `<:header>` and `<:headerEnd>` of a `g.Column`: the header content, in place of the label and
|
|
65
|
+
after it. `<:editor>` (with `@ember-lattice/editing`): the editor of the cell.
|
|
66
|
+
- `<:toolbar>` and `<:statusBar>`: before and after the grid root. `<:sideBar>`: in the grid
|
|
67
|
+
root. Each gets `{ table, root }`. `<:contextMenu>`: the context menu, with `table`.
|
|
68
|
+
|
|
69
|
+
### Size
|
|
70
|
+
|
|
71
|
+
The theme gives `.lt-grid-root` and `.lt-grid` a `block-size` of `100%`. The root must have a
|
|
72
|
+
parent with a height, or the grid has no height and cannot virtualize. Give the parent a
|
|
73
|
+
height with CSS, or set `block-size` on `.lt-grid-root`. Load the styles of
|
|
74
|
+
`@ember-lattice/theme`: the grid needs them for its layout.
|
|
75
|
+
|
|
76
|
+
### Features
|
|
77
|
+
|
|
78
|
+
The grid uses each table feature that the table has. A table without a feature does not show
|
|
79
|
+
that feature. A column sorts or resizes only with `@sortable={{true}}` or
|
|
80
|
+
`@resizable={{true}}`.
|
|
81
|
+
|
|
82
|
+
- Sorting (`rowSortingFeature`): click a header. Shift+click adds a column to the sort. Enter
|
|
83
|
+
on a header also sorts.
|
|
84
|
+
- Column resizing (`columnResizingFeature` and `columnSizingFeature`): the grid shows a
|
|
85
|
+
resize handle only when the table has `columnResizingFeature`. Drag the separator at the
|
|
86
|
+
end of a header, or focus it and push ArrowLeft or ArrowRight (10 px).
|
|
87
|
+
- Column order (`columnOrderingFeature`): drag a header to a different header.
|
|
88
|
+
- Pinning (`columnPinningFeature`): pinned columns stay at the inline start or the inline end.
|
|
89
|
+
`@pinned='start'` pins a column in the first render.
|
|
90
|
+
- Visibility (`columnVisibilityFeature`): the grid shows only the visible columns.
|
|
91
|
+
`@hidden={{true}}` hides a column in the first render.
|
|
92
|
+
- Row selection (`rowSelectionFeature`): add `<g.SelectionColumn />`. Space toggles the row,
|
|
93
|
+
Shift+Space selects it, and Ctrl+A selects all rows.
|
|
94
|
+
- Header groups: put columns in a `<g.ColumnGroup @id @label>` for a group header row.
|
|
95
|
+
|
|
96
|
+
### Column options
|
|
97
|
+
|
|
98
|
+
The args of `g.Column` are the grid options of a column:
|
|
99
|
+
|
|
100
|
+
- `@field` (the key of the value, default `@id`) or `@value` (a function of the data row).
|
|
101
|
+
- `<:cell>`, or `@cell`: a component. It gets `@cell`, `@row`, `@column`, `@value` and
|
|
102
|
+
`@state`.
|
|
103
|
+
- `@cellKind`: `'full'` (the default for a block or a component) or `'cheap'`.
|
|
104
|
+
- `@format`: a function that gives the text of a cell with no block or component.
|
|
105
|
+
- `@align`: `'start'`, `'end'` or `'center'`.
|
|
106
|
+
- `@columnDef`: more column def options, for a feature that has no arg.
|
|
107
|
+
|
|
108
|
+
### Cell state
|
|
109
|
+
|
|
110
|
+
The grid reuses row elements when you scroll (row slots). A `'full'` cell component is
|
|
111
|
+
keyed by its row ID, so the grid makes a new component when a different row comes into the
|
|
112
|
+
slot. Thus a `@tracked` field in a full cell goes away when its row leaves the view. Keep
|
|
113
|
+
state that must stay in `@state`, the `cell.state` store of the grid:
|
|
114
|
+
|
|
115
|
+
```gts
|
|
116
|
+
class Expand extends Component<LatticeCellSignature> {
|
|
117
|
+
get open() {
|
|
118
|
+
return this.args.state.get('open') === true
|
|
119
|
+
}
|
|
120
|
+
toggle = () => this.args.state.set('open', !this.open)
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
In development, the grid warns once (`ember-lattice.full-cells`) when the table has more than
|
|
125
|
+
100,000 rows and a column has a `cell` component with `cellKind` not set to `'cheap'`. Each
|
|
126
|
+
new row in view then makes new components. The warning does nothing in production builds.
|
|
127
|
+
|
|
128
|
+
A `'cheap'` cell component is not keyed: it gets a different row when its slot gets a
|
|
129
|
+
different row. Use `'cheap'` only for a component with no state of its own.
|
|
130
|
+
|
|
131
|
+
### The engine form
|
|
132
|
+
|
|
133
|
+
Make the table yourself with `constructTable` from `@ember-lattice/core`, and give it as
|
|
134
|
+
`@table`. Use it for generated columns (the pivot columns, `autoColumns`) and for a table that
|
|
135
|
+
two surfaces share. The column options are then in `meta.lattice` of each column def. The guide
|
|
136
|
+
page "Engine API" (`features/engine-api.md`) shows it.
|
|
137
|
+
|
|
138
|
+
```gts
|
|
139
|
+
import {
|
|
140
|
+
constructTable,
|
|
141
|
+
emberReactivityBindings,
|
|
142
|
+
rowSelectionFeature,
|
|
143
|
+
tableFeatures,
|
|
144
|
+
} from '@ember-lattice/core'
|
|
145
|
+
import { LatticeGrid, selectionColumn } from '@ember-lattice/ember'
|
|
146
|
+
|
|
147
|
+
const table = constructTable({
|
|
148
|
+
features: tableFeatures({
|
|
149
|
+
coreReactivityFeature: emberReactivityBindings(),
|
|
150
|
+
rowSelectionFeature,
|
|
151
|
+
}),
|
|
152
|
+
data: orders,
|
|
153
|
+
columns: [
|
|
154
|
+
selectionColumn(),
|
|
155
|
+
{ id: 'id', accessorKey: 'id', header: 'Order', meta: { lattice: { align: 'end' } } },
|
|
156
|
+
{ id: 'customer', accessorKey: 'customer', header: 'Customer' },
|
|
157
|
+
],
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
<template><LatticeGrid @table={{table}} @label='Orders' /></template>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Keyboard
|
|
164
|
+
|
|
165
|
+
The grid has one tab stop: the active cell. The arrow keys, Home, End, Ctrl+Home, Ctrl+End,
|
|
166
|
+
PageUp and PageDown move the active cell. In RTL, ArrowLeft and ArrowRight swap. The active
|
|
167
|
+
row stays in the DOM when you scroll it out of the view, so it keeps the focus.
|
|
168
|
+
|
|
169
|
+
### Large lists
|
|
170
|
+
|
|
171
|
+
Above 10M px of rows, the grid scales the scroll range (ADR 0003). The wheel and the keys
|
|
172
|
+
still move by the same number of rows.
|
|
173
|
+
|
|
174
|
+
## List and Board
|
|
175
|
+
|
|
176
|
+
- `LatticeList`: a virtual list with measured heights. See `src/list/README.md`.
|
|
177
|
+
- `LatticeBoard`: items in lanes. See `src/board/README.md`.
|
package/addon-main.cjs
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { TOC } from '@ember/component/template-only';
|
|
3
|
+
import type Owner from '@ember/owner';
|
|
4
|
+
import type { ComponentLike, WithBoundArgs } from '@glint/template';
|
|
5
|
+
import { ColumnRegistry } from '../grid/columns/registry.ts';
|
|
6
|
+
/** What the `<:header>` block of a lane gets. */
|
|
7
|
+
export interface BoardLaneHeaderBlock<K> {
|
|
8
|
+
/** The lane key: `@key`. */
|
|
9
|
+
key: K;
|
|
10
|
+
/** The lane name: `@label`. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** The number of cards in the lane. */
|
|
13
|
+
count: number;
|
|
14
|
+
}
|
|
15
|
+
export interface LatticeBoardLaneSignature<K> {
|
|
16
|
+
Args: {
|
|
17
|
+
/** The lane key: the value that `@laneOf` gives for the items of the lane. */
|
|
18
|
+
key: K;
|
|
19
|
+
/** The lane name: the title, the name of the lane listbox and the text of the announcements. */
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
Blocks: {
|
|
23
|
+
/** The content of the lane title, in place of the label and the count. */
|
|
24
|
+
header: [BoardLaneHeaderBlock<K>];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface LatticeBoardCardSignature<T> {
|
|
28
|
+
Blocks: {
|
|
29
|
+
/** The content of a card, for each item. */
|
|
30
|
+
default: [item: T];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** The declarations that the board yields in the template form. */
|
|
34
|
+
export interface BoardDeclarations<T, K> {
|
|
35
|
+
/** One lane. The lanes show in template order. */
|
|
36
|
+
Lane: ComponentLike<LatticeBoardLaneSignature<K>>;
|
|
37
|
+
/** The content of each card. */
|
|
38
|
+
Card: ComponentLike<LatticeBoardCardSignature<T>>;
|
|
39
|
+
}
|
|
40
|
+
/** A lane in the registry of a board. */
|
|
41
|
+
export interface DeclaredLane {
|
|
42
|
+
readonly marker: Node;
|
|
43
|
+
readonly key: unknown;
|
|
44
|
+
readonly label: string;
|
|
45
|
+
/** True when the declaration has a `<:header>` block. */
|
|
46
|
+
readonly hasHeader: boolean;
|
|
47
|
+
}
|
|
48
|
+
export type LaneRegistry = ColumnRegistry<DeclaredLane>;
|
|
49
|
+
export declare const laneRegistry: () => LaneRegistry;
|
|
50
|
+
type LaneArgs = LatticeBoardLaneSignature<unknown>['Args'];
|
|
51
|
+
export declare class LaneDeclaration extends Component<{
|
|
52
|
+
Args: LaneArgs & {
|
|
53
|
+
registry: LaneRegistry;
|
|
54
|
+
};
|
|
55
|
+
Blocks: LatticeBoardLaneSignature<unknown>['Blocks'];
|
|
56
|
+
}> implements DeclaredLane {
|
|
57
|
+
/** A comment node: the place of the declaration in the template. */
|
|
58
|
+
readonly marker: Comment;
|
|
59
|
+
/** A plain field: the template sets it before the board reads the lanes. */
|
|
60
|
+
hasHeader: boolean;
|
|
61
|
+
constructor(owner: Owner, args: LaneArgs & {
|
|
62
|
+
registry: LaneRegistry;
|
|
63
|
+
});
|
|
64
|
+
willDestroy(): void;
|
|
65
|
+
get key(): unknown;
|
|
66
|
+
get label(): string;
|
|
67
|
+
/** The blocks are fixed for one invocation, so the first render sets this once. */
|
|
68
|
+
noteHeader: (header: boolean) => void;
|
|
69
|
+
}
|
|
70
|
+
/** A declaration that renders nothing in this mode. */
|
|
71
|
+
declare const Nothing: TOC<{
|
|
72
|
+
Args: Partial<LaneArgs>;
|
|
73
|
+
}>;
|
|
74
|
+
/** The declarations of declare mode. */
|
|
75
|
+
export interface DeclareParts {
|
|
76
|
+
Lane: WithBoundArgs<typeof LaneDeclaration, 'registry'>;
|
|
77
|
+
Card: typeof Nothing;
|
|
78
|
+
}
|
|
79
|
+
/** Yields the declarations of declare mode: each lane adds itself to the registry. */
|
|
80
|
+
export declare const DeclareMode: TOC<{
|
|
81
|
+
Args: {
|
|
82
|
+
registry: LaneRegistry;
|
|
83
|
+
};
|
|
84
|
+
Blocks: {
|
|
85
|
+
default: [DeclareParts];
|
|
86
|
+
};
|
|
87
|
+
}>;
|
|
88
|
+
declare const HeaderLane: TOC<{
|
|
89
|
+
Args: LaneArgs & {
|
|
90
|
+
target: unknown;
|
|
91
|
+
ctx: BoardLaneHeaderBlock<unknown>;
|
|
92
|
+
};
|
|
93
|
+
Blocks: LatticeBoardLaneSignature<unknown>['Blocks'];
|
|
94
|
+
}>;
|
|
95
|
+
/** Yields the declarations of header mode: only the lane `@target` renders its `<:header>`. */
|
|
96
|
+
export declare const HeaderMode: TOC<{
|
|
97
|
+
Args: {
|
|
98
|
+
target: unknown;
|
|
99
|
+
ctx: BoardLaneHeaderBlock<unknown>;
|
|
100
|
+
};
|
|
101
|
+
Blocks: {
|
|
102
|
+
default: [{
|
|
103
|
+
Lane: WithBoundArgs<typeof HeaderLane, 'target' | 'ctx'>;
|
|
104
|
+
Card: typeof Nothing;
|
|
105
|
+
}];
|
|
106
|
+
};
|
|
107
|
+
}>;
|
|
108
|
+
declare const CardItem: TOC<{
|
|
109
|
+
Args: {
|
|
110
|
+
item: unknown;
|
|
111
|
+
};
|
|
112
|
+
Blocks: {
|
|
113
|
+
default: [unknown];
|
|
114
|
+
};
|
|
115
|
+
}>;
|
|
116
|
+
/** Yields the declarations of card mode: only `<b.Card>` renders its block, with `@item`. */
|
|
117
|
+
export declare const CardMode: TOC<{
|
|
118
|
+
Args: {
|
|
119
|
+
item: unknown;
|
|
120
|
+
};
|
|
121
|
+
Blocks: {
|
|
122
|
+
default: [{
|
|
123
|
+
Lane: typeof Nothing;
|
|
124
|
+
Card: WithBoundArgs<typeof CardItem, 'item'>;
|
|
125
|
+
}];
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
export {};
|
|
129
|
+
//# sourceMappingURL=declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../../src/board/declarations.gts"],"names":[],"mappings":"AA8KA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE5D,iDAAiD;AACjD,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,4BAA4B;IAC5B,GAAG,EAAE,CAAC,CAAA;IACN,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,IAAI,EAAE;QACJ,8EAA8E;QAC9E,GAAG,EAAE,CAAC,CAAA;QACN,gGAAgG;QAChG,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,MAAM,EAAE;QACN,0EAA0E;QAC1E,MAAM,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAA;KAClC,CAAA;CACF;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,MAAM,EAAE;QACN,4CAA4C;QAC5C,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;KACnB,CAAA;CACF;AAED,mEAAmE;AACnE,MAAM,WAAW,iBAAiB,CAAC,CAAC,EAAE,CAAC;IACrC,kDAAkD;IAClD,IAAI,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAA;IACjD,gCAAgC;IAChC,IAAI,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAA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AAC;YAAC,IAAI,EAAE,aAAa,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAA;SAAE,CAAC,CAAA;KAClF,CAAA;CACF,CAMC,CAAA"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type Owner from '@ember/owner';
|
|
3
|
+
import type { SafeString } from '@ember/template';
|
|
4
|
+
import type { LatticeLocale, LatticeLocaleTextOverride } from '@ember-lattice/core';
|
|
5
|
+
import type { BoardDeclarations, BoardLaneHeaderBlock } from './declarations';
|
|
6
|
+
/**
|
|
7
|
+
* What the default block gets: in the engine form (with `@lanes`), an item; in the template form
|
|
8
|
+
* (no `@lanes`), the declarations.
|
|
9
|
+
*/
|
|
10
|
+
export type LatticeBoardBlock<T, K, L> = [L] extends [undefined] ? BoardDeclarations<T, K> : T;
|
|
11
|
+
/**
|
|
12
|
+
* `L` is the type of `@lanes`: `undefined` in the template form. Glint infers it from the args,
|
|
13
|
+
* so the block gets the type of its form.
|
|
14
|
+
*/
|
|
15
|
+
export interface LatticeBoardSignature<T, K, L extends ReadonlyArray<unknown> | undefined = ReadonlyArray<K>> {
|
|
16
|
+
Element: HTMLDivElement;
|
|
17
|
+
Args: {
|
|
18
|
+
/** All the items of the board. */
|
|
19
|
+
items: ReadonlyArray<T>;
|
|
20
|
+
/** The accessible name of the board. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** The ID of an item. Default: the `id` key of the item, as text. */
|
|
23
|
+
getItemId?: (item: T) => string;
|
|
24
|
+
/**
|
|
25
|
+
* The engine form: the lane keys, in order. With `@lanes`, the block is the content of each
|
|
26
|
+
* card. With no `@lanes`, the block declares the lanes (`<b.Lane>`) and the card (`<b.Card>`).
|
|
27
|
+
*/
|
|
28
|
+
lanes?: L & ReadonlyArray<K>;
|
|
29
|
+
/** The lane key of an item. */
|
|
30
|
+
laneOf: (item: T) => K;
|
|
31
|
+
/** The engine form: the label of a lane. Default: the lane key as text. */
|
|
32
|
+
laneLabel?: (lane: K) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Called when the user drops a card. `toIndex` is the index in `toLane` after the move.
|
|
35
|
+
* Return a promise: the card shows the new place until it settles, and goes back on reject.
|
|
36
|
+
*/
|
|
37
|
+
onMove?: (item: T, toLane: K, toIndex: number, fromLane: K) => unknown;
|
|
38
|
+
/** The estimated card height in px, before the lane measures a card. */
|
|
39
|
+
estimateSize?: number;
|
|
40
|
+
/** The name of a card in the announcements. The default is the text of the card. */
|
|
41
|
+
cardLabel?: (item: T) => string;
|
|
42
|
+
/** The heading level of the lane titles, one more than the heading above the board. Default 3. */
|
|
43
|
+
headingLevel?: number;
|
|
44
|
+
/** Locale text that replaces the owner text and the English defaults for this board (ADR 0024). */
|
|
45
|
+
localeText?: LatticeLocaleTextOverride;
|
|
46
|
+
};
|
|
47
|
+
Blocks: {
|
|
48
|
+
/**
|
|
49
|
+
* The engine form (`@lanes`): the content of a card, for each item. The template form (no
|
|
50
|
+
* `@lanes`): the declarations, `<b.Lane>` for each lane and `<b.Card>` for the card content.
|
|
51
|
+
*/
|
|
52
|
+
default: [LatticeBoardBlock<T, K, L>];
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
interface LaneView<T, K> {
|
|
56
|
+
key: K;
|
|
57
|
+
dataLane: string;
|
|
58
|
+
label: string;
|
|
59
|
+
titleId: string;
|
|
60
|
+
items: ReadonlyArray<T>;
|
|
61
|
+
/** The template form: the context of the `<:header>` block of the lane, or null. */
|
|
62
|
+
header: BoardLaneHeaderBlock<K> | null;
|
|
63
|
+
}
|
|
64
|
+
export default class LatticeBoard<T, K, L extends ReadonlyArray<unknown> | undefined = undefined> extends Component<LatticeBoardSignature<T, K, L>> {
|
|
65
|
+
/** The cards out of their data place: picked up, or with a move in progress. */
|
|
66
|
+
private overrides;
|
|
67
|
+
private held;
|
|
68
|
+
private drag;
|
|
69
|
+
message: string;
|
|
70
|
+
private _root;
|
|
71
|
+
/** A card to focus when it renders, and while it is picked up. */
|
|
72
|
+
private _focusId;
|
|
73
|
+
private _suppressClick;
|
|
74
|
+
private _endDrag;
|
|
75
|
+
/** The template form: the `<b.Lane>` declarations of the block. */
|
|
76
|
+
registry: import('./declarations').LaneRegistry;
|
|
77
|
+
constructor(owner: Owner, args: LatticeBoardSignature<T, K, L>['Args']);
|
|
78
|
+
private get boardId();
|
|
79
|
+
/** True in the template form: the block declares the lanes and the card. */
|
|
80
|
+
get declared(): boolean;
|
|
81
|
+
/** The block value of its form: the type of the block depends on `@lanes` (`L`). */
|
|
82
|
+
asBlock: (value: unknown) => LatticeBoardBlock<T, K, L>;
|
|
83
|
+
/** The lane keys, in order: `@lanes`, or the `<b.Lane>` declarations in template order. */
|
|
84
|
+
get laneKeys(): ReadonlyArray<K>;
|
|
85
|
+
/** The template form: the declared lanes by key. */
|
|
86
|
+
private get declaredLanes();
|
|
87
|
+
/** The label of a lane: `@laneLabel`, or the `@label` of its declaration. */
|
|
88
|
+
private labelOf;
|
|
89
|
+
private get itemById();
|
|
90
|
+
/** The items of each lane, from the data only. */
|
|
91
|
+
private get baseLanes();
|
|
92
|
+
/** The items of each lane, with the overrides. A lane with no override keeps its array. */
|
|
93
|
+
get laneItems(): Map<K, ReadonlyArray<T>>;
|
|
94
|
+
get laneViews(): Array<LaneView<T, K>>;
|
|
95
|
+
idOf: (item: T) => string;
|
|
96
|
+
get headingLevel(): number;
|
|
97
|
+
get heldId(): string | undefined;
|
|
98
|
+
/** The style of the drop line in a lane, or undefined. It reads only the drag. */
|
|
99
|
+
lineFor: (lane: K) => SafeString | undefined;
|
|
100
|
+
get previewStyle(): SafeString;
|
|
101
|
+
/** The locale text of this component (ADR 0024): `@localeText`, then the owner text. */
|
|
102
|
+
get l(): LatticeLocale;
|
|
103
|
+
private placeOf;
|
|
104
|
+
private countIn;
|
|
105
|
+
/** The params of a place in a message: the lane label, the position and the card count. */
|
|
106
|
+
private where;
|
|
107
|
+
private setOverride;
|
|
108
|
+
/** Drop a card: call @onMove, and show the new place while its promise is in progress. */
|
|
109
|
+
private commit;
|
|
110
|
+
setup: import("ember-modifier").FunctionBasedModifier<{
|
|
111
|
+
Args: {
|
|
112
|
+
Positional: unknown[];
|
|
113
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
114
|
+
};
|
|
115
|
+
Element: HTMLElement;
|
|
116
|
+
}>;
|
|
117
|
+
/** On each card: mark the picked-up card, and give it the focus when it renders or moves. */
|
|
118
|
+
card: import("ember-modifier").FunctionBasedModifier<{
|
|
119
|
+
Args: {
|
|
120
|
+
Positional: [string, string | undefined, number];
|
|
121
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
122
|
+
};
|
|
123
|
+
Element: HTMLElement;
|
|
124
|
+
}>;
|
|
125
|
+
/** The option of a board card that is the event target, or null. */
|
|
126
|
+
private cardOf;
|
|
127
|
+
private laneElement;
|
|
128
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
129
|
+
/** Put a picked-up card back in its old place. */
|
|
130
|
+
private cancel;
|
|
131
|
+
/** Cancel a keyboard move when the user goes out of the board: the card keeps no focus. */
|
|
132
|
+
private leave;
|
|
133
|
+
onFocusOut: (event: FocusEvent) => void;
|
|
134
|
+
onDocumentPointerDown: (event: PointerEvent) => void;
|
|
135
|
+
/** After the render: cancel the keyboard move if the picked-up card is not rendered. */
|
|
136
|
+
private checkHeld;
|
|
137
|
+
private stop;
|
|
138
|
+
private pickUp;
|
|
139
|
+
private moveInLane;
|
|
140
|
+
/** Move to the next or the previous lane, at the height of the card in the view. */
|
|
141
|
+
private moveToLane;
|
|
142
|
+
private moveTo;
|
|
143
|
+
onPointerDown: (event: PointerEvent) => void;
|
|
144
|
+
private startDrag;
|
|
145
|
+
private nameOf;
|
|
146
|
+
/** Client px to board px: a transform on the page (the test container scale) changes it. */
|
|
147
|
+
private ratio;
|
|
148
|
+
/** Update the preview and the drop place for a pointer at (x, y), in client px. */
|
|
149
|
+
private track;
|
|
150
|
+
onClick: (event: MouseEvent) => void;
|
|
151
|
+
}
|
|
152
|
+
export {};
|
|
153
|
+
//# sourceMappingURL=lattice-board.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lattice-board.d.ts","sourceRoot":"","sources":["../../src/board/lattice-board.gts"],"names":[],"mappings":"AAwxBA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAK1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAIrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAKjD,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAKnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAgB,MAAM,oBAAoB,CAAA;AAE/F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;AAE9F;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CACpC,CAAC,EACD,CAAC,EACD,CAAC,SAAS,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC;IAE/D,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE;QACJ,kCAAkC;QAClC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;QACvB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;QACb,qEAAqE;QACrE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAA;QAC/B;;;WAGG;QACH,KAAK,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;QAC5B,+BAA+B;QAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAA;QACtB,2EAA2E;QAC3E,SAAS,CAAC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b,OAAO,CAAC,WAAW;IASnB,0FAA0F;IAC1F,OAAO,CAAC,MAAM;IAoCd,KAAK;;;;;;OAQH;IAEF,6FAA6F;IAE7F,IAAI;;;;;;OAeF;IAIF,oEAAoE;IACpE,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,WAAW;IAMnB,SAAS,GAAI,OAAO,aAAa,UA4BhC;IAED,kDAAkD;IAClD,OAAO,CAAC,MAAM;IAQd,2FAA2F;IAC3F,OAAO,CAAC,KAAK;IAUb,UAAU,GAAI,OAAO,UAAU,UAAoC;IAGnE,qBAAqB,GAAI,OAAO,YAAY,UAA6B;IAEzE,wFAAwF;IACxF,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,UAAU;IAOlB,oFAAoF;IACpF,OAAO,CAAC,UAAU;IAsBlB,OAAO,CAAC,MAAM;IAOd,aAAa,GAAI,OAAO,YAAY,UAoGnC;IAED,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,MAAM;IAId,4FAA4F;IAC5F,OAAO,CAAC,KAAK;IAMb,mFAAmF;IACnF,OAAO,CAAC,KAAK;IAkDb,OAAO,GAAI,OAAO,UAAU,UAI3B;CAmMF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** The column state that aligned grids share. */
|
|
2
|
+
export interface AlignedColumns {
|
|
3
|
+
/** The size of each leaf column, by ID. */
|
|
4
|
+
sizes: Readonly<Record<string, number>>;
|
|
5
|
+
/** The IDs of the visible leaf columns, in the order that the grid shows them. */
|
|
6
|
+
order: ReadonlyArray<string>;
|
|
7
|
+
/** True for each visible leaf column, by ID. */
|
|
8
|
+
visible: Readonly<Record<string, boolean>>;
|
|
9
|
+
}
|
|
10
|
+
/** The part of `LatticeGrid` that an alignment uses. */
|
|
11
|
+
export interface AlignedGrid {
|
|
12
|
+
alignedColumns(): AlignedColumns;
|
|
13
|
+
/** Makes the columns of this grid the same as `state`, for the IDs that both have. */
|
|
14
|
+
alignColumns(state: AlignedColumns): void;
|
|
15
|
+
/** Sets the horizontal scroll offset, in CSS px. */
|
|
16
|
+
alignScroll(left: number): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class GridAlignment {
|
|
19
|
+
private grids;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a grid. A grid that joins takes the columns of the grids that are already there. The
|
|
22
|
+
* returned function removes it.
|
|
23
|
+
*/
|
|
24
|
+
join(grid: AlignedGrid): () => void;
|
|
25
|
+
/** A grid changed its columns: the other grids take the change. */
|
|
26
|
+
columnsChanged(from: AlignedGrid): void;
|
|
27
|
+
/** A grid scrolled: the other grids scroll to the same offset. */
|
|
28
|
+
scrolled(from: AlignedGrid, left: number): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=alignment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alignment.d.ts","sourceRoot":"","sources":["../../src/grid/alignment.ts"],"names":[],"mappings":"AAIA,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACvC,kFAAkF;IAClF,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC5B,gDAAgD;IAChD,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAC3C;AAED,wDAAwD;AACxD,MAAM,WAAW,WAAW;IAC1B,cAAc,IAAI,cAAc,CAAA;IAChC,sFAAsF;IACtF,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IACzC,oDAAoD;IACpD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAyB;IAEtC;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,IAAI;IAOnC,mEAAmE;IACnE,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAMvC,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;CAGhD"}
|