mui-tel-input 8.0.1 → 9.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/dist/index.d.ts +91 -18
- package/dist/mui-tel-input.es.js +937 -920
- package/package.json +28 -28
- package/dist/components/Flag/Flag.d.ts +0 -9
- package/dist/components/Flag/Flag.styled.d.ts +0 -4
- package/dist/components/FlagButton/FlagButton.d.ts +0 -16
- package/dist/components/FlagButton/FlagButton.styled.d.ts +0 -4
- package/dist/components/FlagMenuItem/FlagMenuItem.d.ts +0 -16
- package/dist/components/FlagMenuItem/FlagsMenuItem.styled.d.ts +0 -5
- package/dist/components/FlagsMenu/FlagsMenu.d.ts +0 -17
- package/dist/index.types.d.ts +0 -47
- package/dist/shared/constants/continents.d.ts +0 -7
- package/dist/shared/constants/countries.d.ts +0 -5
- package/dist/shared/constants/flags.d.ts +0 -6
- package/dist/shared/constants/lang.d.ts +0 -1
- package/dist/shared/helpers/__tests__/array.test.d.ts +0 -1
- package/dist/shared/helpers/__tests__/country.test.d.ts +0 -1
- package/dist/shared/helpers/__tests__/intl.test.d.ts +0 -0
- package/dist/shared/helpers/__tests__/string.test.d.ts +0 -0
- package/dist/shared/helpers/__tests__/valid-phone-number.test.d.ts +0 -0
- package/dist/shared/helpers/array.d.ts +0 -2
- package/dist/shared/helpers/country.d.ts +0 -18
- package/dist/shared/helpers/dom.d.ts +0 -1
- package/dist/shared/helpers/flag.d.ts +0 -14
- package/dist/shared/helpers/intl.d.ts +0 -1
- package/dist/shared/helpers/log.d.ts +0 -1
- package/dist/shared/helpers/object.d.ts +0 -2
- package/dist/shared/helpers/ref.d.ts +0 -2
- package/dist/shared/helpers/string.d.ts +0 -1
- package/dist/shared/helpers/valid-phone-number.d.ts +0 -7
- package/dist/shared/hooks/__tests__/useMissmatch.test.d.ts +0 -1
- package/dist/shared/hooks/useAnchor.d.ts +0 -10
- package/dist/shared/hooks/useEvents.d.ts +0 -10
- package/dist/shared/hooks/useMissmatchProps.d.ts +0 -2
- package/dist/shared/hooks/usePhoneDigits.d.ts +0 -34
- package/dist/testUtils/index.d.ts +0 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,91 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { AsYouType } from 'libphonenumber-js';
|
|
2
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
3
|
+
import { getNumberType } from 'libphonenumber-js';
|
|
4
|
+
import { IconButtonProps } from '@mui/material/IconButton';
|
|
5
|
+
import { JSX } from 'react/jsx-runtime';
|
|
6
|
+
import { MenuProps } from '@mui/material/Menu';
|
|
7
|
+
import { NumberType } from 'libphonenumber-js';
|
|
8
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
9
|
+
|
|
10
|
+
export { AsYouType }
|
|
11
|
+
|
|
12
|
+
declare type BaseTextFieldProps = Omit<TextFieldProps, 'onChange' | 'select' | 'type' | 'multiline' | 'defaultValue' | 'inputProps' | 'InputProps'>;
|
|
13
|
+
|
|
14
|
+
export declare const classes: {
|
|
15
|
+
readonly textField: "MuiTelInput-TextField";
|
|
16
|
+
readonly flagContainer: "MuiTelInput-Flag";
|
|
17
|
+
readonly flagImg: "MuiTelInput-FlagImg";
|
|
18
|
+
readonly flagButton: "MuiTelInput-IconButton";
|
|
19
|
+
readonly menu: "MuiTelInput-Menu";
|
|
20
|
+
readonly menuItem: "MuiTelInput-MenuItem";
|
|
21
|
+
readonly listItemIconFlag: "MuiTelInput-ListItemIcon-flag";
|
|
22
|
+
readonly listItemTextCountry: "MuiTelInput-ListItemText-country";
|
|
23
|
+
readonly callingCode: "MuiTelInput-Typography-calling-code";
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare type ForceCallingCodeWithDefaultCountry = {
|
|
27
|
+
forceCallingCode: true;
|
|
28
|
+
defaultCountry: MuiTelInputCountry;
|
|
29
|
+
} | {
|
|
30
|
+
forceCallingCode?: false | undefined;
|
|
31
|
+
defaultCountry?: MuiTelInputCountry;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
declare type GetFlagElement = (isoCode: MuiTelInputCountry, { countryName, isSelected, imgProps }: {
|
|
35
|
+
countryName: string;
|
|
36
|
+
isSelected: boolean;
|
|
37
|
+
imgProps: React.ComponentPropsWithRef<'img'>;
|
|
38
|
+
}) => MuiTelInputFlagElement;
|
|
39
|
+
|
|
40
|
+
export { getNumberType }
|
|
41
|
+
|
|
42
|
+
declare const ISO_CODES: CountryCode[];
|
|
43
|
+
|
|
44
|
+
export declare function matchIsValidTel(text: string, options?: {
|
|
45
|
+
excludedCountries?: MuiTelInputCountry[];
|
|
46
|
+
onlyCountries?: MuiTelInputCountry[];
|
|
47
|
+
continents?: MuiTelInputContinent_2[];
|
|
48
|
+
}): boolean;
|
|
49
|
+
|
|
50
|
+
export declare const MuiTelInput: (props: MuiTelInputProps) => JSX.Element;
|
|
51
|
+
|
|
52
|
+
export declare type MuiTelInputContinent = 'EU' | 'AS' | 'NA' | 'SA' | 'OC' | 'AF';
|
|
53
|
+
|
|
54
|
+
declare type MuiTelInputContinent_2 = 'EU' | 'AS' | 'NA' | 'SA' | 'OC' | 'AF'
|
|
55
|
+
|
|
56
|
+
export declare type MuiTelInputCountry = (typeof ISO_CODES)[number];
|
|
57
|
+
|
|
58
|
+
export declare type MuiTelInputFlagElement = React.ReactNode;
|
|
59
|
+
|
|
60
|
+
export declare interface MuiTelInputInfo {
|
|
61
|
+
countryCode: MuiTelInputCountry | null;
|
|
62
|
+
countryCallingCode: string | null;
|
|
63
|
+
nationalNumber: string | null;
|
|
64
|
+
numberType: Exclude<NumberType, undefined> | null;
|
|
65
|
+
numberValue: string | null;
|
|
66
|
+
reason: MuiTelInputReason;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare type MuiTelInputProps = BaseTextFieldProps & ForceCallingCodeWithDefaultCountry & {
|
|
70
|
+
excludedCountries?: MuiTelInputCountry[];
|
|
71
|
+
onlyCountries?: MuiTelInputCountry[];
|
|
72
|
+
preferredCountries?: MuiTelInputCountry[];
|
|
73
|
+
focusOnSelectCountry?: boolean;
|
|
74
|
+
disableDropdown?: boolean;
|
|
75
|
+
langOfCountryName?: string;
|
|
76
|
+
disableFormatting?: boolean;
|
|
77
|
+
continents?: MuiTelInputContinent[];
|
|
78
|
+
onChange?: (value: string, info: MuiTelInputInfo) => void;
|
|
79
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>, info: MuiTelInputInfo) => void;
|
|
80
|
+
value?: string | undefined;
|
|
81
|
+
MenuProps?: Partial<MenuProps>;
|
|
82
|
+
getFlagElement?: GetFlagElement;
|
|
83
|
+
unknownFlagElement?: MuiTelInputFlagElement;
|
|
84
|
+
FlagIconButtonProps?: Partial<IconButtonProps>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export declare type MuiTelInputReason = 'country' | 'input' | 'blur';
|
|
88
|
+
|
|
89
|
+
export declare const textFieldClass = "MuiTelInput-TextField";
|
|
90
|
+
|
|
91
|
+
export { }
|