@ni/nimble-components 30.1.1 → 30.1.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.
- package/dist/all-components-bundle.js +14 -10
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +7 -5
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/index.js +5 -8
- package/dist/esm/table/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -10256,13 +10256,15 @@ return o.columns=r.columns?e(r.columns,o,i+1):[],o}))}
|
|
|
10256
10256
|
return e(t)}),gO(t,"debugColumns")),getAllFlatColumns:mO((()=>[s.getAllColumns()]),(t=>t.flatMap((t=>t.getFlatColumns()))),gO(t,"debugColumns")),_getAllFlatColumnsById:mO((()=>[s.getAllFlatColumns()]),(t=>t.reduce(((t,e)=>(t[e.id]=e,t)),{})),gO(t,"debugColumns")),getAllLeafColumns:mO((()=>[s.getAllColumns(),s._getOrderColumnsFn()]),((t,e)=>e(t.flatMap((t=>t.getLeafColumns())))),gO(t,"debugColumns")),getColumn:t=>s._getAllFlatColumnsById()[t]}
|
|
10257
10257
|
Object.assign(s,c)
|
|
10258
10258
|
for(let t=0;t<s._features.length;t++){const e=s._features[t]
|
|
10259
|
-
null==e||null==e.createTable||e.createTable(s)}return s}function dR(){return t=>mO((()=>[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 dR(){return t=>mO((()=>[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
|
|
10260
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)))
|
|
10261
10261
|
const l=i[n],c=function(t,e){const n=new Map
|
|
10262
10262
|
return t.reduce(((t,n)=>{const i=`${n.getGroupingValue(e)}`,s=t.get(i)
|
|
10263
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}`
|
|
10264
10264
|
u=a?`${a}>${u}`:u
|
|
10265
|
-
const p=r(h,n+1,u)
|
|
10265
|
+
const p=r(h,n+1,u)
|
|
10266
|
+
p.forEach((t=>{t.parentId=u}))
|
|
10267
|
+
const f=n?fO(h,(t=>t.subRows)):h,m=xO(t,u,f[0].original,c,n,0,a)
|
|
10266
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]
|
|
10267
10269
|
var n
|
|
10268
10270
|
if(h[0])m._valuesCache[e]=null!=(n=h[0].getValue(e))?n:void 0
|
|
@@ -11656,7 +11658,7 @@ const n=x.getNotifier(t.columnInternals)
|
|
|
11656
11658
|
n.subscribe(this),this.columnNotifiers.push(n)
|
|
11657
11659
|
const i=x.getNotifier(t.columnInternals.validator)
|
|
11658
11660
|
i.subscribe(this),this.columnNotifiers.push(i)}}getColumnsParticipatingInSorting(){return this.columns.filter((t=>!t.columnInternals.sortingDisabled&&t.columnInternals.currentSortDirection!==fR.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 LE(this.childItems),this.columns=this.childItems.filter((t=>t instanceof VR))}updateTanStack(){const t={state:{}}
|
|
11659
|
-
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===mR.multiple,t.enableSubRowSelection=this.selectionMode===mR.multiple,t.state.rowSelection={},this.selectionManager.handleSelectionModeChanged(this.selectionMode)),this.dataHierarchyManager&&this.tableUpdateTracker.requiresTanStackDataReset)if(this.
|
|
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===mR.multiple,t.enableSubRowSelection=this.selectionMode===mR.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)
|
|
11660
11662
|
n.state&&(t.state.rowSelection=n.state.rowSelection),t.data=n.data}else t.data=[...this.table.options.data]
|
|
11661
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)
|
|
11662
11664
|
const t=new Set
|
|
@@ -11666,8 +11668,8 @@ this.$emit("column-configuration-change",t)}async emitSelectionChangeEvent(){con
|
|
|
11666
11668
|
this.$emit("selection-change",t)}selectionStateChanged(){this.setSelectionCheckboxState()}selectionCheckboxChanged(){this.setSelectionCheckboxState()}setSelectionCheckboxState(){this.selectionCheckbox&&(this.ignoreSelectionChangeEvents=!0,this.selectionCheckbox.checked=this.selectionState===vR,this.selectionCheckbox.indeterminate=this.selectionState===bR,this.ignoreSelectionChangeEvents=!1)}isHierarchyEnabled(){return"string"==typeof this.parentIdFieldName}refreshRows(){this.selectionState=this.getTableSelectionState()
|
|
11667
11669
|
let t=!1
|
|
11668
11670
|
const e=this.table.getRowModel().rows,n=this.getRequestedSlotsByRecordId()
|
|
11669
|
-
this.tableData=e.map((e=>{const i=e.getIsGrouped(),s=!i&&
|
|
11670
|
-
return t=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={}
|
|
11671
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})
|
|
11672
11674
|
return t}getTableSelectionState(){return this.table.getIsAllRowsSelected()?vR:this.table.getIsSomeRowsSelected()?bR:gR}getRowSelectionState(t){return t.getIsGrouped()?this.getGroupedRowSelectionState(t):t.getIsSelected()?vR:gR}getGroupedRowSelectionState(t){const e=t.getLeafRows().filter((t=>!t.getIsGrouped()))??[]
|
|
11673
11675
|
let n=!1,i=!1
|