Skip to content

Commit 62a2306

Browse files
web-padawanclaude
andauthored
refactor!: rename overlayContainment from "viewport" to "page" (#11520)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0619c13 commit 62a2306

19 files changed

Lines changed: 35 additions & 35 deletions

File tree

dev/aura/grid-mdl-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ customElements.define(
226226
<vaadin-master-detail-layout
227227
class="aura-surface-solid"
228228
detail-size="25rem"
229-
overlay-containment="viewport"
229+
overlay-containment="page"
230230
expand="master"
231231
>
232232
<div class="aura-view">

dev/master-detail-layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ <h3>View ${window.mdlCount}</h3>
233233
value="layout"
234234
>
235235
<vaadin-radio-button value="layout" label="Layout"></vaadin-radio-button>
236-
<vaadin-radio-button value="viewport" label="Viewport"></vaadin-radio-button>
236+
<vaadin-radio-button value="page" label="Page"></vaadin-radio-button>
237237
</vaadin-radio-group>
238238
<vaadin-radio-group
239239
@change=${this._configChange}

packages/aura/src/components/master-detail-layout.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ vaadin-master-detail-layout[has-detail][overlay]::part(detail) {
1515
);
1616
}
1717

18-
vaadin-master-detail-layout[has-detail][overlay][overlay-containment='viewport']::part(detail) {
18+
vaadin-master-detail-layout[has-detail][overlay][overlay-containment='page']::part(detail) {
1919
box-shadow: var(--vaadin-master-detail-layout-detail-shadow, var(--aura-overlay-shadow));
2020
}
2121

2222
/* TODO could be a built-in variant */
2323
vaadin-master-detail-layout[theme~='inset-drawer'][has-detail][overlay]::part(detail),
24-
vaadin-master-detail-layout[has-detail][overlay][overlay-containment='viewport']::part(detail) {
24+
vaadin-master-detail-layout[has-detail][overlay][overlay-containment='page']::part(detail) {
2525
margin: calc(var(--aura-app-layout-inset) / 2);
2626
border-radius: var(--_app-layout-radius);
2727
}

packages/master-detail-layout/ARCHITECTURE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ When `overlay` AND `has-detail` are both set, the detail becomes an overlay:
8989
- `position: absolute; grid-column: none` removes detail from grid flow
9090
- Backdrop becomes visible (`opacity: 1`, `pointer-events: auto`)
9191
- `overlaySize` (CSS custom property `--_overlay-size`) controls overlay dimensions; falls back to `--_detail-size`
92-
- `overlayContainment` (`layout`/`viewport`) controls positioning: `absolute` vs `fixed`
93-
- ARIA: `role="dialog"` on detail, `inert` on master (layout containment), `aria-modal` (viewport containment)
92+
- `overlayContainment` (`layout`/`page`) controls positioning: `absolute` vs `fixed`
93+
- ARIA: `role="dialog"` on detail, `inert` on master (layout containment), `aria-modal` (page containment)
9494

9595
### Overlay positioning
9696

97-
| Orientation | Default | `overlayContainment='viewport'` |
98-
| ----------- | ---------------------------------------------------- | ------------------------------- |
99-
| Horizontal | `width: overlaySize/detailSize; inset-inline-end: 0` | `position: fixed` |
100-
| Vertical | `height: overlaySize/detailSize; inset-block-end: 0` | `position: fixed` |
97+
| Orientation | Default | `overlayContainment='page'` |
98+
| ----------- | ---------------------------------------------------- | --------------------------- |
99+
| Horizontal | `width: overlaySize/detailSize; inset-inline-end: 0` | `position: fixed` |
100+
| Vertical | `height: overlaySize/detailSize; inset-block-end: 0` | `position: fixed` |
101101

102102
Setting `overlaySize` to `100%` makes the detail cover the full layout (replaces old "full" mode).
103103

packages/master-detail-layout/src/styles/vaadin-master-detail-layout-base-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export const masterDetailLayoutStyles = css`
238238
max-height: 100%;
239239
}
240240
241-
:host([has-detail][overlay][overlay-containment='viewport']) :is(#detail, #detailOutgoing, #backdrop) {
241+
:host([has-detail][overlay][overlay-containment='page']) :is(#detail, #detailOutgoing, #backdrop) {
242242
position: fixed;
243243
}
244244

packages/master-detail-layout/src/vaadin-master-detail-layout.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface MasterDetailLayoutEventMap extends HTMLElementEventMap, MasterD
6464
* `has-detail` | Set when the detail content is provided and visible.
6565
* `has-detail-placeholder` | Set when the detail placeholder content is provided.
6666
* `overlay` | Set when columns don't fit and the detail is shown as an overlay.
67-
* `overlay-containment` | Set to `layout` or `viewport`.
67+
* `overlay-containment` | Set to `layout` or `page`.
6868
*
6969
* The following custom CSS properties are available for styling:
7070
*
@@ -128,12 +128,12 @@ declare class MasterDetailLayout extends ThemableMixin(ElementMixin(HTMLElement)
128128
/**
129129
* Defines the containment of the detail area when the layout is in
130130
* overlay mode. When set to `layout`, the overlay is confined to the
131-
* layout. When set to `viewport`, the overlay is confined to the
131+
* layout. When set to `page`, the overlay is confined to the
132132
* browser's viewport. Defaults to `layout`.
133133
*
134134
* @attr {string} overlay-containment
135135
*/
136-
overlayContainment: 'layout' | 'viewport';
136+
overlayContainment: 'layout' | 'page';
137137

138138
/**
139139
* Controls which column(s) expand to fill available space.

packages/master-detail-layout/src/vaadin-master-detail-layout.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ import {
7070
* `has-detail` | Set when the detail content is provided and visible.
7171
* `has-detail-placeholder` | Set when the detail placeholder content is provided.
7272
* `overlay` | Set when columns don't fit and the detail is shown as an overlay.
73-
* `overlay-containment` | Set to `layout` or `viewport`.
73+
* `overlay-containment` | Set to `layout` or `page`.
7474
*
7575
* The following custom CSS properties are available for styling:
7676
*
@@ -167,7 +167,7 @@ class MasterDetailLayout extends ElementMixin(ThemableMixin(PolylitMixin(LitElem
167167
/**
168168
* Defines the containment of the detail area when the layout is in
169169
* overlay mode. When set to `layout`, the overlay is confined to the
170-
* layout. When set to `viewport`, the overlay is confined to the
170+
* layout. When set to `page`, the overlay is confined to the
171171
* browser's viewport. Defaults to `layout`.
172172
*
173173
* @attr {string} overlay-containment
@@ -218,8 +218,8 @@ class MasterDetailLayout extends ElementMixin(ThemableMixin(PolylitMixin(LitElem
218218
/** @protected */
219219
render() {
220220
const isOverlay = this.hasAttribute('has-detail') && this.hasAttribute('overlay');
221-
const isViewport = isOverlay && this.overlayContainment === 'viewport';
222-
const isLayoutContained = isOverlay && !isViewport;
221+
const isPage = isOverlay && this.overlayContainment === 'page';
222+
const isLayoutContained = isOverlay && !isPage;
223223

224224
return html`
225225
<div id="backdrop" part="backdrop" @click="${this.__onBackdropClick}"></div>
@@ -233,7 +233,7 @@ class MasterDetailLayout extends ElementMixin(ThemableMixin(PolylitMixin(LitElem
233233
id="detail"
234234
part="detail"
235235
role="${isOverlay ? 'dialog' : nothing}"
236-
aria-modal="${isViewport ? 'true' : nothing}"
236+
aria-modal="${isPage ? 'true' : nothing}"
237237
@keydown="${this.__onDetailKeydown}"
238238
>
239239
<slot name="detail" @slotchange="${this.__onSlotChange}"></slot>

packages/master-detail-layout/test/aria.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ describe('ARIA', () => {
3535
expect(detail.hasAttribute('role')).to.be.false;
3636
});
3737

38-
it('should set aria-modal on detail with viewport containment', async () => {
39-
layout.overlayContainment = 'viewport';
38+
it('should set aria-modal on detail with page containment', async () => {
39+
layout.overlayContainment = 'page';
4040
await onceResized(layout);
4141
expect(detail.getAttribute('aria-modal')).to.equal('true');
4242
});
@@ -49,8 +49,8 @@ describe('ARIA', () => {
4949
expect(master.hasAttribute('inert')).to.be.true;
5050
});
5151

52-
it('should not set inert on master with viewport containment', async () => {
53-
layout.overlayContainment = 'viewport';
52+
it('should not set inert on master with page containment', async () => {
53+
layout.overlayContainment = 'page';
5454
await onceResized(layout);
5555
expect(master.hasAttribute('inert')).to.be.false;
5656
});

packages/master-detail-layout/test/overlay.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ describe('overlay', () => {
193193
});
194194
});
195195

196-
describe('overlayContainment viewport', () => {
196+
describe('overlayContainment page', () => {
197197
['horizontal', 'vertical'].forEach((orientation) => {
198198
describe(orientation, () => {
199199
let layout, detail, backdrop;
@@ -207,7 +207,7 @@ describe('overlay', () => {
207207
${orientationAttr}
208208
master-size="300px"
209209
detail-size="300px"
210-
overlay-containment="viewport"
210+
overlay-containment="page"
211211
style="${sizeStyle}"
212212
>
213213
<div>Master</div>

packages/master-detail-layout/test/typings/master-detail-layout.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ assertType<ThemableMixinClass>(layout);
1414
assertType<string | null | undefined>(layout.detailSize);
1515
assertType<string | null | undefined>(layout.masterSize);
1616
assertType<string | null | undefined>(layout.overlaySize);
17-
assertType<'layout' | 'viewport'>(layout.overlayContainment);
17+
assertType<'layout' | 'page'>(layout.overlayContainment);
1818
assertType<'master' | 'detail' | 'both'>(layout.expand);
1919
assertType<'horizontal' | 'vertical'>(layout.orientation);
2020
assertType<boolean>(layout.noAnimation);

0 commit comments

Comments
 (0)