@ni/spright-components 6.9.1 → 6.10.1

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.
@@ -12373,14 +12373,12 @@ const t=this.hierarchyOptions.get(n)?.delayedHierarchyState,o=i.delayedHierarchy
12373
12373
  t!==UL||o!==HL||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===UL}canLoadDelayedChildren(t){if(!this.isHierarchyEnabled)return!1
12374
12374
  const e=this.hierarchyOptions.get(t)?.delayedHierarchyState
12375
12375
  return e!==VL}getDefaultExpansionState(t){return 0!==t.subRows.length}}class vP extends yD{isValid(){return this.noneTracked()}getValidationFlags(){return this.getTrackedItems()}}class bP extends vP{constructor(t){super(t),this.isColumnValid=!0}getValidity(){return this.getValidationFlags()}onTrackingChange(){super.onTrackingChange(),this.isColumnValid=this.isValid()}setConditionValue(t,e){e?this.track(t):this.untrack(t)}}t([C],bP.prototype,"isColumnValid",void 0)
12376
- class yP{get inNavigationMode(){return this.focusType!==iB&&this.focusType!==oB}constructor(t,e){this.table=t,this.virtualizer=e,this.focusType=XL,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)
12377
- const e=void 0!==this.table.openActionMenuRecordId
12378
- if((t.target===this.table||this.focusType===XL)&&!e){let t=!0
12379
- this.hasRowOrCellFocusType()&&this.scrollToAndFocusRow(this.rowIndex)&&(t=!1),t&&!this.setFocusOnHeader()&&this.table.blur()}},this.onTableFocusOut=()=>{this.focusWithinTable=!1},this.onCellActionMenuBlur=t=>{t.stopPropagation()
12376
+ class yP{get inNavigationMode(){return this.focusType!==iB&&this.focusType!==oB}constructor(t,e){this.table=t,this.virtualizer=e,this.focusType=XL,this.headerActionIndex=-1,this.rowIndex=-1,this.cellContentIndex=-1,this.columnIndex=-1,this.focusWithinTable=!1,this.isCurrentlyFocusingElement=!1,this.focusedViaPointer=!1,this.visibleRowNotifiers=[],this.onTableFocusIn=t=>{this.focusWithinTable=!0,this.updateFocusStateFromActiveElement()
12377
+ void 0!==this.table.openActionMenuRecordId||(this.focusType===XL?this.focusSomethingOtherThanTheTable():t.target===this.table&&(this.hasRowOrCellFocusType()&&this.rowIndexIsValid(this.rowIndex)?this.scrollToAndFocusRow(this.rowIndex):this.hasHeaderFocusType()?this.focusHeaderElement():this.focusSomethingOtherThanTheTable())),this.focusedViaPointer=!1},this.onTableFocusOut=()=>{this.focusWithinTable=!1},this.onCellActionMenuBlur=t=>{t.stopPropagation()
12380
12378
  const e=t.detail
12381
- e.actionMenuButton&&this.setActionMenuButtonFocused(e.actionMenuButton,!1)},this.onCellViewFocusIn=t=>{t.stopPropagation(),this.updateFocusStateFromActiveElement(!1)},this.onCellFocusIn=t=>{t.stopPropagation()
12382
- const e=t.detail
12383
- this.updateFocusStateFromActiveElement(!0),this.focusType===tB&&this.getActiveElement()===e&&this.focusCurrentRow(!1)},this.onCellBlur=t=>{t.stopPropagation()
12379
+ e.actionMenuButton&&this.setActionMenuButtonFocused(e.actionMenuButton,!1)},this.onCellViewFocusIn=t=>{t.stopPropagation(),this.updateFocusStateFromActiveElement()},this.onCellFocusIn=t=>{t.stopPropagation()
12380
+ const e=t.detail,n=this.updateFocusStateFromActiveElement()
12381
+ n&&this.hasRowOrCellFocusType()&&this.rowIndex!==n.resolvedRowIndex&&this.setRowFocusState(n.resolvedRowIndex),this.focusType===tB&&this.getActiveElement()===e&&this.focusCurrentRow(!1)},this.onCellBlur=t=>{t.stopPropagation()
12384
12382
  const e=t.detail
12385
12383
  this.setElementFocusable(e,!1)},this.onCaptureKeyDown=t=>{let e=!1
12386
12384
  if(t.key===pn)e=this.onTabPressed(t.shiftKey)
@@ -12405,10 +12403,10 @@ break
12405
12403
  case un:e=this.onSpacePressed(t.shiftKey)
12406
12404
  break
12407
12405
  case"F2":e=this.onF2Pressed()}e&&t.preventDefault()},this.onKeyDown=t=>{if(!(this.inNavigationMode||t.defaultPrevented||t.key!==an&&"F2"!==t.key)){const t=this.getCurrentRow()
12408
- t&&this.trySetCellFocus(t.getFocusableElements())}},this.onViewportKeyDown=t=>{let e=!this.inNavigationMode&&(t.key===rn||t.key===en)
12406
+ t&&this.trySetCellFocus(t.getFocusableElements())}},this.onPointerDown=()=>{this.focusedViaPointer=!0},this.onPointerUpOrCancel=()=>{this.focusedViaPointer=!1},this.onViewportKeyDown=t=>{let e=!this.inNavigationMode&&(t.key===rn||t.key===en)
12409
12407
  switch(t.key){case hn:case dn:case ln:case cn: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=XL
12410
12408
  const t=this.getActiveElement()
12411
- 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
12409
+ 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("pointerdown",this.onPointerDown),this.table.addEventListener("pointerup",this.onPointerUpOrCancel),this.table.addEventListener("pointercancel",this.onPointerUpOrCancel),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("pointerdown",this.onPointerDown),this.table.removeEventListener("pointerup",this.onPointerUpOrCancel),this.table.removeEventListener("pointercancel",this.onPointerUpOrCancel),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
12412
12410
  if(t===this.virtualizer&&"visibleItems"===e)n=!0
12413
12411
  else if(t===this.table&&"rowElements"===e){for(const t of this.visibleRowNotifiers)t.unsubscribe(this)
12414
12412
  this.visibleRowNotifiers=[]
@@ -12419,7 +12417,7 @@ this.rowIndex=0}this.focusWithinTable&&this.focusCurrentRow(!1)}}onRowFocusIn(t)
12419
12417
  const e=t.target
12420
12418
  this.isResolvedRowType(e)&&this.rowIndex!==e.resolvedRowIndex&&this.setRowFocusState(e.resolvedRowIndex)}onRowBlur(t){const e=t.target
12421
12419
  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))
