@ni/nimble-components 29.8.0 → 29.8.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.
Files changed (33) hide show
  1. package/dist/all-components-bundle.js +40 -18
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +215 -206
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/table/components/header/index.d.ts +2 -1
  6. package/dist/esm/table/components/header/index.js +5 -1
  7. package/dist/esm/table/components/header/index.js.map +1 -1
  8. package/dist/esm/table/components/header/styles.js +10 -3
  9. package/dist/esm/table/components/header/styles.js.map +1 -1
  10. package/dist/esm/table/components/header/template.js +2 -1
  11. package/dist/esm/table/components/header/template.js.map +1 -1
  12. package/dist/esm/table/template.js +1 -0
  13. package/dist/esm/table/template.js.map +1 -1
  14. package/dist/esm/table/types.d.ts +11 -0
  15. package/dist/esm/table/types.js +9 -0
  16. package/dist/esm/table/types.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 +8 -1
  19. package/dist/esm/table-column/base/models/column-internals.js.map +1 -1
  20. package/dist/esm/table-column/number-text/cell-view/index.js +2 -2
  21. package/dist/esm/table-column/number-text/cell-view/index.js.map +1 -1
  22. package/dist/esm/table-column/number-text/index.d.ts +2 -3
  23. package/dist/esm/table-column/number-text/index.js +6 -5
  24. package/dist/esm/table-column/number-text/index.js.map +1 -1
  25. package/dist/esm/table-column/text-base/cell-view/index.d.ts +2 -3
  26. package/dist/esm/table-column/text-base/cell-view/index.js +2 -2
  27. package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
  28. package/dist/esm/table-column/text-base/cell-view/template.js +2 -2
  29. package/dist/esm/table-column/text-base/cell-view/template.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/esm/table-column/text-base/cell-view/types.d.ts +0 -8
  32. package/dist/esm/table-column/text-base/cell-view/types.js +0 -8
  33. package/dist/esm/table-column/text-base/cell-view/types.js.map +0 -1
@@ -16333,7 +16333,7 @@
16333
16333
 
16334
16334
  /**
16335
16335
  * Do not edit directly
16336
- * Generated on Wed, 10 Jul 2024 16:10:17 GMT
16336
+ * Generated on Thu, 11 Jul 2024 17:27:02 GMT
16337
16337
  */
16338
16338
 
16339
16339
  const Information100DarkUi = "#a46eff";
@@ -64560,6 +64560,15 @@ img.ProseMirror-separator {
64560
64560
  selected: 'selected',
64561
64561
  partiallySelected: 'partially-selected'
64562
64562
  };
64563
+ /**
64564
+ * @internal
64565
+ *
64566
+ * Alignment of column content
64567
+ */
64568
+ const TableColumnAlignment = {
64569
+ left: 'left',
64570
+ right: 'right'
64571
+ };
64563
64572
  /**
64564
64573
  * Table keyboard focus types
64565
64574
  */
@@ -64786,6 +64795,10 @@ img.ProseMirror-separator {
64786
64795
  * when the column is grouped or sorted.
64787
64796
  */
64788
64797
  this.hideHeaderIndicators = false;
64798
+ /**
64799
+ * How to align the header content.
64800
+ */
64801
+ this.headerAlignment = TableColumnAlignment.left;
64789
64802
  /**
64790
64803
  * @internal Do not write to this value directly. It is used by the Table in order to store
64791
64804
  * the resolved value of the fractionalWidth after updates programmatic or interactive updates.
@@ -64850,6 +64863,9 @@ img.ProseMirror-separator {
64850
64863
  __decorate$1([
64851
64864
  observable
64852
64865
  ], ColumnInternals.prototype, "hideHeaderIndicators", void 0);
64866
+ __decorate$1([
64867
+ observable
64868
+ ], ColumnInternals.prototype, "headerAlignment", void 0);
64853
64869
  __decorate$1([
64854
64870
  observable
64855
64871
  ], ColumnInternals.prototype, "currentFractionalWidth", void 0);
@@ -65262,15 +65278,22 @@ focus outline in that case.
65262
65278
  :host {
65263
65279
  height: ${controlHeight};
65264
65280
  align-items: center;
65265
- padding: 0px ${mediumPadding};
65281
+ padding-left: ${mediumPadding};
65282
+ padding-right: ${smallPadding};
65266
65283
  font: ${tableHeaderFont};
65267
65284
  color: ${tableHeaderFontColor};
65268
65285
  ${iconColor.cssCustomProperty}: ${tableHeaderFontColor};
65269
65286
  text-transform: uppercase;
65270
- gap: ${mediumPadding};
65287
+ gap: ${smallPadding};
65271
65288
  cursor: default;
65272
65289
  }
65273
65290
 
65291
+ :host(.right-align) {
65292
+ flex-direction: row-reverse;
65293
+ padding-left: ${smallPadding};
65294
+ padding-right: ${mediumPadding};
65295
+ }
65296
+
65274
65297
  :host(${focusVisible}) {
65275
65298
  outline: calc(2 * ${borderWidth}) solid ${borderHoverColor};
65276
65299
  outline-offset: calc(-2 * ${borderWidth});
@@ -65285,6 +65308,7 @@ focus outline in that case.
65285
65308
  // prettier-ignore
65286
65309
  const template$k = html `
65287
65310
  <template role="columnheader"
65311
+ class="${x => (x.alignment === TableColumnAlignment.right ? 'right-align' : '')}"
65288
65312
  aria-sort="${x => x.ariaSort}"
65289
65313
  ${'' /* Prevent header double clicks from selecting text */}
