@vaadin/master-detail-layout 24.8.0-alpha3 → 24.8.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/master-detail-layout",
|
|
3
|
-
"version": "24.8.0-
|
|
3
|
+
"version": "24.8.0-alpha4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,14 +34,15 @@
|
|
|
34
34
|
"web-component"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vaadin/
|
|
38
|
-
"@vaadin/
|
|
39
|
-
"@vaadin/vaadin-
|
|
40
|
-
"@vaadin/vaadin-
|
|
37
|
+
"@vaadin/a11y-base": "24.8.0-alpha4",
|
|
38
|
+
"@vaadin/component-base": "24.8.0-alpha4",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha4",
|
|
40
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha4",
|
|
41
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha4",
|
|
41
42
|
"lit": "^3.0.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@vaadin/chai-plugins": "24.8.0-
|
|
45
|
+
"@vaadin/chai-plugins": "24.8.0-alpha4",
|
|
45
46
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
46
47
|
"sinon": "^18.0.0"
|
|
47
48
|
},
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"web-types.json",
|
|
50
51
|
"web-types.lit.json"
|
|
51
52
|
],
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "88251b4c84ebb8849dde982acb62cc2b20eeec31"
|
|
53
54
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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 transitionStyles = css`
|
|
9
|
+
/* Overlay - horizontal - add */
|
|
10
|
+
|
|
11
|
+
vaadin-master-detail-layout[overlay][orientation='horizontal'][transition='add']::part(detail) {
|
|
12
|
+
view-transition-name: vaadin-master-detail-layout-overlay-horizontal-detail-add;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
::view-transition-group(vaadin-master-detail-layout-overlay-horizontal-detail-add) {
|
|
16
|
+
clip-path: inset(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
::view-transition-new(vaadin-master-detail-layout-overlay-horizontal-detail-add) {
|
|
20
|
+
animation: 300ms ease both vaadin-master-detail-layout-overlay-horizontal-detail-add;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes vaadin-master-detail-layout-overlay-horizontal-detail-add {
|
|
24
|
+
from {
|
|
25
|
+
transform: translateX(100%);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Overlay - horizontal - remove */
|
|
30
|
+
|
|
31
|
+
vaadin-master-detail-layout[overlay][orientation='horizontal'][transition='remove']::part(detail) {
|
|
32
|
+
view-transition-name: vaadin-master-detail-layout-overlay-horizontal-detail-remove;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::view-transition-group(vaadin-master-detail-layout-overlay-horizontal-detail-remove) {
|
|
36
|
+
clip-path: inset(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
::view-transition-old(vaadin-master-detail-layout-overlay-horizontal-detail-remove) {
|
|
40
|
+
animation: 300ms ease both vaadin-master-detail-layout-overlay-horizontal-detail-remove;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes vaadin-master-detail-layout-overlay-horizontal-detail-remove {
|
|
44
|
+
to {
|
|
45
|
+
transform: translateX(100%);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Stack - horizontal - add */
|
|
50
|
+
|
|
51
|
+
vaadin-master-detail-layout[stack][orientation='horizontal'][transition='add'] {
|
|
52
|
+
view-transition-name: vaadin-master-detail-layout-stack-horizontal-add;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
::view-transition-group(vaadin-master-detail-layout-stack-horizontal-add) {
|
|
56
|
+
clip-path: inset(0);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::view-transition-new(vaadin-master-detail-layout-stack-horizontal-add) {
|
|
60
|
+
animation: 300ms ease both vaadin-master-detail-layout-stack-horizontal-add-new;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
::view-transition-old(vaadin-master-detail-layout-stack-horizontal-add) {
|
|
64
|
+
animation: 300ms ease both vaadin-master-detail-layout-stack-horizontal-add-old;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes vaadin-master-detail-layout-stack-horizontal-add-new {
|
|
68
|
+
from {
|
|
69
|
+
transform: translateX(100px);
|
|
70
|
+
opacity: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes vaadin-master-detail-layout-stack-horizontal-add-old {
|
|
75
|
+
to {
|
|
76
|
+
transform: translateX(-100px);
|
|
77
|
+
opacity: 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Stack - horizontal - remove */
|
|
82
|
+
|
|
83
|
+
vaadin-master-detail-layout[stack][orientation='horizontal'][transition='remove'] {
|
|
84
|
+
view-transition-name: vaadin-master-detail-layout-stack-horizontal-remove;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
::view-transition-group(vaadin-master-detail-layout-stack-horizontal-remove) {
|
|
88
|
+
clip-path: inset(0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
::view-transition-new(vaadin-master-detail-layout-stack-horizontal-remove) {
|
|
92
|
+
animation: 300ms ease both vaadin-master-detail-layout-stack-horizontal-remove-new;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
::view-transition-old(vaadin-master-detail-layout-stack-horizontal-remove) {
|
|
96
|
+
animation: 300ms ease both vaadin-master-detail-layout-stack-horizontal-remove-old;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@keyframes vaadin-master-detail-layout-stack-horizontal-remove-new {
|
|
100
|
+
from {
|
|
101
|
+
transform: translateX(-100px);
|
|
102
|
+
opacity: 0;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@keyframes vaadin-master-detail-layout-stack-horizontal-remove-old {
|
|
107
|
+
to {
|
|
108
|
+
transform: translateX(100px);
|
|
109
|
+
opacity: 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
@@ -5,14 +5,36 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
7
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
8
|
+
import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* `<vaadin-master-detail-layout>` is a web component for building UIs with a master
|
|
12
13
|
* (or primary) area and a detail (or secondary) area that is displayed next to, or
|
|
13
14
|
* overlaid on top of, the master area, depending on configuration and viewport size.
|
|
15
|
+
*
|
|
16
|
+
* ### Styling
|
|
17
|
+
*
|
|
18
|
+
* The following shadow DOM parts are available for styling:
|
|
19
|
+
*
|
|
20
|
+
* Part name | Description
|
|
21
|
+
* ---------------|----------------------
|
|
22
|
+
* `master` | The master area
|
|
23
|
+
* `detail` | The detail area
|
|
24
|
+
*
|
|
25
|
+
* The following state attributes are available for styling:
|
|
26
|
+
*
|
|
27
|
+
* Attribute | Description
|
|
28
|
+
* ---------------| -----------
|
|
29
|
+
* `containment` | Set to `layout` or `viewport` depending on the containment.
|
|
30
|
+
* `orientation` | Set to `horizontal` or `vertical` depending on the orientation.
|
|
31
|
+
* `has-detail` | Set when the detail content is provided.
|
|
32
|
+
* `overlay` | Set when the layout is using the overlay mode.
|
|
33
|
+
* `stack` | Set when the layout is using the stack mode.
|
|
34
|
+
*
|
|
35
|
+
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
14
36
|
*/
|
|
15
|
-
declare class MasterDetailLayout extends ResizeMixin(ThemableMixin(ElementMixin(HTMLElement))) {
|
|
37
|
+
declare class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ThemableMixin(ElementMixin(HTMLElement)))) {
|
|
16
38
|
/**
|
|
17
39
|
* Fixed size (in CSS length units) to be set on the detail area.
|
|
18
40
|
* When specified, it prevents the detail area from growing or
|
|
@@ -38,7 +60,6 @@ declare class MasterDetailLayout extends ResizeMixin(ThemableMixin(ElementMixin(
|
|
|
38
60
|
* When specified, it prevents the master area from growing or
|
|
39
61
|
* shrinking. If there is not enough space to show master and detail
|
|
40
62
|
* areas next to each other, the layout switches to the overlay mode.
|
|
41
|
-
* Setting `100%` enforces the overlay mode to be used by default.
|
|
42
63
|
*
|
|
43
64
|
* @attr {string} master-size
|
|
44
65
|
*/
|
|
@@ -49,11 +70,55 @@ declare class MasterDetailLayout extends ResizeMixin(ThemableMixin(ElementMixin(
|
|
|
49
70
|
* When specified, it prevents the master area from shrinking below
|
|
50
71
|
* this size. If there is not enough space to show master and detail
|
|
51
72
|
* areas next to each other, the layout switches to the overlay mode.
|
|
52
|
-
* Setting `100%` enforces the overlay mode to be used by default.
|
|
53
73
|
*
|
|
54
74
|
* @attr {string} master-min-size
|
|
55
75
|
*/
|
|
56
76
|
masterMinSize: string | null | undefined;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Define how master and detail areas are shown next to each other,
|
|
80
|
+
* and the way how size and min-size properties are applied to them.
|
|
81
|
+
* Possible values are: `horizontal` or `vertical`.
|
|
82
|
+
* Defaults to horizontal.
|
|
83
|
+
*/
|
|
84
|
+
orientation: 'horizontal' | 'vertical';
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* When specified, forces the layout to use overlay mode, even if
|
|
88
|
+
* there is enough space for master and detail to be shown next to
|
|
89
|
+
* each other using the default (split) mode.
|
|
90
|
+
*
|
|
91
|
+
* @attr {boolean} force-overlay
|
|
92
|
+
*/
|
|
93
|
+
forceOverlay: boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Defines the containment of the detail area when the layout is in
|
|
97
|
+
* overlay mode. When set to `layout`, the overlay is confined to the
|
|
98
|
+
* layout. When set to `viewport`, the overlay is confined to the
|
|
99
|
+
* browser's viewport. Defaults to `layout`.
|
|
100
|
+
*/
|
|
101
|
+
containment: 'layout' | 'viewport';
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The threshold (in CSS length units) at which the layout switches to
|
|
105
|
+
* the "stack" mode, making detail area fully cover the master area.
|
|
106
|
+
*
|
|
107
|
+
* @attr {string} stack-threshold
|
|
108
|
+
*/
|
|
109
|
+
stackThreshold: string | null | undefined;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Sets the detail element to be displayed in the detail area and starts a
|
|
113
|
+
* view transition that animates adding, replacing or removing the detail
|
|
114
|
+
* area. During the view transition, the element is added to the DOM and
|
|
115
|
+
* assigned to the `detail` slot. Any previous detail element is removed.
|
|
116
|
+
* When passing null as the element, the current detail element is removed.
|
|
117
|
+
*
|
|
118
|
+
* If the browser does not support view transitions, the respective updates
|
|
119
|
+
* are applied immediately without starting a transition.
|
|
120
|
+
*/
|
|
121
|
+
setDetail(detail: HTMLElement | null): Promise<void>;
|
|
57
122
|
}
|
|
58
123
|
|
|
59
124
|
declare global {
|
|
@@ -3,25 +3,50 @@
|
|
|
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 { css, html, LitElement } from 'lit';
|
|
6
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
7
|
+
import { getFocusableElements } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
7
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
11
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
12
|
+
import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
11
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
+
import { transitionStyles } from './vaadin-master-detail-layout-transition-styles.js';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* `<vaadin-master-detail-layout>` is a web component for building UIs with a master
|
|
15
18
|
* (or primary) area and a detail (or secondary) area that is displayed next to, or
|
|
16
19
|
* overlaid on top of, the master area, depending on configuration and viewport size.
|
|
17
20
|
*
|
|
21
|
+
* ### Styling
|
|
22
|
+
*
|
|
23
|
+
* The following shadow DOM parts are available for styling:
|
|
24
|
+
*
|
|
25
|
+
* Part name | Description
|
|
26
|
+
* ---------------|----------------------
|
|
27
|
+
* `master` | The master area
|
|
28
|
+
* `detail` | The detail area
|
|
29
|
+
*
|
|
30
|
+
* The following state attributes are available for styling:
|
|
31
|
+
*
|
|
32
|
+
* Attribute | Description
|
|
33
|
+
* ---------------| -----------
|
|
34
|
+
* `containment` | Set to `layout` or `viewport` depending on the containment.
|
|
35
|
+
* `orientation` | Set to `horizontal` or `vertical` depending on the orientation.
|
|
36
|
+
* `has-detail` | Set when the detail content is provided.
|
|
37
|
+
* `overlay` | Set when the layout is using the overlay mode.
|
|
38
|
+
* `stack` | Set when the layout is using the stack mode.
|
|
39
|
+
*
|
|
40
|
+
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
41
|
+
*
|
|
18
42
|
* @customElement
|
|
19
43
|
* @extends HTMLElement
|
|
20
44
|
* @mixes ThemableMixin
|
|
21
45
|
* @mixes ElementMixin
|
|
22
46
|
* @mixes ResizeMixin
|
|
47
|
+
* @mixes SlotStylesMixin
|
|
23
48
|
*/
|
|
24
|
-
class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
49
|
+
class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement))))) {
|
|
25
50
|
static get is() {
|
|
26
51
|
return 'vaadin-master-detail-layout';
|
|
27
52
|
}
|
|
@@ -43,19 +68,30 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
43
68
|
}
|
|
44
69
|
|
|
45
70
|
/* Overlay mode */
|
|
46
|
-
:host([overlay][
|
|
71
|
+
:host(:is([overlay], [stack])) {
|
|
47
72
|
position: relative;
|
|
48
73
|
}
|
|
49
74
|
|
|
50
|
-
:host([overlay]) [part='detail'] {
|
|
75
|
+
:host(:is([overlay], [stack])[containment='layout']) [part='detail'] {
|
|
51
76
|
position: absolute;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host(:is([overlay], [stack])[containment='viewport']) [part='detail'] {
|
|
80
|
+
position: fixed;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([overlay][orientation='horizontal']) [part='detail'] {
|
|
52
84
|
inset-inline-end: 0;
|
|
53
85
|
height: 100%;
|
|
54
86
|
width: var(--_detail-min-size, min-content);
|
|
55
87
|
max-width: 100%;
|
|
56
88
|
}
|
|
57
89
|
|
|
58
|
-
:host([overlay]) [part='
|
|
90
|
+
:host([overlay][orientation='horizontal'][containment='viewport']) [part='detail'] {
|
|
91
|
+
inset-block-start: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([overlay][orientation='horizontal']) [part='master'] {
|
|
59
95
|
max-width: 100%;
|
|
60
96
|
}
|
|
61
97
|
|
|
@@ -67,14 +103,17 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
67
103
|
}
|
|
68
104
|
|
|
69
105
|
/* Fixed size */
|
|
70
|
-
:host([has-master-size]) [part='master']
|
|
71
|
-
|
|
106
|
+
:host([has-master-size]) [part='master'],
|
|
107
|
+
:host([has-detail-size]) [part='detail'] {
|
|
72
108
|
flex-shrink: 0;
|
|
73
109
|
}
|
|
74
110
|
|
|
75
|
-
:host([has-
|
|
111
|
+
:host([has-master-size][orientation='horizontal']) [part='master'] {
|
|
112
|
+
width: var(--_master-size);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host([has-detail-size][orientation='horizontal']:not([stack])) [part='detail'] {
|
|
76
116
|
width: var(--_detail-size);
|
|
77
|
-
flex-shrink: 0;
|
|
78
117
|
}
|
|
79
118
|
|
|
80
119
|
:host([has-master-size][has-detail-size]) [part='master'] {
|
|
@@ -88,11 +127,11 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
88
127
|
}
|
|
89
128
|
|
|
90
129
|
/* Min size */
|
|
91
|
-
:host([has-master-min-size]:not([overlay])) [part='master'] {
|
|
130
|
+
:host([has-master-min-size][orientation='horizontal']:not([overlay])) [part='master'] {
|
|
92
131
|
min-width: var(--_master-min-size);
|
|
93
132
|
}
|
|
94
133
|
|
|
95
|
-
:host([has-detail-min-size]:not([overlay])) [part='detail'] {
|
|
134
|
+
:host([has-detail-min-size][orientation='horizontal']:not([overlay]):not([stack])) [part='detail'] {
|
|
96
135
|
min-width: var(--_detail-min-size);
|
|
97
136
|
}
|
|
98
137
|
|
|
@@ -100,6 +139,57 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
100
139
|
:host([has-detail-min-size]) [part='detail'] {
|
|
101
140
|
flex-shrink: 0;
|
|
102
141
|
}
|
|
142
|
+
|
|
143
|
+
/* Vertical */
|
|
144
|
+
:host([orientation='vertical']) {
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([orientation='vertical'][overlay]) [part='master'] {
|
|
149
|
+
max-height: 100%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([orientation='vertical'][overlay]) [part='detail'] {
|
|
153
|
+
inset-block-end: 0;
|
|
154
|
+
width: 100%;
|
|
155
|
+
height: var(--_detail-min-size, min-content);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:host([overlay][orientation='vertical'][containment='viewport']) [part='detail'] {
|
|
159
|
+
inset-inline-start: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Fixed size */
|
|
163
|
+
:host([has-master-size][orientation='vertical']) [part='master'] {
|
|
164
|
+
height: var(--_master-size);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host([has-detail-size][orientation='vertical']:not([stack])) [part='detail'] {
|
|
168
|
+
height: var(--_detail-size);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Min size */
|
|
172
|
+
:host([has-master-min-size][orientation='vertical']:not([overlay])) [part='master'],
|
|
173
|
+
:host([has-master-min-size][orientation='vertical'][overlay]) {
|
|
174
|
+
min-height: var(--_master-min-size);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host([has-detail-min-size][orientation='vertical']:not([overlay]):not([stack])) [part='detail'] {
|
|
178
|
+
min-height: var(--_detail-min-size);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Stack mode */
|
|
182
|
+
:host([stack]) [part='master'] {
|
|
183
|
+
max-height: 100%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
:host([stack]) [part='detail'] {
|
|
187
|
+
inset: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
[part='master']::before {
|
|
191
|
+
background-position-y: var(--_stack-threshold);
|
|
192
|
+
}
|
|
103
193
|
`;
|
|
104
194
|
}
|
|
105
195
|
|
|
@@ -138,7 +228,6 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
138
228
|
* When specified, it prevents the master area from growing or
|
|
139
229
|
* shrinking. If there is not enough space to show master and detail
|
|
140
230
|
* areas next to each other, the layout switches to the overlay mode.
|
|
141
|
-
* Setting `100%` enforces the overlay mode to be used by default.
|
|
142
231
|
*
|
|
143
232
|
* @attr {string} master-size
|
|
144
233
|
*/
|
|
@@ -153,7 +242,6 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
153
242
|
* When specified, it prevents the master area from shrinking below
|
|
154
243
|
* this size. If there is not enough space to show master and detail
|
|
155
244
|
* areas next to each other, the layout switches to the overlay mode.
|
|
156
|
-
* Setting `100%` enforces the overlay mode to be used by default.
|
|
157
245
|
*
|
|
158
246
|
* @attr {string} master-min-size
|
|
159
247
|
*/
|
|
@@ -162,16 +250,103 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
162
250
|
sync: true,
|
|
163
251
|
observer: '__masterMinSizeChanged',
|
|
164
252
|
},
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Define how master and detail areas are shown next to each other,
|
|
256
|
+
* and the way how size and min-size properties are applied to them.
|
|
257
|
+
* Possible values are: `horizontal` or `vertical`.
|
|
258
|
+
* Defaults to horizontal.
|
|
259
|
+
*/
|
|
260
|
+
orientation: {
|
|
261
|
+
type: String,
|
|
262
|
+
value: 'horizontal',
|
|
263
|
+
reflectToAttribute: true,
|
|
264
|
+
observer: '__orientationChanged',
|
|
265
|
+
sync: true,
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* When specified, forces the layout to use overlay mode, even if
|
|
270
|
+
* there is enough space for master and detail to be shown next to
|
|
271
|
+
* each other using the default (split) mode.
|
|
272
|
+
*
|
|
273
|
+
* @attr {boolean} force-overlay
|
|
274
|
+
*/
|
|
275
|
+
forceOverlay: {
|
|
276
|
+
type: Boolean,
|
|
277
|
+
value: false,
|
|
278
|
+
observer: '__forceOverlayChanged',
|
|
279
|
+
sync: true,
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Defines the containment of the detail area when the layout is in
|
|
284
|
+
* overlay mode. When set to `layout`, the overlay is confined to the
|
|
285
|
+
* layout. When set to `viewport`, the overlay is confined to the
|
|
286
|
+
* browser's viewport. Defaults to `layout`.
|
|
287
|
+
*/
|
|
288
|
+
containment: {
|
|
289
|
+
type: String,
|
|
290
|
+
value: 'layout',
|
|
291
|
+
reflectToAttribute: true,
|
|
292
|
+
sync: true,
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* The threshold (in CSS length units) at which the layout switches to
|
|
297
|
+
* the "stack" mode, making detail area fully cover the master area.
|
|
298
|
+
*
|
|
299
|
+
* @attr {string} stack-threshold
|
|
300
|
+
*/
|
|
301
|
+
stackThreshold: {
|
|
302
|
+
type: String,
|
|
303
|
+
observer: '__stackThresholdChanged',
|
|
304
|
+
sync: true,
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* When true, the component uses the overlay mode. This property is read-only.
|
|
309
|
+
* In order to enforce the overlay mode, use `forceOverlay` property.
|
|
310
|
+
* @protected
|
|
311
|
+
*/
|
|
312
|
+
_overlay: {
|
|
313
|
+
type: Boolean,
|
|
314
|
+
attribute: 'overlay',
|
|
315
|
+
reflectToAttribute: true,
|
|
316
|
+
sync: true,
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* When true, the component uses the stack mode. This property is read-only.
|
|
321
|
+
* In order to enforce the stack mode, use `stackThreshold` property.
|
|
322
|
+
* @protected
|
|
323
|
+
*/
|
|
324
|
+
_stack: {
|
|
325
|
+
type: Boolean,
|
|
326
|
+
attribute: 'stack',
|
|
327
|
+
reflectToAttribute: true,
|
|
328
|
+
sync: true,
|
|
329
|
+
},
|
|
165
330
|
};
|
|
166
331
|
}
|
|
167
332
|
|
|
333
|
+
/** @override */
|
|
334
|
+
get slotStyles() {
|
|
335
|
+
return [transitionStyles];
|
|
336
|
+
}
|
|
337
|
+
|
|
168
338
|
/** @protected */
|
|
169
339
|
render() {
|
|
170
340
|
return html`
|
|
171
|
-
<div id="master" part="master">
|
|
341
|
+
<div id="master" part="master" ?inert="${this._overlay && this.containment === 'layout'}">
|
|
172
342
|
<slot></slot>
|
|
173
343
|
</div>
|
|
174
|
-
<div
|
|
344
|
+
<div
|
|
345
|
+
id="detail"
|
|
346
|
+
part="detail"
|
|
347
|
+
role="${this._overlay || this._stack ? 'dialog' : nothing}"
|
|
348
|
+
aria-modal="${this._overlay && this.containment === 'viewport' ? 'true' : nothing}"
|
|
349
|
+
>
|
|
175
350
|
<slot name="detail" @slotchange="${this.__onDetailSlotChange}"></slot>
|
|
176
351
|
</div>
|
|
177
352
|
`;
|
|
@@ -179,8 +354,19 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
179
354
|
|
|
180
355
|
/** @private */
|
|
181
356
|
__onDetailSlotChange(e) {
|
|
182
|
-
|
|
357
|
+
const children = e.target.assignedNodes();
|
|
358
|
+
|
|
359
|
+
this.toggleAttribute('has-detail', children.length > 0);
|
|
183
360
|
this.__detectLayoutMode();
|
|
361
|
+
|
|
362
|
+
// Move focus to the detail area when it is added to the DOM,
|
|
363
|
+
// in case if the layout is using overlay or stack mode.
|
|
364
|
+
if ((this.hasAttribute('overlay') || this.hasAttribute('stack')) && children.length > 0) {
|
|
365
|
+
const focusables = getFocusableElements(children[0]);
|
|
366
|
+
if (focusables.length) {
|
|
367
|
+
focusables[0].focus();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
184
370
|
}
|
|
185
371
|
|
|
186
372
|
/**
|
|
@@ -215,6 +401,33 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
215
401
|
this.__detectLayoutMode();
|
|
216
402
|
}
|
|
217
403
|
|
|
404
|
+
/** @private */
|
|
405
|
+
__orientationChanged(orientation, oldOrientation) {
|
|
406
|
+
if (orientation || oldOrientation) {
|
|
407
|
+
this.__detectLayoutMode();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/** @private */
|
|
412
|
+
__forceOverlayChanged(forceOverlay, oldForceOverlay) {
|
|
413
|
+
if (forceOverlay || oldForceOverlay) {
|
|
414
|
+
this.__detectLayoutMode();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/** @private */
|
|
419
|
+
__stackThresholdChanged(threshold, oldThreshold) {
|
|
420
|
+
if (threshold || oldThreshold) {
|
|
421
|
+
if (threshold) {
|
|
422
|
+
this.$.master.style.setProperty('--_stack-threshold', threshold);
|
|
423
|
+
} else {
|
|
424
|
+
this.$.master.style.removeProperty('--_stack-threshold');
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
this.__detectLayoutMode();
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
218
431
|
/** @private */
|
|
219
432
|
__updateStyleProperty(prop, size, oldSize) {
|
|
220
433
|
if (size) {
|
|
@@ -228,11 +441,36 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
228
441
|
|
|
229
442
|
/** @private */
|
|
230
443
|
__detectLayoutMode() {
|
|
444
|
+
this._overlay = false;
|
|
445
|
+
this._stack = false;
|
|
446
|
+
|
|
447
|
+
if (this.forceOverlay) {
|
|
448
|
+
this._overlay = true;
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (this.stackThreshold != null) {
|
|
453
|
+
const threshold = this.__getStackThresholdInPixels();
|
|
454
|
+
const size = this.orientation === 'vertical' ? this.offsetHeight : this.offsetWidth;
|
|
455
|
+
if (size <= threshold) {
|
|
456
|
+
this._stack = true;
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
231
461
|
if (!this.hasAttribute('has-detail')) {
|
|
232
|
-
this.removeAttribute('overlay');
|
|
233
462
|
return;
|
|
234
463
|
}
|
|
235
464
|
|
|
465
|
+
if (this.orientation === 'vertical') {
|
|
466
|
+
this.__detectVerticalMode();
|
|
467
|
+
} else {
|
|
468
|
+
this.__detectHorizontalMode();
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** @private */
|
|
473
|
+
__detectHorizontalMode() {
|
|
236
474
|
const detailWidth = this.$.detail.offsetWidth;
|
|
237
475
|
|
|
238
476
|
// Detect minimum width needed by master content. Use max-width to ensure
|
|
@@ -245,18 +483,77 @@ class MasterDetailLayout extends ResizeMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
245
483
|
|
|
246
484
|
// If the combined minimum size of both the master and the detail content
|
|
247
485
|
// exceeds the size of the layout, the layout changes to the overlay mode.
|
|
248
|
-
|
|
249
|
-
this.setAttribute('overlay', '');
|
|
250
|
-
} else {
|
|
251
|
-
this.removeAttribute('overlay');
|
|
252
|
-
}
|
|
486
|
+
this._overlay = this.offsetWidth < masterWidth + detailWidth;
|
|
253
487
|
|
|
254
488
|
// Toggling the overlay resizes master content, which can cause document
|
|
255
489
|
// scroll bar to appear or disappear, and trigger another resize of the
|
|
256
490
|
// layout which can affect previous measurements and end up in horizontal
|
|
257
491
|
// scroll. Check if that is the case and if so, preserve the overlay mode.
|
|
258
492
|
if (this.offsetWidth < this.scrollWidth) {
|
|
259
|
-
this.
|
|
493
|
+
this._overlay = true;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/** @private */
|
|
498
|
+
__detectVerticalMode() {
|
|
499
|
+
// Remove overlay attribute temporarily to detect if there is enough space
|
|
500
|
+
// for both areas so that layout could switch back to the split mode.
|
|
501
|
+
this._overlay = false;
|
|
502
|
+
|
|
503
|
+
const masterHeight = this.$.master.clientHeight;
|
|
504
|
+
|
|
505
|
+
// If the combined minimum size of both the master and the detail content
|
|
506
|
+
// exceeds the available height, the layout changes to the overlay mode.
|
|
507
|
+
if (this.offsetHeight < masterHeight + this.$.detail.clientHeight) {
|
|
508
|
+
this._overlay = true;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/** @private */
|
|
513
|
+
__getStackThresholdInPixels() {
|
|
514
|
+
const { backgroundPositionY } = getComputedStyle(this.$.master, '::before');
|
|
515
|
+
return parseFloat(backgroundPositionY);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Sets the detail element to be displayed in the detail area and starts a
|
|
520
|
+
* view transition that animates adding, replacing or removing the detail
|
|
521
|
+
* area. During the view transition, the element is added to the DOM and
|
|
522
|
+
* assigned to the `detail` slot. Any previous detail element is removed.
|
|
523
|
+
* When passing null as the element, the current detail element is removed.
|
|
524
|
+
*
|
|
525
|
+
* If the browser does not support view transitions, the respective updates
|
|
526
|
+
* are applied immediately without starting a transition.
|
|
527
|
+
*
|
|
528
|
+
* @param element the new detail element, or null to remove the current detail
|
|
529
|
+
* @returns {Promise<void>}
|
|
530
|
+
*/
|
|
531
|
+
async setDetail(element) {
|
|
532
|
+
// Don't start a transition if detail didn't change
|
|
533
|
+
const currentDetail = this.querySelector('[slot="detail"]');
|
|
534
|
+
if ((element || null) === currentDetail) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const updateSlot = () => {
|
|
539
|
+
// Remove old content
|
|
540
|
+
this.querySelectorAll('[slot="detail"]').forEach((oldElement) => oldElement.remove());
|
|
541
|
+
// Add new content
|
|
542
|
+
if (element) {
|
|
543
|
+
element.setAttribute('slot', 'detail');
|
|
544
|
+
this.appendChild(element);
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
if (typeof document.startViewTransition === 'function') {
|
|
549
|
+
const hasDetail = !!currentDetail;
|
|
550
|
+
const transitionType = hasDetail && element ? 'replace' : hasDetail ? 'remove' : 'add';
|
|
551
|
+
this.setAttribute('transition', transitionType);
|
|
552
|
+
const transition = document.startViewTransition(updateSlot);
|
|
553
|
+
await transition.finished;
|
|
554
|
+
this.removeAttribute('transition');
|
|
555
|
+
} else {
|
|
556
|
+
updateSlot();
|
|
260
557
|
}
|
|
261
558
|
}
|
|
262
559
|
}
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/master-detail-layout",
|
|
4
|
-
"version": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha4",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-master-detail-layout",
|
|
11
|
-
"description": "`<vaadin-master-detail-layout>` is a web component for building UIs with a master\n(or primary) area and a detail (or secondary) area that is displayed next to, or\noverlaid on top of, the master area, depending on configuration and viewport size.",
|
|
11
|
+
"description": "`<vaadin-master-detail-layout>` is a web component for building UIs with a master\n(or primary) area and a detail (or secondary) area that is displayed next to, or\noverlaid on top of, the master area, depending on configuration and viewport size.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------|----------------------\n`master` | The master area\n`detail` | The detail area\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------| -----------\n`containment` | Set to `layout` or `viewport` depending on the containment.\n`orientation` | Set to `horizontal` or `vertical` depending on the orientation.\n`has-detail` | Set when the detail content is provided.\n`overlay` | Set when the layout is using the overlay mode.\n`stack` | Set when the layout is using the stack mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "detail-size",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"name": "master-size",
|
|
37
|
-
"description": "Fixed size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from growing or\nshrinking. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode
|
|
37
|
+
"description": "Fixed size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from growing or\nshrinking. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode.",
|
|
38
38
|
"value": {
|
|
39
39
|
"type": [
|
|
40
40
|
"string",
|
|
@@ -45,7 +45,51 @@
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"name": "master-min-size",
|
|
48
|
-
"description": "Minimum size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from shrinking below\nthis size. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode
|
|
48
|
+
"description": "Minimum size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from shrinking below\nthis size. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode.",
|
|
49
|
+
"value": {
|
|
50
|
+
"type": [
|
|
51
|
+
"string",
|
|
52
|
+
"null",
|
|
53
|
+
"undefined"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "orientation",
|
|
59
|
+
"description": "Define how master and detail areas are shown next to each other,\nand the way how size and min-size properties are applied to them.\nPossible values are: `horizontal` or `vertical`.\nDefaults to horizontal.",
|
|
60
|
+
"value": {
|
|
61
|
+
"type": [
|
|
62
|
+
"string",
|
|
63
|
+
"null",
|
|
64
|
+
"undefined"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "force-overlay",
|
|
70
|
+
"description": "When specified, forces the layout to use overlay mode, even if\nthere is enough space for master and detail to be shown next to\neach other using the default (split) mode.",
|
|
71
|
+
"value": {
|
|
72
|
+
"type": [
|
|
73
|
+
"boolean",
|
|
74
|
+
"null",
|
|
75
|
+
"undefined"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "containment",
|
|
81
|
+
"description": "Defines the containment of the detail area when the layout is in\noverlay mode. When set to `layout`, the overlay is confined to the\nlayout. When set to `viewport`, the overlay is confined to the\nbrowser's viewport. Defaults to `layout`.",
|
|
82
|
+
"value": {
|
|
83
|
+
"type": [
|
|
84
|
+
"string",
|
|
85
|
+
"null",
|
|
86
|
+
"undefined"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "stack-threshold",
|
|
92
|
+
"description": "The threshold (in CSS length units) at which the layout switches to\nthe \"stack\" mode, making detail area fully cover the master area.",
|
|
49
93
|
"value": {
|
|
50
94
|
"type": [
|
|
51
95
|
"string",
|
|
@@ -92,7 +136,7 @@
|
|
|
92
136
|
},
|
|
93
137
|
{
|
|
94
138
|
"name": "masterSize",
|
|
95
|
-
"description": "Fixed size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from growing or\nshrinking. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode
|
|
139
|
+
"description": "Fixed size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from growing or\nshrinking. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode.",
|
|
96
140
|
"value": {
|
|
97
141
|
"type": [
|
|
98
142
|
"string",
|
|
@@ -103,7 +147,51 @@
|
|
|
103
147
|
},
|
|
104
148
|
{
|
|
105
149
|
"name": "masterMinSize",
|
|
106
|
-
"description": "Minimum size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from shrinking below\nthis size. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode
|
|
150
|
+
"description": "Minimum size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from shrinking below\nthis size. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode.",
|
|
151
|
+
"value": {
|
|
152
|
+
"type": [
|
|
153
|
+
"string",
|
|
154
|
+
"null",
|
|
155
|
+
"undefined"
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "orientation",
|
|
161
|
+
"description": "Define how master and detail areas are shown next to each other,\nand the way how size and min-size properties are applied to them.\nPossible values are: `horizontal` or `vertical`.\nDefaults to horizontal.",
|
|
162
|
+
"value": {
|
|
163
|
+
"type": [
|
|
164
|
+
"string",
|
|
165
|
+
"null",
|
|
166
|
+
"undefined"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "forceOverlay",
|
|
172
|
+
"description": "When specified, forces the layout to use overlay mode, even if\nthere is enough space for master and detail to be shown next to\neach other using the default (split) mode.",
|
|
173
|
+
"value": {
|
|
174
|
+
"type": [
|
|
175
|
+
"boolean",
|
|
176
|
+
"null",
|
|
177
|
+
"undefined"
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "containment",
|
|
183
|
+
"description": "Defines the containment of the detail area when the layout is in\noverlay mode. When set to `layout`, the overlay is confined to the\nlayout. When set to `viewport`, the overlay is confined to the\nbrowser's viewport. Defaults to `layout`.",
|
|
184
|
+
"value": {
|
|
185
|
+
"type": [
|
|
186
|
+
"string",
|
|
187
|
+
"null",
|
|
188
|
+
"undefined"
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "stackThreshold",
|
|
194
|
+
"description": "The threshold (in CSS length units) at which the layout switches to\nthe \"stack\" mode, making detail area fully cover the master area.",
|
|
107
195
|
"value": {
|
|
108
196
|
"type": [
|
|
109
197
|
"string",
|
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/master-detail-layout",
|
|
4
|
-
"version": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha4",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,9 +16,16 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-master-detail-layout",
|
|
19
|
-
"description": "`<vaadin-master-detail-layout>` is a web component for building UIs with a master\n(or primary) area and a detail (or secondary) area that is displayed next to, or\noverlaid on top of, the master area, depending on configuration and viewport size.",
|
|
19
|
+
"description": "`<vaadin-master-detail-layout>` is a web component for building UIs with a master\n(or primary) area and a detail (or secondary) area that is displayed next to, or\noverlaid on top of, the master area, depending on configuration and viewport size.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------|----------------------\n`master` | The master area\n`detail` | The detail area\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------| -----------\n`containment` | Set to `layout` or `viewport` depending on the containment.\n`orientation` | Set to `horizontal` or `vertical` depending on the orientation.\n`has-detail` | Set when the detail content is provided.\n`overlay` | Set when the layout is using the overlay mode.\n`stack` | Set when the layout is using the stack mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": "?forceOverlay",
|
|
24
|
+
"description": "When specified, forces the layout to use overlay mode, even if\nthere is enough space for master and detail to be shown next to\neach other using the default (split) mode.",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
22
29
|
{
|
|
23
30
|
"name": ".detailSize",
|
|
24
31
|
"description": "Fixed size (in CSS length units) to be set on the detail area.\nWhen specified, it prevents the detail area from growing or\nshrinking. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode.",
|
|
@@ -35,14 +42,35 @@
|
|
|
35
42
|
},
|
|
36
43
|
{
|
|
37
44
|
"name": ".masterSize",
|
|
38
|
-
"description": "Fixed size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from growing or\nshrinking. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode
|
|
45
|
+
"description": "Fixed size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from growing or\nshrinking. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode.",
|
|
39
46
|
"value": {
|
|
40
47
|
"kind": "expression"
|
|
41
48
|
}
|
|
42
49
|
},
|
|
43
50
|
{
|
|
44
51
|
"name": ".masterMinSize",
|
|
45
|
-
"description": "Minimum size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from shrinking below\nthis size. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode
|
|
52
|
+
"description": "Minimum size (in CSS length units) to be set on the master area.\nWhen specified, it prevents the master area from shrinking below\nthis size. If there is not enough space to show master and detail\nareas next to each other, the layout switches to the overlay mode.",
|
|
53
|
+
"value": {
|
|
54
|
+
"kind": "expression"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": ".orientation",
|
|
59
|
+
"description": "Define how master and detail areas are shown next to each other,\nand the way how size and min-size properties are applied to them.\nPossible values are: `horizontal` or `vertical`.\nDefaults to horizontal.",
|
|
60
|
+
"value": {
|
|
61
|
+
"kind": "expression"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": ".containment",
|
|
66
|
+
"description": "Defines the containment of the detail area when the layout is in\noverlay mode. When set to `layout`, the overlay is confined to the\nlayout. When set to `viewport`, the overlay is confined to the\nbrowser's viewport. Defaults to `layout`.",
|
|
67
|
+
"value": {
|
|
68
|
+
"kind": "expression"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": ".stackThreshold",
|
|
73
|
+
"description": "The threshold (in CSS length units) at which the layout switches to\nthe \"stack\" mode, making detail area fully cover the master area.",
|
|
46
74
|
"value": {
|
|
47
75
|
"kind": "expression"
|
|
48
76
|
}
|