@ni/ok-components 0.2.12 → 0.2.13

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.
@@ -15799,6 +15799,7 @@ const m0=f0.compose({baseName:"chat-conversation",template:u0,styles:h0})
15799
15799
  Mi.getOrCreate().withPrefix("spright").register(m0())
15800
15800
  const g0=Mt`
15801
15801
  ${d0("flex")}
15802
+ ${qg}
15802
15803
 
15803
15804
  :host {
15804
15805
  width: 100%;
@@ -15840,6 +15841,22 @@ const g0=Mt`
15840
15841
  border-bottom-color: ${oc};
15841
15842
  }
15842
15843
 
15844
+ :host([error-visible]) .container::after {
15845
+ border-bottom-color: ${tc};
15846
+ }
15847
+
15848
+ :host([error-visible]) .container {
15849
+ border-bottom-color: ${tc};
15850
+ }
15851
+
15852
+ :host([error-visible]:hover) .container::after {
15853
+ border-bottom-color: ${tc};
15854
+ }
15855
+
15856
+ :host([error-visible]:focus-within) .container {
15857
+ border-bottom-color: ${tc};
15858
+ }
15859
+
15843
15860
  @media (prefers-reduced-motion) {
15844
15861
  .container::after {
15845
15862
  transition-duration: 0s;
@@ -15866,6 +15883,17 @@ const g0=Mt`
15866
15883
  color: ${dd};
15867
15884
  }
15868
15885
 
15886
+ :host([error-visible]) .error-icon {
15887
+ display: none;
15888
+ }
15889
+
15890
+ :host([error-visible]) .error-icon.scrollbar-width-calculated {
15891
+ display: inline-flex;
15892
+ position: absolute;
15893
+ top: ${yc};
15894
+ right: var(--ni-private-scrollbar-width);
15895
+ }
15896
+
15869
15897
  .action-button {
15870
15898
  align-self: flex-end;
15871
15899
  width: 80px;
@@ -15895,10 +15923,16 @@ const g0=Mt`
15895
15923
  ${t=>t.processing?t.stopButtonLabel:t.sendButtonLabel}
15896
15924
  ${Ut((t=>t.processing),Q`<${Vv} slot="start"></${Vv}>`,Q`<${zv} slot="start"></${zv}>`)}
15897
15925
  </${uh}>
15926
+ <${_g}
15927
+ severity="error"
15928
+ class="error-icon ${t=>t.scrollbarWidth>=0?"scrollbar-width-calculated":""}"
15929
+ style="--ni-private-scrollbar-width: ${t=>t.scrollbarWidth}px;"
15930
+ ></${_g}>
15931
+ ${Zg}
15898
15932
  </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
15933
+ 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
15934
  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)
15935
+ 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
15936
  const y0=b0.compose({baseName:"chat-input",template:v0,styles:g0,shadowOptions:{delegatesFocus:!0}})
15903
15937
  Mi.getOrCreate().withPrefix("spright").register(y0())
15904
15938
  const w0={system:void 0,outbound:"outbound",inbound:"inbound"},x0=Mt`