@ni/spright-components 6.10.5 → 6.11.0

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.
@@ -16524,7 +16524,7 @@ const N0=Mt`
16524
16524
  class="action-button"
16525
16525
  appearance="block"
16526
16526
  appearance-variant="${t=>t.processing?"primary":"accent"}"
16527
- ?disabled=${t=>!t.processing&&t.disableSendButton}
16527
+ ?disabled=${t=>!t.processing&&(t.sendDisabled||t.isInputEmpty)}
16528
16528
  @click=${t=>t.processing?t.stopButtonClickHandler():t.sendButtonClickHandler()}
16529
16529
  tabindex="${t=>t.tabIndex}"
16530
16530
  title=${t=>t.processing?t.stopButtonLabel:t.sendButtonLabel}
@@ -16540,9 +16540,9 @@ const N0=Mt`
16540
16540
  ></${Hm}>
16541
16541
  ${av}
16542
16542
  </div>`
16543
- class P0 extends(lv(Ue)){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===an&&!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
16543
+ class P0 extends(lv(Ue)){constructor(){super(...arguments),this.value="",this.maxLength=-1,this.processing=!1,this.sendDisabled=!1,this.isInputEmpty=!0,this.scrollbarWidth=-1,this.updateScrollbarWidthQueued=!1}textAreaKeydownHandler(t){return!(t.key===an&&!t.shiftKey)||(this.processing||this.sendButtonClickHandler(),!1)}textAreaInputHandler(){this.value=this.textArea.value,this.isInputEmpty=this.shouldDisableSendButton(),this.queueUpdateScrollbarWidth()}placeholderChanged(){this.queueUpdateScrollbarWidth()}valueChanged(){this.textArea&&(this.textArea.value=this.value,this.isInputEmpty=this.shouldDisableSendButton(),this.queueUpdateScrollbarWidth())}connectedCallback(){super.connectedCallback(),this.textArea.value=this.value,this.isInputEmpty=this.shouldDisableSendButton(),this.resizeObserver=new ResizeObserver(()=>this.onResize()),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}sendButtonClickHandler(){if(this.shouldDisableSendButton())return
16544
16544
  const t={text:this.textArea.value}
16545
- 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],P0.prototype,"placeholder",void 0),t([ft({attribute:"send-button-label"})],P0.prototype,"sendButtonLabel",void 0),t([ft({attribute:"stop-button-label"})],P0.prototype,"stopButtonLabel",void 0),t([ft],P0.prototype,"value",void 0),t([ft({attribute:"tabindex",converter:ut})],P0.prototype,"tabIndex",void 0),t([ft({attribute:"maxlength",converter:ut})],P0.prototype,"maxLength",void 0),t([ft({attribute:"processing",mode:"boolean"})],P0.prototype,"processing",void 0),t([C],P0.prototype,"textArea",void 0),t([C],P0.prototype,"disableSendButton",void 0),t([C],P0.prototype,"scrollbarWidth",void 0)
16545
+ 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.isInputEmpty=!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],P0.prototype,"placeholder",void 0),t([ft({attribute:"send-button-label"})],P0.prototype,"sendButtonLabel",void 0),t([ft({attribute:"stop-button-label"})],P0.prototype,"stopButtonLabel",void 0),t([ft],P0.prototype,"value",void 0),t([ft({attribute:"tabindex",converter:ut})],P0.prototype,"tabIndex",void 0),t([ft({attribute:"maxlength",converter:ut})],P0.prototype,"maxLength",void 0),t([ft({attribute:"processing",mode:"boolean"})],P0.prototype,"processing",void 0),t([ft({attribute:"send-disabled",mode:"boolean"})],P0.prototype,"sendDisabled",void 0),t([C],P0.prototype,"textArea",void 0),t([C],P0.prototype,"isInputEmpty",void 0),t([C],P0.prototype,"scrollbarWidth",void 0)
16546
16546
  const z0=P0.compose({baseName:"chat-input",template:B0,styles:N0,shadowOptions:{delegatesFocus:!0}})
16547
16547
  Ii.getOrCreate().withPrefix("spright").register(z0())
16548
16548
  const V0={system:void 0,outbound:"outbound",inbound:"inbound"},H0=Mt`