@ni/ok-components 0.2.12 → 0.2.14

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.
@@ -12374,14 +12374,12 @@ const t=this.hierarchyOptions.get(n)?.delayedHierarchyState,o=i.delayedHierarchy
12374
12374
  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
12375
12375
  const e=this.hierarchyOptions.get(t)?.delayedHierarchyState
12376
12376
  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)
12377
- 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)
12378
- const e=void 0!==this.table.openActionMenuRecordId
12379
- if((t.target===this.table||this.focusType===XL)&&!e){let t=!0
12380
- this.hasRowOrCellFocusType()&&this.scrollToAndFocusRow(this.rowIndex)&&(t=!1),t&&!this.setFocusOnHeader()&&this.table.blur()}},this.onTableFocusOut=()=>{this.focusWithinTable=!1},this.onCellActionMenuBlur=t=>{t.stopPropagation()
12377
+ 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()
12378
+ 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()
12381
12379
  const e=t.detail
12382
- e.actionMenuButton&&this.setActionMenuButtonFocused(e.actionMenuButton,!1)},this.onCellViewFocusIn=t=>{t.stopPropagation(),this.updateFocusStateFromActiveElement(!1)},this.onCellFocusIn=t=>{t.stopPropagation()
12383
- const e=t.detail
12384
- this.updateFocusStateFromActiveElement(!0),this.focusType===tB&&this.getActiveElement()===e&&this.focusCurrentRow(!1)},this.onCellBlur=t=>{t.stopPropagation()
12380
+ e.actionMenuButton&&this.setActionMenuButtonFocused(e.actionMenuButton,!1)},this.onCellViewFocusIn=t=>{t.stopPropagation(),this.updateFocusStateFromActiveElement()},this.onCellFocusIn=t=>{t.stopPropagation()
12381
+ const e=t.detail,n=this.updateFocusStateFromActiveElement()
12382
+ 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()
12385
12383
  const e=t.detail
12386
12384
  this.setElementFocusable(e,!1)},this.onCaptureKeyDown=t=>{let e=!1
12387
12385
  if(t.key===pn)e=this.onTabPressed(t.shiftKey)
@@ -12406,10 +12404,10 @@ break
12406
12404
  case un:e=this.onSpacePressed(t.shiftKey)
12407
12405
  break
12408
12406
  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()
12409
- t&&this.trySetCellFocus(t.getFocusableElements())}},this.onViewportKeyDown=t=>{let e=!this.inNavigationMode&&(t.key===rn||t.key===en)
12407
+ 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)
12410
12408
  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
12411
12409
  const t=this.getActiveElement()
12412
- 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
12410
+ 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
12413
12411
  if(t===this.virtualizer&&"visibleItems"===e)n=!0
12414
12412
  else if(t===this.table&&"rowElements"===e){for(const t of this.visibleRowNotifiers)t.unsubscribe(this)
12415
12413
  this.visibleRowNotifiers=[]
@@ -12420,7 +12418,7 @@ this.rowIndex=0}this.focusWithinTable&&this.focusCurrentRow(!1)}}onRowFocusIn(t)
12420
12418
  const e=t.target
12421
12419
  this.isResolvedRowType(e)&&this.rowIndex!==e.resolvedRowIndex&&this.setRowFocusState(e.resolvedRowIndex)}onRowBlur(t){const e=t.target
12422
12420
  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))
