phase-7: add reusable input-output widget library and default registry

This commit is contained in:
sdarbinyan
2026-07-03 01:36:27 +04:00
parent 3f00884f33
commit 92c2f26780
5 changed files with 155 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
export interface FooterNavigationLink {
id: string;
label: string;
href: string;
}
@Component({
selector: 'app-footer-navigation-widget',
standalone: true,
imports: [CommonModule],
template: `
<footer class="footer-nav-widget">
<nav>
<ul>
@for (link of links; track link.id) {
<li>
<button type="button" (click)="onLinkClick(link)">{{ link.label }}</button>
</li>
}
</ul>
</nav>
</footer>
`,
styles: [
`
.footer-nav-widget { padding: 1rem; border-top: 1px solid var(--border-color, #d3dad9); }
ul { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
button { background: transparent; border: none; color: var(--text-secondary, #667a77); cursor: pointer; }
`
],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class FooterNavigationWidgetComponent {
@Input() links: FooterNavigationLink[] = [];
@Output() linkSelected = new EventEmitter<FooterNavigationLink>();
onLinkClick(link: FooterNavigationLink): void {
this.linkSelected.emit(link);
}
}