Skip to content

Commit 832046a

Browse files
Integrated latest changes at 12-12-2024 1:30:12 AM
1 parent 164b365 commit 832046a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2923
-42
lines changed

ej2-angular-toc.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,19 @@
554554
Chat UI
555555
<ul>
556556
<li><a href="/ej2-angular/chat-ui/getting-started">Getting Started</a></li>
557+
<li><a href="/ej2-angular/chat-ui/messages">Messages</a></li>
558+
<li><a href="/ej2-angular/chat-ui/timebreak">Time break</a></li>
559+
<li><a href="/ej2-angular/chat-ui/timestamp">Timestamp</a></li>
560+
<li><a href="/ej2-angular/chat-ui/typing-indicator">Typing indicator</a></li>
561+
<li><a href="/ej2-angular/chat-ui/load-on-demand">Load on-demand</a></li>
562+
<li><a href="/ej2-angular/chat-ui/header">Header</a></li>
563+
<li><a href="/ej2-angular/chat-ui/footer">Footer</a></li>
564+
<li><a href="/ej2-angular/chat-ui/templates">Templates</a></li>
565+
<li><a href="/ej2-angular/chat-ui/appearance">Appearance</a></li>
566+
<li><a href="/ej2-angular/chat-ui/globalization">Globalization</a></li>
567+
<li><a href="/ej2-angular/chat-ui/accessibility">Accessibility</a></li>
568+
<li><a href="/ej2-angular/chat-ui/methods">Methods</a></li>
569+
<li><a href="/ej2-angular/chat-ui/events">Events</a></li>
557570
</ul>
558571
</li><li>
559572
CheckBox

