@vaadin/dialog 25.0.0-alpha2 → 25.0.0-alpha20
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 -12
- package/src/lit/renderer-directives.d.ts +0 -1
- package/src/{vaadin-dialog-styles.d.ts → styles/vaadin-dialog-overlay-base-styles.d.ts} +3 -3
- package/src/styles/vaadin-dialog-overlay-base-styles.js +215 -0
- package/src/vaadin-dialog-base-mixin.d.ts +9 -22
- package/src/vaadin-dialog-base-mixin.js +34 -28
- package/src/vaadin-dialog-draggable-mixin.js +2 -1
- package/src/vaadin-dialog-overlay-mixin.d.ts +0 -14
- package/src/vaadin-dialog-overlay-mixin.js +32 -41
- package/src/vaadin-dialog-overlay.d.ts +1 -1
- package/src/vaadin-dialog-overlay.js +16 -5
- package/src/vaadin-dialog-renderer-mixin.d.ts +3 -3
- package/src/vaadin-dialog-renderer-mixin.js +3 -3
- package/src/vaadin-dialog-resizable-mixin.js +2 -14
- package/src/vaadin-dialog-size-mixin.d.ts +24 -0
- package/src/vaadin-dialog-size-mixin.js +40 -0
- package/src/vaadin-dialog.d.ts +9 -24
- package/src/vaadin-dialog.js +41 -33
- package/vaadin-dialog.js +1 -1
- package/web-types.json +22 -66
- package/web-types.lit.json +13 -27
- package/src/vaadin-dialog-styles.js +0 -181
- package/theme/lumo/vaadin-dialog-styles.d.ts +0 -3
- package/theme/lumo/vaadin-dialog-styles.js +0 -109
- package/theme/lumo/vaadin-dialog.d.ts +0 -2
- package/theme/lumo/vaadin-dialog.js +0 -2
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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha20",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,12 +16,12 @@
|
|
|
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\
|
|
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
|
{
|
|
23
23
|
"name": "?opened",
|
|
24
|
-
"description": "True if the
|
|
24
|
+
"description": "True if the dialog is visible and available for interaction.",
|
|
25
25
|
"value": {
|
|
26
26
|
"kind": "expression"
|
|
27
27
|
}
|
|
@@ -63,35 +63,21 @@
|
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"name": ".top",
|
|
66
|
-
"description": "Set the distance of the
|
|
66
|
+
"description": "Set the distance of the dialog from the top of the viewport.\nIf a unitless number is provided, pixels are assumed.\n\nNote that the dialog uses an internal container that has some\nadditional spacing, which can be overridden by the theme.",
|
|
67
67
|
"value": {
|
|
68
68
|
"kind": "expression"
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"name": ".left",
|
|
73
|
-
"description": "Set the distance of the
|
|
74
|
-
"value": {
|
|
75
|
-
"kind": "expression"
|
|
76
|
-
}
|
|
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.",
|
|
73
|
+
"description": "Set the distance of the dialog from the left of the viewport.\nIf a unitless number is provided, pixels are assumed.\n\nNote that the dialog uses an internal container that has some\nadditional spacing, which can be overridden by the theme.",
|
|
88
74
|
"value": {
|
|
89
75
|
"kind": "expression"
|
|
90
76
|
}
|
|
91
77
|
},
|
|
92
78
|
{
|
|
93
79
|
"name": ".overlayRole",
|
|
94
|
-
"description": "The `role` attribute value to be set on the
|
|
80
|
+
"description": "The `role` attribute value to be set on the dialog. Defaults to \"dialog\".",
|
|
95
81
|
"value": {
|
|
96
82
|
"kind": "expression"
|
|
97
83
|
}
|
|
@@ -105,35 +91,35 @@
|
|
|
105
91
|
},
|
|
106
92
|
{
|
|
107
93
|
"name": ".headerTitle",
|
|
108
|
-
"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
|
|
94
|
+
"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 set on the dialog.",
|
|
109
95
|
"value": {
|
|
110
96
|
"kind": "expression"
|
|
111
97
|
}
|
|
112
98
|
},
|
|
113
99
|
{
|
|
114
100
|
"name": ".headerRenderer",
|
|
115
|
-
"description": "Custom function for rendering the dialog header.\nReceives two arguments:\n\n- `root` The root container DOM element. Append your content to it.\n- `dialog` The reference to the `<vaadin-dialog>` element.\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 `headerRenderer` is set, the attribute `has-header` is
|
|
101
|
+
"description": "Custom function for rendering the dialog header.\nReceives two arguments:\n\n- `root` The root container DOM element. Append your content to it.\n- `dialog` The reference to the `<vaadin-dialog>` element.\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 `headerRenderer` is set, the attribute `has-header` is set on the dialog.",
|
|
116
102
|
"value": {
|
|
117
103
|
"kind": "expression"
|
|
118
104
|
}
|
|
119
105
|
},
|
|
120
106
|
{
|
|
121
107
|
"name": ".footerRenderer",
|
|
122
|
-
"description": "Custom function for rendering the dialog footer.\nReceives two arguments:\n\n- `root` The root container DOM element. Append your content to it.\n- `dialog` The reference to the `<vaadin-dialog>` element.\n\nWhen `footerRenderer` is set, the attribute `has-footer` is
|
|
108
|
+
"description": "Custom function for rendering the dialog footer.\nReceives two arguments:\n\n- `root` The root container DOM element. Append your content to it.\n- `dialog` The reference to the `<vaadin-dialog>` element.\n\nWhen `footerRenderer` is set, the attribute `has-footer` is set on the dialog.",
|
|
123
109
|
"value": {
|
|
124
110
|
"kind": "expression"
|
|
125
111
|
}
|
|
126
112
|
},
|
|
127
113
|
{
|
|
128
|
-
"name": ".
|
|
129
|
-
"description": "
|
|
114
|
+
"name": ".width",
|
|
115
|
+
"description": "Set the width of the dialog.\nIf a unitless number is provided, pixels are assumed.",
|
|
130
116
|
"value": {
|
|
131
117
|
"kind": "expression"
|
|
132
118
|
}
|
|
133
119
|
},
|
|
134
120
|
{
|
|
135
|
-
"name": ".
|
|
136
|
-
"description": "Set the
|
|
121
|
+
"name": ".height",
|
|
122
|
+
"description": "Set the height of the dialog.\nIf a unitless number is provided, pixels are assumed.",
|
|
137
123
|
"value": {
|
|
138
124
|
"kind": "expression"
|
|
139
125
|
}
|
|
@@ -1,181 +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 { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const dialogOverlay = css`
|
|
9
|
-
[part='header'],
|
|
10
|
-
[part='header-content'],
|
|
11
|
-
[part='footer'] {
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
flex-wrap: wrap;
|
|
15
|
-
flex: none;
|
|
16
|
-
pointer-events: none;
|
|
17
|
-
z-index: 1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part='header'] {
|
|
21
|
-
flex-wrap: nowrap;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
::slotted([slot='header-content']),
|
|
25
|
-
::slotted([slot='title']),
|
|
26
|
-
::slotted([slot='footer']) {
|
|
27
|
-
display: contents;
|
|
28
|
-
pointer-events: auto;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
::slotted([slot='title']) {
|
|
32
|
-
font: inherit !important;
|
|
33
|
-
overflow-wrap: anywhere;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[part='header-content'] {
|
|
37
|
-
flex: 1;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:host([has-title]) [part='header-content'],
|
|
41
|
-
[part='footer'] {
|
|
42
|
-
justify-content: flex-end;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host(:not([has-title]):not([has-header])) [part='header'],
|
|
46
|
-
:host(:not([has-header])) [part='header-content'],
|
|
47
|
-
:host(:not([has-title])) [part='title'],
|
|
48
|
-
:host(:not([has-footer])) [part='footer'] {
|
|
49
|
-
display: none !important;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
:host(:is([has-title], [has-header], [has-footer])) [part='content'] {
|
|
53
|
-
height: auto;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@media (min-height: 320px) {
|
|
57
|
-
:host(:is([has-title], [has-header], [has-footer])) .resizer-container {
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
display: flex;
|
|
60
|
-
flex-direction: column;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
:host(:is([has-title], [has-header], [has-footer])) [part='content'] {
|
|
64
|
-
flex: 1;
|
|
65
|
-
overflow: auto;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/*
|
|
70
|
-
NOTE(platosha): Make some min-width to prevent collapsing of the content
|
|
71
|
-
taking the parent width, e. g., <vaadin-grid> and such.
|
|
72
|
-
*/
|
|
73
|
-
[part='content'] {
|
|
74
|
-
min-width: 12em; /* matches the default <vaadin-text-field> width */
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
:host([has-bounds-set]) [part='overlay'] {
|
|
78
|
-
max-width: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@media (forced-colors: active) {
|
|
82
|
-
[part='overlay'] {
|
|
83
|
-
outline: 3px solid !important;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
`;
|
|
87
|
-
|
|
88
|
-
export const resizableOverlay = css`
|
|
89
|
-
[part='overlay'] {
|
|
90
|
-
position: relative;
|
|
91
|
-
overflow: visible;
|
|
92
|
-
max-height: 100%;
|
|
93
|
-
display: flex;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
[part='content'] {
|
|
97
|
-
box-sizing: border-box;
|
|
98
|
-
height: 100%;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.resizer-container {
|
|
102
|
-
overflow: auto;
|
|
103
|
-
flex-grow: 1;
|
|
104
|
-
border-radius: inherit; /* prevent child elements being drawn outside part=overlay */
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
[part='overlay'][style] .resizer-container {
|
|
108
|
-
min-height: 100%;
|
|
109
|
-
width: 100%;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
:host(:not([resizable])) .resizer {
|
|
113
|
-
display: none;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
:host([resizable]) [part='title'] {
|
|
117
|
-
cursor: move;
|
|
118
|
-
-webkit-user-select: none;
|
|
119
|
-
user-select: none;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.resizer {
|
|
123
|
-
position: absolute;
|
|
124
|
-
height: 16px;
|
|
125
|
-
width: 16px;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.resizer.edge {
|
|
129
|
-
height: 8px;
|
|
130
|
-
width: 8px;
|
|
131
|
-
inset: -4px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.resizer.edge.n {
|
|
135
|
-
width: auto;
|
|
136
|
-
bottom: auto;
|
|
137
|
-
cursor: ns-resize;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.resizer.ne {
|
|
141
|
-
top: -4px;
|
|
142
|
-
right: -4px;
|
|
143
|
-
cursor: nesw-resize;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.resizer.edge.e {
|
|
147
|
-
height: auto;
|
|
148
|
-
left: auto;
|
|
149
|
-
cursor: ew-resize;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.resizer.se {
|
|
153
|
-
bottom: -4px;
|
|
154
|
-
right: -4px;
|
|
155
|
-
cursor: nwse-resize;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.resizer.edge.s {
|
|
159
|
-
width: auto;
|
|
160
|
-
top: auto;
|
|
161
|
-
cursor: ns-resize;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.resizer.sw {
|
|
165
|
-
bottom: -4px;
|
|
166
|
-
left: -4px;
|
|
167
|
-
cursor: nesw-resize;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.resizer.edge.w {
|
|
171
|
-
height: auto;
|
|
172
|
-
right: auto;
|
|
173
|
-
cursor: ew-resize;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.resizer.nw {
|
|
177
|
-
top: -4px;
|
|
178
|
-
left: -4px;
|
|
179
|
-
cursor: nwse-resize;
|
|
180
|
-
}
|
|
181
|
-
`;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
2
|
-
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
3
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
|
-
|
|
5
|
-
const dialogOverlay = css`
|
|
6
|
-
/* Optical centering */
|
|
7
|
-
:host::before,
|
|
8
|
-
:host::after {
|
|
9
|
-
content: '';
|
|
10
|
-
flex-basis: 0;
|
|
11
|
-
flex-grow: 1;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
:host::after {
|
|
15
|
-
flex-grow: 1.1;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
[part='overlay'] {
|
|
19
|
-
border-radius: var(--lumo-border-radius-l);
|
|
20
|
-
box-shadow:
|
|
21
|
-
0 0 0 1px var(--lumo-shade-5pct),
|
|
22
|
-
var(--lumo-box-shadow-xl);
|
|
23
|
-
background-image: none;
|
|
24
|
-
outline: none;
|
|
25
|
-
-webkit-tap-highlight-color: transparent;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
[part='content'] {
|
|
29
|
-
padding: var(--lumo-space-l);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:host(:is([has-header], [has-title])) [part='header'] + [part='content'] {
|
|
33
|
-
padding-top: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[part='header'],
|
|
37
|
-
[part='header-content'],
|
|
38
|
-
[part='footer'] {
|
|
39
|
-
gap: var(--lumo-space-xs) var(--lumo-space-s);
|
|
40
|
-
line-height: var(--lumo-line-height-s);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[part='header'] {
|
|
44
|
-
padding: var(--lumo-space-m);
|
|
45
|
-
background-color: var(--lumo-base-color);
|
|
46
|
-
border-radius: var(--lumo-border-radius-l) var(--lumo-border-radius-l) 0 0; /* Needed for Safari */
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[part='footer'] {
|
|
50
|
-
padding: var(--lumo-space-s) var(--lumo-space-m);
|
|
51
|
-
background-color: var(--lumo-contrast-5pct);
|
|
52
|
-
border-radius: 0 0 var(--lumo-border-radius-l) var(--lumo-border-radius-l); /* Needed for Safari */
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
[part='title'] {
|
|
56
|
-
font-size: var(--lumo-font-size-xl);
|
|
57
|
-
font-weight: 600;
|
|
58
|
-
color: var(--lumo-header-text-color);
|
|
59
|
-
margin-inline-start: calc(var(--lumo-space-l) - var(--lumo-space-m));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* No padding */
|
|
63
|
-
:host([theme~='no-padding']) [part='content'] {
|
|
64
|
-
padding: 0 !important;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@media (min-height: 320px) {
|
|
68
|
-
:host([overflow~='top']) [part='header'] {
|
|
69
|
-
box-shadow: 0 1px 0 0 var(--lumo-contrast-10pct);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* Animations */
|
|
74
|
-
|
|
75
|
-
:host([opening]),
|
|
76
|
-
:host([closing]) {
|
|
77
|
-
animation: 0.25s lumo-overlay-dummy-animation;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
:host([opening]) [part='overlay'] {
|
|
81
|
-
animation: 0.12s 0.05s vaadin-dialog-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@keyframes vaadin-dialog-enter {
|
|
85
|
-
0% {
|
|
86
|
-
opacity: 0;
|
|
87
|
-
transform: scale(0.95);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
:host([closing]) [part='overlay'] {
|
|
92
|
-
animation: 0.1s 0.03s vaadin-dialog-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
:host([closing]) [part='backdrop'] {
|
|
96
|
-
animation-delay: 0.05s;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@keyframes vaadin-dialog-exit {
|
|
100
|
-
100% {
|
|
101
|
-
opacity: 0;
|
|
102
|
-
transform: scale(1.02);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
106
|
-
|
|
107
|
-
registerStyles('vaadin-dialog-overlay', [overlay, dialogOverlay], { moduleId: 'lumo-dialog' });
|
|
108
|
-
|
|
109
|
-
export { dialogOverlay };
|