@ni/spright-components 4.0.2 → 4.0.3

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.
@@ -66029,7 +66029,7 @@ focus outline in that case.
66029
66029
  position: absolute;
66030
66030
  }
66031
66031
 
66032
- :host([selectable]:not([selected]):hover)::before {
66032
+ :host([selectable]:not([selected])[allow-hover]:hover)::before {
66033
66033
  background-color: ${fillHoverColor};
66034
66034
  }
66035
66035
 
@@ -66037,7 +66037,7 @@ focus outline in that case.
66037
66037
  background-color: ${fillSelectedColor};
66038
66038
  }
66039
66039
 
66040
- :host([selected]:hover)::before {
66040
+ :host([selected][allow-hover]:hover)::before {
66041
66041
  background-color: ${fillHoverSelectedColor};
66042
66042
  }
66043
66043
 
@@ -66152,7 +66152,7 @@ focus outline in that case.
66152
66152
  height: ${controlHeight};
66153
66153
  }
66154
66154
 
66155
- :host(:hover) nimble-table-cell {
66155
+ :host([allow-hover]:hover) nimble-table-cell {
66156
66156
  --ni-private-table-cell-action-menu-display: block;
66157
66157
  }
66158
66158
 
@@ -66164,7 +66164,7 @@ focus outline in that case.
66164
66164
  --ni-private-table-cell-action-menu-display: block;
66165
66165
  }
66166
66166
  `.withBehaviors(themeBehavior(Theme.color, css `
66167
- :host([selectable]:not([selected]):hover)::before {
66167
+ :host([selectable]:not([selected])[allow-hover]:hover)::before {
66168
66168
  background-color: ${hexToRgbaCssColor(White, 0.05)};
66169
66169
  }
66170
66170
 
@@ -66172,7 +66172,7 @@ focus outline in that case.
66172
66172
  background-color: ${hexToRgbaCssColor(White, 0.25)};
66173
66173
  }
66174
66174
 
