@ni/nimble-components 18.5.0 → 18.5.2

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.
@@ -26871,6 +26871,19 @@
26871
26871
  * The base class for table columns
26872
26872
  */
26873
26873
  class TableColumn extends FoundationElement {
26874
+ constructor() {
26875
+ super(...arguments);
26876
+ /**
26877
+ * @internal
26878
+ *
26879
+ * The names of the fields from the row's record that correlate to the data that will be in TCellRecord.
26880
+ * This array is parallel with the field names specified by `cellRecordFieldNames`.
26881
+ */
26882
+ this.dataRecordFieldNames = [];
26883
+ }
26884
+ /**
26885
+ * @internal
26886
+ */
26874
26887
  connectedCallback() {
26875
26888
  super.connectedCallback();
26876
26889
  this.setAttribute('slot', uniqueId('table-column-slot'));
@@ -26885,6 +26898,12 @@
26885
26898
  __decorate$1([
26886
26899
  attr({ attribute: 'action-menu-label' })
26887
26900
  ], TableColumn.prototype, "actionMenuLabel", void 0);
26901
+ __decorate$1([
26902
+ observable
26903
+ ], TableColumn.prototype, "dataRecordFieldNames", void 0);
26904
+ __decorate$1([
26905
+ observable
26906
+ ], TableColumn.prototype, "columnConfig", void 0);
26888
26907
 
26889
26908
  /**
26890
26909
  * Helper class for the nimble-table to validate that the table's configuration
@@ -27257,7 +27276,7 @@
27257
27276
  }
27258
27277
  get columnStates() {
27259
27278
  return this.columns.map(column => {
27260
- const fieldNames = column.getDataRecordFieldNames();
27279
+ const fieldNames = column.dataRecordFieldNames;
27261
27280
  let cellState;
27262
27281
  if (this.hasValidFieldNames(fieldNames) && this.dataRecord) {
27263
27282
  const cellDataValues = fieldNames.map(field => this.dataRecord[field]);
@@ -27265,7 +27284,7 @@
27265
27284
  k,
27266
27285
  cellDataValues[i]
27267
27286
  ]));
27268
- const columnConfig = column.getColumnConfig?.() ?? {};
27287
+ const columnConfig = column.columnConfig ?? {};
27269
27288
  cellState = {
27270
27289
  cellRecord,
27271
27290
  columnConfig
@@ -28349,11 +28368,11 @@
28349
28368
  this.cellStyles = cellStyles;
28350
28369
  this.cellTemplate = cellTemplate;
28351
28370
  }
28352
- getColumnConfig() {
28353
- return { placeholder: this.placeholder ?? '' };
28371
+ fieldNameChanged() {
28372
+ this.dataRecordFieldNames = [this.fieldName];
28354
28373
  }
28355
- getDataRecordFieldNames() {
28356
- return [this.fieldName];
28374
+ placeholderChanged() {
28375
+ this.columnConfig = { placeholder: this.placeholder ?? '' };
28357
28376
  }
28358
28377
  }
28359
28378
  __decorate$1([