@vaadin/avatar-group 23.0.0-alpha2 → 23.0.0-alpha3

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-alpha2",
3
+ "version": "23.0.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,21 +33,20 @@
33
33
  "polymer"
34
34
  ],
35
35
  "dependencies": {
36
- "@polymer/iron-a11y-announcer": "^3.0.0",
37
36
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/avatar": "23.0.0-alpha2",
39
- "@vaadin/component-base": "23.0.0-alpha2",
40
- "@vaadin/item": "23.0.0-alpha2",
41
- "@vaadin/list-box": "23.0.0-alpha2",
42
- "@vaadin/vaadin-lumo-styles": "23.0.0-alpha2",
43
- "@vaadin/vaadin-material-styles": "23.0.0-alpha2",
44
- "@vaadin/vaadin-overlay": "23.0.0-alpha2",
45
- "@vaadin/vaadin-themable-mixin": "23.0.0-alpha2"
37
+ "@vaadin/avatar": "23.0.0-alpha3",
38
+ "@vaadin/component-base": "23.0.0-alpha3",
39
+ "@vaadin/item": "23.0.0-alpha3",
40
+ "@vaadin/list-box": "23.0.0-alpha3",
41
+ "@vaadin/vaadin-lumo-styles": "23.0.0-alpha3",
42
+ "@vaadin/vaadin-material-styles": "23.0.0-alpha3",
43
+ "@vaadin/vaadin-overlay": "23.0.0-alpha3",
44
+ "@vaadin/vaadin-themable-mixin": "23.0.0-alpha3"
46
45
  },
47
46
  "devDependencies": {
48
47
  "@esm-bundle/chai": "^4.3.4",
49
48
  "@vaadin/testing-helpers": "^0.3.2",
50
49
  "sinon": "^9.2.1"
51
50
  },
52
- "gitHead": "070f586dead02ca41b66717820c647f48bf1665f"
51
+ "gitHead": "490037919a9e054cc002c1b3be0c94a1603e1a44"
53
52
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
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) 2021 Vaadin Ltd.
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) 2021 Vaadin Ltd.
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) 2021 Vaadin Ltd.
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 { timeOut } from '@vaadin/component-base/src/async.js';
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
- /** @private */
344
+ /**
345
+ * @protected
346
+ * @override
347
+ */
362
348
  _onResize() {
363
- this.__debounceResize = Debouncer.debounce(this.__debounceResize, timeOut.after(0), () => {
364
- this.__setItemsInView();
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
- this.__announce(messages.join(', '));
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);