mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4755][CardViewDate&SelectItemComponent] Provide a way to reset date and none option as default. (#4955)
* [ADF-4755] [CardViewDateItemComponent] Provide a way to reset date. * Added clear icon to reset date to empty. * Added Translation key to the new icon. * * Added displayClearAction flag to toggle clear action.* Added None as default for the selectItem components.* Added displayNoneOption flag to toggle the default none option. * * Fixed comments. * * Added translation key for 'none' option. * * Updated dateItem css to the match recent changes. * * Fixed failing unit tests* Updated TaskHeader components with the displayClearAction. * * Updated demo shell card-view component to test the latest changes
This commit is contained in:
committed by
Maurizio Vitale
parent
525f0a06db
commit
05e73a8aa1
@@ -52,6 +52,9 @@ export class CardViewDateItemComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
displayEmpty: boolean = true;
|
||||
|
||||
@Input()
|
||||
displayClearAction: boolean = true;
|
||||
|
||||
@ViewChild('datetimePicker')
|
||||
public datepicker: MatDatetimepicker<any>;
|
||||
|
||||
@@ -92,6 +95,10 @@ export class CardViewDateItemComponent implements OnInit, OnDestroy {
|
||||
return this.displayEmpty || !this.property.isEmpty();
|
||||
}
|
||||
|
||||
showClearAction() {
|
||||
return !this.property.isEmpty() && this.displayClearAction;
|
||||
}
|
||||
|
||||
isEditable() {
|
||||
return this.editable && this.property.editable;
|
||||
}
|
||||
@@ -111,4 +118,10 @@ export class CardViewDateItemComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
onDateClear() {
|
||||
this.valueDate = null;
|
||||
this.cardViewUpdateService.update(this.property, null);
|
||||
this.property.value = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user