[ADF-4713] Add new DecimalNumber Pipe to transform and localize numbers (#4926)

* [ADF-4713] Add new DecimalNumber Pipe to transform and localize numbers

* Unsubscribe from userPreference service

* Make Pipe impure

* Add documentation in localization page
This commit is contained in:
davidcanonieto
2019-07-18 11:09:50 +01:00
committed by Eugenio Romano
parent 8ee5cd1908
commit a0d4160c11
25 changed files with 457 additions and 66 deletions

View File

@@ -27,7 +27,8 @@ import {
CardViewSelectItemModel,
CardViewUpdateService,
CardViewMapItemModel,
UpdateNotification
UpdateNotification,
DecimalNumberPipe
} from '@alfresco/adf-core';
import { of, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@@ -46,7 +47,8 @@ export class CardViewComponent implements OnInit, OnDestroy {
private onDestroy$ = new Subject<boolean>();
constructor(private cardViewUpdateService: CardViewUpdateService) {
constructor(private cardViewUpdateService: CardViewUpdateService,
private decimalNumberPipe: DecimalNumberPipe) {
this.logs = [];
this.createCard();
}
@@ -112,7 +114,8 @@ export class CardViewComponent implements OnInit, OnDestroy {
value: 9.9,
key: 'float',
default: 0.0,
editable: this.isEditable
editable: this.isEditable,
pipes: [{ pipe: this.decimalNumberPipe}]
}),
new CardViewKeyValuePairsItemModel({
label: 'CardView Key-Value Pairs Item',