@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.
@@ -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 | Description
29
- * ---------------|----------------------
30
- * `backdrop` | Backdrop covering the master area in the drawer mode
31
- * `master` | The master area
32
- * `detail` | The detail area
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 | Description
37
- * ---------------| -----------
38
- * `containment` | Set to `layout` or `viewport` depending on the containment.
39
- * `orientation` | Set to `horizontal` or `vertical` depending on the orientation.
40
- * `has-detail` | Set when the detail content is provided.
41
- * `drawer` | Set when the layout is using the drawer mode.
42
- * `stack` | Set when the layout is using the stack mode.
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 drawer mode.
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 SlotStylesMixin(ResizeMixin(ThemableMixin(ElementMixin(HTMLElement)))) {
84
+ declare class MasterDetailLayout extends ThemableMixin(ElementMixin(HTMLElement)) {
60
85
  /**
61
- * Fixed size (in CSS length units) to be set on the detail area.
62
- * When specified, it prevents the detail area from growing or
63
- * shrinking. If there is not enough space to show master and detail
64
- * areas next to each other, the details are shown as an overlay:
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
- * Minimum size (in CSS length units) to be set on the detail area.
73
- * When specified, it prevents the detail area from shrinking below
74
- * this size. If there is not enough space to show master and detail
75
- * areas next to each other, the details are shown as an overlay:
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
- * Minimum size (in CSS length units) to be set on the master area.
95
- * When specified, it prevents the master area from shrinking below
96
- * this size. If there is not enough space to show master and detail
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} master-min-size
110
+ * @attr {string} overlay-size
101
111
  */
102
- masterMinSize: string | null | undefined;
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
- containment: 'layout' | 'viewport';
130
+ overlayContainment: 'layout' | 'viewport';
132
131
 
133
132
  /**
134
- * When true, the layout in the overlay mode is rendered as a stack,
135
- * making detail area fully cover the master area. Otherwise, it is
136
- * rendered as a drawer and has a visual backdrop.
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
- stackOverlay: boolean;
137
+ expand: 'master' | 'detail' | 'both';
144
138
 
145
139
  /**
146
140
  * When true, the layout does not use animated transitions for the detail area.