-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
groupingFormatters.index.ts
111 lines (96 loc) · 6.13 KB
/
groupingFormatters.index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import { avgTotalsPercentageFormatter } from './avgTotalsPercentageFormatter.js';
import { avgTotalsDollarFormatter } from './avgTotalsDollarFormatter.js';
import { avgTotalsCurrencyFormatter } from './avgTotalsCurrencyFormatter.js';
import { avgTotalsFormatter } from './avgTotalsFormatter.js';
import { minTotalsFormatter } from './minTotalsFormatter.js';
import { maxTotalsFormatter } from './maxTotalsFormatter.js';
import { sumTotalsColoredFormatter } from './sumTotalsColoredFormatter.js';
import { sumTotalsCurrencyFormatter } from './sumTotalsCurrencyFormatter.js';
import { sumTotalsCurrencyColoredFormatter } from './sumTotalsCurrencyColoredFormatter.js';
import { sumTotalsDollarColoredBoldFormatter } from './sumTotalsDollarColoredBoldFormatter.js';
import { sumTotalsDollarColoredFormatter } from './sumTotalsDollarColoredFormatter.js';
import { sumTotalsDollarBoldFormatter } from './sumTotalsDollarBoldFormatter.js';
import { sumTotalsDollarFormatter } from './sumTotalsDollarFormatter.js';
import { sumTotalsFormatter } from './sumTotalsFormatter.js';
import { sumTotalsBoldFormatter } from './sumTotalsBoldFormatter.js';
import type { GroupTotalsFormatter } from '../interfaces/groupTotalsFormatter.interface.js';
/** Provides a list of different Formatters that will change the cell value displayed in the UI */
export const GroupTotalFormatters: Record<string, GroupTotalsFormatter> = {
/**
* Average all the column totals
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g.: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
avgTotals: avgTotalsFormatter,
/**
* Average all the column totals and display currency prefix/suffix via "groupFormatterCurrencyPrefix" and/or "groupFormatterCurrencySuffix"
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g.: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
avgTotalsCurrency: avgTotalsCurrencyFormatter,
/**
* Average all the column totals and display '$' at the end of the value
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g.: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
avgTotalsDollar: avgTotalsDollarFormatter,
/**
* Average all the column totals and display '%' at the end of the value
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g.: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
avgTotalsPercentage: avgTotalsPercentageFormatter,
/**
* Show max value of all the column totals
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g.: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
maxTotals: maxTotalsFormatter,
/**
* Show min value of all the column totals
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g.: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
minTotals: minTotalsFormatter,
/**
* Sums up all the column totals
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g.: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotals: sumTotalsFormatter,
/**
* Sums up all the column totals and display it in bold font weight
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsBold: sumTotalsBoldFormatter,
/**
* Sums up all the column totals, change color of text to red/green on negative/positive value
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsColored: sumTotalsColoredFormatter,
/**
* Sums up all the column totals and display currency
* Extra options available in "params":: "groupFormatterPrefix", "groupFormatterSuffix", "groupFormatterCurrencyPrefix" and/or "groupFormatterCurrencySuffix"
* e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsCurrency: sumTotalsCurrencyFormatter,
/**
* Sums up all the column totals and display currency with color of red/green text on negative/positive values
* Extra options available in "params":: "groupFormatterPrefix", "groupFormatterSuffix", "groupFormatterCurrencyPrefix" and/or "groupFormatterCurrencySuffix"
* e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsCurrencyColored: sumTotalsCurrencyColoredFormatter,
/**
* Sums up all the column totals and display dollar sign
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsDollar: sumTotalsDollarFormatter,
/**
* Sums up all the column totals and display dollar sign and show it in bold font weight
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsDollarBold: sumTotalsDollarBoldFormatter,
/**
* Sums up all the column totals, change color of text to red/green on negative/positive value
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsDollarColored: sumTotalsDollarColoredFormatter,
/**
* Sums up all the column totals, change color of text to red/green on negative/positive value, show it in bold font weight as well
* Extra options available in "params":: "groupFormatterPrefix" and "groupFormatterSuffix", e.g: params: { groupFormatterPrefix: '<i>Total</i>: ', groupFormatterSuffix: '$' }
*/
sumTotalsDollarColoredBold: sumTotalsDollarColoredBoldFormatter,
};