@vaadin/master-detail-layout 25.0.0-alpha3 → 25.0.0-alpha4
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 +7 -7
- package/src/styles/vaadin-master-detail-layout-styles.d.ts +8 -0
- package/src/styles/vaadin-master-detail-layout-styles.js +155 -0
- package/src/styles/vaadin-master-detail-layout-transition-styles.d.ts +8 -0
- package/src/{vaadin-master-detail-layout-transition-styles.js → styles/vaadin-master-detail-layout-transition-styles.js} +1 -1
- package/src/vaadin-master-detail-layout.js +5 -151
- 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/master-detail-layout",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"web-component"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
38
|
-
"@vaadin/component-base": "25.0.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-alpha4",
|
|
38
|
+
"@vaadin/component-base": "25.0.0-alpha4",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha4",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha4",
|
|
41
41
|
"lit": "^3.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
44
|
+
"@vaadin/chai-plugins": "25.0.0-alpha4",
|
|
45
45
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
46
46
|
"sinon": "^18.0.0"
|
|
47
47
|
},
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"web-types.json",
|
|
50
50
|
"web-types.lit.json"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "ce4421f0daf26027b863b91787a474e4cc264344"
|
|
53
53
|
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2025 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const masterDetailLayoutStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: flex;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([hidden]) {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host(:not([has-detail])) [part='detail'],
|
|
20
|
+
[part='backdrop'] {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([orientation='horizontal']) [part='master'] {
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Drawer mode */
|
|
29
|
+
:host(:is([drawer], [stack])) {
|
|
30
|
+
position: relative;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host(:is([drawer], [stack])[containment='layout']) [part='detail'],
|
|
34
|
+
:host([drawer][containment='layout']) [part='backdrop'] {
|
|
35
|
+
position: absolute;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host(:is([drawer], [stack])[containment='viewport']) [part='detail'],
|
|
39
|
+
:host([drawer][containment='viewport']) [part='backdrop'] {
|
|
40
|
+
position: fixed;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([drawer][has-detail]) [part='backdrop'] {
|
|
44
|
+
display: block;
|
|
45
|
+
inset: 0;
|
|
46
|
+
z-index: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host(:is([drawer], [stack])) [part='detail'] {
|
|
50
|
+
z-index: 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([drawer][orientation='horizontal']) [part='detail'] {
|
|
54
|
+
inset-inline-end: 0;
|
|
55
|
+
height: 100%;
|
|
56
|
+
width: var(--_detail-min-size, min-content);
|
|
57
|
+
max-width: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([drawer][orientation='horizontal'][containment='viewport']) [part='detail'] {
|
|
61
|
+
inset-block-start: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* No fixed size */
|
|
65
|
+
:host(:not([has-master-size])) [part='master'],
|
|
66
|
+
:host(:not([has-detail-size])) [part='detail'] {
|
|
67
|
+
flex-grow: 1;
|
|
68
|
+
flex-basis: 50%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Fixed size */
|
|
72
|
+
:host([has-master-size]) [part='master'],
|
|
73
|
+
:host([has-detail-size]) [part='detail'] {
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([has-master-size][orientation='horizontal']) [part='master'] {
|
|
78
|
+
width: var(--_master-size);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([has-detail-size][orientation='horizontal']:not([stack])) [part='detail'] {
|
|
82
|
+
width: var(--_detail-size);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([has-master-size][has-detail-size]) [part='master'] {
|
|
86
|
+
flex-grow: 1;
|
|
87
|
+
flex-basis: var(--_master-size);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([has-master-size][has-detail-size]) [part='detail'] {
|
|
91
|
+
flex-grow: 1;
|
|
92
|
+
flex-basis: var(--_detail-size);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Min size */
|
|
96
|
+
:host([has-master-min-size][has-detail][orientation='horizontal']:not([drawer]):not([stack])) [part='master'] {
|
|
97
|
+
min-width: var(--_master-min-size);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host([has-detail-min-size][orientation='horizontal']:not([drawer]):not([stack])) [part='detail'] {
|
|
101
|
+
min-width: var(--_detail-min-size);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([has-master-min-size]) [part='master'],
|
|
105
|
+
:host([has-detail-min-size]) [part='detail'] {
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Vertical */
|
|
110
|
+
:host([orientation='vertical']) {
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host([orientation='vertical'][drawer]) [part='master'] {
|
|
115
|
+
max-height: 100%;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([orientation='vertical'][drawer]) [part='detail'] {
|
|
119
|
+
inset-block-end: 0;
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: var(--_detail-min-size, min-content);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([drawer][orientation='vertical'][containment='viewport']) [part='detail'] {
|
|
125
|
+
inset-inline-start: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Fixed size */
|
|
129
|
+
:host([has-master-size][orientation='vertical']) [part='master'] {
|
|
130
|
+
height: var(--_master-size);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([has-detail-size][orientation='vertical']:not([stack])) [part='detail'] {
|
|
134
|
+
height: var(--_detail-size);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Min size */
|
|
138
|
+
:host([has-master-min-size][orientation='vertical']:not([drawer])) [part='master'],
|
|
139
|
+
:host([has-master-min-size][orientation='vertical'][drawer]) {
|
|
140
|
+
min-height: var(--_master-min-size);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([has-detail-min-size][orientation='vertical']:not([drawer]):not([stack])) [part='detail'] {
|
|
144
|
+
min-height: var(--_detail-min-size);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Stack mode */
|
|
148
|
+
:host([stack]) [part='master'] {
|
|
149
|
+
max-height: 100%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([stack]) [part='detail'] {
|
|
153
|
+
inset: 0;
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2025 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import type { CSSResult } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const masterDetailLayoutTransitionStyles: CSSResult;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2025 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, LitElement, nothing } from 'lit';
|
|
7
7
|
import { getFocusableElements } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
@@ -11,7 +11,8 @@ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
|
11
11
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
12
12
|
import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
13
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
-
import {
|
|
14
|
+
import { masterDetailLayoutStyles } from './styles/vaadin-master-detail-layout-styles.js';
|
|
15
|
+
import { masterDetailLayoutTransitionStyles } from './styles/vaadin-master-detail-layout-transition-styles.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* `<vaadin-master-detail-layout>` is a web component for building UIs with a master
|
|
@@ -63,154 +64,7 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
static get styles() {
|
|
66
|
-
return
|
|
67
|
-
:host {
|
|
68
|
-
display: flex;
|
|
69
|
-
box-sizing: border-box;
|
|
70
|
-
height: 100%;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:host([hidden]) {
|
|
74
|
-
display: none !important;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
:host(:not([has-detail])) [part='detail'],
|
|
78
|
-
[part='backdrop'] {
|
|
79
|
-
display: none;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
:host([orientation='horizontal']) [part='master'] {
|
|
83
|
-
max-width: 100%;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Drawer mode */
|
|
87
|
-
:host(:is([drawer], [stack])) {
|
|
88
|
-
position: relative;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
:host(:is([drawer], [stack])[containment='layout']) [part='detail'],
|
|
92
|
-
:host([drawer][containment='layout']) [part='backdrop'] {
|
|
93
|
-
position: absolute;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
:host(:is([drawer], [stack])[containment='viewport']) [part='detail'],
|
|
97
|
-
:host([drawer][containment='viewport']) [part='backdrop'] {
|
|
98
|
-
position: fixed;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
:host([drawer][has-detail]) [part='backdrop'] {
|
|
102
|
-
display: block;
|
|
103
|
-
inset: 0;
|
|
104
|
-
z-index: 1;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
:host(:is([drawer], [stack])) [part='detail'] {
|
|
108
|
-
z-index: 1;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:host([drawer][orientation='horizontal']) [part='detail'] {
|
|
112
|
-
inset-inline-end: 0;
|
|
113
|
-
height: 100%;
|
|
114
|
-
width: var(--_detail-min-size, min-content);
|
|
115
|
-
max-width: 100%;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
:host([drawer][orientation='horizontal'][containment='viewport']) [part='detail'] {
|
|
119
|
-
inset-block-start: 0;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* No fixed size */
|
|
123
|
-
:host(:not([has-master-size])) [part='master'],
|
|
124
|
-
:host(:not([has-detail-size])) [part='detail'] {
|
|
125
|
-
flex-grow: 1;
|
|
126
|
-
flex-basis: 50%;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* Fixed size */
|
|
130
|
-
:host([has-master-size]) [part='master'],
|
|
131
|
-
:host([has-detail-size]) [part='detail'] {
|
|
132
|
-
flex-shrink: 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
:host([has-master-size][orientation='horizontal']) [part='master'] {
|
|
136
|
-
width: var(--_master-size);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
:host([has-detail-size][orientation='horizontal']:not([stack])) [part='detail'] {
|
|
140
|
-
width: var(--_detail-size);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
:host([has-master-size][has-detail-size]) [part='master'] {
|
|
144
|
-
flex-grow: 1;
|
|
145
|
-
flex-basis: var(--_master-size);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
:host([has-master-size][has-detail-size]) [part='detail'] {
|
|
149
|
-
flex-grow: 1;
|
|
150
|
-
flex-basis: var(--_detail-size);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/* Min size */
|
|
154
|
-
:host([has-master-min-size][has-detail][orientation='horizontal']:not([drawer]):not([stack])) [part='master'] {
|
|
155
|
-
min-width: var(--_master-min-size);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
:host([has-detail-min-size][orientation='horizontal']:not([drawer]):not([stack])) [part='detail'] {
|
|
159
|
-
min-width: var(--_detail-min-size);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
:host([has-master-min-size]) [part='master'],
|
|
163
|
-
:host([has-detail-min-size]) [part='detail'] {
|
|
164
|
-
flex-shrink: 0;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/* Vertical */
|
|
168
|
-
:host([orientation='vertical']) {
|
|
169
|
-
flex-direction: column;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
:host([orientation='vertical'][drawer]) [part='master'] {
|
|
173
|
-
max-height: 100%;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
:host([orientation='vertical'][drawer]) [part='detail'] {
|
|
177
|
-
inset-block-end: 0;
|
|
178
|
-
width: 100%;
|
|
179
|
-
height: var(--_detail-min-size, min-content);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
:host([drawer][orientation='vertical'][containment='viewport']) [part='detail'] {
|
|
183
|
-
inset-inline-start: 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/* Fixed size */
|
|
187
|
-
:host([has-master-size][orientation='vertical']) [part='master'] {
|
|
188
|
-
height: var(--_master-size);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
:host([has-detail-size][orientation='vertical']:not([stack])) [part='detail'] {
|
|
192
|
-
height: var(--_detail-size);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/* Min size */
|
|
196
|
-
:host([has-master-min-size][orientation='vertical']:not([drawer])) [part='master'],
|
|
197
|
-
:host([has-master-min-size][orientation='vertical'][drawer]) {
|
|
198
|
-
min-height: var(--_master-min-size);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
:host([has-detail-min-size][orientation='vertical']:not([drawer]):not([stack])) [part='detail'] {
|
|
202
|
-
min-height: var(--_detail-min-size);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/* Stack mode */
|
|
206
|
-
:host([stack]) [part='master'] {
|
|
207
|
-
max-height: 100%;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
:host([stack]) [part='detail'] {
|
|
211
|
-
inset: 0;
|
|
212
|
-
}
|
|
213
|
-
`;
|
|
67
|
+
return masterDetailLayoutStyles;
|
|
214
68
|
}
|
|
215
69
|
|
|
216
70
|
static get properties() {
|
|
@@ -388,7 +242,7 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
|
|
|
388
242
|
|
|
389
243
|
/** @override */
|
|
390
244
|
get slotStyles() {
|
|
391
|
-
return [
|
|
245
|
+
return [masterDetailLayoutTransitionStyles];
|
|
392
246
|
}
|
|
393
247
|
|
|
394
248
|
/** @protected */
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED