@vaadin/avatar-group 24.3.0-alpha2 → 24.3.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": "24.3.0-alpha2",
3
+ "version": "24.3.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,15 +37,15 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "24.3.0-alpha2",
41
- "@vaadin/avatar": "24.3.0-alpha2",
42
- "@vaadin/component-base": "24.3.0-alpha2",
43
- "@vaadin/item": "24.3.0-alpha2",
44
- "@vaadin/list-box": "24.3.0-alpha2",
45
- "@vaadin/overlay": "24.3.0-alpha2",
46
- "@vaadin/vaadin-lumo-styles": "24.3.0-alpha2",
47
- "@vaadin/vaadin-material-styles": "24.3.0-alpha2",
48
- "@vaadin/vaadin-themable-mixin": "24.3.0-alpha2",
40
+ "@vaadin/a11y-base": "24.3.0-alpha3",
41
+ "@vaadin/avatar": "24.3.0-alpha3",
42
+ "@vaadin/component-base": "24.3.0-alpha3",
43
+ "@vaadin/item": "24.3.0-alpha3",
44
+ "@vaadin/list-box": "24.3.0-alpha3",
45
+ "@vaadin/overlay": "24.3.0-alpha3",
46
+ "@vaadin/vaadin-lumo-styles": "24.3.0-alpha3",
47
+ "@vaadin/vaadin-material-styles": "24.3.0-alpha3",
48
+ "@vaadin/vaadin-themable-mixin": "24.3.0-alpha3",
49
49
  "lit": "^2.0.0"
50
50
  },
51
51
  "devDependencies": {
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "0fd437292fa2a2f65e29b424d2456909ad2d684b"
60
+ "gitHead": "9162ca5fb9879dbcc8c68a77c1acb3af2c497a15"
61
61
  }
@@ -26,6 +26,7 @@ export interface AvatarGroupItem {
26
26
  abbr?: string;
27
27
  img?: string;
28
28
  colorIndex?: number;
29
+ className?: string;
29
30
  }
30
31
 
31
32
  /**
@@ -79,7 +80,7 @@ declare class AvatarGroup extends ResizeMixin(
79
80
  * The items objects allow to configure [`name`](#/elements/vaadin-avatar#property-name),
80
81
  * [`abbr`](#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)
81
82
  * and [`colorIndex`](#/elements/vaadin-avatar#property-colorIndex) properties on the
82
- * stamped avatars.
83
+ * stamped avatars, and set `className` to provide CSS class names.
83
84
  *
84
85
  * #### Example
85
86
  *
@@ -87,11 +88,13 @@ declare class AvatarGroup extends ResizeMixin(
87
88
  * group.items = [
88
89
  * {
89
90
  * name: 'User name',
90
- * img: 'url-to-image.png'
91
+ * img: 'url-to-image.png',
92
+ * className: 'even'
91
93
  * },
92
94
  * {
93
95
  * abbr: 'JD',
94
- * colorIndex: 1
96
+ * colorIndex: 1,
97
+ * className: 'odd'
95
98
  * },
96
99
  * ];
97
100
  * ```
@@ -11,6 +11,7 @@ import { calculateSplices } from '@polymer/polymer/lib/utils/array-splice.js';
11
11
  import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
12
12
  import { html as legacyHtml, PolymerElement } from '@polymer/polymer/polymer-element.js';
13
13
  import { html, render } from 'lit';
14
+ import { ifDefined } from 'lit/directives/if-defined.js';
14
15
  import { announce } from '@vaadin/a11y-base/src/announce.js';
15
16
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
16
17
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
@@ -145,7 +146,7 @@ class AvatarGroup extends ResizeMixin(OverlayClassMixin(ElementMixin(ThemableMix
145
146
  * The items objects allow to configure [`name`](#/elements/vaadin-avatar#property-name),
146
147
  * [`abbr`](#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)
147
148
  * and [`colorIndex`](#/elements/vaadin-avatar#property-colorIndex) properties on the
148
- * stamped avatars.
149
+ * stamped avatars, and set `className` to provide CSS class names.
149
150
  *
150
151
  * #### Example
151
152
  *
@@ -153,11 +154,13 @@ class AvatarGroup extends ResizeMixin(OverlayClassMixin(ElementMixin(ThemableMix
153
154
  * group.items = [
154
155
  * {
155
156
  * name: 'User name',
156
- * img: 'url-to-image.png'
157
+ * img: 'url-to-image.png',
158
+ * className: 'even'
157
159
  * },
158
160
  * {
159
161
  * abbr: 'JD',
160
- * colorIndex: 1
162
+ * colorIndex: 1,
163
+ * className: 'odd'
161
164
  * },
162
165
  * ];
163
166
  * ```
@@ -368,6 +371,9 @@ class AvatarGroup extends ResizeMixin(OverlayClassMixin(ElementMixin(ThemableMix
368
371
  avatar.abbr = item.abbr;
369
372
  avatar.img = item.img;
370
373
  avatar.colorIndex = item.colorIndex;
374
+ if (item.className) {
375
+ avatar.className = item.className;
376
+ }
371
377
 
372
378
  if (item.name) {
373
379
  const text = document.createTextNode(item.name);
@@ -432,6 +438,7 @@ class AvatarGroup extends ResizeMixin(OverlayClassMixin(ElementMixin(ThemableMix
432
438
  .img="${item.img}"
433
439
  .colorIndex="${item.colorIndex}"
434
440
  .i18n="${this.i18n}"
441
+ class="${ifDefined(item.className)}"
435
442
  with-tooltip
436
443
  ></vaadin-avatar>
437
444
  `,
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/avatar-group",
4
- "version": "24.3.0-alpha2",
4
+ "version": "24.3.0-alpha3",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
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.3.0-alpha2/#/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.3.0-alpha2/#/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.3.0-alpha2/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha2/#/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.3.0-alpha2/#/elements/vaadin-item).",
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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/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.3.0-alpha3/#/elements/vaadin-item).",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "overlay-class",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  {
61
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.3.0-alpha2/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha2/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha2/#/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```",
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.3.0-alpha3/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/elements/vaadin-avatar#property-colorIndex) properties on the\nstamped avatars, and set `className` to provide CSS class names.\n\n#### Example\n\n```js\ngroup.items = [\n {\n name: 'User name',\n img: 'url-to-image.png',\n className: 'even'\n },\n {\n abbr: 'JD',\n colorIndex: 1,\n className: 'odd'\n },\n];\n```",
63
63
  "value": {
64
64
  "type": [
65
65
  "Array.<AvatarGroupItem>",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/avatar-group",
4
- "version": "24.3.0-alpha2",
4
+ "version": "24.3.0-alpha3",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
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.3.0-alpha2/#/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.3.0-alpha2/#/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.3.0-alpha2/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha2/#/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.3.0-alpha2/#/elements/vaadin-item).",
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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/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.3.0-alpha3/#/elements/vaadin-item).",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
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.3.0-alpha2/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha2/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha2/#/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```",
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.3.0-alpha3/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/elements/vaadin-avatar#property-colorIndex) properties on the\nstamped avatars, and set `className` to provide CSS class names.\n\n#### Example\n\n```js\ngroup.items = [\n {\n name: 'User name',\n img: 'url-to-image.png',\n className: 'even'\n },\n {\n abbr: 'JD',\n colorIndex: 1,\n className: 'odd'\n },\n];\n```",
32
32
  "value": {
33
33
  "kind": "expression"
34
34
  }