intervention-pages
Version:
113 lines (99 loc) • 3.21 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { LitElement, html, property, customElement } from 'lit-element';
import { layoutVertical, layoutStartJustified, layoutFlex, layoutHorizontal, layoutCenter } from '../../styles/flex-layout-styles';
/**
* @LitElement
* @customElement
*/
let PageContentHeader = class PageContentHeader extends LitElement {
constructor() {
super(...arguments);
this.withTabsVisible = false;
}
render() {
// language=HTML
return html `
<style>
*[hidden] {
display: none !important;
}
:host {
${layoutVertical}
${layoutStartJustified}
${layoutFlex}
background-color: var(--primary-background-color);
padding: 0 24px;
min-height: 85px;
border-bottom: 1px solid var(--dark-divider-color);
--page-title: {
margin: 0;
font-weight: normal;
text-transform: capitalize;
font-size: 24px;
line-height: 1.3;
min-height: 31px;
}
}
:host([with-tabs-visible]) {
min-height: 114px;
}
.content-header-row {
${layoutHorizontal}
${layoutStartJustified}
}
.title-row {
${layoutCenter}
margin: 30px 0 0;
padding: 0 24px;
}
.title-row h1 {
${layoutFlex}
@apply --page-title;
}
.tabs {
margin-top: 5px;
}
@media print {
:host {
padding: 0;
border-bottom: none;
min-height: 0 !important;
margin-bottom: 16px;
}
.title-row h1 {
font-size: 18px;
}
}
@media (max-width: 576px) {
:host {
padding: 0 5px;
}
.title-row {
padding: 0 5px 5px 5px;
}
}
</style>
<div class="content-header-row title-row">
<h1>
<slot name="page-title"></slot>
</h1>
<slot name="title-row-actions"></slot>
</div>
<div class="content-header-row tabs" ?hidden="${this.withTabsVisible}">
<slot name="tabs"></slot>
</div>
`;
}
};
__decorate([
property({ type: Boolean, reflect: true })
], PageContentHeader.prototype, "withTabsVisible", void 0);
PageContentHeader = __decorate([
customElement('page-content-header')
], PageContentHeader);
export { PageContentHeader };