@vaadin/accordion 24.0.0-alpha6 → 24.0.0-alpha8
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 +7 -7
- package/src/vaadin-accordion-heading.d.ts +1 -1
- package/src/vaadin-accordion-heading.js +7 -2
- package/src/vaadin-accordion-panel.d.ts +9 -3
- package/src/vaadin-accordion-panel.js +60 -36
- package/src/vaadin-accordion.d.ts +1 -1
- package/src/vaadin-accordion.js +3 -5
- package/web-types.json +94 -4
- package/web-types.lit.json +39 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/accordion",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/component-base": "24.0.0-
|
|
40
|
-
"@vaadin/details": "24.0.0-
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "24.0.0-
|
|
42
|
-
"@vaadin/vaadin-material-styles": "24.0.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "24.0.0-
|
|
39
|
+
"@vaadin/component-base": "24.0.0-alpha8",
|
|
40
|
+
"@vaadin/details": "24.0.0-alpha8",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "24.0.0-alpha8",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "24.0.0-alpha8",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "24.0.0-alpha8"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"web-types.json",
|
|
52
52
|
"web-types.lit.json"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "476752249bb12295c500980d98a3256ad3b22b73"
|
|
55
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2019 -
|
|
3
|
+
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ActiveMixin } from '@vaadin/component-base/src/active-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2019 -
|
|
3
|
+
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -80,7 +80,7 @@ class AccordionHeading extends ActiveMixin(DirMixin(ThemableMixin(PolymerElement
|
|
|
80
80
|
text-align: inherit;
|
|
81
81
|
}
|
|
82
82
|
</style>
|
|
83
|
-
<button id="button" part="content" disabled$="[[disabled]]">
|
|
83
|
+
<button id="button" part="content" disabled$="[[disabled]]" aria-expanded$="[[__updateAriaExpanded(opened)]]">
|
|
84
84
|
<span part="toggle" aria-hidden="true"></span>
|
|
85
85
|
<slot></slot>
|
|
86
86
|
</button>
|
|
@@ -121,6 +121,11 @@ class AccordionHeading extends ActiveMixin(DirMixin(ThemableMixin(PolymerElement
|
|
|
121
121
|
this.setAttribute('role', 'heading');
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
+
|
|
125
|
+
/** @private */
|
|
126
|
+
__updateAriaExpanded(opened) {
|
|
127
|
+
return opened ? 'true' : 'false';
|
|
128
|
+
}
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
customElements.define(AccordionHeading.is, AccordionHeading);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2019 -
|
|
3
|
+
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { DelegateFocusMixin } from '@vaadin/component-base/src/delegate-focus-mixin.js';
|
|
7
|
+
import { DelegateStateMixin } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
6
8
|
import { DetailsMixin } from '@vaadin/details/src/vaadin-details-mixin.js';
|
|
7
|
-
import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
|
|
8
|
-
import { DelegateStateMixin } from '@vaadin/field-base/src/delegate-state-mixin.js';
|
|
9
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -44,6 +44,12 @@ export type AccordionPanelEventMap = AccordionPanelCustomEventMap & HTMLElementE
|
|
|
44
44
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
45
45
|
*/
|
|
46
46
|
declare class AccordionPanel extends DetailsMixin(DelegateFocusMixin(DelegateStateMixin(ThemableMixin(HTMLElement)))) {
|
|
47
|
+
/**
|
|
48
|
+
* A text that is displayed in the heading, if no
|
|
49
|
+
* element is assigned to the `summary` slot.
|
|
50
|
+
*/
|
|
51
|
+
summary: string | null | undefined;
|
|
52
|
+
|
|
47
53
|
addEventListener<K extends keyof AccordionPanelEventMap>(
|
|
48
54
|
type: K,
|
|
49
55
|
listener: (this: AccordionPanel, ev: AccordionPanelEventMap[K]) => void,
|
|
@@ -1,31 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2019 -
|
|
3
|
+
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
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 { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
8
7
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
9
8
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
10
|
-
import {
|
|
9
|
+
import { DelegateFocusMixin } from '@vaadin/component-base/src/delegate-focus-mixin.js';
|
|
10
|
+
import { DelegateStateMixin } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
11
11
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
12
|
+
import { SummaryController } from '@vaadin/details/src/summary-controller.js';
|
|
12
13
|
import { DetailsMixin } from '@vaadin/details/src/vaadin-details-mixin.js';
|
|
13
|
-
import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
|
|
14
|
-
import { DelegateStateMixin } from '@vaadin/field-base/src/delegate-state-mixin.js';
|
|
15
14
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
16
15
|
|
|
17
|
-
class SummaryController extends SlotController {
|
|
18
|
-
constructor(host) {
|
|
19
|
-
super(host, 'summary', 'vaadin-accordion-heading', {
|
|
20
|
-
useUniqueId: true,
|
|
21
|
-
initializer: (node, host) => {
|
|
22
|
-
host._setFocusElement(node);
|
|
23
|
-
host.stateTarget = node;
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
16
|
/**
|
|
30
17
|
* The accordion panel element.
|
|
31
18
|
*
|
|
@@ -49,6 +36,13 @@ class SummaryController extends SlotController {
|
|
|
49
36
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
|
|
50
37
|
*
|
|
51
38
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
39
|
+
*
|
|
40
|
+
* @extends HTMLElement
|
|
41
|
+
* @mixes ControllerMixin
|
|
42
|
+
* @mixes DetailsMixin
|
|
43
|
+
* @mixes DelegateFocusMixin
|
|
44
|
+
* @mixes DelegateStateMixin
|
|
45
|
+
* @mixes ThemableMixin
|
|
52
46
|
*/
|
|
53
47
|
class AccordionPanel extends DetailsMixin(
|
|
54
48
|
DelegateFocusMixin(DelegateStateMixin(ThemableMixin(ControllerMixin(PolymerElement)))),
|
|
@@ -92,16 +86,20 @@ class AccordionPanel extends DetailsMixin(
|
|
|
92
86
|
static get properties() {
|
|
93
87
|
return {
|
|
94
88
|
/**
|
|
95
|
-
* A
|
|
96
|
-
*
|
|
97
|
-
* @protected
|
|
89
|
+
* A text that is displayed in the heading, if no
|
|
90
|
+
* element is assigned to the `summary` slot.
|
|
98
91
|
*/
|
|
99
|
-
|
|
100
|
-
type:
|
|
92
|
+
summary: {
|
|
93
|
+
type: String,
|
|
94
|
+
observer: '_summaryChanged',
|
|
101
95
|
},
|
|
102
96
|
};
|
|
103
97
|
}
|
|
104
98
|
|
|
99
|
+
static get observers() {
|
|
100
|
+
return ['__updateAriaAttributes(focusElement, _contentElements)'];
|
|
101
|
+
}
|
|
102
|
+
|
|
105
103
|
static get delegateAttrs() {
|
|
106
104
|
return ['theme'];
|
|
107
105
|
}
|
|
@@ -110,26 +108,29 @@ class AccordionPanel extends DetailsMixin(
|
|
|
110
108
|
return ['disabled', 'opened'];
|
|
111
109
|
}
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
super.ready();
|
|
111
|
+
constructor() {
|
|
112
|
+
super();
|
|
116
113
|
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
this._summaryController = new SummaryController(this, 'vaadin-accordion-heading');
|
|
115
|
+
this._summaryController.addEventListener('slot-content-changed', (event) => {
|
|
116
|
+
const { node } = event.target;
|
|
119
117
|
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
this._setFocusElement(node);
|
|
119
|
+
this.stateTarget = node;
|
|
122
120
|
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
this._tooltipController.setTarget(node);
|
|
122
|
+
});
|
|
125
123
|
|
|
126
|
-
this._tooltipController
|
|
124
|
+
this._tooltipController = new TooltipController(this);
|
|
127
125
|
this._tooltipController.setPosition('bottom-start');
|
|
126
|
+
}
|
|
128
127
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
/** @protected */
|
|
129
|
+
ready() {
|
|
130
|
+
super.ready();
|
|
131
|
+
|
|
132
|
+
this.addController(this._summaryController);
|
|
133
|
+
this.addController(this._tooltipController);
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
/**
|
|
@@ -142,6 +143,29 @@ class AccordionPanel extends DetailsMixin(
|
|
|
142
143
|
_setAriaDisabled() {
|
|
143
144
|
// The `aria-disabled` is set on the details summary.
|
|
144
145
|
}
|
|
146
|
+
|
|
147
|
+
/** @private */
|
|
148
|
+
_summaryChanged(summary) {
|
|
149
|
+
this._summaryController.setSummary(summary);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** @private */
|
|
153
|
+
__updateAriaAttributes(focusElement, contentElements) {
|
|
154
|
+
if (focusElement && contentElements) {
|
|
155
|
+
const node = contentElements[0];
|
|
156
|
+
|
|
157
|
+
if (node) {
|
|
158
|
+
node.setAttribute('role', 'region');
|
|
159
|
+
node.setAttribute('aria-labelledby', focusElement.id);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (node && node.id) {
|
|
163
|
+
focusElement.setAttribute('aria-controls', node.id);
|
|
164
|
+
} else {
|
|
165
|
+
focusElement.removeAttribute('aria-controls');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
145
169
|
}
|
|
146
170
|
|
|
147
171
|
customElements.define(AccordionPanel.is, AccordionPanel);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2019 -
|
|
3
|
+
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
package/src/vaadin-accordion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2019 -
|
|
3
|
+
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
@@ -151,7 +151,7 @@ class Accordion extends KeyboardDirectionMixin(ThemableMixin(ElementMixin(Polyme
|
|
|
151
151
|
* @override
|
|
152
152
|
*/
|
|
153
153
|
get focused() {
|
|
154
|
-
return (this._getItems() || []).find((item) => isElementFocused(item.
|
|
154
|
+
return (this._getItems() || []).find((item) => isElementFocused(item.focusElement));
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
/**
|
|
@@ -195,9 +195,7 @@ class Accordion extends KeyboardDirectionMixin(ThemableMixin(ElementMixin(Polyme
|
|
|
195
195
|
*/
|
|
196
196
|
_onKeyDown(event) {
|
|
197
197
|
// Only check keyboard events on details toggle buttons
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (!this.items.some((item) => item._toggleElement === target)) {
|
|
198
|
+
if (!this.items.some((item) => item.focusElement === event.target)) {
|
|
201
199
|
return;
|
|
202
200
|
}
|
|
203
201
|
|
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": "24.0.0-
|
|
4
|
+
"version": "24.0.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -54,6 +54,48 @@
|
|
|
54
54
|
"name": "vaadin-accordion-panel",
|
|
55
55
|
"description": "The accordion panel element.\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`content` | The wrapper for the collapsible panel content.\n\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`opened` | Set when the collapsible content is expanded and visible.\n`disabled` | Set when the element is disabled.\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
|
|
56
56
|
"attributes": [
|
|
57
|
+
{
|
|
58
|
+
"name": "opened",
|
|
59
|
+
"description": "If true, the collapsible content is visible.",
|
|
60
|
+
"value": {
|
|
61
|
+
"type": [
|
|
62
|
+
"boolean"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "disabled",
|
|
68
|
+
"description": "If true, the user cannot interact with this element.",
|
|
69
|
+
"value": {
|
|
70
|
+
"type": [
|
|
71
|
+
"boolean",
|
|
72
|
+
"null",
|
|
73
|
+
"undefined"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "autofocus",
|
|
79
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
80
|
+
"value": {
|
|
81
|
+
"type": [
|
|
82
|
+
"boolean",
|
|
83
|
+
"null",
|
|
84
|
+
"undefined"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "summary",
|
|
90
|
+
"description": "A text that is displayed in the heading, if no\nelement is assigned to the `summary` slot.",
|
|
91
|
+
"value": {
|
|
92
|
+
"type": [
|
|
93
|
+
"string",
|
|
94
|
+
"null",
|
|
95
|
+
"undefined"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
57
99
|
{
|
|
58
100
|
"name": "theme",
|
|
59
101
|
"description": "The theme variants to apply to the component.",
|
|
@@ -67,13 +109,61 @@
|
|
|
67
109
|
}
|
|
68
110
|
],
|
|
69
111
|
"js": {
|
|
70
|
-
"properties": [
|
|
71
|
-
|
|
112
|
+
"properties": [
|
|
113
|
+
{
|
|
114
|
+
"name": "opened",
|
|
115
|
+
"description": "If true, the collapsible content is visible.",
|
|
116
|
+
"value": {
|
|
117
|
+
"type": [
|
|
118
|
+
"boolean"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "disabled",
|
|
124
|
+
"description": "If true, the user cannot interact with this element.",
|
|
125
|
+
"value": {
|
|
126
|
+
"type": [
|
|
127
|
+
"boolean",
|
|
128
|
+
"null",
|
|
129
|
+
"undefined"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "autofocus",
|
|
135
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
136
|
+
"value": {
|
|
137
|
+
"type": [
|
|
138
|
+
"boolean",
|
|
139
|
+
"null",
|
|
140
|
+
"undefined"
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "summary",
|
|
146
|
+
"description": "A text that is displayed in the heading, if no\nelement is assigned to the `summary` slot.",
|
|
147
|
+
"value": {
|
|
148
|
+
"type": [
|
|
149
|
+
"string",
|
|
150
|
+
"null",
|
|
151
|
+
"undefined"
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"events": [
|
|
157
|
+
{
|
|
158
|
+
"name": "opened-changed",
|
|
159
|
+
"description": "Fired when the `opened` property changes."
|
|
160
|
+
}
|
|
161
|
+
]
|
|
72
162
|
}
|
|
73
163
|
},
|
|
74
164
|
{
|
|
75
165
|
"name": "vaadin-accordion",
|
|
76
|
-
"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```\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/24.0.0-
|
|
166
|
+
"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```\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/24.0.0-alpha8/#/elements/vaadin-accordion-panel)\ndocumentation for the available state attributes and stylable shadow parts.\n\n**Note:** You can apply the theme to `<vaadin-accordion>` component itself,\nespecially by using the following CSS selector:\n\n```\n:host ::slotted(vaadin-accordion-panel) {\n margin-bottom: 5px;\n}\n```\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
|
|
77
167
|
"attributes": [
|
|
78
168
|
{
|
|
79
169
|
"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": "24.0.0-
|
|
4
|
+
"version": "24.0.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -32,11 +32,47 @@
|
|
|
32
32
|
"name": "vaadin-accordion-panel",
|
|
33
33
|
"description": "The accordion panel element.\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`content` | The wrapper for the collapsible panel content.\n\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`opened` | Set when the collapsible content is expanded and visible.\n`disabled` | Set when the element is disabled.\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
|
|
34
34
|
"extension": true,
|
|
35
|
-
"attributes": [
|
|
35
|
+
"attributes": [
|
|
36
|
+
{
|
|
37
|
+
"name": "?opened",
|
|
38
|
+
"description": "If true, the collapsible content is visible.",
|
|
39
|
+
"value": {
|
|
40
|
+
"kind": "expression"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "?disabled",
|
|
45
|
+
"description": "If true, the user cannot interact with this element.",
|
|
46
|
+
"value": {
|
|
47
|
+
"kind": "expression"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "?autofocus",
|
|
52
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
53
|
+
"value": {
|
|
54
|
+
"kind": "expression"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": ".summary",
|
|
59
|
+
"description": "A text that is displayed in the heading, if no\nelement is assigned to the `summary` slot.",
|
|
60
|
+
"value": {
|
|
61
|
+
"kind": "expression"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "@opened-changed",
|
|
66
|
+
"description": "Fired when the `opened` property changes.",
|
|
67
|
+
"value": {
|
|
68
|
+
"kind": "expression"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
36
72
|
},
|
|
37
73
|
{
|
|
38
74
|
"name": "vaadin-accordion",
|
|
39
|
-
"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```\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/24.0.0-
|
|
75
|
+
"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```\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/24.0.0-alpha8/#/elements/vaadin-accordion-panel)\ndocumentation for the available state attributes and stylable shadow parts.\n\n**Note:** You can apply the theme to `<vaadin-accordion>` component itself,\nespecially by using the following CSS selector:\n\n```\n:host ::slotted(vaadin-accordion-panel) {\n margin-bottom: 5px;\n}\n```\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
|
|
40
76
|
"extension": true,
|
|
41
77
|
"attributes": [
|
|
42
78
|
{
|