@vaadin/dialog 25.1.0-alpha5 → 25.1.0-alpha7
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 +2021 -0
- package/package.json +13 -11
- package/src/vaadin-dialog-overlay-mixin.js +14 -6
- package/src/vaadin-dialog-overlay.js +1 -1
- package/src/vaadin-dialog.js +1 -1
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/dialog",
|
|
3
|
-
"version": "25.1.0-
|
|
3
|
+
"version": "25.1.0-alpha7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"src",
|
|
26
26
|
"vaadin-*.d.ts",
|
|
27
27
|
"vaadin-*.js",
|
|
28
|
+
"custom-elements.json",
|
|
28
29
|
"web-types.json",
|
|
29
30
|
"web-types.lit.json"
|
|
30
31
|
],
|
|
@@ -36,24 +37,25 @@
|
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@vaadin/component-base": "25.1.0-
|
|
40
|
-
"@vaadin/lit-renderer": "25.1.0-
|
|
41
|
-
"@vaadin/overlay": "25.1.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.1.0-
|
|
40
|
+
"@vaadin/component-base": "25.1.0-alpha7",
|
|
41
|
+
"@vaadin/lit-renderer": "25.1.0-alpha7",
|
|
42
|
+
"@vaadin/overlay": "25.1.0-alpha7",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.1.0-alpha7",
|
|
43
44
|
"lit": "^3.0.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@vaadin/a11y-base": "25.1.0-
|
|
47
|
-
"@vaadin/aura": "25.1.0-
|
|
48
|
-
"@vaadin/chai-plugins": "25.1.0-
|
|
49
|
-
"@vaadin/test-runner-commands": "25.1.0-
|
|
47
|
+
"@vaadin/a11y-base": "25.1.0-alpha7",
|
|
48
|
+
"@vaadin/aura": "25.1.0-alpha7",
|
|
49
|
+
"@vaadin/chai-plugins": "25.1.0-alpha7",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.1.0-alpha7",
|
|
50
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
51
|
-
"@vaadin/vaadin-lumo-styles": "25.1.0-
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "25.1.0-alpha7",
|
|
52
53
|
"sinon": "^21.0.0"
|
|
53
54
|
},
|
|
55
|
+
"customElements": "custom-elements.json",
|
|
54
56
|
"web-types": [
|
|
55
57
|
"web-types.json",
|
|
56
58
|
"web-types.lit.json"
|
|
57
59
|
],
|
|
58
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "98c586125f769c8fefd307536965293668fda81d"
|
|
59
61
|
}
|
|
@@ -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 { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
|
|
6
7
|
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
7
8
|
import { setOverlayStateAttribute } from '@vaadin/overlay/src/vaadin-overlay-utils.js';
|
|
8
9
|
|
|
@@ -90,6 +91,19 @@ export const DialogOverlayMixin = (superClass) =>
|
|
|
90
91
|
this.shadowRoot.addEventListener('slotchange', () => {
|
|
91
92
|
this.__updateOverflow();
|
|
92
93
|
});
|
|
94
|
+
|
|
95
|
+
// Observe header-content and footer slots for dynamic content
|
|
96
|
+
const headerSlot = this.shadowRoot.querySelector('slot[name="header-content"]');
|
|
97
|
+
this.__headerSlotObserver = new SlotObserver(headerSlot, ({ currentNodes }) => {
|
|
98
|
+
setOverlayStateAttribute(this, 'has-header', currentNodes.length > 0);
|
|
99
|
+
this.__updateOverflow();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const footerSlot = this.shadowRoot.querySelector('slot[name="footer"]');
|
|
103
|
+
this.__footerSlotObserver = new SlotObserver(footerSlot, ({ currentNodes }) => {
|
|
104
|
+
setOverlayStateAttribute(this, 'has-footer', currentNodes.length > 0);
|
|
105
|
+
this.__updateOverflow();
|
|
106
|
+
});
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
/** @private */
|
|
@@ -132,17 +146,12 @@ export const DialogOverlayMixin = (superClass) =>
|
|
|
132
146
|
const openedChanged = this._oldOpenedFooterHeader !== opened;
|
|
133
147
|
this._oldOpenedFooterHeader = opened;
|
|
134
148
|
|
|
135
|
-
// Set attributes here to update styles before detecting content overflow
|
|
136
|
-
setOverlayStateAttribute(this, 'has-header', !!headerRenderer);
|
|
137
|
-
setOverlayStateAttribute(this, 'has-footer', !!footerRenderer);
|
|
138
|
-
|
|
139
149
|
if (headerRendererChanged) {
|
|
140
150
|
if (headerRenderer) {
|
|
141
151
|
this.headerContainer = this.__initContainer(this.headerContainer, 'header-content');
|
|
142
152
|
} else if (this.headerContainer) {
|
|
143
153
|
this.headerContainer.remove();
|
|
144
154
|
this.headerContainer = null;
|
|
145
|
-
this.__updateOverflow();
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
157
|
|
|
@@ -152,7 +161,6 @@ export const DialogOverlayMixin = (superClass) =>
|
|
|
152
161
|
} else if (this.footerContainer) {
|
|
153
162
|
this.footerContainer.remove();
|
|
154
163
|
this.footerContainer = null;
|
|
155
|
-
this.__updateOverflow();
|
|
156
164
|
}
|
|
157
165
|
}
|
|
158
166
|
|
|
@@ -15,7 +15,7 @@ import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
|
|
|
15
15
|
/**
|
|
16
16
|
* An element used internally by `<vaadin-dialog>`. Not intended to be used separately.
|
|
17
17
|
*
|
|
18
|
-
* @customElement
|
|
18
|
+
* @customElement vaadin-dialog-overlay
|
|
19
19
|
* @extends HTMLElement
|
|
20
20
|
* @mixes DialogOverlayMixin
|
|
21
21
|
* @mixes DirMixin
|
package/src/vaadin-dialog.js
CHANGED
|
@@ -95,7 +95,7 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
|
|
|
95
95
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
96
96
|
* @fires {CustomEvent} closed - Fired when the dialog is closed.
|
|
97
97
|
*
|
|
98
|
-
* @customElement
|
|
98
|
+
* @customElement vaadin-dialog
|
|
99
99
|
* @extends HTMLElement
|
|
100
100
|
* @mixes ThemePropertyMixin
|
|
101
101
|
* @mixes ElementMixin
|
package/web-types.json
CHANGED