Last active
September 26, 2020 15:25
-
-
Save hebertlima/74f31ff7a3e5ef1b822d5b349660ceec to your computer and use it in GitHub Desktop.
table.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class Table { | |
| headers: [{ | |
| title: 'Header 1', | |
| code: 'header' | |
| }]; | |
| data: any; | |
| hiddenFields: any[]; | |
| tablefields: any[]; | |
| tableTrExpand: false; | |
| button: ButtonTable; | |
| subHeaders: any[]; | |
| constructor(options?: { | |
| tableTrExpand?: boolean | |
| headers?: { title: string, code?: string, style?: string, join?: any[] }[], | |
| subHeaders?: { title: string, code?: string, style?: string, join?: any[] }[], | |
| data?: any, | |
| button?: ButtonTable | |
| }) { | |
| if (options) { | |
| Object.assign(this, options); | |
| this.clear(); | |
| } | |
| } | |
| private clear(): void { | |
| Object.keys(this).forEach(key => { | |
| if (Array.isArray( key ) ) { | |
| this[key].filter(item => item ); | |
| } | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment