@vaadin/avatar-group 24.2.0-dev.f254716fe → 24.2.0

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": "24.2.0-dev.f254716fe",
3
+ "version": "24.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,25 +37,25 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "24.2.0-dev.f254716fe",
41
- "@vaadin/avatar": "24.2.0-dev.f254716fe",
42
- "@vaadin/component-base": "24.2.0-dev.f254716fe",
43
- "@vaadin/item": "24.2.0-dev.f254716fe",
44
- "@vaadin/list-box": "24.2.0-dev.f254716fe",
45
- "@vaadin/overlay": "24.2.0-dev.f254716fe",
46
- "@vaadin/vaadin-lumo-styles": "24.2.0-dev.f254716fe",
47
- "@vaadin/vaadin-material-styles": "24.2.0-dev.f254716fe",
48
- "@vaadin/vaadin-themable-mixin": "24.2.0-dev.f254716fe",
40
+ "@vaadin/a11y-base": "~24.2.0",
41
+ "@vaadin/avatar": "~24.2.0",
42
+ "@vaadin/component-base": "~24.2.0",
43
+ "@vaadin/item": "~24.2.0",
44
+ "@vaadin/list-box": "~24.2.0",
45
+ "@vaadin/overlay": "~24.2.0",
46
+ "@vaadin/vaadin-lumo-styles": "~24.2.0",
47
+ "@vaadin/vaadin-material-styles": "~24.2.0",
48
+ "@vaadin/vaadin-themable-mixin": "~24.2.0",
49
49
  "lit": "^2.0.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@esm-bundle/chai": "^4.3.4",
53
- "@vaadin/testing-helpers": "^0.4.3",
53
+ "@vaadin/testing-helpers": "^0.5.0",
54
54
  "sinon": "^13.0.2"
55
55
  },
56
56
  "web-types": [
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "da54950b9f8c14c6451ede0d426e16a489c7fb9b"
60
+ "gitHead": "8b9e860d53fc0132d05d3e8701eeded2dca74eba"
61
61
  }
@@ -4,6 +4,7 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
7
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
8
9
  import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
9
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -11,6 +12,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
11
12
  /**
12
13
  * An element used internally by `<vaadin-avatar-group>`. Not intended to be used separately.
13
14
  *
15
+ * @customElement
14
16
  * @extends HTMLElement
15
17
  * @mixes DirMixin
16
18
  * @mixes ItemMixin
@@ -48,6 +50,6 @@ class AvatarGroupMenuItem extends ItemMixin(ThemableMixin(DirMixin(PolymerElemen
48
50
  }
49
51
  }
50
52
 
51
- customElements.define(AvatarGroupMenuItem.is, AvatarGroupMenuItem);
53
+ defineCustomElement(AvatarGroupMenuItem);
52
54
 
53
55
  export { AvatarGroupMenuItem };
@@ -6,12 +6,14 @@
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
7
  import { ListMixin } from '@vaadin/a11y-base/src/list-mixin.js';
8
8
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
9
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
10
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
12
 
12
13
  /**
13
14
  * An element used internally by `<vaadin-avatar-group>`. Not intended to be used separately.
14
15
  *
16
+ * @customElement
15
17
  * @extends HTMLElement
16
18
  * @mixes ControllerMixin
17
19
  * @mixes DirMixin
@@ -76,6 +78,6 @@ class AvatarGroupMenu extends ListMixin(ThemableMixin(DirMixin(ControllerMixin(P
76
78
  }
77
79
  }
78
80
 
79
- customElements.define(AvatarGroupMenu.is, AvatarGroupMenu);
81
+ defineCustomElement(AvatarGroupMenu);
80
82
 
81
83
  export { AvatarGroupMenu };
@@ -4,6 +4,7 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
7
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
8
9
  import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
9
10
  import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
@@ -17,7 +18,12 @@ registerStyles('vaadin-avatar-group-overlay', [overlayStyles], {
17
18
  /**
18
19
  * An element used internally by `<vaadin-avatar-group>`. Not intended to be used separately.
19
20
  *
20
- * @extends Overlay
21
+ * @customElement
22
+ * @extends HTMLElement
23
+ * @mixes PositionMixin
24
+ * @mixes OverlayMixin
25
+ * @mixes DirMixin
26
+ * @mixes ThemableMixin
21
27
  * @private
22
28
  */
