@libregrid/cell-selection 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -3
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LibreGrid contributors
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/README.md CHANGED
@@ -1,6 +1,61 @@
1
1
  # @libregrid/cell-selection
2
2
 
3
- Framework-neutral cell range selection for AG Grid Community.
3
+ Drag to select a range of cells. Drag the fill handle to extend a value
4
+ or series across cells. `@libregrid/clipboard` and `@libregrid/status-bar`'s
5
+ aggregation panel build on this foundation.
4
6
 
5
- LibreGrid is an independent open-source project. It is not affiliated with,
6
- endorsed by, or sponsored by AG Grid Ltd. "AG Grid" is a trademark of AG Grid Ltd.
7
+ Replaces AG Grid Enterprise's `CellSelection` module (Enterprise's older
8
+ "range selection" is folded into cell selection as of AG Grid v36).
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install ag-grid-community @libregrid/cell-selection
14
+ ```
15
+
16
+ Requires `ag-grid-community >=36.1.0 <37` as a peer dependency.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { ModuleRegistry, AllCommunityModule, createGrid } from 'ag-grid-community';
22
+ import { CellSelectionModule } from '@libregrid/cell-selection';
23
+
24
+ ModuleRegistry.registerModules([AllCommunityModule, CellSelectionModule]);
25
+
26
+ const api = createGrid(document.querySelector('#grid')!, {
27
+ columnDefs: [{ field: 'name' }, { field: 'first' }, { field: 'second' }],
28
+ rowData: [{ name: 'Alpha', first: 1, second: 2 }],
29
+ defaultColDef: { editable: true },
30
+ cellSelection: { handle: { mode: 'fill' } },
31
+ });
32
+
33
+ api.addEventListener('rangeSelectionChanged', () => {
34
+ console.log(api.getCellRanges());
35
+ });
36
+ ```
37
+
38
+ Set `cellSelection: true` for range selection without the fill handle. Set
39
+ `cellSelection: { handle: { mode: 'range' } }` to drag-extend the current
40
+ range instead of filling values.
41
+
42
+ ## API
43
+
44
+ | Export | Purpose |
45
+ | --- | --- |
46
+ | `CellSelectionModule` | Registers the feature (`moduleName: 'CellSelection'`). |
47
+ | `RangeService` | Bean backing range state and the fill handle. |
48
+ | `RangeModel`, `normalise(range)` | Normalizes a `CellRangeModel` (e.g. after dragging up/left). |
49
+ | `fillSeries(values, length)` | The series-detection logic behind fill-handle drag (numeric sequences, repeats). |
50
+
51
+ ## Learn more
52
+
53
+ - [LibreGrid README](https://github.com/libregrid/libregrid#readme) — full package list and quick start
54
+ - [`@libregrid/clipboard`](https://github.com/libregrid/libregrid/blob/main/packages/clipboard/README.md) — copy/cut/paste for the selected range
55
+ - [`@libregrid/status-bar`](https://github.com/libregrid/libregrid/blob/main/packages/status-bar/README.md) — aggregation panel over the selected range
56
+
57
+ ## License
58
+
59
+ MIT — see [LICENSE](./LICENSE). LibreGrid is an independent open-source
60
+ 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.0.0","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.0.0"},"files":["dist","NOTICE","README.md"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}}}
1
+ {"name":"@libregrid/cell-selection","version":"1.0.1","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.0.1"},"files":["dist","LICENSE","NOTICE","README.md"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}}}