@vaadin/message-list 23.1.6 → 23.1.8
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/message-list",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/avatar": "
|
|
40
|
-
"@vaadin/component-base": "
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
42
|
-
"@vaadin/vaadin-material-styles": "
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
39
|
+
"@vaadin/avatar": "~23.1.8",
|
|
40
|
+
"@vaadin/component-base": "~23.1.8",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "~23.1.8",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "~23.1.8",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "~23.1.8"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
47
47
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
48
48
|
"sinon": "^13.0.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "297e4e51743751bed97f5400e661529a7d550870"
|
|
51
51
|
}
|
|
@@ -118,6 +118,7 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
118
118
|
return Array.from(this.shadowRoot.querySelectorAll('vaadin-message'));
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
/** @private */
|
|
121
122
|
_itemsChanged(newVal, oldVal) {
|
|
122
123
|
const focusedIndex = this._getIndexOfFocusableElement();
|
|
123
124
|
if (newVal && newVal.length) {
|
|
@@ -132,6 +133,7 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
/** @private */
|
|
135
137
|
_scrollToLastMessage() {
|
|
136
138
|
if (this.items.length > 0) {
|
|
137
139
|
this.scrollTop = this.scrollHeight - this.clientHeight;
|
|
@@ -186,6 +188,7 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
186
188
|
target.focus();
|
|
187
189
|
}
|
|
188
190
|
|
|
191
|
+
/** @private */
|
|
189
192
|
_handleFocusEvent(e) {
|
|
190
193
|
const target = e.composedPath().find((node) => node instanceof Message);
|
|
191
194
|
this._setTabIndexesByMessage(target);
|
|
@@ -200,10 +203,12 @@ class MessageList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
200
203
|
this._setTabIndexesByMessage(message);
|
|
201
204
|
}
|
|
202
205
|
|
|
206
|
+
/** @private */
|
|
203
207
|
_setTabIndexesByMessage(message) {
|
|
204
208
|
this._messages.forEach((e) => (e.tabIndex = e === message ? 0 : -1));
|
|
205
209
|
}
|
|
206
210
|
|
|
211
|
+
/** @private */
|
|
207
212
|
_getIndexOfFocusableElement() {
|
|
208
213
|
const index = this._messages.findIndex((e) => e.tabIndex === 0);
|
|
209
214
|
return index !== -1 ? index : 0;
|
package/src/vaadin-message.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
56
56
|
* It will be placed in the name part to indicate who has sent the message.
|
|
57
57
|
* It is also used as a tooltip for the avatar.
|
|
58
58
|
* Example: `message.userName = "Jessica Jacobs";`
|
|
59
|
+
* @attr {string} user-name
|
|
59
60
|
*/
|
|
60
61
|
userName: string | null | undefined;
|
|
61
62
|
|
|
@@ -64,6 +65,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
64
65
|
* The abbreviation will be passed on to avatar of the message.
|
|
65
66
|
* If the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.
|
|
66
67
|
* Example: `message.userAbbr = "JJ";`
|
|
68
|
+
* @attr {string} user-abbr
|
|
67
69
|
*/
|
|
68
70
|
userAbbr: string | null | undefined;
|
|
69
71
|
|
|
@@ -71,6 +73,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
71
73
|
* An URL for a user image.
|
|
72
74
|
* The image will be used in the avatar component to show who has sent the message.
|
|
73
75
|
* Example: `message.userImg = "/static/img/avatar.jpg";`
|
|
76
|
+
* @attr {string} user-img
|
|
74
77
|
*/
|
|
75
78
|
userImg: string | null | undefined;
|
|
76
79
|
|
|
@@ -92,6 +95,7 @@ declare class Message extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement)
|
|
|
92
95
|
* ```js
|
|
93
96
|
* message.userColorIndex = 1;
|
|
94
97
|
* ```
|
|
98
|
+
* @attr {number} user-color-index
|
|
95
99
|
*/
|
|
96
100
|
userColorIndex: number | null | undefined;
|
|
97
101
|
}
|
package/src/vaadin-message.js
CHANGED
|
@@ -67,6 +67,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
67
67
|
* It will be placed in the name part to indicate who has sent the message.
|
|
68
68
|
* It is also used as a tooltip for the avatar.
|
|
69
69
|
* Example: `message.userName = "Jessica Jacobs";`
|
|
70
|
+
* @attr {string} user-name
|
|
70
71
|
*/
|
|
71
72
|
userName: {
|
|
72
73
|
type: String,
|
|
@@ -77,6 +78,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
77
78
|
* The abbreviation will be passed on to avatar of the message.
|
|
78
79
|
* If the user does not have an avatar picture set with `userImg`, `userAbbr` will be shown in the avatar.
|
|
79
80
|
* Example: `message.userAbbr = "JJ";`
|
|
81
|
+
* @attr {string} user-abbr
|
|
80
82
|
*/
|
|
81
83
|
userAbbr: {
|
|
82
84
|
type: String,
|
|
@@ -86,6 +88,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
86
88
|
* An URL for a user image.
|
|
87
89
|
* The image will be used in the avatar component to show who has sent the message.
|
|
88
90
|
* Example: `message.userImg = "/static/img/avatar.jpg";`
|
|
91
|
+
* @attr {string} user-img
|
|
89
92
|
*/
|
|
90
93
|
userImg: {
|
|
91
94
|
type: String,
|
|
@@ -109,6 +112,7 @@ class Message extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
109
112
|
* ```js
|
|
110
113
|
* message.userColorIndex = 1;
|
|
111
114
|
* ```
|
|
115
|
+
* @attr {number} user-color-index
|
|
112
116
|
*/
|
|
113
117
|
userColorIndex: {
|
|
114
118
|
type: Number,
|