@ni/spright-components 6.20.0 → 6.20.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.
@@ -225,6 +225,118 @@
225
225
  }
226
226
  ]
227
227
  },
228
+ {
229
+ "kind": "javascript-module",
230
+ "path": "src/chat/message/index.ts",
231
+ "declarations": [
232
+ {
233
+ "kind": "class",
234
+ "description": "A Spright component for displaying a chat message",
235
+ "name": "ChatMessage",
236
+ "members": [
237
+ {
238
+ "kind": "field",
239
+ "name": "messageType",
240
+ "type": {
241
+ "text": "ChatMessageType"
242
+ },
243
+ "privacy": "public"
244
+ },
245
+ {
246
+ "kind": "method",
247
+ "name": "slottedFooterActionsElementsChanged",
248
+ "privacy": "public",
249
+ "return": {
250
+ "type": {
251
+ "text": "void"
252
+ }
253
+ },
254
+ "parameters": [
255
+ {
256
+ "name": "_prev",
257
+ "type": {
258
+ "text": "HTMLElement[] | undefined"
259
+ }
260
+ },
261
+ {
262
+ "name": "next",
263
+ "type": {
264
+ "text": "HTMLElement[] | undefined"
265
+ }
266
+ }
267
+ ]
268
+ }
269
+ ],
270
+ "attributes": [
271
+ {
272
+ "name": "message-type",
273
+ "type": {
274
+ "text": "ChatMessageType"
275
+ },
276
+ "fieldName": "messageType"
277
+ }
278
+ ],
279
+ "superclass": {
280
+ "name": "FoundationElement",
281
+ "package": "@ni/fast-foundation"
282
+ },
283
+ "deprecated": "Use specific message component types instead"
284
+ },
285
+ {
286
+ "kind": "variable",
287
+ "name": "chatMessageTag",
288
+ "type": {
289
+ "text": "string"
290
+ },
291
+ "default": "'spright-chat-message'"
292
+ }
293
+ ],
294
+ "exports": [
295
+ {
296
+ "kind": "js",
297
+ "name": "ChatMessage",
298
+ "declaration": {
299
+ "name": "ChatMessage",
300
+ "module": "src/chat/message/index.ts"
301
+ }
302
+ },
303
+ {
304
+ "kind": "js",
305
+ "name": "chatMessageTag",
306
+ "declaration": {
307
+ "name": "chatMessageTag",
308
+ "module": "src/chat/message/index.ts"
309
+ }
310
+ }
311
+ ]
312
+ },
313
+ {
314
+ "kind": "javascript-module",
315
+ "path": "src/chat/message/types.ts",
316
+ "declarations": [
317
+ {
318
+ "kind": "variable",
319
+ "name": "ChatMessageType",
320
+ "type": {
321
+ "text": "{\n system: undefined,\n outbound: 'outbound',\n inbound: 'inbound'\n}"
322
+ },
323
+ "default": "{ system: undefined, outbound: 'outbound', inbound: 'inbound' }",
324
+ "description": "A message type in a chat conversation.",
325
+ "privacy": "public",
326
+ "deprecated": "Use specific message component types instead"
327
+ }
328
+ ],
329
+ "exports": [
330
+ {
331
+ "kind": "js",
332
+ "name": "ChatMessageType",
333
+ "declaration": {
334
+ "name": "ChatMessageType",
335
+ "module": "src/chat/message/types.ts"
336
+ }
337
+ }
338
+ ]
339
+ },
228
340
  {
229
341
  "kind": "javascript-module",
230
342
  "path": "src/chat/input/index.ts",
@@ -542,118 +654,6 @@
542
654
  "declarations": [],
543
655
  "exports": []
544
656
  },