23
29
  class AvatarGroupOverlay extends PositionMixin(OverlayMixin(DirMixin(ThemableMixin(PolymerElement)))) {
@@ -37,4 +43,4 @@ class AvatarGroupOverlay extends PositionMixin(OverlayMixin(DirMixin(ThemableMix
37
43
  }
38
44
  }
39
45
 
40
- customElements.define(AvatarGroupOverlay.is, AvatarGroupOverlay);
46
+ defineCustomElement(AvatarGroupOverlay);
@@ -13,6 +13,7 @@ import { html as legacyHtml, PolymerElement } from '@polymer/polymer/polymer-ele
13
13
  import { html, render } from 'lit';
14
14
  import { announce } from '@vaadin/a11y-base/src/announce.js';
15
15
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
16
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
16
17
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
17
18
  import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
18
19
  import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
@@ -61,6 +62,7 @@ const MINIMUM_DISPLAYED_AVATARS = 2;
61
62
  * - `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
62
63
  * - `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
63
64
  *
65
+ * @customElement
64
66
  * @extends HTMLElement
65
67
  * @mixes ControllerMixin
66
68
  * @mixes ElementMixin
@@ -667,6 +669,6 @@ class AvatarGroup extends ResizeMixin(OverlayClassMixin(ElementMixin(ThemableMix
667
669
  }
668
670
  }
669
671
 
670
- customElements.define(AvatarGroup.is, AvatarGroup);
672
+ defineCustomElement(AvatarGroup);
671
673
 
672
674
  export { AvatarGroup };
package/web-types.json ADDED
@@ -0,0 +1,97 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/avatar-group",
4
+ "version": "24.2.0",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "vaadin-avatar-group",
11
+ "description": "`<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.\n\nTo create the avatar group, first add the component to the page:\n\n```\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar-group#property-items) property to initialize the structure:\n\n```\ndocument.querySelector('vaadin-avatar-group').items = [\n {name: 'John Doe'},\n {abbr: 'AB'}\n];\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n----------- | ---------------\n`container` | The container element\n\nSee the [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar) documentation for the available\nstate attributes and stylable shadow parts of avatar elements.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-avatar-group>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-avatar-group-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-list-box).\n- `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-item).",
12
+ "attributes": [
13
+ {
14
+ "name": "overlay-class",
15
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
16
+ "value": {
17
+ "type": [
18
+ "string",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "name": "max-items-visible",
26
+ "description": "The maximum number of avatars to display. By default, all the avatars are displayed.\nWhen _maxItemsVisible_ is set, the overflowing avatars are grouped into one avatar with\na dropdown. Setting 0 or 1 has no effect so there are always at least two avatars visible.",
27
+ "value": {
28
+ "type": [
29
+ "number",
30
+ "null",
31
+ "undefined"
32
+ ]
33
+ }
34
+ },
35
+ {
36
+ "name": "theme",
37
+ "description": "The theme variants to apply to the component.",
38
+ "value": {
39
+ "type": [
40
+ "string",
41
+ "null",
42
+ "undefined"
43
+ ]
44
+ }
45
+ }
46
+ ],
47
+ "js": {
48
+ "properties": [
49
+ {
50
+ "name": "overlayClass",
51
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
52
+ "value": {
53
+ "type": [
54
+ "string",
55
+ "null",
56
+ "undefined"
57
+ ]
58
+ }
59
+ },
60
+ {
61
+ "name": "items",
62
+ "description": "An array containing the items which will be stamped as avatars.\n\nThe items objects allow to configure [`name`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar#property-colorIndex) properties on the\nstamped avatars.\n\n#### Example\n\n```js\ngroup.items = [\n {\n name: 'User name',\n img: 'url-to-image.png'\n },\n {\n abbr: 'JD',\n colorIndex: 1\n },\n];\n```",
63
+ "value": {
64
+ "type": [
65
+ "Array.<AvatarGroupItem>",
66
+ "undefined"
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "name": "maxItemsVisible",
72
+ "description": "The maximum number of avatars to display. By default, all the avatars are displayed.\nWhen _maxItemsVisible_ is set, the overflowing avatars are grouped into one avatar with\na dropdown. Setting 0 or 1 has no effect so there are always at least two avatars visible.",
73
+ "value": {
74
+ "type": [
75
+ "number",
76
+ "null",
77
+ "undefined"
78
+ ]
79
+ }
80
+ },
81
+ {
82
+ "name": "i18n",
83
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n_i18n_ object or just the property you want to modify.\n\nThe object has the following JSON structure and default values:\n```\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous',\n // Translation of the avatar group accessible label.\n // {count} is replaced with the actual count of users.\n activeUsers: {\n one: 'Currently one active user',\n many: 'Currently {count} active users'\n },\n // Screen reader announcement when user joins group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n joined: '{user} joined',\n // Screen reader announcement when user leaves group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n left: '{user} left'\n}\n```",
84
+ "value": {
85
+ "type": [
86
+ "AvatarGroupI18n"
87
+ ]
88
+ }
89
+ }
90
+ ],
91
+ "events": []
92
+ }
93
+ }
94
+ ]
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/avatar-group",
4
+ "version": "24.2.0",
5
+ "description-markup": "markdown",
6
+ "framework": "lit",
7
+ "framework-config": {
8
+ "enable-when": {
9
+ "node-packages": [
10
+ "lit"
11
+ ]
12
+ }
13
+ },
14
+ "contributions": {
15
+ "html": {
16
+ "elements": [
17
+ {
18
+ "name": "vaadin-avatar-group",
19
+ "description": "`<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.\n\nTo create the avatar group, first add the component to the page:\n\n```\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar-group#property-items) property to initialize the structure:\n\n```\ndocument.querySelector('vaadin-avatar-group').items = [\n {name: 'John Doe'},\n {abbr: 'AB'}\n];\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n----------- | ---------------\n`container` | The container element\n\nSee the [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar) documentation for the available\nstate attributes and stylable shadow parts of avatar elements.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-avatar-group>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-avatar-group-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-list-box).\n- `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-item).",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": ".overlayClass",
24
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": ".items",
31
+ "description": "An array containing the items which will be stamped as avatars.\n\nThe items objects allow to configure [`name`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/24.2.0/#/elements/vaadin-avatar#property-colorIndex) properties on the\nstamped avatars.\n\n#### Example\n\n```js\ngroup.items = [\n {\n name: 'User name',\n img: 'url-to-image.png'\n },\n {\n abbr: 'JD',\n colorIndex: 1\n },\n];\n```",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": ".maxItemsVisible",
38
+ "description": "The maximum number of avatars to display. By default, all the avatars are displayed.\nWhen _maxItemsVisible_ is set, the overflowing avatars are grouped into one avatar with\na dropdown. Setting 0 or 1 has no effect so there are always at least two avatars visible.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": ".i18n",
45
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n_i18n_ object or just the property you want to modify.\n\nThe object has the following JSON structure and default values:\n```\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous',\n // Translation of the avatar group accessible label.\n // {count} is replaced with the actual count of users.\n activeUsers: {\n one: 'Currently one active user',\n many: 'Currently {count} active users'\n },\n // Screen reader announcement when user joins group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n joined: '{user} joined',\n // Screen reader announcement when user leaves group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n left: '{user} left'\n}\n```",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ }
50
+ ]
51
+ }
52
+ ]
53
+ }
54
+ }
55
+ }