12422
- this.setCellActionMenuFocusState(e.resolvedRowIndex,n,!1)}}onEnterPressed(t){let e,n
12420
+ this.setCellActionMenuFocusState(e.resolvedRowIndex,n,!1)}}focusSomethingOtherThanTheTable(){this.setDefaultFocus(),this.focusType===XL&&this.table.blur()}onEnterPressed(t){let e,n
12423
12421
  if(this.hasRowOrCellFocusType()&&(e=this.getCurrentRow(),n=e?.getFocusableElements()),this.focusType===tB&&e instanceof NB)return this.toggleRowExpanded(e),!0
12424
12422
  if(this.focusType===nB){if(t){const t=n?.cells[this.columnIndex]
12425
12423
  if(t?.actionMenuButton&&!t.actionMenuButton.open)return t.actionMenuButton.toggleButton.control.click(),!0}return this.focusFirstInteractiveElementInCurrentCell(n)}return!1}onF2Pressed(){if(this.focusType===nB){const t=this.getCurrentRow(),e=t?.getFocusableElements()
@@ -12439,7 +12437,7 @@ return this.trySetRowSelectionCheckboxFocus(e)||this.trySetCellFocus(e,0)}return
12439
12437
  return this.trySetCellFocus(e,this.table.visibleColumns.length-1)}return this.onMoveDown(0,this.table.tableData.length-1)}handleHomeEndWithinRow(t){return(this.focusType===nB||this.focusType===eB)&&!t}onTabPressed(t){const e=this.getActiveElement()
12440
12438
  if(null===e||e===this.table)return!1
12441
12439
  const n=this.hasRowOrCellFocusType()?this.getNextRowTabStop(t):this.getNextHeaderTabStop(t)
12442
- 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()
12440
+ 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(!this.focusedViaPointer):this.focusHeaderElement(),!0):(this.blurAfterLastTab(e),!1)}getNextRowTabStop(t){const e=this.getCurrentRow()
12443
12441
  if(void 0===e)return
12444
12442
  let n=-1
12445
12443
  const i=[],o=e.getFocusableElements()
@@ -12464,15 +12462,19 @@ switch(this.focusType){case QL:return this.setRowFocusState(0),this.scrollToAndF
12464
12462
  case JL:return this.setCellFocusState(this.columnIndex,0,!1),this.scrollToAndFocusRow(0)
12465
12463
  case tB:case eB:case nB:{const i={}
12466
12464
  let o=this.rowIndex
12467
- return void 0!==e&&(o=e),o+=t,n&&o>=this.table.tableData.length&&(o=this.table.tableData.length-1),t>1&&(i.align="end"),o>this.rowIndex&&o<this.table.tableData.length&&this.scrollToAndFocusRow(o,i)}}return!1}updateFocusStateFromActiveElement(t){const e=this.getActiveElement()
12468
- if(e){const n=this.getContainingRow(e)
12469
- if(n){if(!(n instanceof NB)){const t=this.getContainingCell(e)
12470
- if(t){const i=this.table.visibleColumns.indexOf(t.column)
12471
- if(t.actionMenuButton===e)return void this.setCellActionMenuFocusState(n.resolvedRowIndex,i,!1)
12472
- const o=t.cellView.tabbableChildren.indexOf(e)
12473
- if(o>-1)return void this.setCellContentFocusState(o,n.resolvedRowIndex,i,!1)}}t&&this.hasRowOrCellFocusType()&&this.rowIndex!==n.resolvedRowIndex&&this.setRowFocusState(n.resolvedRowIndex)}}}focusElement(t,e){const n=this.getActiveElement()
12474
- 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!==XL)}setDefaultFocus(){const t=this.getTableHeaderFocusableElements()
12475
- this.trySetHeaderActionFocus(t,0)||this.trySetColumnHeaderFocus(t,0)||this.scrollToAndFocusRow(0)||(this.focusType=XL)}scrollToAndFocusRow(t,e){if(t>=0&&t<this.table.tableData.length){switch(this.focusType){case XL:case QL:case JL:this.setRowFocusState(t)}return this.rowIndex=t,this.virtualizer.scrollToIndex(t,e),this.focusCurrentRow(!0),!0}return!1}focusCurrentRow(t){const e=this.getCurrentRowVisibleIndex()
12465
+ return void 0!==e&&(o=e),o+=t,n&&o>=this.table.tableData.length&&(o=this.table.tableData.length-1),t>1&&(i.align="end"),o>this.rowIndex&&o<this.table.tableData.length&&this.scrollToAndFocusRow(o,i)}}return!1}updateFocusStateFromActiveElement(){const{activeElement:t,row:e,cell:n}=this.getActiveElementCellAndRow()
12466
+ if(!n)return e
12467
+ const i=this.table.visibleColumns.indexOf(n.column)
12468
+ if(n.actionMenuButton===t)this.setCellActionMenuFocusState(e.resolvedRowIndex,i,!1)
12469
+ else{const o=n.cellView.tabbableChildren.indexOf(t)
12470
+ o>-1&&this.setCellContentFocusState(o,e.resolvedRowIndex,i,!1)}return e}getActiveElementCellAndRow(){const t=this.getActiveElement()
12471
+ if(!t)return{}
12472
+ const e=this.getContainingRow(t)
12473
+ if(!e)return{activeElement:t}
12474
+ if(e instanceof NB)return{activeElement:t,row:e}
12475
+ return{activeElement:t,row:e,cell:this.getContainingCell(t)}}focusElement(t,e){const n=this.getActiveElement()
12476
+ 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")}setDefaultFocus(){const t=this.getTableHeaderFocusableElements()
12477
+ this.trySetHeaderActionFocus(t,0)||this.trySetColumnHeaderFocus(t,0)||this.scrollToAndFocusRow(0)||(this.focusType=XL)}scrollToAndFocusRow(t,e){return!!this.rowIndexIsValid(t)&&(this.hasRowOrCellFocusType()||this.setRowFocusState(),this.rowIndex=t,this.virtualizer.scrollToIndex(t,e),this.focusCurrentRow(!this.focusedViaPointer),!0)}rowIndexIsValid(t){return t>=0&&t<this.table.tableData.length}focusCurrentRow(t){const e=this.getCurrentRowVisibleIndex()
12476
12478
  if(e<0)return!1
12477
12479
  const n=this.table.rowElements[e]
12478
12480
  let i=!1
@@ -12491,7 +12493,7 @@ break}case oB:i=n.cells[this.columnIndex]?.cell.cellView.tabbableChildren[this.c
12491
12493
  let e
12492
12494
  switch(this.focusType){case QL:e=t.headerActions[this.headerActionIndex]
12493
12495
  break
12494
- case JL: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=[]
12496
+ case JL:e=t.columnHeaders[this.columnIndex]}return!!e&&(this.focusElement(e,{preventScroll:this.focusedViaPointer}),!0)}getCurrentRowVisibleIndex(){return this.table.rowElements.findIndex((t=>t.resolvedRowIndex===this.rowIndex))}getTableHeaderFocusableElements(){const t=[]
12495
12497
  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)
