@vaadin/crud 25.0.0-alpha1 → 25.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/crud",
3
- "version": "25.0.0-alpha1",
3
+ "version": "25.0.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,8 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
+ "!src/styles/*-base-styles.d.ts",
25
+ "!src/styles/*-base-styles.js",
24
26
  "theme",
25
27
  "vaadin-*.d.ts",
26
28
  "vaadin-*.js",
@@ -35,23 +37,23 @@
35
37
  ],
36
38
  "dependencies": {
37
39
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.0.0-alpha1",
39
- "@vaadin/button": "25.0.0-alpha1",
40
- "@vaadin/component-base": "25.0.0-alpha1",
41
- "@vaadin/confirm-dialog": "25.0.0-alpha1",
42
- "@vaadin/dialog": "25.0.0-alpha1",
43
- "@vaadin/form-layout": "25.0.0-alpha1",
44
- "@vaadin/grid": "25.0.0-alpha1",
45
- "@vaadin/overlay": "25.0.0-alpha1",
46
- "@vaadin/text-field": "25.0.0-alpha1",
47
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha1",
48
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
40
+ "@vaadin/a11y-base": "25.0.0-alpha10",
41
+ "@vaadin/button": "25.0.0-alpha10",
42
+ "@vaadin/component-base": "25.0.0-alpha10",
43
+ "@vaadin/confirm-dialog": "25.0.0-alpha10",
44
+ "@vaadin/dialog": "25.0.0-alpha10",
45
+ "@vaadin/form-layout": "25.0.0-alpha10",
46
+ "@vaadin/grid": "25.0.0-alpha10",
47
+ "@vaadin/overlay": "25.0.0-alpha10",
48
+ "@vaadin/text-field": "25.0.0-alpha10",
49
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
50
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
49
51
  "lit": "^3.0.0"
50
52
  },
51
53
  "devDependencies": {
52
- "@vaadin/chai-plugins": "25.0.0-alpha1",
53
- "@vaadin/test-runner-commands": "25.0.0-alpha1",
54
- "@vaadin/testing-helpers": "^1.1.0",
54
+ "@vaadin/chai-plugins": "25.0.0-alpha10",
55
+ "@vaadin/test-runner-commands": "25.0.0-alpha10",
56
+ "@vaadin/testing-helpers": "^2.0.0",
55
57
  "sinon": "^18.0.0"
56
58
  },
57
59
  "cvdlName": "vaadin-crud",
@@ -59,5 +61,5 @@
59
61
  "web-types.json",
60
62
  "web-types.lit.json"
61
63
  ],
62
- "gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
64
+ "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
63
65
  }
@@ -11,5 +11,3 @@
11
11
  import type { CSSResult } from 'lit';
12
12
 
13
13
  export const crudStyles: CSSResult;
