@vaadin/avatar-group 23.0.0-alpha2 → 23.0.0-beta1
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/avatar-group",
|
|
3
|
-
"version": "23.0.0-
|
|
3
|
+
"version": "23.0.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"main": "vaadin-avatar-group.js",
|
|
20
20
|
"module": "vaadin-avatar-group.js",
|
|
21
|
+
"type": "module",
|
|
21
22
|
"files": [
|
|
22
23
|
"src",
|
|
23
24
|
"theme",
|
|
@@ -33,21 +34,20 @@
|
|
|
33
34
|
"polymer"
|
|
34
35
|
],
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@polymer/iron-a11y-announcer": "^3.0.0",
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/avatar": "23.0.0-
|
|
39
|
-
"@vaadin/component-base": "23.0.0-
|
|
40
|
-
"@vaadin/item": "23.0.0-
|
|
41
|
-
"@vaadin/list-box": "23.0.0-
|
|
42
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0-
|
|
43
|
-
"@vaadin/vaadin-material-styles": "23.0.0-
|
|
44
|
-
"@vaadin/vaadin-overlay": "23.0.0-
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "23.0.0-
|
|
38
|
+
"@vaadin/avatar": "23.0.0-beta1",
|
|
39
|
+
"@vaadin/component-base": "23.0.0-beta1",
|
|
40
|
+
"@vaadin/item": "23.0.0-beta1",
|
|
41
|
+
"@vaadin/list-box": "23.0.0-beta1",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-beta1",
|
|
43
|
+
"@vaadin/vaadin-material-styles": "23.0.0-beta1",
|
|
44
|
+
"@vaadin/vaadin-overlay": "23.0.0-beta1",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-beta1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@esm-bundle/chai": "^4.3.4",
|
|
49
49
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
50
50
|
"sinon": "^9.2.1"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "467244b76021176c109df675799b07029b293e58"
|
|
53
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2020 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ListBox } from '@vaadin/list-box/src/vaadin-list-box.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2020 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { OverlayElement } from '@vaadin/vaadin-overlay/src/vaadin-overlay.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2020 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { AvatarI18n } from '@vaadin/avatar/src/vaadin-avatar.js';
|
|
7
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
|
+
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
|
|
10
11
|
export { AvatarI18n };
|
|
@@ -62,7 +63,7 @@ export interface AvatarGroupItem {
|
|
|
62
63
|
* - `<vaadin-avatar-group-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
|
|
63
64
|
* - `<vaadin-avatar-group-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
|
|
64
65
|
*/
|
|
65
|
-
declare class AvatarGroup extends ElementMixin(ThemableMixin(HTMLElement)) {
|
|
66
|
+
declare class AvatarGroup extends ResizeMixin(ElementMixin(ThemableMixin(HTMLElement))) {
|
|
66
67
|
readonly _avatars: HTMLElement[];
|
|
67
68
|
|
|
68
69
|
/**
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2020 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import '@polymer/polymer/lib/elements/dom-repeat.js';
|
|
6
7
|
import '@vaadin/avatar/src/vaadin-avatar.js';
|
|
7
8
|
import '@vaadin/item/src/vaadin-item.js';
|
|
8
9
|
import './vaadin-avatar-group-list-box.js';
|
|
9
10
|
import './vaadin-avatar-group-overlay.js';
|
|
10
|
-
import { IronA11yAnnouncer } from '@polymer/iron-a11y-announcer/iron-a11y-announcer.js';
|
|
11
11
|
import { calculateSplices } from '@polymer/polymer/lib/utils/array-splice.js';
|
|
12
12
|
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
13
13
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
14
|
-
import {
|
|
15
|
-
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
14
|
+
import { announce } from '@vaadin/component-base/src/a11y-announcer.js';
|
|
16
15
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
16
|
+
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
17
17
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
18
18
|
|
|
19
19
|
const MINIMUM_DISPLAYED_AVATARS = 2;
|
|
@@ -58,8 +58,9 @@ const MINIMUM_DISPLAYED_AVATARS = 2;
|
|
|
58
58
|
* @extends HTMLElement
|
|
59
59
|
* @mixes ElementMixin
|
|
60
60
|
* @mixes ThemableMixin
|
|
61
|
+
* @mixes ResizeMixin
|
|
61
62
|
*/
|
|
62
|
-
class AvatarGroup extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
63
|
+
class AvatarGroup extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
63
64
|
static get template() {
|
|
64
65
|
return html`
|
|
65
66
|
<style>
|
|
@@ -278,13 +279,8 @@ class AvatarGroup extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
278
279
|
ready() {
|
|
279
280
|
super.ready();
|
|
280
281
|
|
|
281
|
-
IronA11yAnnouncer.requestAvailability();
|
|
282
|
-
|
|
283
282
|
this.__boundSetPosition = this.__setPosition.bind(this);
|
|
284
283
|
|
|
285
|
-
this.__resizeObserver = new ResizeObserver(() => this._onResize());
|
|
286
|
-
this.__resizeObserver.observe(this);
|
|
287
|
-
|
|
288
284
|
this._overlayElement = this.shadowRoot.querySelector('vaadin-avatar-group-overlay');
|
|
289
285
|
|
|
290
286
|
afterNextRender(this, () => {
|
|
@@ -313,19 +309,6 @@ class AvatarGroup extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
313
309
|
return this.shadowRoot.querySelectorAll('vaadin-avatar');
|
|
314
310
|
}
|
|
315
311
|
|
|
316
|
-
/** @private */
|
|
317
|
-
__announce(text) {
|
|
318
|
-
this.dispatchEvent(
|
|
319
|
-
new CustomEvent('iron-announce', {
|
|
320
|
-
bubbles: true,
|
|
321
|
-
composed: true,
|
|
322
|
-
detail: {
|
|
323
|
-
text
|
|
324
|
-
}
|
|
325
|
-
})
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
312
|
/** @private */
|
|
330
313
|
__getMessage(user, action) {
|
|
331
314
|
return action.replace('{user}', user.name || user.abbr || this.i18n.anonymous);
|
|
@@ -358,12 +341,13 @@ class AvatarGroup extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
358
341
|
}
|
|
359
342
|
}
|
|
360
343
|
|
|
361
|
-
/**
|
|
344
|
+
/**
|
|
345
|
+
* @protected
|
|
346
|
+
* @override
|
|
347
|
+
*/
|
|
362
348
|
_onResize() {
|
|
363
|
-
this.
|
|
364
|
-
|
|
365
|
-
this.__setPosition();
|
|
366
|
-
});
|
|
349
|
+
this.__setItemsInView();
|
|
350
|
+
this.__setPosition();
|
|
367
351
|
}
|
|
368
352
|
|
|
369
353
|
/** @private */
|
|
@@ -475,7 +459,7 @@ class AvatarGroup extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
475
459
|
|
|
476
460
|
const messages = removedMsg.concat(addedMsg);
|
|
477
461
|
if (messages.length > 0) {
|
|
478
|
-
|
|
462
|
+
announce(messages.join(', '));
|
|
479
463
|
}
|
|
480
464
|
}
|
|
481
465
|
|
|
@@ -593,16 +577,6 @@ class AvatarGroup extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
593
577
|
this._overlayElement.style.top = btnRect.bottom + 'px';
|
|
594
578
|
}
|
|
595
579
|
}
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* @deprecated Since Vaadin 23, `notifyResize()` is deprecated. The component uses a
|
|
599
|
-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
|
|
600
|
-
*/
|
|
601
|
-
notifyResize() {
|
|
602
|
-
console.warn(
|
|
603
|
-
`WARNING: Since Vaadin 23, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes.`
|
|
604
|
-
);
|
|
605
|
-
}
|
|
606
580
|
}
|
|
607
581
|
|
|
608
582
|
customElements.define(AvatarGroup.is, AvatarGroup);
|