import {LitElement, html, unsafeCSS} from 'lit'; import {customElement, property} from 'lit/decorators.js'; import {classMap} from 'lit/directives/class-map.js'; import compentStyle from './top-bar.css?inline'; import '../icon-button/icon-button'; import '../clock/clock'; import '../divider/divider'; import '../breadcrumb/breadcrumb'; import '../../icons/icon-menu-iec'; import '../../icons/icon-close-google'; import '../../icons/icon-arrow-left-google'; import '../../icons/icon-arrow-right-google'; import '../../icons/icon-palette-day-night-iec'; import '../../icons/icon-applications'; import '../../icons/icon-more-vertical-google'; import {BreadcrumbItem} from '../breadcrumb/breadcrumb'; /** * Top bar component * * @fires menu-button-clicked - Menu button clicked * @fires dimming-button-clicked - Dimming button clicked * @fires apps-button-clicked - Apps button clicked * @fires left-more-button-clicked - Left more button clicked */ @customElement('obc-top-bar') export class ObcTopBar extends LitElement { @property({type: String}) appTitle = 'App'; @property({type: String}) pageName = 'Page'; @property({type: String}) date = '2021-01-01T11:11:11.111Z'; @property({type: Boolean}) menuButtonActivated = false; @property({type: Boolean}) dimmingButtonActivated = false; @property({type: Boolean}) appsButtonActivated = false; @property({type: Boolean}) leftMoreButtonActivated = false; @property({type: Boolean}) wideMenuButton = false; @property({type: Boolean}) showAppsButton = false; @property({type: Boolean}) showDimmingButton = false; @property({type: Boolean}) showClock = false; @property({type: Boolean}) showDate = false; @property({type: Boolean}) inactive = false; @property({type: Number}) appButtonBreakpointPx = 500; @property({type: Number}) dimmingButtonBreakpointPx = 500; @property({type: Number}) appTitleBreakpointPx = 500; @property({type: Number}) clockMinimizeBreakpointPx = 300; @property({type: Boolean}) settings = false; @property({type: Array}) breadcrumbItems: BreadcrumbItem[] = []; private menuButtonClicked() { this.dispatchEvent(new CustomEvent('menu-button-clicked')); } private dimmingButtonClicked() { this.dispatchEvent(new CustomEvent('dimming-button-clicked')); } private appsButtonClicked() { this.dispatchEvent(new CustomEvent('apps-button-clicked')); } private leftMoreButtonClicked() { this.dispatchEvent(new CustomEvent('left-more-button-clicked')); } override render() { const leftGroup = []; if (this.settings) { leftGroup.push( html`
` ); leftGroup.push(html`