@vaadin/master-detail-layout 25.1.0 → 25.2.0-alpha2
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 +35 -84
- package/package.json +8 -8
- package/src/styles/vaadin-master-detail-layout-base-styles.js +107 -117
- package/src/vaadin-master-detail-layout.d.ts +61 -67
- package/src/vaadin-master-detail-layout.js +450 -295
- package/web-types.json +31 -75
- package/web-types.lit.json +15 -29
- package/src/styles/vaadin-master-detail-layout-transition-base-styles.js +0 -147
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
|
-
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
8
|
-
import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
9
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
8
|
|
|
11
9
|
export interface MasterDetailLayoutCustomEventMap {
|
|
@@ -21,25 +19,52 @@ export interface MasterDetailLayoutEventMap extends HTMLElementEventMap, MasterD
|
|
|
21
19
|
* (or primary) area and a detail (or secondary) area that is displayed next to, or
|
|
22
20
|
* overlaid on top of, the master area, depending on configuration and viewport size.
|
|
23
21
|
*
|
|
22
|
+
* ### Slots
|
|
23
|
+
*
|
|
24
|
+
* The component has two main content areas: the master area (default slot)
|
|
25
|
+
* and the detail area (`detail` slot). When the detail doesn't fit next to
|
|
26
|
+
* the master, it is shown as an overlay on top of the master area:
|
|
27
|
+
*
|
|
28
|
+
* ```html
|
|
29
|
+
* <vaadin-master-detail-layout>
|
|
30
|
+
* <div>Master content</div>
|
|
31
|
+
* <div slot="detail">Detail content</div>
|
|
32
|
+
* </vaadin-master-detail-layout>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* The component also supports a `detail-placeholder` slot for content shown
|
|
36
|
+
* in the detail area when no detail is selected. Unlike the `detail` slot,
|
|
37
|
+
* the placeholder is simply hidden when it doesn't fit next to the master area,
|
|
38
|
+
* rather than shown as an overlay:
|
|
39
|
+
*
|
|
40
|
+
* ```html
|
|
41
|
+
* <vaadin-master-detail-layout>
|
|
42
|
+
* <div>Master content</div>
|
|
43
|
+
* <div slot="detail-placeholder">Select an item</div>
|
|
44
|
+
* </vaadin-master-detail-layout>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
24
47
|
* ### Styling
|
|
25
48
|
*
|
|
26
49
|
* The following shadow DOM parts are available for styling:
|
|
27
50
|
*
|
|
28
|
-
* Part name
|
|
29
|
-
*
|
|
30
|
-
* `backdrop`
|
|
31
|
-
* `master`
|
|
32
|
-
* `detail`
|
|
51
|
+
* Part name | Description
|
|
52
|
+
* ----------------------|----------------------
|
|
53
|
+
* `backdrop` | Backdrop covering the master area in the overlay mode
|
|
54
|
+
* `master` | The master area
|
|
55
|
+
* `detail` | The detail area
|
|
56
|
+
* `detail-placeholder` | The detail placeholder area
|
|
33
57
|
*
|
|
34
58
|
* The following state attributes are available for styling:
|
|
35
59
|
*
|
|
36
|
-
* Attribute
|
|
37
|
-
*
|
|
38
|
-
* `
|
|
39
|
-
* `orientation`
|
|
40
|
-
* `has-detail`
|
|
41
|
-
* `
|
|
42
|
-
* `
|
|
60
|
+
* Attribute | Description
|
|
61
|
+
* --------------------------|----------------------
|
|
62
|
+
* `expand` | Set to `master`, `detail`, or `both`.
|
|
63
|
+
* `orientation` | Set to `horizontal` or `vertical` depending on the orientation.
|
|
64
|
+
* `has-detail` | Set when the detail content is provided and visible.
|
|
65
|
+
* `has-detail-placeholder` | Set when the detail placeholder content is provided.
|
|
66
|
+
* `overlay` | Set when columns don't fit and the detail is shown as an overlay.
|
|
67
|
+
* `overlay-containment` | Set to `layout` or `viewport`.
|
|
43
68
|
*
|
|
44
69
|
* The following custom CSS properties are available for styling:
|
|
45
70
|
*
|
|
@@ -53,53 +78,38 @@ export interface MasterDetailLayoutEventMap extends HTMLElementEventMap, MasterD
|
|
|
53
78
|
*
|
|
54
79
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
55
80
|
*
|
|
56
|
-
* @fires {CustomEvent} backdrop-click - Fired when the user clicks the backdrop in the
|
|
81
|
+
* @fires {CustomEvent} backdrop-click - Fired when the user clicks the backdrop in the overlay mode.
|
|
57
82
|
* @fires {CustomEvent} detail-escape-press - Fired when the user presses Escape in the detail area.
|
|
58
83
|
*/
|
|
59
|
-
declare class MasterDetailLayout extends
|
|
84
|
+
declare class MasterDetailLayout extends ThemableMixin(ElementMixin(HTMLElement)) {
|
|
60
85
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* either as drawer or stack, depending on the `stackOverlay` property.
|
|
86
|
+
* Size (in CSS length units) to be set on the detail area in
|
|
87
|
+
* the CSS grid layout. If there is not enough space to show
|
|
88
|
+
* master and detail areas next to each other, the detail area
|
|
89
|
+
* is shown as an overlay. Defaults to 15em.
|
|
66
90
|
*
|
|
67
91
|
* @attr {string} detail-size
|
|
68
92
|
*/
|
|
69
93
|
detailSize: string | null | undefined;
|
|
70
94
|
|
|
71
95
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* either as drawer or stack, depending on the `stackOverlay` property.
|
|
77
|
-
*
|
|
78
|
-
* @attr {string} detail-min-size
|
|
79
|
-
*/
|
|
80
|
-
detailMinSize: string | null | undefined;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Fixed size (in CSS length units) to be set on the master area.
|
|
84
|
-
* When specified, it prevents the master area from growing or
|
|
85
|
-
* shrinking. If there is not enough space to show master and detail
|
|
86
|
-
* areas next to each other, the details are shown as an overlay:
|
|
87
|
-
* either as drawer or stack, depending on the `stackOverlay` property.
|
|
96
|
+
* Size (in CSS length units) to be set on the master area in
|
|
97
|
+
* the CSS grid layout. If there is not enough space to show
|
|
98
|
+
* master and detail areas next to each other, the detail area
|
|
99
|
+
* is shown as an overlay. Defaults to 30em.
|
|
88
100
|
*
|
|
89
101
|
* @attr {string} master-size
|
|
90
102
|
*/
|
|
91
103
|
masterSize: string | null | undefined;
|
|
92
104
|
|
|
93
105
|
/**
|
|
94
|
-
*
|
|
95
|
-
* When
|
|
96
|
-
*
|
|
97
|
-
* areas next to each other, the details are shown as an overlay:
|
|
98
|
-
* either as drawer or stack, depending on the `stackOverlay` property.
|
|
106
|
+
* Size (in CSS length units) for the detail area when shown as an
|
|
107
|
+
* overlay. When not set, falls back to `detailSize`. Set to `100%`
|
|
108
|
+
* to make the detail cover the full layout.
|
|
99
109
|
*
|
|
100
|
-
* @attr {string}
|
|
110
|
+
* @attr {string} overlay-size
|
|
101
111
|
*/
|
|
102
|
-
|
|
112
|
+
overlaySize: string | null | undefined;
|
|
103
113
|
|
|
104
114
|
/**
|
|
105
115
|
* Define how master and detail areas are shown next to each other,
|
|
@@ -109,38 +119,22 @@ declare class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ThemableMix
|
|
|
109
119
|
*/
|
|
110
120
|
orientation: 'horizontal' | 'vertical';
|
|
111
121
|
|
|
112
|
-
/**
|
|
113
|
-
* When specified, forces the details to be shown as an overlay
|
|
114
|
-
* (either as drawer or stack), even if there is enough space for
|
|
115
|
-
* master and detail to be shown next to each other using the default
|
|
116
|
-
* (split) mode.
|
|
117
|
-
*
|
|
118
|
-
* In order to enforce the stack mode, use this property together with
|
|
119
|
-
* `stackOverlay` property and set both to `true`.
|
|
120
|
-
*
|
|
121
|
-
* @attr {boolean} force-overlay
|
|
122
|
-
*/
|
|
123
|
-
forceOverlay: boolean;
|
|
124
|
-
|
|
125
122
|
/**
|
|
126
123
|
* Defines the containment of the detail area when the layout is in
|
|
127
124
|
* overlay mode. When set to `layout`, the overlay is confined to the
|
|
128
125
|
* layout. When set to `viewport`, the overlay is confined to the
|
|
129
126
|
* browser's viewport. Defaults to `layout`.
|
|
127
|
+
*
|
|
128
|
+
* @attr {string} overlay-containment
|
|
130
129
|
*/
|
|
131
|
-
|
|
130
|
+
overlayContainment: 'layout' | 'viewport';
|
|
132
131
|
|
|
133
132
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* In order to enforce the stack mode, use this property together with
|
|
139
|
-
* `forceOverlay` property and set both to `true`.
|
|
140
|
-
*
|
|
141
|
-
* @attr {string} stack-threshold
|
|
133
|
+
* Controls which column(s) expand to fill available space.
|
|
134
|
+
* Possible values: `'master'`, `'detail'`, `'both'`.
|
|
135
|
+
* Defaults to `'master'`.
|
|
142
136
|
*/
|
|
143
|
-
|
|
137
|
+
expand: 'master' | 'detail' | 'both';
|
|
144
138
|
|
|
145
139
|
/**
|
|
146
140
|
* When true, the layout does not use animated transitions for the detail area.
|