66175
- :host([selected]:hover)::before {
66175
+ :host([selected][allow-hover]:hover)::before {
66176
66176
  background-color: ${hexToRgbaCssColor(White, 0.2)};
66177
66177
  }
66178
66178
  `));
@@ -66456,6 +66456,10 @@ focus outline in that case.
66456
66456
  * @internal
66457
66457
  */
66458
66458
  this.animationClass = '';
66459
+ /**
66460
+ * @internal
66461
+ */
66462
+ this.allowHover = false;
66459
66463
  // Programmatically updating the selection state of a checkbox fires the 'change' event.
66460
66464
  // Therefore, selection change events that occur due to programmatically updating
66461
66465
  // the selection checkbox 'checked' value should be ingored.
@@ -66696,6 +66700,9 @@ focus outline in that case.
66696
66700
  __decorate$1([
66697
66701
  observable
66698
66702
  ], TableRow.prototype, "animationClass", void 0);
66703
+ __decorate$1([
66704
+ attr({ attribute: 'allow-hover', mode: 'boolean' })
66705
+ ], TableRow.prototype, "allowHover", void 0);
66699
66706
  __decorate$1([
66700
66707
  volatile
66701
66708
  ], TableRow.prototype, "isTopLevelParentRow", null);
@@ -66751,7 +66758,7 @@ focus outline in that case.
66751
66758
  position: absolute;
66752
66759
  }
66753
66760
 
66754
- :host(:hover)::before {
66761
+ :host([allow-hover]:hover)::before {
66755
66762
  background-color: ${fillHoverColor};
66756
66763
  }
66757
66764
 
@@ -66797,11 +66804,11 @@ focus outline in that case.
66797
66804
  padding-left: 0px;
66798
66805
  }
66799
66806
  `.withBehaviors(themeBehavior(Theme.color, css `
66800
- :host(:hover)::before {
66807
+ :host([allow-hover]:hover)::before {
66801
66808
  background-color: ${hexToRgbaCssColor(White, 0.05)};
66802
66809
  }
66803
66810
  `), themeBehavior(Theme.dark, css `
66804
- :host(:hover)::before {
66811
+ :host([allow-hover]:hover)::before {
66805
66812
  background-color: ${hexToRgbaCssColor(White, 0.1)};
66806
66813
  }
66807
66814
  `));
@@ -66865,6 +66872,10 @@ focus outline in that case.
66865
66872
  * @internal
66866
66873
  */
66867
66874
  this.animationClass = '';
66875
+ /**
66876
+ * @internal
66877
+ */
66878
+ this.allowHover = false;
66868
66879
  // Programmatically updating the selection state of a checkbox fires the 'change' event.
66869
66880
  // Therefore, selection change events that occur due to programmatically updating
66870
66881
  // the selection checkbox 'checked' value should be ingored.
@@ -66957,6 +66968,9 @@ focus outline in that case.
66957
66968
  __decorate$1([
66958
66969
  observable
66959
66970
  ], TableGroupRow.prototype, "animationClass", void 0);
66971
+ __decorate$1([
66972
+ attr({ attribute: 'allow-hover', mode: 'boolean' })
66973
+ ], TableGroupRow.prototype, "allowHover", void 0);
66960
66974
  const nimbleTableGroupRow = TableGroupRow.compose({
66961
66975
  baseName: 'table-group-row',
66962
66976
  template: template$i,
@@ -67089,6 +67103,7 @@ focus outline in that case.
67089
67103
  ?selectable="${(_, c) => c.parent.selectionMode === TableRowSelectionMode.multiple}"
67090
67104
  selection-state="${(x, c) => c.parent.tableData[x.index]?.selectionState}"
67091
67105
  :resolvedRowIndex="${x => x.index}"
67106
+ ?allow-hover="${(_, c) => !c.parent.virtualizer.isScrolling}"
67092
67107
  @focusin="${(_, c) => c.parent.onRowFocusIn(c.event)}"
67093
67108
  @blur="${(_, c) => c.parent.onRowBlur(c.event)}"
67094
67109
  @group-selection-toggle="${(x, c) => c.parent.onRowSelectionToggle(x.index, c.event)}"
@@ -67114,6 +67129,7 @@ focus outline in that case.
67114
67129
  ?row-operation-grid-cell-hidden="${(_, c) => !c.parent.showRowOperationColumn}"
67115
67130
  ?loading="${(x, c) => c.parent.tableData[x.index]?.isLoadingChildren}"
67116
67131
  :resolvedRowIndex="${x => x.index}"
67132
+ ?allow-hover="${(_, c) => !c.parent.virtualizer.isScrolling}"
67117
67133
  @click="${(x, c) => c.parent.onRowClick(x.index, c.event)}"
67118
67134
  @focusin="${(_, c) => c.parent.onRowFocusIn(c.event)}"
67119
67135
  @blur="${(_, c) => c.parent.onRowBlur(c.event)}"
@@ -67872,9 +67888,11 @@ focus outline in that case.
67872
67888
  constructor(table, tanStackTable) {
67873
67889
  this.visibleItems = [];
67874
67890
  this.scrollHeight = 0;
67891
+ this.isScrolling = false;
67875
67892
  this.headerContainerMarginRight = 0;
67876
67893
  this.rowContainerYOffset = 0;
67877
67894
  this._pageSize = 0;
67895
+ this.isScrollingTimer = 0;
67878
67896
  this.table = table;
67879
67897
  this.tanStackTable = tanStackTable;
67880
67898
  this.viewportResizeObserver = new ResizeObserver(entries => {
@@ -67928,7 +67946,7 @@ focus outline in that case.
67928
67946
  estimateSize: (_) => rowHeight,
67929
67947
  enableSmoothScroll: true,
67930
67948
  overscan: 3,
67931
- scrollingDelay: 5,
67949
+ isScrollingResetDelay: 250,
67932
67950
  scrollToFn: elementScroll,
67933
67951
  observeElementOffset,
67934
67952
  observeElementRect,
@@ -67939,6 +67957,16 @@ focus outline in that case.
67939
67957
  const virtualizer = this.virtualizer;
67940
67958
  this.visibleItems = virtualizer.getVirtualItems();
67941
67959
  this.scrollHeight = virtualizer.getTotalSize();
67960
+ this.isScrolling = virtualizer.isScrolling;
67961
+ // There are multiple browser bugs that can result in us getting stuck thinking that we're scrolling.
67962
+ // As a workaround, we assume scrolling stopped if we haven't received an update in 300ms.
67963
+ // Tech debt item to remove this workaround: https://github.com/ni/nimble/issues/2382
67964
+ window.clearTimeout(this.isScrollingTimer);
67965
+ if (this.isScrolling) {
67966
+ this.isScrollingTimer = window.setTimeout(() => {
67967
+ this.isScrolling = false;
67968
+ }, 300);
67969
+ }
67942
67970
  // We're using a separate div ('table-scroll') to represent the full height of all rows, and
67943
67971
  // the row container's height is only big enough to hold the virtualized rows. So we don't
67944
67972
  // use the TanStackVirtual-provided 'start' offset (which is in terms of the full height)
@@ -67960,6 +67988,9 @@ focus outline in that case.
67960
67988
  __decorate$1([
67961
67989
  observable
67962
67990
  ], Virtualizer.prototype, "scrollHeight", void 0);
67991
+ __decorate$1([
67992
+ observable
67993
+ ], Virtualizer.prototype, "isScrolling", void 0);
67963
67994
  __decorate$1([
67964
67995
  observable
67965
67996
  ], Virtualizer.prototype, "headerContainerMarginRight", void 0);