14
-
15
- export const crudDialogOverlayStyles: CSSResult;
@@ -0,0 +1,162 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import '@vaadin/component-base/src/style-props.js';
12
+ import { css } from 'lit';
13
+
14
+ export const crudStyles = css`
15
+ :host {
16
+ --vaadin-grid-border-width: 0px;
17
+ --vaadin-grid-border-radius: var(--vaadin-crud-border-radius, var(--vaadin-radius-l));
18
+ --vaadin-crud-editor-max-height: 40%;
19
+ --vaadin-crud-editor-max-width: 40%;
20
+ border: var(--vaadin-crud-border-width, 1px) solid var(--vaadin-crud-border-color, var(--vaadin-border-color));
21
+ border-radius: var(--vaadin-crud-border-radius, var(--vaadin-radius-l));
22
+ height: 400px;
23
+ width: 100%;
24
+ background: var(--vaadin-crud-background, var(--vaadin-background-color));
25
+ }
26
+
27
+ :host,
28
+ #main {
29
+ align-self: stretch;
30
+ display: flex;
31
+ flex-direction: column;
32
+ position: relative;
33
+ }
34
+
35
+ #main {
36
+ flex: 1 1 100%;
37
+ height: 100%;
38
+ min-width: 0;
39
+ min-height: 0;
40
+ }
41
+
42
+ ::slotted(vaadin-crud-grid) {
43
+ border-end-start-radius: 0;
44
+ border-end-end-radius: 0;
45
+ }
46
+
47
+ :host([hidden]),
48
+ [hidden] {
49
+ display: none !important;
50
+ }
51
+
52
+ #container {
53
+ display: flex;
54
+ height: 100%;
55
+ }
56
+
57
+ :host([editor-position='bottom']) #container {
58
+ flex-direction: column;
59
+ }
60
+
61
+ :host([editor-position='aside'][editor-opened]) #main {
62
+ border-inline-end: var(--vaadin-crud-border-width, 1px) solid
63
+ var(--vaadin-crud-border-color, var(--vaadin-border-color));
64
+ }
65
+
66
+ :host([editor-position='aside'][editor-opened]) ::slotted(vaadin-crud-grid) {
67
+ border-start-end-radius: 0;
68
+ border-end-end-radius: 0;
69
+ }
70
+
71
+ :host([editor-position='aside'][editor-opened]) :is(#container, [part='editor']) {
72
+ border-start-end-radius: inherit;
73
+ border-end-end-radius: inherit;
74
+ }
75
+
76
+ :host([editor-position='bottom'][editor-opened]) #main {
77
+ border-bottom: var(--vaadin-crud-border-width, 1px) solid
78
+ var(--vaadin-crud-border-color, var(--vaadin-border-color));
79
+ }
80
+
81
+ :host([editor-position='bottom'][editor-opened]) :is(#container, [part='editor']) {
82
+ border-end-start-radius: inherit;
83
+ border-end-end-radius: inherit;
84
+ }
85
+
86
+ [part='toolbar'] {
87
+ align-items: baseline;
88
+ background: var(--vaadin-crud-toolbar-background, transparent);
89
+ border-top: var(--vaadin-crud-border-width, 1px) solid var(--vaadin-crud-border-color, var(--vaadin-border-color));
90
+ display: flex;
91
+ flex-shrink: 0;
92
+ justify-content: flex-end;
93
+ padding: var(--vaadin-crud-toolbar-padding, var(--vaadin-padding));
94
+ }
95
+
96
+ :host([no-toolbar]) [part='toolbar'] {
97
+ display: none;
98
+ }
99
+
100
+ [part='editor'] {
101
+ display: flex;
102
+ flex-direction: column;
103
+ height: 100%;
104
+ z-index: 1;
105
+ }
106
+
107
+ [part='editor']:focus-visible {
108
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
109
+ }
110
+
111
+ :host(:not([editor-position=''])[editor-opened]:not([fullscreen])) [part='editor'] {
112
+ flex: 1 0 100%;
113
+ }
114
+
115
+ :host([editor-position='bottom'][editor-opened]:not([fullscreen])) [part='editor'] {
116
+ max-height: var(--vaadin-crud-editor-max-height);
117
+ }
118
+
119
+ :host([editor-position='aside'][editor-opened]:not([fullscreen])) [part='editor'] {
120
+ max-width: var(--vaadin-crud-editor-max-width);
121
+ min-width: 300px;
122
+ }
123
+
124
+ [part='scroller'] {
125
+ display: flex;
126
+ flex: auto;
127
+ flex-direction: column;
128
+ overflow: auto;
129
+ }
130
+
131
+ [part='header'] {
132
+ color: var(--vaadin-crud-header-color, var(--vaadin-color));
133
+ font-size: var(--vaadin-crud-header-font-size, 1em);
134
+ font-weight: var(--vaadin-crud-header-font-weight, 600);
135
+ line-height: var(--vaadin-crud-header-line-height, inherit);
136
+ padding: var(--vaadin-crud-header-padding, var(--vaadin-padding));
137
+ }
138
+
139
+ ::slotted([slot='header']) {
140
+ color: inherit !important;
141
+ display: contents;
142
+ font: inherit !important;
143
+ overflow-wrap: anywhere;
144
+ }
145
+
146
+ ::slotted([slot='form']) {
147
+ padding: var(--vaadin-crud-form-padding, var(--vaadin-padding));
148
+ }
149
+
150
+ [part='footer'] {
151
+ background: var(--vaadin-crud-footer-background, transparent);
152
+ border-top: var(--vaadin-crud-border-width, 1px) solid var(--vaadin-crud-border-color, var(--vaadin-border-color));
153
+ display: flex;
154
+ flex: none;
155
+ gap: var(--vaadin-crud-footer-gap, var(--vaadin-gap-container-inline));
156
+ padding: var(--vaadin-crud-footer-padding, var(--vaadin-padding));
157
+ }
158
+
159
+ ::slotted([slot='delete-button']) {
160
+ margin-inline-start: auto;
161
+ }
162
+ `;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { CSSResult } from 'lit';
12
+
13
+ export const crudStyles: CSSResult;
@@ -8,7 +8,7 @@
8
8
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
9
  * license.
