mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-] update library to use new js-api 3.0.0 (#4097)
This commit is contained in:
committed by
Eugenio Romano
parent
2acd1b4e26
commit
3ef7d3b7ea
@@ -28,16 +28,16 @@ export abstract class CardViewBaseItemModel {
|
||||
validators?: CardViewItemValidator[];
|
||||
data?: any;
|
||||
|
||||
constructor(obj: CardViewItemProperties) {
|
||||
this.label = obj.label || '';
|
||||
this.value = obj.value;
|
||||
this.key = obj.key;
|
||||
this.default = obj.default;
|
||||
this.editable = !!obj.editable;
|
||||
this.clickable = !!obj.clickable;
|
||||
this.icon = obj.icon || '';
|
||||
this.validators = obj.validators || [];
|
||||
this.data = obj.data || null;
|
||||
constructor(cardViewItemProperties: CardViewItemProperties) {
|
||||
this.label = cardViewItemProperties.label || '';
|
||||
this.value = cardViewItemProperties.value;
|
||||
this.key = cardViewItemProperties.key;
|
||||
this.default = cardViewItemProperties.default;
|
||||
this.editable = !!cardViewItemProperties.editable;
|
||||
this.clickable = !!cardViewItemProperties.clickable;
|
||||
this.icon = cardViewItemProperties.icon || '';
|
||||
this.validators = cardViewItemProperties.validators || [];
|
||||
this.data = cardViewItemProperties.data || null;
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
|
@@ -25,11 +25,11 @@ export class CardViewBoolItemModel extends CardViewBaseItemModel implements Card
|
||||
value: boolean = false;
|
||||
default: boolean;
|
||||
|
||||
constructor(obj: CardViewBoolItemProperties) {
|
||||
super(obj);
|
||||
constructor(cardViewBoolItemProperties: CardViewBoolItemProperties) {
|
||||
super(cardViewBoolItemProperties);
|
||||
|
||||
if (obj.value !== undefined) {
|
||||
this.value = !!JSON.parse(obj.value);
|
||||
if (cardViewBoolItemProperties.value !== undefined) {
|
||||
this.value = !!JSON.parse(cardViewBoolItemProperties.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,11 +25,11 @@ export class CardViewDateItemModel extends CardViewBaseItemModel implements Card
|
||||
type: string = 'date';
|
||||
format: string = 'MMM DD YYYY';
|
||||
|
||||
constructor(obj: CardViewDateItemProperties) {
|
||||
super(obj);
|
||||
constructor(cardViewDateItemProperties: CardViewDateItemProperties) {
|
||||
super(cardViewDateItemProperties);
|
||||
|
||||
if (obj.format) {
|
||||
this.format = obj.format;
|
||||
if (cardViewDateItemProperties.format) {
|
||||
this.format = cardViewDateItemProperties.format;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -24,12 +24,12 @@ import { CardViewItemFloatValidator } from '..//validators/card-view.validators'
|
||||
export class CardViewFloatItemModel extends CardViewTextItemModel implements CardViewItem, DynamicComponentModel {
|
||||
type: string = 'float';
|
||||
|
||||
constructor(obj: CardViewTextItemProperties) {
|
||||
super(obj);
|
||||
constructor(cardViewTextItemProperties: CardViewTextItemProperties) {
|
||||
super(cardViewTextItemProperties);
|
||||
|
||||
this.validators.push(new CardViewItemFloatValidator());
|
||||
if (obj.value) {
|
||||
this.value = parseFloat(obj.value);
|
||||
if (cardViewTextItemProperties.value) {
|
||||
this.value = parseFloat(cardViewTextItemProperties.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,12 +24,12 @@ import { CardViewItemIntValidator } from '../validators/card-view.validators';
|
||||
export class CardViewIntItemModel extends CardViewTextItemModel implements CardViewItem, DynamicComponentModel {
|
||||
type: string = 'int';
|
||||
|
||||
constructor(obj: CardViewTextItemProperties) {
|
||||
super(obj);
|
||||
constructor(cardViewTextItemProperties: CardViewTextItemProperties) {
|
||||
super(cardViewTextItemProperties);
|
||||
|
||||
this.validators.push(new CardViewItemIntValidator());
|
||||
if (obj.value) {
|
||||
this.value = parseInt(obj.value, 10);
|
||||
if (cardViewTextItemProperties.value) {
|
||||
this.value = parseInt(cardViewTextItemProperties.value, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@ import { CardViewKeyValuePairsItemProperties } from '../interfaces/card-view.int
|
||||
export class CardViewKeyValuePairsItemModel extends CardViewBaseItemModel implements CardViewItem, DynamicComponentModel {
|
||||
type: string = 'keyvaluepairs';
|
||||
|
||||
constructor(obj: CardViewKeyValuePairsItemProperties) {
|
||||
super(obj);
|
||||
constructor(cardViewKeyValuePairsItemProperties: CardViewKeyValuePairsItemProperties) {
|
||||
super(cardViewKeyValuePairsItemProperties);
|
||||
}
|
||||
|
||||
get displayValue() {
|
||||
|
@@ -26,10 +26,10 @@ export class CardViewSelectItemModel<T> extends CardViewBaseItemModel implements
|
||||
type: string = 'select';
|
||||
options$: Observable<CardViewSelectItemOption<T>[]>;
|
||||
|
||||
constructor(obj: CardViewSelectItemProperties<T>) {
|
||||
super(obj);
|
||||
constructor(cardViewSelectItemProperties: CardViewSelectItemProperties<T>) {
|
||||
super(cardViewSelectItemProperties);
|
||||
|
||||
this.options$ = obj.options$;
|
||||
this.options$ = cardViewSelectItemProperties.options$;
|
||||
}
|
||||
|
||||
get displayValue() {
|
||||
|
@@ -25,10 +25,10 @@ export class CardViewTextItemModel extends CardViewBaseItemModel implements Card
|
||||
multiline?: boolean;
|
||||
pipes?: CardViewTextItemPipeProperty[];
|
||||
|
||||
constructor(obj: CardViewTextItemProperties) {
|
||||
super(obj);
|
||||
this.multiline = !!obj.multiline ;
|
||||
this.pipes = obj.pipes || [];
|
||||
constructor(cardViewTextItemProperties: CardViewTextItemProperties) {
|
||||
super(cardViewTextItemProperties);
|
||||
this.multiline = !!cardViewTextItemProperties.multiline ;
|
||||
this.pipes = cardViewTextItemProperties.pipes || [];
|
||||
}
|
||||
|
||||
get displayValue() {
|
||||
|
Reference in New Issue
Block a user