12423
- this.setCellActionMenuFocusState(e.resolvedRowIndex,n,!1)}}onEnterPressed(t){let e,n
12421
+ this.setCellActionMenuFocusState(e.resolvedRowIndex,n,!1)}}focusSomethingOtherThanTheTable(){this.setDefaultFocus(),this.focusType===XL&&this.table.blur()}onEnterPressed(t){let e,n
12424
12422
  if(this.hasRowOrCellFocusType()&&(e=this.getCurrentRow(),n=e?.getFocusableElements()),this.focusType===tB&&e instanceof NB)return this.toggleRowExpanded(e),!0
12425
12423
  if(this.focusType===nB){if(t){const t=n?.cells[this.columnIndex]
12426
12424
  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()
@@ -12440,7 +12438,7 @@ return this.trySetRowSelectionCheckboxFocus(e)||this.trySetCellFocus(e,0)}return
12440
12438
  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()
12441
12439
  if(null===e||e===this.table)return!1
12442
12440
  const n=this.hasRowOrCellFocusType()?this.getNextRowTabStop(t):this.getNextHeaderTabStop(t)
12443
- 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()
12441
+ 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()
12444
12442
  if(void 0===e)return
12445
12443
  let n=-1
12446
12444
  const i=[],o=e.getFocusableElements()
@@ -12465,15 +12463,19 @@ switch(this.focusType){case QL:return this.setRowFocusState(0),this.scrollToAndF
12465
12463
  case JL:return this.setCellFocusState(this.columnIndex,0,!1),this.scrollToAndFocusRow(0)
12466
12464
  case tB:case eB:case nB:{const i={}
12467
12465
  let o=this.rowIndex
12468
- 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()
12469
- if(e){const n=this.getContainingRow(e)
12470
- if(n){if(!(n instanceof NB)){const t=this.getContainingCell(e)
12471
- if(t){const i=this.table.visibleColumns.indexOf(t.column)
12472
- if(t.actionMenuButton===e)return void this.setCellActionMenuFocusState(n.resolvedRowIndex,i,!1)
12473
- const o=t.cellView.tabbableChildren.indexOf(e)
12474
- 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()
12475
- 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()
12476
- 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()
12466
+ 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()
12467
+ if(!n)return e
12468
+ const i=this.table.visibleColumns.indexOf(n.column)
12469
+ if(n.actionMenuButton===t)this.setCellActionMenuFocusState(e.resolvedRowIndex,i,!1)
12470
+ else{const o=n.cellView.tabbableChildren.indexOf(t)
12471
+ o>-1&&this.setCellContentFocusState(o,e.resolvedRowIndex,i,!1)}return e}getActiveElementCellAndRow(){const t=this.getActiveElement()
12472
+ if(!t)return{}
12473
+ const e=this.getContainingRow(t)
12474
+ if(!e)return{activeElement:t}
12475
+ if(e instanceof NB)return{activeElement:t,row:e}
12476
+ return{activeElement:t,row:e,cell:this.getContainingCell(t)}}focusElement(t,e){const n=this.getActiveElement()
12477
+ 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()
12478
+ 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()
12477
12479
  if(e<0)return!1
12478
12480
  const n=this.table.rowElements[e]
12479
12481
  let i=!1
@@ -12492,7 +12494,7 @@ break}case oB:i=n.cells[this.columnIndex]?.cell.cellView.tabbableChildren[this.c
12492
12494
  let e
12493
12495
  switch(this.focusType){case QL:e=t.headerActions[this.headerActionIndex]
12494
12496
  break
12495
- 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=[]
12497
+ 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=[]
12496
12498
  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)
12497
12499
  const e=[]
12498
12500
  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
@@ -12502,12 +12504,12 @@ for(;e&&e!==this.table;)e=e.parentElement??e.parentNode?.host
12502
12504
  return e===this.table}getActiveElement(){let t=document.activeElement
12503
12505
  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
12504
12506
  default:return!1}}hasHeaderFocusType(){switch(this.focusType){case QL:case JL:return!0
12505
- 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
12507
+ 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
12506
12508
  const i=e??this.columnIndex,o=n??this.rowIndex
12507
12509
  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
12508
12510
  const o=n??this.columnIndex,r=i??this.rowIndex
12509
12511
  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
12510
- 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
12512
+ 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
12511
12513
  this.updateTableOptions({state:{rowSelection:e}})},this.handleExpandedChange=t=>{const e=t instanceof Function?t(this.table.getState().expanded):t
12512
12514
  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)
12513
12515
  const s=[]
@@ -15799,6 +15801,7 @@ const m0=f0.compose({baseName:"chat-conversation",template:u0,styles:h0})
15799
15801
  Mi.getOrCreate().withPrefix("spright").register(m0())
15800
15802
  const g0=Mt`
15801
15803
  ${d0("flex")}
15804
+ ${qg}
15802
15805
 
15803
15806
  :host {
15804
15807
  width: 100%;
@@ -15840,6 +15843,22 @@ const g0=Mt`
15840
15843
  border-bottom-color: ${oc};
15841
15844
  }
15842
15845
 
15846
+ :host([error-visible]) .container::after {
15847
+ border-bottom-color: ${tc};
15848
+ }
15849
+
15850
+ :host([error-visible]) .container {
15851
+ border-bottom-color: ${tc};
15852
+ }
15853
+
15854
+ :host([error-visible]:hover) .container::after {
15855
+ border-bottom-color: ${tc};
15856
+ }
15857
+
15858
+ :host([error-visible]:focus-within) .container {
15859
+ border-bottom-color: ${tc};
15860
+ }
15861
+
15843
15862
  @media (prefers-reduced-motion) {
15844
15863
  .container::after {
15845
15864
  transition-duration: 0s;
@@ -15866,6 +15885,17 @@ const g0=Mt`
15866
15885
  color: ${dd};
15867
15886
  }
15868
15887
 
15888
+ :host([error-visible]) .error-icon {
15889
+ display: none;
15890
+ }
15891
+
15892
+ :host([error-visible]) .error-icon.scrollbar-width-calculated {
15893
+ display: inline-flex;
15894
+ position: absolute;
15895
+ top: ${yc};
15896
+ right: var(--ni-private-scrollbar-width);
15897
+ }
15898
+
15869
15899
  .action-button {
15870
15900
  align-self: flex-end;
15871
15901
  width: 80px;
@@ -15895,10 +15925,16 @@ const g0=Mt`
15895
15925
  ${t=>t.processing?t.stopButtonLabel:t.sendButtonLabel}
15896
15926
  ${Ut((t=>t.processing),Q`<${Vv} slot="start"></${Vv}>`,Q`<${zv} slot="start"></${zv}>`)}
15897
15927
  </${uh}>
15928
+ <${_g}
15929
+ severity="error"
15930
+ class="error-icon ${t=>t.scrollbarWidth>=0?"scrollbar-width-calculated":""}"
15931
+ style="--ni-private-scrollbar-width: ${t=>t.scrollbarWidth}px;"
15932
+ ></${_g}>
15933
+ ${Zg}
15898
15934
  </div>`
15899
- 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
15935
+ 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
15900
15936
  const t={text:this.textArea.value}
15901
- 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)
15937
+ 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)
15902
15938
  const y0=b0.compose({baseName:"chat-input",template:v0,styles:g0,shadowOptions:{delegatesFocus:!0}})
15903
15939
  Mi.getOrCreate().withPrefix("spright").register(y0())
15904
15940
  const w0={system:void 0,outbound:"outbound",inbound:"inbound"},x0=Mt`