@seniorsistemas/tecnologia-webcomponents
Version:
A webcomponents library for Senior Sistemas - Suite BPM products.
38 lines (32 loc) • 4.84 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-9e7d65d0.js');
const defaultTheme = require('./defaultTheme-b024b6fb.js');
const productHeaderCss = "@import url(https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Inter:wght@300;400;500;600;700;800&family=Roboto:wght@300;400;500;700;900&display=swap);@import url(https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Volkhov:wght@400;700&display=swap);@import url(https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&family=Oxygen+Mono&family=Roboto+Mono:wght@300;400;500;600;700&display=swap);.bg-default{background:#f6f8fa}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-2x1{font-size:1.5rem;line-height:2rem}.text-3x1{font-size:1.875rem;line-height:2.25rem}.text-4x1{font-size:2.25rem;line-height:2.5rem}.text-5x1{font-size:3rem;line-height:3rem}.text-6x1{font-size:3.75rem;line-height:3.75rem}.text-7x1{font-size:4.5rem;line-height:4.5rem}.text-8x1{font-size:6rem;line-height:6rem}.text-9x1{font-size:8rem;line-height:8rem}.text-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Roboto,Almarai,Inter,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-serif{font-family:ui-serif,Volkhov,Libre Baskerville,Georgia,serif,serif}.text-mono{font-family:ui-monospace,Fira Mono,Roboto Mono,Oxygen Mono,Consolas,monospace,monospace}.text-title{font-family:Inter,sans-serif}@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@500;700&family=Open+Sans:wght@400;600&display=swap\"); *{-webkit-box-sizing:border-box;box-sizing:border-box}:host([hidden]){display:none}:host([theme=light]){--tecnologia-color-primary:#3c9bec;--tecnologia-color-secondary:#cbd0d8;--tecnologia-color-danger:#ec3c43;--tecnologia-color-success:#00c99a;--tecnologia-color-warning:#ff9800}:host([theme=light]) .bg-primary{background-color:#3c9bec}:host([theme=light]) .bg-secondary{background-color:#cbd0d8}:host([theme=light]) .bg-danger{background-color:#ec3c43}:host([theme=light]) .bg-success{background-color:#00c99a}:host([theme=light]) .bg-warning{background-color:#ff9800}:host([theme=dark]){--tecnologia-color-primary:#7dbcf2;--tecnologia-color-secondary:#cbd0d8;--tecnologia-color-danger:#ec3c43;--tecnologia-color-success:#00c99a;--tecnologia-color-warning:#ff9800}:host([theme=dark]) .bg-primary{background-color:#7dbcf2}:host([theme=dark]) .bg-secondary{background-color:#cbd0d8}:host([theme=dark]) .bg-danger{background-color:#ec3c43}:host([theme=dark]) .bg-success{background-color:#00c99a}:host([theme=dark]) .bg-warning{background-color:#ff9800}:host{font-size:1rem;display:block}:host([theme=dark]) header{background:#434548}:host([theme=dark]) header .title{color:#f6f8fa}:host([theme=light]) header{background:#ffffff}:host([theme=light]) header .title{color:#5a5c60}:host([sticky]){position:-webkit-sticky;position:sticky;position:fixed;z-index:99;top:0;right:0;left:0;position:relative;width:100%;height:70px}header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-box-shadow:0 -1px 6px #00000046;box-shadow:0 -1px 6px #00000046;padding:1rem 1.25rem;width:100%;height:70px;top:0;left:0;height:70px}header.sticky{position:fixed}header .title{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:1.2rem;font-weight:500;margin-right:1rem;height:100%}header .content{font-size:1rem;-ms-flex:1;flex:1}";
const ProductHeader = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.titleClicked = index.createEvent(this, "title-clicked", 7);
this.theme = defaultTheme.defaultTheme;
/**
* Set `false` to remove `cursor: pointer` from title
* @summary when `false` this property disable `titleClicked` event.
* @default true
*/
this.titleCursorPointer = true;
/**
* Use to make a bar fixed on top
* @default true
*/
this.sticky = true;
this.handleClick = () => {
if (this.titleCursorPointer)
this.titleClicked.emit();
};
}
render() {
return (index.h(index.Host, null, index.h("header", { class: `text-title ${this.sticky && 'sticky'}` }, index.h("div", { class: "before-title" }, index.h("slot", { name: "before-title" })), index.h("div", { class: "title", style: { cursor: this.titleCursorPointer && 'pointer' }, onClick: this.handleClick }, this.titleProduct), index.h("div", { class: "content" }, index.h("slot", { name: "content" })))));
}
};
ProductHeader.style = productHeaderCss;
exports.tec_product_header = ProductHeader;