@vaadin/avatar-group 25.0.0-alpha1 → 25.0.0-alpha10
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 +16 -14
- package/src/styles/vaadin-avatar-group-base-styles.js +63 -0
- package/src/styles/vaadin-avatar-group-core-styles.d.ts +8 -0
- package/src/{vaadin-avatar-group-styles.js → styles/vaadin-avatar-group-core-styles.js} +6 -13
- package/src/styles/vaadin-avatar-group-menu-base-styles.js +21 -0
- package/src/styles/vaadin-avatar-group-menu-core-styles.js +8 -0
- package/src/styles/vaadin-avatar-group-menu-item-base-styles.js +17 -0
- package/src/styles/vaadin-avatar-group-menu-item-core-styles.js +8 -0
- package/src/vaadin-avatar-group-menu-item.js +5 -11
- package/src/vaadin-avatar-group-menu.js +5 -18
- package/src/vaadin-avatar-group-mixin.js +106 -145
- package/src/vaadin-avatar-group-overlay.js +5 -3
- package/src/vaadin-avatar-group.d.ts +4 -2
- package/src/vaadin-avatar-group.js +12 -5
- package/web-types.json +3 -3
- package/web-types.lit.json +3 -3
- /package/src/{vaadin-avatar-group-styles.d.ts → styles/vaadin-avatar-group-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/avatar-group",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/styles/*-base-styles.d.ts",
|
|
25
|
+
"!src/styles/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -36,26 +38,26 @@
|
|
|
36
38
|
],
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
40
|
-
"@vaadin/avatar": "25.0.0-
|
|
41
|
-
"@vaadin/component-base": "25.0.0-
|
|
42
|
-
"@vaadin/item": "25.0.0-
|
|
43
|
-
"@vaadin/list-box": "25.0.0-
|
|
44
|
-
"@vaadin/overlay": "25.0.0-
|
|
45
|
-
"@vaadin/tooltip": "25.0.0-
|
|
46
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
41
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/avatar": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
44
|
+
"@vaadin/item": "25.0.0-alpha10",
|
|
45
|
+
"@vaadin/list-box": "25.0.0-alpha10",
|
|
46
|
+
"@vaadin/overlay": "25.0.0-alpha10",
|
|
47
|
+
"@vaadin/tooltip": "25.0.0-alpha10",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
48
50
|
"lit": "^3.0.0"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
52
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
53
|
-
"@vaadin/testing-helpers": "^
|
|
53
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
54
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
55
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
54
56
|
"sinon": "^18.0.0"
|
|
55
57
|
},
|
|
56
58
|
"web-types": [
|
|
57
59
|
"web-types.json",
|
|
58
60
|
"web-types.lit.json"
|
|
59
61
|
],
|
|
60
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
61
63
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const avatarGroupStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
width: 100%; /* prevent collapsing inside non-stretching column flex */
|
|
13
|
+
/* 1: last on top */
|
|
14
|
+
/* -1: first on top */
|
|
15
|
+
--_dir: 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([theme~='reverse']) {
|
|
19
|
+
--_dir: -1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([hidden]) {
|
|
23
|
+
display: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part='container'] {
|
|
27
|
+
display: flex;
|
|
28
|
+
position: relative;
|
|
29
|
+
width: 100%;
|
|
30
|
+
flex-wrap: nowrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
::slotted(vaadin-avatar) {
|
|
34
|
+
mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M300 0H0V300H300V0ZM150 200C177.614 200 200 177.614 200 150C200 122.386 177.614 100 150 100C122.386 100 100 122.386 100 150C100 177.614 122.386 200 150 200Z" fill="black"/></svg>');
|
|
35
|
+
mask-size: calc(300% + var(--vaadin-avatar-group-gap, 2px) * 6 - var(--vaadin-focus-ring-width) * 6);
|
|
36
|
+
mask-position: calc(
|
|
37
|
+
50% +
|
|
38
|
+
(
|
|
39
|
+
var(--vaadin-avatar-size, 32px) - var(--vaadin-avatar-group-overlap, 8px) +
|
|
40
|
+
var(--vaadin-avatar-group-gap, 2px)
|
|
41
|
+
) *
|
|
42
|
+
var(--_d)
|
|
43
|
+
);
|
|
44
|
+
--_d: var(--_dir);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host(:dir(rtl)) ::slotted(vaadin-avatar) {
|
|
48
|
+
--_d: calc(var(--_dir) * -1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
::slotted(vaadin-avatar:not(:first-of-type)) {
|
|
52
|
+
margin-inline-start: calc(
|
|
53
|
+
var(--vaadin-avatar-group-overlap, 8px) * -1 - var(--vaadin-focus-ring-width) +
|
|
54
|
+
var(--vaadin-avatar-group-gap, 2px)
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host(:not([theme~='reverse'])) ::slotted(vaadin-avatar:last-child),
|
|
59
|
+
:host(:not([theme~='reverse']):not([has-overflow])) ::slotted(vaadin-avatar:nth-last-child(2)),
|
|
60
|
+
:host([theme~='reverse']) ::slotted(vaadin-avatar:first-of-type) {
|
|
61
|
+
mask-image: none;
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { css } from '
|
|
6
|
+
import { css } from 'lit';
|
|
7
7
|
|
|
8
8
|
export const avatarGroupStyles = css`
|
|
9
9
|
:host {
|
|
10
10
|
display: block;
|
|
11
11
|
width: 100%; /* prevent collapsing inside non-stretching column flex */
|
|
12
12
|
--vaadin-avatar-group-overlap: 8px;
|
|
13
|
-
|
|
13
|
+
/* Deprecated property name (overlap-border), for backwards compatibility */
|
|
14
|
+
--vaadin-avatar-group-overlap-border: var(--vaadin-avatar-group-gap, 2px);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
:host([hidden]) {
|
|
@@ -24,26 +25,18 @@ export const avatarGroupStyles = css`
|
|
|
24
25
|
flex-wrap: nowrap;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
::slotted(vaadin-avatar:not(:first-
|
|
28
|
-
-webkit-mask-image: url('data:image/svg+xml;utf8,<svg viewBox=%220 0 300 300%22 fill=%22none%22 xmlns=%22http://www.w3.org/2000/svg%22><path fill-rule=%22evenodd%22 clip-rule=%22evenodd%22 d=%22M300 0H0V300H300V0ZM150 200C177.614 200 200 177.614 200 150C200 122.386 177.614 100 150 100C122.386 100 100 122.386 100 150C100 177.614 122.386 200 150 200Z%22 fill=%22black%22/></svg>');
|
|
28
|
+
::slotted(vaadin-avatar:not(:first-of-type)) {
|
|
29
29
|
mask-image: url('data:image/svg+xml;utf8,<svg viewBox=%220 0 300 300%22 fill=%22none%22 xmlns=%22http://www.w3.org/2000/svg%22><path fill-rule=%22evenodd%22 clip-rule=%22evenodd%22 d=%22M300 0H0V300H300V0ZM150 200C177.614 200 200 177.614 200 150C200 122.386 177.614 100 150 100C122.386 100 100 122.386 100 150C100 177.614 122.386 200 150 200Z%22 fill=%22black%22/></svg>');
|
|
30
|
-
-webkit-mask-size: calc(
|
|
31
|
-
300% + var(--vaadin-avatar-group-overlap-border) * 6 - var(--vaadin-avatar-outline-width) * 6
|
|
32
|
-
);
|
|
33
30
|
mask-size: calc(300% + var(--vaadin-avatar-group-overlap-border) * 6 - var(--vaadin-avatar-outline-width) * 6);
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
::slotted(vaadin-avatar:not([dir='rtl']):not(:first-
|
|
33
|
+
::slotted(vaadin-avatar:not([dir='rtl']):not(:first-of-type)) {
|
|
37
34
|
margin-left: calc(var(--vaadin-avatar-group-overlap) * -1 - var(--vaadin-avatar-outline-width));
|
|
38
|
-
-webkit-mask-position: calc(50% - var(--vaadin-avatar-size) + var(--vaadin-avatar-group-overlap));
|
|
39
35
|
mask-position: calc(50% - var(--vaadin-avatar-size) + var(--vaadin-avatar-group-overlap));
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
::slotted(vaadin-avatar[dir='rtl']:not(:first-
|
|
38
|
+
::slotted(vaadin-avatar[dir='rtl']:not(:first-of-type)) {
|
|
43
39
|
margin-right: calc(var(--vaadin-avatar-group-overlap) * -1);
|
|
44
|
-
-webkit-mask-position: calc(
|
|
45
|
-
50% + var(--vaadin-avatar-size) - var(--vaadin-avatar-group-overlap) + var(--vaadin-avatar-outline-width)
|
|
46
|
-
);
|
|
47
40
|
mask-position: calc(
|
|
48
41
|
50% + var(--vaadin-avatar-size) - var(--vaadin-avatar-group-overlap) + var(--vaadin-avatar-outline-width)
|
|
49
42
|
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const avatarGroupMenuStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
padding: var(--vaadin-item-overlay-padding, 4px);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[part='items'] {
|
|
19
|
+
display: contents;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { listBoxStyles } from '@vaadin/list-box/src/styles/vaadin-list-box-core-styles.js';
|
|
7
|
+
|
|
8
|
+
export { listBoxStyles as avatarGroupMenuStyles };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-base-styles.js';
|
|
8
|
+
|
|
9
|
+
const menuItemStyles = css`
|
|
10
|
+
[part='content'] {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: inherit;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export const avatarGroupMenuItemStyles = [itemStyles, menuItemStyles];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js';
|
|
7
|
+
|
|
8
|
+
export const avatarGroupMenuItemStyles = itemStyles;
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
10
|
import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { avatarGroupMenuItemStyles } from './styles/vaadin-avatar-group-menu-item-core-styles.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* An element used internally by `<vaadin-avatar-group>`. Not intended to be used separately.
|
|
@@ -20,21 +22,13 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
20
22
|
* @mixes ThemableMixin
|
|
21
23
|
* @protected
|
|
22
24
|
*/
|
|
23
|
-
class AvatarGroupMenuItem extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
25
|
+
class AvatarGroupMenuItem extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
24
26
|
static get is() {
|
|
25
27
|
return 'vaadin-avatar-group-menu-item';
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
static get styles() {
|
|
29
|
-
return
|
|
30
|
-
:host {
|
|
31
|
-
display: inline-block;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([hidden]) {
|
|
35
|
-
display: none !important;
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
31
|
+
return avatarGroupMenuItemStyles;
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
/** @protected */
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { ListMixin } from '@vaadin/a11y-base/src/list-mixin.js';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { avatarGroupMenuStyles } from './styles/vaadin-avatar-group-menu-core-styles.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* An element used internally by `<vaadin-avatar-group>`. Not intended to be used separately.
|
|
@@ -20,28 +22,13 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
20
22
|
* @mixes ThemableMixin
|
|
21
23
|
* @protected
|
|
22
24
|
*/
|
|
23
|
-
class AvatarGroupMenu extends ListMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
25
|
+
class AvatarGroupMenu extends ListMixin(ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
24
26
|
static get is() {
|
|
25
27
|
return 'vaadin-avatar-group-menu';
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
static get styles() {
|
|
29
|
-
return
|
|
30
|
-
:host {
|
|
31
|
-
display: flex;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([hidden]) {
|
|
35
|
-
display: none !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[part='items'] {
|
|
39
|
-
height: 100%;
|
|
40
|
-
width: 100%;
|
|
41
|
-
overflow-y: auto;
|
|
42
|
-
-webkit-overflow-scrolling: touch;
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
31
|
+
return avatarGroupMenuStyles;
|
|
45
32
|
}
|
|
46
33
|
|
|
47
34
|
static get properties() {
|
|
@@ -64,7 +64,6 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
64
64
|
*/
|
|
65
65
|
items: {
|
|
66
66
|
type: Array,
|
|
67
|
-
observer: '__itemsChanged',
|
|
68
67
|
sync: true,
|
|
69
68
|
},
|
|
70
69
|
|
|
@@ -79,13 +78,6 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
79
78
|
sync: true,
|
|
80
79
|
},
|
|
81
80
|
|
|
82
|
-
/** @private */
|
|
83
|
-
_avatars: {
|
|
84
|
-
type: Array,
|
|
85
|
-
value: () => [],
|
|
86
|
-
sync: true,
|
|
87
|
-
},
|
|
88
|
-
|
|
89
81
|
/** @private */
|
|
90
82
|
__itemsInView: {
|
|
91
83
|
type: Number,
|
|
@@ -93,23 +85,14 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
93
85
|
sync: true,
|
|
94
86
|
},
|
|
95
87
|
|
|
96
|
-
/** @private */
|
|
97
|
-
_overflow: {
|
|
98
|
-
type: Object,
|
|
99
|
-
sync: true,
|
|
100
|
-
},
|
|
101
|
-
|
|
102
88
|
/** @private */
|
|
103
89
|
_overflowItems: {
|
|
104
90
|
type: Array,
|
|
105
|
-
observer: '__overflowItemsChanged',
|
|
106
|
-
computed: '__computeOverflowItems(items, __itemsInView, maxItemsVisible)',
|
|
107
91
|
},
|
|
108
92
|
|
|
109
93
|
/** @private */
|
|
110
|
-
|
|
111
|
-
type:
|
|
112
|
-
sync: true,
|
|
94
|
+
_overflowLimit: {
|
|
95
|
+
type: Number,
|
|
113
96
|
},
|
|
114
97
|
|
|
115
98
|
/** @private */
|
|
@@ -120,17 +103,6 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
120
103
|
};
|
|
121
104
|
}
|
|
122
105
|
|
|
123
|
-
static get observers() {
|
|
124
|
-
return [
|
|
125
|
-
'__i18nItemsChanged(__effectiveI18n, items)',
|
|
126
|
-
'__openedChanged(_opened, _overflow)',
|
|
127
|
-
'__updateAvatarsTheme(_overflow, _avatars, _theme)',
|
|
128
|
-
'__updateAvatars(items, __itemsInView, maxItemsVisible, _overflow, __effectiveI18n)',
|
|
129
|
-
'__updateOverflowAvatar(_overflow, items, __itemsInView, maxItemsVisible)',
|
|
130
|
-
'__updateOverflowTooltip(_overflowTooltip, items, __itemsInView, maxItemsVisible)',
|
|
131
|
-
];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
106
|
/**
|
|
135
107
|
* The object used to localize this component. To change the default
|
|
136
108
|
* localization, replace this with an object that provides all properties, or
|
|
@@ -167,10 +139,22 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
167
139
|
super.i18n = value;
|
|
168
140
|
}
|
|
169
141
|
|
|
142
|
+
/** @protected */
|
|
143
|
+
get _avatars() {
|
|
144
|
+
return [...this.children].filter((node) => node.localName === 'vaadin-avatar');
|
|
145
|
+
}
|
|
146
|
+
|
|
170
147
|
/** @protected */
|
|
171
148
|
ready() {
|
|
172
149
|
super.ready();
|
|
173
150
|
|
|
151
|
+
this._menuController = new SlotController(this, 'overlay', 'vaadin-avatar-group-menu', {
|
|
152
|
+
initializer: (menu) => {
|
|
153
|
+
menu.addEventListener('keydown', this._onListKeyDown.bind(this));
|
|
154
|
+
this._menuElement = menu;
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
174
158
|
this._overflowController = new SlotController(this, 'overflow', 'vaadin-avatar', {
|
|
175
159
|
initializer: (overflow) => {
|
|
176
160
|
overflow.setAttribute('role', 'button');
|
|
@@ -187,11 +171,11 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
187
171
|
this._overflowTooltip = tooltip;
|
|
188
172
|
},
|
|
189
173
|
});
|
|
174
|
+
|
|
175
|
+
this.addController(this._menuController);
|
|
190
176
|
this.addController(this._overflowController);
|
|
191
177
|
|
|
192
|
-
|
|
193
|
-
overlay.renderer = this.__overlayRenderer.bind(this);
|
|
194
|
-
this._overlayElement = overlay;
|
|
178
|
+
this._overlayElement = this.$.overlay;
|
|
195
179
|
}
|
|
196
180
|
|
|
197
181
|
/** @protected */
|
|
@@ -201,65 +185,92 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
201
185
|
this._opened = false;
|
|
202
186
|
}
|
|
203
187
|
|
|
204
|
-
/** @
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
*/
|
|
215
|
-
__overlayRenderer(root) {
|
|
216
|
-
let menu = root.firstElementChild;
|
|
217
|
-
if (!menu) {
|
|
218
|
-
menu = document.createElement('vaadin-avatar-group-menu');
|
|
219
|
-
menu.addEventListener('keydown', (event) => this._onListKeyDown(event));
|
|
220
|
-
root.appendChild(menu);
|
|
188
|
+
/** @protected */
|
|
189
|
+
willUpdate(props) {
|
|
190
|
+
super.willUpdate(props);
|
|
191
|
+
|
|
192
|
+
if (props.has('items') || props.has('__itemsInView') || props.has('maxItemsVisible')) {
|
|
193
|
+
// Calculate overflow limit only once to reuse it in updated() observers
|
|
194
|
+
const count = Array.isArray(this.items) ? this.items.length : 0;
|
|
195
|
+
const limit = this.__getLimit(count, this.__itemsInView, this.maxItemsVisible);
|
|
196
|
+
this._overflowLimit = limit;
|
|
197
|
+
this._overflowItems = limit ? this.items.slice(limit) : [];
|
|
221
198
|
}
|
|
199
|
+
}
|
|
222
200
|
|
|
223
|
-
|
|
201
|
+
/** @protected */
|
|
202
|
+
updated(props) {
|
|
203
|
+
super.updated(props);
|
|
224
204
|
|
|
225
|
-
if (
|
|
226
|
-
|
|
205
|
+
if (props.has('items')) {
|
|
206
|
+
this.__itemsChanged(this.items, props.get('items'));
|
|
227
207
|
}
|
|
228
208
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
/** @private */
|
|
235
|
-
__createItemElement(item) {
|
|
236
|
-
const itemElement = document.createElement('vaadin-avatar-group-menu-item');
|
|
209
|
+
if (props.has('items') || props.has('_overflowLimit') || props.has('__effectiveI18n') || props.has('_theme')) {
|
|
210
|
+
const limit = this._overflowLimit;
|
|
211
|
+
this.__renderAvatars(limit ? this.items.slice(0, limit) : this.items || []);
|
|
212
|
+
}
|
|
237
213
|
|
|
238
|
-
|
|
239
|
-
|
|
214
|
+
if (props.has('items') || props.has('_overflowLimit')) {
|
|
215
|
+
this.__updateOverflowTooltip(this.items, this._overflowLimit);
|
|
216
|
+
this.__updateOverflowAvatar(this.items, this._overflowLimit, this.__itemsInView);
|
|
217
|
+
}
|
|
240
218
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
219
|
+
if (props.has('__effectiveI18n') || props.has('items')) {
|
|
220
|
+
this.__i18nItemsChanged(this.__effectiveI18n, this.items);
|
|
221
|
+
}
|
|
244
222
|
|
|
245
|
-
if (
|
|
246
|
-
|
|
223
|
+
if (props.has('_opened')) {
|
|
224
|
+
this.__openedChanged(this._opened, props.get('_opened'));
|
|
247
225
|
}
|
|
248
226
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
227
|
+
if (props.has('_theme')) {
|
|
228
|
+
if (this._theme) {
|
|
229
|
+
this._overflow.setAttribute('theme', this._theme);
|
|
230
|
+
} else {
|
|
231
|
+
this._overflow.removeAttribute('theme');
|
|
232
|
+
}
|
|
255
233
|
}
|
|
256
234
|
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
itemElement.appendChild(text);
|
|
235
|
+
if (props.has('_overflowItems') || props.has('__effectiveI18n') || props.has('_theme')) {
|
|
236
|
+
this.__renderMenu();
|
|
260
237
|
}
|
|
238
|
+
}
|
|
261
239
|
|
|
262
|
-
|
|
240
|
+
/** @private */
|
|
241
|
+
__getMessage(user, action) {
|
|
242
|
+
return action.replace('{user}', user.name || user.abbr || this.__effectiveI18n.anonymous);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Renders items when they are provided by the `items` property and clears the content otherwise.
|
|
247
|
+
* @private
|
|
248
|
+
*/
|
|
249
|
+
__renderMenu() {
|
|
250
|
+
render(
|
|
251
|
+
html`
|
|
252
|
+
${(this._overflowItems || []).map(
|
|
253
|
+
(item) => html`
|
|
254
|
+
<vaadin-avatar-group-menu-item>
|
|
255
|
+
<vaadin-avatar
|
|
256
|
+
.name="${item.name}"
|
|
257
|
+
.abbr="${item.abbr}"
|
|
258
|
+
.img="${item.img}"
|
|
259
|
+
.colorIndex="${item.colorIndex}"
|
|
260
|
+
.i18n="${this.__effectiveI18n}"
|
|
261
|
+
class="${ifDefined(item.className)}"
|
|
262
|
+
theme="${ifDefined(this._theme)}"
|
|
263
|
+
aria-hidden="true"
|
|
264
|
+
tabindex="-1"
|
|
265
|
+
></vaadin-avatar>
|
|
266
|
+
${item.name || ''}
|
|
267
|
+
</vaadin-avatar-group-menu-item>
|
|
268
|
+
`,
|
|
269
|
+
)}
|
|
270
|
+
`,
|
|
271
|
+
this._menuElement,
|
|
272
|
+
{ host: this },
|
|
273
|
+
);
|
|
263
274
|
}
|
|
264
275
|
|
|
265
276
|
/** @private */
|
|
@@ -323,6 +334,7 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
323
334
|
.img="${item.img}"
|
|
324
335
|
.colorIndex="${item.colorIndex}"
|
|
325
336
|
.i18n="${this.__effectiveI18n}"
|
|
337
|
+
theme="${ifDefined(this._theme)}"
|
|
326
338
|
class="${ifDefined(item.className)}"
|
|
327
339
|
with-tooltip
|
|
328
340
|
></vaadin-avatar>
|
|
@@ -335,56 +347,25 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
335
347
|
}
|
|
336
348
|
|
|
337
349
|
/** @private */
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
const limit = this.__getLimit(items.length, itemsInView, maxItemsVisible);
|
|
344
|
-
|
|
345
|
-
this.__renderAvatars(limit ? items.slice(0, limit) : items);
|
|
346
|
-
|
|
347
|
-
this._avatars = [...this.querySelectorAll('vaadin-avatar')];
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/** @private */
|
|
351
|
-
__computeOverflowItems(items, itemsInView, maxItemsVisible) {
|
|
352
|
-
const count = Array.isArray(items) ? items.length : 0;
|
|
353
|
-
const limit = this.__getLimit(count, itemsInView, maxItemsVisible);
|
|
354
|
-
return limit ? items.slice(limit) : [];
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/** @private */
|
|
358
|
-
__updateOverflowAvatar(overflow, items, itemsInView, maxItemsVisible) {
|
|
350
|
+
__updateOverflowAvatar(items, limit, itemsInView) {
|
|
351
|
+
const overflow = this._overflow;
|
|
359
352
|
if (overflow) {
|
|
360
353
|
const count = Array.isArray(items) ? items.length : 0;
|
|
361
|
-
const maxReached = maxItemsVisible != null && count > this.__getMax(maxItemsVisible);
|
|
354
|
+
const maxReached = this.maxItemsVisible != null && count > this.__getMax(this.maxItemsVisible);
|
|
362
355
|
|
|
363
|
-
overflow.abbr = `+${count -
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
/** @private */
|
|
369
|
-
__updateAvatarsTheme(overflow, avatars, theme) {
|
|
370
|
-
if (overflow) {
|
|
371
|
-
[overflow, ...avatars].forEach((avatar) => {
|
|
372
|
-
if (theme) {
|
|
373
|
-
avatar.setAttribute('theme', theme);
|
|
374
|
-
} else {
|
|
375
|
-
avatar.removeAttribute('theme');
|
|
376
|
-
}
|
|
377
|
-
});
|
|
356
|
+
overflow.abbr = `+${count - limit}`;
|
|
357
|
+
const hasOverflow = maxReached || (itemsInView && itemsInView < count);
|
|
358
|
+
overflow.toggleAttribute('hidden', !hasOverflow);
|
|
359
|
+
this.toggleAttribute('has-overflow', hasOverflow);
|
|
378
360
|
}
|
|
379
361
|
}
|
|
380
362
|
|
|
381
363
|
/** @private */
|
|
382
|
-
__updateOverflowTooltip(
|
|
383
|
-
if (!
|
|
364
|
+
__updateOverflowTooltip(items, limit) {
|
|
365
|
+
if (!Array.isArray(items)) {
|
|
384
366
|
return;
|
|
385
367
|
}
|
|
386
368
|
|
|
387
|
-
const limit = this.__getLimit(items.length, itemsInView, maxItemsVisible);
|
|
388
369
|
if (limit == null) {
|
|
389
370
|
return;
|
|
390
371
|
}
|
|
@@ -397,7 +378,7 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
397
378
|
}
|
|
398
379
|
}
|
|
399
380
|
|
|
400
|
-
|
|
381
|
+
this._overflowTooltip.text = result.join('\n');
|
|
401
382
|
}
|
|
402
383
|
|
|
403
384
|
/** @private */
|
|
@@ -466,41 +447,21 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
466
447
|
if (effectiveI18n.activeUsers[field]) {
|
|
467
448
|
this.setAttribute('aria-label', effectiveI18n.activeUsers[field].replace('{count}', count || 0));
|
|
468
449
|
}
|
|
469
|
-
|
|
470
|
-
this._avatars.forEach((avatar) => {
|
|
471
|
-
avatar.i18n = effectiveI18n;
|
|
472
|
-
});
|
|
473
450
|
}
|
|
474
451
|
}
|
|
475
452
|
|
|
476
453
|
/** @private */
|
|
477
|
-
__openedChanged(opened,
|
|
478
|
-
if (!overflow) {
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
|
|
454
|
+
__openedChanged(opened, oldOpened) {
|
|
482
455
|
if (opened) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
this._openedWithFocusRing = overflow.hasAttribute('focus-ring');
|
|
488
|
-
} else if (this.__oldOpened) {
|
|
489
|
-
overflow.focus();
|
|
456
|
+
this._openedWithFocusRing = this._overflow.hasAttribute('focus-ring');
|
|
457
|
+
} else if (oldOpened) {
|
|
458
|
+
this._overflow.focus();
|
|
490
459
|
if (this._openedWithFocusRing) {
|
|
491
|
-
|
|
460
|
+
this._overflow.setAttribute('focus-ring', '');
|
|
492
461
|
}
|
|
493
462
|
}
|
|
494
463
|
|
|
495
|
-
|
|
496
|
-
this.__oldOpened = opened;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/** @private */
|
|
500
|
-
__overflowItemsChanged(items, oldItems) {
|
|
501
|
-
if (items || oldItems) {
|
|
502
|
-
this.$.overlay.requestContentUpdate();
|
|
503
|
-
}
|
|
464
|
+
this._overflow.setAttribute('aria-expanded', opened === true);
|
|
504
465
|
}
|
|
505
466
|
|
|
506
467
|
/** @private */
|
|
@@ -7,9 +7,10 @@ import { html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
|
|
10
11
|
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
11
12
|
import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
|
|
12
|
-
import {
|
|
13
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
13
14
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -23,7 +24,9 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
23
24
|
* @mixes ThemableMixin
|
|
24
25
|
* @private
|
|
25
26
|
*/
|
|
26
|
-
class AvatarGroupOverlay extends PositionMixin(
|
|
27
|
+
class AvatarGroupOverlay extends PositionMixin(
|
|
28
|
+
OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))),
|
|
29
|
+
) {
|
|
27
30
|
static get is() {
|
|
28
31
|
return 'vaadin-avatar-group-overlay';
|
|
29
32
|
}
|
|
@@ -35,7 +38,6 @@ class AvatarGroupOverlay extends PositionMixin(OverlayMixin(DirMixin(ThemableMix
|
|
|
35
38
|
/** @protected */
|
|
36
39
|
render() {
|
|
37
40
|
return html`
|
|
38
|
-
<div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
|
|
39
41
|
<div part="overlay" id="overlay" tabindex="0">
|
|
40
42
|
<div part="content" id="content">
|
|
41
43
|
<slot></slot>
|
|
@@ -15,13 +15,13 @@ export { AvatarGroupI18n, AvatarGroupItem, AvatarI18n };
|
|
|
15
15
|
*
|
|
16
16
|
* To create the avatar group, first add the component to the page:
|
|
17
17
|
*
|
|
18
|
-
* ```
|
|
18
|
+
* ```html
|
|
19
19
|
* <vaadin-avatar-group></vaadin-avatar-group>
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* And then use [`items`](#/elements/vaadin-avatar-group#property-items) property to initialize the structure:
|
|
23
23
|
*
|
|
24
|
-
* ```
|
|
24
|
+
* ```js
|
|
25
25
|
* document.querySelector('vaadin-avatar-group').items = [
|
|
26
26
|
* {name: 'John Doe'},
|
|
27
27
|
* {abbr: 'AB'}
|
|
@@ -35,6 +35,8 @@ export { AvatarGroupI18n, AvatarGroupItem, AvatarI18n };
|
|
|
35
35
|
* Part name | Description
|
|
36
36
|
* ----------- | ---------------
|
|
37
37
|
* `container` | The container element
|
|
38
|
+
* `overlay` | The overflow avatar menu overlay
|
|
39
|
+
* `content` | The overflow avatar menu overlay content
|
|
38
40
|
*
|
|
39
41
|
* See the [`<vaadin-avatar>`](#/elements/vaadin-avatar) documentation for the available
|
|
40
42
|
* state attributes and stylable shadow parts of avatar elements.
|
|
@@ -12,22 +12,23 @@ import { html, LitElement } from 'lit';
|
|
|
12
12
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
13
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
14
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
15
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
+
import { avatarGroupStyles } from './styles/vaadin-avatar-group-core-styles.js';
|
|
16
18
|
import { AvatarGroupMixin } from './vaadin-avatar-group-mixin.js';
|
|
17
|
-
import { avatarGroupStyles } from './vaadin-avatar-group-styles.js';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* `<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.
|
|
21
22
|
*
|
|
22
23
|
* To create the avatar group, first add the component to the page:
|
|
23
24
|
*
|
|
24
|
-
* ```
|
|
25
|
+
* ```html
|
|
25
26
|
* <vaadin-avatar-group></vaadin-avatar-group>
|
|
26
27
|
* ```
|
|
27
28
|
*
|
|
28
29
|
* And then use [`items`](#/elements/vaadin-avatar-group#property-items) property to initialize the structure:
|
|
29
30
|
*
|
|
30
|
-
* ```
|
|
31
|
+
* ```js
|
|
31
32
|
* document.querySelector('vaadin-avatar-group').items = [
|
|
32
33
|
* {name: 'John Doe'},
|
|
33
34
|
* {abbr: 'AB'}
|
|
@@ -41,6 +42,8 @@ import { avatarGroupStyles } from './vaadin-avatar-group-styles.js';
|
|
|
41
42
|
* Part name | Description
|
|
42
43
|
* ----------- | ---------------
|
|
43
44
|
* `container` | The container element
|
|
45
|
+
* `overlay` | The overflow avatar menu overlay
|
|
46
|
+
* `content` | The overflow avatar menu overlay content
|
|
44
47
|
*
|
|
45
48
|
* See the [`<vaadin-avatar>`](#/elements/vaadin-avatar) documentation for the available
|
|
46
49
|
* state attributes and stylable shadow parts of avatar elements.
|
|
@@ -62,7 +65,7 @@ import { avatarGroupStyles } from './vaadin-avatar-group-styles.js';
|
|
|
62
65
|
* @mixes AvatarGroupMixin
|
|
63
66
|
* @mixes ThemableMixin
|
|
64
67
|
*/
|
|
65
|
-
class AvatarGroup extends AvatarGroupMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
68
|
+
class AvatarGroup extends AvatarGroupMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
66
69
|
static get is() {
|
|
67
70
|
return 'vaadin-avatar-group';
|
|
68
71
|
}
|
|
@@ -80,13 +83,17 @@ class AvatarGroup extends AvatarGroupMixin(ElementMixin(ThemableMixin(PolylitMix
|
|
|
80
83
|
</div>
|
|
81
84
|
<vaadin-avatar-group-overlay
|
|
82
85
|
id="overlay"
|
|
86
|
+
.owner="${this}"
|
|
83
87
|
.opened="${this._opened}"
|
|
84
88
|
.positionTarget="${this._overflow}"
|
|
85
89
|
no-vertical-overlap
|
|
90
|
+
exportparts="overlay, content"
|
|
86
91
|
@vaadin-overlay-close="${this._onVaadinOverlayClose}"
|
|
87
92
|
@vaadin-overlay-open="${this._onVaadinOverlayOpen}"
|
|
88
93
|
@opened-changed="${this._onOpenedChanged}"
|
|
89
|
-
|
|
94
|
+
>
|
|
95
|
+
<slot name="overlay"></slot>
|
|
96
|
+
</vaadin-avatar-group-overlay>
|
|
90
97
|
`;
|
|
91
98
|
}
|
|
92
99
|
|
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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
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
|
|
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```html\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-avatar-group#property-items) property to initialize the structure:\n\n```js\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`overlay` | The overflow avatar menu overlay\n`content` | The overflow avatar menu overlay content\n\nSee the [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/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/25.0.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-list-box).\n- `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-item).",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "i18n",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"name": "items",
|
|
80
|
-
"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/25.0.0-
|
|
80
|
+
"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/25.0.0-alpha10/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/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```",
|
|
81
81
|
"value": {
|
|
82
82
|
"type": [
|
|
83
83
|
"Array.<AvatarGroupItem>",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/avatar-group",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
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
|
|
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```html\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-avatar-group#property-items) property to initialize the structure:\n\n```js\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`overlay` | The overflow avatar menu overlay\n`content` | The overflow avatar menu overlay content\n\nSee the [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/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/25.0.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-list-box).\n- `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-item).",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"name": ".items",
|
|
38
|
-
"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/25.0.0-
|
|
38
|
+
"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/25.0.0-alpha10/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/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```",
|
|
39
39
|
"value": {
|
|
40
40
|
"kind": "expression"
|
|
41
41
|
}
|
/package/src/{vaadin-avatar-group-styles.d.ts → styles/vaadin-avatar-group-base-styles.d.ts}
RENAMED
|
File without changes
|