import { ChangeDetectionStrategy , Component } from '@angular/core' ; import 'chance' ; import { BaseDocumentationSection } from '../../../../../components/base-documentation-section/base-documentation-section' ; import { DocumentationSectionComponent } from '../../../../../decorators/documentation-section-component' ; import { IPlayground } from '../../../../../interfaces/IPlayground' ; import { IPlaygroundProvider } from '../../../../../interfaces/IPlaygroundProvider' ; const chance = new Chance ( ) ; @ Component ( { selector : 'uxd-components-tabs' , templateUrl : './tabs.component.html' , styleUrls : [ './tabs.component.less' ] , changeDetection : ChangeDetectionStrategy . OnPush } ) @ DocumentationSectionComponent ( 'ComponentsTabsComponent' ) export class ComponentsTabsComponent extends BaseDocumentationSection implements IPlaygroundProvider { tabs : Tab [ ] = [ { icon : 'schedule' , title : 'Schedule' , content : chance . paragraph ( ) } , { icon : 'shield' , title : 'Protection' , content : chance . paragraph ( ) } , { icon : 'information' , title : 'Solution' , content : chance . paragraph ( ) } , { icon : 'analytics' , title : 'Analytics' , content : chance . paragraph ( ) } ] ; minimal : boolean = true ; set stacked ( stacked ) { this . _stacked = stacked ; if ( stacked === 'left' || stacked === 'right' ) { this . minimal = true ; } } get stacked ( ) : TabStackType { return this . _stacked ; } private _stacked : TabStackType = 'none' ; playground : IPlayground = { files : { 'app.component.html' : this . snippets . raw . appHtml , 'app.component.ts' : this . snippets . raw . appTs , 'app.component.css' : this . snippets . raw . appCss , } , modules : [ { imports : [ 'TabsetModule' ] , library : '@ux-aspects/ux-aspects' } , { library : 'chance' } ] } ; constructor ( ) { super ( require . context ( './snippets/' , false , /\.(html|css|js|ts)$/ ) ) ; } } export type TabStackType = 'left' | 'right' | 'none' ; export interface Tab { icon : string ; title : string ; content : string ; }