@vaadin/accordion 24.8.4 → 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/README.md +0 -23
- package/package.json +13 -14
- package/src/styles/vaadin-accordion-heading-base-styles.js +27 -0
- package/src/styles/vaadin-accordion-heading-core-styles.d.ts +8 -0
- package/src/styles/vaadin-accordion-panel-base-styles.js +28 -0
- package/src/styles/vaadin-accordion-panel-core-styles.d.ts +8 -0
- package/src/vaadin-accordion-heading.js +21 -28
- package/src/vaadin-accordion-panel.js +12 -9
- package/src/vaadin-accordion.d.ts +1 -10
- package/src/vaadin-accordion.js +19 -25
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-lit-accordion-heading.js +0 -73
- package/src/vaadin-lit-accordion-panel.js +0 -48
- package/src/vaadin-lit-accordion.js +0 -48
- package/theme/lumo/vaadin-lit-accordion-heading.d.ts +0 -2
- package/theme/lumo/vaadin-lit-accordion-heading.js +0 -2
- package/theme/lumo/vaadin-lit-accordion-panel.d.ts +0 -3
- package/theme/lumo/vaadin-lit-accordion-panel.js +0 -3
- package/theme/lumo/vaadin-lit-accordion.d.ts +0 -2
- package/theme/lumo/vaadin-lit-accordion.js +0 -2
- package/theme/material/vaadin-accordion-heading-styles.d.ts +0 -1
- package/theme/material/vaadin-accordion-heading-styles.js +0 -44
- package/theme/material/vaadin-accordion-heading.d.ts +0 -2
- package/theme/material/vaadin-accordion-heading.js +0 -2
- package/theme/material/vaadin-accordion-panel-styles.d.ts +0 -1
- package/theme/material/vaadin-accordion-panel-styles.js +0 -17
- package/theme/material/vaadin-accordion-panel.d.ts +0 -3
- package/theme/material/vaadin-accordion-panel.js +0 -3
- package/theme/material/vaadin-accordion.d.ts +0 -2
- package/theme/material/vaadin-accordion.js +0 -2
- package/theme/material/vaadin-lit-accordion-heading.d.ts +0 -2
- package/theme/material/vaadin-lit-accordion-heading.js +0 -2
- package/theme/material/vaadin-lit-accordion-panel.d.ts +0 -3
- package/theme/material/vaadin-lit-accordion-panel.js +0 -3
- package/theme/material/vaadin-lit-accordion.d.ts +0 -2
- package/theme/material/vaadin-lit-accordion.js +0 -2
- package/vaadin-lit-accordion-heading.d.ts +0 -1
- package/vaadin-lit-accordion-heading.js +0 -2
- package/vaadin-lit-accordion-panel.d.ts +0 -1
- package/vaadin-lit-accordion-panel.js +0 -2
- package/vaadin-lit-accordion.d.ts +0 -1
- package/vaadin-lit-accordion.js +0 -2
- /package/src/{vaadin-accordion-heading-core-styles.d.ts → styles/vaadin-accordion-heading-base-styles.d.ts} +0 -0
- /package/src/{vaadin-accordion-heading-core-styles.js → styles/vaadin-accordion-heading-core-styles.js} +0 -0
- /package/src/{vaadin-accordion-panel-core-styles.d.ts → styles/vaadin-accordion-panel-base-styles.d.ts} +0 -0
- /package/src/{vaadin-accordion-panel-core-styles.js → styles/vaadin-accordion-panel-core-styles.js} +0 -0
package/README.md
CHANGED
|
@@ -35,29 +35,6 @@ Once installed, import the component in your application:
|
|
|
35
35
|
import '@vaadin/accordion';
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
## Themes
|
|
39
|
-
|
|
40
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
41
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/accordion/vaadin-accordion.js) of the package uses the Lumo theme.
|
|
42
|
-
|
|
43
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
44
|
-
|
|
45
|
-
```js
|
|
46
|
-
import '@vaadin/accordion/theme/material/vaadin-accordion.js';
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
You can also import the Lumo version of the component explicitly:
|
|
50
|
-
|
|
51
|
-
```js
|
|
52
|
-
import '@vaadin/accordion/theme/lumo/vaadin-accordion.js';
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
56
|
-
|
|
57
|
-
```js
|
|
58
|
-
import '@vaadin/accordion/src/vaadin-accordion.js';
|
|
59
|
-
```
|
|
60
|
-
|
|
61
38
|
## Contributing
|
|
62
39
|
|
|
63
40
|
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/accordion",
|
|
3
|
-
"version": "
|
|
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",
|
|
@@ -31,29 +33,26 @@
|
|
|
31
33
|
"Vaadin",
|
|
32
34
|
"vaadin-accordion",
|
|
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/
|
|
43
|
-
"@vaadin/vaadin-
|
|
44
|
-
"@vaadin/vaadin-material-styles": "~24.8.4",
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "~24.8.4",
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/details": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
46
45
|
"lit": "^3.0.0"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "
|
|
50
|
-
"@vaadin/test-runner-commands": "
|
|
51
|
-
"@vaadin/testing-helpers": "^
|
|
48
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
49
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
50
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
51
|
"sinon": "^18.0.0"
|
|
53
52
|
},
|
|
54
53
|
"web-types": [
|
|
55
54
|
"web-types.json",
|
|
56
55
|
"web-types.lit.json"
|
|
57
56
|
],
|
|
58
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
59
58
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 - 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 { detailsSummary } from '@vaadin/details/src/styles/vaadin-details-summary-base-styles.js';
|
|
8
|
+
|
|
9
|
+
export const accordionHeading = [
|
|
10
|
+
detailsSummary('vaadin-accordion-heading'),
|
|
11
|
+
css`
|
|
12
|
+
button {
|
|
13
|
+
align-items: center;
|
|
14
|
+
appearance: none;
|
|
15
|
+
background: transparent;
|
|
16
|
+
border: 0;
|
|
17
|
+
color: inherit;
|
|
18
|
+
cursor: inherit;
|
|
19
|
+
display: flex;
|
|
20
|
+
font: inherit;
|
|
21
|
+
gap: inherit;
|
|
22
|
+
outline: none;
|
|
23
|
+
padding: 0;
|
|
24
|
+
touch-action: manipulation;
|
|
25
|
+
}
|
|
26
|
+
`,
|
|
27
|
+
];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 - 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 accordionPanel = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([hidden]) {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[part='content'] {
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host(:not([opened])) [part='content'] {
|
|
22
|
+
display: none !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([focus-ring]) {
|
|
26
|
+
--_focus-ring: 1;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2019 - 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 { ActiveMixin } from '@vaadin/a11y-base/src/active-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
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { accordionHeading } from './styles/vaadin-accordion-heading-core-styles.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* The accordion heading element.
|
|
@@ -51,18 +51,17 @@ registerStyles('vaadin-accordion-heading', accordionHeading, { moduleId: 'vaadin
|
|
|
51
51
|
* @mixes DirMixin
|
|
52
52
|
* @mixes ThemableMixin
|
|
53
53
|
*/
|
|
54
|
-
class AccordionHeading extends ActiveMixin(DirMixin(ThemableMixin(
|
|
54
|
+
class AccordionHeading extends ActiveMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
55
55
|
static get is() {
|
|
56
56
|
return 'vaadin-accordion-heading';
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
static get
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`;
|
|
59
|
+
static get shadowRootOptions() {
|
|
60
|
+
return { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static get styles() {
|
|
64
|
+
return accordionHeading;
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
static get properties() {
|
|
@@ -73,21 +72,20 @@ class AccordionHeading extends ActiveMixin(DirMixin(ThemableMixin(PolymerElement
|
|
|
73
72
|
opened: {
|
|
74
73
|
type: Boolean,
|
|
75
74
|
reflectToAttribute: true,
|
|
75
|
+
sync: true,
|
|
76
76
|
value: false,
|
|
77
77
|
},
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
root.appendChild(dom);
|
|
90
|
-
return root;
|
|
81
|
+
/** @protected */
|
|
82
|
+
render() {
|
|
83
|
+
return html`
|
|
84
|
+
<button id="button" part="content" ?disabled="${this.disabled}" aria-expanded="${this.opened ? 'true' : 'false'}">
|
|
85
|
+
<span part="toggle" aria-hidden="true"></span>
|
|
86
|
+
<slot></slot>
|
|
87
|
+
</button>
|
|
88
|
+
`;
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
/** @protected */
|
|
@@ -100,11 +98,6 @@ class AccordionHeading extends ActiveMixin(DirMixin(ThemableMixin(PolymerElement
|
|
|
100
98
|
this.setAttribute('role', 'heading');
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
|
-
|
|
104
|
-
/** @private */
|
|
105
|
-
__updateAriaExpanded(opened) {
|
|
106
|
-
return opened ? 'true' : 'false';
|
|
107
|
-
}
|
|
108
101
|
}
|
|
109
102
|
|
|
110
103
|
defineCustomElement(AccordionHeading);
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-accordion-heading.js';
|
|
7
|
-
import { html,
|
|
8
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
9
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
+
import { accordionPanel } from './styles/vaadin-accordion-panel-core-styles.js';
|
|
12
13
|
import { AccordionPanelMixin } from './vaadin-accordion-panel-mixin.js';
|
|
13
14
|
|
|
14
|
-
registerStyles('vaadin-accordion-panel', accordionPanel, { moduleId: 'vaadin-accordion-panel-styles' });
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* The accordion panel element.
|
|
18
17
|
*
|
|
@@ -40,15 +39,19 @@ registerStyles('vaadin-accordion-panel', accordionPanel, { moduleId: 'vaadin-acc
|
|
|
40
39
|
* @customElement
|
|
41
40
|
* @extends HTMLElement
|
|
42
41
|
* @mixes AccordionPanelMixin
|
|
43
|
-
* @mixes ControllerMixin
|
|
44
42
|
* @mixes ThemableMixin
|
|
45
43
|
*/
|
|
46
|
-
class AccordionPanel extends AccordionPanelMixin(ThemableMixin(
|
|
44
|
+
class AccordionPanel extends AccordionPanelMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))) {
|
|
47
45
|
static get is() {
|
|
48
46
|
return 'vaadin-accordion-panel';
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
static get
|
|
49
|
+
static get styles() {
|
|
50
|
+
return accordionPanel;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @protected */
|
|
54
|
+
render() {
|
|
52
55
|
return html`
|
|
53
56
|
<slot name="summary"></slot>
|
|
54
57
|
|
|
@@ -38,7 +38,7 @@ export type AccordionEventMap = AccordionCustomEventMap & HTMLElementEventMap;
|
|
|
38
38
|
* Only one panel can be opened at a time, opening a new one forces
|
|
39
39
|
* previous panel to close and hide its content.
|
|
40
40
|
*
|
|
41
|
-
* ```
|
|
41
|
+
* ```html
|
|
42
42
|
* <vaadin-accordion>
|
|
43
43
|
* <vaadin-accordion-panel>
|
|
44
44
|
* <vaadin-accordion-heading slot="summary">Panel 1</vaadin-accordion-heading>
|
|
@@ -56,15 +56,6 @@ export type AccordionEventMap = AccordionCustomEventMap & HTMLElementEventMap;
|
|
|
56
56
|
* See the [`<vaadin-accordion-panel>`](#/elements/vaadin-accordion-panel)
|
|
57
57
|
* documentation for the available state attributes and stylable shadow parts.
|
|
58
58
|
*
|
|
59
|
-
* **Note:** You can apply the theme to `<vaadin-accordion>` component itself,
|
|
60
|
-
* especially by using the following CSS selector:
|
|
61
|
-
*
|
|
62
|
-
* ```
|
|
63
|
-
* :host ::slotted(vaadin-accordion-panel) {
|
|
64
|
-
* margin-bottom: 5px;
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
59
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
69
60
|
*
|
|
70
61
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
package/src/vaadin-accordion.js
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-accordion-panel.js';
|
|
7
|
-
import { html,
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
12
|
import { AccordionMixin } from './vaadin-accordion-mixin.js';
|
|
12
13
|
|
|
@@ -22,7 +23,7 @@ import { AccordionMixin } from './vaadin-accordion-mixin.js';
|
|
|
22
23
|
* Only one panel can be opened at a time, opening a new one forces
|
|
23
24
|
* previous panel to close and hide its content.
|
|
24
25
|
*
|
|
25
|
-
* ```
|
|
26
|
+
* ```html
|
|
26
27
|
* <vaadin-accordion>
|
|
27
28
|
* <vaadin-accordion-panel>
|
|
28
29
|
* <vaadin-accordion-heading slot="summary">Panel 1</vaadin-accordion-heading>
|
|
@@ -40,15 +41,6 @@ import { AccordionMixin } from './vaadin-accordion-mixin.js';
|
|
|
40
41
|
* See the [`<vaadin-accordion-panel>`](#/elements/vaadin-accordion-panel)
|
|
41
42
|
* documentation for the available state attributes and stylable shadow parts.
|
|
42
43
|
*
|
|
43
|
-
* **Note:** You can apply the theme to `<vaadin-accordion>` component itself,
|
|
44
|
-
* especially by using the following CSS selector:
|
|
45
|
-
*
|
|
46
|
-
* ```
|
|
47
|
-
* :host ::slotted(vaadin-accordion-panel) {
|
|
48
|
-
* margin-bottom: 5px;
|
|
49
|
-
* }
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
44
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
53
45
|
*
|
|
54
46
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
|
@@ -60,24 +52,26 @@ import { AccordionMixin } from './vaadin-accordion-mixin.js';
|
|
|
60
52
|
* @mixes ElementMixin
|
|
61
53
|
* @mixes ThemableMixin
|
|
62
54
|
*/
|
|
63
|
-
class Accordion extends AccordionMixin(ThemableMixin(ElementMixin(
|
|
64
|
-
static get
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
class Accordion extends AccordionMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
56
|
+
static get is() {
|
|
57
|
+
return 'vaadin-accordion';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static get styles() {
|
|
61
|
+
return css`
|
|
62
|
+
:host {
|
|
63
|
+
display: block;
|
|
64
|
+
}
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</style>
|
|
75
|
-
<slot></slot>
|
|
66
|
+
:host([hidden]) {
|
|
67
|
+
display: none !important;
|
|
68
|
+
}
|
|
76
69
|
`;
|
|
77
70
|
}
|
|
78
71
|
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
/** @protected */
|
|
73
|
+
render() {
|
|
74
|
+
return html`<slot></slot>`;
|
|
81
75
|
}
|
|
82
76
|
}
|
|
83
77
|
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/accordion",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
"name": "vaadin-accordion",
|
|
188
|
-
"description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n
|
|
188
|
+
"description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n```html\n<vaadin-accordion>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 1</vaadin-accordion-heading>\n <div>This panel is opened, so the text is visible by default.</div>\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 2</vaadin-accordion-heading>\n <div>After opening this panel, the first one becomes closed.</div>\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nSee the [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-accordion-panel)\ndocumentation for the available state attributes and stylable shadow parts.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
189
189
|
"attributes": [
|
|
190
190
|
{
|
|
191
191
|
"name": "opened",
|
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/accordion",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "vaadin-accordion",
|
|
82
|
-
"description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n
|
|
82
|
+
"description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n```html\n<vaadin-accordion>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 1</vaadin-accordion-heading>\n <div>This panel is opened, so the text is visible by default.</div>\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 2</vaadin-accordion-heading>\n <div>After opening this panel, the first one becomes closed.</div>\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nSee the [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-accordion-panel)\ndocumentation for the available state attributes and stylable shadow parts.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
83
83
|
"extension": true,
|
|
84
84
|
"attributes": [
|
|
85
85
|
{
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { html, LitElement } from 'lit';
|
|
7
|
-
import { ActiveMixin } from '@vaadin/a11y-base/src/active-mixin.js';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { accordionHeading } from './vaadin-accordion-heading-core-styles.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* LitElement based version of `<vaadin-accordion-heading>` web component.
|
|
16
|
-
*
|
|
17
|
-
* ## Disclaimer
|
|
18
|
-
*
|
|
19
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
20
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
21
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
22
|
-
*/
|
|
23
|
-
class AccordionHeading extends ActiveMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
24
|
-
static get is() {
|
|
25
|
-
return 'vaadin-accordion-heading';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get shadowRootOptions() {
|
|
29
|
-
return { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static get styles() {
|
|
33
|
-
return accordionHeading;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static get properties() {
|
|
37
|
-
return {
|
|
38
|
-
/**
|
|
39
|
-
* When true, the element is opened.
|
|
40
|
-
*/
|
|
41
|
-
opened: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
reflectToAttribute: true,
|
|
44
|
-
value: false,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** @protected */
|
|
50
|
-
render() {
|
|
51
|
-
return html`
|
|
52
|
-
<button id="button" part="content" ?disabled="${this.disabled}" aria-expanded="${this.opened ? 'true' : 'false'}">
|
|
53
|
-
<span part="toggle" aria-hidden="true"></span>
|
|
54
|
-
<slot></slot>
|
|
55
|
-
</button>
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** @protected */
|
|
60
|
-
ready() {
|
|
61
|
-
super.ready();
|
|
62
|
-
|
|
63
|
-
// By default, if the user hasn't provided a custom role,
|
|
64
|
-
// the role attribute is set to "heading".
|
|
65
|
-
if (!this.hasAttribute('role')) {
|
|
66
|
-
this.setAttribute('role', 'heading');
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
defineCustomElement(AccordionHeading);
|
|
72
|
-
|
|
73
|
-
export { AccordionHeading };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import './vaadin-lit-accordion-heading.js';
|
|
7
|
-
import { html, LitElement } from 'lit';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.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 { accordionPanel } from './vaadin-accordion-panel-core-styles.js';
|
|
12
|
-
import { AccordionPanelMixin } from './vaadin-accordion-panel-mixin.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* LitElement based version of `<vaadin-accordion-panel>` web component.
|
|
16
|
-
*
|
|
17
|
-
* ## Disclaimer
|
|
18
|
-
*
|
|
19
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
20
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
21
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
22
|
-
*/
|
|
23
|
-
class AccordionPanel extends AccordionPanelMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
24
|
-
static get is() {
|
|
25
|
-
return 'vaadin-accordion-panel';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get styles() {
|
|
29
|
-
return accordionPanel;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** @protected */
|
|
33
|
-
render() {
|
|
34
|
-
return html`
|
|
35
|
-
<slot name="summary"></slot>
|
|
36
|
-
|
|
37
|
-
<div part="content">
|
|
38
|
-
<slot></slot>
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
<slot name="tooltip"></slot>
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
defineCustomElement(AccordionPanel);
|
|
47
|
-
|
|
48
|
-
export { AccordionPanel };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import './vaadin-lit-accordion-panel.js';
|
|
7
|
-
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { AccordionMixin } from './vaadin-accordion-mixin.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* LitElement based version of `<vaadin-accordion>` web component.
|
|
16
|
-
*
|
|
17
|
-
* ## Disclaimer
|
|
18
|
-
*
|
|
19
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
20
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
21
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
22
|
-
*/
|
|
23
|
-
class Accordion extends AccordionMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
24
|
-
static get is() {
|
|
25
|
-
return 'vaadin-accordion';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get styles() {
|
|
29
|
-
return css`
|
|
30
|
-
:host {
|
|
31
|
-
display: block;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([hidden]) {
|
|
35
|
-
display: none !important;
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** @protected */
|
|
41
|
-
render() {
|
|
42
|
-
return html`<slot></slot>`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
defineCustomElement(Accordion);
|
|
47
|
-
|
|
48
|
-
export { Accordion };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import { detailsSummary } from '@vaadin/details/theme/material/vaadin-details-summary-styles.js';
|
|
3
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
|
-
|
|
5
|
-
const accordionHeading = css`
|
|
6
|
-
:host(:not([opened]))::after {
|
|
7
|
-
content: '';
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: -1px;
|
|
10
|
-
left: 0;
|
|
11
|
-
right: 0;
|
|
12
|
-
height: 1px;
|
|
13
|
-
opacity: 1;
|
|
14
|
-
z-index: 1;
|
|
15
|
-
background-color: var(--material-divider-color);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:host([opened])::before {
|
|
19
|
-
opacity: 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
[part='content'] {
|
|
23
|
-
font-weight: normal;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
[part='content'] ::slotted(*) {
|
|
27
|
-
display: flex;
|
|
28
|
-
margin-right: 16px;
|
|
29
|
-
color: var(--material-body-text-color);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
[part='content'] ::slotted([theme='primary']) {
|
|
33
|
-
flex-basis: 33.33%;
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
[part='content'] ::slotted([theme='secondary']) {
|
|
38
|
-
color: var(--material-secondary-text-color);
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
registerStyles('vaadin-accordion-heading', [detailsSummary, accordionHeading], {
|
|
43
|
-
moduleId: 'material-accordion-heading',
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import { details } from '@vaadin/details/theme/material/vaadin-details-styles.js';
|
|
3
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
|
-
|
|
5
|
-
const accordionPanel = css`
|
|
6
|
-
:host([opened]:not(:first-child)) {
|
|
7
|
-
margin-top: 16px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:host([opened]:not(:last-child)) {
|
|
11
|
-
margin-bottom: 16px;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
registerStyles('vaadin-accordion-panel', [details, accordionPanel], {
|
|
16
|
-
moduleId: 'material-accordion-panel',
|
|
17
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-accordion-heading.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-accordion-panel.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-accordion.js';
|
package/vaadin-lit-accordion.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{vaadin-accordion-panel-core-styles.js → styles/vaadin-accordion-panel-core-styles.js}
RENAMED
|
File without changes
|