@intl-tel-input/react 28.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/IntlTelInput.d.ts +26 -0
- package/dist/IntlTelInput.js +4824 -0
- package/dist/IntlTelInputWithUtils.d.ts +4 -0
- package/dist/IntlTelInputWithUtils.js +11181 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2016 Jack O'Connor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# IntlTelInput React Component
|
|
2
|
+
|
|
3
|
+
A React component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) JavaScript plugin. View the [source code](https://github.com/jackocnr/intl-tel-input/blob/master/packages/react/src/IntlTelInput.tsx).
|
|
4
|
+
|
|
5
|
+
[Explore docs »](https://intl-tel-input.com/docs/react-component)
|
|
6
|
+
|
|
7
|
+
## Running the demos locally
|
|
8
|
+
|
|
9
|
+
1. Initialise the submodules: `git submodule update --init --recursive`
|
|
10
|
+
2. Install dependencies: `npm install`
|
|
11
|
+
3. Build: `npm run build`
|
|
12
|
+
|
|
13
|
+
You can then open `packages/react/demo/validation/index.html` in your browser to try the validation demo. View the full list of [available demos](https://github.com/jackocnr/intl-tel-input/tree/master/packages/react/demo).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import intlTelInput, { Iti } from "intl-tel-input";
|
|
2
|
+
import type { ValidationError } from "intl-tel-input";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export { intlTelInput };
|
|
5
|
+
type InputProps = Omit<React.ComponentPropsWithoutRef<"input">, "onInput">;
|
|
6
|
+
export type StrictRejectSource = "key" | "paste";
|
|
7
|
+
export type StrictRejectReason = "invalid" | "max-length";
|
|
8
|
+
export type IntlTelInputRef = {
|
|
9
|
+
getInstance: () => Iti | null;
|
|
10
|
+
getInput: () => HTMLInputElement | null;
|
|
11
|
+
};
|
|
12
|
+
declare const IntlTelInput: React.ForwardRefExoticComponent<Partial<import("intl-tel-input").AllOptions> & {
|
|
13
|
+
onChangeNumber?: (number: string) => void;
|
|
14
|
+
onChangeCountry?: (iso2: string) => void;
|
|
15
|
+
onChangeValidity?: (isValid: boolean) => void;
|
|
16
|
+
onChangeErrorCode?: (errorCode: ValidationError | null) => void;
|
|
17
|
+
onOpenCountryDropdown?: () => void;
|
|
18
|
+
onCloseCountryDropdown?: () => void;
|
|
19
|
+
onStrictReject?: (source: StrictRejectSource, rejectedInput: string, reason: StrictRejectReason) => void;
|
|
20
|
+
usePreciseValidation?: boolean;
|
|
21
|
+
inputProps?: InputProps;
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
readOnly?: boolean | undefined;
|
|
24
|
+
value?: string | null;
|
|
25
|
+
} & React.RefAttributes<IntlTelInputRef>>;
|
|
26
|
+
export default IntlTelInput;
|