mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Rebased to the latest
This commit is contained in:
@@ -2,19 +2,19 @@
|
||||
<div class="adf-property-value adf-card-view-array-item-container">
|
||||
<ng-container *ngIf="(property.displayValue | async) as items; else elseEmptyValueBlock">
|
||||
<mat-chip-listbox *ngIf="items.length > 0; else elseEmptyValueBlock" data-automation-id="card-arrayitem-chip-list-container">
|
||||
<ng-container *ngIf="displayCount() > 0; else withOutDisplayCount" >
|
||||
<ng-container *ngIf="displayCount > 0; else withOutDisplayCount" >
|
||||
<mat-chip-option
|
||||
*ngFor="let item of items.slice(0, displayCount())"
|
||||
*ngFor="let item of items.slice(0, displayCount)"
|
||||
(click)="clicked()"
|
||||
[attr.data-automation-id]="'card-arrayitem-chip-' + item.value">
|
||||
<mat-icon *ngIf="item?.icon" class="adf-array-item-icon">{{item.icon}}</mat-icon>
|
||||
<span>{{item?.value}}</span>
|
||||
</mat-chip-option>
|
||||
<mat-chip-option
|
||||
*ngIf="items.length > displayCount()"
|
||||
*ngIf="items.length > displayCount"
|
||||
data-automation-id="card-arrayitem-more-chip"
|
||||
[matMenuTriggerFor]="menu">
|
||||
<span>{{items.length - displayCount()}} {{'CORE.CARDVIEW.MORE' | translate}}</span>
|
||||
<span>{{items.length - displayCount}} {{'CORE.CARDVIEW.MORE' | translate}}</span>
|
||||
</mat-chip-option>
|
||||
</ng-container>
|
||||
<ng-template #withOutDisplayCount>
|
||||
@@ -32,7 +32,7 @@
|
||||
<mat-card-content>
|
||||
<mat-chip-listbox>
|
||||
<mat-chip-option (click)="clicked()"
|
||||
*ngFor="let item of items.slice(displayCount(), items.length)"
|
||||
*ngFor="let item of items.slice(displayCount, items.length)"
|
||||
[attr.data-automation-id]="'card-arrayitem-chip-' + item.value">
|
||||
<mat-icon *ngIf="item?.icon" class="adf-array-item-icon">{{item.icon}}</mat-icon>
|
||||
<span>{{item?.value}}</span>
|
||||
|
@@ -1,16 +1,19 @@
|
||||
<div #nodeListContainer
|
||||
class="adf-dynamic-chip-list-container"
|
||||
[class.adf-dynamic-chip-list-flex-column]="limitChipsDisplayed && (!calculationsDone || columnFlexDirection)"
|
||||
[class.adf-dynamic-chip-list-button-in-next-line]="moveLoadMoreButtonToNextRow"
|
||||
[class.adf-dynamic-chip-list-paginated]="paginationData">
|
||||
<mat-chip-list [class.adf-dynamic-chip-list-full-width]="limitChipsDisplayed && !calculationsDone"
|
||||
role="listbox"
|
||||
[attr.aria-label]="'METADATA.BASIC.TAGS' | translate">
|
||||
<mat-chip *ngFor="let chip of chipsToDisplay; let idx = index"
|
||||
class="adf-dynamic-chip-list-chip"
|
||||
[style.border-radius]="roundUpChips ? '20px' : '10px'"
|
||||
[style.font-weight]="'bold'"
|
||||
(removed)="removedChip.emit(chip.id)">
|
||||
<div
|
||||
class="adf-dynamic-chip-list-container"
|
||||
[class.adf-dynamic-chip-list-flex-column]="limitChipsDisplayed && (!calculationsDone || columnFlexDirection)"
|
||||
[class.adf-dynamic-chip-list-button-in-next-line]="moveLoadMoreButtonToNextRow"
|
||||
[class.adf-dynamic-chip-list-paginated]="paginationData"
|
||||
#nodeListContainer>
|
||||
<mat-chip-listbox
|
||||
[class.adf-dynamic-chip-list-full-width]="limitChipsDisplayed && !calculationsDone"
|
||||
role="listbox"
|
||||
[attr.aria-label]="'METADATA.BASIC.TAGS' | translate">
|
||||
<mat-chip
|
||||
class="adf-dynamic-chip-list-chip"
|
||||
*ngFor="let chip of chipsToDisplay; let idx = index"
|
||||
[style.border-radius]="roundUpChips ? '20px' : '10px'"
|
||||
[style.font-weight]="'bold'"
|
||||
(removed)="removedChip.emit(chip.id)">
|
||||
<span id="adf-dynamic-chip-list-chip-name-{{ idx }}">{{ chip.name }}</span>
|
||||
<mat-icon *ngIf="showDelete"
|
||||
id="adf-dynamic-chip-list-delete-{{ chip.name }}"
|
||||
@@ -19,15 +22,16 @@
|
||||
close
|
||||
</mat-icon>
|
||||
</mat-chip>
|
||||
</mat-chip-list>
|
||||
<button data-automation-id="adf-dynamic-chip-list-view-more-button"
|
||||
class="adf-dynamic-chip-list-view-more-button"
|
||||
mat-button
|
||||
[hidden]="!limitChipsDisplayed"
|
||||
[style.left.px]="viewMoreButtonLeftOffset"
|
||||
[style.top.px]="viewMoreButtonTop"
|
||||
[class.adf-dynamic-chip-list-hidden-btn]="!calculationsDone"
|
||||
(click)="displayNextChips($event)">
|
||||
</mat-chip-listbox>
|
||||
<button
|
||||
data-automation-id="adf-dynamic-chip-list-view-more-button"
|
||||
mat-button
|
||||
[hidden]="!limitChipsDisplayed"
|
||||
[style.left.px]="viewMoreButtonLeftOffset"
|
||||
[style.top.px]="viewMoreButtonTop"
|
||||
class="adf-dynamic-chip-list-view-more-button"
|
||||
[class.adf-dynamic-chip-list-hidden-btn]="!calculationsDone"
|
||||
(click)="displayNextChips($event)">
|
||||
{{
|
||||
paginationData ? ('DYNAMIC_CHIP_LIST.LOAD_MORE' | translate) :
|
||||
('TAG_NODE_LIST.VIEW_MORE' | translate: { count: undisplayedChipsCount })
|
||||
|
@@ -289,7 +289,7 @@ describe('DynamicChipListComponent', () => {
|
||||
});
|
||||
tick();
|
||||
fixture.detectChanges();
|
||||
element.style.maxWidth = '309px';
|
||||
element.style.maxWidth = '100px';
|
||||
|
||||
resizeCallback([], null);
|
||||
fixture.detectChanges();
|
||||
|
Reference in New Issue
Block a user