@vaadin/dialog 25.0.0-alpha2 → 25.0.0-alpha4

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/dialog",
3
- "version": "25.0.0-alpha2",
3
+ "version": "25.0.0-alpha4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,17 +37,17 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/component-base": "25.0.0-alpha2",
41
- "@vaadin/lit-renderer": "25.0.0-alpha2",
42
- "@vaadin/overlay": "25.0.0-alpha2",
43
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
44
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
40
+ "@vaadin/component-base": "25.0.0-alpha4",
41
+ "@vaadin/lit-renderer": "25.0.0-alpha4",
42
+ "@vaadin/overlay": "25.0.0-alpha4",
43
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha4",
44
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha4",
45
45
  "lit": "^3.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@vaadin/a11y-base": "25.0.0-alpha2",
49
- "@vaadin/chai-plugins": "25.0.0-alpha2",
50
- "@vaadin/test-runner-commands": "25.0.0-alpha2",
48
+ "@vaadin/a11y-base": "25.0.0-alpha4",
49
+ "@vaadin/chai-plugins": "25.0.0-alpha4",
50
+ "@vaadin/test-runner-commands": "25.0.0-alpha4",
51
51
  "@vaadin/testing-helpers": "^2.0.0",
52
52
  "sinon": "^18.0.0"
53
53
  },
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
58
+ "gitHead": "ce4421f0daf26027b863b91787a474e4cc264344"
59
59
  }
@@ -3,7 +3,6 @@
3
3
  * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- /* eslint-disable max-classes-per-file */
7
6
  import type { DirectiveResult } from 'lit/directive.js';
8
7
  import type { LitRendererResult } from '@vaadin/lit-renderer';
9
8
  import { LitRendererDirective } from '@vaadin/lit-renderer';
@@ -5,6 +5,6 @@
5
5
  */
6
6
  import type { CSSResult } from 'lit';
7
7
 
8
- export const dialogOverlay: CSSResult;
8
+ export const dialogOverlayBase: CSSResult;
9
9
 
10
- export const resizableOverlay: CSSResult;
10
+ export const dialogOverlayStyles: CSSResult;
@@ -4,8 +4,9 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { css } from 'lit';
7
+ import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
7
8
 
8
- export const dialogOverlay = css`
9
+ export const dialogOverlayBase = css`
9
10
  [part='header'],
10
11
  [part='header-content'],
11
12
  [part='footer'] {
@@ -85,7 +86,7 @@ export const dialogOverlay = css`
85
86
  }
86
87
  `;
87
88
 
88
- export const resizableOverlay = css`
89
+ const dialogResizableOverlay = css`
89
90
  [part='overlay'] {
90
91
  position: relative;
91
92
  overflow: visible;
@@ -179,3 +180,5 @@ export const resizableOverlay = css`
179
180
  cursor: nwse-resize;
180
181
  }
181
182
  `;
183
+
184
+ export const dialogOverlayStyles = [overlayStyles, dialogOverlayBase, dialogResizableOverlay];
@@ -207,7 +207,8 @@ export const DialogOverlayMixin = (superClass) =>
207
207
  }
208
208
 
209
209
  Object.keys(parsedBounds).forEach((arg) => {
210
- if (!isNaN(parsedBounds[arg])) {
210
+ // Allow setting width or height to `null`
211
+ if (parsedBounds[arg] !== null && !isNaN(parsedBounds[arg])) {
211
212
  parsedBounds[arg] = `${parsedBounds[arg]}px`;
212
213
  }
213
214
  });
@@ -7,10 +7,10 @@ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
- import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
10
+ import { CSSInjectionMixin } from '@vaadin/vaadin-themable-mixin/css-injection-mixin.js';
11
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
+ import { dialogOverlayStyles } from './styles/vaadin-dialog-overlay-styles.js';
12
13
  import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
13
- import { dialogOverlay, resizableOverlay } from './vaadin-dialog-styles.js';
14
14
 
15
15
  /**
16
16
  * An element used internally by `<vaadin-dialog>`. Not intended to be used separately.
@@ -22,13 +22,15 @@ import { dialogOverlay, resizableOverlay } from './vaadin-dialog-styles.js';
22
22
  * @mixes ThemableMixin
23
23
  * @private
24
24
  */
25
- export class DialogOverlay extends DialogOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
25
+ export class DialogOverlay extends DialogOverlayMixin(
26
+ DirMixin(ThemableMixin(CSSInjectionMixin(PolylitMixin(LitElement)))),
27
+ ) {
26
28
  static get is() {
27
29
  return 'vaadin-dialog-overlay';
28
30
  }
29
31
 
30
32
  static get styles() {
31
- return [overlayStyles, dialogOverlay, resizableOverlay];
33
+ return dialogOverlayStyles;
32
34
  }
33
35
 
34
36
  /** @protected */
@@ -147,17 +147,8 @@ export const DialogResizableMixin = (superClass) =>
147
147
  * @protected
148
148
  */
149
149
  _getResizeDimensions() {
150
- const scrollPosition = this.$.overlay.$.resizerContainer.scrollTop;
151
150
  const { width, height, top, left } = getComputedStyle(this.$.overlay.$.overlay);
152
- const content = this.$.overlay.$.content;
153
- content.setAttribute(
154
- 'style',
155
- 'position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-sizing: content-box; height: auto;',
156
- );
157
- const { width: contentWidth, height: contentHeight } = getComputedStyle(content);
158
- content.removeAttribute('style');
159
- this.$.overlay.$.resizerContainer.scrollTop = scrollPosition;
160
- return { width, height, contentWidth, contentHeight, top, left };
151
+ return { width, height, top, left };
161
152
  }
162
153
 
163
154
  /**
@@ -20,8 +20,6 @@ export type DialogResizableDirection = 'e' | 'n' | 'ne' | 'nw' | 's' | 'se' | 's
20
20
  export type DialogResizeDimensions = {
21
21
  width: string;
22
22
  height: string;
23
- contentWidth: string;
24
- contentHeight: string;
25
23
  top: string;
26
24
  left: string;
27
25
  };
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": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha4",
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/25.0.0-alpha2/#/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\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/25.0.0-alpha4/#/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.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "opened",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dialog",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha4",
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/25.0.0-alpha2/#/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\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/25.0.0-alpha4/#/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.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {