@vaadin/accordion 23.2.0-dev.8a7678b70 → 23.2.1
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 +4 -4
- package/package.json +14 -8
- package/src/vaadin-accordion-panel.d.ts +1 -1
- package/src/vaadin-accordion-panel.js +1 -1
- package/src/vaadin-accordion.d.ts +5 -5
- package/src/vaadin-accordion.js +1 -1
- package/web-types.json +150 -0
- package/web-types.lit.json +83 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A web component for displaying a vertically stacked set of expandable panels.
|
|
4
4
|
|
|
5
|
-
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/accordion)
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@vaadin/accordion)
|
|
8
8
|
[](https://discord.gg/PHmkCKC)
|
|
@@ -20,7 +20,7 @@ A web component for displaying a vertically stacked set of expandable panels.
|
|
|
20
20
|
</vaadin-accordion>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/accordion/screenshot.png" alt="Screenshot of vaadin-accordion" width="900">](https://vaadin.com/docs/latest/
|
|
23
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/accordion/screenshot.png" alt="Screenshot of vaadin-accordion" width="900">](https://vaadin.com/docs/latest/components/accordion)
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
@@ -38,7 +38,7 @@ import '@vaadin/accordion';
|
|
|
38
38
|
|
|
39
39
|
## Themes
|
|
40
40
|
|
|
41
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/
|
|
41
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
42
42
|
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/accordion/vaadin-accordion.js) of the package uses the Lumo theme.
|
|
43
43
|
|
|
44
44
|
To use the Material theme, import the component from the `theme/material` folder:
|
|
@@ -61,7 +61,7 @@ import '@vaadin/accordion/src/vaadin-accordion.js';
|
|
|
61
61
|
|
|
62
62
|
## Contributing
|
|
63
63
|
|
|
64
|
-
Read the [contributing guide](https://vaadin.com/docs/latest/
|
|
64
|
+
Read the [contributing guide](https://vaadin.com/docs/latest/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
|
65
65
|
|
|
66
66
|
## License
|
|
67
67
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/accordion",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"src",
|
|
24
24
|
"theme",
|
|
25
25
|
"vaadin-*.d.ts",
|
|
26
|
-
"vaadin-*.js"
|
|
26
|
+
"vaadin-*.js",
|
|
27
|
+
"web-types.json",
|
|
28
|
+
"web-types.lit.json"
|
|
27
29
|
],
|
|
28
30
|
"keywords": [
|
|
29
31
|
"Vaadin",
|
|
@@ -34,16 +36,20 @@
|
|
|
34
36
|
],
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/component-base": "23.2.
|
|
38
|
-
"@vaadin/details": "23.2.
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "23.2.
|
|
40
|
-
"@vaadin/vaadin-material-styles": "23.2.
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "23.2.
|
|
39
|
+
"@vaadin/component-base": "~23.2.1",
|
|
40
|
+
"@vaadin/details": "~23.2.1",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "~23.2.1",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "~23.2.1",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "~23.2.1"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
45
47
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
46
48
|
"sinon": "^13.0.2"
|
|
47
49
|
},
|
|
48
|
-
"
|
|
50
|
+
"web-types": [
|
|
51
|
+
"web-types.json",
|
|
52
|
+
"web-types.lit.json"
|
|
53
|
+
],
|
|
54
|
+
"gitHead": "a6c314f6927bfd3309fc735eae6c6dc72ab8367a"
|
|
49
55
|
}
|
|
@@ -28,7 +28,7 @@ import { Details } from '@vaadin/details/src/vaadin-details.js';
|
|
|
28
28
|
* `focus-ring` | Set when the element is focused using the keyboard.
|
|
29
29
|
* `focused` | Set when the element is focused.
|
|
30
30
|
*
|
|
31
|
-
* See [Styling Components](https://vaadin.com/docs/latest/
|
|
31
|
+
* See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
|
|
32
32
|
*
|
|
33
33
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
34
34
|
*/
|
|
@@ -28,7 +28,7 @@ import { Details } from '@vaadin/details/src/vaadin-details.js';
|
|
|
28
28
|
* `focus-ring` | Set when the element is focused using the keyboard.
|
|
29
29
|
* `focused` | Set when the element is focused.
|
|
30
30
|
*
|
|
31
|
-
* See [Styling Components](https://vaadin.com/docs/latest/
|
|
31
|
+
* See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
|
|
32
32
|
*
|
|
33
33
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
34
34
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
-
import { AccordionPanel } from './vaadin-accordion-panel.js';
|
|
8
|
+
import type { AccordionPanel } from './vaadin-accordion-panel.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Fired when the `items` property changes.
|
|
@@ -23,7 +23,7 @@ export interface AccordionCustomEventMap {
|
|
|
23
23
|
'opened-changed': AccordionOpenedChangedEvent;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export type AccordionEventMap =
|
|
26
|
+
export type AccordionEventMap = AccordionCustomEventMap & HTMLElementEventMap;
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* `<vaadin-accordion>` is a Web Component implementing accordion widget —
|
|
@@ -64,7 +64,7 @@ export type AccordionEventMap = HTMLElementEventMap & AccordionCustomEventMap;
|
|
|
64
64
|
* }
|
|
65
65
|
* ```
|
|
66
66
|
*
|
|
67
|
-
* See [Styling Components](https://vaadin.com/docs/latest/
|
|
67
|
+
* See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
|
|
68
68
|
*
|
|
69
69
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
|
70
70
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
@@ -87,13 +87,13 @@ declare class Accordion extends ElementMixin(ThemableMixin(HTMLElement)) {
|
|
|
87
87
|
addEventListener<K extends keyof AccordionEventMap>(
|
|
88
88
|
type: K,
|
|
89
89
|
listener: (this: Accordion, ev: AccordionEventMap[K]) => void,
|
|
90
|
-
options?:
|
|
90
|
+
options?: AddEventListenerOptions | boolean,
|
|
91
91
|
): void;
|
|
92
92
|
|
|
93
93
|
removeEventListener<K extends keyof AccordionEventMap>(
|
|
94
94
|
type: K,
|
|
95
95
|
listener: (this: Accordion, ev: AccordionEventMap[K]) => void,
|
|
96
|
-
options?:
|
|
96
|
+
options?: EventListenerOptions | boolean,
|
|
97
97
|
): void;
|
|
98
98
|
}
|
|
99
99
|
|
package/src/vaadin-accordion.js
CHANGED
|
@@ -48,7 +48,7 @@ import { AccordionPanel } from './vaadin-accordion-panel.js';
|
|
|
48
48
|
* }
|
|
49
49
|
* ```
|
|
50
50
|
*
|
|
51
|
-
* See [Styling Components](https://vaadin.com/docs/latest/
|
|
51
|
+
* See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
|
|
52
52
|
*
|
|
53
53
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
|
54
54
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
package/web-types.json
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/web-types",
|
|
3
|
+
"name": "@vaadin/accordion",
|
|
4
|
+
"version": "23.2.1",
|
|
5
|
+
"description-markup": "markdown",
|
|
6
|
+
"contributions": {
|
|
7
|
+
"html": {
|
|
8
|
+
"elements": [
|
|
9
|
+
{
|
|
10
|
+
"name": "vaadin-accordion-panel",
|
|
11
|
+
"description": "The accordion panel element.\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`summary` | The element used to open and close collapsible content.\n`toggle` | The element used as indicator, can represent an icon.\n`summary-content`| The wrapper for the slotted summary content.\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.",
|
|
12
|
+
"attributes": [
|
|
13
|
+
{
|
|
14
|
+
"name": "disabled",
|
|
15
|
+
"description": "If true, the user cannot interact with this element.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"boolean",
|
|
19
|
+
"null",
|
|
20
|
+
"undefined"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "autofocus",
|
|
26
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
27
|
+
"value": {
|
|
28
|
+
"type": [
|
|
29
|
+
"boolean",
|
|
30
|
+
"null",
|
|
31
|
+
"undefined"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "opened",
|
|
37
|
+
"description": "If true, the details content is visible.",
|
|
38
|
+
"value": {
|
|
39
|
+
"type": [
|
|
40
|
+
"boolean"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "theme",
|
|
46
|
+
"description": "The theme variants to apply to the component.",
|
|
47
|
+
"value": {
|
|
48
|
+
"type": [
|
|
49
|
+
"string",
|
|
50
|
+
"null",
|
|
51
|
+
"undefined"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"js": {
|
|
57
|
+
"properties": [
|
|
58
|
+
{
|
|
59
|
+
"name": "disabled",
|
|
60
|
+
"description": "If true, the user cannot interact with this element.",
|
|
61
|
+
"value": {
|
|
62
|
+
"type": [
|
|
63
|
+
"boolean",
|
|
64
|
+
"null",
|
|
65
|
+
"undefined"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "autofocus",
|
|
71
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
72
|
+
"value": {
|
|
73
|
+
"type": [
|
|
74
|
+
"boolean",
|
|
75
|
+
"null",
|
|
76
|
+
"undefined"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "opened",
|
|
82
|
+
"description": "If true, the details content is visible.",
|
|
83
|
+
"value": {
|
|
84
|
+
"type": [
|
|
85
|
+
"boolean"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"events": [
|
|
91
|
+
{
|
|
92
|
+
"name": "opened-changed",
|
|
93
|
+
"description": "Fired when the `opened` property changes."
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "vaadin-accordion",
|
|
100
|
+
"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 <div slot=\"summary\">Panel 1</div>\n This panel is opened, so the text is visible by default.\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <div slot=\"summary\">Panel 2</div>\n After opening this panel, the first one becomes closed.\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nSee the [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/23.2.1/#/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.",
|
|
101
|
+
"attributes": [
|
|
102
|
+
{
|
|
103
|
+
"name": "opened",
|
|
104
|
+
"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.",
|
|
105
|
+
"value": {
|
|
106
|
+
"type": [
|
|
107
|
+
"number"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "theme",
|
|
113
|
+
"description": "The theme variants to apply to the component.",
|
|
114
|
+
"value": {
|
|
115
|
+
"type": [
|
|
116
|
+
"string",
|
|
117
|
+
"null",
|
|
118
|
+
"undefined"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"js": {
|
|
124
|
+
"properties": [
|
|
125
|
+
{
|
|
126
|
+
"name": "opened",
|
|
127
|
+
"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.",
|
|
128
|
+
"value": {
|
|
129
|
+
"type": [
|
|
130
|
+
"number"
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"events": [
|
|
136
|
+
{
|
|
137
|
+
"name": "opened-changed",
|
|
138
|
+
"description": "Fired when the `opened` property changes."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "items-changed",
|
|
142
|
+
"description": "Fired when the `items` property changes."
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/web-types",
|
|
3
|
+
"name": "@vaadin/accordion",
|
|
4
|
+
"version": "23.2.1",
|
|
5
|
+
"description-markup": "markdown",
|
|
6
|
+
"framework": "lit",
|
|
7
|
+
"framework-config": {
|
|
8
|
+
"enable-when": {
|
|
9
|
+
"node-packages": [
|
|
10
|
+
"lit"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"contributions": {
|
|
15
|
+
"html": {
|
|
16
|
+
"elements": [
|
|
17
|
+
{
|
|
18
|
+
"name": "vaadin-accordion-panel",
|
|
19
|
+
"description": "The accordion panel element.\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`summary` | The element used to open and close collapsible content.\n`toggle` | The element used as indicator, can represent an icon.\n`summary-content`| The wrapper for the slotted summary content.\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.",
|
|
20
|
+
"extension": true,
|
|
21
|
+
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": "?disabled",
|
|
24
|
+
"description": "If true, the user cannot interact with this element.",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "?autofocus",
|
|
31
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
32
|
+
"value": {
|
|
33
|
+
"kind": "expression"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "?opened",
|
|
38
|
+
"description": "If true, the details content is visible.",
|
|
39
|
+
"value": {
|
|
40
|
+
"kind": "expression"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "@opened-changed",
|
|
45
|
+
"description": "Fired when the `opened` property changes.",
|
|
46
|
+
"value": {
|
|
47
|
+
"kind": "expression"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "vaadin-accordion",
|
|
54
|
+
"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 <div slot=\"summary\">Panel 1</div>\n This panel is opened, so the text is visible by default.\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <div slot=\"summary\">Panel 2</div>\n After opening this panel, the first one becomes closed.\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nSee the [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/23.2.1/#/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.",
|
|
55
|
+
"extension": true,
|
|
56
|
+
"attributes": [
|
|
57
|
+
{
|
|
58
|
+
"name": ".opened",
|
|
59
|
+
"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.",
|
|
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
|
+
{
|
|
72
|
+
"name": "@items-changed",
|
|
73
|
+
"description": "Fired when the `items` property changes.",
|
|
74
|
+
"value": {
|
|
75
|
+
"kind": "expression"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|