@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.
|
@@ -10653,7 +10653,7 @@ const pF="nimble-table-header",fF=Mt`
|
|
|
10653
10653
|
position: absolute;
|
|
10654
10654
|
}
|
|
10655
10655
|
|
|
10656
|
-
:host([selectable]:not([selected]):hover)::before {
|
|
10656
|
+
:host([selectable]:not([selected])[allow-hover]:hover)::before {
|
|
10657
10657
|
background-color: ${wl};
|
|
10658
10658
|
}
|
|
10659
10659
|
|
|
@@ -10661,7 +10661,7 @@ const pF="nimble-table-header",fF=Mt`
|
|
|
10661
10661
|
background-color: ${vl};
|
|
10662
10662
|
}
|
|
10663
10663
|
|
|
10664
|
-
:host([selected]:hover)::before {
|
|
10664
|
+
:host([selected][allow-hover]:hover)::before {
|
|
10665
10665
|
background-color: ${yl};
|
|
10666
10666
|
}
|
|
10667
10667
|
|
|
@@ -10776,7 +10776,7 @@ const pF="nimble-table-header",fF=Mt`
|
|
|
10776
10776
|
height: ${Pl};
|
|
10777
10777
|
}
|
|
10778
10778
|
|
|
10779
|
-
:host(:hover) nimble-table-cell {
|
|
10779
|
+
:host([allow-hover]:hover) nimble-table-cell {
|
|
10780
10780
|
--ni-private-table-cell-action-menu-display: block;
|
|
10781
10781
|
}
|
|
10782
10782
|
|
|
@@ -10788,7 +10788,7 @@ const pF="nimble-table-header",fF=Mt`
|
|
|
10788
10788
|
--ni-private-table-cell-action-menu-display: block;
|
|
10789
10789
|
}
|
|
10790
10790
|
`.withBehaviors(tu(Lo.color,Mt`
|
|
10791
|
-
:host([selectable]:not([selected]):hover)::before {
|
|
10791
|
+
:host([selectable]:not([selected])[allow-hover]:hover)::before {
|
|
10792
10792
|
background-color: ${fl(ho,.05)};
|
|
10793
10793
|
}
|
|
10794
10794
|
|
|
@@ -10796,7 +10796,7 @@ const pF="nimble-table-header",fF=Mt`
|
|
|
10796
10796
|
background-color: ${fl(ho,.25)};
|
|
10797
10797
|
}
|
|
10798
10798
|
|
|
10799
|
-
:host([selected]:hover)::before {
|
|
10799
|
+
:host([selected][allow-hover]:hover)::before {
|
|
10800
10800
|
background-color: ${fl(ho,.2)};
|
|
10801
10801
|
}
|
|
10802
10802
|
`)),gF=Mt`
|
|
@@ -10962,7 +10962,7 @@ const wF="nimble-table-cell",xF=Q`
|
|
|
10962
10962
|
</span>
|
|
10963
10963
|
</template>
|
|
10964
10964
|
`
|
|
10965
|
-
class CF extends We{constructor(){super(...arguments),this.selectable=!1,this.selected=!1,this.hideSelection=!1,this.expanded=!1,this.reserveCollapseSpace=!1,this.columnNotifiers=[],this.columns=[],this.nestingLevel=0,this.isParentRow=!1,this.menuOpen=!1,this.rowOperationGridCellHidden=!1,this.loading=!1,this.cellIndentLevels=[],this.cellStates=[],this.animationClass="",this.ignoreSelectionChangeEvents=!1,this.removeAnimatingClass=()=>{this.animationClass="",this.expandIcon?.removeEventListener("transitionend",this.removeAnimatingClass)}}get isTopLevelParentRow(){return this.isParentRow&&0===this.nestingLevel}get isNestedParent(){return this.isParentRow&&this.nestingLevel>0}get showSelectionCheckbox(){return this.selectable&&!this.hideSelection}get ariaSelected(){return this.selectable?this.selected?"true":"false":null}onSelectionCheckboxChange(t){if(this.ignoreSelectionChangeEvents)return
|
|
10965
|
+
class CF extends We{constructor(){super(...arguments),this.selectable=!1,this.selected=!1,this.hideSelection=!1,this.expanded=!1,this.reserveCollapseSpace=!1,this.columnNotifiers=[],this.columns=[],this.nestingLevel=0,this.isParentRow=!1,this.menuOpen=!1,this.rowOperationGridCellHidden=!1,this.loading=!1,this.cellIndentLevels=[],this.cellStates=[],this.animationClass="",this.allowHover=!1,this.ignoreSelectionChangeEvents=!1,this.removeAnimatingClass=()=>{this.animationClass="",this.expandIcon?.removeEventListener("transitionend",this.removeAnimatingClass)}}get isTopLevelParentRow(){return this.isParentRow&&0===this.nestingLevel}get isNestedParent(){return this.isParentRow&&this.nestingLevel>0}get showSelectionCheckbox(){return this.selectable&&!this.hideSelection}get ariaSelected(){return this.selectable?this.selected?"true":"false":null}onSelectionCheckboxChange(t){if(this.ignoreSelectionChangeEvents)return
|
|
10966
10966
|
const e=t.target.checked
|
|
10967
10967
|
this.onSelectionChange(!e,e)}onSelectionChange(t,e){this.selected=e
|
|
10968
10968
|
const n={oldState:t,newState:e}
|
|
@@ -10974,7 +10974,7 @@ this.$emit(t,i)}columnsChanged(){this.updateCellIndentLevels(),this.updateCellSt
|
|
|
10974
10974
|
return e.subscribe(this),e}))}updateCellStates(){this.cellStates=this.columns.map((t=>{const e=t.columnInternals.dataRecordFieldNames
|
|
10975
10975
|
let n
|
|
10976
10976
|
if(this.hasValidFieldNames(e)&&this.dataRecord){const i=e.map((t=>this.dataRecord[t]))
|
|
10977
|
-
n={cellRecord:Object.fromEntries(t.columnInternals.cellRecordFieldNames.map(((t,e)=>[t,i[e]]))),columnConfig:t.columnInternals.columnConfig}}return n}))}hasValidFieldNames(t){return t.every((t=>void 0!==t))}selectedChanged(){this.setSelectionCheckboxState()}selectionCheckboxChanged(){this.setSelectionCheckboxState()}setSelectionCheckboxState(){this.selectionCheckbox&&(this.ignoreSelectionChangeEvents=!0,this.selectionCheckbox.checked=this.selected,this.ignoreSelectionChangeEvents=!1)}}t([ft({attribute:"record-id"})],CF.prototype,"recordId",void 0),t([ft({mode:"boolean"})],CF.prototype,"selectable",void 0),t([ft({mode:"boolean"})],CF.prototype,"selected",void 0),t([ft({attribute:"hide-selection",mode:"boolean"})],CF.prototype,"hideSelection",void 0),t([ft({mode:"boolean"})],CF.prototype,"expanded",void 0),t([ft({attribute:"reserve-collapse-space",mode:"boolean"})],CF.prototype,"reserveCollapseSpace",void 0),t([C],CF.prototype,"dataRecord",void 0),t([C],CF.prototype,"columns",void 0),t([C],CF.prototype,"currentActionMenuColumn",void 0),t([C],CF.prototype,"nestingLevel",void 0),t([C],CF.prototype,"resolvedRowIndex",void 0),t([ft({attribute:"is-parent-row",mode:"boolean"})],CF.prototype,"isParentRow",void 0),t([ft({attribute:"menu-open",mode:"boolean"})],CF.prototype,"menuOpen",void 0),t([ft({attribute:"row-operation-grid-cell-hidden",mode:"boolean"})],CF.prototype,"rowOperationGridCellHidden",void 0),t([ft({mode:"boolean"})],CF.prototype,"loading",void 0),t([C],CF.prototype,"cellIndentLevels",void 0),t([C],CF.prototype,"cellStates",void 0),t([C],CF.prototype,"selectionCheckbox",void 0),t([C],CF.prototype,"animationClass",void 0),t([k],CF.prototype,"isTopLevelParentRow",null),t([k],CF.prototype,"isNestedParent",null),t([k],CF.prototype,"showSelectionCheckbox",null),t([k],CF.prototype,"ariaSelected",null)
|
|
10977
|
+
n={cellRecord:Object.fromEntries(t.columnInternals.cellRecordFieldNames.map(((t,e)=>[t,i[e]]))),columnConfig:t.columnInternals.columnConfig}}return n}))}hasValidFieldNames(t){return t.every((t=>void 0!==t))}selectedChanged(){this.setSelectionCheckboxState()}selectionCheckboxChanged(){this.setSelectionCheckboxState()}setSelectionCheckboxState(){this.selectionCheckbox&&(this.ignoreSelectionChangeEvents=!0,this.selectionCheckbox.checked=this.selected,this.ignoreSelectionChangeEvents=!1)}}t([ft({attribute:"record-id"})],CF.prototype,"recordId",void 0),t([ft({mode:"boolean"})],CF.prototype,"selectable",void 0),t([ft({mode:"boolean"})],CF.prototype,"selected",void 0),t([ft({attribute:"hide-selection",mode:"boolean"})],CF.prototype,"hideSelection",void 0),t([ft({mode:"boolean"})],CF.prototype,"expanded",void 0),t([ft({attribute:"reserve-collapse-space",mode:"boolean"})],CF.prototype,"reserveCollapseSpace",void 0),t([C],CF.prototype,"dataRecord",void 0),t([C],CF.prototype,"columns",void 0),t([C],CF.prototype,"currentActionMenuColumn",void 0),t([C],CF.prototype,"nestingLevel",void 0),t([C],CF.prototype,"resolvedRowIndex",void 0),t([ft({attribute:"is-parent-row",mode:"boolean"})],CF.prototype,"isParentRow",void 0),t([ft({attribute:"menu-open",mode:"boolean"})],CF.prototype,"menuOpen",void 0),t([ft({attribute:"row-operation-grid-cell-hidden",mode:"boolean"})],CF.prototype,"rowOperationGridCellHidden",void 0),t([ft({mode:"boolean"})],CF.prototype,"loading",void 0),t([C],CF.prototype,"cellIndentLevels",void 0),t([C],CF.prototype,"cellStates",void 0),t([C],CF.prototype,"selectionCheckbox",void 0),t([C],CF.prototype,"animationClass",void 0),t([ft({attribute:"allow-hover",mode:"boolean"})],CF.prototype,"allowHover",void 0),t([k],CF.prototype,"isTopLevelParentRow",null),t([k],CF.prototype,"isNestedParent",null),t([k],CF.prototype,"showSelectionCheckbox",null),t([k],CF.prototype,"ariaSelected",null)
|
|
10978
10978
|
const kF=CF.compose({baseName:"table-row",template:xF,styles:mF})
|
|
10979
10979
|
_i.getOrCreate().withPrefix("nimble").register(kF())
|
|
10980
10980
|
const SF="nimble-table-row",_F=Mt`
|
|
@@ -11012,7 +11012,7 @@ const SF="nimble-table-row",_F=Mt`
|
|
|
11012
11012
|
position: absolute;
|
|
11013
11013
|
}
|
|
11014
11014
|
|
|
11015
|
-
:host(:hover)::before {
|
|
11015
|
+
:host([allow-hover]:hover)::before {
|
|
11016
11016
|
background-color: ${wl};
|
|
11017
11017
|
}
|
|
11018
11018
|
|
|
@@ -11058,11 +11058,11 @@ const SF="nimble-table-row",_F=Mt`
|
|
|
11058
11058
|
padding-left: 0px;
|
|
11059
11059
|
}
|
|
11060
11060
|
`.withBehaviors(tu(Lo.color,Mt`
|
|
11061
|
-
:host(:hover)::before {
|
|
11061
|
+
:host([allow-hover]:hover)::before {
|
|
11062
11062
|
background-color: ${fl(ho,.05)};
|
|
11063
11063
|
}
|
|
11064
11064
|
`),tu(Lo.dark,Mt`
|
|
11065
|
-
:host(:hover)::before {
|
|
11065
|
+
:host([allow-hover]:hover)::before {
|
|
11066
11066
|
background-color: ${fl(ho,.1)};
|
|
11067
11067
|
}
|
|
11068
11068
|
`)),IF=Q`
|
|
@@ -11105,11 +11105,11 @@ const SF="nimble-table-row",_F=Mt`
|
|
|
11105
11105
|
</div>
|
|
11106
11106
|
</template>
|
|
11107
11107
|
`
|
|
11108
|
-
class MF extends We{constructor(){super(...arguments),this.nestingLevel=0,this.expanded=!1,this.selectable=!1,this.selectionState=FR,this.animationClass="",this.ignoreSelectionChangeEvents=!1,this.removeAnimatingClass=()=>{this.animationClass="",this.expandIcon.removeEventListener("transitionend",this.removeAnimatingClass)}}onGroupExpandToggle(){this.$emit("group-expand-toggle"),this.animationClass="animating",this.expandIcon.addEventListener("transitionend",this.removeAnimatingClass)}onSelectionCheckboxChange(t){if(this.ignoreSelectionChangeEvents)return
|
|
11108
|
+
class MF extends We{constructor(){super(...arguments),this.nestingLevel=0,this.expanded=!1,this.selectable=!1,this.selectionState=FR,this.animationClass="",this.allowHover=!1,this.ignoreSelectionChangeEvents=!1,this.removeAnimatingClass=()=>{this.animationClass="",this.expandIcon.removeEventListener("transitionend",this.removeAnimatingClass)}}onGroupExpandToggle(){this.$emit("group-expand-toggle"),this.animationClass="animating",this.expandIcon.addEventListener("transitionend",this.removeAnimatingClass)}onSelectionCheckboxChange(t){if(this.ignoreSelectionChangeEvents)return
|
|
11109
11109
|
const e=t.target.checked
|
|
11110
11110
|
this.selectionState=e?NR:FR
|
|
11111
11111
|
const n={oldState:!e,newState:e}
|
|
11112
|
-
this.$emit("group-selection-toggle",n)}getFocusableElements(){return{selectionCheckbox:this.selectable?this.selectionCheckbox:void 0,cells:[]}}selectionStateChanged(){this.setSelectionCheckboxState()}selectionCheckboxChanged(){this.setSelectionCheckboxState()}setSelectionCheckboxState(){this.selectionCheckbox&&(this.ignoreSelectionChangeEvents=!0,this.selectionCheckbox.checked=this.selectionState===NR,this.selectionCheckbox.indeterminate=this.selectionState===LR,this.ignoreSelectionChangeEvents=!1)}}t([C],MF.prototype,"groupRowValue",void 0),t([C],MF.prototype,"nestingLevel",void 0),t([C],MF.prototype,"resolvedRowIndex",void 0),t([C],MF.prototype,"immediateChildCount",void 0),t([C],MF.prototype,"groupColumn",void 0),t([ft({mode:"boolean"})],MF.prototype,"expanded",void 0),t([ft({mode:"boolean"})],MF.prototype,"selectable",void 0),t([ft({attribute:"selection-state"})],MF.prototype,"selectionState",void 0),t([C],MF.prototype,"selectionCheckbox",void 0),t([C],MF.prototype,"animationClass",void 0)
|
|
11112
|
+
this.$emit("group-selection-toggle",n)}getFocusableElements(){return{selectionCheckbox:this.selectable?this.selectionCheckbox:void 0,cells:[]}}selectionStateChanged(){this.setSelectionCheckboxState()}selectionCheckboxChanged(){this.setSelectionCheckboxState()}setSelectionCheckboxState(){this.selectionCheckbox&&(this.ignoreSelectionChangeEvents=!0,this.selectionCheckbox.checked=this.selectionState===NR,this.selectionCheckbox.indeterminate=this.selectionState===LR,this.ignoreSelectionChangeEvents=!1)}}t([C],MF.prototype,"groupRowValue",void 0),t([C],MF.prototype,"nestingLevel",void 0),t([C],MF.prototype,"resolvedRowIndex",void 0),t([C],MF.prototype,"immediateChildCount",void 0),t([C],MF.prototype,"groupColumn",void 0),t([ft({mode:"boolean"})],MF.prototype,"expanded",void 0),t([ft({mode:"boolean"})],MF.prototype,"selectable",void 0),t([ft({attribute:"selection-state"})],MF.prototype,"selectionState",void 0),t([C],MF.prototype,"selectionCheckbox",void 0),t([C],MF.prototype,"animationClass",void 0),t([ft({attribute:"allow-hover",mode:"boolean"})],MF.prototype,"allowHover",void 0)
|
|
11113
11113
|
const $F=MF.compose({baseName:"table-group-row",template:IF,styles:_F})
|
|
11114
11114
|
_i.getOrCreate().withPrefix("nimble").register($F())
|
|
11115
11115
|
const EF="nimble-table-group-row",DF=Q`
|
|
@@ -11235,6 +11235,7 @@ const EF="nimble-table-group-row",DF=Q`
|
|
|
11235
11235
|
?selectable="${(t,e)=>e.parent.selectionMode===RR.multiple}"
|
|
11236
11236
|
selection-state="${(t,e)=>e.parent.tableData[t.index]?.selectionState}"
|
|
11237
11237
|
:resolvedRowIndex="${t=>t.index}"
|
|
11238
|
+
?allow-hover="${(t,e)=>!e.parent.virtualizer.isScrolling}"
|
|
11238
11239
|
@focusin="${(t,e)=>e.parent.onRowFocusIn(e.event)}"
|
|
11239
11240
|
@blur="${(t,e)=>e.parent.onRowBlur(e.event)}"
|
|
11240
11241
|
@group-selection-toggle="${(t,e)=>e.parent.onRowSelectionToggle(t.index,e.event)}"
|
|
@@ -11260,6 +11261,7 @@ const EF="nimble-table-group-row",DF=Q`
|
|
|
11260
11261
|
?row-operation-grid-cell-hidden="${(t,e)=>!e.parent.showRowOperationColumn}"
|
|
11261
11262
|
?loading="${(t,e)=>e.parent.tableData[t.index]?.isLoadingChildren}"
|
|
11262
11263
|
:resolvedRowIndex="${t=>t.index}"
|
|
11264
|
+
?allow-hover="${(t,e)=>!e.parent.virtualizer.isScrolling}"
|
|
11263
11265
|
@click="${(t,e)=>e.parent.onRowClick(t.index,e.event)}"
|
|
11264
11266
|
@focusin="${(t,e)=>e.parent.onRowFocusIn(e.event)}"
|
|
11265
11267
|
@blur="${(t,e)=>e.parent.onRowBlur(e.event)}"
|
|
@@ -11376,21 +11378,21 @@ const UF=(t,e,n,i)=>{for(;t<=e;){const s=(t+e)/2|0,o=n(s)
|
|
|
11376
11378
|
if(o<i)t=s+1
|
|
11377
11379
|
else{if(!(o>i))return s
|
|
11378
11380
|
e=s-1}}return t>0?t-1:0}
|
|
11379
|
-
class qF{get pageSize(){return this._pageSize}get rowHeight(){return parseFloat(Pl.getValueFor(this.table))+2*parseFloat(jl.getValueFor(this.table))}constructor(t,e){this.visibleItems=[],this.scrollHeight=0,this.headerContainerMarginRight=0,this.rowContainerYOffset=0,this._pageSize=0,this.table=t,this.tanStackTable=e,this.viewportResizeObserver=new ResizeObserver((t=>{const e=t[0]?.borderBoxSize[0]
|
|
11381
|
+
class qF{get pageSize(){return this._pageSize}get rowHeight(){return parseFloat(Pl.getValueFor(this.table))+2*parseFloat(jl.getValueFor(this.table))}constructor(t,e){this.visibleItems=[],this.scrollHeight=0,this.isScrolling=!1,this.headerContainerMarginRight=0,this.rowContainerYOffset=0,this._pageSize=0,this.isScrollingTimer=0,this.table=t,this.tanStackTable=e,this.viewportResizeObserver=new ResizeObserver((t=>{const e=t[0]?.borderBoxSize[0]
|
|
11380
11382
|
if(e){this.updatePageSize()
|
|
11381
11383
|
const t=e.inlineSize
|
|
11382
11384
|
this.headerContainerMarginRight=t-this.table.viewport.clientWidth}}))}connect(){this.viewportResizeObserver.observe(this.table.viewport),this.updateVirtualizer()
|
|
11383
11385
|
const t=this.virtualizer.scrollOffset
|
|
11384
11386
|
null!==t&&this.table.viewport.scrollTo({top:t})}disconnect(){this.viewportResizeObserver.disconnect()}dataChanged(){this.table.$fastController.isConnected&&this.updateVirtualizer()}scrollToIndex(t,e){this.virtualizer?.scrollToIndex(t,e)}updateVirtualizer(){const t=this.createVirtualizerOptions()
|
|
11385
11387
|
this.virtualizer?this.virtualizer.setOptions(t):this.virtualizer=new HF(t),this.virtualizer._willUpdate(),this.handleVirtualizerChange()}createVirtualizerOptions(){const t=this.rowHeight
|
|
11386
|
-
return{count:this.tanStackTable.getRowModel().rows.length,getScrollElement:()=>this.table.viewport,estimateSize:e=>t,enableSmoothScroll:!0,overscan:3,
|
|
11387
|
-
this.visibleItems=t.getVirtualItems(),this.scrollHeight=t.getTotalSize()
|
|
11388
|
+
return{count:this.tanStackTable.getRowModel().rows.length,getScrollElement:()=>this.table.viewport,estimateSize:e=>t,enableSmoothScroll:!0,overscan:3,isScrollingResetDelay:250,scrollToFn:VF,observeElementOffset:PF,observeElementRect:NF,onChange:()=>this.handleVirtualizerChange()}}handleVirtualizerChange(){const t=this.virtualizer
|
|
11389
|
+
this.visibleItems=t.getVirtualItems(),this.scrollHeight=t.getTotalSize(),this.isScrolling=t.isScrolling,window.clearTimeout(this.isScrollingTimer),this.isScrolling&&(this.isScrollingTimer=window.setTimeout((()=>{this.isScrolling=!1}),300))
|
|
11388
11390
|
let e=0
|
|
11389
11391
|
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 jF(t){switch(t){case ZR:return GF
|
|
11390
11392
|
case KR:return WF
|
|
11391
11393
|
default:return GF}}function WF(t,e,n){const i=t.getValue(n),s=e.getValue(n)
|
|
11392
11394
|
return"string"==typeof i&&"string"==typeof s?i.localeCompare(s):i===s?0:void 0===i||null===i&&void 0!==s?-1:1}function GF(t,e,n){const i=t.getValue(n),s=e.getValue(n)
|
|
11393
|
-
return Object.is(i,s)?0:void 0===i?-1:void 0===s?1:null===i?-1:null===s?1:Number.isNaN(i)?-1:Number.isNaN(s)?1:0===i&&0===s?Object.is(i,-0)?-1:1:i>s?1:-1}t([C],qF.prototype,"visibleItems",void 0),t([C],qF.prototype,"scrollHeight",void 0),t([C],qF.prototype,"headerContainerMarginRight",void 0),t([C],qF.prototype,"rowContainerYOffset",void 0)
|
|
11395
|
+
return Object.is(i,s)?0:void 0===i?-1:void 0===s?1:null===i?-1:null===s?1:Number.isNaN(i)?-1:Number.isNaN(s)?1:0===i&&0===s?Object.is(i,-0)?-1:1:i>s?1:-1}t([C],qF.prototype,"visibleItems",void 0),t([C],qF.prototype,"scrollHeight",void 0),t([C],qF.prototype,"isScrolling",void 0),t([C],qF.prototype,"headerContainerMarginRight",void 0),t([C],qF.prototype,"rowContainerYOffset",void 0)
|
|
11394
11396
|
class ZF{constructor(t){this.table=t,this.isColumnBeingSized=!1,this.visibleColumns=[],this.currentTotalDelta=0,this.dragStart=0,this.initialColumnWidths=[],this.onDividerMouseMove=t=>{const e=t
|
|
11395
11397
|
for(let t=0;t<this.visibleColumns.length;t++)this.visibleColumns[t].columnInternals.currentPixelWidth=this.initialColumnWidths[t]?.initialPixelWidth
|
|
11396
11398
|
this.currentTotalDelta=this.getAllowedSizeDelta(e.clientX-this.dragStart),this.performCascadeSizeLeft(this.leftColumnIndex,this.currentTotalDelta),this.performCascadeSizeRight(this.rightColumnIndex,this.currentTotalDelta)
|