@libregrid/cell-selection 1.3.3 → 1.3.4
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/README.md +26 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
# @libregrid/cell-selection
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Select rectangular cell ranges and extend values or sequences with a fill
|
|
4
|
+
handle. Combine this with clipboard operations or status-bar summaries for
|
|
5
|
+
spreadsheet-style interaction.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
"range selection" is folded into cell selection as of AG Grid v36).
|
|
7
|
+
[Documentation and examples](https://libregrid.dev/selection)
|
|
9
8
|
|
|
10
9
|
## Install
|
|
11
10
|
|
|
12
11
|
```bash
|
|
13
|
-
npm install ag-grid-community @libregrid/cell-selection
|
|
12
|
+
npm install "ag-grid-community@^36.1.0" @libregrid/cell-selection
|
|
14
13
|
```
|
|
15
14
|
|
|
16
15
|
Requires `ag-grid-community >=36.1.0 <37` as a peer dependency.
|
|
17
16
|
|
|
18
17
|
## Usage
|
|
19
18
|
|
|
19
|
+
In a browser TypeScript project, add a grid container before running the code:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<div id="grid" style="height: 400px"></div>
|
|
23
|
+
```
|
|
24
|
+
|
|
20
25
|
```ts
|
|
21
26
|
import { ModuleRegistry, AllCommunityModule, createGrid } from 'ag-grid-community';
|
|
22
27
|
import { CellSelectionModule } from '@libregrid/cell-selection';
|
|
23
28
|
|
|
24
29
|
ModuleRegistry.registerModules([AllCommunityModule, CellSelectionModule]);
|
|
25
30
|
|
|
26
|
-
const api = createGrid(document.querySelector('#grid')!, {
|
|
31
|
+
const api = createGrid(document.querySelector<HTMLElement>('#grid')!, {
|
|
27
32
|
columnDefs: [{ field: 'name' }, { field: 'first' }, { field: 'second' }],
|
|
28
33
|
rowData: [{ name: 'Alpha', first: 1, second: 2 }],
|
|
29
34
|
defaultColDef: { editable: true },
|
|
@@ -41,12 +46,12 @@ range instead of filling values.
|
|
|
41
46
|
|
|
42
47
|
## API
|
|
43
48
|
|
|
44
|
-
| Export
|
|
45
|
-
|
|
|
46
|
-
| `CellSelectionModule`
|
|
47
|
-
| `RangeService`
|
|
48
|
-
| `RangeModel`, `normalise(range)` | Normalizes a `CellRangeModel` (e.g. after dragging up/left).
|
|
49
|
-
| `fillSeries(values, length)`
|
|
49
|
+
| Export | Purpose |
|
|
50
|
+
| -------------------------------- | -------------------------------------------------------------------------------- |
|
|
51
|
+
| `CellSelectionModule` | Registers the feature (`moduleName: 'CellSelection'`). |
|
|
52
|
+
| `RangeService` | Bean backing range state and the fill handle. |
|
|
53
|
+
| `RangeModel`, `normalise(range)` | Normalizes a `CellRangeModel` (e.g. after dragging up/left). |
|
|
54
|
+
| `fillSeries(values, length)` | The series-detection logic behind fill-handle drag (numeric sequences, repeats). |
|
|
50
55
|
|
|
51
56
|
## Learn more
|
|
52
57
|
|
|
@@ -54,8 +59,14 @@ range instead of filling values.
|
|
|
54
59
|
- [`@libregrid/clipboard`](https://github.com/libregrid/libregrid/blob/main/packages/clipboard/README.md) — copy/cut/paste for the selected range
|
|
55
60
|
- [`@libregrid/status-bar`](https://github.com/libregrid/libregrid/blob/main/packages/status-bar/README.md) — aggregation panel over the selected range
|
|
56
61
|
|
|
62
|
+
## Angular
|
|
63
|
+
|
|
64
|
+
Use the same column definitions and grid options with `ag-grid-angular`.
|
|
65
|
+
Register the modules shown above through `provideLibreGrid` from
|
|
66
|
+
[`@libregrid/angular`](../angular/README.md). See the
|
|
67
|
+
[Angular setup](https://libregrid.dev/angular) for a complete component and bootstrap example.
|
|
68
|
+
|
|
57
69
|
## License
|
|
58
70
|
|
|
59
|
-
MIT — see [LICENSE](./LICENSE). LibreGrid is an independent
|
|
71
|
+
MIT — see [LICENSE](./LICENSE) and [NOTICE](./NOTICE). LibreGrid is an independent
|
|
60
72
|
project and is not affiliated with, endorsed by, or sponsored by AG Grid Ltd.
|
|
61
|
-
See [NOTICE](./NOTICE) for third-party attribution.
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@libregrid/cell-selection","version":"1.3.
|
|
1
|
+
{"name":"@libregrid/cell-selection","version":"1.3.4","description":"Cell range selection for AG Grid Community — part of LibreGrid","keywords":["libregrid","ag-grid","data-grid","cell-selection"],"homepage":"https://github.com/libregrid/libregrid#readme","repository":{"type":"git","url":"git+https://github.com/libregrid/libregrid.git","directory":"packages/cell-selection"},"bugs":{"url":"https://github.com/libregrid/libregrid/issues"},"license":"MIT","type":"module","sideEffects":false,"peerDependencies":{"ag-grid-community":">=36.1.0 <37"},"dependencies":{"@libregrid/core":"^1.3.4"},"files":["dist","LICENSE","NOTICE","README.md"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}}}
|