@ni/nimble-components 20.6.0 → 20.6.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.
@@ -9841,10 +9841,11 @@ this.visibleColumns[e].columnInternals.currentPixelWidth+=r,r>n&&e>0&&t<0&&(n-=o
9841
9841
  const i=this.initialColumnWidths[e],o=t>0?Math.min(i.initialPixelWidth-i.minPixelWidth,n):t,r=o
9842
9842
  this.visibleColumns[e].columnInternals.currentPixelWidth-=r,r<n&&e<this.visibleColumns.length-1&&t>0&&(n-=o,this.performCascadeSizeRight(e+1,n))}cacheGridSizedColumns(){this.gridSizedColumns=[]
9843
9843
  for(const e of this.visibleColumns)void 0===e.columnInternals.currentPixelWidth&&this.gridSizedColumns.push(e)}cacheColumnInitialPixelWidths(){this.initialColumnWidths=[]
9844
- for(const e of this.visibleColumns)this.initialColumnWidths.push({initalColumnFractionalWidth:e.columnInternals.currentFractionalWidth,initialPixelWidth:e.columnInternals.currentPixelWidth,minPixelWidth:e.columnInternals.minPixelWidth})}resetGridSizedColumns(){if(!this.gridSizedColumns)return
9845
- let e=0
9846
- for(let t=0;t<this.visibleColumns.length&&e<this.gridSizedColumns.length;t++){const n=this.visibleColumns[t]
9847
- n===this.gridSizedColumns[e]&&(e+=1,n.columnInternals.currentFractionalWidth=n.columnInternals.currentPixelWidth/this.initialColumnWidths[t].initialPixelWidth*this.initialColumnWidths[t].initalColumnFractionalWidth,n.columnInternals.currentPixelWidth=void 0)}}getVisibleColumns(){return this.table.columns.filter((e=>!e.columnHidden))}getLeftColumnIndexFromDivider(e){return Math.floor(e/2)}}e([m],lN.prototype,"isColumnBeingSized",void 0),e([m],lN.prototype,"activeColumnIndex",void 0)
9844
+ for(const e of this.visibleColumns)this.initialColumnWidths.push({initalColumnFractionalWidth:e.columnInternals.currentFractionalWidth,initialPixelWidth:e.columnInternals.currentPixelWidth,minPixelWidth:e.columnInternals.minPixelWidth})}resetGridSizedColumns(){if(!this.gridSizedColumns||0===this.gridSizedColumns.length)return
9845
+ const e=this.gridSizedColumns.reduce(((e,t)=>e+t.columnInternals.currentPixelWidth),0),t=e/this.gridSizedColumns.length
9846
+ let n=0
9847
+ for(let e=0;e<this.visibleColumns.length&&n<this.gridSizedColumns.length;e++){const i=this.visibleColumns[e]
9848
+ i===this.gridSizedColumns[n]&&(n+=1,i.columnInternals.currentFractionalWidth=i.columnInternals.currentPixelWidth/t,i.columnInternals.currentPixelWidth=void 0)}}getVisibleColumns(){return this.table.columns.filter((e=>!e.columnHidden))}getLeftColumnIndexFromDivider(e){return Math.floor(e/2)}}e([m],lN.prototype,"isColumnBeingSized",void 0),e([m],lN.prototype,"activeColumnIndex",void 0)
9848
9849
  class cN{constructor(e){this.trackedItems={},this.trackedItems=e.reduce(((e,t)=>({...e,[t]:!1})),this.trackedItems)}getTrackedItems(){return{...this.trackedItems}}isTracked(e){return this.trackedItems[e]}track(e){this.trackedItems[e]=!0}untrack(e){this.trackedItems[e]=!1}trackAll(){this.setAllKeys(!0)}untrackAll(){this.setAllKeys(!1)}allTracked(){return Object.values(this.trackedItems).every((e=>e))}anyTracked(){return Object.values(this.trackedItems).some((e=>e))}noneTracked(){return Object.values(this.trackedItems).every((e=>!e))}setAllKeys(e){this.trackedItems=Object.keys(this.trackedItems).reduce(((t,n)=>({...t,[n]:e})),this.trackedItems)}}class dN extends cN{}const hN=(e,...t)=>{for(const n of t)if(e===n)return!0
9849
9850
  return!1},uN=["rowIds","groupRows","columnIds","columnSort","columnWidths","columnDefinition","actionMenuSlots","selectionMode"]
9850
9851
  class pN extends dN{constructor(e){super(uN),this.table=e,this.updateQueued=!1}get updateRowIds(){return this.isTracked("rowIds")}get updateGroupRows(){return this.isTracked("groupRows")}get updateColumnIds(){return this.isTracked("columnIds")}get updateColumnSort(){return this.isTracked("columnSort")}get updateColumnWidths(){return this.isTracked("columnWidths")}get updateColumnDefinition(){return this.isTracked("columnDefinition")}get updateActionMenuSlots(){return this.isTracked("actionMenuSlots")}get updateSelectionMode(){return this.isTracked("selectionMode")}get requiresTanStackUpdate(){return this.isTracked("rowIds")||this.isTracked("columnSort")||this.isTracked("columnDefinition")||this.isTracked("groupRows")||this.isTracked("selectionMode")}get requiresTanStackDataReset(){return this.isTracked("rowIds")||this.isTracked("columnDefinition")}trackAllStateChanged(){this.trackAll(),this.queueUpdate()}get hasPendingUpdates(){return this.updateQueued}trackColumnPropertyChanged(e){hN(e,"columnId")?this.track("columnIds"):kF(e,"operandDataRecordFieldName","sortOperation")?this.track("columnDefinition"):hN(e,"sortingDisabled")||kF(e,"currentSortDirection","currentSortIndex")?this.track("columnSort"):hN(e,"columnHidden")||kF(e,"currentFractionalWidth","currentPixelWidth","minPixelWidth")?this.track("columnWidths"):hN(e,"actionMenuSlot")?this.track("actionMenuSlots"):kF(e,"groupIndex","groupingDisabled")&&this.track("groupRows"),this.queueUpdate()}trackColumnInstancesChanged(){this.track("columnIds"),this.track("columnDefinition"),this.track("columnSort"),this.track("columnWidths"),this.track("actionMenuSlots"),this.track("groupRows"),this.queueUpdate()}trackIdFieldNameChanged(){this.track("rowIds"),this.queueUpdate()}trackSelectionModeChanged(){this.track("selectionMode"),this.queueUpdate()}queueUpdate(){this.table.$fastController.isConnected&&(this.updateQueued||(this.updateQueued=!0,u.queueUpdate((()=>{this.table.update(),this.untrackAll(),this.updateQueued=!1}))))}}class fN{constructor(e){this.tanStackTable=e}reset(){}toggleIsRowSelected(e,t){e.isGrouped&&e.selectionState===pF?this.deselectAllLeafRows(e.id):this.tanStackTable.getRow(e.id).toggleSelected(t)}selectSingleRow(e){if(e.isGrouped)throw new Error("function not intended to select grouped rows")