@vaadin/details 24.0.0-alpha9 → 24.0.0-beta2

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/details",
3
- "version": "24.0.0-alpha9",
3
+ "version": "24.0.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,20 +37,20 @@
37
37
  "dependencies": {
38
38
  "@open-wc/dedupe-mixin": "^1.3.0",
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/button": "24.0.0-alpha9",
41
- "@vaadin/component-base": "24.0.0-alpha9",
42
- "@vaadin/vaadin-lumo-styles": "24.0.0-alpha9",
43
- "@vaadin/vaadin-material-styles": "24.0.0-alpha9",
44
- "@vaadin/vaadin-themable-mixin": "24.0.0-alpha9"
40
+ "@vaadin/button": "24.0.0-beta2",
41
+ "@vaadin/component-base": "24.0.0-beta2",
42
+ "@vaadin/vaadin-lumo-styles": "24.0.0-beta2",
43
+ "@vaadin/vaadin-material-styles": "24.0.0-beta2",
44
+ "@vaadin/vaadin-themable-mixin": "24.0.0-beta2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@esm-bundle/chai": "^4.3.4",
48
- "@vaadin/testing-helpers": "^0.3.2",
48
+ "@vaadin/testing-helpers": "^0.4.0",
49
49
  "sinon": "^13.0.2"
50
50
  },
51
51
  "web-types": [
52
52
  "web-types.json",
53
53
  "web-types.lit.json"
54
54
  ],
55
- "gitHead": "cc3f747164041566b300bde4b105d2475649e93f"
55
+ "gitHead": "00086f1f6d487f042f189c9b9ecd7ba736960888"
56
56
  }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+
8
+ /**
9
+ * A mixin providing common functionality for making content collapsible,
10
+ * used by `<vaadin-details>` and `<vaadin-accordion-panel>` elements.
11
+ */
12
+ export declare function CollapsibleMixin<T extends Constructor<HTMLElement>>(
13
+ base: T,
14
+ ): Constructor<CollapsibleMixinClass> & T;
15
+
16
+ export declare class CollapsibleMixinClass {
17
+ /**
18
+ * If true, the collapsible content is visible.
19
+ */
20
+ opened: boolean;
21
+
22
+ /**
23
+ * List of elements assigned to the default `<slot>`
24
+ * that represent the collapsible content.
25
+ */
26
+ protected _contentElements: HTMLElement[];
27
+ }
@@ -6,12 +6,13 @@
6
6
  import { ContentController } from './content-controller.js';
7
7
 
8
8
  /**
9
- * A mixin providing common details functionality.
9
+ * A mixin providing common functionality for making content collapsible,
10
+ * used by `<vaadin-details>` and `<vaadin-accordion-panel>` elements.
10
11
  *
11
12
  * @polymerMixin
12
13
  */