10
10
  */
11
- import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import { css } from 'lit';
12
12
 
13
13
  export const crudStyles = css`
14
14
  :host {
@@ -91,35 +91,3 @@ export const crudStyles = css`
91
91
  flex-direction: row-reverse;
92
92
  }
93
93
  `;
94
-
95
- export const crudDialogOverlayStyles = css`
96
- [part='overlay'] {
97
- max-width: 54em;
98
- min-width: 20em;
99
- }
100
-
101
- [part='footer'] {
102
- justify-content: flex-start;
103
- flex-direction: row-reverse;
104
- }
105
-
106
- /* Make buttons clickable */
107
- [part='footer'] ::slotted(:not([disabled])) {
108
- pointer-events: all;
109
- }
110
-
111
- :host([fullscreen]) {
112
- inset: 0;
113
- padding: 0;
114
- }
115
-
116
- :host([fullscreen]) [part='overlay'] {
117
- height: 100vh;
118
- width: 100vw;
119
- border-radius: 0 !important;
120
- }
121
-
122
- :host([fullscreen]) [part='content'] {
123
- flex: 1;
124
- }
125
- `;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { CSSResult } from 'lit';
12
+
13
+ export declare const crudDialogOverlayStyles: CSSResult;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import '@vaadin/component-base/src/style-props.js';
12
+ import { css } from 'lit';
13
+ import { dialogOverlayStyles } from '@vaadin/dialog/src/styles/vaadin-dialog-overlay-base-styles.js';
14
+
15
+ const crudDialogOverlay = css`
16
+ [part='header'] {
17
+ color: var(--vaadin-crud-dialog-header-color, var(--vaadin-color));
18
+ font-size: var(--vaadin-crud-dialog-header-font-size, 1em);
19
+ font-weight: var(--vaadin-crud-dialog-header-font-weight, 600);
20
+ line-height: var(--vaadin-crud-dialog-header-line-height, inherit);
21
+ padding: var(--vaadin-crud-header-padding, var(--vaadin-padding));
22
+ }
23
+
24
+ ::slotted([slot='header']) {
25
+ color: inherit !important;
26
+ display: contents;
27
+ font: inherit !important;
28
+ overflow-wrap: anywhere;
29
+ }
30
+
31
+ :host(:is(*, #id)) [part='content'] {
32
+ overflow: auto;
33
+ overscroll-behavior: contain;
34
+ padding: var(--vaadin-crud-form-padding, var(--vaadin-padding));
35
+ }
36
+
37
+ ::slotted([slot='form']) {
38
+ --vaadin-crud-form-padding: 0;
39
+ }
40
+
41
+ [part='footer'] {
42
+ justify-content: normal;
43
+ background: var(--vaadin-crud-footer-background, transparent);
44
+ border-top: var(--vaadin-crud-border-width, 1px) solid var(--vaadin-crud-border-color, var(--vaadin-border-color));
45
+ }
46
+ `;
47
+
48
+ export const crudDialogOverlayStyles = [...dialogOverlayStyles, crudDialogOverlay];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { CSSResult } from 'lit';
12
+
13
+ export declare const crudDialogOverlayStyles: CSSResult;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import { css } from 'lit';
12
+ import { dialogOverlayBase } from '@vaadin/dialog/src/styles/vaadin-dialog-overlay-core-styles.js';
13
+ import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
14
+
15
+ const crudDialogOverlay = css`
16
+ [part='overlay'] {
17
+ max-width: 54em;
18
+ min-width: 20em;
19
+ display: flex;
20
+ }
21
+
22
+ .resizer-container {
23
+ display: flex;
24
+ flex-direction: column;
25
+ flex-grow: 1;
26
+ }
27
+
28
+ [part='footer'] {
29
+ justify-content: flex-start;
30
+ flex-direction: row-reverse;
31
+ }
32
+
33
+ /* Make buttons clickable */
34
+ [part='footer'] ::slotted(:not([disabled])) {
35
+ pointer-events: all;
36
+ }
37
+
38
+ :host([fullscreen]) {
39
+ inset: 0;
40
+ padding: 0;
41
+ }
42
+
43
+ :host([fullscreen]) [part='overlay'] {
44
+ height: 100vh;
45
+ width: 100vw;
46
+ border-radius: 0 !important;
47
+ }
48
+
49
+ :host([fullscreen]) [part='content'] {
50
+ flex: 1;
51
+ }
52
+ `;
53
+
54
+ export const crudDialogOverlayStyles = [overlayStyles, dialogOverlayBase, crudDialogOverlay];
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import '@vaadin/component-base/src/style-props.js';
12
+ import { css } from 'lit';
13
+
14
+ export const crudEditStyles = css`
15
+ [part='icon'] {
16
+ background: currentColor;
17
+ display: block;
18
+ height: var(--vaadin-icon-size, 1lh);
19
+ mask-image: var(--_vaadin-icon-edit);
20
+ width: var(--vaadin-icon-size, 1lh);
21
+ }
22
+
23
+ @media (forced-colors: active) {
24
+ [part='icon'] {
25
+ background: CanvasText;
26
+ }
27
+ }
28
+ `;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import { css } from 'lit';
12
+
13
+ export const crudEditStyles = css`
14
+ :host {
15
+ display: block;
16
+ }
17
+ `;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { CSSResult } from 'lit';
12
+
13
+ export const crudGridStyles: CSSResult;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import '@vaadin/component-base/src/style-props.js';
12
+ import { css } from 'lit';
13
+ import { gridStyles } from '@vaadin/grid/src/styles/vaadin-grid-base-styles.js';
14
+
15
+ const crudGrid = css`
16
+ #scroller {
17
+ border-radius: inherit;
18
+ }
19
+ `;
20
+
21
+ export const crudGridStyles = [gridStyles, crudGrid];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { CSSResult } from 'lit';
12
+
13
+ export const crudGridStyles: CSSResult;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import { gridStyles } from '@vaadin/grid/src/styles/vaadin-grid-core-styles.js';
12
+
13
+ export const crudGridStyles = [gridStyles];
@@ -42,7 +42,7 @@ export class ButtonSlotController extends SlotController {
42
42
  }
43
43
 
44
44
  // Respect default theme attribute set by the Flow counterpart
45
- if (node === this.defaultNode && !node.hasAttribute('theme')) {
45
+ if (node === this.defaultNode && this.theme && !node.hasAttribute('theme')) {
46
46
  node.setAttribute('theme', this.theme);
47
47
  }
48
48
 
@@ -15,12 +15,11 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
15
15
  import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
16
16
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
17
17
  import { DialogBaseMixin } from '@vaadin/dialog/src/vaadin-dialog-base-mixin.js';
18
- import { dialogOverlay, resizableOverlay } from '@vaadin/dialog/src/vaadin-dialog-styles.js';
19
18
  import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
20
- import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
19
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
21
20
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
22
21
  import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
23
- import { crudDialogOverlayStyles } from './vaadin-crud-styles.js';
22
+ import { crudDialogOverlayStyles } from './styles/vaadin-crud-dialog-overlay-core-styles.js';
24
23
 
25
24
  /**
26
25
  * An element used internally by `<vaadin-crud>`. Not intended to be used separately.
@@ -32,13 +31,22 @@ import { crudDialogOverlayStyles } from './vaadin-crud-styles.js';
32
31
  * @mixes ThemableMixin
33
32
  * @private
34
33
  */
35
- class CrudDialogOverlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
34
+ class CrudDialogOverlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
36
35
  static get is() {
37
36
  return 'vaadin-crud-dialog-overlay';
38
37
  }
39
38
 
40
39
  static get styles() {
41
- return [overlayStyles, dialogOverlay, resizableOverlay, crudDialogOverlayStyles];
40
+ return crudDialogOverlayStyles;
41
+ }
42
+
43
+ /**
44
+ * Override method from OverlayFocusMixin to use the owner (CRUD element) as modal root
45
+ * @protected
46
+ * @override
47
+ */
48
+ get _modalRoot() {
49
+ return this.owner;
42
50
  }
43
51
 
44
52
  /** @protected */
@@ -47,7 +55,9 @@ class CrudDialogOverlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin
47
55
  <div part="backdrop" id="backdrop" ?hidden="${!this.withBackdrop}"></div>
48
56
  <div part="overlay" id="overlay" tabindex="0">
49
57
  <section id="resizerContainer" class="resizer-container">
50
- <header part="header"><slot name="header"></slot></header>
58
+ <header part="header">
59
+ <slot name="header"></slot>
60
+ </header>
51
61
  <div part="content" id="content">
52
62
  <slot name="form"></slot>
53
63
  </div>
@@ -87,21 +97,28 @@ class CrudDialog extends DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(Po
87
97
 
88
98
  static get styles() {
89
99
  return css`
