input library
Formatting and checking CNIC, phone and IBAN form fields as the user types.
Same as the pakdatakit/input entry point of the npm package.
Enums
- InputState
- State of a form field while the user is typing.
Functions
-
checkCNICInput(
String value) → InputState - Checks a CNIC while the user is typing.
-
checkIBANInput(
String value) → InputState -
Checks a Pakistani IBAN while the user is typing: the
PKprefix, check digits and bank code are checked as they are typed, and the full checksum once all 24 characters are in. -
checkPhoneInput(
String value) → InputState -
Checks a Pakistani mobile number while the user is typing. The
03XXprefix is checked as soon as it is complete. -
formatCNICInput(
String value) → String -
Formats a CNIC as the user types:
35202-1234567-1. -
formatIBANInput(
String value) → String -
Formats an IBAN as the user types: uppercase, in groups of four
(
PK36 SCBL 0000 0011 2345 6702), up to 24 characters. -
formatPhoneInput(
String value) → String -
Formats a Pakistani mobile number as the user types:
0300-1234567, or+92 300 1234567when the user starts with the country code.