@ni/nimble-components 29.3.5 → 29.3.6

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 (37) hide show
  1. package/dist/all-components-bundle.js +67 -58
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +496 -496
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/table/index.js +2 -2
  6. package/dist/esm/table/index.js.map +1 -1
  7. package/dist/esm/table/models/table-update-tracker.js +1 -2
  8. package/dist/esm/table/models/table-update-tracker.js.map +1 -1
  9. package/dist/esm/table/testing/table.pageobject.js +1 -1
  10. package/dist/esm/table/testing/table.pageobject.js.map +1 -1
  11. package/dist/esm/table-column/anchor/index.d.ts +8 -0
  12. package/dist/esm/table-column/anchor/index.js +2 -1
  13. package/dist/esm/table-column/anchor/index.js.map +1 -1
  14. package/dist/esm/table-column/base/index.d.ts +0 -7
  15. package/dist/esm/table-column/base/index.js +1 -33
  16. package/dist/esm/table-column/base/index.js.map +1 -1
  17. package/dist/esm/table-column/base/models/column-internals.d.ts +5 -1
  18. package/dist/esm/table-column/base/models/column-internals.js +7 -0
  19. package/dist/esm/table-column/base/models/column-internals.js.map +1 -1
  20. package/dist/esm/table-column/date-text/index.d.ts +8 -0
  21. package/dist/esm/table-column/duration-text/index.d.ts +8 -0
  22. package/dist/esm/table-column/mapping/index.d.ts +8 -0
  23. package/dist/esm/table-column/mapping/index.js +2 -1
  24. package/dist/esm/table-column/mapping/index.js.map +1 -1
  25. package/dist/esm/table-column/mixins/fractional-width-column.js +2 -12
  26. package/dist/esm/table-column/mixins/fractional-width-column.js.map +1 -1
  27. package/dist/esm/table-column/mixins/groupable-column.js +1 -7
  28. package/dist/esm/table-column/mixins/groupable-column.js.map +1 -1
  29. package/dist/esm/table-column/mixins/sortable-column.d.ts +17 -0
  30. package/dist/esm/table-column/mixins/sortable-column.js +52 -0
  31. package/dist/esm/table-column/mixins/sortable-column.js.map +1 -0
  32. package/dist/esm/table-column/number-text/index.d.ts +8 -0
  33. package/dist/esm/table-column/text/index.d.ts +8 -0
  34. package/dist/esm/table-column/text-base/index.d.ts +8 -0
  35. package/dist/esm/table-column/text-base/index.js +2 -1
  36. package/dist/esm/table-column/text-base/index.js.map +1 -1
  37. package/package.json +1 -1
@@ -16280,7 +16280,7 @@
16280
16280
 
16281
16281
  /**
16282
16282
  * Do not edit directly
16283
- * Generated on Tue, 11 Jun 2024 19:14:08 GMT
16283
+ * Generated on Thu, 13 Jun 2024 16:48:33 GMT
16284
16284
  */
16285
16285
 
16286
16286
  const Information100DarkUi = "#a46eff";
@@ -64556,6 +64556,10 @@ img.ProseMirror-separator {
64556
64556
  * the resolved value of the fractionalWidth after updates programmatic or interactive updates.
64557
64557
  */
64558
64558
  this.currentFractionalWidth = defaultFractionalWidth;
64559
+ /**
64560
+ * Whether or not this column can be sorted
64561
+ */
64562
+ this.sortingDisabled = false;
64559
64563
  /**
64560
64564
  * @internal Do not write to this value directly. It is used by the Table in order to store
64561
64565
  * the resolved value of the sortDirection after programmatic or interactive updates.
@@ -64614,6 +64618,9 @@ img.ProseMirror-separator {
64614
64618
  __decorate$1([
64615
64619
  observable
64616
64620
  ], ColumnInternals.prototype, "currentPixelWidth", void 0);
64621
+ __decorate$1([
64622
+ observable
64623
+ ], ColumnInternals.prototype, "sortingDisabled", void 0);
64617
64624
  __decorate$1([
64618
64625
  observable
64619
64626
  ], ColumnInternals.prototype, "currentSortIndex", void 0);
@@ -64642,8 +64649,6 @@ img.ProseMirror-separator {
64642
64649
  */
64643
64650
  this.columnInternals = new ColumnInternals(this.getColumnInternalsOptions());
64644
64651
  this.columnHidden = false;
64645
- this.sortDirection = TableColumnSortDirection.none;
64646
- this.sortingDisabled = false;
64647
64652
  /** @internal */
64648
64653
  this.hasOverflow = false;
64649
64654
  }
@@ -64665,26 +64670,6 @@ img.ProseMirror-separator {
64665
64670
  // Done here to enforce consistency across headers as they may have custom templates
64666
64671
  this.setAttribute('slot', this.columnInternals.uniqueId);
64667
64672
  }
