v1.1.0
This commit is contained in:
@@ -26,6 +26,7 @@ h1 {
|
||||
@property()
|
||||
heading? = "Heading";
|
||||
|
||||
// todo add tailing extra buttons
|
||||
protected render() {
|
||||
return html`<h1>${this.heading}</h1>
|
||||
`;
|
||||
|
||||
31
src/borderlayout.stories.ts
Normal file
31
src/borderlayout.stories.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Story, Meta } from '@storybook/web-components';
|
||||
import {LitElement, html, css,} from 'lit';
|
||||
import {classMap} from 'lit/directives/class-map.js';
|
||||
|
||||
import './borderlayout';
|
||||
|
||||
export default {
|
||||
title: 'Persona/BorderLayout',
|
||||
component: 'persona-border-layout',
|
||||
argTypes: {
|
||||
//fullWidth: {control: 'boolean',
|
||||
// description: "add a 'full-width' class."}
|
||||
},
|
||||
} as Meta;
|
||||
|
||||
|
||||
const Template:Story = () => html`
|
||||
<persona-border-layout>
|
||||
<persona-app-bar slot="north" heading="I'm App-Bar in North." primary></persona-app-bar>
|
||||
<div slot="south" style="height:32px;background-color:green">South</div>
|
||||
<div slot="east" style="width:100px;background-color:blue">East</div>
|
||||
<div slot="west" style="width:180px;background-color:yellow">West</div>
|
||||
<div slot="center" style="background-color:white">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</div>
|
||||
</persona-border-layout>
|
||||
`;
|
||||
|
||||
export const Basic = Template.bind({});
|
||||
Basic.args = {
|
||||
};
|
||||
|
||||
51
src/borderlayout.ts
Normal file
51
src/borderlayout.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import {LitElement, html, css} from 'lit';
|
||||
import {customElement, property} from 'lit/decorators.js';
|
||||
import {Variables} from './variables';
|
||||
|
||||
/**
|
||||
* Border layout
|
||||
*/
|
||||
@customElement('persona-border-layout')
|
||||
export class BorderLayout extends LitElement {
|
||||
|
||||
static styles = css`
|
||||
:host{
|
||||
display:grid;
|
||||
width: 100%; height: 100%;
|
||||
margin:0; padding:0; border:0;
|
||||
grid-template-rows: fit-content(auto) 2fr fit-content(auto);
|
||||
grid-template-columns: fit-content(auto) 2fr fit-content(auto);
|
||||
grid-template-areas:
|
||||
"north north north"
|
||||
"west center east"
|
||||
"south south south";
|
||||
}
|
||||
::slotted(*) {
|
||||
//color: green;
|
||||
}
|
||||
#north::slotted(*) {
|
||||
grid-area: north;
|
||||
}
|
||||
#south::slotted(*) {
|
||||
grid-area: south;
|
||||
}
|
||||
#west::slotted(*) {
|
||||
grid-area: west;
|
||||
}
|
||||
#east::slotted(*) {
|
||||
grid-area: east;
|
||||
}
|
||||
#center::slotted(*) {
|
||||
grid-area: center;
|
||||
}
|
||||
`;
|
||||
|
||||
protected render() {
|
||||
return html`
|
||||
<slot id="north" name="north"></slot>
|
||||
<slot id="south" name="south"></slot>
|
||||
<slot id="east" name="east"></slot>
|
||||
<slot id="west" name="west"></slot>
|
||||
<slot id="center" name="center"></slot>`;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import './layouts'
|
||||
import './flowlayout'
|
||||
import './borderlayout'
|
||||
import './appbar'
|
||||
import './button'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user