openaire-library/utils/tabs/tab.component.ts

43 lines
967 B
TypeScript
Raw Normal View History

/**
* A single tab page. It renders the passed template
* via the @Input properties by using the ngTemplateOutlet
* and ngTemplateOutletContext directives.
*/
import { Component, Input } from '@angular/core';
2022-01-21 14:40:30 +01:00
export interface TabIcon {
svg: string;
ratio: number;
fill: string;
}
@Component({
selector: 'my-tab',
// styles: [
// `
// .pane{
// padding: 1em;
// }
// `
// ],
template: `
<!-- [class]="active ? 'uk-active' : ''" [hidden]="!active"-->
<!-- <div [class]="active ? 'uk-active' : ''" [hidden]="!active">-->
<div class="pane">
<ng-content></ng-content>
</div>
<!-- <div [hidden]="!active" class="pane">-->
<!-- <ng-content></ng-content>-->
<!-- </div>-->
`
})
export class TabComponent {
@Input('tabTitle') title: string;
@Input('tabNumber') num: number;
@Input('customClass') customClass:string = "";
@Input('tabId') tabId: string;
2022-01-21 14:40:30 +01:00
@Input('tabIcon') tabIcon: TabIcon;
}