@ni/nimble-components 30.1.6 → 30.1.7

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.
@@ -16032,7 +16032,7 @@
16032
16032
 
16033
16033
  /**
16034
16034
  * Do not edit directly
16035
- * Generated on Tue, 30 Jul 2024 20:04:50 GMT
16035
+ * Generated on Wed, 31 Jul 2024 19:28:45 GMT
16036
16036
  */
16037
16037
 
16038
16038
  const Information100DarkUi = "#a46eff";
@@ -68717,7 +68717,7 @@ focus outline in that case.
68717
68717
  catch {
68718
68718
  this.isDataFlat = true;
68719
68719
  this._hierarchicalData = records.map((record, index) => ({
68720
- clientRecord: { ...record },
68720
+ clientRecord: record,
68721
68721
  originalIndex: index
68722
68722
  }));
68723
68723
  this._parentIdConfigurationValid = false;
@@ -68726,7 +68726,7 @@ focus outline in that case.
68726
68726
  else {
68727
68727
  this.isDataFlat = true;
68728
68728
  this._hierarchicalData = records.map((record, index) => ({
68729
- clientRecord: { ...record },
68729
+ clientRecord: record,
68730
68730
  originalIndex: index
68731
68731
  }));
68732
68732
  this._parentIdConfigurationValid = true;
@@ -70083,7 +70083,10 @@ focus outline in that case.
70083
70083
  }
70084
70084
  async setData(newData) {
70085
70085
  await this.processPendingUpdates();
70086
- const tanstackUpdates = this.calculateTanStackData(newData);
70086
+ // Make a shallow clone of the record to avoid holding a reference to the client's data object.
70087
+ // This also ensures that a data update will always result in a row's record being a new object.
70088
+ const clonedData = newData.map(record => ({ ...record }));
70089
+ const tanstackUpdates = this.calculateTanStackData(clonedData);
70087
70090
  this.updateTableOptions(tanstackUpdates);
70088
70091
  }
70089
70092
  async getSelectedRecordIds() {