@ni/spright-components 1.0.37 → 1.0.38
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.
|
@@ -10224,10 +10224,10 @@ return m._valuesCache[e]}if(m._groupingValuesCache.hasOwnProperty(e))return m._g
|
|
|
10224
10224
|
const s=t.getColumn(e),o=null==s?void 0:s.getAggregationFn()
|
|
10225
10225
|
return o?(m._groupingValuesCache[e]=o(e,f,h),m._groupingValuesCache[e]):void 0}}),p.forEach((t=>{s.push(t),o[t.id]=t})),m}))
|
|
10226
10226
|
return d},a=r(n.rows,0)
|
|
10227
|
-
return a.forEach((t=>{s.push(t),o[t.id]=t})),{rows:a,flatRows:s,rowsById:o}}),eO(t.options,"debugTable",0,(()=>{t._queue((()=>{t._autoResetExpanded(),t._autoResetPageIndex()}))})))}const YO=void 0,XO="can-load-children",JO="loading-children",QO={none:void 0,ascending:"ascending",descending:"descending"},tR={none:void 0,single:"single",multiple:"multiple"},eR="not-selected",nR="selected",iR="partially-selected",sR="
|
|
10228
|
-
class
|
|
10229
|
-
const
|
|
10230
|
-
try{e=document.createElement(t)}catch(t){}if(!(e instanceof
|
|
10227
|
+
return a.forEach((t=>{s.push(t),o[t.id]=t})),{rows:a,flatRows:s,rowsById:o}}),eO(t.options,"debugTable",0,(()=>{t._queue((()=>{t._autoResetExpanded(),t._autoResetPageIndex()}))})))}const YO=void 0,XO="can-load-children",JO="loading-children",QO={none:void 0,ascending:"ascending",descending:"descending"},tR={none:void 0,single:"single",multiple:"multiple"},eR="not-selected",nR="selected",iR="partially-selected",sR="left",oR="right",rR="none",aR="columnHeader",lR="headerActions",cR="row",dR="rowSelectionCheckbox",hR="cell",uR="cellActionMenu",pR="cellContent",fR="basic",mR="localeAwareCaseSensitive",gR=117,vR=1
|
|
10228
|
+
class bR extends We{}t([C],bR.prototype,"groupHeaderValue",void 0),t([C],bR.prototype,"columnConfig",void 0)
|
|
10229
|
+
const yR=t=>((t=>{let e
|
|
10230
|
+
try{e=document.createElement(t)}catch(t){}if(!(e instanceof bR))throw new Error(`Group header view tag name (${t}) must evaluate to an element extending TableGroupHeaderView`)})(t),Q`
|
|
10231
10231
|
<${t}
|
|
10232
10232
|
:groupHeaderValue="${t=>t.groupRowValue}"
|
|
10233
10233
|
:columnConfig="${t=>t.groupColumn?.columnInternals.columnConfig}"
|
|
@@ -10235,11 +10235,11 @@ try{e=document.createElement(t)}catch(t){}if(!(e instanceof gR))throw new Error(
|
|
|
10235
10235
|
>
|
|
10236
10236
|
</${t}>
|
|
10237
10237
|
`)
|
|
10238
|
-
class
|
|
10238
|
+
class wR extends We{constructor(){super(...arguments),this.delegatedEvents=[],this.delegatedEventHandler=()=>{}}get tabbableChildren(){return[]}focusedRecycleCallback(){}columnChanged(){for(const t of this.delegatedEvents)this.removeEventListener(t,this.delegatedEventHandler)
|
|
10239
10239
|
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}}))}
|
|
10240
|
-
for(const t of this.delegatedEvents)this.addEventListener(t,this.delegatedEventHandler)}}}function
|
|
10241
|
-
const
|
|
10242
|
-
try{e=document.createElement(t)}catch(t){}if(!(e instanceof
|
|
10240
|
+
for(const t of this.delegatedEvents)this.addEventListener(t,this.delegatedEventHandler)}}}function xR(t,e){return`${t}-${e}`}function CR(t,e){return xR(t.columnInternals.uniqueId,e)}t([C],wR.prototype,"cellRecord",void 0),t([C],wR.prototype,"columnConfig",void 0),t([C],wR.prototype,"column",void 0),t([C],wR.prototype,"recordId",void 0)
|
|
10241
|
+
const kR=t=>((t=>{let e
|
|
10242
|
+
try{e=document.createElement(t)}catch(t){}if(!(e instanceof wR))throw new Error(`Cell view tag name (${t}) must evaluate to an element extending TableCellView`)})(t),Q`
|
|
10243
10243
|
<${t}
|
|
10244
10244
|
:cellRecord="${t=>t.cellState?.cellRecord}"
|
|
10245
10245
|
:columnConfig="${t=>t.cellState?.columnConfig}"
|
|
@@ -10249,16 +10249,16 @@ try{e=document.createElement(t)}catch(t){}if(!(e instanceof bR))throw new Error(
|
|
|
10249
10249
|
>
|
|
10250
10250
|
${Qt((t=>t.column?.columnInternals.slotNames||[]),Q`
|
|
10251
10251
|
<slot
|
|
10252
|
-
name="${(t,e)=>
|
|
10252
|
+
name="${(t,e)=>CR(e.parent.column,t)}"
|
|
10253
10253
|
slot="${t=>t}"
|
|
10254
10254
|
></slot>
|
|
10255
10255
|
`)}
|
|
10256
10256
|
</${t}>
|
|
10257
10257
|
`)
|
|
10258
|
-
class
|
|
10259
|
-
return!1}t([C],
|
|
10260
|
-
class
|
|
10261
|
-
class
|
|
10258
|
+
class SR{constructor(t){this.uniqueId=Ha("table-column-slot"),this.sortOperation=fR,this.dataRecordFieldNames=[],this.groupingDisabled=!0,this.fractionalWidth=vR,this.minPixelWidth=gR,this.resizingDisabled=!1,this.hideHeaderIndicators=!1,this.headerAlignment=sR,this.currentFractionalWidth=vR,this.sortingDisabled=!0,this.currentSortDirection=QO.none,this.cellRecordFieldNames=t.cellRecordFieldNames,this.cellViewTemplate=kR(t.cellViewTag),t.groupHeaderViewTag&&(this.groupHeaderViewTemplate=yR(t.groupHeaderViewTag)),this.delegatedEvents=t.delegatedEvents,this.slotNames=t.slotNames??[],this.sortOperation=t.sortOperation??fR,this.validator=t.validator}fractionalWidthChanged(){this.currentFractionalWidth=this.fractionalWidth}pixelWidthChanged(){this.currentPixelWidth=this.pixelWidth}}function _R(t,...e){for(const n of e)if(t===n)return!0
|
|
10259
|
+
return!1}t([C],SR.prototype,"columnConfig",void 0),t([C],SR.prototype,"operandDataRecordFieldName",void 0),t([C],SR.prototype,"sortOperation",void 0),t([C],SR.prototype,"dataRecordFieldNames",void 0),t([C],SR.prototype,"groupingDisabled",void 0),t([C],SR.prototype,"groupIndex",void 0),t([C],SR.prototype,"pixelWidth",void 0),t([C],SR.prototype,"fractionalWidth",void 0),t([C],SR.prototype,"minPixelWidth",void 0),t([C],SR.prototype,"resizingDisabled",void 0),t([C],SR.prototype,"hideHeaderIndicators",void 0),t([C],SR.prototype,"headerAlignment",void 0),t([C],SR.prototype,"currentFractionalWidth",void 0),t([C],SR.prototype,"currentPixelWidth",void 0),t([C],SR.prototype,"sortingDisabled",void 0),t([C],SR.prototype,"currentSortIndex",void 0),t([C],SR.prototype,"currentSortDirection",void 0)
|
|
10260
|
+
class IR extends We{constructor(){super(...arguments),this.columnInternals=new SR(this.getColumnInternalsOptions()),this.columnHidden=!1,this.hasOverflow=!1}checkValidity(){return this.columnInternals.validator.isColumnValid}get validity(){return this.columnInternals.validator.getValidity()}get headerTextContent(){return this.contentSlot.assignedNodes().map((t=>t.textContent?.trim())).join(" ")}connectedCallback(){super.connectedCallback(),this.setAttribute("slot",this.columnInternals.uniqueId)}}t([ft({attribute:"column-id"})],IR.prototype,"columnId",void 0),t([ft({attribute:"action-menu-slot"})],IR.prototype,"actionMenuSlot",void 0),t([ft({attribute:"action-menu-label"})],IR.prototype,"actionMenuLabel",void 0),t([ft({attribute:"column-hidden",mode:"boolean"})],IR.prototype,"columnHidden",void 0),t([C],IR.prototype,"hasOverflow",void 0)
|
|
10261
|
+
class MR{constructor(){this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.duplicateColumnId=!1,this.missingColumnId=!1,this.duplicateSortIndex=!1,this.duplicateGroupIndex=!1,this.idFieldNameNotConfigured=!1,this.invalidColumnConfiguration=!1,this.invalidParentIdConfiguration=!1,this.recordIds=new Set}getValidity(){return{duplicateRecordId:this.duplicateRecordId,missingRecordId:this.missingRecordId,invalidRecordId:this.invalidRecordId,duplicateColumnId:this.duplicateColumnId,missingColumnId:this.missingColumnId,duplicateSortIndex:this.duplicateSortIndex,duplicateGroupIndex:this.duplicateGroupIndex,idFieldNameNotConfigured:this.idFieldNameNotConfigured,invalidColumnConfiguration:this.invalidColumnConfiguration,invalidParentIdConfiguration:this.invalidParentIdConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!1===t))}areRecordIdsValid(){const t=this.getValidity()
|
|
10262
10262
|
return!t.duplicateRecordId&&!t.missingRecordId&&!t.invalidRecordId}validateIdFieldConfiguration(t,e,n){const i=t!==tR.none||"string"==typeof n
|
|
10263
10263
|
return this.idFieldNameNotConfigured=!!i&&"string"!=typeof e,!this.idFieldNameNotConfigured}validateRecordIds(t,e){if(this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.recordIds.clear(),"string"!=typeof e)return!0
|
|
10264
10264
|
for(const n of t){if(!Object.prototype.hasOwnProperty.call(n,e)){this.missingRecordId=!0
|
|
@@ -10268,7 +10268,7 @@ const e=t.some((t=>t))
|
|
|
10268
10268
|
if(!e)return!0
|
|
10269
10269
|
const n=new Set
|
|
10270
10270
|
for(const e of t)e?(n.has(e)&&(this.duplicateColumnId=!0),n.add(e)):this.missingColumnId=!0
|
|
10271
|
-
return!this.missingColumnId&&!this.duplicateColumnId}validateColumnSortIndices(t){return this.duplicateSortIndex=!this.validateIndicesAreUnique(t),!this.duplicateSortIndex}validateColumnGroupIndices(t){return this.duplicateGroupIndex=!this.validateIndicesAreUnique(t),!this.duplicateGroupIndex}validateColumnConfigurations(t){return this.invalidColumnConfiguration=t.some((t=>!t.columnInternals.validator.isColumnValid)),!this.invalidColumnConfiguration}getPresentRecordIds(t){return t.filter((t=>this.recordIds.has(t)))}getOptionsWithPresentIds(t){return t.filter((t=>this.recordIds.has(t.recordId)))}setParentIdConfigurationValidity(t){this.invalidParentIdConfiguration=!t}validateIndicesAreUnique(t){return new Set(t).size===t.length}}const
|
|
10271
|
+
return!this.missingColumnId&&!this.duplicateColumnId}validateColumnSortIndices(t){return this.duplicateSortIndex=!this.validateIndicesAreUnique(t),!this.duplicateSortIndex}validateColumnGroupIndices(t){return this.duplicateGroupIndex=!this.validateIndicesAreUnique(t),!this.duplicateGroupIndex}validateColumnConfigurations(t){return this.invalidColumnConfiguration=t.some((t=>!t.columnInternals.validator.isColumnValid)),!this.invalidColumnConfiguration}getPresentRecordIds(t){return t.filter((t=>this.recordIds.has(t)))}getOptionsWithPresentIds(t){return t.filter((t=>this.recordIds.has(t.recordId)))}setParentIdConfigurationValidity(t){this.invalidParentIdConfiguration=!t}validateIndicesAreUnique(t){return new Set(t).size===t.length}}const $R=Mt`
|
|
10272
10272
|
${Vs("flex")}
|
|
10273
10273
|
|
|
10274
10274
|
:host {
|
|
@@ -10466,21 +10466,28 @@ return!this.missingColumnId&&!this.duplicateColumnId}validateColumnSortIndices(t
|
|
|
10466
10466
|
background-color: ${Fo(uo,.1)};
|
|
10467
10467
|
position: absolute;
|
|
10468
10468
|
}
|
|
10469
|
-
`)),
|
|
10469
|
+
`)),ER=Mt`
|
|
10470
10470
|
${Vs("flex")}
|
|
10471
10471
|
|
|
10472
10472
|
:host {
|
|
10473
10473
|
height: ${kl};
|
|
10474
10474
|
align-items: center;
|
|
10475
|
-
padding:
|
|
10475
|
+
padding-left: ${Il};
|
|
10476
|
+
padding-right: ${_l};
|
|
10476
10477
|
font: ${Nd};
|
|
10477
10478
|
color: ${Ld};
|
|
10478
10479
|
${pl.cssCustomProperty}: ${Ld};
|
|
10479
10480
|
text-transform: uppercase;
|
|
10480
|
-
gap: ${
|
|
10481
|
+
gap: ${_l};
|
|
10481
10482
|
cursor: default;
|
|
10482
10483
|
}
|
|
10483
10484
|
|
|
10485
|
+
:host(.right-align) {
|
|
10486
|
+
flex-direction: row-reverse;
|
|
10487
|
+
padding-left: ${_l};
|
|
10488
|
+
padding-right: ${Il};
|
|
10489
|
+
}
|
|
10490
|
+
|
|
10484
10491
|
:host(${Hs}) {
|
|
10485
10492
|
outline: calc(2 * ${El}) solid ${ul};
|
|
10486
10493
|
outline-offset: calc(-2 * ${El});
|
|
@@ -10490,8 +10497,9 @@ return!this.missingColumnId&&!this.duplicateColumnId}validateColumnSortIndices(t
|
|
|
10490
10497
|
.grouped-indicator {
|
|
10491
10498
|
flex: 0 0 auto;
|
|
10492
10499
|
}
|
|
10493
|
-
|
|
10500
|
+
`,DR=Q`
|
|
10494
10501
|
<template role="columnheader"
|
|
10502
|
+
class="${t=>t.alignment===oR?"right-align":""}"
|
|
10495
10503
|
aria-sort="${t=>t.ariaSort}"
|
|
10496
10504
|
${""}
|
|
10497
10505
|
@mousedown="${(t,e)=>!(e.event.detail>1)}"
|
|
@@ -10525,10 +10533,10 @@ return!this.missingColumnId&&!this.duplicateColumnId}validateColumnSortIndices(t
|
|
|
10525
10533
|
`)}
|
|
10526
10534
|
</template>
|
|
10527
10535
|
`
|
|
10528
|
-
class
|
|
10529
|
-
const
|
|
10530
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
10531
|
-
const
|
|
10536
|
+
class AR extends We{constructor(){super(...arguments),this.sortDirection=QO.none,this.firstSortedColumn=!1,this.indicatorsHidden=!1,this.alignment=sR,this.isGrouped=!1}sortDirectionChanged(t,e){this.updateAriaSort()}firstSortedColumnChanged(t,e){this.updateAriaSort()}updateAriaSort(){this.firstSortedColumn&&this.sortDirection!==QO.none?this.sortDirection===QO.ascending?this.ariaSort="ascending":this.ariaSort="descending":this.ariaSort=null}}t([ft({attribute:"sort-direction"})],AR.prototype,"sortDirection",void 0),t([ft({attribute:"first-sorted-column",mode:"boolean"})],AR.prototype,"firstSortedColumn",void 0),t([ft({attribute:"indicators-hidden",mode:"boolean"})],AR.prototype,"indicatorsHidden",void 0),t([C],AR.prototype,"alignment",void 0),t([C],AR.prototype,"isGrouped",void 0)
|
|
10537
|
+
const TR=AR.compose({baseName:"table-header",template:DR,styles:ER})
|
|
10538
|
+
_i.getOrCreate().withPrefix("nimble").register(TR())
|
|
10539
|
+
const OR="nimble-table-header",RR=Mt`
|
|
10532
10540
|
:host .animating {
|
|
10533
10541
|
transition: ${jd} ease-in;
|
|
10534
10542
|
}
|
|
@@ -10551,9 +10559,9 @@ const AR="nimble-table-header",TR=Mt`
|
|
|
10551
10559
|
transition-duration: 0s;
|
|
10552
10560
|
}
|
|
10553
10561
|
}
|
|
10554
|
-
`,
|
|
10562
|
+
`,FR=Mt`
|
|
10555
10563
|
${Vs("flex")}
|
|
10556
|
-
${
|
|
10564
|
+
${RR}
|
|
10557
10565
|
|
|
10558
10566
|
:host {
|
|
10559
10567
|
width: fit-content;
|
|
@@ -10715,7 +10723,7 @@ const AR="nimble-table-header",TR=Mt`
|
|
|
10715
10723
|
:host([selected]:hover)::before {
|
|
10716
10724
|
background-color: ${Fo(uo,.2)};
|
|
10717
10725
|
}
|
|
10718
|
-
`)),
|
|
10726
|
+
`)),NR=Mt`
|
|
10719
10727
|
${Vs("flex")}
|
|
10720
10728
|
|
|
10721
10729
|
:host {
|
|
@@ -10757,7 +10765,7 @@ const AR="nimble-table-header",TR=Mt`
|
|
|
10757
10765
|
.action-menu.cell-action-menu-focused {
|
|
10758
10766
|
display: block;
|
|
10759
10767
|
}
|
|
10760
|
-
`,
|
|
10768
|
+
`,LR=Q`
|
|
10761
10769
|
<template role="cell" style="--ni-private-table-cell-nesting-level: ${t=>t.nestingLevel}"
|
|
10762
10770
|
@focusin="${t=>t.onCellFocusIn()}"
|
|
10763
10771
|
@blur="${t=>t.onCellBlur()}"
|
|
@@ -10785,10 +10793,10 @@ const AR="nimble-table-header",TR=Mt`
|
|
|
10785
10793
|
`)}
|
|
10786
10794
|
</template>
|
|
10787
10795
|
`
|
|
10788
|
-
class
|
|
10789
|
-
const
|
|
10790
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
10791
|
-
const
|
|
10796
|
+
class BR extends We{constructor(){super(...arguments),this.hasActionMenu=!1,this.menuOpen=!1,this.nestingLevel=0}get cellView(){return this.cellViewContainer.firstElementChild}onActionMenuBeforeToggle(t){this.$emit("cell-action-menu-beforetoggle",t.detail)}onActionMenuToggle(t){this.menuOpen=t.detail.newState,this.$emit("cell-action-menu-toggle",t.detail)}onActionMenuBlur(){this.$emit("cell-action-menu-blur",this)}onCellViewFocusIn(){this.$emit("cell-view-focus-in",this)}onCellFocusIn(){this.$emit("cell-focus-in",this)}onCellBlur(){this.$emit("cell-blur",this)}}t([C],BR.prototype,"cellState",void 0),t([C],BR.prototype,"column",void 0),t([C],BR.prototype,"recordId",void 0),t([ft({attribute:"column-id"})],BR.prototype,"columnId",void 0),t([ft({attribute:"has-action-menu",mode:"boolean"})],BR.prototype,"hasActionMenu",void 0),t([ft({attribute:"menu-open",mode:"boolean"})],BR.prototype,"menuOpen",void 0),t([ft({attribute:"action-menu-label"})],BR.prototype,"actionMenuLabel",void 0),t([C],BR.prototype,"cellViewTemplate",void 0),t([C],BR.prototype,"cellViewContainer",void 0),t([C],BR.prototype,"nestingLevel",void 0)
|
|
10797
|
+
const PR=BR.compose({baseName:"table-cell",template:LR,styles:NR})
|
|
10798
|
+
_i.getOrCreate().withPrefix("nimble").register(PR())
|
|
10799
|
+
const zR="nimble-table-cell",VR=Q`
|
|
10792
10800
|
<template
|
|
10793
10801
|
role="row"
|
|
10794
10802
|
aria-selected=${t=>t.ariaSelected}
|
|
@@ -10844,7 +10852,7 @@ const BR="nimble-table-cell",PR=Q`
|
|
|
10844
10852
|
>
|
|
10845
10853
|
${Qt((t=>t.columns),Q`
|
|
10846
10854
|
${Gt((t=>!t.columnHidden),Q`
|
|
10847
|
-
<${
|
|
10855
|
+
<${zR}
|
|
10848
10856
|
class="cell"
|
|
10849
10857
|
:cellState="${(t,e)=>e.parent.cellStates[e.index]}"
|
|
10850
10858
|
:cellViewTemplate="${t=>t.columnInternals.cellViewTemplate}"
|
|
@@ -10868,22 +10876,22 @@ const BR="nimble-table-cell",PR=Q`
|
|
|
10868
10876
|
|
|
10869
10877
|
${Qt((t=>t.columnInternals.slotNames),Q`
|
|
10870
10878
|
<slot
|
|
10871
|
-
name="${(t,e)=>
|
|
10872
|
-
slot="${(t,e)=>
|
|
10879
|
+
name="${(t,e)=>CR(e.parent,t)}"
|
|
10880
|
+
slot="${(t,e)=>CR(e.parent,t)}"
|
|
10873
10881
|
></slot>
|
|
10874
10882
|
`)}
|
|
10875
|
-
</${
|
|
10883
|
+
</${zR}>
|
|
10876
10884
|
`)}
|
|
10877
10885
|
`,{recycle:!1,positioning:!0})}
|
|
10878
10886
|
</span>
|
|
10879
10887
|
</template>
|
|
10880
10888
|
`
|
|
10881
|
-
class
|
|
10889
|
+
class HR extends We{constructor(){super(...arguments),this.selectable=!1,this.selected=!1,this.hideSelection=!1,this.expanded=!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
|
|
10882
10890
|
const e=t.target.checked
|
|
10883
10891
|
this.onSelectionChange(!e,e)}onSelectionChange(t,e){this.selected=e
|
|
10884
10892
|
const n={oldState:t,newState:e}
|
|
10885
|
-
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)}closeOpenActionMenus(){if(this.menuOpen){const t=Array.from(this.cellContainer.children).find((t=>t instanceof
|
|
10886
|
-
t?.actionMenuButton?.open&&t.actionMenuButton.toggleButton.control.click()}}handleChange(t,e){t instanceof
|
|
10893
|
+
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)}closeOpenActionMenus(){if(this.menuOpen){const t=Array.from(this.cellContainer.children).find((t=>t instanceof BR&&t.menuOpen))
|
|
10894
|
+
t?.actionMenuButton?.open&&t.actionMenuButton.toggleButton.control.click()}}handleChange(t,e){t instanceof SR&&"string"==typeof e&&(_R(e,"columnConfig")||_R(e,"dataRecordFieldNames"))&&this.updateCellStates()}getFocusableElements(){return{selectionCheckbox:this.showSelectionCheckbox?this.selectionCheckbox:void 0,cells:Array.from(this.cellContainer.querySelectorAll(zR)).map((t=>({cell:t,actionMenuButton:t.hasActionMenu?t.actionMenuButton:void 0})))}}onRowExpandToggle(t){const e={oldState:this.expanded,newState:!this.expanded,recordId:this.recordId}
|
|
10887
10895
|
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
|
|
10888
10896
|
const n={recordId:this.recordId,columnInternalId:t.columnInternals.uniqueId,slots:e.detail.slots}
|
|
10889
10897
|
this.$emit("row-slots-request",n)}emitActionMenuToggleEvent(t,e,n){const i={newState:e.newState,oldState:e.oldState,recordIds:[this.recordId],columnId:n.columnId}
|
|
@@ -10891,12 +10899,12 @@ this.$emit(t,i)}columnsChanged(){this.updateCellIndentLevels(),this.updateCellSt
|
|
|
10891
10899
|
return e.subscribe(this),e}))}updateCellStates(){this.cellStates=this.columns.map((t=>{const e=t.columnInternals.dataRecordFieldNames
|
|
10892
10900
|
let n
|
|
10893
10901
|
if(this.hasValidFieldNames(e)&&this.dataRecord){const i=e.map((t=>this.dataRecord[t]))
|
|
10894
|
-
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"})],
|
|
10895
|
-
const
|
|
10896
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
10897
|
-
const
|
|
10902
|
+
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"})],HR.prototype,"recordId",void 0),t([ft({mode:"boolean"})],HR.prototype,"selectable",void 0),t([ft({mode:"boolean"})],HR.prototype,"selected",void 0),t([ft({attribute:"hide-selection",mode:"boolean"})],HR.prototype,"hideSelection",void 0),t([ft({mode:"boolean"})],HR.prototype,"expanded",void 0),t([C],HR.prototype,"dataRecord",void 0),t([C],HR.prototype,"columns",void 0),t([C],HR.prototype,"currentActionMenuColumn",void 0),t([C],HR.prototype,"nestingLevel",void 0),t([C],HR.prototype,"resolvedRowIndex",void 0),t([ft({attribute:"is-parent-row",mode:"boolean"})],HR.prototype,"isParentRow",void 0),t([ft({attribute:"menu-open",mode:"boolean"})],HR.prototype,"menuOpen",void 0),t([ft({attribute:"row-operation-grid-cell-hidden",mode:"boolean"})],HR.prototype,"rowOperationGridCellHidden",void 0),t([ft({mode:"boolean"})],HR.prototype,"loading",void 0),t([C],HR.prototype,"cellIndentLevels",void 0),t([C],HR.prototype,"cellStates",void 0),t([C],HR.prototype,"selectionCheckbox",void 0),t([C],HR.prototype,"animationClass",void 0),t([k],HR.prototype,"isTopLevelParentRow",null),t([k],HR.prototype,"isNestedParent",null),t([k],HR.prototype,"showSelectionCheckbox",null),t([k],HR.prototype,"ariaSelected",null)
|
|
10903
|
+
const UR=HR.compose({baseName:"table-row",template:VR,styles:FR})
|
|
10904
|
+
_i.getOrCreate().withPrefix("nimble").register(UR())
|
|
10905
|
+
const qR="nimble-table-row",jR=Mt`
|
|
10898
10906
|
${Vs("grid")}
|
|
10899
|
-
${
|
|
10907
|
+
${RR}
|
|
10900
10908
|
|
|
10901
10909
|
:host {
|
|
10902
10910
|
align-items: center;
|
|
@@ -10982,7 +10990,7 @@ const HR="nimble-table-row",UR=Mt`
|
|
|
10982
10990
|
:host(:hover)::before {
|
|
10983
10991
|
background-color: ${Fo(uo,.1)};
|
|
10984
10992
|
}
|
|
10985
|
-
`)),
|
|
10993
|
+
`)),WR=Q`
|
|
10986
10994
|
<template
|
|
10987
10995
|
role="row"
|
|
10988
10996
|
@click=${t=>t.onGroupExpandToggle()}
|
|
@@ -11022,14 +11030,14 @@ const HR="nimble-table-row",UR=Mt`
|
|
|
11022
11030
|
</div>
|
|
11023
11031
|
</template>
|
|
11024
11032
|
`
|
|
11025
|
-
class
|
|
11033
|
+
class GR extends We{constructor(){super(...arguments),this.nestingLevel=0,this.expanded=!1,this.selectable=!1,this.selectionState=eR,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
|
|
11026
11034
|
const e=t.target.checked
|
|
11027
11035
|
this.selectionState=e?nR:eR
|
|
11028
11036
|
const n={oldState:!e,newState:e}
|
|
11029
|
-
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===iR,this.ignoreSelectionChangeEvents=!1)}}t([C],
|
|
11030
|
-
const
|
|
11031
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
11032
|
-
const
|
|
11037
|
+
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===iR,this.ignoreSelectionChangeEvents=!1)}}t([C],GR.prototype,"groupRowValue",void 0),t([C],GR.prototype,"nestingLevel",void 0),t([C],GR.prototype,"resolvedRowIndex",void 0),t([C],GR.prototype,"immediateChildCount",void 0),t([C],GR.prototype,"groupColumn",void 0),t([ft({mode:"boolean"})],GR.prototype,"expanded",void 0),t([ft({mode:"boolean"})],GR.prototype,"selectable",void 0),t([ft({attribute:"selection-state"})],GR.prototype,"selectionState",void 0),t([C],GR.prototype,"selectionCheckbox",void 0),t([C],GR.prototype,"animationClass",void 0)
|
|
11038
|
+
const ZR=GR.compose({baseName:"table-group-row",template:WR,styles:jR})
|
|
11039
|
+
_i.getOrCreate().withPrefix("nimble").register(ZR())
|
|
11040
|
+
const KR="nimble-table-group-row",YR=Q`
|
|
11033
11041
|
<template
|
|
11034
11042
|
role="treegrid"
|
|
11035
11043
|
${""}
|
|
@@ -11100,7 +11108,7 @@ const GR="nimble-table-group-row",ZR=Q`
|
|
|
11100
11108
|
@mousedown="${(t,e)=>e.parent.onLeftDividerMouseDown(e.event,e.index)}">
|
|
11101
11109
|
</div>
|
|
11102
11110
|
`)}
|
|
11103
|
-
<${
|
|
11111
|
+
<${OR}
|
|
11104
11112
|
class="header"
|
|
11105
11113
|
${""}
|
|
11106
11114
|
sort-direction="${t=>"number"==typeof t.columnInternals.currentSortIndex?t.columnInternals.currentSortDirection:QO.none}"
|
|
@@ -11108,10 +11116,11 @@ const GR="nimble-table-group-row",ZR=Q`
|
|
|
11108
11116
|
?indicators-hidden="${t=>t.columnInternals.hideHeaderIndicators}"
|
|
11109
11117
|
@keydown="${(t,e)=>e.parent.onHeaderKeyDown(t,e.event)}"
|
|
11110
11118
|
@click="${(t,e)=>e.parent.toggleColumnSort(t,e.event.shiftKey)}"
|
|
11119
|
+
:alignment="${t=>t.columnInternals.headerAlignment}"
|
|
11111
11120
|
:isGrouped=${t=>"number"==typeof t.columnInternals.groupIndex&&!t.columnInternals.groupingDisabled}
|
|
11112
11121
|
>
|
|
11113
11122
|
<slot name="${t=>t.slot}"></slot>
|
|
11114
|
-
</${
|
|
11123
|
+
</${OR}>
|
|
11115
11124
|
${Gt(((t,e)=>e.index<e.length-1),Q`
|
|
11116
11125
|
<div
|
|
11117
11126
|
class="
|
|
@@ -11132,12 +11141,12 @@ const GR="nimble-table-group-row",ZR=Q`
|
|
|
11132
11141
|
</div>
|
|
11133
11142
|
<div class="table-viewport" tabindex="-1" ${Ut("viewport")}>
|
|
11134
11143
|
<div class="table-scroll"></div>
|
|
11135
|
-
<div class="table-row-container ${t=>""+(t.showCollapseAll?"collapse-all-visible":"")}" ${oe({property:"rowElements",filter:te(`${
|
|
11144
|
+
<div class="table-row-container ${t=>""+(t.showCollapseAll?"collapse-all-visible":"")}" ${oe({property:"rowElements",filter:te(`${qR}, ${KR}`)})}
|
|
11136
11145
|
role="rowgroup">
|
|
11137
11146
|
${Gt((t=>t.columns.length>0&&t.canRenderRows),Q`
|
|
11138
11147
|
${Qt((t=>t.virtualizer.visibleItems),Q`
|
|
11139
11148
|
${Gt(((t,e)=>e.parent.tableData[t.index]?.isGroupRow),Q`
|
|
11140
|
-
<${
|
|
11149
|
+
<${KR}
|
|
11141
11150
|
class="group-row"
|
|
11142
11151
|
${""}
|
|
11143
11152
|
tabindex="-1"
|
|
@@ -11154,10 +11163,10 @@ const GR="nimble-table-group-row",ZR=Q`
|
|
|
11154
11163
|
@group-selection-toggle="${(t,e)=>e.parent.onRowSelectionToggle(t.index,e.event)}"
|
|
11155
11164
|
@group-expand-toggle="${(t,e)=>e.parent.handleGroupRowExpanded(t.index,e.event)}"
|
|
11156
11165
|
>
|
|
11157
|
-
</${
|
|
11166
|
+
</${KR}>
|
|
11158
11167
|
`)}
|
|
11159
11168
|
${Gt(((t,e)=>!e.parent.tableData[t.index]?.isGroupRow),Q`
|
|
11160
|
-
<${
|
|
11169
|
+
<${qR}
|
|
11161
11170
|
class="row"
|
|
11162
11171
|
${""}
|
|
11163
11172
|
tabindex="-1"
|
|
@@ -11196,7 +11205,7 @@ const GR="nimble-table-group-row",ZR=Q`
|
|
|
11196
11205
|
slot="${t=>t.slot}"
|
|
11197
11206
|
></slot>
|
|
11198
11207
|
`)}
|
|
11199
|
-
</${
|
|
11208
|
+
</${qR}>
|
|
11200
11209
|
`)}
|
|
11201
11210
|
`)}
|
|
11202
11211
|
`)}
|
|
@@ -11206,7 +11215,7 @@ const GR="nimble-table-group-row",ZR=Q`
|
|
|
11206
11215
|
</div>
|
|
11207
11216
|
</template>
|
|
11208
11217
|
`
|
|
11209
|
-
function
|
|
11218
|
+
function XR(t,e,n){let i,s=n.initialDeps??[]
|
|
11210
11219
|
return()=>{var o,r,a,l
|
|
11211
11220
|
let c
|
|
11212
11221
|
n.key&&(null==(o=n.debug)?void 0:o.call(n))&&(c=Date.now())
|
|
@@ -11215,11 +11224,11 @@ if(!(d.length!==s.length||d.some(((t,e)=>s[e]!==t))))return i
|
|
|
11215
11224
|
let h
|
|
11216
11225
|
if(s=d,n.key&&(null==(r=n.debug)?void 0:r.call(n))&&(h=Date.now()),i=e(...d),n.key&&(null==(a=n.debug)?void 0:a.call(n))){const t=Math.round(100*(Date.now()-c))/100,e=Math.round(100*(Date.now()-h))/100,i=e/16,s=(t,e)=>{for(t=String(t);t.length<e;)t=" "+t
|
|
11217
11226
|
return t}
|
|
11218
|
-
console.info(`%c⏱ ${s(e,5)} /${s(t,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(l=null==n?void 0:n.onChange)||l.call(n,i),i}}function
|
|
11219
|
-
return t}const
|
|
11220
|
-
return function(...s){t.clearTimeout(i),i=t.setTimeout((()=>e.apply(this,s)),n)}},
|
|
11227
|
+
console.info(`%c⏱ ${s(e,5)} /${s(t,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(l=null==n?void 0:n.onChange)||l.call(n,i),i}}function JR(t,e){if(void 0===t)throw new Error("Unexpected undefined")
|
|
11228
|
+
return t}const QR=(t,e,n)=>{let i
|
|
11229
|
+
return function(...s){t.clearTimeout(i),i=t.setTimeout((()=>e.apply(this,s)),n)}},tF=t=>t,eF=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),i=[]
|
|
11221
11230
|
for(let t=e;t<=n;t++)i.push(t)
|
|
11222
|
-
return i},
|
|
11231
|
+
return i},nF=(t,e)=>{const n=t.scrollElement
|
|
11223
11232
|
if(!n)return
|
|
11224
11233
|
const i=t.targetWindow
|
|
11225
11234
|
if(!i)return
|
|
@@ -11229,21 +11238,21 @@ if(s(n.getBoundingClientRect()),!i.ResizeObserver)return()=>{}
|
|
|
11229
11238
|
const o=new i.ResizeObserver((t=>{const e=t[0]
|
|
11230
11239
|
if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0]
|
|
11231
11240
|
if(t)return void s({width:t.inlineSize,height:t.blockSize})}s(n.getBoundingClientRect())}))
|
|
11232
|
-
return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},
|
|
11241
|
+
return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},iF={passive:!0},sF="undefined"==typeof window||"onscrollend"in window,oF=(t,e)=>{const n=t.scrollElement
|
|
11233
11242
|
if(!n)return
|
|
11234
11243
|
const i=t.targetWindow
|
|
11235
11244
|
if(!i)return
|
|
11236
11245
|
let s=0
|
|
11237
|
-
const o=
|
|
11238
|
-
return l(),n.addEventListener("scroll",a,
|
|
11239
|
-
if(t){return Math.round(t[n.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},
|
|
11246
|
+
const o=sF?()=>{}:QR(i,(()=>{e(s,!1)}),t.options.isScrollingResetDelay),r=i=>()=>{s=n[t.options.horizontal?"scrollLeft":"scrollTop"],o(),e(s,i)},a=r(!0),l=r(!1)
|
|
11247
|
+
return l(),n.addEventListener("scroll",a,iF),n.addEventListener("scrollend",l,iF),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},rF=(t,e,n)=>{if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0]
|
|
11248
|
+
if(t){return Math.round(t[n.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},aF=(t,{adjustments:e=0,behavior:n},i)=>{var s,o
|
|
11240
11249
|
const r=t+e
|
|
11241
11250
|
null==(o=null==(s=i.scrollElement)?void 0:s.scrollTo)||o.call(s,{[i.options.horizontal?"left":"top"]:r,behavior:n})}
|
|
11242
|
-
const
|
|
11251
|
+
const lF=(t,e,n,i)=>{for(;t<=e;){const s=(t+e)/2|0,o=n(s)
|
|
11243
11252
|
if(o<i)t=s+1
|
|
11244
11253
|
else{if(!(o>i))return s
|
|
11245
11254
|
e=s-1}}return t>0?t-1:0}
|
|
11246
|
-
class
|
|
11255
|
+
class cF{get pageSize(){return this._pageSize}get rowHeight(){return parseFloat(kl.getValueFor(this.table))+2*parseFloat(El.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]
|
|
11247
11256
|
if(e){this.updatePageSize()
|
|
11248
11257
|
const t=e.inlineSize
|
|
11249
11258
|
this.headerContainerMarginRight=t-this.table.viewport.clientWidth}}))}connect(){this.viewportResizeObserver.observe(this.table.viewport),this.updateVirtualizer()
|
|
@@ -11254,7 +11263,7 @@ const e=()=>t||(this.targetWindow&&this.targetWindow.ResizeObserver?t=new this.t
|
|
|
11254
11263
|
return{disconnect:()=>{var t
|
|
11255
11264
|
return null==(t=e())?void 0:t.disconnect()},observe:t=>{var n
|
|
11256
11265
|
return null==(n=e())?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n
|
|
11257
|
-
return null==(n=e())?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach((([e,n])=>{void 0===n&&delete t[e]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:
|
|
11266
|
+
return null==(n=e())?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach((([e,n])=>{void 0===n&&delete t[e]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tF,rangeExtractor:eF,onChange:()=>{},measureElement:rF,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...t}},this.notify=(t,e)=>{var n,i
|
|
11258
11267
|
const{startIndex:s,endIndex:o}=this.range??{startIndex:void 0,endIndex:void 0},r=this.calculateRange();(t||s!==(null==r?void 0:r.startIndex)||o!==(null==r?void 0:r.endIndex))&&(null==(i=(n=this.options).onChange)||i.call(n,this,e))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((t=>t())),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t
|
|
11259
11268
|
const e=this.options.enabled?this.options.getScrollElement():null
|
|
11260
11269
|
if(this.scrollElement!==e){if(this.cleanup(),!e)return void this.notify(!1,!1)
|
|
@@ -11264,7 +11273,7 @@ this.isScrolling=e,this.notify(n!==e,e)})))}},this.getSize=()=>this.options.enab
|
|
|
11264
11273
|
for(let s=e-1;s>=0;s--){const e=t[s]
|
|
11265
11274
|
if(n.has(e.lane))continue
|
|
11266
11275
|
const o=i.get(e.lane)
|
|
11267
|
-
if(null==o||e.end>o.end?i.set(e.lane,e):e.end<o.end&&n.set(e.lane,!0),n.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort(((t,e)=>t.end===e.end?t.index-e.index:t.end-e.end))[0]:void 0},this.getMeasurementOptions=
|
|
11276
|
+
if(null==o||e.end>o.end?i.set(e.lane,e):e.end<o.end&&n.set(e.lane,!0),n.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort(((t,e)=>t.end===e.end?t.index-e.index:t.end-e.end))[0]:void 0},this.getMeasurementOptions=XR((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((t,e,n,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:e,scrollMargin:n,getItemKey:i,enabled:s})),{key:!1}),this.getMeasurements=XR((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:t,paddingStart:e,scrollMargin:n,getItemKey:i,enabled:s},o)=>{var r
|
|
11268
11277
|
if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[]
|
|
11269
11278
|
0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((t=>{this.itemSizeCache.set(t.key,t.size)})))
|
|
11270
11279
|
const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0
|
|
@@ -11274,20 +11283,20 @@ for(let s=a;s<t;s++){let t=null==(r=this.measurementsCache[s])?void 0:r.measureE
|
|
|
11274
11283
|
t||(t=t=>{const e=i(s),n=this.elementsCache.get(e)
|
|
11275
11284
|
t?(n!==t&&(n&&this.observer.unobserve(n),this.observer.observe(t),this.elementsCache.set(e,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,void 0,this))):n&&(this.observer.unobserve(n),this.elementsCache.delete(e))})
|
|
11276
11285
|
const a=i(s),c=1===this.options.lanes?l[s-1]:this.getFurthestMeasurement(l,s),d=c?c.end+this.options.gap:e+n,h=o.get(a),u="number"==typeof h?h:this.options.estimateSize(s),p=d+u,f=c?c.lane:s%this.options.lanes
|
|
11277
|
-
l[s]={index:s,start:d,size:u,end:p,key:a,lane:f,measureElement:t}}return this.measurementsCache=l,l}),{key:!1,debug:()=>this.options.debug}),this.calculateRange=
|
|
11286
|
+
l[s]={index:s,start:d,size:u,end:p,key:a,lane:f,measureElement:t}}return this.measurementsCache=l,l}),{key:!1,debug:()=>this.options.debug}),this.calculateRange=XR((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((t,e,n)=>this.range=t.length>0&&e>0?function({measurements:t,outerSize:e,scrollOffset:n}){const i=t.length-1,s=lF(0,i,(e=>t[e].start),n)
|
|
11278
11287
|
let o=s
|
|
11279
11288
|
for(;o<i&&t[o].end<n+e;)o++
|
|
11280
|
-
return{startIndex:s,endIndex:o}}({measurements:t,outerSize:e,scrollOffset:n}):null),{key:!1,debug:()=>this.options.debug}),this.getIndexes=
|
|
11289
|
+
return{startIndex:s,endIndex:o}}({measurements:t,outerSize:e,scrollOffset:n}):null),{key:!1,debug:()=>this.options.debug}),this.getIndexes=XR((()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count]),((t,e,n,i)=>null===e?[]:t({startIndex:e.startIndex,endIndex:e.endIndex,overscan:n,count:i})),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const e=this.options.indexAttribute,n=t.getAttribute(e)
|
|
11281
11290
|
return n?parseInt(n,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this._measureElement=(t,e)=>{const n=this.indexFromElement(t),i=this.getMeasurements()[n]
|
|
11282
11291
|
if(!i||!t.isConnected)return void this.elementsCache.forEach(((e,n)=>{e===t&&(this.observer.unobserve(t),this.elementsCache.delete(n))}))
|
|
11283
11292
|
const s=this.elementsCache.get(i.key)
|
|
11284
11293
|
s!==t&&(s&&this.observer.unobserve(s),this.observer.observe(t),this.elementsCache.set(i.key,t)),this.resizeItem(n,this.options.measureElement(t,e,this))},this.resizeItem=(t,e)=>{const n=this.getMeasurements()[t]
|
|
11285
11294
|
if(!n)return
|
|
11286
11295
|
const i=e-(this.itemSizeCache.get(n.key)??n.size)
|
|
11287
|
-
0!==i&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,i,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,e)),this.notify(!0,!1))},this.measureElement=t=>{t&&this._measureElement(t,void 0)},this.getVirtualItems=
|
|
11296
|
+
0!==i&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,i,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,e)),this.notify(!0,!1))},this.measureElement=t=>{t&&this._measureElement(t,void 0)},this.getVirtualItems=XR((()=>[this.getIndexes(),this.getMeasurements()]),((t,e)=>{const n=[]
|
|
11288
11297
|
for(let i=0,s=t.length;i<s;i++){const s=e[t[i]]
|
|
11289
11298
|
n.push(s)}return n}),{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const e=this.getMeasurements()
|
|
11290
|
-
if(0!==e.length)return
|
|
11299
|
+
if(0!==e.length)return JR(e[lF(0,e.length-1,(t=>JR(e[t]).start),t)])},this.getOffsetForAlignment=(t,e)=>{const n=this.getSize(),i=this.getScrollOffset()
|
|
11291
11300
|
"auto"===e&&(e=t<=i?"start":t>=i+n?"end":"start"),"start"===e||("end"===e?t-=n:"center"===e&&(t-=n/2))
|
|
11292
11301
|
const s=this.options.horizontal?"scrollWidth":"scrollHeight",o=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-n
|
|
11293
11302
|
return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1))
|
|
@@ -11301,23 +11310,23 @@ return[this.getOffsetForAlignment(o,e),e]},this.isDynamicMode=()=>this.elementsC
|
|
|
11301
11310
|
const i=this.getOffsetForIndex(t,e)
|
|
11302
11311
|
if(!i)return
|
|
11303
11312
|
const[s,o]=i
|
|
11304
|
-
this._scrollToOffset(s,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[s]=
|
|
11313
|
+
this._scrollToOffset(s,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[s]=JR(this.getOffsetForIndex(t,o))
|
|
11305
11314
|
e=s,i=this.getScrollOffset(),Math.abs(e-i)<1||this.scrollToIndex(t,{align:o,behavior:n})}else this.scrollToIndex(t,{align:o,behavior:n})
|
|
11306
11315
|
var e,i})))},this.scrollBy=(t,{behavior:e}={})=>{this.cancelScrollToIndex(),"smooth"===e&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:e})},this.getTotalSize=()=>{var t
|
|
11307
11316
|
const e=this.getMeasurements()
|
|
11308
11317
|
let n
|
|
11309
11318
|
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
|
|
11310
11319
|
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
|
|
11311
|
-
return{count:this.tanStackTable.getRowModel().rows.length,getScrollElement:()=>this.table.viewport,estimateSize:e=>t,enableSmoothScroll:!0,overscan:3,scrollingDelay:5,scrollToFn:
|
|
11320
|
+
return{count:this.tanStackTable.getRowModel().rows.length,getScrollElement:()=>this.table.viewport,estimateSize:e=>t,enableSmoothScroll:!0,overscan:3,scrollingDelay:5,scrollToFn:aF,observeElementOffset:oF,observeElementRect:nF,onChange:()=>this.handleVirtualizerChange()}}handleVirtualizerChange(){this.table.handleFocusedCellRecycling()
|
|
11312
11321
|
const t=this.virtualizer
|
|
11313
11322
|
this.visibleItems=t.getVirtualItems(),this.scrollHeight=t.getTotalSize()
|
|
11314
11323
|
let e=0
|
|
11315
|
-
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
|
|
11316
|
-
case
|
|
11317
|
-
default:return
|
|
11318
|
-
return"string"==typeof i&&"string"==typeof s?i.localeCompare(s):i===s?0:void 0===i||null===i&&void 0!==s?-1:1}function
|
|
11319
|
-
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],
|
|
11320
|
-
class
|
|
11324
|
+
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 dF(t){switch(t){case fR:return uF
|
|
11325
|
+
case mR:return hF
|
|
11326
|
+
default:return uF}}function hF(t,e,n){const i=t.getValue(n),s=e.getValue(n)
|
|
11327
|
+
return"string"==typeof i&&"string"==typeof s?i.localeCompare(s):i===s?0:void 0===i||null===i&&void 0!==s?-1:1}function uF(t,e,n){const i=t.getValue(n),s=e.getValue(n)
|
|
11328
|
+
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],cF.prototype,"visibleItems",void 0),t([C],cF.prototype,"scrollHeight",void 0),t([C],cF.prototype,"headerContainerMarginRight",void 0),t([C],cF.prototype,"rowContainerYOffset",void 0)
|
|
11329
|
+
class pF{constructor(t){this.table=t,this.isColumnBeingSized=!1,this.visibleColumns=[],this.currentTotalDelta=0,this.dragStart=0,this.initialColumnWidths=[],this.onDividerMouseMove=t=>{const e=t
|
|
11321
11330
|
for(let t=0;t<this.visibleColumns.length;t++)this.visibleColumns[t].columnInternals.currentPixelWidth=this.initialColumnWidths[t]?.initialPixelWidth
|
|
11322
11331
|
this.currentTotalDelta=this.getAllowedSizeDelta(e.clientX-this.dragStart),this.performCascadeSizeLeft(this.leftColumnIndex,this.currentTotalDelta),this.performCascadeSizeRight(this.rightColumnIndex,this.currentTotalDelta)
|
|
11323
11332
|
const n=this.getTotalColumnFixedWidth()-this.initialColumnTotalWidth
|
|
@@ -11354,10 +11363,10 @@ for(const t of this.visibleColumns)this.initialColumnWidths.push({initalColumnFr
|
|
|
11354
11363
|
const t=this.gridSizedColumns.reduce(((t,e)=>t+e.columnInternals.currentPixelWidth),0),e=t/this.gridSizedColumns.length
|
|
11355
11364
|
let n=0
|
|
11356
11365
|
for(let t=0;t<this.visibleColumns.length&&n<this.gridSizedColumns.length;t++){const i=this.visibleColumns[t]
|
|
11357
|
-
i===this.gridSizedColumns[n]&&(n+=1,i.columnInternals.currentFractionalWidth=i.columnInternals.currentPixelWidth/e,i.columnInternals.currentPixelWidth=void 0)}}getVisibleColumns(){return this.table.columns.filter((t=>!t.columnHidden))}getLeftColumnIndexFromDivider(t){return Math.floor(t/2)}}t([C],
|
|
11358
|
-
const
|
|
11359
|
-
return!1},
|
|
11360
|
-
class
|
|
11366
|
+
i===this.gridSizedColumns[n]&&(n+=1,i.columnInternals.currentFractionalWidth=i.columnInternals.currentPixelWidth/e,i.columnInternals.currentPixelWidth=void 0)}}getVisibleColumns(){return this.table.columns.filter((t=>!t.columnHidden))}getLeftColumnIndexFromDivider(t){return Math.floor(t/2)}}t([C],pF.prototype,"isColumnBeingSized",void 0),t([C],pF.prototype,"activeColumnIndex",void 0),t([C],pF.prototype,"activeColumnDivider",void 0)
|
|
11367
|
+
const fF=(t,...e)=>{for(const n of e)if(t===n)return!0
|
|
11368
|
+
return!1},mF=["rowIds","rowParentIds","groupRows","columnIds","columnHidden","columnSort","columnSortDisabled","columnWidths","columnDefinition","actionMenuSlots","selectionMode"]
|
|
11369
|
+
class gF extends xE{constructor(t){super(mF),this.table=t,this.updateQueued=!1}get updateRowIds(){return this.isTracked("rowIds")}get updateRowParentIds(){return this.isTracked("rowParentIds")}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("rowParentIds")||this.isTracked("columnSort")||this.isTracked("columnDefinition")||this.isTracked("groupRows")||this.isTracked("selectionMode")}get requiresTanStackDataReset(){return this.isTracked("rowIds")||this.isTracked("columnDefinition")||this.isTracked("rowParentIds")}get requiresKeyboardFocusReset(){return this.isTracked("columnSortDisabled")||this.isTracked("columnDefinition")||this.isTracked("columnHidden")||this.isTracked("selectionMode")||this.isTracked("actionMenuSlots")}trackAllStateChanged(){this.trackAll(),this.queueUpdate()}get hasPendingUpdates(){return this.updateQueued}trackColumnPropertyChanged(t){fF(t,"columnId")?this.track("columnIds"):_R(t,"operandDataRecordFieldName","sortOperation")?this.track("columnDefinition"):_R(t,"sortingDisabled")?(this.track("columnSort"),this.track("columnSortDisabled")):_R(t,"currentSortDirection","currentSortIndex")?this.track("columnSort"):_R(t,"currentFractionalWidth","currentPixelWidth","minPixelWidth","resizingDisabled")?this.track("columnWidths"):fF(t,"columnHidden")?(this.track("columnWidths"),this.track("columnHidden")):fF(t,"actionMenuSlot")?this.track("actionMenuSlots"):_R(t,"groupIndex","groupingDisabled")&&this.track("groupRows"),this.queueUpdate()}trackColumnInstancesChanged(){this.track("columnIds"),this.track("columnDefinition"),this.track("columnSort"),this.track("columnSortDisabled"),this.track("columnWidths"),this.track("actionMenuSlots"),this.track("groupRows"),this.queueUpdate()}trackIdFieldNameChanged(){this.track("rowIds"),this.queueUpdate()}trackParentIdFieldNameChanged(){this.track("rowParentIds"),this.queueUpdate()}trackSelectionModeChanged(){this.track("selectionMode"),this.queueUpdate()}queueUpdate(){this.table.$fastController.isConnected&&(this.updateQueued||(this.updateQueued=!0,b.queueUpdate((()=>{this.table.update(),this.untrackAll(),this.updateQueued=!1}))))}}class vF{constructor(t){this.tanStackTable=t}reset(){}toggleIsRowSelected(t,e){t.isGroupRow&&t.selectionState===nR?this.deselectAllLeafRows(t.id):this.tanStackTable.getRow(t.id).toggleSelected(e,{selectChildren:t.isGroupRow})}selectSingleRow(t){if(t.isGroupRow)throw new Error("function not intended to select grouped rows")
|
|
11361
11370
|
const e=this.tanStackTable.getState().rowSelection,n=[]
|
|
11362
11371
|
if(Object.entries(e).forEach((([t,e])=>{e&&n.push(t)})),1===n.length&&n[0]===t.id)return!1
|
|
11363
11372
|
const i={}
|
|
@@ -11367,7 +11376,7 @@ this.tanStackTable.setRowSelection(i)}getAllLeafRowIds(t){const e=this.tanStackT
|
|
|
11367
11376
|
return e?.getIsGrouped()?e.getLeafRows().filter((t=>!t.getIsGrouped())).map((t=>t.id)):[]}getAllOrderedRows(){const t=this.tanStackTable.getPreExpandedRowModel().rows
|
|
11368
11377
|
return this.getOrderedRows(t)}getOrderedRows(t){const e=[]
|
|
11369
11378
|
for(const n of t)e.push(n),n.subRows?.length&&e.push(...this.getOrderedRows(n.subRows))
|
|
11370
|
-
return e}}class
|
|
11379
|
+
return e}}class bF extends vF{handleRowSelectionToggle(t,e,n){return!1}handleRowClick(t,e,n){return!1}handleActionMenuOpening(t){return!1}}class yF extends vF{handleRowSelectionToggle(t,e,n){return n&&this.tryUpdateRangeSelection(t.id)||(this.shiftSelectStartRowId=t.id,this.previousShiftSelectRowEndId=void 0,this.toggleIsRowSelected(t,e)),!0}handleRowClick(t,e,n){return n?(this.shiftSelectStartRowId=t.id,this.previousShiftSelectRowEndId=void 0,this.toggleIsRowSelected(t),!0):!(!e||!this.tryUpdateRangeSelection(t.id))||(this.shiftSelectStartRowId=t.id,this.previousShiftSelectRowEndId=void 0,this.selectSingleRow(t))}handleActionMenuOpening(t){return t.selectionState!==nR&&this.selectSingleRow(t)}reset(){this.shiftSelectStartRowId=void 0,this.previousShiftSelectRowEndId=void 0}tryUpdateRangeSelection(t){if(void 0===this.shiftSelectStartRowId)return!1
|
|
11371
11380
|
const e=this.getAllOrderedRows(),n=this.getRowIndexForId(this.shiftSelectStartRowId,e)
|
|
11372
11381
|
if(-1===n)return!1
|
|
11373
11382
|
const i=this.tanStackTable.getState().rowSelection
|
|
@@ -11377,20 +11386,20 @@ this.updateSelectionStateForRange(t,n,s,i,!0)}updateSelectionStateForRange(t,e,n
|
|
|
11377
11386
|
const o=Math.min(e,n),r=Math.max(e,n)
|
|
11378
11387
|
for(let e=o;e<=r;e++){const n=i[e]
|
|
11379
11388
|
n.getIsGrouped()||this.updateSelectionStateForRow(t,n.id,s)}const a=i[n]
|
|
11380
|
-
a.getIsGrouped()&&this.getAllLeafRowIds(a.id).forEach((e=>this.updateSelectionStateForRow(t,e,s)))}updateSelectionStateForRow(t,e,n){n?t[e]=!0:delete t[e]}getRowIndexForId(t,e){return t?e.findIndex((e=>e.id===t)):-1}}class
|
|
11389
|
+
a.getIsGrouped()&&this.getAllLeafRowIds(a.id).forEach((e=>this.updateSelectionStateForRow(t,e,s)))}updateSelectionStateForRow(t,e,n){n?t[e]=!0:delete t[e]}getRowIndexForId(t,e){return t?e.findIndex((e=>e.id===t)):-1}}class wF extends vF{handleRowSelectionToggle(t,e,n){return this.toggleIsRowSelected(t,e),!0}handleRowClick(t,e,n){return this.selectSingleRow(t)}handleActionMenuOpening(t){return this.handleRowClick(t,!1,!1)}}class xF{constructor(t,e){this.tanStackTable=t,this.selectionManager=this.createSelectionManager(e)}handleRowSelectionToggle(t,e,n){return!!t&&this.selectionManager.handleRowSelectionToggle(t,e,n)}handleRowClick(t,e,n){return!!t&&this.selectionManager.handleRowClick(t,e,n)}handleActionMenuOpening(t){return!!t&&this.selectionManager.handleActionMenuOpening(t)}handleSelectionModeChanged(t){this.selectionManager=this.createSelectionManager(t)}handleSelectionReset(){this.selectionManager.reset()}getCurrentSelectedRecordIds(){const t=this.tanStackTable.options.state.rowSelection
|
|
11381
11390
|
if(!t)return[]
|
|
11382
11391
|
const e=[]
|
|
11383
|
-
return Object.entries(t).forEach((([t,n])=>{n&&e.push(t)})),e}createSelectionManager(t){switch(t){case tR.multiple:return new
|
|
11384
|
-
case tR.single:return new
|
|
11385
|
-
case tR.none:return new
|
|
11386
|
-
default:throw new Error("unknown selection mode found")}}}function
|
|
11392
|
+
return Object.entries(t).forEach((([t,n])=>{n&&e.push(t)})),e}createSelectionManager(t){switch(t){case tR.multiple:return new yF(this.tanStackTable)
|
|
11393
|
+
case tR.single:return new wF(this.tanStackTable)
|
|
11394
|
+
case tR.none:return new bF(this.tanStackTable)
|
|
11395
|
+
default:throw new Error("unknown selection mode found")}}}function CF(t,e){const n=e,i=[],s={},o=new Set
|
|
11387
11396
|
for(let e=0;e<t.length;e++){const r=t[e],a=r[n.id],l=r[n.parentId]
|
|
11388
11397
|
Object.prototype.hasOwnProperty.call(s,a)||(s[a]={subRows:[],clientRecord:void 0,originalIndex:void 0}),o&&o.delete(a),s[a].clientRecord=r
|
|
11389
11398
|
const c=s[a]
|
|
11390
11399
|
c.originalIndex=e,null==l?i.push(c):(Object.prototype.hasOwnProperty.call(s,l)||(s[l]={subRows:[],clientRecord:void 0,originalIndex:void 0},o&&o.add(l)),s[l].subRows.push(c))}if(o?.size){const t=Array.from(o.values()).join(",")
|
|
11391
|
-
throw new Error(`The items array contains orphans that point to the following parentIds: [${t}]. These parentIds do not exist in the items array.`)}if(
|
|
11392
|
-
return i}function
|
|
11393
|
-
return this.getAllNodes(this._hierarchicalData,e),this.isDataFlat||!t?e.map((t=>t.clientRecord)):e.sort(((t,e)=>t.originalIndex-e.originalIndex)).map((t=>t.clientRecord))}getAllNodes(t,e){for(const n of t)e.push(n),n.subRows&&this.getAllNodes(n.subRows,e)}}class
|
|
11400
|
+
throw new Error(`The items array contains orphans that point to the following parentIds: [${t}]. These parentIds do not exist in the items array.`)}if(kF(i)<Object.keys(s).length)throw new Error("The items array contains nodes with a circular parent/child relationship.")
|
|
11401
|
+
return i}function kF(t){return t.reduce(((t,e)=>t+1+(e.subRows&&kF(e.subRows))),0)}class SF{constructor(t,e,n){if(this.isDataFlat=!1,"string"==typeof e&&"string"==typeof n)try{this._hierarchicalData=CF(t,{id:e,parentId:n}),this.isDataFlat=!1,this._parentIdConfigurationValid=!0}catch{this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:{...t},originalIndex:e}))),this._parentIdConfigurationValid=!1}else this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:{...t},originalIndex:e}))),this._parentIdConfigurationValid=!0}get hierarchicalData(){return this._hierarchicalData}get parentIdConfigurationValid(){return this._parentIdConfigurationValid}getAllRecords(t=!1){const e=[]
|
|
11402
|
+
return this.getAllNodes(this._hierarchicalData,e),this.isDataFlat||!t?e.map((t=>t.clientRecord)):e.sort(((t,e)=>t.originalIndex-e.originalIndex)).map((t=>t.clientRecord))}getAllNodes(t,e){for(const n of t)e.push(n),n.subRows&&this.getAllNodes(n.subRows,e)}}class _F{constructor(t){this.tanStackTable=t,this.explicitExpansionStates=new Map,this.hierarchyOptions=new Map,this.isHierarchyEnabled=!1,this.parentRowsWithChildren=new Set}isRowExpanded(t){if(!this.isRowExpandable(t))return!1
|
|
11394
11403
|
return this.explicitExpansionStates.get(t.id)??this.getDefaultExpansionState(t)}toggleRowExpansion(t){if(!this.isRowExpandable(t))return
|
|
11395
11404
|
const e=this.isRowExpanded(t)
|
|
11396
11405
|
this.explicitExpansionStates.set(t.id,!e),t.toggleExpanded()}collapseAll(){this.resetExpansionState()
|
|
@@ -11405,15 +11414,15 @@ for(const{recordId:n,options:i}of t){e.set(n,i)
|
|
|
11405
11414
|
const t=this.hierarchyOptions.get(n)?.delayedHierarchyState,s=i.delayedHierarchyState
|
|
11406
11415
|
t!==JO||s!==XO||this.parentRowsWithChildren.has(n)||this.explicitExpansionStates.delete(n)}this.hierarchyOptions=e}isRowExpandable(t){return t.subRows.length>0||this.canLoadDelayedChildren(t.id)}setHierarchyEnabled(t){this.isHierarchyEnabled=t}isLoadingChildren(t){return!!this.isHierarchyEnabled&&(this.hierarchyOptions.get(t)?.delayedHierarchyState===JO??!1)}canLoadDelayedChildren(t){if(!this.isHierarchyEnabled)return!1
|
|
11407
11416
|
const e=this.hierarchyOptions.get(t)?.delayedHierarchyState
|
|
11408
|
-
return e!==YO}getDefaultExpansionState(t){return 0!==t.subRows.length}}class
|
|
11409
|
-
class
|
|
11417
|
+
return e!==YO}getDefaultExpansionState(t){return 0!==t.subRows.length}}class IF extends wE{isValid(){return this.noneTracked()}getValidationFlags(){return this.getTrackedItems()}}class MF extends IF{constructor(t){super(t),this.isColumnValid=!0}getValidity(){return this.getValidationFlags()}setConditionValue(t,e){e?this.track(t):this.untrack(t),this.updateColumnInternalsFlag()}updateColumnInternalsFlag(){this.isColumnValid=this.isValid()}}t([C],MF.prototype,"isColumnValid",void 0)
|
|
11418
|
+
class $F{get inNavigationMode(){return this.focusType!==uR&&this.focusType!==pR}constructor(t,e){this.table=t,this.virtualizer=e,this.focusType=rR,this.headerActionIndex=-1,this.rowIndex=-1,this.cellContentIndex=-1,this.columnIndex=-1,this.focusWithinTable=!1,this.isCurrentlyFocusingElement=!1,this.visibleRowNotifiers=[],this.onTableFocusIn=t=>{this.focusWithinTable=!0,this.updateFocusStateFromActiveElement(!1)
|
|
11410
11419
|
const e=void 0!==this.table.openActionMenuRecordId
|
|
11411
|
-
if((t.target===this.table||this.focusType===
|
|
11420
|
+
if((t.target===this.table||this.focusType===rR)&&!e){let t=!0
|
|
11412
11421
|
this.hasRowOrCellFocusType()&&this.scrollToAndFocusRow(this.rowIndex)&&(t=!1),t&&!this.setFocusOnHeader()&&this.table.blur()}},this.onTableFocusOut=()=>{this.focusWithinTable=!1},this.onCellActionMenuBlur=t=>{t.stopPropagation()
|
|
11413
11422
|
const e=t.detail
|
|
11414
11423
|
e.actionMenuButton&&this.setActionMenuButtonFocused(e.actionMenuButton,!1)},this.onCellViewFocusIn=t=>{t.stopPropagation(),this.updateFocusStateFromActiveElement(!1)},this.onCellFocusIn=t=>{t.stopPropagation()
|
|
11415
11424
|
const e=t.detail
|
|
11416
|
-
this.updateFocusStateFromActiveElement(!0),this.focusType===
|
|
11425
|
+
this.updateFocusStateFromActiveElement(!0),this.focusType===cR&&this.getActiveElement()===e&&this.focusCurrentRow(!1)},this.onCellBlur=t=>{t.stopPropagation()
|
|
11417
11426
|
const e=t.detail
|
|
11418
11427
|
this.setElementFocusable(e,!1)},this.onCaptureKeyDown=t=>{let e=!1
|
|
11419
11428
|
if(t.key===Pa)e=this.onTabPressed(t.shiftKey)
|
|
@@ -11439,106 +11448,106 @@ case Ba:e=this.onSpacePressed(t.shiftKey)
|
|
|
11439
11448
|
break
|
|
11440
11449
|
case"F2":e=this.onF2Pressed()}e&&t.preventDefault()},this.onKeyDown=t=>{if(!(this.inNavigationMode||t.defaultPrevented||t.key!==Oa&&"F2"!==t.key)){const t=this.getCurrentRow()
|
|
11441
11450
|
t&&this.trySetCellFocus(t.getFocusableElements())}},this.onViewportKeyDown=t=>{let e=!this.inNavigationMode&&(t.key===Da||t.key===Ma)
|
|
11442
|
-
switch(t.key){case Na:case Fa:case Ra:case Aa:e=!0}e&&(t.preventDefault(),t.stopImmediatePropagation())},this.tableNotifier=x.getNotifier(this.table),this.tableNotifier.subscribe(this,"rowElements"),this.virtualizerNotifier=x.getNotifier(this.virtualizer),this.virtualizerNotifier.subscribe(this,"visibleItems")}resetFocusState(){this.focusType=
|
|
11451
|
+
switch(t.key){case Na:case Fa:case Ra:case Aa:e=!0}e&&(t.preventDefault(),t.stopImmediatePropagation())},this.tableNotifier=x.getNotifier(this.table),this.tableNotifier.subscribe(this,"rowElements"),this.virtualizerNotifier=x.getNotifier(this.virtualizer),this.virtualizerNotifier.subscribe(this,"visibleItems")}resetFocusState(){this.focusType=rR
|
|
11443
11452
|
const t=this.getActiveElement()
|
|
11444
11453
|
t&&this.isInTable(t)&&this.setDefaultFocus()}get hasActiveRowOrCellFocus(){return this.focusWithinTable&&this.hasRowOrCellFocusType()}connect(){this.table.addEventListener("keydown",this.onCaptureKeyDown,{capture:!0}),this.table.addEventListener("keydown",this.onKeyDown),this.table.addEventListener("focusin",this.onTableFocusIn),this.table.addEventListener("focusout",this.onTableFocusOut),this.table.viewport.addEventListener("keydown",this.onViewportKeyDown),this.table.viewport.addEventListener("cell-action-menu-blur",this.onCellActionMenuBlur),this.table.viewport.addEventListener("cell-view-focus-in",this.onCellViewFocusIn),this.table.viewport.addEventListener("cell-focus-in",this.onCellFocusIn),this.table.viewport.addEventListener("cell-blur",this.onCellBlur)}disconnect(){this.table.removeEventListener("keydown",this.onCaptureKeyDown,{capture:!0}),this.table.removeEventListener("keydown",this.onKeyDown),this.table.removeEventListener("focusin",this.onTableFocusIn),this.table.removeEventListener("focusout",this.onTableFocusOut),this.table.viewport.removeEventListener("keydown",this.onViewportKeyDown),this.table.viewport.removeEventListener("cell-action-menu-blur",this.onCellActionMenuBlur),this.table.viewport.removeEventListener("cell-view-focus-in",this.onCellViewFocusIn),this.table.viewport.removeEventListener("cell-focus-in",this.onCellFocusIn),this.table.viewport.removeEventListener("cell-blur",this.onCellBlur)}handleChange(t,e){let n=!1
|
|
11445
11454
|
if(t===this.virtualizer&&"visibleItems"===e)n=!0
|
|
11446
11455
|
else if(t===this.table&&"rowElements"===e){for(const t of this.visibleRowNotifiers)t.unsubscribe(this)
|
|
11447
11456
|
this.visibleRowNotifiers=[]
|
|
11448
11457
|
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)
|
|
11449
|
-
if(n&&(this.focusType!==
|
|
11458
|
+
if(n&&(this.focusType!==uR&&this.focusType!==pR||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=rR)
|
|
11450
11459
|
this.rowIndex=0}this.focusWithinTable&&this.focusCurrentRow(!1)}}handleFocusedCellRecycling(t){t&&!this.focusWithinTable&&this.focusCurrentRow(!1)}onRowFocusIn(t){if(this.isCurrentlyFocusingElement)return
|
|
11451
11460
|
const e=t.target
|
|
11452
11461
|
this.isResolvedRowType(e)&&this.rowIndex!==e.resolvedRowIndex&&this.setRowFocusState(e.resolvedRowIndex)}onRowBlur(t){const e=t.target
|
|
11453
11462
|
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))
|
|
11454
11463
|
this.setCellActionMenuFocusState(e.resolvedRowIndex,n,!1)}}onEnterPressed(t){let e,n
|
|
11455
|
-
if(this.hasRowOrCellFocusType()&&(e=this.getCurrentRow(),n=e?.getFocusableElements()),this.focusType===
|
|
11456
|
-
if(this.focusType===
|
|
11457
|
-
if(t?.actionMenuButton&&!t.actionMenuButton.open)return t.actionMenuButton.toggleButton.control.click(),!0}return this.focusFirstInteractiveElementInCurrentCell(n)}return!1}onF2Pressed(){if(this.focusType===
|
|
11458
|
-
return this.focusFirstInteractiveElementInCurrentCell(e)}return!1}onSpacePressed(t){if(this.focusType===
|
|
11459
|
-
t instanceof
|
|
11460
|
-
switch(this.hasRowOrCellFocusType()?(t=this.getCurrentRow(),e=t?.getFocusableElements()):this.hasHeaderFocusType()&&(n=this.getTableHeaderFocusableElements()),this.focusType){case
|
|
11461
|
-
case
|
|
11462
|
-
case
|
|
11463
|
-
case
|
|
11464
|
-
case
|
|
11465
|
-
switch(this.hasRowOrCellFocusType()?(t=this.getCurrentRow(),e=t?.getFocusableElements()):this.hasHeaderFocusType()&&(n=this.getTableHeaderFocusableElements()),this.focusType){case
|
|
11466
|
-
case
|
|
11467
|
-
case
|
|
11468
|
-
case
|
|
11469
|
-
case
|
|
11464
|
+
if(this.hasRowOrCellFocusType()&&(e=this.getCurrentRow(),n=e?.getFocusableElements()),this.focusType===cR&&e instanceof GR)return this.toggleRowExpanded(e),!0
|
|
11465
|
+
if(this.focusType===hR){if(t){const t=n?.cells[this.columnIndex]
|
|
11466
|
+
if(t?.actionMenuButton&&!t.actionMenuButton.open)return t.actionMenuButton.toggleButton.control.click(),!0}return this.focusFirstInteractiveElementInCurrentCell(n)}return!1}onF2Pressed(){if(this.focusType===hR){const t=this.getCurrentRow(),e=t?.getFocusableElements()
|
|
11467
|
+
return this.focusFirstInteractiveElementInCurrentCell(e)}return!1}onSpacePressed(t){if(this.focusType===cR||this.focusType===hR){if(this.focusType===cR||t){const t=this.getCurrentRow()
|
|
11468
|
+
t instanceof HR&&t.selectable?t.onSelectionChange(t.selected,!t.selected):t instanceof GR&&this.toggleRowExpanded(t)}return!0}return!1}onLeftArrowPressed(){let t,e,n
|
|
11469
|
+
switch(this.hasRowOrCellFocusType()?(t=this.getCurrentRow(),e=t?.getFocusableElements()):this.hasHeaderFocusType()&&(n=this.getTableHeaderFocusableElements()),this.focusType){case lR:return this.trySetHeaderActionFocus(n,this.headerActionIndex-1)
|
|
11470
|
+
case aR:return this.trySetColumnHeaderFocus(n,this.columnIndex-1)||this.trySetHeaderActionFocus(n,n.headerActions.length-1)
|
|
11471
|
+
case cR:return!0===this.isRowExpanded(t)&&(this.toggleRowExpanded(t),!0)
|
|
11472
|
+
case dR:return this.setRowFocusState(),this.focusCurrentRow(!0)
|
|
11473
|
+
case hR:return this.trySetCellFocus(e,this.columnIndex-1)||this.trySetRowSelectionCheckboxFocus(e)||(this.setRowFocusState(),this.focusCurrentRow(!0)),!0}return!1}onRightArrowPressed(){let t,e,n
|
|
11474
|
+
switch(this.hasRowOrCellFocusType()?(t=this.getCurrentRow(),e=t?.getFocusableElements()):this.hasHeaderFocusType()&&(n=this.getTableHeaderFocusableElements()),this.focusType){case lR:return this.trySetHeaderActionFocus(n,this.headerActionIndex+1)||this.trySetColumnHeaderFocus(n,0)
|
|
11475
|
+
case aR:return this.trySetColumnHeaderFocus(n,this.columnIndex+1)
|
|
11476
|
+
case cR:return!1===this.isRowExpanded(t)?(this.toggleRowExpanded(t),!0):this.trySetRowSelectionCheckboxFocus(e)||this.trySetCellFocus(e,0)
|
|
11477
|
+
case dR:return this.trySetCellFocus(e,0)
|
|
11478
|
+
case hR:return this.trySetCellFocus(e,this.columnIndex+1)}return!1}onUpArrowPressed(){return this.onMoveUp(1),!0}onPageUpPressed(){return this.onMoveUp(this.virtualizer.pageSize)}onHomePressed(t){if(this.handleHomeEndWithinRow(t)){const t=this.getCurrentRow(),e=t?.getFocusableElements()
|
|
11470
11479
|
return this.trySetRowSelectionCheckboxFocus(e)||this.trySetCellFocus(e,0)}return this.onMoveUp(0,0)}onDownArrowPressed(){return this.onMoveDown(1),!0}onPageDownPressed(){return this.onMoveDown(this.virtualizer.pageSize)}onEndPressed(t){if(this.handleHomeEndWithinRow(t)){const t=this.getCurrentRow(),e=t?.getFocusableElements()
|
|
11471
|
-
return this.trySetCellFocus(e,this.table.visibleColumns.length-1)}return this.onMoveDown(0,this.table.tableData.length-1)}handleHomeEndWithinRow(t){return(this.focusType===
|
|
11480
|
+
return this.trySetCellFocus(e,this.table.visibleColumns.length-1)}return this.onMoveDown(0,this.table.tableData.length-1)}handleHomeEndWithinRow(t){return(this.focusType===hR||this.focusType===dR)&&!t}onTabPressed(t){const e=this.getActiveElement()
|
|
11472
11481
|
if(null===e||e===this.table)return!1
|
|
11473
11482
|
const n=this.hasRowOrCellFocusType()?this.getNextRowTabStop(t):this.getNextHeaderTabStop(t)
|
|
11474
11483
|
return n?(this.focusType=n.focusType,this.rowIndex=n.rowIndex??this.rowIndex,this.columnIndex=n.columnIndex??this.columnIndex,this.headerActionIndex=n.headerActionIndex??this.headerActionIndex,this.cellContentIndex=n.cellContentIndex??this.cellContentIndex,this.hasRowOrCellFocusType()?this.focusCurrentRow(!1):this.focusHeaderElement(),!0):(this.blurAfterLastTab(e),!1)}getNextRowTabStop(t){const e=this.getCurrentRow()
|
|
11475
11484
|
if(void 0===e)return
|
|
11476
11485
|
let n=-1
|
|
11477
11486
|
const i=[],s=e.getFocusableElements()
|
|
11478
|
-
s.selectionCheckbox&&(i.push({focusType:
|
|
11487
|
+
s.selectionCheckbox&&(i.push({focusType:dR}),this.focusType===dR&&(n=0))
|
|
11479
11488
|
let o=0
|
|
11480
11489
|
for(;o<s.cells.length;){const e=i.length,r=s.cells[o],a=r.cell.cellView.tabbableChildren
|
|
11481
|
-
for(let t=0;t<a.length;t++)i.push({focusType:
|
|
11482
|
-
r.actionMenuButton&&(i.push({focusType:
|
|
11490
|
+
for(let t=0;t<a.length;t++)i.push({focusType:pR,columnIndex:o,cellContentIndex:t}),this.focusType===pR&&this.columnIndex===o&&this.cellContentIndex===t&&(n=i.length-1)
|
|
11491
|
+
r.actionMenuButton&&(i.push({focusType:uR,columnIndex:o}),this.focusType===uR&&this.columnIndex===o&&(n=i.length-1))
|
|
11483
11492
|
const l=i.length-1
|
|
11484
|
-
this.focusType===
|
|
11493
|
+
this.focusType===hR&&this.columnIndex===o&&(n=t?l+1:e-1),o+=1}this.focusType===cR&&(n=t?i.length:-1)
|
|
11485
11494
|
return i[n+(t?-1:1)]}getNextHeaderTabStop(t){let e=-1
|
|
11486
11495
|
const n=[],i=this.getTableHeaderFocusableElements().headerActions
|
|
11487
|
-
for(let t=0;t<i.length;t++)n.push({focusType:
|
|
11488
|
-
e=this.focusType===
|
|
11496
|
+
for(let t=0;t<i.length;t++)n.push({focusType:lR,headerActionIndex:t})
|
|
11497
|
+
e=this.focusType===lR?this.headerActionIndex:n.length
|
|
11489
11498
|
return n[e+(t?-1:1)]}blurAfterLastTab(t){this.table.tabIndex=-1,window.requestAnimationFrame((()=>{this.table.tabIndex=0})),this.setElementFocusable(t,!1)}onMoveUp(t,e){const n=t>1
|
|
11490
|
-
switch(this.focusType){case
|
|
11499
|
+
switch(this.focusType){case cR:case dR:case hR:{const i={}
|
|
11491
11500
|
let s=this.rowIndex
|
|
11492
11501
|
if(void 0!==e&&(s=e),s-=t,n&&s<0&&(s=0),t>1&&(i.align="start"),s<this.rowIndex&&s>=0)return this.scrollToAndFocusRow(s,i)
|
|
11493
11502
|
if(-1===s){const t=this.getTableHeaderFocusableElements()
|
|
11494
|
-
return this.focusType===
|
|
11495
|
-
switch(this.focusType){case
|
|
11496
|
-
case
|
|
11497
|
-
case
|
|
11503
|
+
return this.focusType===cR||this.focusType===dR?this.trySetHeaderActionFocus(t,0)||this.trySetColumnHeaderFocus(t,0):this.trySetColumnHeaderFocus(t,this.columnIndex)}return!1}}return!1}onMoveDown(t,e){const n=t>1
|
|
11504
|
+
switch(this.focusType){case lR:return this.setRowFocusState(0),this.scrollToAndFocusRow(0)
|
|
11505
|
+
case aR:return this.setCellFocusState(this.columnIndex,0,!1),this.scrollToAndFocusRow(0)
|
|
11506
|
+
case cR:case dR:case hR:{const i={}
|
|
11498
11507
|
let s=this.rowIndex
|
|
11499
11508
|
return void 0!==e&&(s=e),s+=t,n&&s>=this.table.tableData.length&&(s=this.table.tableData.length-1),t>1&&(i.align="end"),s>this.rowIndex&&s<this.table.tableData.length&&this.scrollToAndFocusRow(s,i)}}return!1}updateFocusStateFromActiveElement(t){const e=this.getActiveElement()
|
|
11500
11509
|
if(e){const n=this.getContainingRow(e)
|
|
11501
|
-
if(n){if(!(n instanceof
|
|
11510
|
+
if(n){if(!(n instanceof GR)){const t=this.getContainingCell(e)
|
|
11502
11511
|
if(t){const i=this.table.visibleColumns.indexOf(t.column)
|
|
11503
11512
|
if(t.actionMenuButton===e)return void this.setCellActionMenuFocusState(n.resolvedRowIndex,i,!1)
|
|
11504
11513
|
const s=t.cellView.tabbableChildren.indexOf(e)
|
|
11505
11514
|
if(s>-1)return void this.setCellContentFocusState(s,n.resolvedRowIndex,i,!1)}}t&&this.hasRowOrCellFocusType()&&this.rowIndex!==n.resolvedRowIndex&&this.setRowFocusState(n.resolvedRowIndex)}}}focusElement(t,e){const n=this.getActiveElement()
|
|
11506
|
-
n!==t&&(this.setElementFocusable(t,!0),this.isCurrentlyFocusingElement=!0,t.focus(e),this.isCurrentlyFocusingElement=!1,n&&this.isInTable(n)&&this.setElementFocusable(n,!1))}setElementFocusable(t,e){t!==this.table&&(t.tabIndex=e?0:-1)}setActionMenuButtonFocused(t,e){e?t.classList.add("cell-action-menu-focused"):t.classList.remove("cell-action-menu-focused")}setFocusOnHeader(){return this.hasHeaderFocusType()?this.focusHeaderElement():(this.setDefaultFocus(),this.focusType!==
|
|
11507
|
-
this.trySetHeaderActionFocus(t,0)||this.trySetColumnHeaderFocus(t,0)||this.scrollToAndFocusRow(0)||(this.focusType=
|
|
11515
|
+
n!==t&&(this.setElementFocusable(t,!0),this.isCurrentlyFocusingElement=!0,t.focus(e),this.isCurrentlyFocusingElement=!1,n&&this.isInTable(n)&&this.setElementFocusable(n,!1))}setElementFocusable(t,e){t!==this.table&&(t.tabIndex=e?0:-1)}setActionMenuButtonFocused(t,e){e?t.classList.add("cell-action-menu-focused"):t.classList.remove("cell-action-menu-focused")}setFocusOnHeader(){return this.hasHeaderFocusType()?this.focusHeaderElement():(this.setDefaultFocus(),this.focusType!==rR)}setDefaultFocus(){const t=this.getTableHeaderFocusableElements()
|
|
11516
|
+
this.trySetHeaderActionFocus(t,0)||this.trySetColumnHeaderFocus(t,0)||this.scrollToAndFocusRow(0)||(this.focusType=rR)}scrollToAndFocusRow(t,e){if(t>=0&&t<this.table.tableData.length){switch(this.focusType){case rR:case lR:case aR:this.setRowFocusState(t)}return this.rowIndex=t,this.virtualizer.scrollToIndex(t,e),this.focusCurrentRow(!0),!0}return!1}focusCurrentRow(t){const e=this.getCurrentRowVisibleIndex()
|
|
11508
11517
|
if(e<0)return!1
|
|
11509
11518
|
const n=this.table.rowElements[e]
|
|
11510
11519
|
let i=!1
|
|
11511
|
-
switch(this.focusType){case
|
|
11520
|
+
switch(this.focusType){case cR:i=!0
|
|
11512
11521
|
break
|
|
11513
|
-
case
|
|
11522
|
+
case hR:case uR:case pR:i=n instanceof GR}const s={preventScroll:!t}
|
|
11514
11523
|
return i?(this.focusElement(n,s),!0):(this.focusRowElement(n,s),!0)}focusRowElement(t,e){const n=t.getFocusableElements()
|
|
11515
11524
|
let i
|
|
11516
|
-
switch(this.focusType){case
|
|
11525
|
+
switch(this.focusType){case dR:i=n.selectionCheckbox
|
|
11517
11526
|
break
|
|
11518
|
-
case
|
|
11527
|
+
case hR:i=n.cells[this.columnIndex].cell
|
|
11519
11528
|
break
|
|
11520
|
-
case
|
|
11529
|
+
case uR:{const t=n.cells[this.columnIndex]?.cell.actionMenuButton
|
|
11521
11530
|
t&&(i=t,this.setActionMenuButtonFocused(t,!0))
|
|
11522
|
-
break}case
|
|
11531
|
+
break}case pR:i=n.cells[this.columnIndex]?.cell.cellView.tabbableChildren[this.cellContentIndex]}i&&this.focusElement(i,e)}focusHeaderElement(){const t=this.getTableHeaderFocusableElements()
|
|
11523
11532
|
let e
|
|
11524
|
-
switch(this.focusType){case
|
|
11533
|
+
switch(this.focusType){case lR:e=t.headerActions[this.headerActionIndex]
|
|
11525
11534
|
break
|
|
11526
|
-
case
|
|
11535
|
+
case aR:e=t.columnHeaders[this.columnIndex]}return!!e&&(this.focusElement(e),!0)}getCurrentRowVisibleIndex(){return this.table.rowElements.findIndex((t=>t.resolvedRowIndex===this.rowIndex))}getTableHeaderFocusableElements(){const t=[]
|
|
11527
11536
|
this.table.selectionCheckbox?.getRootNode()===this.table.shadowRoot&&t.push(this.table.selectionCheckbox),this.table.showCollapseAll&&this.table.collapseAllButton?.getRootNode()===this.table.shadowRoot&&t.push(this.table.collapseAllButton)
|
|
11528
11537
|
const e=[]
|
|
11529
|
-
return this.canFocusColumnHeaders()&&this.table.columnHeadersContainer.querySelectorAll(
|
|
11538
|
+
return this.canFocusColumnHeaders()&&this.table.columnHeadersContainer.querySelectorAll(OR).forEach((t=>e.push(t))),{headerActions:t,columnHeaders:e}}canFocusColumnHeaders(){return void 0!==this.table.columns.find((t=>!t.columnInternals.sortingDisabled))}getCurrentRow(){return this.table.rowElements[this.getCurrentRowVisibleIndex()]}isRowExpanded(t){if(t instanceof HR&&t.isParentRow||t instanceof GR)return t.expanded}toggleRowExpanded(t){t instanceof GR?t.onGroupExpandToggle():t.onRowExpandToggle(),this.focusRowElement(t)}getContainingRow(t){return this.getContainingElement(t,(t=>this.isResolvedRowType(t)))}getContainingCell(t){return this.getContainingElement(t,(t=>t instanceof BR))}getContainingElement(t,e){let n=t
|
|
11530
11539
|
for(;n&&n!==this.table;){if(e(n))return n
|
|
11531
11540
|
n=n.parentElement??n.parentNode?.host}}isInTable(t){let e=t
|
|
11532
11541
|
for(;e&&e!==this.table;)e=e.parentElement??e.parentNode?.host
|
|
11533
11542
|
return e===this.table}getActiveElement(){let t=document.activeElement
|
|
11534
|
-
for(;t?.shadowRoot?.activeElement&&(t=t.shadowRoot.activeElement,!(t instanceof We)||this.isResolvedRowType(t)||t instanceof
|
|
11535
|
-
default:return!1}}hasHeaderFocusType(){switch(this.focusType){case
|
|
11536
|
-
default:return!1}}trySetRowSelectionCheckboxFocus(t){return!!t?.selectionCheckbox&&(this.focusType=
|
|
11543
|
+
for(;t?.shadowRoot?.activeElement&&(t=t.shadowRoot.activeElement,!(t instanceof We)||this.isResolvedRowType(t)||t instanceof BR||t instanceof wR););return t}focusFirstInteractiveElementInCurrentCell(t){return!!t&&(this.trySetCellContentFocus(t,0)||this.trySetCellActionMenuFocus(t))}hasRowOrCellFocusType(){switch(this.focusType){case hR:case uR:case pR:case cR:case dR:return!0
|
|
11544
|
+
default:return!1}}hasHeaderFocusType(){switch(this.focusType){case lR:case aR:return!0
|
|
11545
|
+
default:return!1}}trySetRowSelectionCheckboxFocus(t){return!!t?.selectionCheckbox&&(this.focusType=dR,this.focusCurrentRow(!0),!0)}trySetColumnHeaderFocus(t,e){return e>=0&&e<t.columnHeaders.length&&(this.focusType=aR,this.columnIndex=e,this.focusHeaderElement(),!0)}trySetHeaderActionFocus(t,e){return e>=0&&e<t.headerActions.length&&(this.focusType=lR,this.headerActionIndex=e,this.focusHeaderElement(),!0)}trySetCellFocus(t,e,n){if(!t)return!1
|
|
11537
11546
|
const i=e??this.columnIndex,s=n??this.rowIndex
|
|
11538
|
-
return i>=0&&i<t.cells.length&&(this.focusType=
|
|
11547
|
+
return i>=0&&i<t.cells.length&&(this.focusType=hR,this.setRowCellFocusState(i,s,!0),!0)}trySetCellContentFocus(t,e,n,i){if(!t)return!1
|
|
11539
11548
|
const s=n??this.columnIndex,o=i??this.rowIndex
|
|
11540
11549
|
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
|
|
11541
|
-
return!!(i>=0&&i<t.cells.length&&t.cells[i].actionMenuButton)&&(this.setCellActionMenuFocusState(s,i,!0),!0)}setCellActionMenuFocusState(t,e,n){this.focusType=
|
|
11550
|
+
return!!(i>=0&&i<t.cells.length&&t.cells[i].actionMenuButton)&&(this.setCellActionMenuFocusState(s,i,!0),!0)}setCellActionMenuFocusState(t,e,n){this.focusType=uR,this.setRowCellFocusState(e,t,n)}setCellContentFocusState(t,e,n,i){this.focusType=pR,this.cellContentIndex=t,this.setRowCellFocusState(n,e,i)}setRowFocusState(t){this.focusType=cR,void 0!==t&&(this.rowIndex=t)}setCellFocusState(t,e,n){this.focusType=hR,this.setRowCellFocusState(t,e,n)}setRowCellFocusState(t,e,n){this.rowIndex=e,this.columnIndex=t,n&&this.focusCurrentRow(!0)}isResolvedRowType(t){return t instanceof HR||t instanceof GR}}let EF=class extends We{get validity(){return this.tableValidator.getValidity()}get showRowOperationColumn(){return this.selectionMode===tR.multiple||this.showCollapseAll}constructor(){super(),this.selectionMode=tR.none,this.tableData=[],this.columns=[],this.childItems=[],this.rowElements=[],this.actionMenuSlots=[],this.canRenderRows=!0,this.scrollX=0,this.selectionState=eR,this.showCollapseAll=!1,this.visibleColumns=[],this.tableScrollableMinWidth=0,this.documentShiftKeyDown=!1,this.tableValidator=new MR,this.tableUpdateTracker=new gF(this),this.columnNotifiers=[],this.isInitialized=!1,this.ignoreSelectionChangeEvents=!1,this.columnRequestedSlots=new Map,this.onViewPortScroll=t=>{this.scrollX=t.target.scrollLeft},this.onKeyDown=t=>{t.key===La&&(this.documentShiftKeyDown=!0)},this.onKeyUp=t=>{t.key===La&&(this.documentShiftKeyDown=!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
|
|
11542
11551
|
this.updateTableOptions({state:{rowSelection:e}})},this.handleExpandedChange=t=>{const e=t instanceof Function?t(this.table.getState().expanded):t
|
|
11543
11552
|
this.updateTableOptions({state:{expanded:e}})},this.options={data:[],onStateChange:t=>{},onRowSelectionChange:this.handleRowSelectionChange,onExpandedChange:this.handleExpandedChange,getCoreRowModel:t=>tO((()=>[t.options.data]),(e=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(e,s,o){void 0===s&&(s=0)
|
|
11544
11553
|
const r=[]
|
|
@@ -11561,13 +11570,13 @@ d=n&&i?0:n?l:-l}}if(0===d&&(d=a.sortingFn(t,e,s.id)),0!==d)return c&&(d*=-1),a.i
|
|
|
11561
11570
|
s.push(t),null!=(e=t.subRows)&&e.length&&(t.subRows=a(t.subRows))})),e}
|
|
11562
11571
|
return{rows:a(n.rows),flatRows:s,rowsById:n.rowsById}}),eO(t.options,"debugTable",0,(()=>t._autoResetPageIndex()))),getGroupedRowModel:KO(),getExpandedRowModel:t=>tO((()=>[t.getState().expanded,t.getPreExpandedRowModel(),t.options.paginateExpandedRows]),((t,e,n)=>!e.rows.length||!0!==t&&!Object.keys(null!=t?t:{}).length?e:n?function(t){const e=[],n=t=>{var i
|
|
11563
11572
|
e.push(t),null!=(i=t.subRows)&&i.length&&t.getIsExpanded()&&t.subRows.forEach(n)}
|
|
11564
|
-
return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}(e):e),eO(t.options,"debugTable")),getRowCanExpand:this.getRowCanExpand,getIsRowExpanded:this.getIsRowExpanded,getSubRows:t=>t.subRows,columns:[],state:{rowSelection:{},grouping:[],expanded:!0},enableRowSelection:t=>!t.getIsGrouped(),enableMultiRowSelection:!1,enableSubRowSelection:!1,enableSorting:!0,enableGrouping:!0,renderFallbackValue:null,autoResetAll:!1},this.table=ZO(this.options),this.virtualizer=new
|
|
11573
|
+
return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}(e):e),eO(t.options,"debugTable")),getRowCanExpand:this.getRowCanExpand,getIsRowExpanded:this.getIsRowExpanded,getSubRows:t=>t.subRows,columns:[],state:{rowSelection:{},grouping:[],expanded:!0},enableRowSelection:t=>!t.getIsGrouped(),enableMultiRowSelection:!1,enableSubRowSelection:!1,enableSorting:!0,enableGrouping:!0,renderFallbackValue:null,autoResetAll:!1},this.table=ZO(this.options),this.virtualizer=new cF(this,this.table),this.keyboardNavigationManager=new $F(this,this.virtualizer),this.layoutManager=new pF(this),this.layoutManagerNotifier=x.getNotifier(this.layoutManager),this.layoutManagerNotifier.subscribe(this,"isColumnBeingSized"),this.selectionManager=new xF(this.table,this.selectionMode),this.expansionManager=new _F(this.table)}async setData(t){await this.processPendingUpdates()
|
|
11565
11574
|
const e=this.calculateTanStackData(t)
|
|
11566
11575
|
this.updateTableOptions(e)}async getSelectedRecordIds(){return await this.processPendingUpdates(),this.selectionManager.getCurrentSelectedRecordIds()}async setSelectedRecordIds(t){await this.processPendingUpdates(),this.selectionMode!==tR.none&&this.updateTableOptions({state:{rowSelection:this.calculateTanStackSelectionState(t)}})}async setRecordHierarchyOptions(t){await this.processPendingUpdates()
|
|
11567
11576
|
const e=structuredClone(t),n=this.tableValidator.getOptionsWithPresentIds(e)
|
|
11568
|
-
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(),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp)}disconnectedCallback(){super.disconnectedCallback(),this.virtualizer.disconnect(),this.keyboardNavigationManager.disconnect(),this.viewport.removeEventListener("scroll",this.onViewPortScroll),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp)}checkValidity(){return this.tableValidator.isValid()}handleChange(t,e){(t instanceof
|
|
11577
|
+
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(),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp)}disconnectedCallback(){super.disconnectedCallback(),this.virtualizer.disconnect(),this.keyboardNavigationManager.disconnect(),this.viewport.removeEventListener("scroll",this.onViewPortScroll),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp)}checkValidity(){return this.tableValidator.isValid()}handleChange(t,e){(t instanceof IR||t instanceof SR)&&"string"==typeof e?this.tableUpdateTracker.trackColumnPropertyChanged(e):t instanceof MF&&"isColumnValid"===e?this.tableValidator.validateColumnConfigurations(this.columns):t instanceof pF&&"isColumnBeingSized"===e&&!this.layoutManager.isColumnBeingSized&&this.emitColumnConfigurationChangeEvent()}onRowSelectionToggle(t,e){e.stopImmediatePropagation()
|
|
11569
11578
|
this.selectionManager.handleRowSelectionToggle(this.tableData[t],e.detail.newState,this.documentShiftKeyDown)&&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()
|
|
11570
|
-
for(const e of t.detail.slots){const n=
|
|
11579
|
+
for(const e of t.detail.slots){const n=xR(t.detail.columnInternalId,e.slot)
|
|
11571
11580
|
this.columnRequestedSlots.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
|
|
11572
11581
|
const n=this.getColumnsParticipatingInSorting().sort(((t,e)=>t.columnInternals.currentSortIndex-e.columnInternals.currentSortIndex)),i=n.indexOf(t),s=i>-1,o=t.columnInternals.currentSortDirection
|
|
11573
11582
|
let r=QO.ascending
|
|
@@ -11576,15 +11585,15 @@ for(let i=0;i<n.length;i++){const s=n[i]
|
|
|
11576
11585
|
e?n[i].columnInternals.currentSortIndex=i:s===t?s.columnInternals.currentSortIndex=0:(s.columnInternals.currentSortIndex=void 0,s.columnInternals.currentSortDirection=QO.none)}this.emitColumnConfigurationChangeEvent()}onHeaderKeyDown(t,e){const n=e.shiftKey
|
|
11577
11586
|
return e.key===Ta&&this.toggleColumnSort(t,n),!0}update(){this.validate(),this.tableUpdateTracker.requiresTanStackUpdate&&this.updateTanStack(),this.tableUpdateTracker.updateActionMenuSlots&&this.updateActionMenuSlots(),this.tableUpdateTracker.updateColumnWidths&&(this.rowGridColumns=this.layoutManager.getGridTemplateColumns(),this.visibleColumns=this.columns.filter((t=>!t.columnHidden))),this.tableUpdateTracker.requiresKeyboardFocusReset&&this.keyboardNavigationManager.resetFocusState()}get ariaMultiSelectable(){switch(this.selectionMode){case tR.multiple:return"true"
|
|
11578
11587
|
case tR.single:return"false"
|
|
11579
|
-
default:return null}}getHeaderContainerElements(){return this.columnHeadersContainer.querySelectorAll(".header-container")}calculateTanStackData(t){this.dataHierarchyManager=new
|
|
11588
|
+
default:return null}}getHeaderContainerElements(){return this.columnHeadersContainer.querySelectorAll(".header-container")}calculateTanStackData(t){this.dataHierarchyManager=new SF(t,this.idFieldName,this.parentIdFieldName)
|
|
11580
11589
|
const e=this.dataHierarchyManager.hierarchicalData
|
|
11581
11590
|
this.tableValidator.setParentIdConfigurationValidity(this.dataHierarchyManager.parentIdConfigurationValid)
|
|
11582
11591
|
const n={data:e}
|
|
11583
11592
|
if(this.validateWithData(t),this.tableValidator.areRecordIdsValid()){const t=this.selectionManager.getCurrentSelectedRecordIds()
|
|
11584
11593
|
n.state={rowSelection:this.calculateTanStackSelectionState(t),expanded:!0}}return n}handleFocusedCellRecycling(){const t=this.keyboardNavigationManager.hasActiveRowOrCellFocus
|
|
11585
11594
|
let e=this.shadowRoot.activeElement
|
|
11586
|
-
for(;null!==e&&!(e instanceof
|
|
11587
|
-
if(e instanceof
|
|
11595
|
+
for(;null!==e&&!(e instanceof wR)&&e.shadowRoot;)e=e.shadowRoot.activeElement
|
|
11596
|
+
if(e instanceof wR&&e.focusedRecycleCallback(),void 0!==this.openActionMenuRecordId){const t=this.rowElements.find((t=>t instanceof HR&&t.recordId===this.openActionMenuRecordId))
|
|
11588
11597
|
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)
|
|
11589
11598
|
this.refreshRows()}async handleActionMenuBeforeToggleEvent(t,e){this.selectionManager.handleActionMenuOpening(this.tableData[t])&&await this.emitSelectionChangeEvent(),this.openActionMenuRecordId=e.detail.recordIds[0],this.removeActionMenuSlotsFromColumnRequestedSlots()
|
|
11590
11599
|
const n=await this.getActionMenuToggleEventDetail(e)
|
|
@@ -11597,7 +11606,7 @@ e.subscribe(this),this.columnNotifiers.push(e)
|
|
|
11597
11606
|
const n=x.getNotifier(t.columnInternals)
|
|
11598
11607
|
n.subscribe(this),this.columnNotifiers.push(n)
|
|
11599
11608
|
const i=x.getNotifier(t.columnInternals.validator)
|
|
11600
|
-
i.subscribe(this),this.columnNotifiers.push(i)}}getColumnsParticipatingInSorting(){return this.columns.filter((t=>!t.columnInternals.sortingDisabled&&t.columnInternals.currentSortDirection!==QO.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 _E(this.childItems),this.columns=this.childItems.filter((t=>t instanceof
|
|
11609
|
+
i.subscribe(this),this.columnNotifiers.push(i)}}getColumnsParticipatingInSorting(){return this.columns.filter((t=>!t.columnInternals.sortingDisabled&&t.columnInternals.currentSortDirection!==QO.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 _E(this.childItems),this.columns=this.childItems.filter((t=>t instanceof IR))}updateTanStack(){const t={state:{}}
|
|
11601
11610
|
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===tR.multiple,t.enableSubRowSelection=this.selectionMode===tR.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)
|
|
11602
11611
|
n.state&&(t.state.rowSelection=n.state.rowSelection),t.data=n.data}else t.data=[...this.table.options.data]
|
|
11603
11612
|
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=new Set
|
|
@@ -11618,14 +11627,14 @@ if(void 0!==e)return this.columns.find((t=>t.columnInternals.uniqueId===e))}upda
|
|
|
11618
11627
|
this.expansionManager.processDataUpdate(t)}this.refreshRows()}toggleRowExpanded(t){const e=this.table.getRowModel().rows[t]
|
|
11619
11628
|
this.expansionManager.toggleRowExpansion(e)}calculateTanStackSortState(){const t=this.getColumnsParticipatingInSorting().sort(((t,e)=>t.columnInternals.currentSortIndex-e.columnInternals.currentSortIndex))
|
|
11620
11629
|
return this.firstSortedColumn=t.length?t[0]:void 0,t.map((t=>({id:t.columnInternals.uniqueId,desc:t.columnInternals.currentSortDirection===QO.descending})))}calculateTanStackGroupingState(){return this.getColumnsParticipatingInGrouping().sort(((t,e)=>t.columnInternals.groupIndex-e.columnInternals.groupIndex)).map((t=>t.columnInternals.uniqueId))}calculateTanStackRowIdFunction(){return null===this.idFieldName||void 0===this.idFieldName?void 0:t=>t.clientRecord[this.idFieldName]}calculateTanStackColumns(){return this.columns.map((t=>({id:t.columnInternals.uniqueId,accessorFn:e=>{const n=t.columnInternals.operandDataRecordFieldName
|
|
11621
|
-
if("string"==typeof n)return e.clientRecord[n]},sortingFn:
|
|
11630
|
+
if("string"==typeof n)return e.clientRecord[n]},sortingFn:dF(t.columnInternals.sortOperation),sortUndefined:!1})))}calculateTanStackSelectionState(t){if(this.selectionMode===tR.none)return{}
|
|
11622
11631
|
const e={},n=this.tableValidator.getPresentRecordIds(t)
|
|
11623
11632
|
for(const t of n)if(e[t]=!0,this.selectionMode===tR.single)break
|
|
11624
11633
|
return e}}
|
|
11625
|
-
t([ft({attribute:"id-field-name"})],
|
|
11626
|
-
const
|
|
11627
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
11628
|
-
const
|
|
11634
|
+
t([ft({attribute:"id-field-name"})],EF.prototype,"idFieldName",void 0),t([ft({attribute:"parent-id-field-name"})],EF.prototype,"parentIdFieldName",void 0),t([ft({attribute:"selection-mode"})],EF.prototype,"selectionMode",void 0),t([C],EF.prototype,"tableData",void 0),t([C],EF.prototype,"columns",void 0),t([C],EF.prototype,"childItems",void 0),t([C],EF.prototype,"rowElements",void 0),t([C],EF.prototype,"actionMenuSlots",void 0),t([C],EF.prototype,"openActionMenuRecordId",void 0),t([C],EF.prototype,"canRenderRows",void 0),t([C],EF.prototype,"scrollX",void 0),t([C],EF.prototype,"rowGridColumns",void 0),t([C],EF.prototype,"selectionState",void 0),t([C],EF.prototype,"selectionCheckbox",void 0),t([C],EF.prototype,"collapseAllButton",void 0),t([C],EF.prototype,"showCollapseAll",void 0),t([C],EF.prototype,"firstSortedColumn",void 0),t([C],EF.prototype,"visibleColumns",void 0),t([C],EF.prototype,"tableScrollableMinWidth",void 0),t([C],EF.prototype,"documentShiftKeyDown",void 0)
|
|
11635
|
+
const DF=EF.compose({baseName:"table",template:YR,styles:$R})
|
|
11636
|
+
_i.getOrCreate().withPrefix("nimble").register(DF())
|
|
11637
|
+
const AF=Mt`
|
|
11629
11638
|
${Vs("contents")}
|
|
11630
11639
|
|
|
11631
11640
|
.header-content {
|
|
@@ -11633,14 +11642,14 @@ const EF=Mt`
|
|
|
11633
11642
|
overflow: hidden;
|
|
11634
11643
|
text-overflow: ellipsis;
|
|
11635
11644
|
}
|
|
11636
|
-
`,
|
|
11645
|
+
`,TF=Q`<span
|
|
11637
11646
|
${Sg("hasOverflow")}
|
|
11638
11647
|
class="header-content"
|
|
11639
11648
|
title=${t=>t.hasOverflow&&t.headerTextContent?t.headerTextContent:null}
|
|
11640
11649
|
>
|
|
11641
11650
|
<slot ${Ut("contentSlot")}></slot>
|
|
11642
11651
|
</span>`
|
|
11643
|
-
function
|
|
11652
|
+
function OF(t){class e extends t{fractionalWidthChanged(){this.columnInternals.fractionalWidth=this.fractionalWidth??vR}minPixelWidthChanged(){this.columnInternals.minPixelWidth=this.minPixelWidth??gR}}return ft({attribute:"fractional-width",converter:ut})(e.prototype,"fractionalWidth"),ft({attribute:"min-pixel-width",converter:ut})(e.prototype,"minPixelWidth"),e}function RF(t){class e extends t{constructor(){super(...arguments),this.groupingDisabled=!1}groupingDisabledChanged(){this.columnInternals.groupingDisabled=this.groupingDisabled}groupIndexChanged(){this.columnInternals.groupIndex=this.groupIndex??void 0}}return ft({attribute:"grouping-disabled",mode:"boolean"})(e.prototype,"groupingDisabled"),ft({attribute:"group-index",converter:ut})(e.prototype,"groupIndex"),e}function FF(t){class e extends t{}return ft({attribute:"placeholder"})(e.prototype,"placeholder"),e}const NF=Mt`
|
|
11644
11653
|
${Vs("flex")}
|
|
11645
11654
|
|
|
11646
11655
|
:host {
|
|
@@ -11669,7 +11678,7 @@ function AF(t){class e extends t{fractionalWidthChanged(){this.columnInternals.f
|
|
|
11669
11678
|
font: ${Rc};
|
|
11670
11679
|
color: ${Fc};
|
|
11671
11680
|
}
|
|
11672
|
-
`,
|
|
11681
|
+
`,LF=Q`
|
|
11673
11682
|
<template
|
|
11674
11683
|
@click="${(t,e)=>("string"==typeof t.cellRecord?.href&&e.event.stopPropagation(),!0)}"
|
|
11675
11684
|
class="${t=>t.isPlaceholder?"placeholder":""}"
|
|
@@ -11703,19 +11712,19 @@ function AF(t){class e extends t{fractionalWidthChanged(){this.columnInternals.f
|
|
|
11703
11712
|
</span>`)}
|
|
11704
11713
|
</template>
|
|
11705
11714
|
`
|
|
11706
|
-
class
|
|
11707
|
-
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}focusedRecycleCallback(){this.anchor?.blur()}get tabbableChildren(){return this.showAnchor?[this.anchor]:[]}}t([C],
|
|
11708
|
-
const
|
|
11709
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
11710
|
-
class
|
|
11711
|
-
const
|
|
11715
|
+
class BF extends wR{constructor(){super(...arguments),this.hasOverflow=!1,this.isPlaceholder=!1}get text(){const t=this.cellRecord?.label??this.cellRecord?.href
|
|
11716
|
+
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}focusedRecycleCallback(){this.anchor?.blur()}get tabbableChildren(){return this.showAnchor?[this.anchor]:[]}}t([C],BF.prototype,"hasOverflow",void 0),t([C],BF.prototype,"isPlaceholder",void 0),t([k],BF.prototype,"text",null),t([k],BF.prototype,"showAnchor",null)
|
|
11717
|
+
const PF=BF.compose({baseName:"table-column-anchor-cell-view",template:LF,styles:NF})
|
|
11718
|
+
_i.getOrCreate().withPrefix("nimble").register(PF())
|
|
11719
|
+
class zF extends bR{constructor(){super(...arguments),this.hasOverflow=!1,this.text=Ov.getValueFor(this),this.noValuePlaceholderLabelSubscriber={handleChange:()=>{this.applyPlaceholderTextIfNeeded()}},this.emptyPlaceholderLabelSubscriber={handleChange:()=>{this.applyPlaceholderTextIfNeeded()}}}connectedCallback(){super.connectedCallback(),Ov.subscribe(this.noValuePlaceholderLabelSubscriber,this),Rv.subscribe(this.emptyPlaceholderLabelSubscriber,this),this.applyPlaceholderTextIfNeeded()}disconnectedCallback(){super.disconnectedCallback(),Ov.unsubscribe(this.noValuePlaceholderLabelSubscriber),Rv.unsubscribe(this.emptyPlaceholderLabelSubscriber)}columnConfigChanged(){this.applyPlaceholderTextIfNeeded()||this.updateText()}groupHeaderValueChanged(){this.applyPlaceholderTextIfNeeded()||this.updateText()}applyPlaceholderTextIfNeeded(){return null===this.groupHeaderValue||void 0===this.groupHeaderValue?(this.text=Ov.getValueFor(this),!0):""===this.groupHeaderValue&&(this.text=Rv.getValueFor(this),!0)}}t([C],zF.prototype,"hasOverflow",void 0),t([C],zF.prototype,"text",void 0)
|
|
11720
|
+
const VF=Q`
|
|
11712
11721
|
<span
|
|
11713
11722
|
${Sg("hasOverflow")}
|
|
11714
11723
|
title="${t=>t.hasOverflow&&t.text?t.text:null}"
|
|
11715
11724
|
>
|
|
11716
11725
|
${t=>t.text}
|
|
11717
11726
|
</span>
|
|
11718
|
-
`,
|
|
11727
|
+
`,HF=Mt`
|
|
11719
11728
|
${Vs("flex")}
|
|
11720
11729
|
|
|
11721
11730
|
span {
|
|
@@ -11726,20 +11735,20 @@ const PF=Q`
|
|
|
11726
11735
|
text-overflow: ellipsis;
|
|
11727
11736
|
}
|
|
11728
11737
|
`
|
|
11729
|
-
const
|
|
11730
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
11731
|
-
const
|
|
11732
|
-
function
|
|
11733
|
-
const
|
|
11734
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
11735
|
-
class
|
|
11736
|
-
try{return t.format(e)}catch(t){return""}}t([ft({attribute:"field-name"})],
|
|
11737
|
-
const
|
|
11738
|
-
_i.getOrCreate().withPrefix("nimble").register(
|
|
11739
|
-
const
|
|
11738
|
+
const UF=class extends zF{updateText(){this.text="string"==typeof this.groupHeaderValue?this.groupHeaderValue:""}}.compose({baseName:"table-column-text-group-header-view",template:VF,styles:HF})
|
|
11739
|
+
_i.getOrCreate().withPrefix("nimble").register(UF())
|
|
11740
|
+
const qF="nimble-table-column-text-group-header-view"
|
|
11741
|
+
function jF(t){class e extends t{constructor(){super(...arguments),this.sortingDisabled=!1,this.sortDirection=QO.none}sortingDisabledChanged(){this.columnInternals.sortingDisabled=this.sortingDisabled,this.sortingDisabled?(this.columnInternals.currentSortDirection=QO.none,this.columnInternals.currentSortIndex=void 0):(this.columnInternals.currentSortDirection=this.sortDirection,this.columnInternals.currentSortIndex=this.sortIndex??void 0)}sortDirectionChanged(){this.sortingDisabled||(this.columnInternals.currentSortDirection=this.sortDirection)}sortIndexChanged(){this.sortingDisabled||(this.columnInternals.currentSortIndex=this.sortIndex??void 0)}}return ft({attribute:"sorting-disabled",mode:"boolean"})(e.prototype,"sortingDisabled"),ft({attribute:"sort-index",converter:ut})(e.prototype,"sortIndex"),ft({attribute:"sort-direction"})(e.prototype,"sortDirection"),e}class WF extends(RF(OF(FF(jF(IR))))){constructor(){super(...arguments),this.underlineHidden=!1}placeholderChanged(){this.updateColumnConfig()}getColumnInternalsOptions(){return{cellRecordFieldNames:["label","href"],cellViewTag:"nimble-table-column-anchor-cell-view",groupHeaderViewTag:qF,delegatedEvents:["click"],sortOperation:mR,validator:new MF([])}}labelFieldNameChanged(){this.columnInternals.dataRecordFieldNames=[this.labelFieldName,this.hrefFieldName],this.columnInternals.operandDataRecordFieldName=this.labelFieldName}hrefFieldNameChanged(){this.columnInternals.dataRecordFieldNames=[this.labelFieldName,this.hrefFieldName]}appearanceChanged(){this.updateColumnConfig()}underlineHiddenChanged(){this.updateColumnConfig()}hreflangChanged(){this.updateColumnConfig()}pingChanged(){this.updateColumnConfig()}referrerpolicyChanged(){this.updateColumnConfig()}relChanged(){this.updateColumnConfig()}targetChanged(){this.updateColumnConfig()}typeChanged(){this.updateColumnConfig()}downloadChanged(){this.updateColumnConfig()}updateColumnConfig(){this.columnInternals.columnConfig={appearance:this.appearance,underlineHidden:this.underlineHidden,hreflang:this.hreflang,ping:this.ping,referrerpolicy:this.referrerpolicy,rel:this.rel,target:this.target,type:this.type,download:this.download,placeholder:this.placeholder}}}t([ft({attribute:"label-field-name"})],WF.prototype,"labelFieldName",void 0),t([ft({attribute:"href-field-name"})],WF.prototype,"hrefFieldName",void 0),t([ft],WF.prototype,"appearance",void 0),t([ft({attribute:"underline-hidden",mode:"boolean"})],WF.prototype,"underlineHidden",void 0),t([ft],WF.prototype,"hreflang",void 0),t([ft],WF.prototype,"ping",void 0),t([ft],WF.prototype,"referrerpolicy",void 0),t([ft],WF.prototype,"rel",void 0),t([ft],WF.prototype,"target",void 0),t([ft],WF.prototype,"type",void 0),t([ft],WF.prototype,"download",void 0)
|
|
11742
|
+
const GF=WF.compose({baseName:"table-column-anchor",template:TF,styles:AF})
|
|
11743
|
+
_i.getOrCreate().withPrefix("nimble").register(GF())
|
|
11744
|
+
class ZF extends IR{fieldNameChanged(){this.columnInternals.dataRecordFieldNames=[this.fieldName],this.columnInternals.operandDataRecordFieldName=this.fieldName}}function KF(t){return RF(OF(FF(jF(t))))}function YF(t,e){if("number"!=typeof e)return""
|
|
11745
|
+
try{return t.format(e)}catch(t){return""}}t([ft({attribute:"field-name"})],ZF.prototype,"fieldName",void 0)
|
|
11746
|
+
const XF=class extends zF{updateText(){this.columnConfig?this.text=YF(this.columnConfig.formatter,this.groupHeaderValue):this.text=""}}.compose({baseName:"table-column-date-text-group-header-view",template:VF,styles:HF})
|
|
11747
|
+
_i.getOrCreate().withPrefix("nimble").register(XF())
|
|
11748
|
+
const JF=Q`
|
|
11740
11749
|
<template
|
|
11741
11750
|
class="
|
|
11742
|
-
${t=>t.alignment===
|
|
11751
|
+
${t=>t.alignment===oR?"right-align":""}
|
|
11743
11752
|
${t=>t.isPlaceholder?"placeholder":""}
|
|
11744
11753
|
"
|
|
11745
11754
|
>
|
|
@@ -11774,18 +11783,18 @@ const YF="left",XF="right",JF=Q`
|
|
|
11774
11783
|
color: ${Fc};
|
|
11775
11784
|
}
|
|
11776
11785
|
`
|
|
11777
|
-
class tN extends
|
|
11786
|
+
class tN extends wR{constructor(){super(...arguments),this.hasOverflow=!1,this.text="",this.alignment=sR,this.isPlaceholder=!1}columnConfigChanged(){this.applyPlaceholderTextIfNeeded()||this.updateText()}cellRecordChanged(){this.applyPlaceholderTextIfNeeded()||this.updateText()}applyPlaceholderTextIfNeeded(){const t=this.cellRecord?.value,e=this.columnConfig?.placeholder
|
|
11778
11787
|
return"string"==typeof e&&null==t?(this.text=e,this.isPlaceholder=!0):this.isPlaceholder=!1,this.isPlaceholder}}t([C],tN.prototype,"hasOverflow",void 0),t([C],tN.prototype,"text",void 0),t([C],tN.prototype,"alignment",void 0),t([C],tN.prototype,"isPlaceholder",void 0)
|
|
11779
|
-
const eN=class extends tN{updateText(){this.columnConfig?this.text=
|
|
11788
|
+
const eN=class extends tN{updateText(){this.columnConfig?this.text=YF(this.columnConfig.formatter,this.cellRecord?.value):this.text=""}}.compose({baseName:"table-column-date-text-cell-view",template:JF,styles:QF})
|
|
11780
11789
|
_i.getOrCreate().withPrefix("nimble").register(eN())
|
|
11781
11790
|
const nN=void 0,iN=["invalidCustomOptionsCombination"]
|
|
11782
|
-
class sN extends
|
|
11783
|
-
class rN extends(
|
|
11791
|
+
class sN extends MF{constructor(){super(iN)}setCustomOptionsValidity(t){this.setConditionValue("invalidCustomOptionsCombination",!t)}}const oN={toView:t=>"boolean"==typeof t?t.toString():null,fromView:t=>"true"===t||!0===t||"false"!==t&&!1!==t&&void 0}
|
|
11792
|
+
class rN extends(KF(ZF)){constructor(){super(...arguments),this.langSubscriber={handleChange:()=>{this.updateColumnConfig()}}}connectedCallback(){super.connectedCallback(),Za.subscribe(this.langSubscriber,this),this.updateColumnConfig()}disconnectedCallback(){super.disconnectedCallback(),Za.unsubscribe(this.langSubscriber,this)}placeholderChanged(){this.updateColumnConfig()}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-date-text-cell-view",groupHeaderViewTag:"nimble-table-column-date-text-group-header-view",delegatedEvents:[],sortOperation:fR,validator:new sN}}formatChanged(){this.updateColumnConfig()}customLocaleMatcherChanged(){this.updateColumnConfig()}customWeekdayChanged(){this.updateColumnConfig()}customEraChanged(){this.updateColumnConfig()}customYearChanged(){this.updateColumnConfig()}customMonthChanged(){this.updateColumnConfig()}customDayChanged(){this.updateColumnConfig()}customHourChanged(){this.updateColumnConfig()}customMinuteChanged(){this.updateColumnConfig()}customSecondChanged(){this.updateColumnConfig()}customTimeZoneNameChanged(){this.updateColumnConfig()}customFormatMatcherChanged(){this.updateColumnConfig()}customHour12Changed(){this.updateColumnConfig()}customTimeZoneChanged(){this.updateColumnConfig()}customCalendarChanged(){this.updateColumnConfig()}customDayPeriodChanged(){this.updateColumnConfig()}customNumberingSystemChanged(){this.updateColumnConfig()}customDateStyleChanged(){this.updateColumnConfig()}customTimeStyleChanged(){this.updateColumnConfig()}customHourCycleChanged(){this.updateColumnConfig()}updateColumnConfig(){const t=this.createFormatter()
|
|
11784
11793
|
if(t){const e={formatter:t,placeholder:this.placeholder}
|
|
11785
11794
|
this.columnInternals.columnConfig=e,this.columnInternals.validator.setCustomOptionsValidity(!0)}else this.columnInternals.columnConfig=void 0,this.columnInternals.validator.setCustomOptionsValidity(!1)}createFormatter(){let t
|
|
11786
11795
|
t=this.format===nN?{dateStyle:"medium",timeStyle:"medium"}:this.getCustomFormattingOptions()
|
|
11787
11796
|
try{return new Intl.DateTimeFormat(Za.getValueFor(this),t)}catch(t){return}}getCustomFormattingOptions(){return{localeMatcher:this.customLocaleMatcher??void 0,weekday:this.customWeekday??void 0,era:this.customEra??void 0,year:this.customYear??void 0,month:this.customMonth??void 0,day:this.customDay??void 0,hour:this.customHour??void 0,minute:this.customMinute??void 0,second:this.customSecond??void 0,timeZoneName:this.customTimeZoneName??void 0,formatMatcher:this.customFormatMatcher??void 0,hour12:this.customHour12??void 0,timeZone:this.customTimeZone??void 0,calendar:this.customCalendar??void 0,dayPeriod:this.customDayPeriod??void 0,numberingSystem:this.customNumberingSystem??void 0,dateStyle:this.customDateStyle??void 0,timeStyle:this.customTimeStyle??void 0,hourCycle:this.customHourCycle??void 0}}}t([ft],rN.prototype,"format",void 0),t([ft({attribute:"custom-locale-matcher"})],rN.prototype,"customLocaleMatcher",void 0),t([ft({attribute:"custom-weekday"})],rN.prototype,"customWeekday",void 0),t([ft({attribute:"custom-era"})],rN.prototype,"customEra",void 0),t([ft({attribute:"custom-year"})],rN.prototype,"customYear",void 0),t([ft({attribute:"custom-month"})],rN.prototype,"customMonth",void 0),t([ft({attribute:"custom-day"})],rN.prototype,"customDay",void 0),t([ft({attribute:"custom-hour"})],rN.prototype,"customHour",void 0),t([ft({attribute:"custom-minute"})],rN.prototype,"customMinute",void 0),t([ft({attribute:"custom-second"})],rN.prototype,"customSecond",void 0),t([ft({attribute:"custom-time-zone-name"})],rN.prototype,"customTimeZoneName",void 0),t([ft({attribute:"custom-format-matcher"})],rN.prototype,"customFormatMatcher",void 0),t([ft({attribute:"custom-hour12",converter:oN})],rN.prototype,"customHour12",void 0),t([ft({attribute:"custom-time-zone"})],rN.prototype,"customTimeZone",void 0),t([ft({attribute:"custom-calendar"})],rN.prototype,"customCalendar",void 0),t([ft({attribute:"custom-day-period"})],rN.prototype,"customDayPeriod",void 0),t([ft({attribute:"custom-numbering-system"})],rN.prototype,"customNumberingSystem",void 0),t([ft({attribute:"custom-date-style"})],rN.prototype,"customDateStyle",void 0),t([ft({attribute:"custom-time-style"})],rN.prototype,"customTimeStyle",void 0),t([ft({attribute:"custom-hour-cycle"})],rN.prototype,"customHourCycle",void 0)
|
|
11788
|
-
const aN=rN.compose({baseName:"table-column-date-text",template:
|
|
11797
|
+
const aN=rN.compose({baseName:"table-column-date-text",template:TF,styles:AF})
|
|
11789
11798
|
_i.getOrCreate().withPrefix("nimble").register(aN())
|
|
11790
11799
|
const lN=class extends tN{updateText(){this.text=this.columnConfig?.formatter.format(this.cellRecord?.value)??""}}.compose({baseName:"table-column-duration-text-cell-view",template:JF,styles:QF})
|
|
11791
11800
|
_i.getOrCreate().withPrefix("nimble").register(lN())
|
|
@@ -11802,14 +11811,14 @@ if(a-=d*i,d){const t=this.minutesFormatter.format(d)
|
|
|
11802
11811
|
e.push(t)}const h=a/n,u=0===h?0:h%60
|
|
11803
11812
|
if(t<1&&0!==h)return this.scientificSecondsFormatter.format(h)
|
|
11804
11813
|
if(u>=5e-4||0===u&&0===e.length){const t=this.secondsFormatter.format(u)
|
|
11805
|
-
e.push(t)}return e.join(", ")}}const dN=class extends
|
|
11814
|
+
e.push(t)}return e.join(", ")}}const dN=class extends zF{updateText(){this.columnConfig?this.text=this.columnConfig.formatter.format(this.groupHeaderValue):this.text=""}}.compose({baseName:"table-column-duration-text-group-header-view",template:VF,styles:HF})
|
|
11806
11815
|
_i.getOrCreate().withPrefix("nimble").register(dN())
|
|
11807
|
-
class hN extends(
|
|
11808
|
-
this.columnInternals.columnConfig=t}}const uN=hN.compose({baseName:"table-column-duration-text",template:
|
|
11816
|
+
class hN extends(KF(ZF)){constructor(){super(...arguments),this.langSubscriber={handleChange:()=>{this.updateColumnConfig()}}}connectedCallback(){super.connectedCallback(),Za.subscribe(this.langSubscriber,this),this.updateColumnConfig()}disconnectedCallback(){super.disconnectedCallback(),Za.unsubscribe(this.langSubscriber,this)}placeholderChanged(){this.updateColumnConfig()}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-duration-text-cell-view",groupHeaderViewTag:"nimble-table-column-duration-text-group-header-view",delegatedEvents:[],sortOperation:fR,validator:new MF([])}}updateColumnConfig(){const t={formatter:new cN(Za.getValueFor(this)),placeholder:this.placeholder}
|
|
11817
|
+
this.columnInternals.columnConfig=t}}const uN=hN.compose({baseName:"table-column-duration-text",template:TF,styles:AF})
|
|
11809
11818
|
_i.getOrCreate().withPrefix("nimble").register(uN())
|
|
11810
11819
|
const pN=(t,e)=>{if("number"===e){const e=ut.fromView(t)
|
|
11811
11820
|
return null===e?void 0:e}return"boolean"===e?!1!==t&&"false"!==t&&(!0===t||"true"===t||void 0):t?.toString()??void 0}
|
|
11812
|
-
class fN extends
|
|
11821
|
+
class fN extends IR{constructor(){super(...arguments),this.mappingNotifiers=[],this.mappings=[],this.keyType="string"}handleChange(t,e){t instanceof Wv&&"string"==typeof e&&this.updateColumnConfig()}updateColumnConfig(){this.columnInternals.validator.validate(this.mappings,this.keyType),this.columnInternals.columnConfig=this.checkValidity()?this.createColumnConfig(this.getMappingConfigs()):void 0}getMappingConfigs(){const t=new Map
|
|
11813
11822
|
return this.mappings.forEach((e=>{const n=pN(e.key,this.keyType)
|
|
11814
11823
|
if(void 0===n)throw Error("Key was invalid for type. Validation should have prevented this.")
|
|
11815
11824
|
const i=this.createMappingConfig(e)
|
|
@@ -11817,13 +11826,13 @@ t.set(n,i)})),t}fieldNameChanged(){this.columnInternals.dataRecordFieldNames=[th
|
|
|
11817
11826
|
for(const t of this.mappings){const e=x.getNotifier(t)
|
|
11818
11827
|
e.subscribe(this),this.mappingNotifiers.push(e)}}}t([C],fN.prototype,"mappings",void 0),t([ft({attribute:"field-name"})],fN.prototype,"fieldName",void 0),t([ft({attribute:"key-type"})],fN.prototype,"keyType",void 0)
|
|
11819
11828
|
const mN=Mt`
|
|
11820
|
-
${
|
|
11829
|
+
${AF}
|
|
11821
11830
|
|
|
11822
11831
|
slot[name='mapping'] {
|
|
11823
11832
|
display: none;
|
|
11824
11833
|
}
|
|
11825
|
-
`,gN=Q`${
|
|
11826
|
-
class vN extends
|
|
11834
|
+
`,gN=Q`${TF}<slot ${ie("mappings")} name="mapping"></slot>`
|
|
11835
|
+
class vN extends MF{constructor(t){super(t)}validate(t,e){this.untrackAll()
|
|
11827
11836
|
const n=t.map((t=>t.key))
|
|
11828
11837
|
this.validateKeyValuesForType(n,e),this.validateUniqueKeys(n,e),this.validateNoMissingKeys(t)}validateKeyValuesForType(t,e){const n=t.some((t=>void 0!==t&&void 0===pN(t,e)))
|
|
11829
11838
|
this.setConditionValue("invalidMappingKeyValueForType",n)}validateUniqueKeys(t,e){const n=t.map((t=>pN(t,e))),i=new Set(n).size!==n.length
|
|
@@ -11884,7 +11893,7 @@ super(n),this.severity=e,this.textHidden=i,this.iconTemplate=Q`
|
|
|
11884
11893
|
>
|
|
11885
11894
|
</${RT}>
|
|
11886
11895
|
`
|
|
11887
|
-
class IN extends kN{constructor(t,e){super(t),this.textHidden=e,this.spinnerTemplate=_N}}class MN extends kN{}class $N extends kN{}class EN extends
|
|
11896
|
+
class IN extends kN{constructor(t,e){super(t),this.textHidden=e,this.spinnerTemplate=_N}}class MN extends kN{}class $N extends kN{}class EN extends bR{constructor(){super(...arguments),this.hasOverflow=!1,this.text="",this.textHidden=!1}columnConfigChanged(){this.updateState()}groupHeaderValueChanged(){this.updateState()}updateState(){if(this.resetState(),!this.columnConfig)return
|
|
11888
11897
|
const t=this.groupHeaderValue,e=this.columnConfig.mappingConfigs.get(t)
|
|
11889
11898
|
e instanceof SN?(this.severity=e.severity,this.text=e.text??"",this.visualizationTemplate=e.iconTemplate):e instanceof IN?(this.text=e.text??"",this.visualizationTemplate=e.spinnerTemplate):(e instanceof MN||e instanceof $N)&&(this.text=e.text??"")}resetState(){this.text="",this.visualizationTemplate=void 0,this.severity=CN.default}}t([C],EN.prototype,"hasOverflow",void 0),t([C],EN.prototype,"text",void 0),t([C],EN.prototype,"severity",void 0),t([C],EN.prototype,"visualizationTemplate",void 0)
|
|
11890
11899
|
const DN=EN.compose({baseName:"table-column-mapping-group-header-view",template:xN,styles:wN})
|
|
@@ -11927,7 +11936,7 @@ const AN=Mt`
|
|
|
11927
11936
|
</span>
|
|
11928
11937
|
`)}
|
|
11929
11938
|
`
|
|
11930
|
-
class ON extends
|
|
11939
|
+
class ON extends wR{constructor(){super(...arguments),this.textHidden=!1,this.hasOverflow=!1}columnConfigChanged(){this.updateState()}cellRecordChanged(){this.updateState()}updateState(){if(this.resetState(),!this.columnConfig||!this.cellRecord)return
|
|
11931
11940
|
const t=this.cellRecord.value
|
|
11932
11941
|
if(null==t)return
|
|
11933
11942
|
const e=this.columnConfig.mappingConfigs.get(t)
|
|
@@ -11935,16 +11944,16 @@ e instanceof SN?(this.severity=e.severity,this.text=e.text,this.visualizationTem
|
|
|
11935
11944
|
const RN=ON.compose({baseName:"table-column-mapping-cell-view",template:TN,styles:AN})
|
|
11936
11945
|
_i.getOrCreate().withPrefix("nimble").register(RN())
|
|
11937
11946
|
const FN="icon-size"
|
|
11938
|
-
class NN extends(
|
|
11947
|
+
class NN extends(RF(OF(jF(fN)))){minPixelWidthChanged(){this.widthMode!==FN&&(this.columnInternals.minPixelWidth=this.getConfiguredMinPixelWidth())}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-mapping-cell-view",groupHeaderViewTag:"nimble-table-column-mapping-group-header-view",delegatedEvents:[],sortOperation:fR,validator:new yN}}createColumnConfig(t){return{mappingConfigs:t}}createMappingConfig(t){if(t instanceof Jv){if(!t.resolvedIcon)throw Error("Unresolved icon")
|
|
11939
11948
|
return new SN(t.resolvedIcon,t.severity,t.text,t.textHidden)}if(t instanceof tb)return new IN(t.text,t.textHidden)
|
|
11940
11949
|
if(t instanceof nb)return new MN(t.text)
|
|
11941
11950
|
if(t instanceof Kv)return new $N(t.text)
|
|
11942
|
-
throw new Error("Unsupported mapping")}widthModeChanged(){this.widthMode===FN?(this.columnInternals.resizingDisabled=!0,this.columnInternals.hideHeaderIndicators=!0,this.columnInternals.pixelWidth=32,this.columnInternals.minPixelWidth=32):(this.columnInternals.resizingDisabled=!1,this.columnInternals.hideHeaderIndicators=!1,this.columnInternals.pixelWidth=void 0,this.columnInternals.minPixelWidth=this.getConfiguredMinPixelWidth())}getConfiguredMinPixelWidth(){return"number"==typeof this.minPixelWidth?this.minPixelWidth:
|
|
11951
|
+
throw new Error("Unsupported mapping")}widthModeChanged(){this.widthMode===FN?(this.columnInternals.resizingDisabled=!0,this.columnInternals.hideHeaderIndicators=!0,this.columnInternals.pixelWidth=32,this.columnInternals.minPixelWidth=32):(this.columnInternals.resizingDisabled=!1,this.columnInternals.hideHeaderIndicators=!1,this.columnInternals.pixelWidth=void 0,this.columnInternals.minPixelWidth=this.getConfiguredMinPixelWidth())}getConfiguredMinPixelWidth(){return"number"==typeof this.minPixelWidth?this.minPixelWidth:gR}}t([ft({attribute:"width-mode"})],NN.prototype,"widthMode",void 0)
|
|
11943
11952
|
const LN=NN.compose({baseName:"table-column-mapping",template:gN,styles:mN})
|
|
11944
11953
|
_i.getOrCreate().withPrefix("nimble").register(LN())
|
|
11945
11954
|
const BN=Q`
|
|
11946
11955
|
<template @delegated-event="${(t,e)=>t.onDelegatedEvent(e.event)}"
|
|
11947
|
-
>${
|
|
11956
|
+
>${TF}</template
|
|
11948
11957
|
>
|
|
11949
11958
|
`,PN="menu-button-menu",zN=Q`
|
|
11950
11959
|
${Gt((t=>t.showMenuButton),Q`
|
|
@@ -11981,16 +11990,16 @@ const BN=Q`
|
|
|
11981
11990
|
white-space: nowrap;
|
|
11982
11991
|
}
|
|
11983
11992
|
`
|
|
11984
|
-
class HN extends
|
|
11993
|
+
class HN extends wR{constructor(){super(...arguments),this.hasOverflow=!1}get showMenuButton(){return!!this.cellRecord?.value}get tabbableChildren(){return this.showMenuButton?[this.menuButton]:[]}onMenuButtonBeforeToggle(t){const e=this.columnConfig?.menuSlot
|
|
11985
11994
|
if(e&&t.detail.newState){const t={slots:[{name:e,slot:PN}]}
|
|
11986
11995
|
this.$emit("cell-view-slots-request",t)}return!0}onMenuButtonMouseOver(){this.valueSpan&&(this.hasOverflow=this.valueSpan.offsetWidth<this.valueSpan.scrollWidth)}onMenuButtonMouseOut(){this.hasOverflow=!1}onMenuButtonClick(t){t.stopPropagation()}}t([C],HN.prototype,"hasOverflow",void 0),t([k],HN.prototype,"showMenuButton",null)
|
|
11987
11996
|
const UN=HN.compose({baseName:"table-column-menu-button-cell-view",template:zN,styles:VN})
|
|
11988
11997
|
_i.getOrCreate().withPrefix("nimble").register(UN())
|
|
11989
|
-
class qN extends(
|
|
11998
|
+
class qN extends(OF(IR)){onDelegatedEvent(t){t.stopImmediatePropagation()
|
|
11990
11999
|
const e=t,n=e.detail.originalEvent
|
|
11991
12000
|
if("beforetoggle"===n.type||"toggle"===n.type){const t=`menu-button-column-${n.type}`,i={...n.detail,recordId:e.detail.recordId}
|
|
11992
|
-
this.$emit(t,i)}}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-menu-button-cell-view",delegatedEvents:["beforetoggle","toggle"],slotNames:[PN],validator:new
|
|
11993
|
-
const jN=qN.compose({baseName:"table-column-menu-button",template:BN,styles:
|
|
12001
|
+
this.$emit(t,i)}}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-menu-button-cell-view",delegatedEvents:["beforetoggle","toggle"],slotNames:[PN],validator:new MF([])}}fieldNameChanged(){this.columnInternals.dataRecordFieldNames=[this.fieldName],this.columnInternals.operandDataRecordFieldName=this.fieldName}menuSlotChanged(){this.updateColumnConfig()}updateColumnConfig(){this.columnInternals.columnConfig={menuSlot:this.menuSlot}}}t([ft({attribute:"field-name"})],qN.prototype,"fieldName",void 0),t([ft({attribute:"menu-slot"})],qN.prototype,"menuSlot",void 0)
|
|
12002
|
+
const jN=qN.compose({baseName:"table-column-menu-button",template:BN,styles:AF})
|
|
11994
12003
|
_i.getOrCreate().withPrefix("nimble").register(jN())
|
|
11995
12004
|
const WN=Q`<span
|
|
11996
12005
|
${Sg("hasOverflow")}
|
|
@@ -12000,9 +12009,9 @@ const WN=Q`<span
|
|
|
12000
12009
|
<slot ${Ut("contentSlot")}></slot>
|
|
12001
12010
|
<slot ${ie({property:"unitElements",filter:te()})} name="unit"></slot>
|
|
12002
12011
|
</span>`
|
|
12003
|
-
const GN=class extends
|
|
12012
|
+
const GN=class extends zF{updateText(){this.text=this.columnConfig?.formatter?.format(this.groupHeaderValue)??""}}.compose({baseName:"table-column-number-text-group-header-view",template:VF,styles:HF})
|
|
12004
12013
|
_i.getOrCreate().withPrefix("nimble").register(GN())
|
|
12005
|
-
const ZN=class extends tN{columnConfigChanged(){super.columnConfigChanged(),this.alignment=this.columnConfig?.alignment??
|
|
12014
|
+
const ZN=class extends tN{columnConfigChanged(){super.columnConfigChanged(),this.alignment=this.columnConfig?.alignment??sR}updateText(){this.text=this.columnConfig?.formatter?.format(this.cellRecord?.value)??""}}.compose({baseName:"table-column-number-text-cell-view",template:JF,styles:QF})
|
|
12006
12015
|
_i.getOrCreate().withPrefix("nimble").register(ZN())
|
|
12007
12016
|
const KN={default:void 0,decimal:"decimal"},YN="left",XN="right"
|
|
12008
12017
|
class JN{format(t){if("number"!=typeof t)return""
|
|
@@ -12031,21 +12040,21 @@ const e="number"==typeof t.decimalDigits,n="number"==typeof t.decimalMaximumDigi
|
|
|
12031
12040
|
if(e&&n)throw new Error("decimalDigits and decimalMaximumDigits are mutually exclusive. Do not specify both.")
|
|
12032
12041
|
return e||n?{numberTextFormat:KN.decimal,decimalDigits:t.decimalDigits,decimalMaximumDigits:t.decimalMaximumDigits,unitScale:t.unitScale??iL}:{numberTextFormat:KN.decimal,decimalDigits:aL.defaultDecimalDigits,decimalMaximumDigits:void 0,unitScale:t.unitScale??iL}}}aL.defaultDecimalDigits=2
|
|
12033
12042
|
const lL=["invalidDecimalDigits","invalidDecimalMaximumDigits","decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits","moreThanOneUnitSpecified"]
|
|
12034
|
-
class cL extends
|
|
12043
|
+
class cL extends MF{constructor(){super(lL)}validateDecimalDigits(t,e){const n=!!(t===KN.decimal&&"number"==typeof e)&&this.isInvalidDecimalDigitsValue(e)
|
|
12035
12044
|
this.setConditionValue("invalidDecimalDigits",n)}validateDecimalMaximumDigits(t,e){const n=!!(t===KN.decimal&&"number"==typeof e)&&this.isInvalidDecimalDigitsValue(e)
|
|
12036
12045
|
this.setConditionValue("invalidDecimalMaximumDigits",n)}validateNoMutuallyExclusiveProperties(t,e,n){const i=!!(t===KN.decimal)&&("number"==typeof e&&"number"==typeof n)
|
|
12037
12046
|
this.setConditionValue("decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits",i)}validateAtMostOneUnit(t){const e=t.length>1
|
|
12038
12047
|
this.setConditionValue("moreThanOneUnitSpecified",e)}isInvalidDecimalDigitsValue(t){return t<0||t>20}}class dL extends We{}t([C],dL.prototype,"resolvedUnitScale",void 0)
|
|
12039
|
-
class hL extends(
|
|
12048
|
+
class hL extends(KF(ZF)){constructor(){super(...arguments),this.langSubscriber={handleChange:()=>{this.updateColumnConfig()}},this.unitSubscriber={handleChange:()=>{this.updateColumnConfig()}}}connectedCallback(){super.connectedCallback(),Za.subscribe(this.langSubscriber,this),this.updateColumnConfig()}disconnectedCallback(){super.disconnectedCallback(),Za.unsubscribe(this.langSubscriber,this)}placeholderChanged(){this.updateColumnConfig()}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-number-text-cell-view",groupHeaderViewTag:"nimble-table-column-number-text-group-header-view",delegatedEvents:[],sortOperation:fR,validator:new cL}}updateUnitNotifier(){if(this.unitNotifier&&(this.unitNotifier.unsubscribe(this.unitSubscriber),this.unitNotifier=void 0),this.unit){const t=x.getNotifier(this.unit)
|
|
12040
12049
|
t.subscribe(this.unitSubscriber,"resolvedUnitScale"),this.unitNotifier=t}}formatChanged(){this.updateColumnConfig()}alignmentChanged(){this.updateColumnConfig()}decimalDigitsChanged(){this.updateColumnConfig()}decimalMaximumDigitsChanged(){this.updateColumnConfig()}unitElementsChanged(){this.updateUnit()}async updateUnit(){this.unit=void 0,this.unitElements&&(await _E(this.unitElements),this.unit=this.unitElements.find((t=>t instanceof dL))),this.updateUnitNotifier()}unitChanged(){this.updateColumnConfig()}updateColumnConfig(){const t=this.columnInternals.validator
|
|
12041
12050
|
if(t.validateDecimalDigits(this.format,this.decimalDigits),t.validateDecimalMaximumDigits(this.format,this.decimalMaximumDigits),t.validateNoMutuallyExclusiveProperties(this.format,this.decimalDigits,this.decimalMaximumDigits),t.validateAtMostOneUnit(this.unitElements??[]),t.isValid()){const t={formatter:this.createFormatter(),alignment:this.determineCellContentAlignment(),placeholder:this.placeholder}
|
|
12042
|
-
this.columnInternals.columnConfig=t}else this.columnInternals.columnConfig=void 0}createFormatter(){const t=this.unit?.resolvedUnitScale
|
|
12043
|
-
return new aL(Za.getValueFor(this),{numberTextFormat:this.format??void 0,decimalDigits:this.decimalDigits??void 0,decimalMaximumDigits:this.decimalMaximumDigits??void 0,unitScale:t})}determineCellContentAlignment(){return this.alignment===YN?
|
|
12044
|
-
const uL=hL.compose({baseName:"table-column-number-text",template:WN,styles:
|
|
12051
|
+
this.columnInternals.headerAlignment=t.alignment,this.columnInternals.columnConfig=t}else this.columnInternals.columnConfig=void 0}createFormatter(){const t=this.unit?.resolvedUnitScale
|
|
12052
|
+
return new aL(Za.getValueFor(this),{numberTextFormat:this.format??void 0,decimalDigits:this.decimalDigits??void 0,decimalMaximumDigits:this.decimalMaximumDigits??void 0,unitScale:t})}determineCellContentAlignment(){return this.alignment===YN?sR:this.alignment===XN?oR:this.format!==KN.decimal||"number"==typeof this.decimalMaximumDigits||this.unit?sR:oR}}t([ft],hL.prototype,"format",void 0),t([ft],hL.prototype,"alignment",void 0),t([ft({attribute:"decimal-digits",converter:ut})],hL.prototype,"decimalDigits",void 0),t([ft({attribute:"decimal-maximum-digits",converter:ut})],hL.prototype,"decimalMaximumDigits",void 0),t([C],hL.prototype,"unitElements",void 0),t([C],hL.prototype,"unit",void 0)
|
|
12053
|
+
const uL=hL.compose({baseName:"table-column-number-text",template:WN,styles:AF})
|
|
12045
12054
|
_i.getOrCreate().withPrefix("nimble").register(uL())
|
|
12046
12055
|
const pL=class extends tN{updateText(){this.text="string"==typeof this.cellRecord?.value?this.cellRecord.value:""}}.compose({baseName:"table-column-text-cell-view",template:JF,styles:QF})
|
|
12047
12056
|
_i.getOrCreate().withPrefix("nimble").register(pL())
|
|
12048
|
-
class fL extends(
|
|
12057
|
+
class fL extends(KF(ZF)){placeholderChanged(){this.columnInternals.columnConfig={placeholder:this.placeholder}}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-text-cell-view",groupHeaderViewTag:qF,delegatedEvents:[],sortOperation:mR,validator:new MF([])}}}const mL=fL.compose({baseName:"table-column-text",template:TF,styles:AF})
|
|
12049
12058
|
_i.getOrCreate().withPrefix("nimble").register(mL())
|
|
12050
12059
|
const gL=Mt`
|
|
12051
12060
|
${Vs("grid")}
|