ej2-angular/chat-ui/accessibility.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
layout: post
3+
title: Accessibility in Angular Chat UI component | Syncfusion
4+
description: Learn here all about Accessibility in Syncfusion Angular Chat UI component of Syncfusion Essential JS 2 and more.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Accessibility in Angular Chat UI component
12+
13+
The Chat UI component followed the accessibility guidelines and standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WCAG roles](https://www.w3.org/TR/wai-aria/#roles) that are commonly used to evaluate accessibility.
14+
15+
The accessibility compliance for the Chat UI component is outlined below.
16+
17+
| Accessibility Criteria | Compatibility |
18+
| -- | -- |
19+
| [WCAG 2.2 Support](../common/accessibility#accessibility-standards) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
20+
| [Section 508 Support](../common/accessibility#accessibility-standards) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
21+
| [Screen Reader Support](../common/accessibility#screen-reader-support) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
22+
| [Right-To-Left Support](../common/accessibility#right-to-left-support) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
23+
| [Color Contrast](../common/accessibility#color-contrast) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
24+
| [Mobile Device Support](../common/accessibility#mobile-device-support) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
25+
| [Keyboard Navigation Support](../common/accessibility#keyboard-navigation-support) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
26+
| [Accessibility Checker Validation](../common/accessibility#ensuring-accessibility) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
27+
| [Axe-core Accessibility Validation](../common/accessibility#ensuring-accessibility) | <img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> |
28+
29+
<style>
30+
.post .post-content img {
31+
display: inline-block;
32+
margin: 0.5em 0;
33+
}
34+
</style>
35+
<div><img src="https://cdn.syncfusion.com/content/images/documentation/full.png" alt="Yes"> - All features of the component meet the requirement.</div>
36+
37+
<div><img src="https://cdn.syncfusion.com/content/images/documentation/partial.png" alt="Intermediate"> - Some features of the component do not meet the requirement.</div>
38+
39+
<div><img src="https://cdn.syncfusion.com/content/images/documentation/not-supported.png" alt="No"> - The component does not meet the requirement.</div>
40+
41+
## WAI-ARIA attributes
42+
43+
The following ARIA attributes are used in the Chat UI component:
44+
45+
| Attributes | Purpose |
46+
| ------------ | ----------------------- |
47+
| `role=button` | Indicates that the element is clickable and triggers an action when activated by the user. |
48+
| `role=toolbar` | Specifies that the element is a toolbar. |
49+
| `aria-label` | Defines a string value that labels an interactive element for accessibility. |
50+
| `aria-orientation` | Specifies the orientation of the toolbar. |
51+
| `aria-disabled` | Indicates whether the toolbar or element is currently disabled and not interactive. |
52+
| `aria-multiline` | Indicates that a textbox accepts multiple lines of input or only a single line. |
53+
54+
## Keyboard interaction
55+
56+
The following keyboard shortcuts are supported by the Chat UI component.
57+
58+
| **Press** | **To do this** |
59+
| --- | --- |
60+
| <kbd>Enter</kbd> | Select the focused item or send a message when the input is focused. |
61+
| <kbd>Tab</kbd> | Moves focus forward through the interactive elements. |
62+
| <kbd>Shift + Tab</kbd> | Moves focus backward through the interactive elements. |
63+
| <kbd>Page Up</kbd> | Scroll up through chat history. |
64+
| <kbd>Page Down</kbd> | Scroll down through chat history. |
65+
| <kbd>Ctrl + Home</kbd> | Scroll to the first message. |
66+
| <kbd>Ctrl + End</kbd> | Scroll to the most recent message. |
67+
<b>Chat UI Toolbars</b>||
68+
| <kbd>Left Arrow</kbd> | Focuses the previous toolbar element. |
69+
| <kbd>Right Arrow</kbd> | Focuses the next toolbar element. |
70+
| <kbd>Enter / Space</kbd> | Select the focused item or activate the selected option. |
71+
| <kbd>Home</kbd> | Moves focus to the first toolbar element. |
72+
| <kbd>End</kbd> | Moves focus to the last toolbar element. |
73+
74+
## Ensuring accessibility
75+
76+
The Chat UI component's accessibility levels are ensured through an [accessibility-checker](https://www.npmjs.com/package/accessibility-checker) and [axe-core](https://www.npmjs.com/package/axe-core) software tools during automated testing.
77+
78+
## See also
79+
80+
* [Accessibility in Syncfusion components](../common/accessibility)

ej2-angular/chat-ui/appearance.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: post
3+
title: Appearance in Angular Chat UI component | Syncfusion
4+
description: Checkout and learn about Appearance with Angular Chat UI component of Syncfusion Essential JS 2 and more details.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Appearance in Angular Chat UI component
12+
13+
## Setting placeholder
14+
15+
You can use the `placeholder` property to display the placeholder text that appears in the message input field to guide users on what to type. The default is `Type your message…`.
16+
17+
## Setting width
18+
19+
You can use the `width` property to specify the dimensions of the Chat UI within the application layout. By default, the value is `100%`.
20+
21+
## Setting height
22+
23+
You can use the `height` property to specify the dimensions of the Chat UI within the application layout. By default, the value is `100%`.
24+
25+
## Setting CSS Class
26+
27+
You can use the `cssClass` property to customize the appearance of the chat UI component.

ej2-angular/chat-ui/events.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: post
3+
title: Events in Angular Chat UI component | Syncfusion
4+
description: Checkout and learn about Events with Angular Chat UI component of Syncfusion Essential JS 2 and more details.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Events in Angular Chat UI component
12+
13+
This section describes the Chat UI events that will be triggered when appropriate actions are performed. The following events are available in the Chat UI component.
14+
15+
## Created
16+
17+
The Chat UI component triggers the `created` event when the component rendering is completed.
18+
19+
## Sending message
20+
21+
The `messageSend` event is triggered before sending a message in the Chat UI component.
22+
23+
## User Typing
24+
25+
The `userTyping` event is triggered when the user is typing a message in the Chat UI component.

ej2-angular/chat-ui/footer.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: post
3+
title: Footer in Angular Chat UI component | Syncfusion
4+
description: Checkout and learn about Footer with Angular Chat UI component of Syncfusion Essential JS 2 and more details.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Footer in Angular Chat UI component
12+
13+
## Show or hide footer
14+
15+
You can use showFooter property to enable or disable the chat footer.
16+
17+
## Footer template
18+
19+
> Refer to the [Templates](./templates#footer-template) section for more details about the Footer template.

ej2-angular/chat-ui/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ This can be referenced in [src/styles.css] using following code.
119119

120120
```css
121121
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
122-
@import '../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css';
123122
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
124123
@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css';
125124
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
126125
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
126+
@import '../node_modules/@syncfusion/ej2-angular-interactive-chat/styles/material.css';
127127
```
128128

129129
## Adding Chat UI component
@@ -166,7 +166,7 @@ The following example illustrates the output in your browser.
166166

167167
## Configure messages and user
168168

169-
You can use the `messages` property to add messages and the `user` property to configure the current user for the chat.
169+
You can use the `<e-messages>` tag directive to group all the messages and `<e-message>` tag to define each message and the `user` property to configure the current user for the chat.
170170

171171
{% tabs %}
172172
{% highlight ts tabtitle="app.component.ts" %}

ej2-angular/chat-ui/globalization.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: post
3+
title: Globalization in Angular Chat UI component | Syncfusion
4+
description: Checkout and learn about Globalization with Angular Chat UI component of Syncfusion Essential JS 2 and more details.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Globalization in Angular Chat UI
12+
13+
## Localization
14+
15+
The Chat UI can be localized to any culture by defining the text of the Chat UI in the corresponding culture. The default locale of the Chat UI is `en` (English). The following table represents the default text of the Chat UI in `en` culture.
16+
17+
|KEY|Text|
18+
|----|----|
19+
|oneUserTyping|{0} is typing|
20+
|twoUserTyping|{0} and {1} are typing|
21+
|threeUserTyping|{0}, {1}, and {2} other are typing|
22+
|multipleUsersTyping|{0}, {1}, and {2} others are typing|
23+
24+
## RTL
25+
26+
RTL provides an option to switch the text direction and layout of the Chat UI component from right to left by setting the `enableRtl` property to `true`.

ej2-angular/chat-ui/header.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
layout: post
3+
title: Header in Angular Chat UI component | Syncfusion
4+
description: Checkout and learn about Header with Angular Chat UI component of Syncfusion Essential JS 2 and more details.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Header in Angular Chat UI component
12+
13+
## Show or hide header
14+
15+
You can use `showHeader` property to enable or disable the chat header. It contains the following options `headerText` and `headerIconCss`.
16+
17+
### Setting header text
18+
19+
You can use the `headerText` property to display the text that appears in the header, which indicates the current username or the group name providing the context for the conversation.
20+
21+
### Setting header icon CSS
22+
23+
You can use the `headerIconCss` property to customize the styling of the header icon.
24+
25+
## Toolbar
26+
27+
You can render the Chat UI toolbar items by using the items property in the headerToolbar.
28+
29+
### Setting Items
30+
31+
Items can be constructed with the following built-in command types or item template.
32+
33+
#### Adding icon CSS
34+
35+
You can customize the header toolbar icons by using the `iconCss` property.
36+
37+
#### Setting item type
38+
39+
You can change the header toolbar item type by using the `type` property. The `type` supports three types of items such as `Button`, `Separator` and `Input`. By default, the type is `Button`.
40+
41+
In the following example, header toolbar item type is set as `Button`.
42+
43+
#### Setting text
44+
45+
You can use the `text` property to set the text for the header toolbar item.
46+
47+
#### Show or hide toolbar item
48+
49+
You can use the `visible` property to specify whether to show or hide the header toolbar item. By default, its value is `true`.
50+
51+
#### Setting disabled
52+
53+
You can use the `disabled` property to disable the header toolbar item. By default, its value is `false`.
54+
55+
#### Setting tooltip text
56+
57+
You can use the `tooltip` property to specify the tooltip text to be displayed on hovering the header toolbar item.
58+
59+
#### Setting Css Class
60+
61+
You can use the `cssClass` property to customize the header toolbar item.
62+
63+
#### Setting alignment
64+
65+
You can change the alignment of toolbar item by using the `align` property. It supports three types of alignments such as `Left`, `Center` and `Right`. By default, the value is `Left`.
66+
67+
In the following example, toolbar item type is set with `Right`.
68+
69+
#### Enabling tab key navigation in toolbar
70+
71+
You can use the `tabIndex` property of a Toolbar item to enable tab key navigation for the item. By default, the user can switch between items using the arrow keys, but the `tabIndex` property allows you to switch between items using the `Tab` and `Shift+Tab` keys as well.
72+
73+
To use the `tabIndex` property, set it for each Toolbar item which you want to enable tab key navigation. The `tabIndex` property should be set to a positive integer value. A value of `0` or a negative value will disable tab key navigation for the item.
74+
75+
For example, to enable tab key navigation for two Toolbar items you can use the following code:
76+
77+
```ts
78+
import { Component, ViewChild } from '@angular/core';
79+
import { ChatUIComponent, ToolbarSettingsModel } from '@syncfusion/ej2-angular-interactive-chat';
80+
81+
@Component({
82+
imports: [ FormsModule, ReactiveFormsModule, ChatUIModule ],
83+
standalone: true,
84+
selector: 'app-root',
85+
// specifies the template string for the Chat UI component
86+
template: `<div ejs-chatui #chatUI [headerToolbar]="headerToolbar"></div>`
87+
})
88+
89+
export class AppComponent {
90+
@ViewChild('chatUIComponent')
91+
public chatUIComponent!: ChatUIComponent;
92+
93+
public headerToolbar: ToolbarSettingsModel = {
94+
items: [
95+
{ text: "Item 1", tabIndex: 1 },
96+
{ text: "Item 2", tabIndex: 2 }
97+
]
98+
};
99+
}
100+
101+
```
102+
103+
With the above code, the user can switch between the two Toolbar items using the Tab and Shift+Tab keys, in addition to using the arrow keys. The items will be navigated in the order specified by the `tabIndex` values.
104+
105+
If you set the `tabIndex` value to 0 for all Toolbar items, tab key navigation will be based on the element order rather than the `tabIndex` values. For example:
106+
107+
```ts
108+
import { Component, ViewChild } from '@angular/core';
109+
import { ChatUIComponent, ToolbarSettingsModel } from '@syncfusion/ej2-angular-interactive-chat';
110+
111+
@Component({
112+
imports: [ FormsModule, ReactiveFormsModule, ChatUIModule ],
113+
standalone: true,
114+
selector: 'app-root',
115+
// specifies the template string for the Chat UI component
116+
template: `<div ejs-chatui #chatUI [headerToolbar]="headerToolbar"></div>`
117+
})
118+
119+
export class AppComponent {
120+
@ViewChild('chatUIComponent')
121+
public chatUIComponent!: ChatUIComponent;
122+
123+
public headerToolbar: ToolbarSettingsModel = {
124+
items: [
125+
{ text: "Item 1", tabIndex: 0 },
126+
{ text: "Item 2", tabIndex: 0 }
127+
]
128+
};
129+
130+
}
131+
132+
```
133+
134+
In this case, the user can switch between the two Toolbar items using the Tab and Shift+Tab keys, and the items will be navigated in the order in which they appear in the DOM.
135+
136+
#### Setting template
137+
138+
You can use the `template` property to add custom toolbar item in the Chat UI component.
139+
140+
### Item clicked
141+
142+
You can define `itemClicked` event in the `headerToolbar` property which will be triggered when the header toolbar item is clicked.

ej2-angular/chat-ui/load-on-demand.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: post
3+
title: Load on-demand in Angular Chat UI component | Syncfusion
4+
description: Checkout and learn about Load on-demand with Angular Chat UI component of Syncfusion Essential JS 2 and more details.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Load on-demand in Angular Chat UI component
12+
13+
You can use the `loadOnDemand` property to load messages dynamically when the scroll reaches the top of the message list improving performance and reducing load times, particularly in long conversations. This ensures a smooth user experience by only fetching messages as needed rather than loading the entire conversation at once.

0 commit comments

Comments
 (0)