From 249479cf6de496ee0a1e98401c214e1ea324dc20 Mon Sep 17 00:00:00 2001 From: mdlufy Date: Fri, 11 Oct 2024 14:12:33 +0300 Subject: [PATCH] fix(kit): `InputPhoneInternational` signal `countries` --- .../input-phone-international.component.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/kit/components/input-phone-international/input-phone-international.component.ts b/projects/kit/components/input-phone-international/input-phone-international.component.ts index 8a4f59bcdc51..79d49a39a646 100644 --- a/projects/kit/components/input-phone-international/input-phone-international.component.ts +++ b/projects/kit/components/input-phone-international/input-phone-international.component.ts @@ -103,13 +103,14 @@ export class TuiInputPhoneInternational extends TuiControl { protected readonly open = tuiDropdownOpen(); protected readonly names = toSignal(inject(TUI_COUNTRIES)); protected readonly metadata = toSignal(from(this.options.metadata)); + protected readonly countries = signal(this.options.countries); protected readonly countryIsoCode = signal(this.options.countryIsoCode); protected readonly icons = inject(TUI_COMMON_ICONS); protected readonly internationalSearchLabel$ = inject(TUI_INTERNATIONAL_SEARCH); protected readonly search = signal(''); protected readonly filtered = computed(() => - this.countries + this.countries() .map((iso) => ({ iso, name: this.names()?.[iso] || '', @@ -130,9 +131,6 @@ export class TuiInputPhoneInternational extends TuiControl { protected textfieldValue = ''; - @Input() - public countries = this.options.countries; - @Input() public countrySearch = false; @@ -141,6 +139,11 @@ export class TuiInputPhoneInternational extends TuiControl { skip(1), ); + @Input('countries') + public set countriesValue(value: readonly TuiCountryIsoCode[]) { + this.countries.set(value); + } + @Input('countryIsoCode') public set isoCode(code: TuiCountryIsoCode) { this.countryIsoCode.set(code);