90
- :host {
91
- display: none;
100
+ :host([opened]),
101
+ :host([opening]),
102
+ :host([closing]) {
103
+ display: contents !important;
104
+ }
105
+
106
+ :host,
107
+ :host([hidden]) {
108
+ display: none !important;
92
109
  }
93
110
  `;
94
111
  }
95
112
 
96
113
  static get properties() {
97
114
  return {
98
- ariaLabel: {
99
- type: String,
100
- },
101
-
102
115
  fullscreen: {
103
116
  type: Boolean,
104
117
  },
118
+
119
+ crudElement: {
120
+ type: Object,
121
+ },
105
122
  };
106
123
  }
107
124
 
@@ -110,20 +127,33 @@ class CrudDialog extends DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(Po
110
127
  return html`
111
128
  <vaadin-crud-dialog-overlay
112
129
  id="overlay"
130
+ .owner="${this.crudElement}"
113
131
  .opened="${this.opened}"
114
- aria-label="${ifDefined(this.ariaLabel)}"
115
132
  @opened-changed="${this._onOverlayOpened}"
116
133
  @mousedown="${this._bringOverlayToFront}"
117
134
  @touchstart="${this._bringOverlayToFront}"
135
+ @vaadin-overlay-outside-click="${this.__cancel}"
136
+ @vaadin-overlay-escape-press="${this.__cancel}"
118
137
  theme="${ifDefined(this._theme)}"
119
138
  .modeless="${this.modeless}"
120
139
  .withBackdrop="${!this.modeless}"
121
140
  ?fullscreen="${this.fullscreen}"
122
- role="dialog"
123
141
  focus-trap
124
- ></vaadin-crud-dialog-overlay>
142
+ exportparts="backdrop, overlay, header, content, footer"
143
+ >
144
+ <slot name="header" slot="header"></slot>
145
+ <slot name="form" slot="form"></slot>
146
+ <slot name="save-button" slot="save-button"></slot>
147
+ <slot name="cancel-button" slot="cancel-button"></slot>
148
+ <slot name="delete-button" slot="delete-button"></slot>
149
+ </vaadin-crud-dialog-overlay>
125
150
  `;
126
151
  }
152
+
153
+ /** @private **/
154
+ __cancel() {
155
+ this.dispatchEvent(new CustomEvent('cancel'));
156
+ }
127
157
  }
128
158
 
129
159
  defineCustomElement(CrudDialog);