Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(text): valueFormatter for easy and flexible input auto-formatting (
- Loading branch information
1 parent
f549667
commit b3abc5f
Showing
6 changed files
with
126 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page"> | ||
<Page.actionBar> | ||
<ActionBar title="Labels and TextView" class="action-bar"> | ||
</ActionBar> | ||
</Page.actionBar> | ||
<ScrollView> | ||
<StackLayout padding="20"> | ||
<Label text="TextField:" fontWeight="bold" /> | ||
<TextField textChange="{{ textChange }}" marginTop="6" backgroundColor="#efefef" padding="8" fontSize="18" keyboardType="url" /> | ||
|
||
<Label text="{{ textInput }}" marginTop="6" /> | ||
|
||
</StackLayout> | ||
</ScrollView> | ||
<Page.actionBar> | ||
<ActionBar title="Labels and TextView" class="action-bar"> | ||
</ActionBar> | ||
</Page.actionBar> | ||
<ScrollView> | ||
<StackLayout padding="20"> | ||
<Label text="TextField:" fontWeight="bold" /> | ||
<TextField textChange="{{ textChange }}" marginTop="6" backgroundColor="#efefef" padding="8" fontSize="18" keyboardType="url" /> | ||
|
||
<Label text="{{ textInput }}" marginTop="6" /> | ||
|
||
<Label text="SSN Formatted input:" fontWeight="bold" marginTop="12" /> | ||
<TextField hint="XXX-XX-XXXX" style.placeholderColor="silver" textChange="{{textChangeSSN}}" keyboardType="number" color="black" width="80%" borderColor="silver" borderWidth="1" height="40" textAlignment="center" borderRadius="4" valueFormatter="{{valueFormatterSSN}}" padding="5" maxLength="11"> | ||
</TextField> | ||
<Label text="{{ formattedSSNInput }}" marginTop="6" /> | ||
|
||
<Label text="Phone Formatted input:" fontWeight="bold" marginTop="12" /> | ||
<TextField hint="XXX-XXX-XXXX" style.placeholderColor="silver" textChange="{{textChangePhone}}" keyboardType="number" color="black" width="80%" borderColor="silver" borderWidth="1" height="40" textAlignment="center" borderRadius="4" valueFormatter="{{valueFormatterPhone}}" padding="5" maxLength="12"> | ||
</TextField> | ||
<Label text="{{ formattedPhoneInput }}" marginTop="6" /> | ||
|
||
</StackLayout> | ||
</ScrollView> | ||
</Page> |
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
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