@vaadin/dialog 24.8.4 → 25.0.0-alpha10

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.
Files changed (32) hide show
  1. package/README.md +0 -23
  2. package/package.json +14 -15
  3. package/src/lit/renderer-directives.d.ts +0 -1
  4. package/src/styles/vaadin-dialog-overlay-base-styles.d.ts +10 -0
  5. package/src/styles/vaadin-dialog-overlay-base-styles.js +216 -0
  6. package/src/{vaadin-dialog-styles.d.ts → styles/vaadin-dialog-overlay-core-styles.d.ts} +2 -2
  7. package/src/{vaadin-dialog-styles.js → styles/vaadin-dialog-overlay-core-styles.js} +5 -2
  8. package/src/vaadin-dialog-base-mixin.d.ts +1 -13
  9. package/src/vaadin-dialog-base-mixin.js +16 -19
  10. package/src/vaadin-dialog-overlay-mixin.d.ts +0 -14
  11. package/src/vaadin-dialog-overlay-mixin.js +27 -31
  12. package/src/vaadin-dialog-overlay.d.ts +1 -1
  13. package/src/vaadin-dialog-overlay.js +15 -11
  14. package/src/vaadin-dialog-resizable-mixin.js +2 -14
  15. package/src/vaadin-dialog-size-mixin.d.ts +24 -0
  16. package/src/vaadin-dialog-size-mixin.js +40 -0
  17. package/src/vaadin-dialog.d.ts +11 -23
  18. package/src/vaadin-dialog.js +60 -78
  19. package/web-types.json +33 -55
  20. package/web-types.lit.json +14 -21
  21. package/src/vaadin-lit-dialog-overlay.js +0 -51
  22. package/src/vaadin-lit-dialog.js +0 -99
  23. package/theme/lumo/vaadin-lit-dialog.d.ts +0 -2
  24. package/theme/lumo/vaadin-lit-dialog.js +0 -2
  25. package/theme/material/vaadin-dialog-styles.d.ts +0 -4
  26. package/theme/material/vaadin-dialog-styles.js +0 -64
  27. package/theme/material/vaadin-dialog.d.ts +0 -2
  28. package/theme/material/vaadin-dialog.js +0 -2
  29. package/theme/material/vaadin-lit-dialog.d.ts +0 -2
  30. package/theme/material/vaadin-lit-dialog.js +0 -2
  31. package/vaadin-lit-dialog.d.ts +0 -1
  32. package/vaadin-lit-dialog.js +0 -2
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2025 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
+ export declare function DialogSizeMixin<T extends Constructor<HTMLElement>>(
9
+ base: T,
10
+ ): Constructor<DialogSizeMixinClass> & T;
11
+
12
+ export declare class DialogSizeMixinClass {
13
+ /**
14
+ * Set the width of the overlay.
15
+ * If a unitless number is provided, pixels are assumed.
16
+ */
17
+ width: string | null;
18
+
19
+ /**
20
+ * Set the height of the overlay.
21
+ * If a unitless number is provided, pixels are assumed.
22
+ */
23
+ height: string | null;
24
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
7
+ /**
8
+ * @polymerMixin
9
+ */
10
+ export const DialogSizeMixin = (superClass) =>
11
+ class DialogSizeMixinClass extends superClass {
12
+ static get properties() {
13
+ return {
14
+ /**
15
+ * Set the width of the overlay.
16
+ * If a unitless number is provided, pixels are assumed.
17
+ */
18
+ width: {
19
+ type: String,
20
+ },
21
+
22
+ /**
23
+ * Set the height of the overlay.
24
+ * If a unitless number is provided, pixels are assumed.
25
+ */
26
+ height: {
27
+ type: String,
28
+ },
29
+ };
30
+ }
31
+
32
+ static get observers() {
33
+ return ['__sizeChanged(width, height)'];
34
+ }
35
+
36
+ /** @private */
37
+ __sizeChanged(width, height) {
38
+ requestAnimationFrame(() => this.$.overlay.setBounds({ width, height }, false));
39
+ }
40
+ };
@@ -10,8 +10,9 @@ import { DialogBaseMixin } from './vaadin-dialog-base-mixin.js';
10
10
  import { DialogDraggableMixin } from './vaadin-dialog-draggable-mixin.js';
11
11
  import { DialogRendererMixin } from './vaadin-dialog-renderer-mixin.js';
12
12
  import { DialogResizableMixin } from './vaadin-dialog-resizable-mixin.js';
13
+ import { DialogSizeMixin } from './vaadin-dialog-size-mixin.js';
13
14
 
14
- export { DialogOverlay, DialogOverlayBounds, DialogOverlayBoundsParam } from './vaadin-dialog-overlay.js';
15
+ export { DialogOverlay, DialogOverlayBounds } from './vaadin-dialog-overlay.js';
15
16
 
16
17
  export type DialogRenderer = (root: HTMLElement, dialog: Dialog) => void;
17
18
 
@@ -20,8 +21,6 @@ export type DialogResizableDirection = 'e' | 'n' | 'ne' | 'nw' | 's' | 'se' | 's
20
21
  export type DialogResizeDimensions = {
21
22
  width: string;
22
23
  height: string;
23
- contentWidth: string;
24
- contentHeight: string;
25
24
  top: string;
26
25
  left: string;
27
26
  };
@@ -92,16 +91,13 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap;
92
91
  *
93
92
  * ### Styling
94
93
  *
95
- * `<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal
96
- * themable component as the actual visible dialog overlay.
97
- *
98
- * See [`<vaadin-overlay>`](#/elements/vaadin-overlay) documentation.
99
- * for `<vaadin-dialog-overlay>` parts.
100
- *
101
- * In addition to `<vaadin-overlay>` parts, the following parts are available for styling:
94
+ * The following shadow DOM parts are available for styling:
102
95
  *
103
96
  * Part name | Description
104
97
  * -----------------|-------------------------------------------
98
+ * `backdrop` | Backdrop of the overlay
99
+ * `overlay` | The overlay container
100
+ * `content` | The overlay content
105
101
  * `header` | Element wrapping title and header content
106
102
  * `header-content` | Element wrapping the header content slot
107
103
  * `title` | Element wrapping the title slot
@@ -116,9 +112,6 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap;
116
112
  * `has-footer` | Set when the element has footer renderer
117
113
  * `overflow` | Set to `top`, `bottom`, none or both
118
114
  *
119
- * Note: the `theme` attribute value set on `<vaadin-dialog>` is
120
- * propagated to the internal `<vaadin-dialog-overlay>` component.
121
- *
122
115
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
123
116
  *
124
117
  * @fires {CustomEvent} resize - Fired when the dialog resize is finished.
@@ -126,18 +119,13 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap;
126
119
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
127
120
  * @fires {CustomEvent} closed - Fired when the dialog is closed.
128
121
  */
129
- declare class Dialog extends DialogDraggableMixin(
130
- DialogResizableMixin(
131
- DialogRendererMixin(DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(HTMLElement))))),
122
+ declare class Dialog extends DialogSizeMixin(
123
+ DialogDraggableMixin(
124
+ DialogResizableMixin(
125
+ DialogRendererMixin(DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(HTMLElement))))),
126
+ ),
132
127
  ),
133
128
  ) {
134
- /**
135
- * Set the `aria-label` attribute for assistive technologies like
136
- * screen readers. An empty string value for this property (the
137
- * default) means that the `aria-label` attribute is not present.
138
- */
139
- ariaLabel: string;
140
-
141
129
  addEventListener<K extends keyof DialogEventMap>(
142
130
  type: K,
143
131
  listener: (this: Dialog, ev: DialogEventMap[K]) => void,
@@ -4,16 +4,18 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-dialog-overlay.js';
7
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { css, html, LitElement } from 'lit';
8
+ import { ifDefined } from 'lit/directives/if-defined.js';
8
9
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
11
  import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
11
- import { processTemplates } from '@vaadin/component-base/src/templates.js';
12
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
13
  import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
13
14
  import { DialogBaseMixin } from './vaadin-dialog-base-mixin.js';
14
15
  import { DialogDraggableMixin } from './vaadin-dialog-draggable-mixin.js';
15
16
  import { DialogRendererMixin } from './vaadin-dialog-renderer-mixin.js';
16
17
  import { DialogResizableMixin } from './vaadin-dialog-resizable-mixin.js';
18
+ import { DialogSizeMixin } from './vaadin-dialog-size-mixin.js';
17
19
 
18
20
  export { DialogOverlay } from './vaadin-dialog-overlay.js';
19
21
 
@@ -46,16 +48,13 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
46
48
  *
47
49
  * ### Styling
48
50
  *
49
- * `<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal
50
- * themable component as the actual visible dialog overlay.
51
- *
52
- * See [`<vaadin-overlay>`](#/elements/vaadin-overlay) documentation.
53
- * for `<vaadin-dialog-overlay>` parts.
54
- *
55
- * In addition to `<vaadin-overlay>` parts, the following parts are available for styling:
51
+ * The following shadow DOM parts are available for styling:
56
52
  *
57
53
  * Part name | Description
58
54
  * -----------------|-------------------------------------------
55
+ * `backdrop` | Backdrop of the overlay
56
+ * `overlay` | The overlay container
57
+ * `content` | The overlay content
59
58
  * `header` | Element wrapping title and header content
60
59
  * `header-content` | Element wrapping the header content slot
61
60
  * `title` | Element wrapping the title slot
@@ -70,9 +69,6 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
70
69
  * `has-footer` | Set when the element has footer renderer
71
70
  * `overflow` | Set to `top`, `bottom`, none or both
72
71
  *
73
- * Note: the `theme` attribute value set on `<vaadin-dialog>` is
74
- * propagated to the internal `<vaadin-dialog-overlay>` component.
75
- *
76
72
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
77
73
  *
78
74
  * @fires {CustomEvent} resize - Fired when the dialog resize is finished.
@@ -88,87 +84,73 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
88
84
  * @mixes DialogDraggableMixin
89
85
  * @mixes DialogRendererMixin
90
86
  * @mixes DialogResizableMixin
87
+ * @mixes DialogSizeMixin
91
88
  * @mixes OverlayClassMixin
92
89
  */
93
- class Dialog extends DialogDraggableMixin(
94
- DialogResizableMixin(
95
- DialogRendererMixin(DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolymerElement))))),
90
+ class Dialog extends DialogSizeMixin(
91
+ DialogDraggableMixin(
92
+ DialogResizableMixin(
93
+ DialogRendererMixin(
94
+ DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(LitElement))))),
95
+ ),
96
+ ),
96
97
  ),
