@vaadin/dialog 25.2.7 → 25.3.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/custom-elements.json +144 -49
- package/package.json +11 -11
- package/src/lit/renderer-directives.d.ts +3 -0
- package/src/lit/renderer-directives.js +3 -0
- 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 +6 -5
- package/src/vaadin-dialog-renderer-mixin.d.ts +8 -0
- package/src/vaadin-dialog-renderer-mixin.js +5 -0
- package/src/vaadin-dialog.d.ts +22 -4
- package/src/vaadin-dialog.js +25 -5
- package/web-types.json +23 -7
- package/web-types.lit.json +10 -3
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",
|
|
@@ -758,6 +804,7 @@
|
|
|
758
804
|
"text": "DialogRenderer | undefined"
|
|
759
805
|
},
|
|
760
806
|
"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.",
|
|
807
|
+
"deprecated": "Add footer content as children of the dialog using `slot=\"footer\"` instead",
|
|
761
808
|
"attribute": "footer-renderer"
|
|
762
809
|
},
|
|
763
810
|
{
|
|
@@ -768,6 +815,7 @@
|
|
|
768
815
|
"text": "DialogRenderer | undefined"
|
|
769
816
|
},
|
|
770
817
|
"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.",
|
|
818
|
+
"deprecated": "Add header content as children of the dialog using `slot=\"header-content\"` instead",
|
|
771
819
|
"attribute": "header-renderer"
|
|
772
820
|
},
|
|
773
821
|
{
|
|
@@ -788,12 +836,14 @@
|
|
|
788
836
|
"text": "DialogRenderer | undefined"
|
|
789
837
|
},
|
|
790
838
|
"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.",
|
|
839
|
+
"deprecated": "Add content elements as children of the dialog instead",
|
|
791
840
|
"attribute": "renderer"
|
|
792
841
|
},
|
|
793
842
|
{
|
|
794
843
|
"kind": "method",
|
|
795
844
|
"name": "requestContentUpdate",
|
|
796
|
-
"description": "Requests an update for the content of the dialog.\nWhile performing the update, it invokes the renderer passed in the `renderer` property,\nas well as `headerRender` and `footerRenderer` properties, if these are defined.\n\nIt is not guaranteed that the update happens immediately (synchronously) after it is requested."
|
|
845
|
+
"description": "Requests an update for the content of the dialog.\nWhile performing the update, it invokes the renderer passed in the `renderer` property,\nas well as `headerRender` and `footerRenderer` properties, if these are defined.\n\nIt is not guaranteed that the update happens immediately (synchronously) after it is requested.",
|
|
846
|
+
"deprecated": "This method is only used with renderers and will be removed in Vaadin 26"
|
|
797
847
|
}
|
|
798
848
|
],
|
|
799
849
|
"attributes": [
|
|
@@ -803,6 +853,7 @@
|
|
|
803
853
|
"text": "DialogRenderer | undefined"
|
|
804
854
|
},
|
|
805
855
|
"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.",
|
|
856
|
+
"deprecated": "Add footer content as children of the dialog using `slot=\"footer\"` instead",
|
|
806
857
|
"fieldName": "footerRenderer"
|
|
807
858
|
},
|
|
808
859
|
{
|
|
@@ -811,6 +862,7 @@
|
|
|
811
862
|
"text": "DialogRenderer | undefined"
|
|
812
863
|
},
|
|
813
864
|
"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.",
|
|
865
|
+
"deprecated": "Add header content as children of the dialog using `slot=\"header-content\"` instead",
|
|
814
866
|
"fieldName": "headerRenderer"
|
|
815
867
|
},
|
|
816
868
|
{
|
|
@@ -827,6 +879,7 @@
|
|
|
827
879
|
"text": "DialogRenderer | undefined"
|
|
828
880
|
},
|
|
829
881
|
"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.",
|
|
882
|
+
"deprecated": "Add content elements as children of the dialog instead",
|
|
830
883
|
"fieldName": "renderer"
|
|
831
884
|
}
|
|
832
885
|
],
|
|
@@ -982,7 +1035,7 @@
|
|
|
982
1035
|
"declarations": [
|
|
983
1036
|
{
|
|
984
1037
|
"kind": "class",
|
|
985
|
-
"description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n###
|
|
1038
|
+
"description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\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 content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
986
1039
|
"name": "Dialog",
|
|
987
1040
|
"members": [
|
|
988
1041
|
{
|
|
@@ -1007,6 +1060,7 @@
|
|
|
1007
1060
|
"text": "DialogRenderer | undefined"
|
|
1008
1061
|
},
|
|
1009
1062
|
"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.",
|
|
1063
|
+
"deprecated": "Add footer content as children of the dialog using `slot=\"footer\"` instead",
|
|
1010
1064
|
"attribute": "footer-renderer",
|
|
1011
1065
|
"inheritedFrom": {
|
|
1012
1066
|
"name": "DialogRendererMixin",
|
|
@@ -1021,6 +1075,7 @@
|
|
|
1021
1075
|
"text": "DialogRenderer | undefined"
|
|
1022
1076
|
},
|
|
1023
1077
|
"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.",
|
|
1078
|
+
"deprecated": "Add header content as children of the dialog using `slot=\"header-content\"` instead",
|
|
1024
1079
|
"attribute": "header-renderer",
|
|
1025
1080
|
"inheritedFrom": {
|
|
1026
1081
|
"name": "DialogRendererMixin",
|
|
@@ -1097,6 +1152,20 @@
|
|
|
1097
1152
|
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1098
1153
|
}
|
|
1099
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
|
+
},
|
|
1100
1169
|
{
|
|
1101
1170
|
"kind": "field",
|
|
1102
1171
|
"name": "noCloseOnEsc",
|
|
@@ -1132,7 +1201,8 @@
|
|
|
1132
1201
|
"type": {
|
|
1133
1202
|
"text": "boolean"
|
|
1134
1203
|
},
|
|
1135
|
-
"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.",
|
|
1136
1206
|
"attribute": "no-focus-trap",
|
|
1137
1207
|
"inheritedFrom": {
|
|
1138
1208
|
"name": "DialogBaseMixin",
|
|
@@ -1176,6 +1246,7 @@
|
|
|
1176
1246
|
"text": "DialogRenderer | undefined"
|
|
1177
1247
|
},
|
|
1178
1248
|
"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.",
|
|
1249
|
+
"deprecated": "Add content elements as children of the dialog instead",
|
|
1179
1250
|
"attribute": "renderer",
|
|
1180
1251
|
"inheritedFrom": {
|
|
1181
1252
|
"name": "DialogRendererMixin",
|
|
@@ -1186,6 +1257,7 @@
|
|
|
1186
1257
|
"kind": "method",
|
|
1187
1258
|
"name": "requestContentUpdate",
|
|
1188
1259
|
"description": "Requests an update for the content of the dialog.\nWhile performing the update, it invokes the renderer passed in the `renderer` property,\nas well as `headerRender` and `footerRenderer` properties, if these are defined.\n\nIt is not guaranteed that the update happens immediately (synchronously) after it is requested.",
|
|
1260
|
+
"deprecated": "This method is only used with renderers and will be removed in Vaadin 26",
|
|
1189
1261
|
"inheritedFrom": {
|
|
1190
1262
|
"name": "DialogRendererMixin",
|
|
1191
1263
|
"module": "src/vaadin-dialog-renderer-mixin.js"
|
|
@@ -1298,46 +1370,6 @@
|
|
|
1298
1370
|
}
|
|
1299
1371
|
}
|
|
1300
1372
|
],
|
|
1301
|
-
"mixins": [
|
|
1302
|
-
{
|
|
1303
|
-
"name": "DialogSizeMixin",
|
|
1304
|
-
"module": "src/vaadin-dialog-size-mixin.js"
|
|
1305
|
-
},
|
|
1306
|
-
{
|
|
1307
|
-
"name": "DialogDraggableMixin",
|
|
1308
|
-
"module": "src/vaadin-dialog-draggable-mixin.js"
|
|
1309
|
-
},
|
|
1310
|
-
{
|
|
1311
|
-
"name": "DialogResizableMixin",
|
|
1312
|
-
"module": "src/vaadin-dialog-resizable-mixin.js"
|
|
1313
|
-
},
|
|
1314
|
-
{
|
|
1315
|
-
"name": "DialogRendererMixin",
|
|
1316
|
-
"module": "src/vaadin-dialog-renderer-mixin.js"
|
|
1317
|
-
},
|
|
1318
|
-
{
|
|
1319
|
-
"name": "DialogBaseMixin",
|
|
1320
|
-
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1321
|
-
},
|
|
1322
|
-
{
|
|
1323
|
-
"name": "ThemePropertyMixin",
|
|
1324
|
-
"package": "@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js"
|
|
1325
|
-
},
|
|
1326
|
-
{
|
|
1327
|
-
"name": "ElementMixin",
|
|
1328
|
-
"package": "@vaadin/component-base/src/element-mixin.js"
|
|
1329
|
-
},
|
|
1330
|
-
{
|
|
1331
|
-
"name": "PolylitMixin",
|
|
1332
|
-
"package": "@vaadin/component-base/src/polylit-mixin.js"
|
|
1333
|
-
}
|
|
1334
|
-
],
|
|
1335
|
-
"superclass": {
|
|
1336
|
-
"name": "LitElement",
|
|
1337
|
-
"package": "lit"
|
|
1338
|
-
},
|
|
1339
|
-
"tagName": "vaadin-dialog",
|
|
1340
|
-
"customElement": true,
|
|
1341
1373
|
"attributes": [
|
|
1342
1374
|
{
|
|
1343
1375
|
"name": "draggable",
|
|
@@ -1357,6 +1389,7 @@
|
|
|
1357
1389
|
"text": "DialogRenderer | undefined"
|
|
1358
1390
|
},
|
|
1359
1391
|
"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.",
|
|
1392
|
+
"deprecated": "Add footer content as children of the dialog using `slot=\"footer\"` instead",
|
|
1360
1393
|
"fieldName": "footerRenderer",
|
|
1361
1394
|
"inheritedFrom": {
|
|
1362
1395
|
"name": "DialogRendererMixin",
|
|
@@ -1369,6 +1402,7 @@
|
|
|
1369
1402
|
"text": "DialogRenderer | undefined"
|
|
1370
1403
|
},
|
|
1371
1404
|
"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.",
|
|
1405
|
+
"deprecated": "Add header content as children of the dialog using `slot=\"header-content\"` instead",
|
|
1372
1406
|
"fieldName": "headerRenderer",
|
|
1373
1407
|
"inheritedFrom": {
|
|
1374
1408
|
"name": "DialogRendererMixin",
|
|
@@ -1435,6 +1469,18 @@
|
|
|
1435
1469
|
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1436
1470
|
}
|
|
1437
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
|
+
},
|
|
1438
1484
|
{
|
|
1439
1485
|
"name": "no-close-on-esc",
|
|
1440
1486
|
"type": {
|
|
@@ -1464,7 +1510,8 @@
|
|
|
1464
1510
|
"type": {
|
|
1465
1511
|
"text": "boolean"
|
|
1466
1512
|
},
|
|
1467
|
-
"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.",
|
|
1468
1515
|
"fieldName": "noFocusTrap",
|
|
1469
1516
|
"inheritedFrom": {
|
|
1470
1517
|
"name": "DialogBaseMixin",
|
|
@@ -1502,6 +1549,7 @@
|
|
|
1502
1549
|
"text": "DialogRenderer | undefined"
|
|
1503
1550
|
},
|
|
1504
1551
|
"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.",
|
|
1552
|
+
"deprecated": "Add content elements as children of the dialog instead",
|
|
1505
1553
|
"fieldName": "renderer",
|
|
1506
1554
|
"inheritedFrom": {
|
|
1507
1555
|
"name": "DialogRendererMixin",
|
|
@@ -1520,6 +1568,13 @@
|
|
|
1520
1568
|
"module": "src/vaadin-dialog-resizable-mixin.js"
|
|
1521
1569
|
}
|
|
1522
1570
|
},
|
|
1571
|
+
{
|
|
1572
|
+
"type": {
|
|
1573
|
+
"text": "string"
|
|
1574
|
+
},
|
|
1575
|
+
"description": "The theme variants to apply to the component.",
|
|
1576
|
+
"name": "theme"
|
|
1577
|
+
},
|
|
1523
1578
|
{
|
|
1524
1579
|
"name": "top",
|
|
1525
1580
|
"type": {
|
|
@@ -1544,7 +1599,47 @@
|
|
|
1544
1599
|
"module": "src/vaadin-dialog-size-mixin.js"
|
|
1545
1600
|
}
|
|
1546
1601
|
}
|
|
1547
|
-
]
|
|
1602
|
+
],
|
|
1603
|
+
"mixins": [
|
|
1604
|
+
{
|
|
1605
|
+
"name": "DialogSizeMixin",
|
|
1606
|
+
"module": "src/vaadin-dialog-size-mixin.js"
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
"name": "DialogDraggableMixin",
|
|
1610
|
+
"module": "src/vaadin-dialog-draggable-mixin.js"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
"name": "DialogResizableMixin",
|
|
1614
|
+
"module": "src/vaadin-dialog-resizable-mixin.js"
|
|
1615
|
+
},
|
|
1616
|
+
{
|
|
1617
|
+
"name": "DialogRendererMixin",
|
|
1618
|
+
"module": "src/vaadin-dialog-renderer-mixin.js"
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
"name": "DialogBaseMixin",
|
|
1622
|
+
"module": "src/vaadin-dialog-base-mixin.js"
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
"name": "ThemePropertyMixin",
|
|
1626
|
+
"package": "@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js"
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
"name": "ElementMixin",
|
|
1630
|
+
"package": "@vaadin/component-base/src/element-mixin.js"
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
"name": "PolylitMixin",
|
|
1634
|
+
"package": "@vaadin/component-base/src/polylit-mixin.js"
|
|
1635
|
+
}
|
|
1636
|
+
],
|
|
1637
|
+
"superclass": {
|
|
1638
|
+
"name": "LitElement",
|
|
1639
|
+
"package": "lit"
|
|
1640
|
+
},
|
|
1641
|
+
"tagName": "vaadin-dialog",
|
|
1642
|
+
"customElement": true
|
|
1548
1643
|
}
|
|
1549
1644
|
],
|
|
1550
1645
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/dialog",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.3.0-alpha10",
|
|
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": "
|
|
41
|
-
"@vaadin/lit-renderer": "
|
|
42
|
-
"@vaadin/overlay": "
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
40
|
+
"@vaadin/component-base": "25.3.0-alpha10",
|
|
41
|
+
"@vaadin/lit-renderer": "25.3.0-alpha10",
|
|
42
|
+
"@vaadin/overlay": "25.3.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-alpha10",
|
|
44
44
|
"lit": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@vaadin/a11y-base": "
|
|
48
|
-
"@vaadin/aura": "
|
|
49
|
-
"@vaadin/chai-plugins": "
|
|
50
|
-
"@vaadin/test-runner-commands": "
|
|
47
|
+
"@vaadin/a11y-base": "25.3.0-alpha10",
|
|
48
|
+
"@vaadin/aura": "25.3.0-alpha10",
|
|
49
|
+
"@vaadin/chai-plugins": "25.3.0-alpha10",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.3.0-alpha10",
|
|
51
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-alpha10",
|
|
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": "f2833abdf9b613fa0d0ed216830e3f4de87b7dac"
|
|
61
61
|
}
|
|
@@ -69,6 +69,7 @@ export class DialogFooterRendererDirective extends AbstractDialogRendererDirecti
|
|
|
69
69
|
* @param renderer the renderer callback that returns a Lit template.
|
|
70
70
|
* @param dependencies a single dependency or an array of dependencies
|
|
71
71
|
* which trigger a re-render when changed.
|
|
72
|
+
* @deprecated Add content elements as children of the dialog instead
|
|
72
73
|
*/
|
|
73
74
|
export declare function dialogRenderer(
|
|
74
75
|
renderer: DialogLitRenderer,
|
|
@@ -100,6 +101,7 @@ export declare function dialogRenderer(
|
|
|
100
101
|
* @param renderer the renderer callback.
|
|
101
102
|
* @param dependencies a single dependency or an array of dependencies
|
|
102
103
|
* which trigger a re-render when changed.
|
|
104
|
+
* @deprecated Add header content as children of the dialog using `slot="header-content"` instead
|
|
103
105
|
*/
|
|
104
106
|
export declare function dialogHeaderRenderer(
|
|
105
107
|
renderer: DialogLitRenderer,
|
|
@@ -131,6 +133,7 @@ export declare function dialogHeaderRenderer(
|
|
|
131
133
|
* @param renderer the renderer callback.
|
|
132
134
|
* @param dependencies a single dependency or an array of dependencies
|
|
133
135
|
* which trigger a re-render when changed.
|
|
136
|
+
* @deprecated Add footer content as children of the dialog using `slot="footer"` instead
|
|
134
137
|
*/
|
|
135
138
|
export declare function dialogFooterRenderer(
|
|
136
139
|
renderer: DialogLitRenderer,
|
|
@@ -95,6 +95,7 @@ export class DialogFooterRendererDirective extends AbstractDialogRendererDirecti
|
|
|
95
95
|
* @param renderer the renderer callback that returns a Lit template.
|
|
96
96
|
* @param dependencies a single dependency or an array of dependencies
|
|
97
97
|
* which trigger a re-render when changed.
|
|
98
|
+
* @deprecated Add content elements as children of the dialog instead
|
|
98
99
|
*/
|
|
99
100
|
export const dialogRenderer = directive(DialogRendererDirective);
|
|
100
101
|
|
|
@@ -123,6 +124,7 @@ export const dialogRenderer = directive(DialogRendererDirective);
|
|
|
123
124
|
* @param renderer the renderer callback.
|
|
124
125
|
* @param dependencies a single dependency or an array of dependencies
|
|
125
126
|
* which trigger a re-render when changed.
|
|
127
|
+
* @deprecated Add header content as children of the dialog using `slot="header-content"` instead
|
|
126
128
|
*/
|
|
127
129
|
export const dialogHeaderRenderer = directive(DialogHeaderRendererDirective);
|
|
128
130
|
|
|
@@ -151,5 +153,6 @@ export const dialogHeaderRenderer = directive(DialogHeaderRendererDirective);
|
|
|
151
153
|
* @param renderer the renderer callback.
|
|
152
154
|
* @param dependencies a single dependency or an array of dependencies
|
|
153
155
|
* which trigger a re-render when changed.
|
|
156
|
+
* @deprecated Add footer content as children of the dialog using `slot="footer"` instead
|
|
154
157
|
*/
|
|
155
158
|
export const dialogFooterRenderer = directive(DialogFooterRendererDirective);
|
|
@@ -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
|
|
|
@@ -16,13 +16,12 @@ import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
|
|
|
16
16
|
/**
|
|
17
17
|
* An element used internally by `<vaadin-dialog>`. Not intended to be used separately.
|
|
18
18
|
*
|
|
19
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
19
20
|
* @customElement vaadin-dialog-overlay
|
|
20
21
|
* @extends HTMLElement
|
|
21
22
|
* @private
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
-
DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
|
|
25
|
-
) {
|
|
24
|
+
class DialogOverlay extends DialogOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
26
25
|
static get is() {
|
|
27
26
|
return 'vaadin-dialog-overlay';
|
|
28
27
|
}
|
|
@@ -32,11 +31,11 @@ export class DialogOverlay extends DialogOverlayMixin(
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
|
-
* Override method from OverlayFocusMixin to use owner as focus
|
|
34
|
+
* Override method from OverlayFocusMixin to use owner as focus root
|
|
36
35
|
* @protected
|
|
37
36
|
* @override
|
|
38
37
|
*/
|
|
39
|
-
get
|
|
38
|
+
get _focusRoot() {
|
|
40
39
|
return this.owner;
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -82,3 +81,5 @@ export class DialogOverlay extends DialogOverlayMixin(
|
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
defineCustomElement(DialogOverlay);
|
|
84
|
+
|
|
85
|
+
export { DialogOverlay };
|
|
@@ -17,6 +17,8 @@ export declare class DialogRendererMixinClass {
|
|
|
17
17
|
*
|
|
18
18
|
* - `root` The root container DOM element. Append your content to it.
|
|
19
19
|
* - `dialog` The reference to the `<vaadin-dialog>` element.
|
|
20
|
+
*
|
|
21
|
+
* @deprecated Add content elements as children of the dialog instead
|
|
20
22
|
*/
|
|
21
23
|
renderer: DialogRenderer | null | undefined;
|
|
22
24
|
|
|
@@ -44,6 +46,8 @@ export declare class DialogRendererMixinClass {
|
|
|
44
46
|
* each other, with the title coming first.
|
|
45
47
|
*
|
|
46
48
|
* When `headerRenderer` is set, the attribute `has-header` is set on the dialog.
|
|
49
|
+
*
|
|
50
|
+
* @deprecated Add header content as children of the dialog using `slot="header-content"` instead
|
|
47
51
|
*/
|
|
48
52
|
headerRenderer: DialogRenderer | null | undefined;
|
|
49
53
|
|
|
@@ -55,6 +59,8 @@ export declare class DialogRendererMixinClass {
|
|
|
55
59
|
* - `dialog` The reference to the `<vaadin-dialog>` element.
|
|
56
60
|
*
|
|
57
61
|
* When `footerRenderer` is set, the attribute `has-footer` is set on the dialog.
|
|
62
|
+
*
|
|
63
|
+
* @deprecated Add footer content as children of the dialog using `slot="footer"` instead
|
|
58
64
|
*/
|
|
59
65
|
footerRenderer: DialogRenderer | null | undefined;
|
|
60
66
|
|
|
@@ -63,6 +69,8 @@ export declare class DialogRendererMixinClass {
|
|
|
63
69
|
* as well as `headerRender` and `footerRenderer` properties, if these are defined.
|
|
64
70
|
*
|
|
65
71
|
* It is not guaranteed that the update happens immediately (synchronously) after it is requested.
|
|
72
|
+
*
|
|
73
|
+
* @deprecated This method is only used with renderers and will be removed in Vaadin 26
|
|
66
74
|
*/
|
|
67
75
|
requestContentUpdate(): void;
|
|
68
76
|
}
|
|
@@ -15,6 +15,7 @@ export const DialogRendererMixin = (superClass) =>
|
|
|
15
15
|
* - `root` The root container DOM element. Append your content to it.
|
|
16
16
|
* - `dialog` The reference to the `<vaadin-dialog>` element.
|
|
17
17
|
* @type {DialogRenderer | undefined}
|
|
18
|
+
* @deprecated Add content elements as children of the dialog instead
|
|
18
19
|
*/
|
|
19
20
|
renderer: {
|
|
20
21
|
type: Object,
|
|
@@ -47,6 +48,7 @@ export const DialogRendererMixin = (superClass) =>
|
|
|
47
48
|
*
|
|
48
49
|
* When `headerRenderer` is set, the attribute `has-header` is set on the dialog.
|
|
49
50
|
* @type {DialogRenderer | undefined}
|
|
51
|
+
* @deprecated Add header content as children of the dialog using `slot="header-content"` instead
|
|
50
52
|
*/
|
|
51
53
|
headerRenderer: {
|
|
52
54
|
type: Object,
|
|
@@ -61,6 +63,7 @@ export const DialogRendererMixin = (superClass) =>
|
|
|
61
63
|
*
|
|
62
64
|
* When `footerRenderer` is set, the attribute `has-footer` is set on the dialog.
|
|
63
65
|
* @type {DialogRenderer | undefined}
|
|
66
|
+
* @deprecated Add footer content as children of the dialog using `slot="footer"` instead
|
|
64
67
|
*/
|
|
65
68
|
footerRenderer: {
|
|
66
69
|
type: Object,
|
|
@@ -74,6 +77,8 @@ export const DialogRendererMixin = (superClass) =>
|
|
|
74
77
|
* as well as `headerRender` and `footerRenderer` properties, if these are defined.
|
|
75
78
|
*
|
|
76
79
|
* It is not guaranteed that the update happens immediately (synchronously) after it is requested.
|
|
80
|
+
*
|
|
81
|
+
* @deprecated This method is only used with renderers and will be removed in Vaadin 26
|
|
77
82
|
*/
|
|
78
83
|
requestContentUpdate() {
|
|
79
84
|
if (this._overlayElement) {
|
package/src/vaadin-dialog.d.ts
CHANGED
|
@@ -78,9 +78,27 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap;
|
|
|
78
78
|
/**
|
|
79
79
|
* `<vaadin-dialog>` is a Web Component for creating customized modal dialogs.
|
|
80
80
|
*
|
|
81
|
-
*
|
|
81
|
+
* ```html
|
|
82
|
+
* <vaadin-dialog header-title="Title">
|
|
83
|
+
* <div>Dialog content</div>
|
|
84
|
+
* <div slot="footer">Footer</div>
|
|
85
|
+
* </vaadin-dialog>
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* ### Slots
|
|
89
|
+
*
|
|
90
|
+
* Dialog supports following slots for providing content:
|
|
91
|
+
*
|
|
92
|
+
* Name | Description
|
|
93
|
+
* -----------------|-------------
|
|
94
|
+
* (none) | Default slot for the content
|
|
95
|
+
* `header-content` | Slot for the header content
|
|
96
|
+
* `footer` | Slot for the footer content
|
|
97
|
+
*
|
|
98
|
+
* #### Renderer (deprecated)
|
|
82
99
|
*
|
|
83
|
-
* The content of the dialog can be populated by using the renderer callback
|
|
100
|
+
* The content of the dialog can also be populated by using the renderer callback functions,
|
|
101
|
+
* although this approach is deprecated in favor of slotted content.
|
|
84
102
|
*
|
|
85
103
|
* The renderer function provides `root`, `dialog` arguments.
|
|
86
104
|
* Generate DOM content, append it to the `root` element and control the state
|
|
@@ -121,8 +139,8 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap;
|
|
|
121
139
|
* Attribute | Description
|
|
122
140
|
* -----------------|--------------------------------------------
|
|
123
141
|
* `has-title` | Set when the element has a title
|
|
124
|
-
* `has-header` | Set when the element has header
|
|
125
|
-
* `has-footer` | Set when the element has footer
|
|
142
|
+
* `has-header` | Set when the element has header content
|
|
143
|
+
* `has-footer` | Set when the element has footer content
|
|
126
144
|
* `overflow` | Set to `top`, `bottom`, none or both
|
|
127
145
|
*
|
|
128
146
|
* The following custom CSS properties are available for styling:
|
package/src/vaadin-dialog.js
CHANGED
|
@@ -21,9 +21,27 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
|
|
|
21
21
|
/**
|
|
22
22
|
* `<vaadin-dialog>` is a Web Component for creating customized modal dialogs.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* ```html
|
|
25
|
+
* <vaadin-dialog header-title="Title">
|
|
26
|
+
* <div>Dialog content</div>
|
|
27
|
+
* <div slot="footer">Footer</div>
|
|
28
|
+
* </vaadin-dialog>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* ### Slots
|
|
32
|
+
*
|
|
33
|
+
* Dialog supports following slots for providing content:
|
|
34
|
+
*
|
|
35
|
+
* Name | Description
|
|
36
|
+
* -----------------|-------------
|
|
37
|
+
* (none) | Default slot for the content
|
|
38
|
+
* `header-content` | Slot for the header content
|
|
39
|
+
* `footer` | Slot for the footer content
|
|
40
|
+
*
|
|
41
|
+
* #### Renderer (deprecated)
|
|
25
42
|
*
|
|
26
|
-
* The content of the dialog can be populated by using the renderer callback
|
|
43
|
+
* The content of the dialog can also be populated by using the renderer callback functions,
|
|
44
|
+
* although this approach is deprecated in favor of slotted content.
|
|
27
45
|
*
|
|
28
46
|
* The renderer function provides `root`, `dialog` arguments.
|
|
29
47
|
* Generate DOM content, append it to the `root` element and control the state
|
|
@@ -64,8 +82,8 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
|
|
|
64
82
|
* Attribute | Description
|
|
65
83
|
* -----------------|--------------------------------------------
|
|
66
84
|
* `has-title` | Set when the element has a title
|
|
67
|
-
* `has-header` | Set when the element has header
|
|
68
|
-
* `has-footer` | Set when the element has footer
|
|
85
|
+
* `has-header` | Set when the element has header content
|
|
86
|
+
* `has-footer` | Set when the element has footer content
|
|
69
87
|
* `overflow` | Set to `top`, `bottom`, none or both
|
|
70
88
|
*
|
|
71
89
|
* The following custom CSS properties are available for styling:
|
|
@@ -98,6 +116,7 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
|
|
|
98
116
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
99
117
|
* @fires {CustomEvent} closed - Fired when the dialog is closed.
|
|
100
118
|
*
|
|
119
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
101
120
|
* @customElement vaadin-dialog
|
|
102
121
|
* @extends HTMLElement
|
|
103
122
|
*/
|
|
@@ -153,7 +172,8 @@ class Dialog extends DialogSizeMixin(
|
|
|
153
172
|
.withBackdrop="${!this.modeless}"
|
|
154
173
|
?resizable="${this.resizable}"
|
|
155
174
|
restore-focus-on-close
|
|
156
|
-
?focus-trap="${!this.noFocusTrap}"
|
|
175
|
+
?focus-trap="${!this.noFocusTrap && !this.modeless}"
|
|
176
|
+
?autofocus="${this.modeless ? !this.noAutofocus && !this.noFocusTrap : !this.noFocusTrap}"
|
|
157
177
|
exportparts="backdrop, overlay, header, title, header-content, content, footer"
|
|
158
178
|
>
|
|
159
179
|
<slot name="title" slot="title"></slot>
|
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.
|
|
4
|
+
"version": "25.3.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###
|
|
11
|
+
"description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\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 content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "draggable",
|
|
@@ -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"
|
|
@@ -123,9 +132,7 @@
|
|
|
123
132
|
"description": "The theme variants to apply to the component.",
|
|
124
133
|
"value": {
|
|
125
134
|
"type": [
|
|
126
|
-
"string"
|
|
127
|
-
"null",
|
|
128
|
-
"undefined"
|
|
135
|
+
"string"
|
|
129
136
|
]
|
|
130
137
|
}
|
|
131
138
|
},
|
|
@@ -224,6 +231,15 @@
|
|
|
224
231
|
]
|
|
225
232
|
}
|
|
226
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
|
+
},
|
|
227
243
|
{
|
|
228
244
|
"name": "noCloseOnEsc",
|
|
229
245
|
"description": "Set to true to disable closing dialog on Escape press",
|
|
@@ -244,7 +260,7 @@
|
|
|
244
260
|
},
|
|
245
261
|
{
|
|
246
262
|
"name": "noFocusTrap",
|
|
247
|
-
"description": "Set to true to
|
|
263
|
+
"description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
|
|
248
264
|
"value": {
|
|
249
265
|
"type": [
|
|
250
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.
|
|
4
|
+
"version": "25.3.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###
|
|
19
|
+
"description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\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 content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -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
|
}
|