@vaadin/accordion 24.0.0-alpha7 → 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 +50 -75
- package/src/vaadin-accordion.d.ts +1 -1
- package/src/vaadin-accordion.js +3 -5
- package/web-types.json +85 -33
- package/web-types.lit.json +23 -15
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,49 +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 SlotObserveController {
|
|
18
|
-
constructor(host) {
|
|
19
|
-
super(host, 'summary', 'vaadin-accordion-heading', {
|
|
20
|
-
initializer: (node, host) => {
|
|
21
|
-
host._setFocusElement(node);
|
|
22
|
-
host.stateTarget = node;
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
class ContentController extends SlotObserveController {
|
|
29
|
-
/**
|
|
30
|
-
* Override method from `SlotController` to change
|
|
31
|
-
* the ID prefix for the default slot content.
|
|
32
|
-
*
|
|
33
|
-
* @param {HTMLElement} host
|
|
34
|
-
* @return {string}
|
|
35
|
-
* @protected
|
|
36
|
-
* @override
|
|
37
|
-
*/
|
|
38
|
-
static generateId(host) {
|
|
39
|
-
return super.generateId(host, 'content');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
constructor(host) {
|
|
43
|
-
super(host, '', null, { multiple: true });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
16
|
/**
|
|
48
17
|
* The accordion panel element.
|
|
49
18
|
*
|
|
@@ -67,6 +36,13 @@ class ContentController extends SlotObserveController {
|
|
|
67
36
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
|
|
68
37
|
*
|
|
69
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
|
|
70
46
|
*/
|
|
71
47
|
class AccordionPanel extends DetailsMixin(
|
|
72
48
|
DelegateFocusMixin(DelegateStateMixin(ThemableMixin(ControllerMixin(PolymerElement)))),
|
|
@@ -110,16 +86,20 @@ class AccordionPanel extends DetailsMixin(
|
|
|
110
86
|
static get properties() {
|
|
111
87
|
return {
|
|
112
88
|
/**
|
|
113
|
-
* A
|
|
114
|
-
*
|
|
115
|
-
* @protected
|
|
89
|
+
* A text that is displayed in the heading, if no
|
|
90
|
+
* element is assigned to the `summary` slot.
|
|
116
91
|
*/
|
|
117
|
-
|
|
118
|
-
type:
|
|
92
|
+
summary: {
|
|
93
|
+
type: String,
|
|
94
|
+
observer: '_summaryChanged',
|
|
119
95
|
},
|
|
120
96
|
};
|
|
121
97
|
}
|
|
122
98
|
|
|
99
|
+
static get observers() {
|
|
100
|
+
return ['__updateAriaAttributes(focusElement, _contentElements)'];
|
|
101
|
+
}
|
|
102
|
+
|
|
123
103
|
static get delegateAttrs() {
|
|
124
104
|
return ['theme'];
|
|
125
105
|
}
|
|
@@ -128,13 +108,29 @@ class AccordionPanel extends DetailsMixin(
|
|
|
128
108
|
return ['disabled', 'opened'];
|
|
129
109
|
}
|
|
130
110
|
|
|
111
|
+
constructor() {
|
|
112
|
+
super();
|
|
113
|
+
|
|
114
|
+
this._summaryController = new SummaryController(this, 'vaadin-accordion-heading');
|
|
115
|
+
this._summaryController.addEventListener('slot-content-changed', (event) => {
|
|
116
|
+
const { node } = event.target;
|
|
117
|
+
|
|
118
|
+
this._setFocusElement(node);
|
|
119
|
+
this.stateTarget = node;
|
|
120
|
+
|
|
121
|
+
this._tooltipController.setTarget(node);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
this._tooltipController = new TooltipController(this);
|
|
125
|
+
this._tooltipController.setPosition('bottom-start');
|
|
126
|
+
}
|
|
127
|
+
|
|
131
128
|
/** @protected */
|
|
132
129
|
ready() {
|
|
133
130
|
super.ready();
|
|
134
131
|
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
this._initTooltip();
|
|
132
|
+
this.addController(this._summaryController);
|
|
133
|
+
this.addController(this._tooltipController);
|
|
138
134
|
}
|
|
139
135
|
|
|
140
136
|
/**
|
|
@@ -149,47 +145,26 @@ class AccordionPanel extends DetailsMixin(
|
|
|
149
145
|
}
|
|
150
146
|
|
|
151
147
|
/** @private */
|
|
152
|
-
|
|
153
|
-
this._summaryController
|
|
154
|
-
this.addController(this._summaryController);
|
|
155
|
-
|
|
156
|
-
// Wait for heading element render to complete
|
|
157
|
-
afterNextRender(this, () => {
|
|
158
|
-
this._toggleElement = this.focusElement.$.button;
|
|
159
|
-
});
|
|
148
|
+
_summaryChanged(summary) {
|
|
149
|
+
this._summaryController.setSummary(summary);
|
|
160
150
|
}
|
|
161
151
|
|
|
162
152
|
/** @private */
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const content = event.target.nodes || [];
|
|
168
|
-
this._contentElements = content;
|
|
169
|
-
|
|
170
|
-
// See https://www.w3.org/WAI/ARIA/apg/patterns/accordion/
|
|
171
|
-
const node = content[0];
|
|
153
|
+
__updateAriaAttributes(focusElement, contentElements) {
|
|
154
|
+
if (focusElement && contentElements) {
|
|
155
|
+
const node = contentElements[0];
|
|
156
|
+
|
|
172
157
|
if (node) {
|
|
173
158
|
node.setAttribute('role', 'region');
|
|
174
|
-
node.setAttribute('aria-labelledby',
|
|
159
|
+
node.setAttribute('aria-labelledby', focusElement.id);
|
|
175
160
|
}
|
|
176
161
|
|
|
177
|
-
if (node && node.
|
|
178
|
-
|
|
162
|
+
if (node && node.id) {
|
|
163
|
+
focusElement.setAttribute('aria-controls', node.id);
|
|
179
164
|
} else {
|
|
180
|
-
|
|
165
|
+
focusElement.removeAttribute('aria-controls');
|
|
181
166
|
}
|
|
182
|
-
}
|
|
183
|
-
this.addController(this._contentController);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/** @private */
|
|
187
|
-
_initTooltip() {
|
|
188
|
-
this._tooltipController = new TooltipController(this);
|
|
189
|
-
this.addController(this._tooltipController);
|
|
190
|
-
|
|
191
|
-
this._tooltipController.setTarget(this.focusElement);
|
|
192
|
-
this._tooltipController.setPosition('bottom-start');
|
|
167
|
+
}
|
|
193
168
|
}
|
|
194
169
|
}
|
|
195
170
|
|
|
@@ -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": {
|
|
@@ -55,32 +55,44 @@
|
|
|
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
57
|
{
|
|
58
|
-
"name": "
|
|
59
|
-
"description": "
|
|
58
|
+
"name": "opened",
|
|
59
|
+
"description": "If true, the collapsible content is visible.",
|
|
60
60
|
"value": {
|
|
61
61
|
"type": [
|
|
62
|
-
"
|
|
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",
|
|
63
72
|
"null",
|
|
64
73
|
"undefined"
|
|
65
74
|
]
|
|
66
75
|
}
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"js": {
|
|
70
|
-
"properties": [],
|
|
71
|
-
"events": []
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"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-alpha7/#/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
|
-
"attributes": [
|
|
76
|
+
},
|
|
78
77
|
{
|
|
79
|
-
"name": "
|
|
80
|
-
"description": "
|
|
78
|
+
"name": "autofocus",
|
|
79
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
81
80
|
"value": {
|
|
82
81
|
"type": [
|
|
83
|
-
"
|
|
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"
|
|
84
96
|
]
|
|
85
97
|
}
|
|
86
98
|
},
|
|
@@ -99,43 +111,83 @@
|
|
|
99
111
|
"js": {
|
|
100
112
|
"properties": [
|
|
101
113
|
{
|
|
102
|
-
"name": "
|
|
103
|
-
"description": "",
|
|
114
|
+
"name": "opened",
|
|
115
|
+
"description": "If true, the collapsible content is visible.",
|
|
104
116
|
"value": {
|
|
105
117
|
"type": [
|
|
106
|
-
"
|
|
118
|
+
"boolean"
|
|
107
119
|
]
|
|
108
120
|
}
|
|
109
121
|
},
|
|
110
122
|
{
|
|
111
|
-
"name": "
|
|
112
|
-
"description": "",
|
|
123
|
+
"name": "disabled",
|
|
124
|
+
"description": "If true, the user cannot interact with this element.",
|
|
113
125
|
"value": {
|
|
114
126
|
"type": [
|
|
115
|
-
"
|
|
127
|
+
"boolean",
|
|
128
|
+
"null",
|
|
129
|
+
"undefined"
|
|
116
130
|
]
|
|
117
131
|
}
|
|
118
132
|
},
|
|
119
133
|
{
|
|
120
|
-
"name": "
|
|
121
|
-
"description": "",
|
|
134
|
+
"name": "autofocus",
|
|
135
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
122
136
|
"value": {
|
|
123
137
|
"type": [
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
138
|
+
"boolean",
|
|
139
|
+
"null",
|
|
140
|
+
"undefined"
|
|
127
141
|
]
|
|
128
142
|
}
|
|
129
143
|
},
|
|
130
144
|
{
|
|
131
|
-
"name": "
|
|
132
|
-
"description": "",
|
|
145
|
+
"name": "summary",
|
|
146
|
+
"description": "A text that is displayed in the heading, if no\nelement is assigned to the `summary` slot.",
|
|
133
147
|
"value": {
|
|
134
148
|
"type": [
|
|
135
|
-
"
|
|
149
|
+
"string",
|
|
150
|
+
"null",
|
|
151
|
+
"undefined"
|
|
136
152
|
]
|
|
137
153
|
}
|
|
138
|
-
}
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"events": [
|
|
157
|
+
{
|
|
158
|
+
"name": "opened-changed",
|
|
159
|
+
"description": "Fired when the `opened` property changes."
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "vaadin-accordion",
|
|
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.",
|
|
167
|
+
"attributes": [
|
|
168
|
+
{
|
|
169
|
+
"name": "opened",
|
|
170
|
+
"description": "The index of currently opened panel. First panel is opened by\ndefault. Only one panel can be opened at the same time.\nSetting null or undefined closes all the accordion panels.",
|
|
171
|
+
"value": {
|
|
172
|
+
"type": [
|
|
173
|
+
"number"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "theme",
|
|
179
|
+
"description": "The theme variants to apply to the component.",
|
|
180
|
+
"value": {
|
|
181
|
+
"type": [
|
|
182
|
+
"string",
|
|
183
|
+
"null",
|
|
184
|
+
"undefined"
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"js": {
|
|
190
|
+
"properties": [
|
|
139
191
|
{
|
|
140
192
|
"name": "opened",
|
|
141
193
|
"description": "The index of currently opened panel. First panel is opened by\ndefault. Only one panel can be opened at the same time.\nSetting null or undefined closes all the accordion panels.",
|
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,41 +32,49 @@
|
|
|
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": []
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"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-alpha7/#/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
|
-
"extension": true,
|
|
41
35
|
"attributes": [
|
|
42
36
|
{
|
|
43
|
-
"name": "
|
|
44
|
-
"description": "",
|
|
37
|
+
"name": "?opened",
|
|
38
|
+
"description": "If true, the collapsible content is visible.",
|
|
45
39
|
"value": {
|
|
46
40
|
"kind": "expression"
|
|
47
41
|
}
|
|
48
42
|
},
|
|
49
43
|
{
|
|
50
|
-
"name": "
|
|
51
|
-
"description": "",
|
|
44
|
+
"name": "?disabled",
|
|
45
|
+
"description": "If true, the user cannot interact with this element.",
|
|
52
46
|
"value": {
|
|
53
47
|
"kind": "expression"
|
|
54
48
|
}
|
|
55
49
|
},
|
|
56
50
|
{
|
|
57
|
-
"name": "
|
|
58
|
-
"description": "",
|
|
51
|
+
"name": "?autofocus",
|
|
52
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
59
53
|
"value": {
|
|
60
54
|
"kind": "expression"
|
|
61
55
|
}
|
|
62
56
|
},
|
|
63
57
|
{
|
|
64
|
-
"name": "
|
|
65
|
-
"description": "",
|
|
58
|
+
"name": ".summary",
|
|
59
|
+
"description": "A text that is displayed in the heading, if no\nelement is assigned to the `summary` slot.",
|
|
66
60
|
"value": {
|
|
67
61
|
"kind": "expression"
|
|
68
62
|
}
|
|
69
63
|
},
|
|
64
|
+
{
|
|
65
|
+
"name": "@opened-changed",
|
|
66
|
+
"description": "Fired when the `opened` property changes.",
|
|
67
|
+
"value": {
|
|
68
|
+
"kind": "expression"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "vaadin-accordion",
|
|
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.",
|
|
76
|
+
"extension": true,
|
|
77
|
+
"attributes": [
|
|
70
78
|
{
|
|
71
79
|
"name": ".opened",
|
|
72
80
|
"description": "The index of currently opened panel. First panel is opened by\ndefault. Only one panel can be opened at the same time.\nSetting null or undefined closes all the accordion panels.",
|