97
98
  ) {
98
- static get template() {
99
- return html`
100
- <style>
101
- :host {
102
- display: none !important;
103
- }
104
- </style>
105
-
106
- <vaadin-dialog-overlay
107
- id="overlay"
108
- role$="[[overlayRole]]"
109
- header-title="[[headerTitle]]"
110
- on-opened-changed="_onOverlayOpened"
111
- on-mousedown="_bringOverlayToFront"
112
- on-touchstart="_bringOverlayToFront"
113
- theme$="[[_theme]]"
114
- modeless="[[modeless]]"
115
- with-backdrop="[[!modeless]]"
116
- resizable$="[[resizable]]"
117
- restore-focus-on-close
118
- focus-trap
119
- ></vaadin-dialog-overlay>
120
- `;
121
- }
122
-
123
99
  static get is() {
124
100
  return 'vaadin-dialog';
125
101
  }
126
102
 
127
- static get properties() {
128
- return {
129
- /**
130
- * Set the `aria-label` attribute for assistive technologies like
131
- * screen readers. An empty string value for this property (the
132
- * default) means that the `aria-label` attribute is not present.
133
- */
134
- ariaLabel: {
135
- type: String,
136
- value: '',
137
- },
138
- };
139
- }
103
+ static get styles() {
104
+ return css`
105
+ :host([opened]),
106
+ :host([opening]),
107
+ :host([closing]) {
108
+ display: contents !important;
109
+ }
140
110
 
141
- static get observers() {
142
- return [
143
- '_openedChanged(opened)',
144
- '_ariaLabelChanged(ariaLabel, headerTitle)',
145
- '_rendererChanged(renderer, headerRenderer, footerRenderer)',
146
- ];
111
+ :host,
112
+ :host([hidden]) {
113
+ display: none !important;
114
+ }
115
+ `;
147
116
  }
148
117
 
149
118
  /** @protected */
150
- ready() {
151
- super.ready();
152
-
153
- processTemplates(this);
154
- }
155
-
156
- /** @private */
157
- _rendererChanged(renderer, headerRenderer, footerRenderer) {
158
- this.$.overlay.setProperties({ owner: this, renderer, headerRenderer, footerRenderer });
119
+ render() {
120
+ return html`
121
+ <vaadin-dialog-overlay
122
+ id="overlay"
123
+ .owner="${this}"
124
+ .opened="${this.opened}"
125
+ .headerTitle="${this.headerTitle}"
126
+ .renderer="${this.renderer}"
127
+ .headerRenderer="${this.headerRenderer}"
128
+ .footerRenderer="${this.footerRenderer}"
129
+ @opened-changed="${this._onOverlayOpened}"
130
+ @mousedown="${this._bringOverlayToFront}"
131
+ @touchstart="${this._bringOverlayToFront}"
132
+ theme="${ifDefined(this._theme)}"
133
+ .modeless="${this.modeless}"
134
+ .withBackdrop="${!this.modeless}"
135
+ ?resizable="${this.resizable}"
136
+ restore-focus-on-close
137
+ focus-trap
138
+ exportparts="backdrop, overlay, header, title, header-content, content, footer"
139
+ >
140
+ <slot name="title" slot="title"></slot>
141
+ <slot name="header-content" slot="header-content"></slot>
142
+ <slot name="footer" slot="footer"></slot>
143
+ <slot></slot>
144
+ </vaadin-dialog-overlay>
145
+ `;
159
146
  }
160
147
 
161
- /** @private */
162
- _openedChanged(opened) {
163
- this.$.overlay.opened = opened;
164
- }
148
+ /** @protected */
149
+ updated(props) {
150
+ super.updated(props);
165
151
 
166
- /** @private */
167
- _ariaLabelChanged(ariaLabel, headerTitle) {
168
- if (ariaLabel || headerTitle) {
169
- this.$.overlay.setAttribute('aria-label', ariaLabel || headerTitle);
170
- } else {
171
- this.$.overlay.removeAttribute('aria-label');
152
+ if (props.has('headerTitle')) {
153
+ this.ariaLabel = this.headerTitle;
172
154
  }
173
155
  }
174
156
  }
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dialog",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-dialog",
11
- "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal\nthemable component as the actual visible dialog overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.4/#/elements/vaadin-overlay) documentation.\nfor `<vaadin-dialog-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nNote: the `theme` attribute value set on `<vaadin-dialog>` is\npropagated to the internal `<vaadin-dialog-overlay>` component.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "opened",
@@ -69,8 +69,8 @@
69
69
  }
70
70
  },
71
71
  {
72
- "name": "width",
73
- "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
72
+ "name": "overlay-role",
73
+ "description": "The `role` attribute value to be set on the dialog. Defaults to \"dialog\".",
74
74
  "value": {
75
75
  "type": [
76
76
  "string",
@@ -80,19 +80,17 @@
80
80
  }
81
81
  },
82
82
  {
83
- "name": "height",
84
- "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
83
+ "name": "draggable",
84
+ "description": "Set to true to enable repositioning the dialog by clicking and dragging.\n\nBy default, only the overlay area can be used to drag the element. But,\na child element can be marked as a draggable area by adding a\n\"`draggable`\" class to it, this will by default make all of its children draggable also.\nIf you want a child element to be draggable\nbut still have its children non-draggable (by default), mark it with\n\"`draggable-leaf-only`\" class name.",
85
85
  "value": {
86
86
  "type": [
87
- "string",
88
- "null",
89
- "undefined"
87
+ "boolean"
90
88
  ]
91
89
  }
92
90
  },
93
91
  {
94
- "name": "overlay-role",
95
- "description": "The `role` attribute value to be set on the overlay. Defaults to \"dialog\".",
92
+ "name": "header-title",
93
+ "description": "String used for rendering a dialog title.\n\nIf both `headerTitle` and `headerRenderer` are defined, the title\nand the elements created by the renderer will be placed next to\neach other, with the title coming first.\n\nWhen `headerTitle` is set, the attribute `has-title` is added to the overlay element.",
96
94
  "value": {
97
95
  "type": [
98
96
  "string",
@@ -102,8 +100,8 @@
102
100
  }
103
101
  },
104
102
  {
105
- "name": "draggable",
106
- "description": "Set to true to enable repositioning the dialog by clicking and dragging.\n\nBy default, only the overlay area can be used to drag the element. But,\na child element can be marked as a draggable area by adding a\n\"`draggable`\" class to it, this will by default make all of its children draggable also.\nIf you want a child element to be draggable\nbut still have its children non-draggable (by default), mark it with\n\"`draggable-leaf-only`\" class name.",
103
+ "name": "resizable",
104
+ "description": "Set to true to enable resizing the dialog by dragging the corners and edges.",
107
105
  "value": {
108
106
  "type": [
109
107
  "boolean"
@@ -111,8 +109,8 @@
111
109
  }
112
110
  },
113
111
  {
114
- "name": "header-title",
115
- "description": "String used for rendering a dialog title.\n\nIf both `headerTitle` and `headerRenderer` are defined, the title\nand the elements created by the renderer will be placed next to\neach other, with the title coming first.\n\nWhen `headerTitle` is set, the attribute `has-title` is added to the overlay element.",
112
+ "name": "width",
113
+ "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
116
114
  "value": {
117
115
  "type": [
118
116
  "string",
@@ -122,17 +120,8 @@
122
120
  }
123
121
  },
124
122
  {
125
- "name": "resizable",
126
- "description": "Set to true to enable resizing the dialog by dragging the corners and edges.",
127
- "value": {
128
- "type": [
129
- "boolean"
130
- ]
131
- }
132
- },
133
- {
134
- "name": "overlay-class",
135
- "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
123
+ "name": "height",
124
+ "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
136
125
  "value": {
137
126
  "type": [
138
127
  "string",
@@ -142,8 +131,8 @@
142
131
  }
143
132
  },
144
133
  {
145
- "name": "aria-label",
146
- "description": "Set the `aria-label` attribute for assistive technologies like\nscreen readers. An empty string value for this property (the\ndefault) means that the `aria-label` attribute is not present.",
134
+ "name": "overlay-class",
135
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
147
136
  "value": {
148
137
  "type": [
149
138
  "string",
@@ -224,31 +213,9 @@
224
213
  ]
225
214
  }
226
215
  },
227
- {
228
- "name": "width",
229
- "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
230
- "value": {
231
- "type": [
232
- "string",
233
- "null",
234
- "undefined"
235
- ]
236
- }
237
- },
238
- {
239
- "name": "height",
240
- "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
241
- "value": {
242
- "type": [
243
- "string",
244
- "null",
245
- "undefined"
246
- ]
247
- }
248
- },
249
216
  {
250
217
  "name": "overlayRole",
251
- "description": "The `role` attribute value to be set on the overlay. Defaults to \"dialog\".",
218
+ "description": "The `role` attribute value to be set on the dialog. Defaults to \"dialog\".",
252
219
  "value": {
253
220
  "type": [
254
221
  "string",
@@ -317,8 +284,8 @@
317
284
  }
318
285
  },
319
286
  {
320
- "name": "overlayClass",
321
- "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
287
+ "name": "width",
288
+ "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
322
289
  "value": {
323
290
  "type": [
324
291
  "string",
@@ -328,8 +295,19 @@
328
295
  }
329
296
  },
330
297
  {
331
- "name": "ariaLabel",
332
- "description": "Set the `aria-label` attribute for assistive technologies like\nscreen readers. An empty string value for this property (the\ndefault) means that the `aria-label` attribute is not present.",
298
+ "name": "height",
299
+ "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
300
+ "value": {
301
+ "type": [
302
+ "string",
303
+ "null",
304
+ "undefined"
305
+ ]
306
+ }
307
+ },
308
+ {
309
+ "name": "overlayClass",
310
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
333
311
  "value": {
334
312
  "type": [
335
313
  "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dialog",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
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-dialog",
19
- "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal\nthemable component as the actual visible dialog overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.4/#/elements/vaadin-overlay) documentation.\nfor `<vaadin-dialog-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nNote: the `theme` attribute value set on `<vaadin-dialog>` is\npropagated to the internal `<vaadin-dialog-overlay>` component.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -75,23 +75,9 @@
75
75
  "kind": "expression"
76
76
  }
77
77
  },
78
- {
79
- "name": ".width",
80
- "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
81
- "value": {
82
- "kind": "expression"
83
- }
84
- },
85
- {
86
- "name": ".height",
87
- "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
88
- "value": {
89
- "kind": "expression"
90
- }
91
- },
92
78
  {
93
79
  "name": ".overlayRole",
94
- "description": "The `role` attribute value to be set on the overlay. Defaults to \"dialog\".",
80
+ "description": "The `role` attribute value to be set on the dialog. Defaults to \"dialog\".",
95
81
  "value": {
96
82
  "kind": "expression"
97
83
  }
@@ -125,15 +111,22 @@
125
111
  }
126
112
  },
127
113
  {
128
- "name": ".overlayClass",
129
- "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
114
+ "name": ".width",
115
+ "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
130
116
  "value": {
131
117
  "kind": "expression"
132
118
  }
133
119
  },
134
120
  {
135
- "name": ".ariaLabel",
136
- "description": "Set the `aria-label` attribute for assistive technologies like\nscreen readers. An empty string value for this property (the\ndefault) means that the `aria-label` attribute is not present.",
121
+ "name": ".height",
122
+ "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
123
+ "value": {
124
+ "kind": "expression"
125
+ }
126
+ },
127
+ {
128
+ "name": ".overlayClass",
129
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
137
130
  "value": {
138
131
  "kind": "expression"
139
132
  }
@@ -1,51 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { html, LitElement } from 'lit';
7
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
- import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
- import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
11
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
13
- import { dialogOverlay, resizableOverlay } from './vaadin-dialog-styles.js';
14
-
15
- /**
16
- * An element used internally by `<vaadin-dialog>`. Not intended to be used separately.
17
- *
18
- * @extends HTMLElement
19
- * @mixes DialogOverlayMixin
20
- * @mixes DirMixin
21
- * @mixes ThemableMixin
22
- * @private
23
- */
24
- export class DialogOverlay extends DialogOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
25
- static get is() {
26
- return 'vaadin-dialog-overlay';
27
- }
28
-
29
- static get styles() {
30
- return [overlayStyles, dialogOverlay, resizableOverlay];
31
- }
32
-
33
- /** @protected */
34
- render() {
35
- return html`
36
- <div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
37
- <div part="overlay" id="overlay" tabindex="0">
38
- <section id="resizerContainer" class="resizer-container">
39
- <header part="header">
40
- <div part="title"><slot name="title"></slot></div>
41
- <div part="header-content"><slot name="header-content"></slot></div>
42
- </header>
43
- <div part="content" id="content"><slot></slot></div>
44
- <footer part="footer"><slot name="footer"></slot></footer>
45
- </section>
46
- </div>
47
- `;
48
- }
49
- }
50
-
51
- defineCustomElement(DialogOverlay);