mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
Merge 58f467c3af937b019cb1f4beae289b8738e31361 into 555b0add40685ad2d799e4bccfc4c69812abe207
This commit is contained in:
commit
a9808963d1
37
labs/layout/supportingpane/internal/_supporting-pane.scss
Normal file
37
labs/layout/supportingpane/internal/_supporting-pane.scss
Normal file
@ -0,0 +1,37 @@
|
||||
//
|
||||
// Copyright 2023 Google LLC
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use 'sass:list';
|
||||
// go/keep-sorted end
|
||||
|
||||
@mixin styles() {
|
||||
.host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
slot {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
:host([variant='expanded']) {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
:host([variant='expanded']) slot[name='supporting'] {
|
||||
max-width: var(--md-supporting-pane-width, 360px);
|
||||
margin-left: 24px;
|
||||
}
|
||||
|
||||
:host([variant='compact']) slot[name='supporting'] {
|
||||
max-height: calc(100% / 2);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
//
|
||||
// Copyright 2023 Google LLC
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './supporting-pane';
|
||||
// go/keep-sorted end
|
||||
|
||||
@include supporting-pane.styles;
|
||||
22
labs/layout/supportingpane/internal/supporting-pane.ts
Normal file
22
labs/layout/supportingpane/internal/supporting-pane.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { html, LitElement } from 'lit';
|
||||
import { property } from 'lit/decorators';
|
||||
|
||||
/**
|
||||
* The Supporting Pane Layout.
|
||||
*/
|
||||
export class SupportingPane extends LitElement {
|
||||
@property({ type: String, reflect: true })
|
||||
variant: 'compact' | 'medium' | 'expanded' = 'expanded';
|
||||
protected override render() {
|
||||
return html`
|
||||
<slot></slot>
|
||||
<slot name="supporting"></slot>
|
||||
`;
|
||||
}
|
||||
}
|
||||
25
labs/layout/supportingpane/supporting-pane.ts
Normal file
25
labs/layout/supportingpane/supporting-pane.ts
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
|
||||
import { SupportingPane } from './internal/supporting-pane.js';
|
||||
import { styles } from './internal/supporting-pane-styles.css.js';
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'md-supporting-pane': MDSupportingPane;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @final
|
||||
* @suppress {visibility}
|
||||
*/
|
||||
@customElement('md-supporting-pane')
|
||||
export class MDSupportingPane extends SupportingPane {
|
||||
static override styles = [styles];
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user