@truenas/ui-components 0.7.11 → 0.7.12

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.
@@ -18517,7 +18517,9 @@ class TnTableComponent {
18517
18517
  ngOnInit() {
18518
18518
  this.initialized = true;
18519
18519
  this.destroyRef.onDestroy(() => {
18520
- this.clearSelection();
18520
+ // Not `clearSelection()`: that emits, and `selectionChange` is already torn down
18521
+ // here, which warns NG0953. Nothing is left to receive it either way.
18522
+ this.resetSelectionState();
18521
18523
  this.resizeObserver?.disconnect();
18522
18524
  });
18523
18525
  }
@@ -19080,10 +19082,19 @@ class TnTableComponent {
19080
19082
  * the next reconcile.
19081
19083
  */
19082
19084
  clearSelection() {
19085
+ this.resetSelectionState();
19086
+ this.emitSelectionIfChanged();
19087
+ }
19088
+ /**
19089
+ * Drops the selection state and tells nobody. Only teardown wants this: by the time
19090
+ * the `onDestroy` hook runs, `selectionChange` is an `OutputRef` Angular has already
19091
+ * destroyed, and emitting on it warns NG0953 in dev mode. Every live path wants
19092
+ * {@link clearSelection}, because a consumer mirroring the selection has to hear it.
19093
+ */
19094
+ resetSelectionState() {
19083
19095
  this.selection.clear();
19084
19096
  this.selectedByKey.clear();
19085
19097
  this.selectionCount.set(0);
19086
- this.emitSelectionIfChanged();
19087
19098
  }
19088
19099
  /** Re-applies the retained selection to the rows currently on screen. */
19089
19100
  syncSelectionToData(rows, selectionKey) {