@vaadin/item 24.8.0-alpha9 → 25.0.0-alpha1
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/README.md +0 -23
- package/package.json +11 -12
- package/src/vaadin-item-base-styles.d.ts +8 -0
- package/src/vaadin-item-base-styles.js +59 -0
- package/src/vaadin-item-core-styles.d.ts +8 -0
- package/src/vaadin-item-core-styles.js +16 -0
- package/src/vaadin-item.js +14 -16
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/vaadin-lit-item.d.ts +0 -1
- package/src/vaadin-lit-item.js +0 -59
- package/theme/lumo/vaadin-lit-item.d.ts +0 -2
- package/theme/lumo/vaadin-lit-item.js +0 -2
- package/theme/material/vaadin-item-styles.d.ts +0 -5
- package/theme/material/vaadin-item-styles.js +0 -73
- package/theme/material/vaadin-item.d.ts +0 -2
- package/theme/material/vaadin-item.js +0 -2
- package/theme/material/vaadin-lit-item.d.ts +0 -2
- package/theme/material/vaadin-lit-item.js +0 -2
- package/vaadin-lit-item.d.ts +0 -1
- package/vaadin-lit-item.js +0 -2
package/README.md
CHANGED
|
@@ -26,29 +26,6 @@ Once installed, import the component in your application:
|
|
|
26
26
|
import '@vaadin/item';
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
## Themes
|
|
30
|
-
|
|
31
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
32
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/item/vaadin-item.js) of the package uses Lumo theme.
|
|
33
|
-
|
|
34
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
import '@vaadin/item/theme/material/vaadin-item.js';
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
You can also import the Lumo version of the component explicitly:
|
|
41
|
-
|
|
42
|
-
```js
|
|
43
|
-
import '@vaadin/item/theme/lumo/vaadin-item.js';
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
import '@vaadin/item/src/vaadin-item.js';
|
|
50
|
-
```
|
|
51
|
-
|
|
52
29
|
## Contributing
|
|
53
30
|
|
|
54
31
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/item",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha1",
|
|
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/*-base-styles.d.ts",
|
|
25
|
+
"!src/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -31,22 +33,19 @@
|
|
|
31
33
|
"Vaadin",
|
|
32
34
|
"vaadin-item",
|
|
33
35
|
"web-components",
|
|
34
|
-
"web-component"
|
|
35
|
-
"polymer"
|
|
36
|
+
"web-component"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/vaadin-
|
|
43
|
-
"@vaadin/vaadin-material-styles": "24.8.0-alpha9",
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha1",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha1",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha1",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
|
|
45
44
|
"lit": "^3.0.0"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@vaadin/chai-plugins": "
|
|
49
|
-
"@vaadin/test-runner-commands": "
|
|
47
|
+
"@vaadin/chai-plugins": "25.0.0-alpha1",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha1",
|
|
50
49
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
51
50
|
"sinon": "^18.0.0"
|
|
52
51
|
},
|
|
@@ -54,5 +53,5 @@
|
|
|
54
53
|
"web-types.json",
|
|
55
54
|
"web-types.lit.json"
|
|
56
55
|
],
|
|
57
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
|
|
58
57
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 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 itemStyles = css`
|
|
10
|
+
@layer base {
|
|
11
|
+
:host {
|
|
12
|
+
align-items: center;
|
|
13
|
+
border-radius: var(--vaadin-item-border-radius, var(--_vaadin-radius-m));
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
16
|
+
display: flex;
|
|
17
|
+
gap: var(--vaadin-item-gap, 0 var(--_vaadin-gap-container-inline));
|
|
18
|
+
height: var(--vaadin-item-height, auto);
|
|
19
|
+
padding: var(--vaadin-item-padding, var(--_vaadin-padding-container));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([focused]) {
|
|
23
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
24
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) / -1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([disabled]) {
|
|
28
|
+
cursor: var(--vaadin-disabled-cursor);
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([hidden]) {
|
|
33
|
+
display: none !important;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[part='checkmark'] {
|
|
37
|
+
color: var(--vaadin-item-checkmark-color, inherit);
|
|
38
|
+
display: var(--vaadin-item-checkmark-display, none);
|
|
39
|
+
visibility: hidden;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[part='checkmark']::before {
|
|
43
|
+
content: '';
|
|
44
|
+
display: block;
|
|
45
|
+
background: currentColor;
|
|
46
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
47
|
+
mask-image: var(--_vaadin-icon-checkmark);
|
|
48
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([selected]) [part='checkmark'] {
|
|
52
|
+
visibility: visible;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[part='content'] {
|
|
56
|
+
flex: 1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 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 itemStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: inline-block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([hidden]) {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
`;
|
package/src/vaadin-item.js
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 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 { html,
|
|
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
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
+
import { itemStyles } from './vaadin-item-core-styles.js';
|
|
10
12
|
import { ItemMixin } from './vaadin-item-mixin.js';
|
|
11
13
|
|
|
12
14
|
/**
|
|
@@ -53,18 +55,18 @@ import { ItemMixin } from './vaadin-item-mixin.js';
|
|
|
53
55
|
* @mixes ThemableMixin
|
|
54
56
|
* @mixes DirMixin
|
|
55
57
|
*/
|
|
56
|
-
class Item extends ItemMixin(ThemableMixin(DirMixin(
|
|
57
|
-
static get
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
class Item extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
59
|
+
static get is() {
|
|
60
|
+
return 'vaadin-item';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static get styles() {
|
|
64
|
+
return itemStyles;
|
|
65
|
+
}
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</style>
|
|
67
|
+
/** @protected */
|
|
68
|
+
render() {
|
|
69
|
+
return html`
|
|
68
70
|
<span part="checkmark" aria-hidden="true"></span>
|
|
69
71
|
<div part="content">
|
|
70
72
|
<slot></slot>
|
|
@@ -72,10 +74,6 @@ class Item extends ItemMixin(ThemableMixin(DirMixin(PolymerElement))) {
|
|
|
72
74
|
`;
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
static get is() {
|
|
76
|
-
return 'vaadin-item';
|
|
77
|
-
}
|
|
78
|
-
|
|
79
77
|
constructor() {
|
|
80
78
|
super();
|
|
81
79
|
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
package/src/vaadin-lit-item.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './vaadin-item.js';
|
package/src/vaadin-lit-item.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
import { ItemMixin } from './vaadin-item-mixin.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* LitElement based version of `<vaadin-item>` web component.
|
|
15
|
-
*
|
|
16
|
-
* ## Disclaimer
|
|
17
|
-
*
|
|
18
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
19
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
-
*/
|
|
22
|
-
class Item extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
23
|
-
static get is() {
|
|
24
|
-
return 'vaadin-item';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static get styles() {
|
|
28
|
-
return css`
|
|
29
|
-
:host {
|
|
30
|
-
display: inline-block;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:host([hidden]) {
|
|
34
|
-
display: none !important;
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** @protected */
|
|
40
|
-
render() {
|
|
41
|
-
return html`
|
|
42
|
-
<span part="checkmark" aria-hidden="true"></span>
|
|
43
|
-
<div part="content">
|
|
44
|
-
<slot></slot>
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** @protected */
|
|
50
|
-
ready() {
|
|
51
|
-
super.ready();
|
|
52
|
-
|
|
53
|
-
this.setAttribute('role', 'option');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
defineCustomElement(Item);
|
|
58
|
-
|
|
59
|
-
export { Item };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/font-icons.js';
|
|
2
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
3
|
-
import '@vaadin/vaadin-material-styles/typography.js';
|
|
4
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
|
-
|
|
6
|
-
const item = css`
|
|
7
|
-
:host {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
min-height: 36px;
|
|
12
|
-
padding: 8px 32px 8px 10px;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
font-family: var(--material-font-family);
|
|
15
|
-
font-size: var(--material-small-font-size);
|
|
16
|
-
line-height: 24px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* It's the list-box's responsibility to add the focus style */
|
|
20
|
-
:host([focused]) {
|
|
21
|
-
outline: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* Checkmark */
|
|
25
|
-
[part='checkmark']::before {
|
|
26
|
-
display: var(--_material-item-selected-icon-display, none);
|
|
27
|
-
content: '';
|
|
28
|
-
font-family: material-icons;
|
|
29
|
-
font-size: 24px;
|
|
30
|
-
line-height: 1;
|
|
31
|
-
font-weight: 400;
|
|
32
|
-
width: 24px;
|
|
33
|
-
text-align: center;
|
|
34
|
-
margin-right: 10px;
|
|
35
|
-
color: var(--material-secondary-text-color);
|
|
36
|
-
flex: none;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host([selected]) [part='checkmark']::before {
|
|
40
|
-
content: var(--material-icons-check);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@media (any-hover: hover) {
|
|
44
|
-
:host(:hover:not([disabled])) {
|
|
45
|
-
background-color: var(--material-secondary-background-color);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host([focused]:not([disabled])) {
|
|
50
|
-
background-color: var(--material-divider-color);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* Disabled */
|
|
54
|
-
:host([disabled]) {
|
|
55
|
-
color: var(--material-disabled-text-color);
|
|
56
|
-
cursor: default;
|
|
57
|
-
pointer-events: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* RTL specific styles */
|
|
61
|
-
:host([dir='rtl']) {
|
|
62
|
-
padding: 8px 10px 8px 32px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:host([dir='rtl']) [part='checkmark']::before {
|
|
66
|
-
margin-right: 0;
|
|
67
|
-
margin-left: 10px;
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
|
|
71
|
-
registerStyles('vaadin-item', item, { moduleId: 'material-item' });
|
|
72
|
-
|
|
73
|
-
export { item };
|
package/vaadin-lit-item.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-item.js';
|
package/vaadin-lit-item.js
DELETED