@ni/spright-components 2.0.9 → 2.0.11

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.
@@ -9114,7 +9114,8 @@ const qT=Mt`
9114
9114
  }
9115
9115
 
9116
9116
  .filter-icon {
9117
- padding-left: ${Sl};
9117
+ flex-shrink: 0;
9118
+ margin-left: ${Sl};
9118
9119
  ${ul.cssCustomProperty}: ${Rc};
9119
9120
  }
9120
9121
 
@@ -10255,13 +10256,15 @@ return o.columns=r.columns?e(r.columns,o,i+1):[],o}))}
10255
10256
  return e(t)}),vO(t,"debugColumns")),getAllFlatColumns:gO((()=>[s.getAllColumns()]),(t=>t.flatMap((t=>t.getFlatColumns()))),vO(t,"debugColumns")),_getAllFlatColumnsById:gO((()=>[s.getAllFlatColumns()]),(t=>t.reduce(((t,e)=>(t[e.id]=e,t)),{})),vO(t,"debugColumns")),getAllLeafColumns:gO((()=>[s.getAllColumns(),s._getOrderColumnsFn()]),((t,e)=>e(t.flatMap((t=>t.getLeafColumns())))),vO(t,"debugColumns")),getColumn:t=>s._getAllFlatColumnsById()[t]}
10256
10257
  Object.assign(s,c)
10257
10258
  for(let t=0;t<s._features.length;t++){const e=s._features[t]
10258
- null==e||null==e.createTable||e.createTable(s)}return s}function hR(){return t=>gO((()=>[t.getState().grouping,t.getPreGroupedRowModel()]),((e,n)=>{if(!n.rows.length||!e.length)return n
10259
+ null==e||null==e.createTable||e.createTable(s)}return s}function hR(){return t=>gO((()=>[t.getState().grouping,t.getPreGroupedRowModel()]),((e,n)=>{if(!n.rows.length||!e.length)return n.rows.forEach((t=>{t.depth=0,t.parentId=void 0})),n
10259
10260
  const i=e.filter((e=>t.getColumn(e))),s=[],o={},r=function(e,n,a){if(void 0===n&&(n=0),n>=i.length)return e.map((t=>(t.depth=n,s.push(t),o[t.id]=t,t.subRows&&(t.subRows=r(t.subRows,n+1,t.id)),t)))
10260
10261
  const l=i[n],c=function(t,e){const n=new Map
10261
10262
  return t.reduce(((t,n)=>{const i=`${n.getGroupingValue(e)}`,s=t.get(i)
10262
10263
  return s?s.push(n):t.set(i,[n]),t}),n)}(e,l),d=Array.from(c.entries()).map(((e,c)=>{let[d,h]=e,u=`${l}:${d}`
10263
10264
  u=a?`${a}>${u}`:u
10264
- const p=r(h,n+1,u),f=n?mO(h,(t=>t.subRows)):h,m=CO(t,u,f[0].original,c,n,0,a)
10265
+ const p=r(h,n+1,u)
10266
+ p.forEach((t=>{t.parentId=u}))
10267
+ const f=n?mO(h,(t=>t.subRows)):h,m=CO(t,u,f[0].original,c,n,0,a)
10265
10268
  return Object.assign(m,{groupingColumnId:l,groupingValue:d,subRows:p,leafRows:f,getValue:e=>{if(i.includes(e)){if(m._valuesCache.hasOwnProperty(e))return m._valuesCache[e]
10266
10269
  var n
10267
10270
  if(h[0])m._valuesCache[e]=null!=(n=h[0].getValue(e))?n:void 0
@@ -11655,7 +11658,7 @@ const n=x.getNotifier(t.columnInternals)
11655
11658
  n.subscribe(this),this.columnNotifiers.push(n)
11656
11659
  const i=x.getNotifier(t.columnInternals.validator)
11657
11660
  i.subscribe(this),this.columnNotifiers.push(i)}}getColumnsParticipatingInSorting(){return this.columns.filter((t=>!t.columnInternals.sortingDisabled&&t.columnInternals.currentSortDirection!==mR.none&&"number"==typeof t.columnInternals.currentSortIndex))}getColumnsParticipatingInGrouping(){return this.columns.filter((t=>!t.columnInternals.groupingDisabled&&"number"==typeof t.columnInternals.groupIndex))}childItemsChanged(){this.updateColumnsFromChildItems()}async updateColumnsFromChildItems(){await BE(this.childItems),this.columns=this.childItems.filter((t=>t instanceof HR))}updateTanStack(){const t={state:{}}
11658
- if(this.tableUpdateTracker.updateColumnSort&&(t.state.sorting=this.calculateTanStackSortState()),this.tableUpdateTracker.updateColumnDefinition&&(t.columns=this.calculateTanStackColumns()),this.tableUpdateTracker.updateRowIds&&(t.getRowId=this.calculateTanStackRowIdFunction(),t.state.rowSelection={},this.selectionManager.handleSelectionReset(),this.expansionManager.resetHierarchyOptions()),this.tableUpdateTracker.updateRowParentIds&&this.expansionManager.setHierarchyEnabled(this.isHierarchyEnabled()),this.tableUpdateTracker.updateSelectionMode&&(t.enableMultiRowSelection=this.selectionMode===gR.multiple,t.enableSubRowSelection=this.selectionMode===gR.multiple,t.state.rowSelection={},this.selectionManager.handleSelectionModeChanged(this.selectionMode)),this.dataHierarchyManager&&this.tableUpdateTracker.requiresTanStackDataReset)if(this.parentIdFieldName||this.tableUpdateTracker.updateRowParentIds){const e=this.dataHierarchyManager.getAllRecords(!0),n=this.calculateTanStackData(e)
11661
+ if(this.tableUpdateTracker.updateColumnSort&&(t.state.sorting=this.calculateTanStackSortState()),this.tableUpdateTracker.updateColumnDefinition&&(t.columns=this.calculateTanStackColumns()),this.tableUpdateTracker.updateRowIds&&(t.getRowId=this.calculateTanStackRowIdFunction(),t.state.rowSelection={},this.selectionManager.handleSelectionReset(),this.expansionManager.resetHierarchyOptions()),this.tableUpdateTracker.updateRowParentIds&&this.expansionManager.setHierarchyEnabled(this.isHierarchyEnabled()),this.tableUpdateTracker.updateSelectionMode&&(t.enableMultiRowSelection=this.selectionMode===gR.multiple,t.enableSubRowSelection=this.selectionMode===gR.multiple,t.state.rowSelection={},this.selectionManager.handleSelectionModeChanged(this.selectionMode)),this.dataHierarchyManager&&this.tableUpdateTracker.requiresTanStackDataReset)if(this.isHierarchyEnabled()||this.tableUpdateTracker.updateRowParentIds){const e=this.dataHierarchyManager.getAllRecords(!0),n=this.calculateTanStackData(e)
11659
11662
  n.state&&(t.state.rowSelection=n.state.rowSelection),t.data=n.data}else t.data=[...this.table.options.data]
11660
11663
  this.tableUpdateTracker.updateGroupRows&&(t.state.grouping=this.calculateTanStackGroupingState()),(this.tableUpdateTracker.updateRowIds||this.tableUpdateTracker.updateRowParentIds||this.tableUpdateTracker.updateGroupRows)&&(t.state.expanded=!0,this.expansionManager.resetExpansionState()),this.updateTableOptions(t)}updateActionMenuSlots(){if(void 0!==this.openActionMenuRecordId)for(const t of this.actionMenuSlots)this.requestedSlots.delete(t)
11661
11664
  const t=new Set
@@ -11665,8 +11668,8 @@ this.$emit("column-configuration-change",t)}async emitSelectionChangeEvent(){con
11665
11668
  this.$emit("selection-change",t)}selectionStateChanged(){this.setSelectionCheckboxState()}selectionCheckboxChanged(){this.setSelectionCheckboxState()}setSelectionCheckboxState(){this.selectionCheckbox&&(this.ignoreSelectionChangeEvents=!0,this.selectionCheckbox.checked=this.selectionState===bR,this.selectionCheckbox.indeterminate=this.selectionState===yR,this.ignoreSelectionChangeEvents=!1)}isHierarchyEnabled(){return"string"==typeof this.parentIdFieldName}refreshRows(){this.selectionState=this.getTableSelectionState()
11666
11669
  let t=!1
11667
11670
  const e=this.table.getRowModel().rows,n=this.getRequestedSlotsByRecordId()
11668
- this.tableData=e.map((e=>{const i=e.getIsGrouped(),s=!i&&e.getParentRow(),o=!i&&this.getRowCanExpand(e),r=!i&&!o&&!s&&e.depth>0&&!this.parentIdFieldName,a={record:e.original.clientRecord,id:e.id,selectionState:this.getRowSelectionState(e),isGroupRow:i,isExpanded:e.getIsExpanded(),groupRowValue:i?e.getValue(e.groupingColumnId):void 0,nestingLevel:r?e.depth-1:e.depth,isParentRow:o,immediateChildCount:e.subRows.length,groupColumn:this.getGroupRowColumn(e),resolvedRowIndex:e.index,isLoadingChildren:this.expansionManager.isLoadingChildren(e.id),requestedSlots:n[e.id]??[]}
11669
- return t=t||o,a})),this.showCollapseAll=t||this.getColumnsParticipatingInGrouping().length>0,this.virtualizer.dataChanged()}getRequestedSlotsByRecordId(){const t={}
11671
+ this.tableData=e.map((e=>{const i=e.getIsGrouped(),s=!i&&this.getRowCanExpand(e),o=!i&&!this.isHierarchyEnabled()&&e.getParentRow()?.getIsGrouped(),r={record:e.original.clientRecord,id:e.id,selectionState:this.getRowSelectionState(e),isGroupRow:i,isExpanded:e.getIsExpanded(),groupRowValue:i?e.getValue(e.groupingColumnId):void 0,nestingLevel:o?e.depth-1:e.depth,isParentRow:s,immediateChildCount:e.subRows.length,groupColumn:this.getGroupRowColumn(e),resolvedRowIndex:e.index,isLoadingChildren:this.expansionManager.isLoadingChildren(e.id),requestedSlots:n[e.id]??[]}
11672
+ return t=t||s,r})),this.showCollapseAll=t||this.getColumnsParticipatingInGrouping().length>0,this.virtualizer.dataChanged()}getRequestedSlotsByRecordId(){const t={}
11670
11673
  for(const[e,{recordId:n,uniqueSlot:i}]of this.requestedSlots)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=[]),t[n].push({name:e,slot:i})
11671
11674
  return t}getTableSelectionState(){return this.table.getIsAllRowsSelected()?bR:this.table.getIsSomeRowsSelected()?yR:vR}getRowSelectionState(t){return t.getIsGrouped()?this.getGroupedRowSelectionState(t):t.getIsSelected()?bR:vR}getGroupedRowSelectionState(t){const e=t.getLeafRows().filter((t=>!t.getIsGrouped()))??[]
11672
11675
  let n=!1,i=!1