@ni/ok-components 0.2.18 → 0.2.19

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.
@@ -16525,7 +16525,7 @@ const N0=Mt`
16525
16525
  class="action-button"
16526
16526
  appearance="block"
16527
16527
  appearance-variant="${t=>t.processing?"primary":"accent"}"
16528
- ?disabled=${t=>!t.processing&&t.disableSendButton}
16528
+ ?disabled=${t=>!t.processing&&(t.sendDisabled||t.isInputEmpty)}
16529
16529
  @click=${t=>t.processing?t.stopButtonClickHandler():t.sendButtonClickHandler()}
16530
16530
  tabindex="${t=>t.tabIndex}"
16531
16531
  title=${t=>t.processing?t.stopButtonLabel:t.sendButtonLabel}
@@ -16541,9 +16541,9 @@ const N0=Mt`
16541
16541
  ></${Hm}>
16542
16542
  ${av}
16543
16543
  </div>`
16544
- 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
16544
+ 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
16545
16545
  const t={text:this.textArea.value}
16546
- 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)
16546
+ 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)
16547
16547
  const z0=P0.compose({baseName:"chat-input",template:B0,styles:N0,shadowOptions:{delegatesFocus:!0}})
16548
16548
  Ii.getOrCreate().withPrefix("spright").register(z0())
16549
16549
  const V0={system:void 0,outbound:"outbound",inbound:"inbound"},H0=Mt`