@vaadin/dialog 24.8.5 → 24.9.0-alpha2
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 +11 -11
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-lit-dialog-overlay.js +0 -51
- package/src/vaadin-lit-dialog.js +0 -100
- package/theme/lumo/vaadin-lit-dialog.d.ts +0 -2
- package/theme/lumo/vaadin-lit-dialog.js +0 -2
- package/theme/material/vaadin-lit-dialog.d.ts +0 -2
- package/theme/material/vaadin-lit-dialog.js +0 -2
- package/vaadin-lit-dialog.d.ts +0 -1
- package/vaadin-lit-dialog.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/dialog",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.9.0-alpha2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
41
|
"@polymer/polymer": "^3.0.0",
|
|
42
|
-
"@vaadin/component-base": "
|
|
43
|
-
"@vaadin/lit-renderer": "
|
|
44
|
-
"@vaadin/overlay": "
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
46
|
-
"@vaadin/vaadin-material-styles": "
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
42
|
+
"@vaadin/component-base": "24.9.0-alpha2",
|
|
43
|
+
"@vaadin/lit-renderer": "24.9.0-alpha2",
|
|
44
|
+
"@vaadin/overlay": "24.9.0-alpha2",
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "24.9.0-alpha2",
|
|
46
|
+
"@vaadin/vaadin-material-styles": "24.9.0-alpha2",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "24.9.0-alpha2",
|
|
48
48
|
"lit": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@vaadin/a11y-base": "
|
|
52
|
-
"@vaadin/chai-plugins": "
|
|
53
|
-
"@vaadin/test-runner-commands": "
|
|
51
|
+
"@vaadin/a11y-base": "24.9.0-alpha2",
|
|
52
|
+
"@vaadin/chai-plugins": "24.9.0-alpha2",
|
|
53
|
+
"@vaadin/test-runner-commands": "24.9.0-alpha2",
|
|
54
54
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
55
55
|
"sinon": "^18.0.0"
|
|
56
56
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"web-types.json",
|
|
59
59
|
"web-types.lit.json"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "dd99dece1b54942ab0e421892b089e506822c5f5"
|
|
62
62
|
}
|
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.
|
|
4
|
+
"version": "24.9.0-alpha2",
|
|
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.
|
|
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.9.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.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "opened",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/dialog",
|
|
4
|
-
"version": "24.
|
|
4
|
+
"version": "24.9.0-alpha2",
|
|
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.
|
|
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.9.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.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -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);
|
package/src/vaadin-lit-dialog.js
DELETED
|
@@ -1,100 +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 './vaadin-lit-dialog-overlay.js';
|
|
7
|
-
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
-
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
12
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
13
|
-
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
14
|
-
import { DialogBaseMixin } from './vaadin-dialog-base-mixin.js';
|
|
15
|
-
import { DialogDraggableMixin } from './vaadin-dialog-draggable-mixin.js';
|
|
16
|
-
import { DialogRendererMixin } from './vaadin-dialog-renderer-mixin.js';
|
|
17
|
-
import { DialogResizableMixin } from './vaadin-dialog-resizable-mixin.js';
|
|
18
|
-
|
|
19
|
-
export { DialogOverlay } from './vaadin-lit-dialog-overlay.js';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* LitElement based version of `<vaadin-dialog>` web component.
|
|
23
|
-
*
|
|
24
|
-
* ## Disclaimer
|
|
25
|
-
*
|
|
26
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
27
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
28
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
29
|
-
*
|
|
30
|
-
* @extends HTMLElement
|
|
31
|
-
* @mixes ElementMixin
|
|
32
|
-
* @mixes DialogBaseMixin
|
|
33
|
-
* @mixes DialogDraggableMixin
|
|
34
|
-
* @mixes DialogRendererMixin
|
|
35
|
-
* @mixes DialogResizableMixin
|
|
36
|
-
* @mixes OverlayClassMixin
|
|
37
|
-
* @mixes ThemePropertyMixin
|
|
38
|
-
*/
|
|
39
|
-
class Dialog extends DialogDraggableMixin(
|
|
40
|
-
DialogResizableMixin(
|
|
41
|
-
DialogRendererMixin(DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(LitElement)))))),
|
|
42
|
-
),
|
|
43
|
-
) {
|
|
44
|
-
static get is() {
|
|
45
|
-
return 'vaadin-dialog';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static get styles() {
|
|
49
|
-
return css`
|
|
50
|
-
:host {
|
|
51
|
-
display: none !important;
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static get properties() {
|
|
57
|
-
return {
|
|
58
|
-
/**
|
|
59
|
-
* Set the `aria-label` attribute for assistive technologies like
|
|
60
|
-
* screen readers. An empty string value for this property (the
|
|
61
|
-
* default) means that the `aria-label` attribute is not present.
|
|
62
|
-
*/
|
|
63
|
-
ariaLabel: {
|
|
64
|
-
type: String,
|
|
65
|
-
value: '',
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** @protected */
|
|
71
|
-
render() {
|
|
72
|
-
return html`
|
|
73
|
-
<vaadin-dialog-overlay
|
|
74
|
-
id="overlay"
|
|
75
|
-
role="${this.overlayRole}"
|
|
76
|
-
.owner="${this}"
|
|
77
|
-
.opened="${this.opened}"
|
|
78
|
-
.headerTitle="${this.headerTitle}"
|
|
79
|
-
.renderer="${this.renderer}"
|
|
80
|
-
.headerRenderer="${this.headerRenderer}"
|
|
81
|
-
.footerRenderer="${this.footerRenderer}"
|
|
82
|
-
@opened-changed="${this._onOverlayOpened}"
|
|
83
|
-
@mousedown="${this._bringOverlayToFront}"
|
|
84
|
-
@touchstart="${this._bringOverlayToFront}"
|
|
85
|
-
theme="${ifDefined(this._theme)}"
|
|
86
|
-
aria-label="${ifDefined(this.ariaLabel || this.headerTitle)}"
|
|
87
|
-
.modeless="${this.modeless}"
|
|
88
|
-
.withBackdrop="${!this.modeless}"
|
|
89
|
-
?resizable="${this.resizable}"
|
|
90
|
-
?draggable="${this.draggable}"
|
|
91
|
-
restore-focus-on-close
|
|
92
|
-
focus-trap
|
|
93
|
-
></vaadin-dialog-overlay>
|
|
94
|
-
`;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
defineCustomElement(Dialog);
|
|
99
|
-
|
|
100
|
-
export { Dialog };
|
package/vaadin-lit-dialog.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-dialog.js';
|
package/vaadin-lit-dialog.js
DELETED