-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kit):
InputPhoneInternational
can be customized with Icon
/ …
…`Tooltip` (#8750) Co-authored-by: taiga-family-bot <[email protected]>
- Loading branch information
1 parent
e566fac
commit b20459b
Showing
8 changed files
with
147 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
projects/demo/src/modules/components/input-phone-international/examples/4/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<tui-input-phone-international | ||
[countries]="countries" | ||
[(countryIsoCode)]="countryIsoCode" | ||
[(ngModel)]="value" | ||
> | ||
Phone number | ||
<tui-icon | ||
appearance="error" | ||
tuiHintAppearance="error" | ||
tuiHintDirection="top" | ||
tuiTooltip="I am a hint" | ||
/> | ||
<tui-icon icon="@tui.phone" /> | ||
</tui-input-phone-international> |
3 changes: 3 additions & 0 deletions
3
projects/demo/src/modules/components/input-phone-international/examples/4/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tui-input-phone-international { | ||
min-width: min(20rem, 80vw); | ||
} |
40 changes: 40 additions & 0 deletions
40
projects/demo/src/modules/components/input-phone-international/examples/4/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {Component} from '@angular/core'; | ||
import {FormsModule} from '@angular/forms'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TuiIcon} from '@taiga-ui/core'; | ||
import type {TuiCountryIsoCode} from '@taiga-ui/i18n'; | ||
import { | ||
TuiInputPhoneInternational, | ||
tuiInputPhoneInternationalOptionsProvider, | ||
TuiTooltip, | ||
} from '@taiga-ui/kit'; | ||
import {defer} from 'rxjs'; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [FormsModule, TuiInputPhoneInternational, TuiIcon, TuiTooltip], | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
providers: [ | ||
tuiInputPhoneInternationalOptionsProvider({ | ||
metadata: defer(async () => | ||
import('libphonenumber-js/max/metadata').then((m) => m.default), | ||
), | ||
}), | ||
], | ||
}) | ||
export default class Example { | ||
protected readonly countries: readonly TuiCountryIsoCode[] = [ | ||
'TR', | ||
'IR', | ||
'IQ', | ||
'SA', | ||
'YE', | ||
]; | ||
|
||
protected countryIsoCode: TuiCountryIsoCode = 'TR'; | ||
protected value = ''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters