ud-components 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -107,4 +107,18 @@ export interface TableDisplayColumn {
|
|
|
107
107
|
* For PILL type columns. Receives the row and returns the KpiPillType to apply.
|
|
108
108
|
*/
|
|
109
109
|
pillTypeFn?: (row: any) => KpiPillType;
|
|
110
|
+
/**
|
|
111
|
+
* For MONEY columns. ISO 4217 code every row is shown in. Defaults to USD,
|
|
112
|
+
* so a table that sets nothing still reads "$12.50".
|
|
113
|
+
*/
|
|
114
|
+
currency?: string;
|
|
115
|
+
/**
|
|
116
|
+
* For MONEY columns. Row property holding each row's ISO 4217 code; wins
|
|
117
|
+
* over {@link currency} when the row has a value there.
|
|
118
|
+
*/
|
|
119
|
+
currencyProperty?: string;
|
|
120
|
+
/**
|
|
121
|
+
* For MONEY columns. Shows credits as "($12.50)" instead of "-$12.50".
|
|
122
|
+
*/
|
|
123
|
+
accountingNegatives?: boolean;
|
|
110
124
|
}
|
|
@@ -196,6 +196,7 @@ export declare class CustomTableComponent implements OnInit, OnChanges {
|
|
|
196
196
|
set sort(val: MatSort);
|
|
197
197
|
allFilterInput: ElementRef<HTMLInputElement>;
|
|
198
198
|
private readonly dialog;
|
|
199
|
+
private readonly locale;
|
|
199
200
|
constructor(translateService: TranslateWrapperService);
|
|
200
201
|
ngOnInit(): void;
|
|
201
202
|
applyFilterToAllColumns(event: Event): void;
|
|
@@ -235,6 +236,7 @@ export declare class CustomTableComponent implements OnInit, OnChanges {
|
|
|
235
236
|
private restoreFiltersFromCriteria;
|
|
236
237
|
private setTableQuery;
|
|
237
238
|
buildColumnFilterControls(): void;
|
|
239
|
+
formatMoneyCell(row: any, column: TableDisplayColumn): string;
|
|
238
240
|
formatPhoneNumber(value: string): string;
|
|
239
241
|
getRowBackgroundColor(index: number): "bg-accent" | "bg-white";
|
|
240
242
|
getHyperlinkRoute(row: any, column: TableDisplayColumn): string;
|
|
@@ -23,3 +23,11 @@ export declare function moneyToCents(value: string): number;
|
|
|
23
23
|
export declare function centsToMoney(cents: number): string;
|
|
24
24
|
/** For display only: "1234.50" → "1,234.50". Never parse this back as a number. */
|
|
25
25
|
export declare function groupThousands(value: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* For display only: an API amount in its currency, always 2 decimals.
|
|
28
|
+
* `formatMoney('1234.5', 'CAD', 'en-US')` gives "$1,234.50", a credit "-$12.50",
|
|
29
|
+
* or "($12.50)" with {@link accounting}. The value goes to Intl as a string, so
|
|
30
|
+
* it is never rounded through a float. Empty input gives "", anything that is
|
|
31
|
+
* not a number is shown as it came.
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatMoney(value: string | number | null | undefined, currency?: string, locale?: string, accounting?: boolean): string;
|