From e69c338dabd7c57525a1a0794b5a439b529ac942 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 8 Apr 2024 13:28:07 +0800 Subject: [PATCH] More formal tone #10279 --- .../lib/modules/select/select/select.component.html | 6 ++---- .../lib/modules/select/select/select.component.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/projects/natural/src/lib/modules/select/select/select.component.html b/projects/natural/src/lib/modules/select/select/select.component.html index 56da93f3..73471491 100644 --- a/projects/natural/src/lib/modules/select/select/select.component.html +++ b/projects/natural/src/lib/modules/select/select/select.component.html @@ -13,10 +13,8 @@ /> } - @if (moreNbItems > 0) { -
Tapez pour chercher parmis les {{ moreNbItems }} elements
+ @if (hasMoreItems) { +
Saisir pour chercher parmi {{ nbTotal }} résultats
} diff --git a/projects/natural/src/lib/modules/select/select/select.component.ts b/projects/natural/src/lib/modules/select/select/select.component.ts index ccbf680d..89f388ed 100644 --- a/projects/natural/src/lib/modules/select/select/select.component.ts +++ b/projects/natural/src/lib/modules/select/select/select.component.ts @@ -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 @@ -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; }),