@vaadin/avatar-group 22.0.2 → 23.0.0-alpha4

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": "22.0.2",
3
+ "version": "23.0.0-alpha4",
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,22 +34,20 @@
33
34
  "polymer"
34
35
  ],
35
36
  "dependencies": {
36
- "@polymer/iron-a11y-announcer": "^3.0.0",
37
- "@polymer/iron-resizable-behavior": "^3.0.0",
38
37
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/avatar": "^22.0.2",
40
- "@vaadin/component-base": "^22.0.2",
41
- "@vaadin/item": "^22.0.2",
42
- "@vaadin/list-box": "^22.0.2",
43
- "@vaadin/vaadin-lumo-styles": "^22.0.2",
44
- "@vaadin/vaadin-material-styles": "^22.0.2",
45
- "@vaadin/vaadin-overlay": "^22.0.2",
46
- "@vaadin/vaadin-themable-mixin": "^22.0.2"
38
+ "@vaadin/avatar": "23.0.0-alpha4",
39
+ "@vaadin/component-base": "23.0.0-alpha4",
40
+ "@vaadin/item": "23.0.0-alpha4",
41
+ "@vaadin/list-box": "23.0.0-alpha4",
42
+ "@vaadin/vaadin-lumo-styles": "23.0.0-alpha4",
43
+ "@vaadin/vaadin-material-styles": "23.0.0-alpha4",
44
+ "@vaadin/vaadin-overlay": "23.0.0-alpha4",
45
+ "@vaadin/vaadin-themable-mixin": "23.0.0-alpha4"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@esm-bundle/chai": "^4.3.4",
50
49
  "@vaadin/testing-helpers": "^0.3.2",
51
50
  "sinon": "^9.2.1"
52
51
  },
53
- "gitHead": "df21370c4a655a38eac11f79686021ab3b0887ad"
52
+ "gitHead": "81e2deee5147bb7c1f4884760f4598613306f1fb"
54
53
  }
@@ -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,21 +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
- import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
12
- import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
13
11
  import { calculateSplices } from '@polymer/polymer/lib/utils/array-splice.js';
14
12
  import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
15
13
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
16
- import { timeOut } from '@vaadin/component-base/src/async.js';
17
- import { Debouncer } from '@vaadin/component-base/src/debounce.js';
14
+ import { announce } from '@vaadin/component-base/src/a11y-announcer.js';
18
15
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
16
+ import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
19
17
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
20
18
 
21
19
  const MINIMUM_DISPLAYED_AVATARS = 2;
@@ -60,8 +58,9 @@ const MINIMUM_DISPLAYED_AVATARS = 2;
60
58
  * @extends HTMLElement
61
59
  * @mixes ElementMixin
62
60
  * @mixes ThemableMixin
61
+ * @mixes ResizeMixin
63
62
  */
64
- class AvatarGroup extends ElementMixin(ThemableMixin(mixinBehaviors([IronResizableBehavior], PolymerElement))) {
63
+ class AvatarGroup extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
65
64
  static get template() {
66
65
  return html`
67
66
  <style>
@@ -280,12 +279,8 @@ class AvatarGroup extends ElementMixin(ThemableMixin(mixinBehaviors([IronResizab
280
279
  ready() {
281
280
  super.ready();
282
281
 
283
- IronA11yAnnouncer.requestAvailability();
284
-
285
282
  this.__boundSetPosition = this.__setPosition.bind(this);
286
283
 
287
- this.addEventListener('iron-resize', this._onResize.bind(this));
288
-
289
284
  this._overlayElement = this.shadowRoot.querySelector('vaadin-avatar-group-overlay');
290
285
 
291
286
  afterNextRender(this, () => {
@@ -314,19 +309,6 @@ class AvatarGroup extends ElementMixin(ThemableMixin(mixinBehaviors([IronResizab
314
309
  return this.shadowRoot.querySelectorAll('vaadin-avatar');
315
310
  }
316
311
 
317
- /** @private */
318
- __announce(text) {
319
- this.dispatchEvent(
320
- new CustomEvent('iron-announce', {
321
- bubbles: true,
322
- composed: true,
323
- detail: {
324
- text
325
- }
326
- })
327
- );
328
- }
329
-
330
312
  /** @private */
331
313
  __getMessage(user, action) {
332
314
  return action.replace('{user}', user.name || user.abbr || this.i18n.anonymous);
@@ -359,12 +341,13 @@ class AvatarGroup extends ElementMixin(ThemableMixin(mixinBehaviors([IronResizab
359
341
  }
360
342
  }
361
343
 
362
- /** @private */
344
+ /**
345
+ * @protected
346
+ * @override
347
+ */
363
348
  _onResize() {
364
- this.__debounceResize = Debouncer.debounce(this.__debounceResize, timeOut.after(0), () => {
365
- this.__setItemsInView();
366
- this.__setPosition();
367
- });
349
+ this.__setItemsInView();
350
+ this.__setPosition();
368
351
  }
369
352
 
370
353
  /** @private */
@@ -476,7 +459,7 @@ class AvatarGroup extends ElementMixin(ThemableMixin(mixinBehaviors([IronResizab
476
459
 
477
460
  const messages = removedMsg.concat(addedMsg);
478
461
  if (messages.length > 0) {
479
- this.__announce(messages.join(', '));
462
+ announce(messages.join(', '));
480
463
  }
481
464
  }
482
465