@omnigrid/selection-plugin 0.1.10 → 0.1.11

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 (2) hide show
  1. package/dist/index.js +9 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -333,6 +333,8 @@ export class SelectionPlugin {
333
333
  stopRowClick: true,
334
334
  // The checkbox column must always stay pinned to the left.
335
335
  pinned: "left",
336
+ movable: false,
337
+ lockPosition: "start",
336
338
  headerRenderer: () => this.renderCheckbox({
337
339
  checked: this.isAllSelectableRowsSelected(),
338
340
  indeterminate: this.hasSomeSelectableRowsSelected() && !this.isAllSelectableRowsSelected(),
@@ -435,11 +437,15 @@ export class SelectionPlugin {
435
437
  if (!this.api)
436
438
  return;
437
439
  const processedData = this.api.getProcessedData();
440
+ const validIds = new Set();
441
+ for (let i = 0; i < processedData.length; i += 1) {
442
+ const row = processedData[i];
443
+ if (this.isRowSelectable(row, i))
444
+ validIds.add(this.getSelectionRowId(row, i));
445
+ }
438
446
  let hasChanges = false;
439
447
  for (const rowId of this.selectedRowIds) {
440
- const index = processedData.findIndex((row, idx) => this.getSelectionRowId(row, idx) === rowId);
441
- const row = index !== -1 ? processedData[index] : undefined;
442
- if (row && index !== -1 && !this.isRowSelectable(row, index)) {
448
+ if (!validIds.has(rowId)) {
443
449
  this.selectedRowIds.delete(rowId);
444
450
  hasChanges = true;
445
451
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigrid/selection-plugin",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Headless row selection plugin for OmniGrid",
5
5
  "keywords": [
6
6
  "omnigrid",