@vaadin/accordion 24.8.0-alpha9 → 24.8.0-rc1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/accordion",
3
- "version": "24.8.0-alpha9",
3
+ "version": "24.8.0-rc1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,10 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
+ "!src/vaadin-accordion-heading-base-styles.d.ts",
25
+ "!src/vaadin-accordion-heading-base-styles.js",
26
+ "!src/vaadin-accordion-panel-base-styles.d.ts",
27
+ "!src/vaadin-accordion-panel-base-styles.js",
24
28
  "theme",
25
29
  "vaadin-*.d.ts",
26
30
  "vaadin-*.js",
@@ -37,17 +41,17 @@
37
41
  "dependencies": {
38
42
  "@open-wc/dedupe-mixin": "^1.3.0",
39
43
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "24.8.0-alpha9",
41
- "@vaadin/component-base": "24.8.0-alpha9",
42
- "@vaadin/details": "24.8.0-alpha9",
43
- "@vaadin/vaadin-lumo-styles": "24.8.0-alpha9",
44
- "@vaadin/vaadin-material-styles": "24.8.0-alpha9",
45
- "@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
44
+ "@vaadin/a11y-base": "24.8.0-rc1",
45
+ "@vaadin/component-base": "24.8.0-rc1",
46
+ "@vaadin/details": "24.8.0-rc1",
47
+ "@vaadin/vaadin-lumo-styles": "24.8.0-rc1",
48
+ "@vaadin/vaadin-material-styles": "24.8.0-rc1",
49
+ "@vaadin/vaadin-themable-mixin": "24.8.0-rc1",
46
50
  "lit": "^3.0.0"
47
51
  },
48
52
  "devDependencies": {
49
- "@vaadin/chai-plugins": "24.8.0-alpha9",
50
- "@vaadin/test-runner-commands": "24.8.0-alpha9",
53
+ "@vaadin/chai-plugins": "24.8.0-rc1",
54
+ "@vaadin/test-runner-commands": "24.8.0-rc1",
51
55
  "@vaadin/testing-helpers": "^1.1.0",
52
56
  "sinon": "^18.0.0"
53
57
  },
@@ -55,5 +59,5 @@
55
59
  "web-types.json",
56
60
  "web-types.lit.json"
57
61
  ],
58
- "gitHead": "4de3809275ddfd733b0d13fd02af8faf73eb6770"
62
+ "gitHead": "901d3eb9224983fd81e222e2fa5c7c207f9a6e46"
59
63
  }
@@ -8,7 +8,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
10
  import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { accordionHeading } from './vaadin-accordion-heading-styles.js';
11
+ import { accordionHeading } from './vaadin-accordion-heading-core-styles.js';
12
12
 
13
13
  registerStyles('vaadin-accordion-heading', accordionHeading, { moduleId: 'vaadin-accordion-heading-styles' });
14
14
 
@@ -114,10 +114,12 @@ export const AccordionMixin = (superClass) =>
114
114
  /** @private */
115
115
  _updateItems(items, opened) {
116
116
  if (items) {
117
+ this.__itemsSync = true;
117
118
  const itemToOpen = items[opened];
118
119
  items.forEach((item) => {
119
120
  item.opened = item === itemToOpen;
120
121
  });
122
+ this.__itemsSync = false;
121
123
  }
122
124
  }
123
125
 
@@ -140,6 +142,11 @@ export const AccordionMixin = (superClass) =>
140
142
 
141
143
  /** @private */
142
144
  _updateOpened(e) {
145
+ // Item sync applies the current opened index to each item, in which
146
+ // case we don't need to update the opened index again.
147
+ if (this.__itemsSync) {
148
+ return;
149
+ }
143
150
  const target = this._filterItems(e.composedPath())[0];
144
151
  const idx = this.items.indexOf(target);
145
152
  if (e.detail.value) {
@@ -57,6 +57,21 @@ export const AccordionPanelMixin = (superClass) =>
57
57
  this._tooltipController.setPosition('bottom-start');
58
58
  }
59
59
 
60
+ /**
61
+ * @protected
62
+ * @override
63
+ */
64
+ __forwardTabIndex(tabindex) {
65
+ super.__forwardTabIndex(tabindex);
66
+ if (tabindex !== undefined && this.focusElement) {
67
+ // Forward the tabIndex to the button inside the heading
68
+ // instead of the heading itself
69
+ this.focusElement.$.button.tabIndex = tabindex;
70
+ // Revert the tabIndex value of the heading
71
+ this.focusElement.tabIndex = -1;
72
+ }
73
+ }
74
+
60
75
  /** @protected */
61
76
  ready() {
62
77
  super.ready();
@@ -8,8 +8,8 @@ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
8
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
9
9
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
10
  import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import { accordionPanel } from './vaadin-accordion-panel-core-styles.js';
11
12
  import { AccordionPanelMixin } from './vaadin-accordion-panel-mixin.js';
12
- import { accordionPanel } from './vaadin-accordion-panel-styles.js';
13
13
 
14
14
  registerStyles('vaadin-accordion-panel', accordionPanel, { moduleId: 'vaadin-accordion-panel-styles' });
15
15
 
@@ -9,7 +9,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
10
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { accordionHeading } from './vaadin-accordion-heading-styles.js';
12
+ import { accordionHeading } from './vaadin-accordion-heading-core-styles.js';
13
13
 
14
14
  /**
15
15
  * LitElement based version of `<vaadin-accordion-heading>` web component.
@@ -8,8 +8,8 @@ import { html, LitElement } from 'lit';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import { accordionPanel } from './vaadin-accordion-panel-core-styles.js';
11
12
  import { AccordionPanelMixin } from './vaadin-accordion-panel-mixin.js';
12
- import { accordionPanel } from './vaadin-accordion-panel-styles.js';
13
13
 
14
14
  /**
15
15
  * LitElement based version of `<vaadin-accordion-panel>` web component.
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.8.0-alpha9",
4
+ "version": "24.8.0-rc1",
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```\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.8.0-alpha9/#/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/styling-components) documentation.",
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```\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.8.0-rc1/#/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/styling-components) documentation.",
189
189
  "attributes": [
190
190
  {
191
191
  "name": "opened",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/accordion",
4
- "version": "24.8.0-alpha9",
4
+ "version": "24.8.0-rc1",
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```\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.8.0-alpha9/#/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/styling-components) documentation.",
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```\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.8.0-rc1/#/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/styling-components) documentation.",
83
83
  "extension": true,
84
84
  "attributes": [
85
85
  {
@@ -1 +0,0 @@
1
- export * from './vaadin-accordion-heading.js';
@@ -1 +0,0 @@
1
- export * from './vaadin-accordion-panel.js';
@@ -1 +0,0 @@
1
- export * from './vaadin-accordion.js';