@ni/ok-components 0.2.18 → 0.2.20
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.
|
@@ -97755,6 +97755,14 @@ focus outline in that case.
|
|
|
97755
97755
|
display: none;
|
|
97756
97756
|
}
|
|
97757
97757
|
|
|
97758
|
+
.start {
|
|
97759
|
+
display: block;
|
|
97760
|
+
}
|
|
97761
|
+
|
|
97762
|
+
.start.start-empty {
|
|
97763
|
+
display: none;
|
|
97764
|
+
}
|
|
97765
|
+
|
|
97758
97766
|
.messages {
|
|
97759
97767
|
flex: 1;
|
|
97760
97768
|
display: flex;
|
|
@@ -97785,6 +97793,9 @@ focus outline in that case.
|
|
|
97785
97793
|
<div class="toolbar ${x => (x.toolbarEmpty ? 'toolbar-empty' : '')}">
|
|
97786
97794
|
<slot name="toolbar" ${slotted({ property: 'slottedToolbarElements' })}></slot>
|
|
97787
97795
|
</div>
|
|
97796
|
+
<div class="start ${x => (x.startEmpty ? 'start-empty' : '')}">
|
|
97797
|
+
<slot name="start" ${slotted({ property: 'slottedStartElements' })}></slot>
|
|
97798
|
+
</div>
|
|
97788
97799
|
<div class="messages"><slot></slot></div>
|
|
97789
97800
|
<div class="input ${x => (x.inputEmpty ? 'input-empty' : '')}">
|
|
97790
97801
|
<slot name="input" ${slotted({ property: 'slottedInputElements' })}>
|
|
@@ -97810,6 +97821,8 @@ focus outline in that case.
|
|
|
97810
97821
|
this.inputEmpty = true;
|
|
97811
97822
|
/** @internal */
|
|
97812
97823
|
this.toolbarEmpty = true;
|
|
97824
|
+
/** @internal */
|
|
97825
|
+
this.startEmpty = true;
|
|
97813
97826
|
}
|
|
97814
97827
|
slottedInputElementsChanged(_prev, next) {
|
|
97815
97828
|
this.inputEmpty = next === undefined || next.length === 0;
|
|
@@ -97817,6 +97830,9 @@ focus outline in that case.
|
|
|
97817
97830
|
slottedToolbarElementsChanged(_prev, next) {
|
|
97818
97831
|
this.toolbarEmpty = next === undefined || next.length === 0;
|
|
97819
97832
|
}
|
|
97833
|
+
slottedStartElementsChanged(_prev, next) {
|
|
97834
|
+
this.startEmpty = next === undefined || next.length === 0;
|
|
97835
|
+
}
|
|
97820
97836
|
}
|
|
97821
97837
|
__decorate([
|
|
97822
97838
|
attr
|
|
@@ -97833,6 +97849,12 @@ focus outline in that case.
|
|
|
97833
97849
|
__decorate([
|
|
97834
97850
|
observable
|
|
97835
97851
|
], ChatConversation.prototype, "slottedToolbarElements", void 0);
|
|
97852
|
+
__decorate([
|
|
97853
|
+
observable
|
|
97854
|
+
], ChatConversation.prototype, "startEmpty", void 0);
|
|
97855
|
+
__decorate([
|
|
97856
|
+
observable
|
|
97857
|
+
], ChatConversation.prototype, "slottedStartElements", void 0);
|
|
97836
97858
|
const sprightChatConversation = ChatConversation.compose({
|
|
97837
97859
|
baseName: 'chat-conversation',
|
|
97838
97860
|
template: template$8,
|
|
@@ -97961,7 +97983,7 @@ focus outline in that case.
|
|
|
97961
97983
|
class="action-button"
|
|
97962
97984
|
appearance="block"
|
|
97963
97985
|
appearance-variant="${x => (x.processing ? 'primary' : 'accent')}"
|
|
97964
|
-
?disabled=${x => (x.processing ? false : x.
|
|
97986
|
+
?disabled=${x => (x.processing ? false : (x.sendDisabled || x.isInputEmpty))}
|
|
97965
97987
|
@click=${x => (x.processing ? x.stopButtonClickHandler() : x.sendButtonClickHandler())}
|
|
97966
97988
|
tabindex="${x => x.tabIndex}"
|
|
97967
97989
|
title=${x => (x.processing ? x.stopButtonLabel : x.sendButtonLabel)}
|
|
@@ -97987,10 +98009,12 @@ focus outline in that case.
|
|
|
97987
98009
|
this.value = '';
|
|
97988
98010
|
this.maxLength = -1;
|
|
97989
98011
|
this.processing = false;
|
|
98012
|
+
this.sendDisabled = false;
|
|
97990
98013
|
/**
|
|
98014
|
+
* Tracks whether the send button should be disabled based on input value
|
|
97991
98015
|
* @internal
|
|
97992
98016
|
*/
|
|
97993
|
-
this.
|
|
98017
|
+
this.isInputEmpty = true;
|
|
97994
98018
|
/**
|
|
97995
98019
|
* The width of the vertical scrollbar, if displayed.
|
|
97996
98020
|
* @internal
|
|
@@ -98016,7 +98040,7 @@ focus outline in that case.
|
|
|
98016
98040
|
*/
|
|
98017
98041
|
textAreaInputHandler() {
|
|
98018
98042
|
this.value = this.textArea.value;
|
|
98019
|
-
this.
|
|
98043
|
+
this.isInputEmpty = this.shouldDisableSendButton();
|
|
98020
98044
|
this.queueUpdateScrollbarWidth();
|
|
98021
98045
|
}
|
|
98022
98046
|
// If a property can affect whether a scrollbar is visible, we need to
|
|
@@ -98037,7 +98061,7 @@ focus outline in that case.
|
|
|
98037
98061
|
valueChanged() {
|
|
98038
98062
|
if (this.textArea) {
|
|
98039
98063
|
this.textArea.value = this.value;
|
|
98040
|
-
this.
|
|
98064
|
+
this.isInputEmpty = this.shouldDisableSendButton();
|
|
98041
98065
|
this.queueUpdateScrollbarWidth();
|
|
98042
98066
|
}
|
|
98043
98067
|
}
|
|
@@ -98047,7 +98071,7 @@ focus outline in that case.
|
|
|
98047
98071
|
connectedCallback() {
|
|
98048
98072
|
super.connectedCallback();
|
|
98049
98073
|
this.textArea.value = this.value;
|
|
98050
|
-
this.
|
|
98074
|
+
this.isInputEmpty = this.shouldDisableSendButton();
|
|
98051
98075
|
this.resizeObserver = new ResizeObserver(() => this.onResize());
|
|
98052
98076
|
this.resizeObserver.observe(this);
|
|
98053
98077
|
}
|
|
@@ -98086,7 +98110,7 @@ focus outline in that case.
|
|
|
98086
98110
|
}
|
|
98087
98111
|
resetInput() {
|
|
98088
98112
|
this.value = '';
|
|
98089
|
-
this.
|
|
98113
|
+
this.isInputEmpty = true;
|
|
98090
98114
|
if (this.textArea) {
|
|
98091
98115
|
this.textArea.value = '';
|
|
98092
98116
|
this.textArea.focus();
|
|
@@ -98130,12 +98154,15 @@ focus outline in that case.
|
|
|
98130
98154
|
__decorate([
|
|
98131
98155
|
attr({ attribute: 'processing', mode: 'boolean' })
|
|
98132
98156
|
], ChatInput.prototype, "processing", void 0);
|
|
98157
|
+
__decorate([
|
|
98158
|
+
attr({ attribute: 'send-disabled', mode: 'boolean' })
|
|
98159
|
+
], ChatInput.prototype, "sendDisabled", void 0);
|
|
98133
98160
|
__decorate([
|
|
98134
98161
|
observable
|
|
98135
98162
|
], ChatInput.prototype, "textArea", void 0);
|
|
98136
98163
|
__decorate([
|
|
98137
98164
|
observable
|
|
98138
|
-
], ChatInput.prototype, "
|
|
98165
|
+
], ChatInput.prototype, "isInputEmpty", void 0);
|
|
98139
98166
|
__decorate([
|
|
98140
98167
|
observable
|
|
98141
98168
|
], ChatInput.prototype, "scrollbarWidth", void 0);
|