@ni/nimble-components 30.0.0 → 30.0.2
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 +29 -73
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +16 -29
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/components/row/index.d.ts +0 -1
- package/dist/esm/table/components/row/index.js +1 -9
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/index.d.ts +4 -9
- package/dist/esm/table/index.js +23 -39
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/keyboard-navigation-manager.d.ts +0 -1
- package/dist/esm/table/models/keyboard-navigation-manager.js +4 -8
- package/dist/esm/table/models/keyboard-navigation-manager.js.map +1 -1
- package/dist/esm/table/models/virtualizer.js +0 -1
- package/dist/esm/table/models/virtualizer.js.map +1 -1
- package/dist/esm/table/template.js +1 -9
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table/types.d.ts +1 -1
- package/dist/esm/table/types.js.map +1 -1
- package/dist/esm/table-column/anchor/cell-view/index.d.ts +0 -1
- package/dist/esm/table-column/anchor/cell-view/index.js +0 -3
- package/dist/esm/table-column/anchor/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/base/cell-view/index.d.ts +0 -6
- package/dist/esm/table-column/base/cell-view/index.js +0 -6
- package/dist/esm/table-column/base/cell-view/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -10243,7 +10243,7 @@ try{e=document.createElement(t)}catch(t){}if(!(e instanceof SR))throw new Error(
|
|
|
10243
10243
|
>
|
|
10244
10244
|
</${t}>
|
|
10245
10245
|
`)
|
|
10246
|
-
class IR extends We{constructor(){super(...arguments),this.delegatedEvents=[],this.delegatedEventHandler=()=>{}}get tabbableChildren(){return[]}
|
|
10246
|
+
class IR extends We{constructor(){super(...arguments),this.delegatedEvents=[],this.delegatedEventHandler=()=>{}}get tabbableChildren(){return[]}columnChanged(){for(const t of this.delegatedEvents)this.removeEventListener(t,this.delegatedEventHandler)
|
|
10247
10247
|
if(this.delegatedEvents=[],this.delegatedEventHandler=()=>{},this.column){this.delegatedEvents=this.column.columnInternals.delegatedEvents,this.delegatedEventHandler=t=>{this.recordId&&this.column?.dispatchEvent(new CustomEvent("delegated-event",{detail:{originalEvent:t,recordId:this.recordId}}))}
|
|
10248
10248
|
for(const t of this.delegatedEvents)this.addEventListener(t,this.delegatedEventHandler)}}}function MR(t,e){return`${t}-${e}`}function $R(t,e){return MR(t.columnInternals.uniqueId,e)}t([C],IR.prototype,"cellRecord",void 0),t([C],IR.prototype,"columnConfig",void 0),t([C],IR.prototype,"column",void 0),t([C],IR.prototype,"recordId",void 0)
|
|
10249
10249
|
const ER=t=>((t=>{let e
|
|
@@ -10898,8 +10898,7 @@ class ZR extends We{constructor(){super(...arguments),this.selectable=!1,this.se
|
|
|
10898
10898
|
const e=t.target.checked
|
|
10899
10899
|
this.onSelectionChange(!e,e)}onSelectionChange(t,e){this.selected=e
|
|
10900
10900
|
const n={oldState:t,newState:e}
|
|
10901
|
-
this.$emit("row-selection-toggle",n)}onCellActionMenuBeforeToggle(t,e){this.currentActionMenuColumn=e,this.emitActionMenuToggleEvent("row-action-menu-beforetoggle",t.detail,e)}onCellActionMenuToggle(t,e){this.menuOpen=t.detail.newState,this.emitActionMenuToggleEvent("row-action-menu-toggle",t.detail,e)}
|
|
10902
|
-
t?.actionMenuButton?.open&&t.actionMenuButton.toggleButton.control.click()}}handleChange(t,e){t instanceof DR&&"string"==typeof e&&(AR(e,"columnConfig")||AR(e,"dataRecordFieldNames"))&&this.updateCellStates()}getFocusableElements(){return{selectionCheckbox:this.showSelectionCheckbox?this.selectionCheckbox:void 0,cells:Array.from(this.cellContainer.querySelectorAll(WR)).map((t=>({cell:t,actionMenuButton:t.hasActionMenu?t.actionMenuButton:void 0})))}}onRowExpandToggle(t){const e={oldState:this.expanded,newState:!this.expanded,recordId:this.recordId}
|
|
10901
|
+
this.$emit("row-selection-toggle",n)}onCellActionMenuBeforeToggle(t,e){this.currentActionMenuColumn=e,this.emitActionMenuToggleEvent("row-action-menu-beforetoggle",t.detail,e)}onCellActionMenuToggle(t,e){this.menuOpen=t.detail.newState,this.emitActionMenuToggleEvent("row-action-menu-toggle",t.detail,e)}handleChange(t,e){t instanceof DR&&"string"==typeof e&&(AR(e,"columnConfig")||AR(e,"dataRecordFieldNames"))&&this.updateCellStates()}getFocusableElements(){return{selectionCheckbox:this.showSelectionCheckbox?this.selectionCheckbox:void 0,cells:Array.from(this.cellContainer.querySelectorAll(WR)).map((t=>({cell:t,actionMenuButton:t.hasActionMenu?t.actionMenuButton:void 0})))}}onRowExpandToggle(t){const e={oldState:this.expanded,newState:!this.expanded,recordId:this.recordId}
|
|
10903
10902
|
this.$emit("row-expand-toggle",e),t?.stopImmediatePropagation(),this.animationClass="animating",this.expandIcon?.addEventListener("transitionend",this.removeAnimatingClass)}onCellViewSlotsRequest(t,e){if(e.stopImmediatePropagation(),"string"!=typeof this.recordId)return
|
|
10904
10903
|
const n={recordId:this.recordId,columnInternalId:t.columnInternals.uniqueId,slots:e.detail.slots}
|
|
10905
10904
|
this.$emit("row-slots-request",n)}emitActionMenuToggleEvent(t,e,n){const i={newState:e.newState,oldState:e.oldState,recordIds:[this.recordId],columnId:n.columnId}
|
|
@@ -11199,15 +11198,7 @@ const eF="nimble-table-group-row",nF=Q`
|
|
|
11199
11198
|
@row-slots-request="${(t,e)=>e.parent.onRowSlotsRequest(e.event)}"
|
|
11200
11199
|
@row-expand-toggle="${(t,e)=>e.parent.handleRowExpanded(t.index)}"
|
|
11201
11200
|
>
|
|
11202
|
-
${
|
|
11203
|
-
${Qt(((t,e)=>e.parent.actionMenuSlots),Q`
|
|
11204
|
-
<slot
|
|
11205
|
-
name="${t=>t}"
|
|
11206
|
-
slot="${t=>`row-action-menu-${t}`}">
|
|
11207
|
-
</slot>
|
|
11208
|
-
`)}
|
|
11209
|
-
`)}
|
|
11210
|
-
${Qt(((t,e)=>e.parent.tableData[t.index]?.slots||[]),Q`
|
|
11201
|
+
${Qt(((t,e)=>e.parent.tableData[t.index]?.requestedSlots||[]),Q`
|
|
11211
11202
|
<slot
|
|
11212
11203
|
name="${t=>t.name}"
|
|
11213
11204
|
slot="${t=>t.slot}"
|
|
@@ -11325,8 +11316,7 @@ const e=this.getMeasurements()
|
|
|
11325
11316
|
let n
|
|
11326
11317
|
return n=0===e.length?this.options.paddingStart:1===this.options.lanes?(null==(t=e[e.length-1])?void 0:t.end)??0:Math.max(...e.slice(-this.options.lanes).map((t=>t.end))),n-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(t,{adjustments:e,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:e},this)},this.measure=()=>{var t,e
|
|
11327
11318
|
this.itemSizeCache=new Map,null==(e=(t=this.options).onChange)||e.call(t,this,!1)},this.setOptions(t)}}(t),this.virtualizer._willUpdate(),this.handleVirtualizerChange()}createVirtualizerOptions(){const t=this.rowHeight
|
|
11328
|
-
return{count:this.tanStackTable.getRowModel().rows.length,getScrollElement:()=>this.table.viewport,estimateSize:e=>t,enableSmoothScroll:!0,overscan:3,scrollingDelay:5,scrollToFn:pF,observeElementOffset:hF,observeElementRect:lF,onChange:()=>this.handleVirtualizerChange()}}handleVirtualizerChange(){this.
|
|
11329
|
-
const t=this.virtualizer
|
|
11319
|
+
return{count:this.tanStackTable.getRowModel().rows.length,getScrollElement:()=>this.table.viewport,estimateSize:e=>t,enableSmoothScroll:!0,overscan:3,scrollingDelay:5,scrollToFn:pF,observeElementOffset:hF,observeElementRect:lF,onChange:()=>this.handleVirtualizerChange()}}handleVirtualizerChange(){const t=this.virtualizer
|
|
11330
11320
|
this.visibleItems=t.getVirtualItems(),this.scrollHeight=t.getTotalSize()
|
|
11331
11321
|
let e=0
|
|
11332
11322
|
if(this.visibleItems.length>0){e=this.visibleItems[0].start}this.rowContainerYOffset=e}updatePageSize(){this._pageSize=Math.round(this.table.viewport.clientHeight/this.rowHeight)}}function gF(t){switch(t){case wR:return bF
|
|
@@ -11464,7 +11454,7 @@ else if(t===this.table&&"rowElements"===e){for(const t of this.visibleRowNotifie
|
|
|
11464
11454
|
this.visibleRowNotifiers=[]
|
|
11465
11455
|
for(const t of this.table.rowElements){x.getNotifier(t).subscribe(this,"resolvedRowIndex"),t.resolvedRowIndex===this.rowIndex&&(n=!0)}}else"resolvedRowIndex"===e&&this.isResolvedRowType(t)&&t.resolvedRowIndex===this.rowIndex&&(n=!0)
|
|
11466
11456
|
if(n&&(this.focusType!==bR&&this.focusType!==yR||this.setCellFocusState(this.columnIndex,this.rowIndex,!1),this.inNavigationMode&&this.hasRowOrCellFocusType())){if(this.rowIndex>this.table.tableData.length-1){if(!(this.table.tableData.length>0))return void(this.focusWithinTable?this.setDefaultFocus():this.focusType=uR)
|
|
11467
|
-
this.rowIndex=0}this.focusWithinTable&&this.focusCurrentRow(!1)}}
|
|
11457
|
+
this.rowIndex=0}this.focusWithinTable&&this.focusCurrentRow(!1)}}onRowFocusIn(t){if(this.isCurrentlyFocusingElement)return
|
|
11468
11458
|
const e=t.target
|
|
11469
11459
|
this.isResolvedRowType(e)&&this.rowIndex!==e.resolvedRowIndex&&this.setRowFocusState(e.resolvedRowIndex)}onRowBlur(t){const e=t.target
|
|
11470
11460
|
this.isResolvedRowType(e)&&this.setElementFocusable(e,!1)}onRowActionMenuToggle(t){if(t.detail.newState){const e=t.target,n=this.table.visibleColumns.findIndex((e=>e.columnId===t.detail.columnId))
|
|
@@ -11555,7 +11545,7 @@ const i=e??this.columnIndex,s=n??this.rowIndex
|
|
|
11555
11545
|
return i>=0&&i<t.cells.length&&(this.focusType=vR,this.setRowCellFocusState(i,s,!0),!0)}trySetCellContentFocus(t,e,n,i){if(!t)return!1
|
|
11556
11546
|
const s=n??this.columnIndex,o=i??this.rowIndex
|
|
11557
11547
|
return s>=0&&s<t.cells.length&&e>=0&&e<t.cells[s].cell.cellView.tabbableChildren.length&&(this.setCellContentFocusState(e,o,s,!0),!0)}trySetCellActionMenuFocus(t,e,n){const i=e??this.columnIndex,s=n??this.rowIndex
|
|
11558
|
-
return!!(i>=0&&i<t.cells.length&&t.cells[i].actionMenuButton)&&(this.setCellActionMenuFocusState(s,i,!0),!0)}setCellActionMenuFocusState(t,e,n){this.focusType=bR,this.setRowCellFocusState(e,t,n)}setCellContentFocusState(t,e,n,i){this.focusType=yR,this.cellContentIndex=t,this.setRowCellFocusState(n,e,i)}setRowFocusState(t){this.focusType=mR,void 0!==t&&(this.rowIndex=t)}setCellFocusState(t,e,n){this.focusType=vR,this.setRowCellFocusState(t,e,n)}setRowCellFocusState(t,e,n){this.rowIndex=e,this.columnIndex=t,n&&this.focusCurrentRow(!0)}isResolvedRowType(t){return t instanceof ZR||t instanceof QR}}let FF=class extends We{get validity(){return this.tableValidator.getValidity()}get showRowOperationColumn(){return this.selectionMode===rR.multiple||this.showCollapseAll}constructor(){super(),this.selectionMode=rR.none,this.tableData=[],this.columns=[],this.childItems=[],this.rowElements=[],this.
|
|
11548
|
+
return!!(i>=0&&i<t.cells.length&&t.cells[i].actionMenuButton)&&(this.setCellActionMenuFocusState(s,i,!0),!0)}setCellActionMenuFocusState(t,e,n){this.focusType=bR,this.setRowCellFocusState(e,t,n)}setCellContentFocusState(t,e,n,i){this.focusType=yR,this.cellContentIndex=t,this.setRowCellFocusState(n,e,i)}setRowFocusState(t){this.focusType=mR,void 0!==t&&(this.rowIndex=t)}setCellFocusState(t,e,n){this.focusType=vR,this.setRowCellFocusState(t,e,n)}setRowCellFocusState(t,e,n){this.rowIndex=e,this.columnIndex=t,n&&this.focusCurrentRow(!0)}isResolvedRowType(t){return t instanceof ZR||t instanceof QR}}let FF=class extends We{get validity(){return this.tableValidator.getValidity()}get showRowOperationColumn(){return this.selectionMode===rR.multiple||this.showCollapseAll}constructor(){super(),this.selectionMode=rR.none,this.tableData=[],this.columns=[],this.childItems=[],this.rowElements=[],this.canRenderRows=!0,this.scrollX=0,this.selectionState=aR,this.showCollapseAll=!1,this.visibleColumns=[],this.tableScrollableMinWidth=0,this.windowShiftKeyDown=!1,this.tableValidator=new OR,this.tableUpdateTracker=new CF(this),this.columnNotifiers=[],this.isInitialized=!1,this.ignoreSelectionChangeEvents=!1,this.requestedSlots=new Map,this.actionMenuSlots=[],this.onViewPortScroll=t=>{this.scrollX=t.target.scrollLeft},this.onKeyDown=t=>{this.windowShiftKeyDown=t.shiftKey},this.onKeyUp=t=>{this.windowShiftKeyDown=t.shiftKey},this.onBlur=()=>{this.windowShiftKeyDown=!1},this.getRowCanExpand=t=>this.expansionManager.isRowExpandable(t),this.getIsRowExpanded=t=>this.expansionManager.isRowExpanded(t),this.handleRowSelectionChange=t=>{const e=t instanceof Function?t(this.table.getState().rowSelection):t
|
|
11559
11549
|
this.updateTableOptions({state:{rowSelection:e}})},this.handleExpandedChange=t=>{const e=t instanceof Function?t(this.table.getState().expanded):t
|
|
11560
11550
|
this.updateTableOptions({state:{expanded:e}})},this.options={data:[],onStateChange:t=>{},onRowSelectionChange:this.handleRowSelectionChange,onExpandedChange:this.handleExpandedChange,getCoreRowModel:t=>rO((()=>[t.options.data]),(e=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(e,s,o){void 0===s&&(s=0)
|
|
11561
11551
|
const r=[]
|
|
@@ -11585,7 +11575,7 @@ const e=structuredClone(t),n=this.tableValidator.getOptionsWithPresentIds(e)
|
|
|
11585
11575
|
this.expansionManager.setHierarchyOptions(n),this.refreshRows()}connectedCallback(){super.connectedCallback(),this.initialize(),this.virtualizer.connect(),this.viewport.addEventListener("scroll",this.onViewPortScroll,{passive:!0}),this.keyboardNavigationManager.connect(),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),window.addEventListener("blur",this.onBlur)}disconnectedCallback(){super.disconnectedCallback(),this.virtualizer.disconnect(),this.keyboardNavigationManager.disconnect(),this.viewport.removeEventListener("scroll",this.onViewPortScroll),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),window.removeEventListener("blur",this.onBlur)}checkValidity(){return this.tableValidator.isValid()}handleChange(t,e){(t instanceof TR||t instanceof DR)&&"string"==typeof e?this.tableUpdateTracker.trackColumnPropertyChanged(e):t instanceof OF&&"isColumnValid"===e?this.tableValidator.validateColumnConfigurations(this.columns):t instanceof yF&&"isColumnBeingSized"===e&&!this.layoutManager.isColumnBeingSized&&this.emitColumnConfigurationChangeEvent()}onRowSelectionToggle(t,e){e.stopImmediatePropagation()
|
|
11586
11576
|
this.selectionManager.handleRowSelectionToggle(this.tableData[t],e.detail.newState,this.windowShiftKeyDown)&&this.emitSelectionChangeEvent()}onRowClick(t,e){return this.selectionManager.handleRowClick(this.tableData[t],e.shiftKey,e.ctrlKey||e.metaKey)&&this.emitSelectionChangeEvent(),!0}onRowFocusIn(t){this.keyboardNavigationManager.onRowFocusIn(t)}onRowBlur(t){this.keyboardNavigationManager.onRowBlur(t)}onAllRowsSelectionChange(t){t.stopPropagation(),this.ignoreSelectionChangeEvents||(this.table.toggleAllRowsSelected(this.selectionCheckbox.checked),this.emitSelectionChangeEvent())}onRowActionMenuBeforeToggle(t,e){e.stopImmediatePropagation(),this.handleActionMenuBeforeToggleEvent(t,e)}onRowActionMenuToggle(t){t.stopImmediatePropagation(),this.handleRowActionMenuToggleEvent(t)}onRowSlotsRequest(t){t.stopImmediatePropagation()
|
|
11587
11577
|
for(const e of t.detail.slots){const n=MR(t.detail.columnInternalId,e.slot)
|
|
11588
|
-
this.
|
|
11578
|
+
this.requestedSlots.set(e.name,{recordId:t.detail.recordId,uniqueSlot:n})}this.refreshRows()}handleCollapseAllRows(){this.expansionManager.collapseAll()}onRightDividerMouseDown(t,e){0===t.button&&this.layoutManager.beginColumnInteractiveSize(t.clientX,this.getRightDividerIndex(e))}onLeftDividerMouseDown(t,e){0===t.button&&this.layoutManager.beginColumnInteractiveSize(t.clientX,this.getLeftDividerIndex(e))}getLeftDividerIndex(t){return 2*t-1}getRightDividerIndex(t){return 2*t}handleGroupRowExpanded(t,e){this.toggleRowExpanded(t),e.stopPropagation()}handleRowExpanded(t){this.toggleRowExpanded(t)}toggleColumnSort(t,e){if(t.columnInternals.sortingDisabled)return
|
|
11589
11579
|
const n=this.getColumnsParticipatingInSorting().sort(((t,e)=>t.columnInternals.currentSortIndex-e.columnInternals.currentSortIndex)),i=n.indexOf(t),s=i>-1,o=t.columnInternals.currentSortDirection
|
|
11590
11580
|
let r=oR.ascending
|
|
11591
11581
|
s?o===oR.descending?(n.splice(i,1),r=oR.none,t.columnInternals.currentSortIndex=void 0):r=oR.descending:n.push(t),t.columnInternals.currentSortDirection=r
|
|
@@ -11598,12 +11588,8 @@ const e=this.dataHierarchyManager.hierarchicalData
|
|
|
11598
11588
|
this.tableValidator.setParentIdConfigurationValidity(this.dataHierarchyManager.parentIdConfigurationValid)
|
|
11599
11589
|
const n={data:e}
|
|
11600
11590
|
if(this.validateWithData(t),this.tableValidator.areRecordIdsValid()){const t=this.selectionManager.getCurrentSelectedRecordIds()
|
|
11601
|
-
n.state={rowSelection:this.calculateTanStackSelectionState(t),expanded:!0}}return n}
|
|
11602
|
-
|
|
11603
|
-
for(;null!==e&&!(e instanceof IR)&&e.shadowRoot;)e=e.shadowRoot.activeElement
|
|
11604
|
-
if(e instanceof IR&&e.focusedRecycleCallback(),void 0!==this.openActionMenuRecordId){const t=this.rowElements.find((t=>t instanceof ZR&&t.recordId===this.openActionMenuRecordId))
|
|
11605
|
-
t?.closeOpenActionMenus()}this.keyboardNavigationManager.handleFocusedCellRecycling(t)}selectionModeChanged(t,e){this.$fastController.isConnected&&this.tableUpdateTracker.trackSelectionModeChanged()}idFieldNameChanged(t,e){this.$fastController.isConnected&&this.tableUpdateTracker.trackIdFieldNameChanged()}parentIdFieldNameChanged(t,e){this.$fastController.isConnected&&this.tableUpdateTracker.trackParentIdFieldNameChanged()}columnsChanged(t,e){this.$fastController.isConnected&&(this.observeColumns(),this.tableUpdateTracker.trackColumnInstancesChanged())}removeActionMenuSlotsFromColumnRequestedSlots(){for(const t of this.actionMenuSlots)this.columnRequestedSlots.delete(t)
|
|
11606
|
-
this.refreshRows()}async handleActionMenuBeforeToggleEvent(t,e){this.selectionManager.handleActionMenuOpening(this.tableData[t])&&await this.emitSelectionChangeEvent(),this.openActionMenuRecordId=e.detail.recordIds[0],this.removeActionMenuSlotsFromColumnRequestedSlots()
|
|
11591
|
+
n.state={rowSelection:this.calculateTanStackSelectionState(t),expanded:!0}}return n}selectionModeChanged(t,e){this.$fastController.isConnected&&this.tableUpdateTracker.trackSelectionModeChanged()}idFieldNameChanged(t,e){this.$fastController.isConnected&&this.tableUpdateTracker.trackIdFieldNameChanged()}parentIdFieldNameChanged(t,e){this.$fastController.isConnected&&this.tableUpdateTracker.trackParentIdFieldNameChanged()}columnsChanged(t,e){this.$fastController.isConnected&&(this.observeColumns(),this.tableUpdateTracker.trackColumnInstancesChanged())}updateRequestedSlotsForOpeningActionMenu(t){for(const e of this.actionMenuSlots)this.requestedSlots.set(e,{recordId:t,uniqueSlot:`row-action-menu-${e}`})
|
|
11592
|
+
this.refreshRows()}async handleActionMenuBeforeToggleEvent(t,e){this.selectionManager.handleActionMenuOpening(this.tableData[t])&&await this.emitSelectionChangeEvent(),this.openActionMenuRecordId=e.detail.recordIds[0],this.updateRequestedSlotsForOpeningActionMenu(this.openActionMenuRecordId)
|
|
11607
11593
|
const n=await this.getActionMenuToggleEventDetail(e)
|
|
11608
11594
|
this.$emit("action-menu-beforetoggle",n)}async handleRowActionMenuToggleEvent(t){this.keyboardNavigationManager.onRowActionMenuToggle(t)
|
|
11609
11595
|
const e=await this.getActionMenuToggleEventDetail(t)
|
|
@@ -11617,16 +11603,17 @@ const i=x.getNotifier(t.columnInternals.validator)
|
|
|
11617
11603
|
i.subscribe(this),this.columnNotifiers.push(i)}}getColumnsParticipatingInSorting(){return this.columns.filter((t=>!t.columnInternals.sortingDisabled&&t.columnInternals.currentSortDirection!==oR.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 AE(this.childItems),this.columns=this.childItems.filter((t=>t instanceof TR))}updateTanStack(){const t={state:{}}
|
|
11618
11604
|
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===rR.multiple,t.enableSubRowSelection=this.selectionMode===rR.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)
|
|
11619
11605
|
n.state&&(t.state.rowSelection=n.state.rowSelection),t.data=n.data}else t.data=[...this.table.options.data]
|
|
11620
|
-
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(){const t
|
|
11606
|
+
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)
|
|
11607
|
+
const t=new Set
|
|
11621
11608
|
for(const e of this.columns)e.actionMenuSlot&&t.add(e.actionMenuSlot)
|
|
11622
|
-
this.actionMenuSlots=Array.from(t)}validate(){this.tableValidator.validateIdFieldConfiguration(this.selectionMode,this.idFieldName,this.parentIdFieldName),this.tableValidator.validateColumnIds(this.columns.map((t=>t.columnId))),this.tableValidator.validateColumnSortIndices(this.getColumnsParticipatingInSorting().map((t=>t.columnInternals.currentSortIndex))),this.tableValidator.validateColumnGroupIndices(this.getColumnsParticipatingInGrouping().map((t=>t.columnInternals.groupIndex))),this.tableValidator.validateColumnConfigurations(this.columns),this.dataHierarchyManager&&this.validateWithData(this.dataHierarchyManager.getAllRecords())}validateWithData(t){this.tableValidator.validateRecordIds(t,this.idFieldName),this.canRenderRows=this.checkValidity()}emitColumnConfigurationChangeEvent(){const t={columns:this.columns.map((t=>({columnId:t.columnId,sortIndex:t.columnInternals.currentSortIndex??void 0,sortDirection:t.columnInternals.currentSortDirection,groupIndex:t.columnInternals.groupIndex,hidden:t.columnHidden,fractionalWidth:t.columnInternals.currentFractionalWidth,pixelWidth:t.columnInternals.currentPixelWidth})))}
|
|
11609
|
+
this.actionMenuSlots=Array.from(t),void 0!==this.openActionMenuRecordId&&this.updateRequestedSlotsForOpeningActionMenu(this.openActionMenuRecordId)}validate(){this.tableValidator.validateIdFieldConfiguration(this.selectionMode,this.idFieldName,this.parentIdFieldName),this.tableValidator.validateColumnIds(this.columns.map((t=>t.columnId))),this.tableValidator.validateColumnSortIndices(this.getColumnsParticipatingInSorting().map((t=>t.columnInternals.currentSortIndex))),this.tableValidator.validateColumnGroupIndices(this.getColumnsParticipatingInGrouping().map((t=>t.columnInternals.groupIndex))),this.tableValidator.validateColumnConfigurations(this.columns),this.dataHierarchyManager&&this.validateWithData(this.dataHierarchyManager.getAllRecords())}validateWithData(t){this.tableValidator.validateRecordIds(t,this.idFieldName),this.canRenderRows=this.checkValidity()}emitColumnConfigurationChangeEvent(){const t={columns:this.columns.map((t=>({columnId:t.columnId,sortIndex:t.columnInternals.currentSortIndex??void 0,sortDirection:t.columnInternals.currentSortDirection,groupIndex:t.columnInternals.groupIndex,hidden:t.columnHidden,fractionalWidth:t.columnInternals.currentFractionalWidth,pixelWidth:t.columnInternals.currentPixelWidth})))}
|
|
11623
11610
|
this.$emit("column-configuration-change",t)}async emitSelectionChangeEvent(){const t={selectedRecordIds:await this.getSelectedRecordIds()}
|
|
11624
11611
|
this.$emit("selection-change",t)}selectionStateChanged(){this.setSelectionCheckboxState()}selectionCheckboxChanged(){this.setSelectionCheckboxState()}setSelectionCheckboxState(){this.selectionCheckbox&&(this.ignoreSelectionChangeEvents=!0,this.selectionCheckbox.checked=this.selectionState===lR,this.selectionCheckbox.indeterminate=this.selectionState===cR,this.ignoreSelectionChangeEvents=!1)}isHierarchyEnabled(){return"string"==typeof this.parentIdFieldName}refreshRows(){this.selectionState=this.getTableSelectionState()
|
|
11625
11612
|
let t=!1
|
|
11626
11613
|
const e=this.table.getRowModel().rows,n=this.getRequestedSlotsByRecordId()
|
|
11627
|
-
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),
|
|
11614
|
+
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]??[]}
|
|
11628
11615
|
return t=t||o,a})),this.showCollapseAll=t||this.getColumnsParticipatingInGrouping().length>0,this.virtualizer.dataChanged()}getRequestedSlotsByRecordId(){const t={}
|
|
11629
|
-
for(const[e,{recordId:n,uniqueSlot:i}]of this.
|
|
11616
|
+
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})
|
|
11630
11617
|
return t}getTableSelectionState(){return this.table.getIsAllRowsSelected()?lR:this.table.getIsSomeRowsSelected()?cR:aR}getRowSelectionState(t){return t.getIsGrouped()?this.getGroupedRowSelectionState(t):t.getIsSelected()?lR:aR}getGroupedRowSelectionState(t){const e=t.getLeafRows().filter((t=>!t.getIsGrouped()))??[]
|
|
11631
11618
|
let n=!1,i=!1
|
|
11632
11619
|
for(const t of e)if(t.getIsSelected()?n=!0:i=!0,n&&i)return cR
|
|
@@ -11639,7 +11626,7 @@ if("string"==typeof n)return e.clientRecord[n]},sortingFn:gF(t.columnInternals.s
|
|
|
11639
11626
|
const e={},n=this.tableValidator.getPresentRecordIds(t)
|
|
11640
11627
|
for(const t of n)if(e[t]=!0,this.selectionMode===rR.single)break
|
|
11641
11628
|
return e}}
|
|
11642
|
-
t([ft({attribute:"id-field-name"})],FF.prototype,"idFieldName",void 0),t([ft({attribute:"parent-id-field-name"})],FF.prototype,"parentIdFieldName",void 0),t([ft({attribute:"selection-mode"})],FF.prototype,"selectionMode",void 0),t([C],FF.prototype,"tableData",void 0),t([C],FF.prototype,"columns",void 0),t([C],FF.prototype,"childItems",void 0),t([C],FF.prototype,"rowElements",void 0),t([C],FF.prototype,"
|
|
11629
|
+
t([ft({attribute:"id-field-name"})],FF.prototype,"idFieldName",void 0),t([ft({attribute:"parent-id-field-name"})],FF.prototype,"parentIdFieldName",void 0),t([ft({attribute:"selection-mode"})],FF.prototype,"selectionMode",void 0),t([C],FF.prototype,"tableData",void 0),t([C],FF.prototype,"columns",void 0),t([C],FF.prototype,"childItems",void 0),t([C],FF.prototype,"rowElements",void 0),t([C],FF.prototype,"openActionMenuRecordId",void 0),t([C],FF.prototype,"canRenderRows",void 0),t([C],FF.prototype,"scrollX",void 0),t([C],FF.prototype,"rowGridColumns",void 0),t([C],FF.prototype,"selectionState",void 0),t([C],FF.prototype,"selectionCheckbox",void 0),t([C],FF.prototype,"collapseAllButton",void 0),t([C],FF.prototype,"showCollapseAll",void 0),t([C],FF.prototype,"firstSortedColumn",void 0),t([C],FF.prototype,"visibleColumns",void 0),t([C],FF.prototype,"tableScrollableMinWidth",void 0),t([C],FF.prototype,"windowShiftKeyDown",void 0)
|
|
11643
11630
|
const NF=FF.compose({baseName:"table",template:nF,styles:RR})
|
|
11644
11631
|
_i.getOrCreate().withPrefix("nimble").register(NF())
|
|
11645
11632
|
const LF=Mt`
|
|
@@ -11721,7 +11708,7 @@ function PF(t){class e extends t{fractionalWidthChanged(){this.columnInternals.f
|
|
|
11721
11708
|
</template>
|
|
11722
11709
|
`
|
|
11723
11710
|
class qF extends IR{constructor(){super(...arguments),this.hasOverflow=!1,this.isPlaceholder=!1}get text(){const t=this.cellRecord?.label??this.cellRecord?.href
|
|
11724
|
-
return null==t&&this.columnConfig?.placeholder?(this.isPlaceholder=!0,this.columnConfig.placeholder):(this.isPlaceholder=!1,"string"==typeof this.cellRecord?.label?this.cellRecord.label:"string"==typeof this.cellRecord?.href?this.cellRecord.href:"")}get showAnchor(){return"string"==typeof this.cellRecord?.href}
|
|
11711
|
+
return null==t&&this.columnConfig?.placeholder?(this.isPlaceholder=!0,this.columnConfig.placeholder):(this.isPlaceholder=!1,"string"==typeof this.cellRecord?.label?this.cellRecord.label:"string"==typeof this.cellRecord?.href?this.cellRecord.href:"")}get showAnchor(){return"string"==typeof this.cellRecord?.href}get tabbableChildren(){return this.showAnchor?[this.anchor]:[]}}t([C],qF.prototype,"hasOverflow",void 0),t([C],qF.prototype,"isPlaceholder",void 0),t([k],qF.prototype,"text",null),t([k],qF.prototype,"showAnchor",null)
|
|
11725
11712
|
const jF=qF.compose({baseName:"table-column-anchor-cell-view",template:UF,styles:HF})
|
|
11726
11713
|
_i.getOrCreate().withPrefix("nimble").register(jF())
|
|
11727
11714
|
class WF extends SR{constructor(){super(...arguments),this.hasOverflow=!1,this.text=Pv.getValueFor(this),this.noValuePlaceholderLabelSubscriber={handleChange:()=>{this.applyPlaceholderTextIfNeeded()}},this.emptyPlaceholderLabelSubscriber={handleChange:()=>{this.applyPlaceholderTextIfNeeded()}}}connectedCallback(){super.connectedCallback(),Pv.subscribe(this.noValuePlaceholderLabelSubscriber,this),zv.subscribe(this.emptyPlaceholderLabelSubscriber,this),this.applyPlaceholderTextIfNeeded()}disconnectedCallback(){super.disconnectedCallback(),Pv.unsubscribe(this.noValuePlaceholderLabelSubscriber),zv.unsubscribe(this.emptyPlaceholderLabelSubscriber)}columnConfigChanged(){this.applyPlaceholderTextIfNeeded()||this.updateText()}groupHeaderValueChanged(){this.applyPlaceholderTextIfNeeded()||this.updateText()}applyPlaceholderTextIfNeeded(){return null===this.groupHeaderValue||void 0===this.groupHeaderValue?(this.text=Pv.getValueFor(this),!0):""===this.groupHeaderValue&&(this.text=zv.getValueFor(this),!0)}}t([C],WF.prototype,"hasOverflow",void 0),t([C],WF.prototype,"text",void 0)
|