@vaadin/dialog 24.5.0-alpha1 → 24.5.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.
- package/README.md +1 -1
- package/package.json +13 -13
- package/src/vaadin-dialog-base-mixin.d.ts +7 -0
- package/src/vaadin-dialog-base-mixin.js +22 -0
- package/src/vaadin-dialog-resizable-mixin.js +6 -0
- package/src/vaadin-dialog.d.ts +8 -0
- package/src/vaadin-dialog.js +2 -1
- package/src/vaadin-lit-dialog.js +1 -1
- package/theme/lumo/vaadin-dialog-styles.js +3 -1
- package/web-types.json +32 -2
- package/web-types.lit.json +23 -2
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ import '@vaadin/dialog/src/vaadin-dialog.js';
|
|
|
58
58
|
|
|
59
59
|
## Contributing
|
|
60
60
|
|
|
61
|
-
Read the [contributing guide](https://vaadin.com/docs/latest/contributing
|
|
61
|
+
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
|
62
62
|
|
|
63
63
|
## License
|
|
64
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/dialog",
|
|
3
|
-
"version": "24.5.0-
|
|
3
|
+
"version": "24.5.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,24 +39,24 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
41
|
"@polymer/polymer": "^3.0.0",
|
|
42
|
-
"@vaadin/component-base": "24.5.0-
|
|
43
|
-
"@vaadin/lit-renderer": "24.5.0-
|
|
44
|
-
"@vaadin/overlay": "24.5.0-
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "24.5.0-
|
|
46
|
-
"@vaadin/vaadin-material-styles": "24.5.0-
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "24.5.0-
|
|
42
|
+
"@vaadin/component-base": "24.5.0-alpha10",
|
|
43
|
+
"@vaadin/lit-renderer": "24.5.0-alpha10",
|
|
44
|
+
"@vaadin/overlay": "24.5.0-alpha10",
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "24.5.0-alpha10",
|
|
46
|
+
"@vaadin/vaadin-material-styles": "24.5.0-alpha10",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "24.5.0-alpha10",
|
|
48
48
|
"lit": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"@vaadin/
|
|
53
|
-
"@vaadin/testing-helpers": "^0.
|
|
54
|
-
"@vaadin/text-area": "24.5.0-
|
|
55
|
-
"sinon": "^
|
|
51
|
+
"@vaadin/a11y-base": "24.5.0-alpha10",
|
|
52
|
+
"@vaadin/chai-plugins": "24.5.0-alpha10",
|
|
53
|
+
"@vaadin/testing-helpers": "^1.0.0",
|
|
54
|
+
"@vaadin/text-area": "24.5.0-alpha10",
|
|
55
|
+
"sinon": "^18.0.0"
|
|
56
56
|
},
|
|
57
57
|
"web-types": [
|
|
58
58
|
"web-types.json",
|
|
59
59
|
"web-types.lit.json"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "6f9c37308031af872a98017bfab4de89aeacda51"
|
|
62
62
|
}
|
|
@@ -31,4 +31,11 @@ export declare class DialogBaseMixinClass {
|
|
|
31
31
|
* Set to true to remove backdrop and allow click events on background elements.
|
|
32
32
|
*/
|
|
33
33
|
modeless: boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `role` attribute value to be set on the overlay. Defaults to "dialog".
|
|
37
|
+
*
|
|
38
|
+
* @attr {string} overlay-role
|
|
39
|
+
*/
|
|
40
|
+
overlayRole: string;
|
|
34
41
|
}
|
|
@@ -49,6 +49,16 @@ export const DialogBaseMixin = (superClass) =>
|
|
|
49
49
|
type: Boolean,
|
|
50
50
|
value: false,
|
|
51
51
|
},
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The `role` attribute value to be set on the overlay. Defaults to "dialog".
|
|
55
|
+
*
|
|
56
|
+
* @attr {string} overlay-role
|
|
57
|
+
*/
|
|
58
|
+
overlayRole: {
|
|
59
|
+
type: String,
|
|
60
|
+
value: 'dialog',
|
|
61
|
+
},
|
|
52
62
|
};
|
|
53
63
|
}
|
|
54
64
|
|
|
@@ -60,10 +70,16 @@ export const DialogBaseMixin = (superClass) =>
|
|
|
60
70
|
|
|
61
71
|
overlay.addEventListener('vaadin-overlay-outside-click', this._handleOutsideClick.bind(this));
|
|
62
72
|
overlay.addEventListener('vaadin-overlay-escape-press', this._handleEscPress.bind(this));
|
|
73
|
+
overlay.addEventListener('vaadin-overlay-closed', this.__handleOverlayClosed.bind(this));
|
|
63
74
|
|
|
64
75
|
this._overlayElement = overlay;
|
|
65
76
|
}
|
|
66
77
|
|
|
78
|
+
/** @private */
|
|
79
|
+
__handleOverlayClosed() {
|
|
80
|
+
this.dispatchEvent(new CustomEvent('closed'));
|
|
81
|
+
}
|
|
82
|
+
|
|
67
83
|
/** @protected */
|
|
68
84
|
connectedCallback() {
|
|
69
85
|
super.connectedCallback();
|
|
@@ -120,4 +136,10 @@ export const DialogBaseMixin = (superClass) =>
|
|
|
120
136
|
this._overlayElement.bringToFront();
|
|
121
137
|
}
|
|
122
138
|
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Fired when the dialog is closed.
|
|
142
|
+
*
|
|
143
|
+
* @event closed
|
|
144
|
+
*/
|
|
123
145
|
};
|
|
@@ -158,4 +158,10 @@ export const DialogResizableMixin = (superClass) =>
|
|
|
158
158
|
this.$.overlay.$.resizerContainer.scrollTop = scrollPosition;
|
|
159
159
|
return { width, height, contentWidth, contentHeight };
|
|
160
160
|
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Fired when the dialog resize is finished.
|
|
164
|
+
*
|
|
165
|
+
* @event resize
|
|
166
|
+
*/
|
|
161
167
|
};
|
package/src/vaadin-dialog.d.ts
CHANGED
|
@@ -34,9 +34,16 @@ export type DialogOpenedChangedEvent = CustomEvent<{ value: boolean }>;
|
|
|
34
34
|
*/
|
|
35
35
|
export type DialogResizeEvent = CustomEvent<DialogResizeDimensions>;
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Fired when the dialog is closed.
|
|
39
|
+
*/
|
|
40
|
+
export type DialogClosedEvent = CustomEvent;
|
|
41
|
+
|
|
37
42
|
export interface DialogCustomEventMap {
|
|
38
43
|
'opened-changed': DialogOpenedChangedEvent;
|
|
39
44
|
|
|
45
|
+
closed: DialogClosedEvent;
|
|
46
|
+
|
|
40
47
|
resize: DialogResizeEvent;
|
|
41
48
|
}
|
|
42
49
|
|
|
@@ -102,6 +109,7 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap;
|
|
|
102
109
|
*
|
|
103
110
|
* @fires {CustomEvent} resize - Fired when the dialog resize is finished.
|
|
104
111
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
112
|
+
* @fires {CustomEvent} closed - Fired when the dialog is closed.
|
|
105
113
|
*/
|
|
106
114
|
declare class Dialog extends DialogDraggableMixin(
|
|
107
115
|
DialogResizableMixin(
|
package/src/vaadin-dialog.js
CHANGED
|
@@ -77,6 +77,7 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
|
|
|
77
77
|
*
|
|
78
78
|
* @fires {CustomEvent} resize - Fired when the dialog resize is finished.
|
|
79
79
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
80
|
+
* @fires {CustomEvent} closed - Fired when the dialog is closed.
|
|
80
81
|
*
|
|
81
82
|
* @customElement
|
|
82
83
|
* @extends HTMLElement
|
|
@@ -103,7 +104,7 @@ class Dialog extends DialogDraggableMixin(
|
|
|
103
104
|
|
|
104
105
|
<vaadin-dialog-overlay
|
|
105
106
|
id="overlay"
|
|
106
|
-
role
|
|
107
|
+
role$="[[overlayRole]]"
|
|
107
108
|
header-title="[[headerTitle]]"
|
|
108
109
|
on-opened-changed="_onOverlayOpened"
|
|
109
110
|
on-mousedown="_bringOverlayToFront"
|
package/src/vaadin-lit-dialog.js
CHANGED
|
@@ -17,7 +17,9 @@ const dialogOverlay = css`
|
|
|
17
17
|
|
|
18
18
|
[part='overlay'] {
|
|
19
19
|
border-radius: var(--lumo-border-radius-l);
|
|
20
|
-
box-shadow:
|
|
20
|
+
box-shadow:
|
|
21
|
+
0 0 0 1px var(--lumo-shade-5pct),
|
|
22
|
+
var(--lumo-box-shadow-xl);
|
|
21
23
|
background-image: none;
|
|
22
24
|
outline: none;
|
|
23
25
|
-webkit-tap-highlight-color: transparent;
|
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.5.0-
|
|
4
|
+
"version": "24.5.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.5.0-
|
|
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.5.0-alpha10/#/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",
|
|
@@ -46,6 +46,17 @@
|
|
|
46
46
|
]
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
"name": "overlay-role",
|
|
51
|
+
"description": "The `role` attribute value to be set on the overlay. Defaults to \"dialog\".",
|
|
52
|
+
"value": {
|
|
53
|
+
"type": [
|
|
54
|
+
"string",
|
|
55
|
+
"null",
|
|
56
|
+
"undefined"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
49
60
|
{
|
|
50
61
|
"name": "draggable",
|
|
51
62
|
"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.",
|
|
@@ -147,6 +158,17 @@
|
|
|
147
158
|
]
|
|
148
159
|
}
|
|
149
160
|
},
|
|
161
|
+
{
|
|
162
|
+
"name": "overlayRole",
|
|
163
|
+
"description": "The `role` attribute value to be set on the overlay. Defaults to \"dialog\".",
|
|
164
|
+
"value": {
|
|
165
|
+
"type": [
|
|
166
|
+
"string",
|
|
167
|
+
"null",
|
|
168
|
+
"undefined"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
},
|
|
150
172
|
{
|
|
151
173
|
"name": "draggable",
|
|
152
174
|
"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.",
|
|
@@ -230,6 +252,14 @@
|
|
|
230
252
|
}
|
|
231
253
|
],
|
|
232
254
|
"events": [
|
|
255
|
+
{
|
|
256
|
+
"name": "closed",
|
|
257
|
+
"description": "Fired when the dialog is closed."
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "resize",
|
|
261
|
+
"description": "Fired when the dialog resize is finished."
|
|
262
|
+
},
|
|
233
263
|
{
|
|
234
264
|
"name": "opened-changed",
|
|
235
265
|
"description": "Fired when the `opened` property changes."
|
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.5.0-
|
|
4
|
+
"version": "24.5.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.5.0-
|
|
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.5.0-alpha10/#/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
|
{
|
|
@@ -61,6 +61,13 @@
|
|
|
61
61
|
"kind": "expression"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
"name": ".overlayRole",
|
|
66
|
+
"description": "The `role` attribute value to be set on the overlay. Defaults to \"dialog\".",
|
|
67
|
+
"value": {
|
|
68
|
+
"kind": "expression"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
64
71
|
{
|
|
65
72
|
"name": ".renderer",
|
|
66
73
|
"description": "Custom function for rendering the content of the dialog.\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.",
|
|
@@ -103,6 +110,20 @@
|
|
|
103
110
|
"kind": "expression"
|
|
104
111
|
}
|
|
105
112
|
},
|
|
113
|
+
{
|
|
114
|
+
"name": "@closed",
|
|
115
|
+
"description": "Fired when the dialog is closed.",
|
|
116
|
+
"value": {
|
|
117
|
+
"kind": "expression"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "@resize",
|
|
122
|
+
"description": "Fired when the dialog resize is finished.",
|
|
123
|
+
"value": {
|
|
124
|
+
"kind": "expression"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
106
127
|
{
|
|
107
128
|
"name": "@opened-changed",
|
|
108
129
|
"description": "Fired when the `opened` property changes.",
|