@ni/ok-components 1.4.1 → 1.4.2

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.
@@ -17093,7 +17093,7 @@ const A1=_t`
17093
17093
  </div>`
17094
17094
  class O1 extends(Av(He)){constructor(){super(...arguments),this.value="",this.maxLength=-1,this.processing=!1,this.sendDisabled=!1,this.isInputEmpty=!0,this.scrollbarWidth=-1,this.footerActionsIsEmpty=!0,this.attachmentsIsEmpty=!0,this.updateScrollbarWidthQueued=!1}slottedFooterActionsElementsChanged(t,e){this.footerActionsIsEmpty=void 0===e||0===e.length}slottedAttachmentsElementsChanged(t,e){this.attachmentsIsEmpty=void 0===e||0===e.length}textAreaKeydownHandler(t){return!(t.key===sn&&!t.shiftKey)||(this.processing||this.sendButtonClickHandler(),!1)}textAreaInputHandler(){this.value=this.textArea.value,this.isInputEmpty=this.shouldDisableSendButton(),this.adjustTextAreaHeight(),this.queueUpdateScrollbarWidth()}placeholderChanged(){this.queueUpdateScrollbarWidth()}valueChanged(){this.textArea&&(this.textArea.value=this.value,this.isInputEmpty=this.shouldDisableSendButton(),this.adjustTextAreaHeight(),this.queueUpdateScrollbarWidth())}connectedCallback(){super.connectedCallback(),this.textArea.value=this.value,this.isInputEmpty=this.shouldDisableSendButton(),this.adjustTextAreaHeight(),this.resizeObserver=new ResizeObserver(()=>this.onResize()),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}sendButtonClickHandler(){if(this.shouldDisableSendButton())return
17095
17095
  const t={text:this.textArea.value}
17096
- 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.adjustTextAreaHeight(),this.textArea.focus())}onResize(){this.adjustTextAreaHeight(),this.scrollbarWidth=this.textArea.offsetWidth-this.textArea.clientWidth}queueUpdateScrollbarWidth(){this.$fastController.isConnected&&(this.updateScrollbarWidthQueued||(this.updateScrollbarWidthQueued=!0,b.queueUpdate(()=>this.updateScrollbarWidth())))}adjustTextAreaHeight(){if(O1.fieldSizingSupported||!this.textArea)return
17096
+ this.resetInput(),this.$emit("send",t)}stopButtonClickHandler(){this.processing&&(this.$emit("stop"),this.textArea?.blur())}shouldDisableSendButton(){return this.sendDisabled||0===this.textArea.value.length}resetInput(){this.value="",this.isInputEmpty=!0,this.textArea&&(this.textArea.value="",this.adjustTextAreaHeight(),this.textArea.focus())}onResize(){this.adjustTextAreaHeight(),this.scrollbarWidth=this.textArea.offsetWidth-this.textArea.clientWidth}queueUpdateScrollbarWidth(){this.$fastController.isConnected&&(this.updateScrollbarWidthQueued||(this.updateScrollbarWidthQueued=!0,b.queueUpdate(()=>this.updateScrollbarWidth())))}adjustTextAreaHeight(){if(O1.fieldSizingSupported||!this.textArea)return
17097
17097
  const t=this.textArea
17098
17098
  t.style.height="auto",t.style.height=`${t.scrollHeight}px`}updateScrollbarWidth(){this.updateScrollbarWidthQueued=!1,this.scrollbarWidth=this.textArea.offsetWidth-this.textArea.clientWidth}}O1.fieldSizingSupported=CSS.supports("field-sizing","content"),t([pt],O1.prototype,"placeholder",void 0),t([pt({attribute:"send-button-label"})],O1.prototype,"sendButtonLabel",void 0),t([pt({attribute:"stop-button-label"})],O1.prototype,"stopButtonLabel",void 0),t([pt],O1.prototype,"value",void 0),t([pt({attribute:"tabindex",converter:ht})],O1.prototype,"tabIndex",void 0),t([pt({attribute:"maxlength",converter:ht})],O1.prototype,"maxLength",void 0),t([pt({attribute:"processing",mode:"boolean"})],O1.prototype,"processing",void 0),t([pt({attribute:"send-disabled",mode:"boolean"})],O1.prototype,"sendDisabled",void 0),t([C],O1.prototype,"textArea",void 0),t([C],O1.prototype,"isInputEmpty",void 0),t([C],O1.prototype,"scrollbarWidth",void 0),t([C],O1.prototype,"footerActionsIsEmpty",void 0),t([C],O1.prototype,"slottedFooterActionsElements",void 0),t([C],O1.prototype,"attachmentsIsEmpty",void 0),t([C],O1.prototype,"slottedAttachmentsElements",void 0)
17099
17099
  const D1=O1.compose({baseName:"chat-input",template:T1,styles:A1,shadowOptions:{delegatesFocus:!0}})