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/package.json
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
"url": "https://github.com/viclafouch/mui-tel-input/issues"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://viclafouch.github.io/mui-tel-input",
|
|
10
|
-
"version": "
|
|
10
|
+
"version": "9.0.0",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
|
+
"type": "module",
|
|
14
15
|
"main": "./dist/mui-tel-input.es.js",
|
|
15
16
|
"types": "./dist/index.d.ts",
|
|
16
17
|
"exports": {
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
],
|
|
40
41
|
"scripts": {
|
|
41
42
|
"build": "vite build",
|
|
42
|
-
"lint": "tsc && eslint
|
|
43
|
+
"lint": "npx tsc && eslint",
|
|
43
44
|
"lint:fix": "npm run lint -- --fix",
|
|
44
45
|
"storybook": "storybook dev -p 6006",
|
|
45
46
|
"build-storybook": "storybook build",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"peerDependencies": {
|
|
61
62
|
"@emotion/react": "^11.13.0",
|
|
62
63
|
"@emotion/styled": "^11.13.0",
|
|
63
|
-
"@mui/material": "^
|
|
64
|
+
"@mui/material": "^7.0.0",
|
|
64
65
|
"@types/react": "^18.0.0 || ^19.0.0",
|
|
65
66
|
"react": "^18.0.0 || ^19.0.0",
|
|
66
67
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -71,43 +72,42 @@
|
|
|
71
72
|
}
|
|
72
73
|
},
|
|
73
74
|
"dependencies": {
|
|
74
|
-
"@types/node": "^22.
|
|
75
|
-
"libphonenumber-js": "^1.
|
|
75
|
+
"@types/node": "^22.14.1",
|
|
76
|
+
"libphonenumber-js": "^1.12.6"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
|
-
"@babel/core": "^7.26.
|
|
79
|
+
"@babel/core": "^7.26.10",
|
|
79
80
|
"@emotion/react": "^11.14.0",
|
|
80
81
|
"@emotion/styled": "^11.14.0",
|
|
81
|
-
"@mui/material": "^
|
|
82
|
-
"@storybook/addon-actions": "^8.6.
|
|
83
|
-
"@storybook/addon-essentials": "^8.6.
|
|
84
|
-
"@storybook/addon-interactions": "^8.6.
|
|
85
|
-
"@storybook/addon-links": "^8.6.
|
|
86
|
-
"@storybook/react": "^8.6.
|
|
87
|
-
"@storybook/
|
|
88
|
-
"@storybook/test": "^8.6.3",
|
|
82
|
+
"@mui/material": "^7.0.2",
|
|
83
|
+
"@storybook/addon-actions": "^8.6.12",
|
|
84
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
85
|
+
"@storybook/addon-interactions": "^8.6.12",
|
|
86
|
+
"@storybook/addon-links": "^8.6.12",
|
|
87
|
+
"@storybook/react-vite": "^8.6.12",
|
|
88
|
+
"@storybook/test": "^8.6.12",
|
|
89
89
|
"@testing-library/dom": "^10.4.0",
|
|
90
90
|
"@testing-library/jest-dom": "^6.6.3",
|
|
91
|
-
"@testing-library/react": "^16.
|
|
91
|
+
"@testing-library/react": "^16.3.0",
|
|
92
92
|
"@testing-library/user-event": "^14.6.1",
|
|
93
|
-
"@types/react": "^19.
|
|
94
|
-
"@types/react-dom": "^19.
|
|
95
|
-
"@viclafouch/eslint-config-viclafouch": "4.
|
|
93
|
+
"@types/react": "^19.1.1",
|
|
94
|
+
"@types/react-dom": "^19.1.2",
|
|
95
|
+
"@viclafouch/eslint-config-viclafouch": "4.22.0",
|
|
96
96
|
"@vitejs/plugin-react": "^4.3.4",
|
|
97
|
-
"babel-loader": "^
|
|
98
|
-
"eslint": "^
|
|
97
|
+
"babel-loader": "^10.0.0",
|
|
98
|
+
"eslint": "^9.24.0",
|
|
99
99
|
"husky": "^9.1.7",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
100
|
+
"jsdom": "^26.1.0",
|
|
101
|
+
"prettier": "^3.5.3",
|
|
102
|
+
"react": "^19.1.0",
|
|
103
|
+
"react-dom": "^19.1.0",
|
|
104
104
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
105
105
|
"standard-version": "^9.5.0",
|
|
106
|
-
"storybook": "^8.6.
|
|
107
|
-
"typescript": "^5.8.
|
|
108
|
-
"vite": "6.2.
|
|
106
|
+
"storybook": "^8.6.12",
|
|
107
|
+
"typescript": "^5.8.3",
|
|
108
|
+
"vite": "6.2.6",
|
|
109
109
|
"vite-aliases": "^0.11.8",
|
|
110
110
|
"vite-plugin-dts": "^4.5.3",
|
|
111
|
-
"vitest": "^3.
|
|
111
|
+
"vitest": "^3.1.1"
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { MuiTelInputCountry } from '../../shared/constants/countries';
|
|
3
|
-
export type FlagProps = {
|
|
4
|
-
isoCode: MuiTelInputCountry | null;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
export declare const flagContainerClass = "MuiTelInput-Flag";
|
|
8
|
-
declare const Flag: ({ isoCode, children }: FlagProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default Flag;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const Styled: {
|
|
2
|
-
Flag: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
|
-
};
|
|
4
|
-
export { Styled };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { MuiTelInputCountry } from '../../shared/constants/countries';
|
|
3
|
-
import { IconButtonProps } from '@mui/material/IconButton';
|
|
4
|
-
import { GetFlagElement } from '../../index.types';
|
|
5
|
-
export type FlagButtonProps = IconButtonProps & {
|
|
6
|
-
isoCode: MuiTelInputCountry | null;
|
|
7
|
-
forceCallingCode?: boolean;
|
|
8
|
-
isFlagsMenuOpened: boolean;
|
|
9
|
-
langOfCountryName?: string;
|
|
10
|
-
disableDropdown?: boolean;
|
|
11
|
-
getFlagElement: GetFlagElement;
|
|
12
|
-
unknownFlagElement: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
export declare const flagButtonClass = "MuiTelInput-IconButton";
|
|
15
|
-
declare const FlagButton: ({ disableDropdown, forceCallingCode, langOfCountryName, isFlagsMenuOpened, getFlagElement, unknownFlagElement, isoCode, className, ...iconButtonProps }: FlagButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export default FlagButton;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const Styled: {
|
|
2
|
-
CallingCodeSplitted: import('@emotion/styled').StyledComponent<import('@mui/material').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "p" | "style" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "children" | "className" | "classes" | "sx" | "variant" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
3
|
-
};
|
|
4
|
-
export { Styled };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { MuiTelInputCountry } from '../../shared/constants/countries';
|
|
3
|
-
import { MenuItemProps } from '@mui/material/MenuItem';
|
|
4
|
-
import { GetFlagElement } from '../../index.types';
|
|
5
|
-
export type FlagMenuItemProps = MenuItemProps & {
|
|
6
|
-
isoCode: MuiTelInputCountry;
|
|
7
|
-
onSelectCountry: (isoCode: MuiTelInputCountry) => void;
|
|
8
|
-
countryName: string;
|
|
9
|
-
getFlagElement: GetFlagElement;
|
|
10
|
-
};
|
|
11
|
-
export declare const menuItemClass = "MuiTelInput-MenuItem";
|
|
12
|
-
export declare const listItemIconFlagClass = "MuiTelInput-ListItemIcon-flag";
|
|
13
|
-
export declare const listItemTextCountryClass = "MuiTelInput-ListItemText-country";
|
|
14
|
-
export declare const callingCodeClass = "MuiTelInput-Typography-calling-code";
|
|
15
|
-
declare const _default: React.MemoExoticComponent<({ isoCode, onSelectCountry, countryName, getFlagElement, ...restMenuItemProps }: FlagMenuItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
|
-
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const Styled: {
|
|
2
|
-
ListItemIcon: import('@emotion/styled').StyledComponent<import('@mui/material').ListItemIconProps & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
3
|
-
ListItemText: import('@emotion/styled').StyledComponent<import('@mui/material').ListItemTextProps<import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>, import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
|
-
};
|
|
5
|
-
export { Styled };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { MuiTelInputContinent } from '../../shared/constants/continents';
|
|
2
|
-
import { MuiTelInputCountry } from '../../shared/constants/countries';
|
|
3
|
-
import { MenuProps } from '@mui/material/Menu';
|
|
4
|
-
import { GetFlagElement } from '../../index.types';
|
|
5
|
-
export type FlagsMenuProps = Partial<MenuProps> & {
|
|
6
|
-
isoCode: MuiTelInputCountry | null;
|
|
7
|
-
onlyCountries?: MuiTelInputCountry[];
|
|
8
|
-
excludedCountries?: MuiTelInputCountry[];
|
|
9
|
-
preferredCountries?: MuiTelInputCountry[];
|
|
10
|
-
langOfCountryName?: string;
|
|
11
|
-
continents?: MuiTelInputContinent[];
|
|
12
|
-
onSelectCountry: (isoCode: MuiTelInputCountry) => void;
|
|
13
|
-
getFlagElement: GetFlagElement;
|
|
14
|
-
};
|
|
15
|
-
export declare const menuClass = "MuiTelInput-Menu";
|
|
16
|
-
declare const FlagsMenu: ({ anchorEl, isoCode, onSelectCountry, excludedCountries, onlyCountries, langOfCountryName, continents, preferredCountries, className, getFlagElement, ...restMenuProps }: FlagsMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export default FlagsMenu;
|
package/dist/index.types.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { NumberType } from 'libphonenumber-js';
|
|
2
|
-
import { MuiTelInputContinent } from './shared/constants/continents';
|
|
3
|
-
import { MuiTelInputCountry } from './shared/constants/countries';
|
|
4
|
-
import { IconButtonProps } from '@mui/material/IconButton';
|
|
5
|
-
import { MenuProps } from '@mui/material/Menu';
|
|
6
|
-
import { TextFieldProps } from '@mui/material/TextField';
|
|
7
|
-
type BaseTextFieldProps = Omit<TextFieldProps, 'onChange' | 'select' | 'type' | 'multiline' | 'defaultValue' | 'inputProps' | 'InputProps'>;
|
|
8
|
-
export type { MuiTelInputContinent, MuiTelInputCountry };
|
|
9
|
-
export type MuiTelInputReason = 'country' | 'input' | 'blur';
|
|
10
|
-
export type MuiTelInputFlagElement = React.ReactNode;
|
|
11
|
-
export type GetFlagElement = (isoCode: MuiTelInputCountry, { countryName, isSelected, imgProps }: {
|
|
12
|
-
countryName: string;
|
|
13
|
-
isSelected: boolean;
|
|
14
|
-
imgProps: React.ComponentPropsWithRef<'img'>;
|
|
15
|
-
}) => MuiTelInputFlagElement;
|
|
16
|
-
export interface MuiTelInputInfo {
|
|
17
|
-
countryCode: MuiTelInputCountry | null;
|
|
18
|
-
countryCallingCode: string | null;
|
|
19
|
-
nationalNumber: string | null;
|
|
20
|
-
numberType: Exclude<NumberType, undefined> | null;
|
|
21
|
-
numberValue: string | null;
|
|
22
|
-
reason: MuiTelInputReason;
|
|
23
|
-
}
|
|
24
|
-
type ForceCallingCodeWithDefaultCountry = {
|
|
25
|
-
forceCallingCode: true;
|
|
26
|
-
defaultCountry: MuiTelInputCountry;
|
|
27
|
-
} | {
|
|
28
|
-
forceCallingCode?: false | undefined;
|
|
29
|
-
defaultCountry?: MuiTelInputCountry;
|
|
30
|
-
};
|
|
31
|
-
export type MuiTelInputProps = BaseTextFieldProps & ForceCallingCodeWithDefaultCountry & {
|
|
32
|
-
excludedCountries?: MuiTelInputCountry[];
|
|
33
|
-
onlyCountries?: MuiTelInputCountry[];
|
|
34
|
-
preferredCountries?: MuiTelInputCountry[];
|
|
35
|
-
focusOnSelectCountry?: boolean;
|
|
36
|
-
disableDropdown?: boolean;
|
|
37
|
-
langOfCountryName?: string;
|
|
38
|
-
disableFormatting?: boolean;
|
|
39
|
-
continents?: MuiTelInputContinent[];
|
|
40
|
-
onChange?: (value: string, info: MuiTelInputInfo) => void;
|
|
41
|
-
onBlur?: (event: React.FocusEvent<HTMLInputElement>, info: MuiTelInputInfo) => void;
|
|
42
|
-
value?: string | undefined;
|
|
43
|
-
MenuProps?: Partial<MenuProps>;
|
|
44
|
-
getFlagElement?: GetFlagElement;
|
|
45
|
-
unknownFlagElement?: MuiTelInputFlagElement;
|
|
46
|
-
FlagIconButtonProps?: Partial<IconButtonProps>;
|
|
47
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MuiTelInputCountry } from './countries';
|
|
2
|
-
export type MuiTelInputContinent = 'EU' | 'AS' | 'NA' | 'SA' | 'OC' | 'AF';
|
|
3
|
-
type Continents = {
|
|
4
|
-
[key in MuiTelInputContinent]: MuiTelInputCountry[];
|
|
5
|
-
};
|
|
6
|
-
export declare const CONTINENTS: Continents;
|
|
7
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { MetadataJson } from 'libphonenumber-js';
|
|
2
|
-
export declare const COUNTRIES: MetadataJson['countries'];
|
|
3
|
-
export declare const ISO_CODES: import('libphonenumber-js').CountryCode[];
|
|
4
|
-
export type MuiTelInputCountry = (typeof ISO_CODES)[number];
|
|
5
|
-
export declare const DEFAULT_ISO_CODE: MuiTelInputCountry;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_LANG = "en";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { MuiTelInputContinent } from '../constants/continents';
|
|
2
|
-
import { MuiTelInputCountry } from '../constants/countries';
|
|
3
|
-
type FilterCountriesOptions = {
|
|
4
|
-
onlyCountries?: readonly MuiTelInputCountry[];
|
|
5
|
-
excludedCountries?: readonly MuiTelInputCountry[];
|
|
6
|
-
preferredCountries?: readonly MuiTelInputCountry[];
|
|
7
|
-
continents?: readonly MuiTelInputContinent[];
|
|
8
|
-
};
|
|
9
|
-
export declare function getCallingCodeOfCountry(isoCode: MuiTelInputCountry): string;
|
|
10
|
-
export declare function getValidCountry(country?: MuiTelInputCountry): MuiTelInputCountry;
|
|
11
|
-
export declare function sortPreferredCountries(countries: readonly MuiTelInputCountry[], preferredCountries: readonly MuiTelInputCountry[]): readonly MuiTelInputCountry[];
|
|
12
|
-
export declare function getCountriesOfContinents(continents: readonly MuiTelInputContinent[]): readonly MuiTelInputCountry[];
|
|
13
|
-
export declare function getOnlyCountries(countries: readonly MuiTelInputCountry[], onlyCountries: readonly MuiTelInputCountry[]): readonly MuiTelInputCountry[];
|
|
14
|
-
export declare function excludeCountries(countries: readonly MuiTelInputCountry[], excludedCountries?: readonly MuiTelInputCountry[]): readonly MuiTelInputCountry[];
|
|
15
|
-
export declare function sortAlphabeticallyCountryCodes(countryCodes: readonly MuiTelInputCountry[], displayNames: Intl.DisplayNames): readonly MuiTelInputCountry[];
|
|
16
|
-
export declare function filterCountries(countries: readonly MuiTelInputCountry[], displayNames: Intl.DisplayNames, options: FilterCountriesOptions): readonly MuiTelInputCountry[];
|
|
17
|
-
export declare function matchContinentsIncludeCountry(continents: MuiTelInputContinent[], isoCode: MuiTelInputCountry): boolean;
|
|
18
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function putCursorAtEndOfInput(inputElement: HTMLInputElement): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { GetFlagElement, MuiTelInputCountry } from '../../index.types';
|
|
2
|
-
export declare const flagImgClass = "MuiTelInput-FlagImg";
|
|
3
|
-
export declare const getDefaultImgProps: ({ isoCode, countryName }: {
|
|
4
|
-
isoCode: MuiTelInputCountry;
|
|
5
|
-
countryName: string;
|
|
6
|
-
}) => {
|
|
7
|
-
src: string;
|
|
8
|
-
loading: "lazy";
|
|
9
|
-
width: number;
|
|
10
|
-
alt: string;
|
|
11
|
-
className: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const getDefaultFlagElement: GetFlagElement;
|
|
14
|
-
export declare const defaultUnknownFlagElement: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getDisplayNames(lang?: string): Intl.DisplayNames;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function log(...args: Parameters<Console['error']>): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function removeOccurrence(text: string, part: string | RegExp): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MuiTelInputContinent } from 'index.types';
|
|
2
|
-
import { MuiTelInputCountry } from '../constants/countries';
|
|
3
|
-
export declare function matchIsValidTel(text: string, options?: {
|
|
4
|
-
excludedCountries?: MuiTelInputCountry[];
|
|
5
|
-
onlyCountries?: MuiTelInputCountry[];
|
|
6
|
-
continents?: MuiTelInputContinent[];
|
|
7
|
-
}): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { MuiTelInputProps } from '../../index.types';
|
|
3
|
-
type Options = Pick<MuiTelInputProps, 'disableDropdown' | 'disabled'>;
|
|
4
|
-
export declare function useAnchor({ disabled, disableDropdown }: Options): {
|
|
5
|
-
anchorRef: React.RefObject<HTMLDivElement | null>;
|
|
6
|
-
anchorEl: HTMLDivElement | null;
|
|
7
|
-
openMenu: () => void;
|
|
8
|
-
closeMenu: () => void;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TextFieldProps } from '@mui/material';
|
|
2
|
-
type Options = Pick<TextFieldProps, 'onDoubleClick' | 'onCopy' | 'onFocus'> & {
|
|
3
|
-
inputRef: React.MutableRefObject<HTMLInputElement | null>;
|
|
4
|
-
};
|
|
5
|
-
export declare function useEvents({ onDoubleClick, onCopy, onFocus, inputRef }: Options): {
|
|
6
|
-
handleDoubleClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
7
|
-
handleCopy: (event: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
8
|
-
handleFocus: (event: React.FocusEvent<HTMLInputElement, Element>) => void;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { MuiTelInputContinent } from '../constants/continents';
|
|
3
|
-
import { MuiTelInputCountry } from '../constants/countries';
|
|
4
|
-
import { MuiTelInputInfo, MuiTelInputReason } from '../../index.types';
|
|
5
|
-
type UsePhoneDigitsParams = {
|
|
6
|
-
value: string;
|
|
7
|
-
onChange?: (value: string, info: MuiTelInputInfo) => void;
|
|
8
|
-
defaultCountry?: MuiTelInputCountry;
|
|
9
|
-
forceCallingCode: boolean;
|
|
10
|
-
disableFormatting: boolean;
|
|
11
|
-
excludedCountries?: MuiTelInputCountry[];
|
|
12
|
-
onlyCountries?: MuiTelInputCountry[];
|
|
13
|
-
continents?: MuiTelInputContinent[];
|
|
14
|
-
};
|
|
15
|
-
type State = {
|
|
16
|
-
inputValue: string;
|
|
17
|
-
isoCode: MuiTelInputCountry | null;
|
|
18
|
-
};
|
|
19
|
-
type GetInitialStateParams = {
|
|
20
|
-
defaultCountry?: MuiTelInputCountry;
|
|
21
|
-
initialValue: string;
|
|
22
|
-
forceCallingCode: boolean;
|
|
23
|
-
disableFormatting: boolean;
|
|
24
|
-
};
|
|
25
|
-
export declare function getInitialState(params: GetInitialStateParams): State;
|
|
26
|
-
export default function usePhoneDigits({ value, onChange, defaultCountry, onlyCountries, excludedCountries, continents, disableFormatting, forceCallingCode }: UsePhoneDigitsParams): {
|
|
27
|
-
inputValue: string;
|
|
28
|
-
isoCode: import('libphonenumber-js').CountryCode | null;
|
|
29
|
-
onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
30
|
-
onCountryChange: (newCountry: MuiTelInputCountry) => void;
|
|
31
|
-
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
32
|
-
buildInputInfo: (reason: MuiTelInputReason) => MuiTelInputInfo;
|
|
33
|
-
};
|
|
34
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MuiTelInputCountry } from '../shared/constants/countries';
|
|
2
|
-
export declare function getInputElement(): HTMLInputElement;
|
|
3
|
-
export declare function getButtonElement(): HTMLButtonElement;
|
|
4
|
-
export declare function expectButtonIsFlagOf(isoCode: MuiTelInputCountry): void;
|
|
5
|
-
export declare function expectButtonNotIsFlagOf(isoCode: MuiTelInputCountry): void;
|
|
6
|
-
export declare function expectButtonContainsCallingCode(callingCode: string): void;
|
|
7
|
-
export declare function typeInInputElement(value: string): Promise<{
|
|
8
|
-
result: string;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function selectCountry(isoCode: MuiTelInputCountry): void;
|
|
11
|
-
export declare function closeFlagsMenu(): Promise<void>;
|