-
Notifications
You must be signed in to change notification settings - Fork 481
/
Copy path19999.1df6d12f03fbff3c.js
1 lines (1 loc) · 2.44 KB
/
19999.1df6d12f03fbff3c.js
1
(self.webpackChunkdemo=self.webpackChunkdemo||[]).push([[19999],{19999:n=>{n.exports="import {AsyncPipe, KeyValuePipe, NgForOf, NgIf} from '@angular/common';\nimport {Component} from '@angular/core';\nimport {changeDetection} from '@demo/emulate/change-detection';\nimport {encapsulation} from '@demo/emulate/encapsulation';\nimport {TuiAmountPipe} from '@taiga-ui/addon-commerce';\nimport {TuiButton, TuiTitle} from '@taiga-ui/core';\nimport {TuiAccordion} from '@taiga-ui/experimental';\nimport {TuiAvatar} from '@taiga-ui/kit';\nimport {TuiCell} from '@taiga-ui/layout';\n\ninterface Operation {\n title: string;\n subtitle?: string;\n sum?: number;\n time?: string;\n}\n\n@Component({\n standalone: true,\n exportAs: \"Example2\",\n imports: [\n AsyncPipe,\n KeyValuePipe,\n NgForOf,\n NgIf,\n TuiAccordion,\n TuiAmountPipe,\n TuiAvatar,\n TuiButton,\n TuiCell,\n TuiTitle,\n ],\n templateUrl: './index.html',\n styleUrls: ['./index.less'],\n encapsulation,\n changeDetection,\n})\nexport default class Example {\n protected readonly operations = {\n Today: [],\n Yesterday: [\n {\n title: 'Cashback',\n subtitle: 'Pot of gold',\n sum: 237,\n time: '19:32',\n },\n {\n title: 'Failed to load',\n },\n ],\n 'January 6, 2021': [\n {\n title: 'Salary',\n subtitle: 'Account number ••••237',\n sum: 43256,\n time: '11:02',\n },\n {\n title: 'Shaman Hat',\n subtitle: 'Insurrection Apparel',\n sum: -99,\n time: '09:11',\n },\n {\n title: 'Shaman Makeup',\n subtitle: 'Insurrection Apparel',\n sum: -75,\n time: '09:11',\n },\n ],\n };\n\n protected getIcon(operation: Operation): string {\n if (!operation.sum) {\n return '@tui.triangle-alert';\n }\n\n return operation.sum > 0 ? '@tui.thumbs-up' : '@tui.thumbs-down';\n }\n\n protected sum(operations: readonly Operation[]): number {\n return operations.reduce((acc, {sum}) => acc + (sum || 0), 0);\n }\n\n protected orderBy(): number {\n return 0;\n }\n}\n"}}]);