13
- export const DetailsMixin = (superClass) =>
14
- class DetailsMixinClass extends superClass {
14
+ export const CollapsibleMixin = (superClass) =>
15
+ class CollapsibleMixinClass extends superClass {
15
16
  static get properties() {
16
17
  return {
17
18
  /**
@@ -26,7 +27,8 @@ export const DetailsMixin = (superClass) =>
26
27
  },
27
28
 
28
29
  /**
29
- * List of elements passed to the details default slot.
30
+ * List of elements assigned to the default `<slot>`
31
+ * that represent the collapsible content.
30
32
  *
31
33
  * @protected
32
34
  */
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2019 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
7
+ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
8
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
+
10
+ /**
11
+ * The details summary element.
12
+ *
13
+ * ### Styling
14
+ *
15
+ * The following shadow DOM parts are exposed for styling:
16
+ *
17
+ * Part name | Description
18
+ * -----------|-------------------
19
+ * `toggle` | The icon element
20
+ * `content` | The content wrapper
21
+ *
22
+ * The following state attributes are available for styling:
23
+ *
24
+ * Attribute | Description
25
+ * -------------| -----------
26
+ * `active` | Set when the element is pressed down, either with mouse, touch or the keyboard.
27
+ * `opened` | Set when the element is expanded and related collapsible content is visible.
28
+ * `disabled` | Set when the element is disabled.
29
+ * `focus-ring` | Set when the element is focused using the keyboard.
30
+ * `focused` | Set when the element is focused.
31
+ *
32
+ * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
33
+ */
34
+ declare class DetailsSummary extends ButtonMixin(DirMixin(ThemableMixin(HTMLElement))) {
35
+ /**
36
+ * When true, the element is opened.
37
+ */
38
+ opened: boolean;
39
+ }
40
+
41
+ declare global {
42
+ interface HTMLElementTagNameMap {
43
+ 'vaadin-details-summary': DetailsSummary;
44
+ }
45
+ }
46
+
47
+ export { DetailsSummary };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
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';
@@ -11,6 +11,27 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
11
11
  /**
12
12
  * The details summary element.
13
13
  *
14
+ * ### Styling
15
+ *
16
+ * The following shadow DOM parts are exposed for styling:
17
+ *
18
+ * Part name | Description
19
+ * -----------|-------------------
20
+ * `toggle` | The icon element
21
+ * `content` | The content wrapper
22
+ *
23
+ * The following state attributes are available for styling:
24
+ *
25
+ * Attribute | Description
26
+ * -------------| -----------
27
+ * `active` | Set when the element is pressed down, either with mouse, touch or the keyboard.
28
+ * `opened` | Set when the element is expanded and related collapsible content is visible.
29
+ * `disabled` | Set when the element is disabled.
30
+ * `focus-ring` | Set when the element is focused using the keyboard.
31
+ * `focused` | Set when the element is focused.
32
+ *
33
+ * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
34
+ *
14
35
  * @extends HTMLElement
15
36
  * @mixes ButtonMixin
16
37
  * @mixes DirMixin
@@ -8,7 +8,7 @@ import { DelegateFocusMixin } from '@vaadin/component-base/src/delegate-focus-mi
8
8
  import { DelegateStateMixin } from '@vaadin/component-base/src/delegate-state-mixin.js';
9
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { DetailsMixin } from './vaadin-details-mixin.js';
11
+ import { CollapsibleMixin } from './collapsible-mixin.js';
12
12
 
13
13
  /**
14
14
  * Fired when the `opened` property changes.
@@ -58,7 +58,7 @@ export type DetailsEventMap = DetailsCustomEventMap & HTMLElementEventMap;
58
58
  *
59
59
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
60
60
  */
61
- declare class Details extends DetailsMixin(
61
+ declare class Details extends CollapsibleMixin(
62
62
  DelegateStateMixin(DelegateFocusMixin(ElementMixin(ThemableMixin(ControllerMixin(HTMLElement))))),
63
63
  ) {
64
64
  /**
@@ -11,8 +11,8 @@ import { DelegateStateMixin } from '@vaadin/component-base/src/delegate-state-mi
11
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
12
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
13
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
+ import { CollapsibleMixin } from './collapsible-mixin.js';
14
15
  import { SummaryController } from './summary-controller.js';
15
- import { DetailsMixin } from './vaadin-details-mixin.js';
16
16
 
17
17
  /**
18
18
  * `<vaadin-details>` is a Web Component which the creates an
@@ -52,14 +52,14 @@ import { DetailsMixin } from './vaadin-details-mixin.js';
52
52
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
53
53
  *
54
54
  * @extends HTMLElement
55
+ * @mixes CollapsibleMixin
55
56
  * @mixes ControllerMixin
56
- * @mixes DetailsMixin
57
57
  * @mixes DelegateFocusMixin
58
58
  * @mixes DelegateStateMixin
59
59
  * @mixes ElementMixin
60
60
  * @mixes ThemableMixin
61
61
  */
62
- class Details extends DetailsMixin(
62
+ class Details extends CollapsibleMixin(
63
63
  DelegateStateMixin(DelegateFocusMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement))))),
64
64
  ) {
65
65
  static get template() {
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/details",
4
- "version": "24.0.0-alpha9",
4
+ "version": "24.0.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-details-summary",
11
- "description": "The details summary element.",
11
+ "description": "The details summary element.\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------|-------------------\n`toggle` | The icon element\n`content` | The content wrapper\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------| -----------\n`active` | Set when the element is pressed down, either with mouse, touch or the keyboard.\n`opened` | Set when the element is expanded and related collapsible content is 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
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/details",
4
- "version": "24.0.0-alpha9",
4
+ "version": "24.0.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-details-summary",
19
- "description": "The details summary element.",
19
+ "description": "The details summary element.\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------|-------------------\n`toggle` | The icon element\n`content` | The content wrapper\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------| -----------\n`active` | Set when the element is pressed down, either with mouse, touch or the keyboard.\n`opened` | Set when the element is expanded and related collapsible content is 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
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -1,23 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import type { Constructor } from '@open-wc/dedupe-mixin';
7
-
8
- /**
9
- * A mixin providing common details functionality.
10
- */
11
- export declare function DetailsMixin<T extends Constructor<HTMLElement>>(base: T): Constructor<DetailsMixinClass> & T;
12
-
13
- export declare class DetailsMixinClass {
14
- /**
15
- * If true, the collapsible content is visible.
16
- */
17
- opened: boolean;
18
-
19
- /**
20
- * List of elements passed to the details default slot.
21
- */
22
- protected _contentElements: HTMLElement[];
23
- }