@omnigrid/selection-plugin 0.1.12 → 0.1.14
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 +1 -1
- package/dist/index.js +6 -3
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ selection is available only in `"multiple"` mode.
|
|
|
55
55
|
## Links
|
|
56
56
|
|
|
57
57
|
- **Source:** https://github.com/KRZK-Apps/omnigrid/tree/main/plugins/base/selection
|
|
58
|
-
- **Demo:** https://omnigrid.cc/
|
|
58
|
+
- **Demo:** https://omnigrid.cc/demo/react/plugins/base/selection
|
|
59
59
|
- **Issues:** https://github.com/KRZK-Apps/omnigrid/issues
|
|
60
60
|
|
|
61
61
|
## License
|
package/dist/index.js
CHANGED
|
@@ -429,9 +429,12 @@ export class SelectionPlugin {
|
|
|
429
429
|
refresh() {
|
|
430
430
|
if (!this.api || this.api.isDestroyed())
|
|
431
431
|
return;
|
|
432
|
-
|
|
433
|
-
this.
|
|
434
|
-
|
|
432
|
+
const api = this.api;
|
|
433
|
+
const selectionState = this.getSelectionState();
|
|
434
|
+
api.setState((prev) => ({ ...prev, selection: selectionState }), { structural: false });
|
|
435
|
+
api.refreshCells([this.selectionColumnId]);
|
|
436
|
+
this.onSelectionChange?.(selectionState);
|
|
437
|
+
api.emit("selection:change", selectionState);
|
|
435
438
|
}
|
|
436
439
|
validateSelection() {
|
|
437
440
|
if (!this.api)
|
package/dist/types.d.ts
CHANGED
|
@@ -65,4 +65,8 @@ declare module "@omnigrid/core" {
|
|
|
65
65
|
/** Clears the current selection. */
|
|
66
66
|
clearSelection?: () => void;
|
|
67
67
|
}
|
|
68
|
+
interface GridEvents<T> {
|
|
69
|
+
/** Fired when the selected rows change. Payload is the new selection state. */
|
|
70
|
+
"selection:change": SelectionState<T>;
|
|
71
|
+
}
|
|
68
72
|
}
|