import { Component } from '@angular/core' ; import { Facet } from '@ux-aspects/ux-aspects' ; 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' ; @ Component ( { selector : 'uxd-components-facet-check-list' , templateUrl : './facet-check-list.component.html' } ) @ DocumentationSectionComponent ( 'ComponentsFacetCheckListComponent' ) export class ComponentsFacetCheckListComponent extends BaseDocumentationSection implements IPlaygroundProvider { facets : Facet [ ] = [ ] ; playground : IPlayground = { files : { 'app.component.ts' : this . snippets . raw . appTs , 'app.component.html' : this . snippets . raw . appHtml } , modules : [ { imports : [ 'FacetsModule' ] , library : '@ux-aspects/ux-aspects' } ] } ; constructor ( ) { super ( require . context ( './snippets/' , false , /\.(html|css|js|ts)$/ ) ) ; for ( let idx = 0 ; idx < 30 ; idx ++ ) { this . facets . push ( new Facet ( chance . name ( ) , null , chance . integer ( { min : 0 , max : 100 } ) ) ) ; } this . facets . sort ( ( facetOne , facetTwo ) => { if ( facetOne . title < facetTwo . title ) { return - 1 ; } if ( facetOne . title > facetTwo . title ) { return 1 ; } return 0 ; } ) ; } }