/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Component, Input} from '@angular/core'; import {EXAMPLE_COMPONENTS} from '@angular/material-examples'; import {coerceBooleanProperty} from '@angular/cdk/coercion'; /** Displays a set of material examples in a mat-accordion. */ @Component({ selector: 'material-example-list', template: `
{{exampleComponents[id]?.title}}
<{{id}}>
`, styles: [` mat-expansion-panel { box-shadow: none !important; border-radius: 0 !important; background: transparent; border-top: 1px solid #CCC; } .header { display: flex; justify-content: space-between; width: 100%; padding-right: 24px; align-items: center; } .id { font-family: monospace; color: #666; font-size: 12px; } `] }) export class ExampleList { /** Type of examples being displayed. */ @Input() type: string; /** IDs of the examples to display. */ @Input() ids: string[]; @Input() get expandAll(): boolean { return this._expandAll; } set expandAll(v: boolean) { this._expandAll = coerceBooleanProperty(v); } _expandAll: boolean; exampleComponents = EXAMPLE_COMPONENTS; }