545
- {
546
- "kind": "javascript-module",
547
- "path": "src/chat/message/index.ts",
548
- "declarations": [
549
- {
550
- "kind": "class",
551
- "description": "A Spright component for displaying a chat message",
552
- "name": "ChatMessage",
553
- "members": [
554
- {
555
- "kind": "field",
556
- "name": "messageType",
557
- "type": {
558
- "text": "ChatMessageType"
559
- },
560
- "privacy": "public"
561
- },
562
- {
563
- "kind": "method",
564
- "name": "slottedFooterActionsElementsChanged",
565
- "privacy": "public",
566
- "return": {
567
- "type": {
568
- "text": "void"
569
- }
570
- },
571
- "parameters": [
572
- {
573
- "name": "_prev",
574
- "type": {
575
- "text": "HTMLElement[] | undefined"
576
- }
577
- },
578
- {
579
- "name": "next",
580
- "type": {
581
- "text": "HTMLElement[] | undefined"
582
- }
583
- }
584
- ]
585
- }
586
- ],
587
- "attributes": [
588
- {
589
- "name": "message-type",
590
- "type": {
591
- "text": "ChatMessageType"
592
- },
593
- "fieldName": "messageType"
594
- }
595
- ],
596
- "superclass": {
597
- "name": "FoundationElement",
598
- "package": "@ni/fast-foundation"
599
- },
600
- "deprecated": "Use specific message component types instead"
601
- },
602
- {
603
- "kind": "variable",
604
- "name": "chatMessageTag",
605
- "type": {
606
- "text": "string"
607
- },
608
- "default": "'spright-chat-message'"
609
- }
610
- ],
611
- "exports": [
612
- {
613
- "kind": "js",
614
- "name": "ChatMessage",
615
- "declaration": {
616
- "name": "ChatMessage",
617
- "module": "src/chat/message/index.ts"
618
- }
619
- },
620
- {
621
- "kind": "js",
622
- "name": "chatMessageTag",
623
- "declaration": {
624
- "name": "chatMessageTag",
625
- "module": "src/chat/message/index.ts"
626
- }
627
- }
628
- ]
629
- },
630
- {
631
- "kind": "javascript-module",
632
- "path": "src/chat/message/types.ts",
633
- "declarations": [
634
- {
635
- "kind": "variable",
636
- "name": "ChatMessageType",
637
- "type": {
638
- "text": "{\n system: undefined,\n outbound: 'outbound',\n inbound: 'inbound'\n}"
639
- },
640
- "default": "{ system: undefined, outbound: 'outbound', inbound: 'inbound' }",
641
- "description": "A message type in a chat conversation.",
642
- "privacy": "public",
643
- "deprecated": "Use specific message component types instead"
644
- }
645
- ],
646
- "exports": [
647
- {
648
- "kind": "js",
649
- "name": "ChatMessageType",
650
- "declaration": {
651
- "name": "ChatMessageType",
652
- "module": "src/chat/message/types.ts"
653
- }
654
- }
655
- ]
656
- },
657
657
  {
658
658
  "kind": "javascript-module",
659
659
  "path": "src/chat/message/inbound/index.ts",
@@ -39,6 +39,34 @@
39
39
 
40
40
  <hr/>
41
41
 
42
+ ## class: `ChatMessage`
43
+
44
+ ### Superclass
45
+
46
+ | Name | Module | Package |
47
+ | ------------------- | ------ | ------------------- |
48
+ | `FoundationElement` | | @ni/fast-foundation |
49
+
50
+ ### Fields
51
+
52
+ | Name | Privacy | Type | Default | Description | Inherited From |
53
+ | ------------- | ------- | ----------------- | ------- | ----------- | -------------- |
54
+ | `messageType` | public | `ChatMessageType` | | | |
55
+
56
+ ### Methods
57
+
58
+ | Name | Privacy | Description | Parameters | Return | Inherited From |
59
+ | ------------------------------------- | ------- | ----------- | --------------------------------------------------------------------- | ------ | -------------- |
60
+ | `slottedFooterActionsElementsChanged` | public | | `_prev: HTMLElement[] \| undefined, next: HTMLElement[] \| undefined` | `void` | |
61
+
62
+ ### Attributes
63
+
64
+ | Name | Field | Inherited From |
65
+ | -------------- | ----------- | -------------- |
66
+ | `message-type` | messageType | |
67
+
68
+ <hr/>
69
+
42
70
  ## class: `ChatInput`
43
71
 
44
72
  ### Superclass
@@ -82,34 +110,6 @@
82
110
 
83
111
  <hr/>
84
112
 
85
- ## class: `ChatMessage`
86
-
87
- ### Superclass
88
-
89
- | Name | Module | Package |
90
- | ------------------- | ------ | ------------------- |
91
- | `FoundationElement` | | @ni/fast-foundation |
92
-
93
- ### Fields
94
-
95
- | Name | Privacy | Type | Default | Description | Inherited From |
96
- | ------------- | ------- | ----------------- | ------- | ----------- | -------------- |
97
- | `messageType` | public | `ChatMessageType` | | | |
98
-
99
- ### Methods
100
-
101
- | Name | Privacy | Description | Parameters | Return | Inherited From |
102
- | ------------------------------------- | ------- | ----------- | --------------------------------------------------------------------- | ------ | -------------- |
103
- | `slottedFooterActionsElementsChanged` | public | | `_prev: HTMLElement[] \| undefined, next: HTMLElement[] \| undefined` | `void` | |
104
-
105
- ### Attributes
106
-
107
- | Name | Field | Inherited From |
108
- | -------------- | ----------- | -------------- |
109
- | `message-type` | messageType | |
110
-
111
- <hr/>
112
-
113
113
  ## class: `ChatMessageInbound`
114
114
 
115
115
  ### Superclass
@@ -124,7 +124,7 @@ export class ChatInput extends mixinErrorPattern(FoundationElement) {
124
124
  this.textArea?.blur();
125
125
  }
126
126
  shouldDisableSendButton() {
127
- return this.textArea.value.length === 0;
127
+ return this.sendDisabled || this.textArea.value.length === 0;
128
128
  }
129
129
  resetInput() {
130
130
  this.value = '';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chat/input/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY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AAE,WAAW,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;4CACtC;AAGxB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;6CACzB;AAGnB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;+CAC1B;AAMrB;IADN,UAAU;2CAC2B;AAO/B;IADN,UAAU;+CACgB;AAOpB;IADN,UAAU;iDACgB;AAIpB;IADN,UAAU;uDACwB;AAInB;IADf,UAAU;+DACkD;AAItD;IADN,UAAU;qDACsB;AAIjB;IADf,UAAU;6DACgD;AAgK/D,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,CAAC;IACvC,QAAQ,EAAE,YAAY;IACtB,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["import { DesignSystem, FoundationElement } from '@ni/fast-foundation';\nimport { keyEnter } from '@ni/fast-web-utilities';\nimport { attr, nullableNumberConverter, observable, DOM } from '@ni/fast-element';\nimport { mixinErrorPattern } from '@ni/nimble-components/dist/esm/patterns/error/types';\nimport { styles } from './styles';\nimport { template } from './template';\nimport type { ChatInputSendEventDetail } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'spright-chat-input': ChatInput;\n }\n}\n\n/**\n * A Spright component for composing and sending a chat message\n */\nexport class ChatInput extends mixinErrorPattern(FoundationElement) {\n private static readonly fieldSizingSupported = CSS.supports(\n 'field-sizing',\n 'content'\n );\n\n @attr\n public placeholder?: string;\n\n @attr({ attribute: 'send-button-label' })\n public sendButtonLabel?: string;\n\n @attr({ attribute: 'stop-button-label' })\n public stopButtonLabel?: string;\n\n @attr\n public value = '';\n\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n @attr({ attribute: 'maxlength', converter: nullableNumberConverter })\n public maxLength?: number = -1;\n\n @attr({ attribute: 'processing', mode: 'boolean' })\n public processing = false;\n\n @attr({ attribute: 'send-disabled', mode: 'boolean' })\n public sendDisabled = false;\n\n /**\n * @internal\n */\n @observable\n public textArea?: HTMLTextAreaElement;\n\n /**\n * Tracks whether the send button should be disabled based on input value\n * @internal\n */\n @observable\n public isInputEmpty = true;\n\n /**\n * The width of the vertical scrollbar, if displayed.\n * @internal\n */\n @observable\n public scrollbarWidth = -1;\n\n /** @internal */\n @observable\n public footerActionsIsEmpty = true;\n\n /** @internal */\n @observable\n public readonly slottedFooterActionsElements?: HTMLElement[];\n\n /** @internal */\n @observable\n public attachmentsIsEmpty = true;\n\n /** @internal */\n @observable\n public readonly slottedAttachmentsElements?: HTMLElement[];\n\n private resizeObserver?: ResizeObserver;\n private updateScrollbarWidthQueued = false;\n\n public slottedFooterActionsElementsChanged(\n _prev: HTMLElement[] | undefined,\n next: HTMLElement[] | undefined\n ): void {\n this.footerActionsIsEmpty = next === undefined || next.length === 0;\n }\n\n public slottedAttachmentsElementsChanged(\n _prev: HTMLElement[] | undefined,\n next: HTMLElement[] | undefined\n ): void {\n this.attachmentsIsEmpty = next === undefined || next.length === 0;\n }\n\n /**\n * @internal\n */\n public textAreaKeydownHandler(e: KeyboardEvent): boolean {\n if (e.key === keyEnter && !e.shiftKey) {\n if (this.processing) {\n return false;\n }\n this.sendButtonClickHandler();\n return false;\n }\n return true;\n }\n\n /**\n * @internal\n */\n public textAreaInputHandler(): void {\n this.value = this.textArea!.value;\n this.isInputEmpty = this.shouldDisableSendButton();\n this.adjustTextAreaHeight();\n this.queueUpdateScrollbarWidth();\n }\n\n // If a property can affect whether a scrollbar is visible, we need to\n // call queueUpdateScrollbarWidth() when it changes. The exceptions are\n // properties that affect size (e.g. height, width, cols, rows), because\n // we already have a ResizeObserver handling those changes. Also,\n // a change to errorVisible cannot cause scrollbar visibility to change,\n // because we always reserve space for the error icon.\n\n /**\n * @internal\n */\n public placeholderChanged(): void {\n this.queueUpdateScrollbarWidth();\n }\n\n /**\n * @internal\n */\n public valueChanged(): void {\n if (this.textArea) {\n this.textArea.value = this.value;\n this.isInputEmpty = this.shouldDisableSendButton();\n this.adjustTextAreaHeight();\n this.queueUpdateScrollbarWidth();\n }\n }\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.textArea!.value = this.value;\n this.isInputEmpty = this.shouldDisableSendButton();\n this.adjustTextAreaHeight();\n this.resizeObserver = new ResizeObserver(() => this.onResize());\n this.resizeObserver.observe(this);\n }\n\n /**\n * @internal\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.resizeObserver?.disconnect();\n }\n\n /**\n * @internal\n */\n public sendButtonClickHandler(): void {\n if (this.shouldDisableSendButton()) {\n return;\n }\n const eventDetail: ChatInputSendEventDetail = {\n text: this.textArea!.value\n };\n this.resetInput();\n this.$emit('send', eventDetail);\n }\n\n /**\n * @internal\n */\n public stopButtonClickHandler(): void {\n if (!this.processing) {\n return;\n }\n this.$emit('stop');\n this.textArea?.blur();\n }\n\n private shouldDisableSendButton(): boolean {\n return this.textArea!.value.length === 0;\n }\n\n private resetInput(): void {\n this.value = '';\n this.isInputEmpty = true;\n if (this.textArea) {\n this.textArea.value = '';\n this.adjustTextAreaHeight();\n this.textArea.focus();\n }\n }\n\n private onResize(): void {\n this.adjustTextAreaHeight();\n this.scrollbarWidth = this.textArea!.offsetWidth - this.textArea!.clientWidth;\n }\n\n private queueUpdateScrollbarWidth(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n if (!this.updateScrollbarWidthQueued) {\n this.updateScrollbarWidthQueued = true;\n DOM.queueUpdate(() => this.updateScrollbarWidth());\n }\n }\n\n // Workaround for browsers that do not support the CSS property `field-sizing: content`\n // See https://github.com/ni/nimble/issues/2902\n private adjustTextAreaHeight(): void {\n if (ChatInput.fieldSizingSupported || !this.textArea) {\n return;\n }\n const textArea = this.textArea;\n textArea.style.height = 'auto';\n textArea.style.height = `${textArea.scrollHeight}px`;\n }\n\n private updateScrollbarWidth(): void {\n this.updateScrollbarWidthQueued = false;\n this.scrollbarWidth = this.textArea!.offsetWidth - this.textArea!.clientWidth;\n }\n}\n\nconst sprightChatInput = ChatInput.compose({\n baseName: 'chat-input',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('spright').register(sprightChatInput());\nexport const chatInputTag = 'spright-chat-input';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chat/input/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qDAAqD,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,iBAAiB,CAAC,iBAAiB,CAAC;IAAnE;;QAgBW,UAAK,GAAG,EAAE,CAAC;QAMX,cAAS,GAAY,CAAC,CAAC,CAAC;QAGxB,eAAU,GAAG,KAAK,CAAC;QAGnB,iBAAY,GAAG,KAAK,CAAC;QAQ5B;;;WAGG;QAEI,iBAAY,GAAG,IAAI,CAAC;QAE3B;;;WAGG;QAEI,mBAAc,GAAG,CAAC,CAAC,CAAC;QAE3B,gBAAgB;QAET,yBAAoB,GAAG,IAAI,CAAC;QAMnC,gBAAgB;QAET,uBAAk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AAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["import { DesignSystem, FoundationElement } from '@ni/fast-foundation';\nimport { keyEnter } from '@ni/fast-web-utilities';\nimport { attr, nullableNumberConverter, observable, DOM } from '@ni/fast-element';\nimport { mixinErrorPattern } from '@ni/nimble-components/dist/esm/patterns/error/types';\nimport { styles } from './styles';\nimport { template } from './template';\nimport type { ChatInputSendEventDetail } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'spright-chat-input': ChatInput;\n }\n}\n\n/**\n * A Spright component for composing and sending a chat message\n */\nexport class ChatInput extends mixinErrorPattern(FoundationElement) {\n private static readonly fieldSizingSupported = CSS.supports(\n 'field-sizing',\n 'content'\n );\n\n @attr\n public placeholder?: string;\n\n @attr({ attribute: 'send-button-label' })\n public sendButtonLabel?: string;\n\n @attr({ attribute: 'stop-button-label' })\n public stopButtonLabel?: string;\n\n @attr\n public value = '';\n\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n @attr({ attribute: 'maxlength', converter: nullableNumberConverter })\n public maxLength?: number = -1;\n\n @attr({ attribute: 'processing', mode: 'boolean' })\n public processing = false;\n\n @attr({ attribute: 'send-disabled', mode: 'boolean' })\n public sendDisabled = false;\n\n /**\n * @internal\n */\n @observable\n public textArea?: HTMLTextAreaElement;\n\n /**\n * Tracks whether the send button should be disabled based on input value\n * @internal\n */\n @observable\n public isInputEmpty = true;\n\n /**\n * The width of the vertical scrollbar, if displayed.\n * @internal\n */\n @observable\n public scrollbarWidth = -1;\n\n /** @internal */\n @observable\n public footerActionsIsEmpty = true;\n\n /** @internal */\n @observable\n public readonly slottedFooterActionsElements?: HTMLElement[];\n\n /** @internal */\n @observable\n public attachmentsIsEmpty = true;\n\n /** @internal */\n @observable\n public readonly slottedAttachmentsElements?: HTMLElement[];\n\n private resizeObserver?: ResizeObserver;\n private updateScrollbarWidthQueued = false;\n\n public slottedFooterActionsElementsChanged(\n _prev: HTMLElement[] | undefined,\n next: HTMLElement[] | undefined\n ): void {\n this.footerActionsIsEmpty = next === undefined || next.length === 0;\n }\n\n public slottedAttachmentsElementsChanged(\n _prev: HTMLElement[] | undefined,\n next: HTMLElement[] | undefined\n ): void {\n this.attachmentsIsEmpty = next === undefined || next.length === 0;\n }\n\n /**\n * @internal\n */\n public textAreaKeydownHandler(e: KeyboardEvent): boolean {\n if (e.key === keyEnter && !e.shiftKey) {\n if (this.processing) {\n return false;\n }\n this.sendButtonClickHandler();\n return false;\n }\n return true;\n }\n\n /**\n * @internal\n */\n public textAreaInputHandler(): void {\n this.value = this.textArea!.value;\n this.isInputEmpty = this.shouldDisableSendButton();\n this.adjustTextAreaHeight();\n this.queueUpdateScrollbarWidth();\n }\n\n // If a property can affect whether a scrollbar is visible, we need to\n // call queueUpdateScrollbarWidth() when it changes. The exceptions are\n // properties that affect size (e.g. height, width, cols, rows), because\n // we already have a ResizeObserver handling those changes. Also,\n // a change to errorVisible cannot cause scrollbar visibility to change,\n // because we always reserve space for the error icon.\n\n /**\n * @internal\n */\n public placeholderChanged(): void {\n this.queueUpdateScrollbarWidth();\n }\n\n /**\n * @internal\n */\n public valueChanged(): void {\n if (this.textArea) {\n this.textArea.value = this.value;\n this.isInputEmpty = this.shouldDisableSendButton();\n this.adjustTextAreaHeight();\n this.queueUpdateScrollbarWidth();\n }\n }\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.textArea!.value = this.value;\n this.isInputEmpty = this.shouldDisableSendButton();\n this.adjustTextAreaHeight();\n this.resizeObserver = new ResizeObserver(() => this.onResize());\n this.resizeObserver.observe(this);\n }\n\n /**\n * @internal\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.resizeObserver?.disconnect();\n }\n\n /**\n * @internal\n */\n public sendButtonClickHandler(): void {\n if (this.shouldDisableSendButton()) {\n return;\n }\n const eventDetail: ChatInputSendEventDetail = {\n text: this.textArea!.value\n };\n this.resetInput();\n this.$emit('send', eventDetail);\n }\n\n /**\n * @internal\n */\n public stopButtonClickHandler(): void {\n if (!this.processing) {\n return;\n }\n this.$emit('stop');\n this.textArea?.blur();\n }\n\n private shouldDisableSendButton(): boolean {\n return this.sendDisabled || this.textArea!.value.length === 0;\n }\n\n private resetInput(): void {\n this.value = '';\n this.isInputEmpty = true;\n if (this.textArea) {\n this.textArea.value = '';\n this.adjustTextAreaHeight();\n this.textArea.focus();\n }\n }\n\n private onResize(): void {\n this.adjustTextAreaHeight();\n this.scrollbarWidth = this.textArea!.offsetWidth - this.textArea!.clientWidth;\n }\n\n private queueUpdateScrollbarWidth(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n if (!this.updateScrollbarWidthQueued) {\n this.updateScrollbarWidthQueued = true;\n DOM.queueUpdate(() => this.updateScrollbarWidth());\n }\n }\n\n // Workaround for browsers that do not support the CSS property `field-sizing: content`\n // See https://github.com/ni/nimble/issues/2902\n private adjustTextAreaHeight(): void {\n if (ChatInput.fieldSizingSupported || !this.textArea) {\n return;\n }\n const textArea = this.textArea;\n textArea.style.height = 'auto';\n textArea.style.height = `${textArea.scrollHeight}px`;\n }\n\n private updateScrollbarWidth(): void {\n this.updateScrollbarWidthQueued = false;\n this.scrollbarWidth = this.textArea!.offsetWidth - this.textArea!.clientWidth;\n }\n}\n\nconst sprightChatInput = ChatInput.compose({\n baseName: 'chat-input',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('spright').register(sprightChatInput());\nexport const chatInputTag = 'spright-chat-input';\n"]}
@@ -101,8 +101,9 @@ export const styles = css `
101
101
 
102
102
  .action-button {
103
103
  align-self: flex-end;
104
- width: 80px;
104
+ width: 48px;
105
105
  margin: ${mediumPadding};
106
+ height: ${controlSlimHeight};
106
107
  }
107
108
 
108
109
  .attachments {
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/chat/input/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACZ,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;MACf,WAAW;;;;;;mDAMkC,WAAW;;;;;;;;;;4BAUlC,0BAA0B;kBACpC,WAAW,UAAU,gBAAgB;sBACjC,mBAAmB;;;;;;4BAMb,WAAW;;;;yBAId,gBAAgB;;4BAEb,UAAU;;;;;4BAKV,UAAU;;;;+BAIP,gBAAgB;;;;+BAIhB,SAAS;;;;+BAIT,SAAS;;;;+BAIT,SAAS;;;;+BAIT,SAAS;;;;;;;;;;gBAUxB,QAAQ;iBACP,aAAa;;;;;;qCAMO,aAAa;;;;;mBAK/B,aAAa;;;;iBAIf,qBAAqB;;;;;;;;;;eAUvB,aAAa;;;;;;;kBAOV,aAAa;;;;;;;;;;eAUhB,aAAa;mBACT,aAAa;2BACL,iBAAiB,UAAU,aAAa;;;;;kBAKjD,iBAAiB;;;;;;;;;;;;;;;;;;;sBAmBb,aAAa;kBACjB,aAAa;;;;kBAIb,iBAAiB;;CAElC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n applicationBackgroundColor,\n bodyFont,\n bodyFontColor,\n borderWidth,\n controlLabelFontColor,\n controlSlimHeight,\n elevation2BoxShadow,\n mediumPadding,\n popupBorderColor,\n borderHoverColor,\n smallDelay,\n failColor\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { styles as errorStyles } from '@ni/nimble-components/dist/esm/patterns/error/styles';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n ${display('flex')}\n ${errorStyles}\n\n :host {\n width: 100%;\n height: auto;\n outline: none;\n --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);\n }\n\n .container {\n display: flex;\n flex-direction: column;\n position: relative;\n width: 100%;\n height: 100%;\n\n background-color: ${applicationBackgroundColor};\n border: ${borderWidth} solid ${popupBorderColor};\n box-shadow: ${elevation2BoxShadow};\n }\n\n .container::after {\n content: '';\n position: absolute;\n bottom: calc(-1 * ${borderWidth});\n width: 0px;\n height: 0px;\n align-self: center;\n border-bottom: ${borderHoverColor}\n var(--ni-private-hover-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n :host(:hover) .container::after {\n width: 100%;\n transition: width ${smallDelay} ease-in;\n }\n\n :host(:focus-within) .container {\n border-bottom-color: ${borderHoverColor};\n }\n\n :host([error-visible]) .container::after {\n border-bottom-color: ${failColor};\n }\n \n :host([error-visible]) .container {\n border-bottom-color: ${failColor};\n }\n\n :host([error-visible]:hover) .container::after {\n border-bottom-color: ${failColor};\n }\n\n :host([error-visible]:focus-within) .container {\n border-bottom-color: ${failColor};\n }\n\n @media (prefers-reduced-motion) {\n .container::after {\n transition-duration: 0s;\n }\n }\n\n textarea {\n font: ${bodyFont};\n color: ${bodyFontColor};\n background-color: transparent;\n\n width: 100%;\n resize: none;\n height: auto;\n max-height: calc(6lh + 2 * ${mediumPadding});\n field-sizing: content;\n\n border-width: 0px;\n outline: none;\n padding: ${mediumPadding};\n }\n\n textarea::placeholder {\n color: ${controlLabelFontColor};\n }\n\n :host([error-visible]) .error-icon {\n display: none;\n }\n\n :host([error-visible]) .error-icon.scrollbar-width-calculated {\n display: inline-flex;\n position: absolute;\n top: ${mediumPadding};\n right: var(--ni-private-scrollbar-width);\n }\n\n .action-button {\n align-self: flex-end;\n width: 80px;\n margin: ${mediumPadding};\n }\n\n .attachments {\n display: none;\n }\n\n .attachments.has-content {\n display: flex;\n flex-wrap: wrap;\n gap: ${mediumPadding};\n padding: ${mediumPadding};\n max-height: calc(${controlSlimHeight} * 3 + ${mediumPadding} * 4 );\n overflow-y: auto;\n }\n\n .attachments ::slotted(*) {\n height: ${controlSlimHeight};\n }\n\n .footer {\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n justify-content: flex-end;\n }\n\n .footer-actions {\n display: none;\n flex: 1;\n }\n\n .footer-actions.has-content {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: ${mediumPadding};\n margin: ${mediumPadding};\n }\n\n .footer-actions ::slotted(*) {\n height: ${controlSlimHeight};\n }\n`;\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/chat/input/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACZ,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;MACf,WAAW;;;;;;mDAMkC,WAAW;;;;;;;;;;4BAUlC,0BAA0B;kBACpC,WAAW,UAAU,gBAAgB;sBACjC,mBAAmB;;;;;;4BAMb,WAAW;;;;yBAId,gBAAgB;;4BAEb,UAAU;;;;;4BAKV,UAAU;;;;+BAIP,gBAAgB;;;;+BAIhB,SAAS;;;;+BAIT,SAAS;;;;+BAIT,SAAS;;;;+BAIT,SAAS;;;;;;;;;;gBAUxB,QAAQ;iBACP,aAAa;;;;;;qCAMO,aAAa;;;;;mBAK/B,aAAa;;;;iBAIf,qBAAqB;;;;;;;;;;eAUvB,aAAa;;;;;;;kBAOV,aAAa;kBACb,iBAAiB;;;;;;;;;;eAUpB,aAAa;mBACT,aAAa;2BACL,iBAAiB,UAAU,aAAa;;;;;kBAKjD,iBAAiB;;;;;;;;;;;;;;;;;;;sBAmBb,aAAa;kBACjB,aAAa;;;;kBAIb,iBAAiB;;CAElC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n applicationBackgroundColor,\n bodyFont,\n bodyFontColor,\n borderWidth,\n controlLabelFontColor,\n controlSlimHeight,\n elevation2BoxShadow,\n mediumPadding,\n popupBorderColor,\n borderHoverColor,\n smallDelay,\n failColor\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { styles as errorStyles } from '@ni/nimble-components/dist/esm/patterns/error/styles';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n ${display('flex')}\n ${errorStyles}\n\n :host {\n width: 100%;\n height: auto;\n outline: none;\n --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);\n }\n\n .container {\n display: flex;\n flex-direction: column;\n position: relative;\n width: 100%;\n height: 100%;\n\n background-color: ${applicationBackgroundColor};\n border: ${borderWidth} solid ${popupBorderColor};\n box-shadow: ${elevation2BoxShadow};\n }\n\n .container::after {\n content: '';\n position: absolute;\n bottom: calc(-1 * ${borderWidth});\n width: 0px;\n height: 0px;\n align-self: center;\n border-bottom: ${borderHoverColor}\n var(--ni-private-hover-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n :host(:hover) .container::after {\n width: 100%;\n transition: width ${smallDelay} ease-in;\n }\n\n :host(:focus-within) .container {\n border-bottom-color: ${borderHoverColor};\n }\n\n :host([error-visible]) .container::after {\n border-bottom-color: ${failColor};\n }\n \n :host([error-visible]) .container {\n border-bottom-color: ${failColor};\n }\n\n :host([error-visible]:hover) .container::after {\n border-bottom-color: ${failColor};\n }\n\n :host([error-visible]:focus-within) .container {\n border-bottom-color: ${failColor};\n }\n\n @media (prefers-reduced-motion) {\n .container::after {\n transition-duration: 0s;\n }\n }\n\n textarea {\n font: ${bodyFont};\n color: ${bodyFontColor};\n background-color: transparent;\n\n width: 100%;\n resize: none;\n height: auto;\n max-height: calc(6lh + 2 * ${mediumPadding});\n field-sizing: content;\n\n border-width: 0px;\n outline: none;\n padding: ${mediumPadding};\n }\n\n textarea::placeholder {\n color: ${controlLabelFontColor};\n }\n\n :host([error-visible]) .error-icon {\n display: none;\n }\n\n :host([error-visible]) .error-icon.scrollbar-width-calculated {\n display: inline-flex;\n position: absolute;\n top: ${mediumPadding};\n right: var(--ni-private-scrollbar-width);\n }\n\n .action-button {\n align-self: flex-end;\n width: 48px;\n margin: ${mediumPadding};\n height: ${controlSlimHeight};\n }\n\n .attachments {\n display: none;\n }\n\n .attachments.has-content {\n display: flex;\n flex-wrap: wrap;\n gap: ${mediumPadding};\n padding: ${mediumPadding};\n max-height: calc(${controlSlimHeight} * 3 + ${mediumPadding} * 4 );\n overflow-y: auto;\n }\n\n .attachments ::slotted(*) {\n height: ${controlSlimHeight};\n }\n\n .footer {\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n justify-content: flex-end;\n }\n\n .footer-actions {\n display: none;\n flex: 1;\n }\n\n .footer-actions.has-content {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: ${mediumPadding};\n margin: ${mediumPadding};\n }\n\n .footer-actions ::slotted(*) {\n height: ${controlSlimHeight};\n }\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/spright-components",
3
- "version": "6.20.0",
3
+ "version": "6.20.2",
4
4
  "description": "NI Spright Components",
5
5
  "scripts": {
6
6
  "build": "npm run build:components && npm run build:cem",