12496
12498
  const e=[]
12497
12499
  return this.canFocusColumnHeaders()&&this.table.columnHeadersContainer.querySelectorAll(CB).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 TB&&t.isParentRow||t instanceof NB)return t.expanded}toggleRowExpanded(t){t instanceof NB?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 MB))}getContainingElement(t,e){let n=t
@@ -12501,12 +12503,12 @@ for(;e&&e!==this.table;)e=e.parentElement??e.parentNode?.host
12501
12503
  return e===this.table}getActiveElement(){let t=document.activeElement
12502
12504
  for(;t?.shadowRoot?.activeElement&&(t=t.shadowRoot.activeElement,!(t instanceof Ve)||this.isResolvedRowType(t)||t instanceof MB||t instanceof cB););return t}focusFirstInteractiveElementInCurrentCell(t){return!!t&&(this.trySetCellContentFocus(t,0)||this.trySetCellActionMenuFocus(t))}hasRowOrCellFocusType(){switch(this.focusType){case nB:case iB:case oB:case tB:case eB:return!0
12503
12505
  default:return!1}}hasHeaderFocusType(){switch(this.focusType){case QL:case JL:return!0
12504
- default:return!1}}trySetRowSelectionCheckboxFocus(t){return!!t?.selectionCheckbox&&(this.focusType=eB,this.focusCurrentRow(!0),!0)}trySetColumnHeaderFocus(t,e){return e>=0&&e<t.columnHeaders.length&&(this.focusType=JL,this.columnIndex=e,this.focusHeaderElement(),!0)}trySetHeaderActionFocus(t,e){return e>=0&&e<t.headerActions.length&&(this.focusType=QL,this.headerActionIndex=e,this.focusHeaderElement(),!0)}trySetCellFocus(t,e,n){if(!t)return!1
12506
+ default:return!1}}trySetRowSelectionCheckboxFocus(t){return!!t?.selectionCheckbox&&(this.focusType=eB,this.focusCurrentRow(!this.focusedViaPointer),!0)}trySetColumnHeaderFocus(t,e){return e>=0&&e<t.columnHeaders.length&&(this.focusType=JL,this.columnIndex=e,this.focusHeaderElement(),!0)}trySetHeaderActionFocus(t,e){return e>=0&&e<t.headerActions.length&&(this.focusType=QL,this.headerActionIndex=e,this.focusHeaderElement(),!0)}trySetCellFocus(t,e,n){if(!t)return!1
12505
12507
  const i=e??this.columnIndex,o=n??this.rowIndex
12506
12508
  return i>=0&&i<t.cells.length&&(this.focusType=nB,this.setRowCellFocusState(i,o,!0),!0)}trySetCellContentFocus(t,e,n,i){if(!t)return!1
12507
12509
  const o=n??this.columnIndex,r=i??this.rowIndex
12508
12510
  return o>=0&&o<t.cells.length&&e>=0&&e<t.cells[o].cell.cellView.tabbableChildren.length&&(this.setCellContentFocusState(e,r,o,!0),!0)}trySetCellActionMenuFocus(t,e,n){const i=e??this.columnIndex,o=n??this.rowIndex
12509
- return!!(i>=0&&i<t.cells.length&&t.cells[i].actionMenuButton)&&(this.setCellActionMenuFocusState(o,i,!0),!0)}setCellActionMenuFocusState(t,e,n){this.focusType=iB,this.setRowCellFocusState(e,t,n)}setCellContentFocusState(t,e,n,i){this.focusType=oB,this.cellContentIndex=t,this.setRowCellFocusState(n,e,i)}setRowFocusState(t){this.focusType=tB,void 0!==t&&(this.rowIndex=t)}setCellFocusState(t,e,n){this.focusType=nB,this.setRowCellFocusState(t,e,n)}setRowCellFocusState(t,e,n){this.rowIndex=e,this.columnIndex=t,n&&this.focusCurrentRow(!0)}isResolvedRowType(t){return t instanceof TB||t instanceof NB}}let wP=class extends Ve{get validity(){return this.tableValidator.getValidity()}get showRowOperationColumn(){return this.selectionMode===jL.multiple||this.showCollapseAll}get collapseButtonVisibility(){return this.canHaveCollapsibleRows?this.showCollapseAll?"visible":"":"hidden-size-reduced"}get rowHeight(){return this._rowHeight}constructor(){super(),this.selectionMode=jL.none,this.actionMenusPreserveSelection=!1,this.tableData=[],this.columns=[],this.childItems=[],this.rowElements=[],this.canRenderRows=!0,this.scrollX=0,this.selectionState=WL,this.showCollapseAll=!1,this.canHaveCollapsibleRows=!1,this.visibleColumns=[],this.tableScrollableMinWidth=0,this.windowShiftKeyDown=!1,this.tableValidator=new gB,this.tableUpdateTracker=new aP(this),this.columnNotifiers=[],this._rowHeight=0,this.isInitialized=!1,this.ignoreSelectionChangeEvents=!1,this.requestedSlots=new Map,this.borderWidthSubscriber={handleChange:()=>{this.updateRowHeight()}},this.controlHeightSubscriber={handleChange:()=>{this.updateRowHeight()}},this.actionMenuSlots=[],this.onViewPortScroll=t=>{this.scrollX=t.target.scrollLeft},this.onKeyDown=t=>{this.windowShiftKeyDown=t.shiftKey},this.onKeyUp=t=>{this.windowShiftKeyDown=t.shiftKey},this.onBlur=()=>{this.windowShiftKeyDown=!1},this.getRowCanExpand=t=>this.expansionManager.isRowExpandable(t),this.getIsRowExpanded=t=>this.expansionManager.isRowExpanded(t),this.handleRowSelectionChange=t=>{const e=t instanceof Function?t(this.table.getState().rowSelection):t
12511
+ return!!(i>=0&&i<t.cells.length&&t.cells[i].actionMenuButton)&&(this.setCellActionMenuFocusState(o,i,!0),!0)}setCellActionMenuFocusState(t,e,n){this.focusType=iB,this.setRowCellFocusState(e,t,n)}setCellContentFocusState(t,e,n,i){this.focusType=oB,this.cellContentIndex=t,this.setRowCellFocusState(n,e,i)}setRowFocusState(t){this.focusType=tB,void 0!==t&&(this.rowIndex=t)}setCellFocusState(t,e,n){this.focusType=nB,this.setRowCellFocusState(t,e,n)}setRowCellFocusState(t,e,n){this.rowIndex=e,this.columnIndex=t,n&&this.focusCurrentRow(!this.focusedViaPointer)}isResolvedRowType(t){return t instanceof TB||t instanceof NB}}let wP=class extends Ve{get validity(){return this.tableValidator.getValidity()}get showRowOperationColumn(){return this.selectionMode===jL.multiple||this.showCollapseAll}get collapseButtonVisibility(){return this.canHaveCollapsibleRows?this.showCollapseAll?"visible":"":"hidden-size-reduced"}get rowHeight(){return this._rowHeight}constructor(){super(),this.selectionMode=jL.none,this.actionMenusPreserveSelection=!1,this.tableData=[],this.columns=[],this.childItems=[],this.rowElements=[],this.canRenderRows=!0,this.scrollX=0,this.selectionState=WL,this.showCollapseAll=!1,this.canHaveCollapsibleRows=!1,this.visibleColumns=[],this.tableScrollableMinWidth=0,this.windowShiftKeyDown=!1,this.tableValidator=new gB,this.tableUpdateTracker=new aP(this),this.columnNotifiers=[],this._rowHeight=0,this.isInitialized=!1,this.ignoreSelectionChangeEvents=!1,this.requestedSlots=new Map,this.borderWidthSubscriber={handleChange:()=>{this.updateRowHeight()}},this.controlHeightSubscriber={handleChange:()=>{this.updateRowHeight()}},this.actionMenuSlots=[],this.onViewPortScroll=t=>{this.scrollX=t.target.scrollLeft},this.onKeyDown=t=>{this.windowShiftKeyDown=t.shiftKey},this.onKeyUp=t=>{this.windowShiftKeyDown=t.shiftKey},this.onBlur=()=>{this.windowShiftKeyDown=!1},this.getRowCanExpand=t=>this.expansionManager.isRowExpandable(t),this.getIsRowExpanded=t=>this.expansionManager.isRowExpanded(t),this.handleRowSelectionChange=t=>{const e=t instanceof Function?t(this.table.getState().rowSelection):t
12510
12512
  this.updateTableOptions({state:{rowSelection:e}})},this.handleExpandedChange=t=>{const e=t instanceof Function?t(this.table.getState().expanded):t
12511
12513
  this.updateTableOptions({state:{expanded:e}})},this.options={data:[],onStateChange:t=>{},onRowSelectionChange:this.handleRowSelectionChange,onExpandedChange:this.handleExpandedChange,getCoreRowModel:t=>jN((()=>[t.options.data]),(e=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(e,o,r){void 0===o&&(o=0)
12512
12514
  const s=[]
@@ -15798,6 +15800,7 @@ const m0=f0.compose({baseName:"chat-conversation",template:u0,styles:h0})
15798
15800
  Mi.getOrCreate().withPrefix("spright").register(m0())
15799
15801
  const g0=Mt`
15800
15802
  ${d0("flex")}
15803
+ ${qg}
15801
15804
 
15802
15805
  :host {
15803
15806
  width: 100%;
@@ -15839,6 +15842,22 @@ const g0=Mt`
15839
15842
  border-bottom-color: ${oc};
15840
15843
  }
15841
15844
 
15845
+ :host([error-visible]) .container::after {
15846
+ border-bottom-color: ${tc};
15847
+ }
15848
+
15849
+ :host([error-visible]) .container {
15850
+ border-bottom-color: ${tc};
15851
+ }
15852
+
15853
+ :host([error-visible]:hover) .container::after {
15854
+ border-bottom-color: ${tc};
15855
+ }
15856
+
15857
+ :host([error-visible]:focus-within) .container {
15858
+ border-bottom-color: ${tc};
15859
+ }
15860
+
15842
15861
  @media (prefers-reduced-motion) {
15843
15862
  .container::after {
15844
15863
  transition-duration: 0s;
@@ -15865,6 +15884,17 @@ const g0=Mt`
15865
15884
  color: ${dd};
15866
15885
  }
15867
15886
 
15887
+ :host([error-visible]) .error-icon {
15888
+ display: none;
15889
+ }
15890
+
15891
+ :host([error-visible]) .error-icon.scrollbar-width-calculated {
15892
+ display: inline-flex;
15893
+ position: absolute;
15894
+ top: ${yc};
15895
+ right: var(--ni-private-scrollbar-width);
15896
+ }
15897
+
15868
15898
  .action-button {
15869
15899
  align-self: flex-end;
15870
15900
  width: 80px;
@@ -15894,10 +15924,16 @@ const g0=Mt`
15894
15924
  ${t=>t.processing?t.stopButtonLabel:t.sendButtonLabel}
15895
15925
  ${Ut((t=>t.processing),Q`<${Vv} slot="start"></${Vv}>`,Q`<${zv} slot="start"></${zv}>`)}
15896
15926
  </${uh}>
15927
+ <${_g}
15928
+ severity="error"
15929
+ class="error-icon ${t=>t.scrollbarWidth>=0?"scrollbar-width-calculated":""}"
15930
+ style="--ni-private-scrollbar-width: ${t=>t.scrollbarWidth}px;"
15931
+ ></${_g}>
15932
+ ${Zg}
15897
15933
  </div>`
15898
- class b0 extends Ve{constructor(){super(...arguments),this.value="",this.maxLength=-1,this.processing=!1,this.disableSendButton=!0}textAreaKeydownHandler(t){return!(t.key===sn&&!t.shiftKey)||(this.processing||this.sendButtonClickHandler(),!1)}textAreaInputHandler(){this.value=this.textArea.value,this.disableSendButton=this.shouldDisableSendButton()}valueChanged(){this.textArea&&(this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton())}connectedCallback(){super.connectedCallback(),this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton()}sendButtonClickHandler(){if(this.shouldDisableSendButton())return
15934
+ class b0 extends(Kg(Ve)){constructor(){super(...arguments),this.value="",this.maxLength=-1,this.processing=!1,this.disableSendButton=!0,this.scrollbarWidth=-1,this.updateScrollbarWidthQueued=!1}textAreaKeydownHandler(t){return!(t.key===sn&&!t.shiftKey)||(this.processing||this.sendButtonClickHandler(),!1)}textAreaInputHandler(){this.value=this.textArea.value,this.disableSendButton=this.shouldDisableSendButton(),this.queueUpdateScrollbarWidth()}placeholderChanged(){this.queueUpdateScrollbarWidth()}valueChanged(){this.textArea&&(this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton(),this.queueUpdateScrollbarWidth())}connectedCallback(){super.connectedCallback(),this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton(),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}sendButtonClickHandler(){if(this.shouldDisableSendButton())return
15899
15935
  const t={text:this.textArea.value}
15900
- this.resetInput(),this.$emit("send",t)}stopButtonClickHandler(){this.processing&&(this.$emit("stop"),this.textArea?.blur())}shouldDisableSendButton(){return 0===this.textArea.value.length}resetInput(){this.value="",this.disableSendButton=!0,this.textArea&&(this.textArea.value="",this.textArea.focus())}}t([ft],b0.prototype,"placeholder",void 0),t([ft({attribute:"send-button-label"})],b0.prototype,"sendButtonLabel",void 0),t([ft({attribute:"stop-button-label"})],b0.prototype,"stopButtonLabel",void 0),t([ft],b0.prototype,"value",void 0),t([ft({attribute:"tabindex",converter:ut})],b0.prototype,"tabIndex",void 0),t([ft({attribute:"maxlength",converter:ut})],b0.prototype,"maxLength",void 0),t([ft({attribute:"processing",mode:"boolean"})],b0.prototype,"processing",void 0),t([C],b0.prototype,"textArea",void 0),t([C],b0.prototype,"disableSendButton",void 0)
15936
+ this.resetInput(),this.$emit("send",t)}stopButtonClickHandler(){this.processing&&(this.$emit("stop"),this.textArea?.blur())}shouldDisableSendButton(){return 0===this.textArea.value.length}resetInput(){this.value="",this.disableSendButton=!0,this.textArea&&(this.textArea.value="",this.textArea.focus())}onResize(){this.scrollbarWidth=this.textArea.offsetWidth-this.textArea.clientWidth}queueUpdateScrollbarWidth(){this.$fastController.isConnected&&(this.updateScrollbarWidthQueued||(this.updateScrollbarWidthQueued=!0,b.queueUpdate((()=>this.updateScrollbarWidth()))))}updateScrollbarWidth(){this.updateScrollbarWidthQueued=!1,this.scrollbarWidth=this.textArea.offsetWidth-this.textArea.clientWidth}}t([ft],b0.prototype,"placeholder",void 0),t([ft({attribute:"send-button-label"})],b0.prototype,"sendButtonLabel",void 0),t([ft({attribute:"stop-button-label"})],b0.prototype,"stopButtonLabel",void 0),t([ft],b0.prototype,"value",void 0),t([ft({attribute:"tabindex",converter:ut})],b0.prototype,"tabIndex",void 0),t([ft({attribute:"maxlength",converter:ut})],b0.prototype,"maxLength",void 0),t([ft({attribute:"processing",mode:"boolean"})],b0.prototype,"processing",void 0),t([C],b0.prototype,"textArea",void 0),t([C],b0.prototype,"disableSendButton",void 0),t([C],b0.prototype,"scrollbarWidth",void 0)
15901
15937
  const y0=b0.compose({baseName:"chat-input",template:v0,styles:g0,shadowOptions:{delegatesFocus:!0}})
15902
15938
  Mi.getOrCreate().withPrefix("spright").register(y0())
15903
15939
  const w0={system:void 0,outbound:"outbound",inbound:"inbound"},x0=Mt`