33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { Component, ElementRef, inject, input } from '@angular/core';
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
|
import { HELP_OUTLINE_ICON } from '../icons';
|
|
|
|
/** Shared heading block for pages and page sections. */
|
|
@Component({
|
|
selector: 'app-page-header',
|
|
standalone: true,
|
|
imports: [MatIconModule, MatTooltipModule],
|
|
templateUrl: './page-header.component.html',
|
|
styleUrl: './page-header.component.scss',
|
|
})
|
|
export class PageHeaderComponent {
|
|
readonly HELP_OUTLINE_ICON = HELP_OUTLINE_ICON;
|
|
|
|
readonly title = input<string | null>(null);
|
|
readonly subtitle = input<string | null>(null);
|
|
readonly eyebrow = input<string | null>(null);
|
|
readonly titleTooltip = input<string | null>(null);
|
|
readonly level = input<1 | 2 | 3>(1);
|
|
|
|
constructor() {
|
|
// See PageContainerComponent: a static `title="..."` would stay on the
|
|
// host element and trigger the browser's native tooltip for the whole
|
|
// section. The input still receives the value.
|
|
inject<ElementRef<HTMLElement>>(ElementRef).nativeElement.removeAttribute(
|
|
'title',
|
|
);
|
|
}
|
|
}
|