-<div class="border rounded p-1">
- <div class="font-weight-bold">{{label}}</div>
- <div *ngIf="!editing" tabindex="0" class="p-1"
- [ngClass]="{'bg-info': hasChanged}" (click)="toggleEditMode()">
+<div class="border rounded m-1">
+ <div class="font-weight-bold header p-2">{{label}}</div>
+ <div *ngIf="!editing" tabindex="0" class="p-2"
+ [ngClass]="{'has-changes': hasChanged}" (click)="toggleEditMode()">
<div class="d-flex"
*ngFor="let count of labelCounts | keyvalue">
<div class="flex-1">
{{count.key | currency}}
</ng-container>
<ng-container *ngIf="displayAs == null">
- {{count.key}}
+ <ng-container *ngIf="emptyIsUnset && !count.key && count.key !== 0; else default">
+ <span i18n><Unset></span>
+ </ng-container>
+ <ng-template #default>{{count.key}}</ng-template>
</ng-container>
</div>
<div i18n>{{count.value}} copies</div>
@Component({
selector: 'eg-batch-item-attr',
- templateUrl: 'batch-item-attr.component.html'
+ templateUrl: 'batch-item-attr.component.html',
+ styles: [
+ `.header { background-color: #d9edf7; }`,
+ `.has-changes { background-color: #dff0d8; }`
+ ]
})
export class BatchItemAttrComponent {
// Display only
@Input() readOnly = false;
+ // If true, null/undefined/empty-string display as <Unset>
+ @Input() emptyIsUnset: boolean;
+
@Output() changesSaved: EventEmitter<void> = new EventEmitter<void>();
@Output() changesCanceled: EventEmitter<void> = new EventEmitter<void>();