@ni/spright-components 6.10.5 → 6.12.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.
@@ -16370,6 +16370,14 @@ const T0=t=>`${zo(t)}:host{box-sizing:border-box;}*{box-sizing:border-box;}:host
16370
16370
  display: none;
16371
16371
  }
16372
16372
 
16373
+ .start {
16374
+ display: block;
16375
+ }
16376
+
16377
+ .start.start-empty {
16378
+ display: none;
16379
+ }
16380
+
16373
16381
  .messages {
16374
16382
  flex: 1;
16375
16383
  display: flex;
@@ -16398,13 +16406,16 @@ const T0=t=>`${zo(t)}:host{box-sizing:border-box;}*{box-sizing:border-box;}:host
16398
16406
  <div class="toolbar ${t=>t.toolbarEmpty?"toolbar-empty":""}">
16399
16407
  <slot name="toolbar" ${te({property:"slottedToolbarElements"})}></slot>
16400
16408
  </div>
16409
+ <div class="start ${t=>t.startEmpty?"start-empty":""}">
16410
+ <slot name="start" ${te({property:"slottedStartElements"})}></slot>
16411
+ </div>
16401
16412
  <div class="messages"><slot></slot></div>
16402
16413
  <div class="input ${t=>t.inputEmpty?"input-empty":""}">
16403
16414
  <slot name="input" ${te({property:"slottedInputElements"})}>
16404
16415
  </slot>
16405
16416
  </div>
16406
16417
  `,R0={default:void 0}
16407
- class F0 extends Ue{constructor(){super(...arguments),this.appearance=R0.default,this.inputEmpty=!0,this.toolbarEmpty=!0}slottedInputElementsChanged(t,e){this.inputEmpty=void 0===e||0===e.length}slottedToolbarElementsChanged(t,e){this.toolbarEmpty=void 0===e||0===e.length}}t([ft],F0.prototype,"appearance",void 0),t([C],F0.prototype,"inputEmpty",void 0),t([C],F0.prototype,"slottedInputElements",void 0),t([C],F0.prototype,"toolbarEmpty",void 0),t([C],F0.prototype,"slottedToolbarElements",void 0)
16418
+ class F0 extends Ue{constructor(){super(...arguments),this.appearance=R0.default,this.inputEmpty=!0,this.toolbarEmpty=!0,this.startEmpty=!0}slottedInputElementsChanged(t,e){this.inputEmpty=void 0===e||0===e.length}slottedToolbarElementsChanged(t,e){this.toolbarEmpty=void 0===e||0===e.length}slottedStartElementsChanged(t,e){this.startEmpty=void 0===e||0===e.length}}t([ft],F0.prototype,"appearance",void 0),t([C],F0.prototype,"inputEmpty",void 0),t([C],F0.prototype,"slottedInputElements",void 0),t([C],F0.prototype,"toolbarEmpty",void 0),t([C],F0.prototype,"slottedToolbarElements",void 0),t([C],F0.prototype,"startEmpty",void 0),t([C],F0.prototype,"slottedStartElements",void 0)
16408
16419
  const L0=F0.compose({baseName:"chat-conversation",template:O0,styles:D0})
16409
16420
  Ii.getOrCreate().withPrefix("spright").register(L0())
16410
16421
  const N0=Mt`
@@ -16524,7 +16535,7 @@ const N0=Mt`
16524
16535
  class="action-button"
16525
16536
  appearance="block"
16526
16537
  appearance-variant="${t=>t.processing?"primary":"accent"}"
16527
- ?disabled=${t=>!t.processing&&t.disableSendButton}
16538
+ ?disabled=${t=>!t.processing&&(t.sendDisabled||t.isInputEmpty)}
16528
16539
  @click=${t=>t.processing?t.stopButtonClickHandler():t.sendButtonClickHandler()}
16529
16540
  tabindex="${t=>t.tabIndex}"
16530
16541
  title=${t=>t.processing?t.stopButtonLabel:t.sendButtonLabel}
@@ -16540,9 +16551,9 @@ const N0=Mt`
16540
16551
  ></${Hm}>
16541
16552
  ${av}
16542
16553
  </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
16554
+ 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
16555
  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)
16556
+ 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
16557
  const z0=P0.compose({baseName:"chat-input",template:B0,styles:N0,shadowOptions:{delegatesFocus:!0}})
16547
16558
  Ii.getOrCreate().withPrefix("spright").register(z0())
16548
16559
  const V0={system:void 0,outbound:"outbound",inbound:"inbound"},H0=Mt`