@ni/nimble-components 19.1.0 → 19.1.1

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.
@@ -16366,7 +16366,7 @@
16366
16366
 
16367
16367
  /**
16368
16368
  * Do not edit directly
16369
- * Generated on Mon, 22 May 2023 18:24:46 GMT
16369
+ * Generated on Tue, 23 May 2023 15:51:05 GMT
16370
16370
  */
16371
16371
  const Information100DarkUi = "#a46eff";
16372
16372
  const Information100LightUi = "#804ad9";
@@ -28038,10 +28038,16 @@
28038
28038
  * the resolved value of the fractionalWidth after updates programmatic or interactive updates.
28039
28039
  */
28040
28040
  this.currentFractionalWidth = defaultFractionalWidth;
28041
+ /**
28042
+ * @internal Do not write to this value directly. It is used by the Table in order to store
28043
+ * the resolved value of the sortDirection after programmatic or interactive updates.
28044
+ */
28045
+ this.currentSortDirection = TableColumnSortDirection.none;
28041
28046
  this.cellRecordFieldNames = options.cellRecordFieldNames;
28042
28047
  this.cellViewTemplate = createCellViewTemplate(options.cellViewTag);
28043
28048
  this.groupHeaderViewTemplate = createGroupHeaderViewTemplate(options.groupHeaderViewTag);
28044
28049
  this.delegatedEvents = options.delegatedEvents;
28050
+ this.sortOperation = options.sortOperation ?? TableColumnSortOperation.basic;
28045
28051
  }
28046
28052
  fractionalWidthChanged() {
28047
28053
  this.currentFractionalWidth = this.fractionalWidth;
@@ -28097,17 +28103,17 @@
28097
28103
  * The base class for table columns
28098
28104
  */
28099
28105
  class TableColumn extends FoundationElement {
28100
- constructor(options) {
28101
- super();
28106
+ constructor() {
28107
+ super(...arguments);
28108
+ /**
28109
+ * @internal
28110
+ *
28111
+ * Column properties configurable by plugin authors
28112
+ */
28113
+ this.columnInternals = new ColumnInternals(this.getColumnInternalsOptions());
28102
28114
  this.columnHidden = false;
28103
28115
  this.sortDirection = TableColumnSortDirection.none;
28104
28116
  this.sortingDisabled = false;
28105
- if (!options) {
28106
- throw new Error('ColumnInternalsOptions must be provided to constructor');
28107
- }
28108
- this.columnInternals = new ColumnInternals(options);
28109
- this.columnInternals.currentSortDirection = this.sortDirection;
28110
- this.columnInternals.currentSortIndex = this.sortIndex;
28111
28117
  }
28112
28118
  checkValidity() {
28113
28119
  return this.columnInternals.validConfiguration;
@@ -28126,16 +28132,13 @@
28126
28132
  }
28127
28133
  }
28128
28134
  sortingDisabledChanged() {
28129
- // Ignore the default value sortingDisabled initialization from undefined to false (which runs before columnInternals is initialized)
28130
- if (this.columnInternals) {
28131
- if (this.sortingDisabled) {
28132
- this.columnInternals.currentSortDirection = TableColumnSortDirection.none;
28133
- this.columnInternals.currentSortIndex = undefined;
28134
- }
28135
- else {
28136
- this.columnInternals.currentSortDirection = this.sortDirection;
28137
- this.columnInternals.currentSortIndex = this.sortIndex;
28138
- }
28135
+ if (this.sortingDisabled) {
28136
+ this.columnInternals.currentSortDirection = TableColumnSortDirection.none;
28137
+ this.columnInternals.currentSortIndex = undefined;
28138
+ }
28139
+ else {
28140
+ this.columnInternals.currentSortDirection = this.sortDirection;
28141
+ this.columnInternals.currentSortIndex = this.sortIndex;
28139
28142
  }
28140
28143
  }
28141
28144
  }
@@ -31429,14 +31432,17 @@
31429
31432
  */
31430
31433
  class TableColumnAnchor extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI((TableColumn))) {
31431
31434
  constructor() {
31432
- super({
31435
+ super(...arguments);
31436
+ this.underlineHidden = false;
31437
+ }
31438
+ getColumnInternalsOptions() {
31439
+ return {
31433
31440
  cellRecordFieldNames: ['label', 'href'],
31434
31441
  cellViewTag: tableColumnAnchorCellViewTag,
31435
31442
  groupHeaderViewTag: tableColumnTextGroupHeaderTag,
31436
- delegatedEvents: ['click']
31437
- });
31438
- this.underlineHidden = false;
31439
- this.columnInternals.sortOperation = TableColumnSortOperation.localeAwareCaseSensitive;
31443
+ delegatedEvents: ['click'],
31444
+ sortOperation: TableColumnSortOperation.localeAwareCaseSensitive
31445
+ };
31440
31446
  }
31441
31447
  labelFieldNameChanged() {
31442
31448
  this.columnInternals.dataRecordFieldNames = [
@@ -31639,14 +31645,14 @@
31639
31645
  * The table column for displaying string fields as text.
31640
31646
  */
31641
31647
  class TableColumnText extends TableColumnTextBase {
31642
- constructor() {
31643
- super({
31648
+ getColumnInternalsOptions() {
31649
+ return {
31644
31650
  cellRecordFieldNames: ['value'],
31645
31651
  cellViewTag: tableColumnTextCellViewTag,
31646
31652
  groupHeaderViewTag: tableColumnTextGroupHeaderTag,
31647
- delegatedEvents: []
31648
- });
31649
- this.columnInternals.sortOperation = TableColumnSortOperation.localeAwareCaseSensitive;
31653
+ delegatedEvents: [],
31654
+ sortOperation: TableColumnSortOperation.localeAwareCaseSensitive
31655
+ };
31650
31656
  }
31651
31657
  }
31652
31658
  const nimbleTableColumnText = TableColumnText.compose({