Skip to content

Commit

Permalink
Merge branch 'before-refactor'
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Apr 10, 2024
2 parents f0577a7 + e69c338 commit 10eb30a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
/>
</mat-option>
}
@if (moreNbItems > 0) {
<div class="mat-caption" i18n style="padding: 5px 10px"
>Tapez pour chercher parmis les {{ moreNbItems }} elements</div
>
@if (hasMoreItems) {
<div class="mat-caption" i18n style="padding: 5px 10px">Saisir pour chercher parmi {{ nbTotal }} résultats</div>
}
</mat-autocomplete>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ export class NaturalSelectComponent<
public loading = false;

/**
* Number of items not shown in result list
* Shows a message after list if positive
* If some items are not shown in result list
* Shows a message after list if true
*/
public moreNbItems = 0;
public hasMoreItems = false;

public nbTotal = 0;

/**
* Default page size
Expand Down Expand Up @@ -246,9 +248,9 @@ export class NaturalSelectComponent<
finalize(() => (this.loading = false)),
map(data => {
this.loading = false;
const nbTotal = data.length;
this.nbTotal = data.length;
const nbListed = Math.min(data.length, this.pageSize);
this.moreNbItems = nbTotal - nbListed;
this.hasMoreItems = this.nbTotal > nbListed;

return data.items;
}),
Expand Down

0 comments on commit 10eb30a

Please sign in to comment.