@vaadin/dialog 25.3.0-alpha8 → 25.3.0-alpha9
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/custom-elements.json +80 -6
- package/package.json +11 -11
- package/src/vaadin-dialog-base-mixin.d.ts +14 -1
- package/src/vaadin-dialog-base-mixin.js +19 -6
- package/src/vaadin-dialog-overlay.js +3 -3
- package/src/vaadin-dialog.js +2 -1
- package/web-types.json +21 -3
- package/web-types.lit.json +9 -2
package/custom-elements.json
CHANGED
|
@@ -56,6 +56,16 @@
|
|
|
56
56
|
"description": "Set to true to remove backdrop and allow click events on background elements.",
|
|
57
57
|
"attribute": "modeless"
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
"kind": "field",
|
|
61
|
+
"name": "noAutofocus",
|
|
62
|
+
"privacy": "public",
|
|
63
|
+
"type": {
|
|
64
|
+
"text": "boolean"
|
|
65
|
+
},
|
|
66
|
+
"description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
|
|
67
|
+
"attribute": "no-autofocus"
|
|
68
|
+
},
|
|
59
69
|
{
|
|
60
70
|
"kind": "field",
|
|
61
71
|
"name": "noCloseOnEsc",
|
|
@@ -83,7 +93,8 @@
|
|
|
83
93
|
"type": {
|
|
84
94
|
"text": "boolean"
|
|
85
95
|
},
|
|
86
|
-
"description": "Set to true to
|
|
96
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
97
|
+
"deprecated": "This property is deprecated and will be removed in Vaadin 26.",
|
|
87
98
|
"attribute": "no-focus-trap"
|
|
88
99
|
},
|
|
89
100
|
{
|
|
@@ -151,6 +162,14 @@
|
|
|
151
162
|
"description": "Set to true to remove backdrop and allow click events on background elements.",
|
|
152
163
|
"fieldName": "modeless"
|
|
153
164
|
},
|
|
165
|
+
{
|
|
166
|
+
"name": "no-autofocus",
|
|
167
|
+
"type": {
|
|
168
|
+
"text": "boolean"
|
|
169
|
+
},
|
|
170
|
+
"description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
|
|
171
|
+
"fieldName": "noAutofocus"
|
|
172
|
+
},
|
|
154
173
|
{
|
|
155
174
|
"name": "no-close-on-esc",
|
|
156
175
|
"type": {
|
|
@@ -172,7 +191,8 @@
|
|
|
172
191
|
"type": {
|
|
173
192
|
"text": "boolean"
|
|
174
193
|
},
|
|
175
|
-
"description": "Set to true to
|
|
194
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
195
|
+
"deprecated": "This property is deprecated and will be removed in Vaadin 26.",
|
|
176
196
|
"fieldName": "noFocusTrap"
|
|
177
197
|
},
|
|
178
198
|
{
|
|
@@ -326,6 +346,20 @@
|
|
|
326
346
|
"description": "",
|
|
327
347
|
"name": "DialogOverlayMixin",
|
|
328
348
|
"members": [
|
|
349
|
+
{
|
|
350
|
+
"kind": "field",
|
|
351
|
+
"name": "autofocus",
|
|
352
|
+
"privacy": "public",
|
|
353
|
+
"type": {
|
|
354
|
+
"text": "boolean"
|
|
355
|
+
},
|
|
356
|
+
"description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
357
|
+
"attribute": "autofocus",
|
|
358
|
+
"inheritedFrom": {
|
|
359
|
+
"name": "OverlayFocusMixin",
|
|
360
|
+
"package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
|
|
361
|
+
}
|
|
362
|
+
},
|
|
329
363
|
{
|
|
330
364
|
"kind": "method",
|
|
331
365
|
"name": "bringToFront",
|
|
@@ -358,7 +392,7 @@
|
|
|
358
392
|
"type": {
|
|
359
393
|
"text": "boolean"
|
|
360
394
|
},
|
|
361
|
-
"description": "
|
|
395
|
+
"description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
362
396
|
"attribute": "focus-trap",
|
|
363
397
|
"inheritedFrom": {
|
|
364
398
|
"name": "OverlayFocusMixin",
|
|
@@ -570,12 +604,24 @@
|
|
|
570
604
|
}
|
|
571
605
|
],
|
|
572
606
|
"attributes": [
|
|
607
|
+
{
|
|
608
|
+
"name": "autofocus",
|
|
609
|
+
"type": {
|
|
610
|
+
"text": "boolean"
|
|
611
|
+
},
|
|
612
|
+
"description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
613
|
+
"fieldName": "autofocus",
|
|
614
|
+
"inheritedFrom": {
|
|
615
|
+
"name": "OverlayFocusMixin",
|
|
616
|
+
"package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
|
|
617
|
+
}
|
|
618
|
+
},
|
|
573
619
|
{
|
|
574
620
|
"name": "focus-trap",
|
|
575
621
|
"type": {
|
|
576
622
|
"text": "boolean"
|
|
577
623
|
},
|
|
578
|
-
"description": "
|
|
624
|
+
"description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
|
|
579
625
|
"fieldName": "focusTrap",
|
|
580
626
|
"inheritedFrom": {
|
|
581
627
|
"name": "OverlayFocusMixin",
|
|
@@ -1106,6 +1152,20 @@
|
|
|
1106
1152
|
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1107
1153
|
}
|
|
1108
1154
|
},
|
|
1155
|
+
{
|
|
1156
|
+
"kind": "field",
|
|
1157
|
+
"name": "noAutofocus",
|
|
1158
|
+
"privacy": "public",
|
|
1159
|
+
"type": {
|
|
1160
|
+
"text": "boolean"
|
|
1161
|
+
},
|
|
1162
|
+
"description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
|
|
1163
|
+
"attribute": "no-autofocus",
|
|
1164
|
+
"inheritedFrom": {
|
|
1165
|
+
"name": "DialogBaseMixin",
|
|
1166
|
+
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1109
1169
|
{
|
|
1110
1170
|
"kind": "field",
|
|
1111
1171
|
"name": "noCloseOnEsc",
|
|
@@ -1141,7 +1201,8 @@
|
|
|
1141
1201
|
"type": {
|
|
1142
1202
|
"text": "boolean"
|
|
1143
1203
|
},
|
|
1144
|
-
"description": "Set to true to
|
|
1204
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
1205
|
+
"deprecated": "This property is deprecated and will be removed in Vaadin 26.",
|
|
1145
1206
|
"attribute": "no-focus-trap",
|
|
1146
1207
|
"inheritedFrom": {
|
|
1147
1208
|
"name": "DialogBaseMixin",
|
|
@@ -1408,6 +1469,18 @@
|
|
|
1408
1469
|
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1409
1470
|
}
|
|
1410
1471
|
},
|
|
1472
|
+
{
|
|
1473
|
+
"name": "no-autofocus",
|
|
1474
|
+
"type": {
|
|
1475
|
+
"text": "boolean"
|
|
1476
|
+
},
|
|
1477
|
+
"description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
|
|
1478
|
+
"fieldName": "noAutofocus",
|
|
1479
|
+
"inheritedFrom": {
|
|
1480
|
+
"name": "DialogBaseMixin",
|
|
1481
|
+
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1482
|
+
}
|
|
1483
|
+
},
|
|
1411
1484
|
{
|
|
1412
1485
|
"name": "no-close-on-esc",
|
|
1413
1486
|
"type": {
|
|
@@ -1437,7 +1510,8 @@
|
|
|
1437
1510
|
"type": {
|
|
1438
1511
|
"text": "boolean"
|
|
1439
1512
|
},
|
|
1440
|
-
"description": "Set to true to
|
|
1513
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
1514
|
+
"deprecated": "This property is deprecated and will be removed in Vaadin 26.",
|
|
1441
1515
|
"fieldName": "noFocusTrap",
|
|
1442
1516
|
"inheritedFrom": {
|
|
1443
1517
|
"name": "DialogBaseMixin",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/dialog",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-alpha9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
|
-
"@vaadin/component-base": "25.3.0-
|
|
41
|
-
"@vaadin/lit-renderer": "25.3.0-
|
|
42
|
-
"@vaadin/overlay": "25.3.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "25.3.0-
|
|
40
|
+
"@vaadin/component-base": "25.3.0-alpha9",
|
|
41
|
+
"@vaadin/lit-renderer": "25.3.0-alpha9",
|
|
42
|
+
"@vaadin/overlay": "25.3.0-alpha9",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-alpha9",
|
|
44
44
|
"lit": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@vaadin/a11y-base": "25.3.0-
|
|
48
|
-
"@vaadin/aura": "25.3.0-
|
|
49
|
-
"@vaadin/chai-plugins": "25.3.0-
|
|
50
|
-
"@vaadin/test-runner-commands": "25.3.0-
|
|
47
|
+
"@vaadin/a11y-base": "25.3.0-alpha9",
|
|
48
|
+
"@vaadin/aura": "25.3.0-alpha9",
|
|
49
|
+
"@vaadin/chai-plugins": "25.3.0-alpha9",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.3.0-alpha9",
|
|
51
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
|
-
"@vaadin/vaadin-lumo-styles": "25.3.0-
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-alpha9",
|
|
53
53
|
"sinon": "^22.0.0"
|
|
54
54
|
},
|
|
55
55
|
"customElements": "custom-elements.json",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"web-types.json",
|
|
58
58
|
"web-types.lit.json"
|
|
59
59
|
],
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "cb915ebde095ec5b94a87af93dd4530f51984c52"
|
|
61
61
|
}
|
|
@@ -33,11 +33,24 @@ export declare class DialogBaseMixinClass {
|
|
|
33
33
|
modeless: boolean;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Set to true to
|
|
36
|
+
* Set to true to prevent the dialog from receiving focus
|
|
37
|
+
* on open and trapping it inside.
|
|
38
|
+
*
|
|
37
39
|
* @attr {boolean} no-focus-trap
|
|
40
|
+
* @deprecated This property is deprecated and will be removed in Vaadin 26.
|
|
38
41
|
*/
|
|
39
42
|
noFocusTrap: boolean;
|
|
40
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Set to true to prevent focus from moving into the dialog on open.
|
|
46
|
+
*
|
|
47
|
+
* This property only works for non-modal dialogs and is ignored
|
|
48
|
+
* for modal ones, where focus must always stay inside.
|
|
49
|
+
*
|
|
50
|
+
* @attr {boolean} no-autofocus
|
|
51
|
+
*/
|
|
52
|
+
noAutofocus: boolean;
|
|
53
|
+
|
|
41
54
|
/**
|
|
42
55
|
* The `role` attribute value to be set on the dialog. Defaults to "dialog".
|
|
43
56
|
*
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
6
7
|
|
|
7
8
|
export const DialogBaseMixin = (superClass) =>
|
|
8
9
|
class DialogBaseMixin extends superClass {
|
|
@@ -46,14 +47,30 @@ export const DialogBaseMixin = (superClass) =>
|
|
|
46
47
|
},
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
|
-
* Set to true to
|
|
50
|
+
* Set to true to prevent the dialog from receiving focus
|
|
51
|
+
* on open and trapping it inside.
|
|
52
|
+
*
|
|
50
53
|
* @attr {boolean} no-focus-trap
|
|
54
|
+
* @deprecated This property is deprecated and will be removed in Vaadin 26.
|
|
51
55
|
*/
|
|
52
56
|
noFocusTrap: {
|
|
53
57
|
type: Boolean,
|
|
54
58
|
value: false,
|
|
55
59
|
},
|
|
56
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Set to true to prevent focus from moving into the dialog on open.
|
|
63
|
+
*
|
|
64
|
+
* This property only works for non-modal dialogs and is ignored
|
|
65
|
+
* for modal ones, where focus must always stay inside.
|
|
66
|
+
*
|
|
67
|
+
* @attr {boolean} no-autofocus
|
|
68
|
+
*/
|
|
69
|
+
noAutofocus: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
value: false,
|
|
72
|
+
},
|
|
73
|
+
|
|
57
74
|
/**
|
|
58
75
|
* Set the distance of the dialog from the top of the viewport.
|
|
59
76
|
* If a unitless number is provided, pixels are assumed.
|
|
@@ -134,11 +151,7 @@ export const DialogBaseMixin = (superClass) =>
|
|
|
134
151
|
}
|
|
135
152
|
|
|
136
153
|
if (props.has('modeless')) {
|
|
137
|
-
|
|
138
|
-
this.setAttribute('aria-modal', 'true');
|
|
139
|
-
} else {
|
|
140
|
-
this.removeAttribute('aria-modal');
|
|
141
|
-
}
|
|
154
|
+
setOrRemoveAttribute(this, 'aria-modal', !this.modeless);
|
|
142
155
|
}
|
|
143
156
|
}
|
|
144
157
|
|
|
@@ -21,9 +21,7 @@ import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
|
|
|
21
21
|
* @extends HTMLElement
|
|
22
22
|
* @private
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
|
|
26
|
-
) {
|
|
24
|
+
class DialogOverlay extends DialogOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
27
25
|
static get is() {
|
|
28
26
|
return 'vaadin-dialog-overlay';
|
|
29
27
|
}
|
|
@@ -83,3 +81,5 @@ export class DialogOverlay extends DialogOverlayMixin(
|
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
defineCustomElement(DialogOverlay);
|
|
84
|
+
|
|
85
|
+
export { DialogOverlay };
|
package/src/vaadin-dialog.js
CHANGED
|
@@ -172,7 +172,8 @@ class Dialog extends DialogSizeMixin(
|
|
|
172
172
|
.withBackdrop="${!this.modeless}"
|
|
173
173
|
?resizable="${this.resizable}"
|
|
174
174
|
restore-focus-on-close
|
|
175
|
-
?focus-trap="${!this.noFocusTrap}"
|
|
175
|
+
?focus-trap="${!this.noFocusTrap && !this.modeless}"
|
|
176
|
+
?autofocus="${this.modeless ? !this.noAutofocus && !this.noFocusTrap : !this.noFocusTrap}"
|
|
176
177
|
exportparts="backdrop, overlay, header, title, header-content, content, footer"
|
|
177
178
|
>
|
|
178
179
|
<slot name="title" slot="title"></slot>
|
package/web-types.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.3.0-
|
|
4
|
+
"version": "25.3.0-alpha9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -64,6 +64,15 @@
|
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"name": "no-autofocus",
|
|
69
|
+
"description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
|
|
70
|
+
"value": {
|
|
71
|
+
"type": [
|
|
72
|
+
"boolean"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
67
76
|
{
|
|
68
77
|
"name": "no-close-on-esc",
|
|
69
78
|
"description": "Set to true to disable closing dialog on Escape press",
|
|
@@ -84,7 +93,7 @@
|
|
|
84
93
|
},
|
|
85
94
|
{
|
|
86
95
|
"name": "no-focus-trap",
|
|
87
|
-
"description": "Set to true to
|
|
96
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
88
97
|
"value": {
|
|
89
98
|
"type": [
|
|
90
99
|
"boolean"
|
|
@@ -222,6 +231,15 @@
|
|
|
222
231
|
]
|
|
223
232
|
}
|
|
224
233
|
},
|
|
234
|
+
{
|
|
235
|
+
"name": "noAutofocus",
|
|
236
|
+
"description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
|
|
237
|
+
"value": {
|
|
238
|
+
"type": [
|
|
239
|
+
"boolean"
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
},
|
|
225
243
|
{
|
|
226
244
|
"name": "noCloseOnEsc",
|
|
227
245
|
"description": "Set to true to disable closing dialog on Escape press",
|
|
@@ -242,7 +260,7 @@
|
|
|
242
260
|
},
|
|
243
261
|
{
|
|
244
262
|
"name": "noFocusTrap",
|
|
245
|
-
"description": "Set to true to
|
|
263
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
246
264
|
"value": {
|
|
247
265
|
"type": [
|
|
248
266
|
"boolean"
|
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.3.0-
|
|
4
|
+
"version": "25.3.0-alpha9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -75,6 +75,13 @@
|
|
|
75
75
|
"kind": "expression"
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
+
{
|
|
79
|
+
"name": "?noAutofocus",
|
|
80
|
+
"description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
|
|
81
|
+
"value": {
|
|
82
|
+
"kind": "expression"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
78
85
|
{
|
|
79
86
|
"name": "?noCloseOnEsc",
|
|
80
87
|
"description": "Set to true to disable closing dialog on Escape press",
|
|
@@ -91,7 +98,7 @@
|
|
|
91
98
|
},
|
|
92
99
|
{
|
|
93
100
|
"name": "?noFocusTrap",
|
|
94
|
-
"description": "Set to true to
|
|
101
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
95
102
|
"value": {
|
|
96
103
|
"kind": "expression"
|
|
97
104
|
}
|