65290
65314
  @mousedown="${(_x, c) => !(c.event.detail > 1)}"
@@ -65329,6 +65353,7 @@ focus outline in that case.
65329
65353
  this.sortDirection = TableColumnSortDirection.none;
65330
65354
  this.firstSortedColumn = false;
65331
65355
  this.indicatorsHidden = false;
65356
+ this.alignment = TableColumnAlignment.left;
65332
65357
  this.isGrouped = false;
65333
65358
  }
65334
65359
  sortDirectionChanged(_prev, _next) {
@@ -65359,6 +65384,9 @@ focus outline in that case.
65359
65384
  __decorate$1([
65360
65385
  attr({ attribute: 'indicators-hidden', mode: 'boolean' })
65361
65386
  ], TableHeader.prototype, "indicatorsHidden", void 0);
65387
+ __decorate$1([
65388
+ observable
65389
+ ], TableHeader.prototype, "alignment", void 0);
65362
65390
  __decorate$1([
65363
65391
  observable
65364
65392
  ], TableHeader.prototype, "isGrouped", void 0);
@@ -66432,6 +66460,7 @@ focus outline in that case.
66432
66460
  ?indicators-hidden="${x => x.columnInternals.hideHeaderIndicators}"
66433
66461
  @keydown="${(x, c) => c.parent.onHeaderKeyDown(x, c.event)}"
66434
66462
  @click="${(x, c) => c.parent.toggleColumnSort(x, c.event.shiftKey)}"
66463
+ :alignment="${x => x.columnInternals.headerAlignment}"
66435
66464
  :isGrouped=${x => (typeof x.columnInternals.groupIndex === 'number' && !x.columnInternals.groupingDisabled)}
66436
66465
  >
66437
66466
  <slot name="${x => x.slot}"></slot>
@@ -70903,19 +70932,11 @@ focus outline in that case.
70903
70932
  .register(tableColumnDateTextGroupHeaderView());
70904
70933
  const tableColumnDateTextGroupHeaderViewTag = 'nimble-table-column-date-text-group-header-view';
70905
70934
 
70906
- /**
70907
- * The aligment of the value in a TableColumnTextCellViewBase instance.
70908
- */
70909
- const TextCellViewBaseAlignment = {
70910
- left: 'left',
70911
- right: 'right'
70912
- };
70913
-
70914
70935
  // prettier-ignore
70915
70936
  const template$c = html `
70916
70937
  <template
70917
70938
  class="
70918
- ${x => (x.alignment === TextCellViewBaseAlignment.right ? 'right-align' : '')}
70939
+ ${x => (x.alignment === TableColumnAlignment.right ? 'right-align' : '')}
70919
70940
  ${x => (x.isPlaceholder ? 'placeholder' : '')}
70920
70941
  "
70921
70942
  >
@@ -70968,7 +70989,7 @@ focus outline in that case.
70968
70989
  /**
70969
70990
  * The alignment of the text within the cell.
70970
70991
  */
70971
- this.alignment = TextCellViewBaseAlignment.left;
70992
+ this.alignment = TableColumnAlignment.left;
70972
70993
  /**
70973
70994
  * Whether or not the text being displayed in the cell view is a placeholder.
70974
70995
  */
@@ -72256,7 +72277,7 @@ focus outline in that case.
72256
72277
  class TableColumnNumberTextCellView extends TableColumnTextCellViewBase {
72257
72278
  columnConfigChanged() {
72258
72279
  super.columnConfigChanged();
72259
- this.alignment = this.columnConfig?.alignment ?? TextCellViewBaseAlignment.left;
72280
+ this.alignment = this.columnConfig?.alignment ?? TableColumnAlignment.left;
72260
72281
  }
72261
72282
  updateText() {
72262
72283
  this.text = this.columnConfig?.formatter?.format(this.cellRecord?.value) ?? '';
@@ -72749,6 +72770,7 @@ focus outline in that case.
72749
72770
  alignment: this.determineCellContentAlignment(),
72750
72771
  placeholder: this.placeholder
72751
72772
  };
72773
+ this.columnInternals.headerAlignment = columnConfig.alignment;
72752
72774
  this.columnInternals.columnConfig = columnConfig;
72753
72775
  }
72754
72776
  else {
@@ -72768,18 +72790,18 @@ focus outline in that case.
72768
72790
  }
72769
72791
  determineCellContentAlignment() {
72770
72792
  if (this.alignment === NumberTextAlignment.left) {
72771
- return TextCellViewBaseAlignment.left;
72793
+ return TableColumnAlignment.left;
72772
72794
  }
72773
72795
  if (this.alignment === NumberTextAlignment.right) {
72774
- return TextCellViewBaseAlignment.right;
72796
+ return TableColumnAlignment.right;
72775
72797
  }
72776
72798
  // Look at format and decimal max digits and unit to determine the default alignment
72777
72799
  if (this.format === NumberTextFormat.decimal
72778
72800
  && typeof this.decimalMaximumDigits !== 'number'
72779
72801
  && !this.unit) {
72780
- return TextCellViewBaseAlignment.right;
72802
+ return TableColumnAlignment.right;
72781
72803
  }
72782
- return TextCellViewBaseAlignment.left;
72804
+ return TableColumnAlignment.left;
72783
72805
  }
72784
72806
  }
72785
72807
  __decorate$1([