64668
- sortDirectionChanged() {
64669
- if (!this.sortingDisabled) {
64670
- this.columnInternals.currentSortDirection = this.sortDirection;
64671
- }
64672
- }
64673
- sortIndexChanged() {
64674
- if (!this.sortingDisabled) {
64675
- this.columnInternals.currentSortIndex = this.sortIndex;
64676
- }
64677
- }
64678
- sortingDisabledChanged() {
64679
- if (this.sortingDisabled) {
64680
- this.columnInternals.currentSortDirection = TableColumnSortDirection.none;
64681
- this.columnInternals.currentSortIndex = undefined;
64682
- }
64683
- else {
64684
- this.columnInternals.currentSortDirection = this.sortDirection;
64685
- this.columnInternals.currentSortIndex = this.sortIndex;
64686
- }
64687
- }
64688
64673
  }
64689
64674
  __decorate$1([
64690
64675
  attr({ attribute: 'column-id' })
@@ -64698,15 +64683,6 @@ img.ProseMirror-separator {
64698
64683
  __decorate$1([
64699
64684
  attr({ attribute: 'column-hidden', mode: 'boolean' })
64700
64685
  ], TableColumn.prototype, "columnHidden", void 0);
64701
- __decorate$1([
64702
- attr({ attribute: 'sort-index', converter: nullableNumberConverter })
64703
- ], TableColumn.prototype, "sortIndex", void 0);
64704
- __decorate$1([
64705
- attr({ attribute: 'sort-direction' })
64706
- ], TableColumn.prototype, "sortDirection", void 0);
64707
- __decorate$1([
64708
- attr({ attribute: 'sorting-disabled', mode: 'boolean' })
64709
- ], TableColumn.prototype, "sortingDisabled", void 0);
64710
64686
  __decorate$1([
64711
64687
  observable
64712
64688
  ], TableColumn.prototype, "hasOverflow", void 0);
@@ -67284,8 +67260,7 @@ img.ProseMirror-separator {
67284
67260
  else if (isColumnInternalsProperty(changedColumnProperty, 'operandDataRecordFieldName', 'sortOperation')) {
67285
67261
  this.track('columnDefinition');
67286
67262
  }
67287
- else if (isColumnProperty(changedColumnProperty, 'sortingDisabled')
67288
- || isColumnInternalsProperty(changedColumnProperty, 'currentSortDirection', 'currentSortIndex')) {
67263
+ else if (isColumnInternalsProperty(changedColumnProperty, 'sortingDisabled', 'currentSortDirection', 'currentSortIndex')) {
67289
67264
  this.track('columnSort');
67290
67265
  }
67291
67266
  else if (isColumnProperty(changedColumnProperty, 'columnHidden')
@@ -68223,7 +68198,7 @@ img.ProseMirror-separator {
68223
68198
  * @internal
68224
68199
  */
68225
68200
  toggleColumnSort(column, allowMultiSort) {
68226
- if (column.sortingDisabled) {
68201
+ if (column.columnInternals.sortingDisabled) {
68227
68202
  return;
68228
68203
  }
68229
68204
  const allSortedColumns = this.getColumnsParticipatingInSorting().sort((x, y) => x.columnInternals.currentSortIndex
@@ -68407,7 +68382,7 @@ img.ProseMirror-separator {
68407
68382
  }
68408
68383
  }
68409
68384
  getColumnsParticipatingInSorting() {
68410
- return this.columns.filter(x => !x.sortingDisabled
68385
+ return this.columns.filter(x => !x.columnInternals.sortingDisabled
68411
68386
  && x.columnInternals.currentSortDirection
68412
68387
  !== TableColumnSortDirection.none
68413
68388
  && typeof x.columnInternals.currentSortIndex === 'number');
@@ -68782,20 +68757,10 @@ img.ProseMirror-separator {
68782
68757
  */
68783
68758
  class FractionalWidthColumn extends base {
68784
68759
  fractionalWidthChanged() {
68785
- if (typeof this.fractionalWidth === 'number') {
68786
- this.columnInternals.fractionalWidth = this.fractionalWidth;
68787
- }
68788
- else {
68789
- this.columnInternals.fractionalWidth = defaultFractionalWidth;
68790
- }
68760
+ this.columnInternals.fractionalWidth = this.fractionalWidth ?? defaultFractionalWidth;
68791
68761
  }
68792
68762
  minPixelWidthChanged() {
68793
- if (typeof this.minPixelWidth === 'number') {
68794
- this.columnInternals.minPixelWidth = this.minPixelWidth;
68795
- }
68796
- else {
68797
- this.columnInternals.minPixelWidth = defaultMinPixelWidth;
68798
- }
68763
+ this.columnInternals.minPixelWidth = this.minPixelWidth ?? defaultMinPixelWidth;
68799
68764
  }
68800
68765
  }
68801
68766
  attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(
@@ -68818,18 +68783,12 @@ img.ProseMirror-separator {
68818
68783
  constructor() {
68819
68784
  super(...arguments);
68820
68785
  this.groupingDisabled = false;
68821
- this.groupIndex = null;
68822
68786
  }
68823
68787
  groupingDisabledChanged() {
68824
68788
  this.columnInternals.groupingDisabled = this.groupingDisabled;
68825
68789
  }
68826
68790
  groupIndexChanged() {
68827
- if (typeof this.groupIndex === 'number') {
68828
- this.columnInternals.groupIndex = this.groupIndex;
68829
- }
68830
- else {
68831
- this.columnInternals.groupIndex = undefined;
68832
- }
68791
+ this.columnInternals.groupIndex = this.groupIndex ?? undefined;
68833
68792
  }
68834
68793
  }
68835
68794
  attr({ attribute: 'grouping-disabled', mode: 'boolean' })(
@@ -69088,10 +69047,60 @@ img.ProseMirror-separator {
69088
69047
  .register(tableColumnTextGroupHeaderView());
69089
69048
  const tableColumnTextGroupHeaderViewTag = 'nimble-table-column-text-group-header-view';
69090
69049
 
69050
+ // As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference
69051
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
69052
+ function mixinSortableColumnAPI(base) {
69053
+ /**
69054
+ * The Mixin that provides a concrete column with the API to allow sorting
69055
+ * by the values in that column.
69056
+ */
69057
+ class SortableColumn extends base {
69058
+ constructor() {
69059
+ super(...arguments);
69060
+ this.sortingDisabled = false;
69061
+ this.sortDirection = TableColumnSortDirection.none;
69062
+ }
69063
+ /** @internal */
69064
+ sortingDisabledChanged() {
69065
+ this.columnInternals.sortingDisabled = this.sortingDisabled;
69066
+ if (this.sortingDisabled) {
69067
+ this.columnInternals.currentSortDirection = TableColumnSortDirection.none;
69068
+ this.columnInternals.currentSortIndex = undefined;
69069
+ }
69070
+ else {
69071
+ this.columnInternals.currentSortDirection = this.sortDirection;
69072
+ this.columnInternals.currentSortIndex = this.sortIndex ?? undefined;
69073
+ }
69074
+ }
69075
+ /** @internal */
69076
+ sortDirectionChanged() {
69077
+ if (!this.sortingDisabled) {
69078
+ this.columnInternals.currentSortDirection = this.sortDirection;
69079
+ }
69080
+ }
69081
+ /** @internal */
69082
+ sortIndexChanged() {
69083
+ if (!this.sortingDisabled) {
69084
+ this.columnInternals.currentSortIndex = this.sortIndex ?? undefined;
69085
+ }
69086
+ }
69087
+ }
69088
+ attr({ attribute: 'sorting-disabled', mode: 'boolean' })(
69089
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
69090
+ SortableColumn.prototype, 'sortingDisabled');
69091
+ attr({ attribute: 'sort-index', converter: nullableNumberConverter })(
69092
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
69093
+ SortableColumn.prototype, 'sortIndex');
69094
+ attr({ attribute: 'sort-direction' })(
69095
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
69096
+ SortableColumn.prototype, 'sortDirection');
69097
+ return SortableColumn;
69098
+ }
69099
+
69091
69100
  /**
69092
69101
  * A table column for displaying links.
69093
69102
  */
69094
- class TableColumnAnchor extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinColumnWithPlaceholderAPI((TableColumn)))) {
69103
+ class TableColumnAnchor extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinColumnWithPlaceholderAPI(mixinSortableColumnAPI((TableColumn))))) {
69095
69104
  constructor() {
69096
69105
  super(...arguments);
69097
69106
  this.underlineHidden = false;
@@ -69220,7 +69229,7 @@ img.ProseMirror-separator {
69220
69229
  ], TableColumnTextBase.prototype, "fieldName", void 0);
69221
69230
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-explicit-any
69222
69231
  function mixinTextBase(base) {
69223
- return mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinColumnWithPlaceholderAPI(base)));
69232
+ return mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinColumnWithPlaceholderAPI(mixinSortableColumnAPI(base))));
69224
69233
  }
69225
69234
 
69226
69235
  function formatNumericDate(formatter, date) {
@@ -70335,7 +70344,7 @@ img.ProseMirror-separator {
70335
70344
  * Table column that maps number, boolean, or string values to an icon, a spinner,
70336
70345
  * text, or an icon/spinner with text.
70337
70346
  */
70338
- class TableColumnMapping extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI((TableColumnEnumBase))) {
70347
+ class TableColumnMapping extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinSortableColumnAPI((TableColumnEnumBase)))) {
70339
70348
  minPixelWidthChanged() {
70340
70349
  if (this.widthMode !== TableColumnMappingWidthMode.iconSize) {
70341
70350
  this.columnInternals.minPixelWidth = this.getConfiguredMinPixelWidth();