@rpcbase/ui 0.112.0 → 0.114.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/components/ImagesField/index.d.ts.map +1 -1
- package/dist/components/PhoneNumberInput/country-options.d.ts +15 -0
- package/dist/components/PhoneNumberInput/country-options.d.ts.map +1 -0
- package/dist/components/PhoneNumberInput/index.d.ts +3 -47
- package/dist/components/PhoneNumberInput/index.d.ts.map +1 -1
- package/dist/components/PhoneNumberInput/messages.d.ts +3 -0
- package/dist/components/PhoneNumberInput/messages.d.ts.map +1 -0
- package/dist/components/PhoneNumberInput/normalization.d.ts +47 -0
- package/dist/components/PhoneNumberInput/normalization.d.ts.map +1 -0
- package/dist/components/PhoneNumberInput/selection.d.ts +19 -0
- package/dist/components/PhoneNumberInput/selection.d.ts.map +1 -0
- package/dist/components/PhoneNumberInput/suggestions.d.ts +17 -0
- package/dist/components/PhoneNumberInput/suggestions.d.ts.map +1 -0
- package/dist/components/PhoneNumberInput/types.d.ts +49 -0
- package/dist/components/PhoneNumberInput/types.d.ts.map +1 -0
- package/dist/index.js +3204 -3162
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/ImagesField/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/ImagesField/index.tsx"],"names":[],"mappings":"AAiBA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAgHD,KAAK,YAAY,GAAG,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAEhE,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KAAK,YAAY,CAAA;AAEzF,KAAK,gBAAgB,GAAG;IACtB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAA;IAC/C,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AA+BD,wBAAgB,WAAW,CAAC,EAC1B,aAAkB,EAClB,QAAQ,EACR,MAAuB,EACvB,QAAgB,GACjB,EAAE,gBAAgB,2CAiZlB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CountryCode } from "libphonenumber-js";
|
|
2
|
+
import type { CountryOption, PhoneNumberSelectedCountry } from "./types";
|
|
3
|
+
export declare const DEFAULT_COUNTRY: CountryCode;
|
|
4
|
+
export declare const COUNTRY_DIAL_CODES: import("libphonenumber-js").CountryCallingCode[];
|
|
5
|
+
export declare const MAX_DIAL_CODE_LENGTH: number;
|
|
6
|
+
export declare const COMMON_IDD_PREFIXES: string[];
|
|
7
|
+
export declare function getValidCountry(input: CountryCode | undefined): CountryCode;
|
|
8
|
+
export declare function getLocaleCacheKey(locale?: string | string[]): string;
|
|
9
|
+
export declare function parseLocaleCacheKey(cacheKey: string): string | string[] | undefined;
|
|
10
|
+
export declare function getCachedCountryOptions(locale: string | string[] | undefined, cacheKey: string): CountryOption[];
|
|
11
|
+
export declare function toSelectedCountry(option: CountryOption): PhoneNumberSelectedCountry;
|
|
12
|
+
export declare function buildFallbackSelectedCountry(country: CountryCode): PhoneNumberSelectedCountry;
|
|
13
|
+
export declare function normalizeSearchValue(value: string): string;
|
|
14
|
+
export declare function optionMatchIndex(tokens: string[], query: string): number;
|
|
15
|
+
//# sourceMappingURL=country-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"country-options.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/country-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAGpD,OAAO,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAIxE,eAAO,MAAM,eAAe,EAAE,WAAkB,CAAA;AAKhD,eAAO,MAAM,kBAAkB,kDAEM,CAAA;AACrC,eAAO,MAAM,oBAAoB,QAGhC,CAAA;AACD,eAAO,MAAM,mBAAmB,UAAsC,CAAA;AAEtE,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,eAM7D;AA2DD,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,UAQ3D;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAiBnF;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAQ9F;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,0BAA0B,CAOnF;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,WAAW,GAAG,0BAA0B,CAO7F;AAsBD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,UAEjD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,UAS/D"}
|
|
@@ -1,51 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { CountryCode } from "libphonenumber-js";
|
|
3
3
|
import { type Props as SelectProps } from "react-select";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
noMatches: string;
|
|
7
|
-
selectCountryLabel: string;
|
|
8
|
-
selectedCountryLabel: (countryName: string | null) => string;
|
|
9
|
-
};
|
|
10
|
-
type CountryOption = {
|
|
11
|
-
value: CountryCode;
|
|
12
|
-
name: string;
|
|
13
|
-
dialCode: string;
|
|
14
|
-
label: string;
|
|
15
|
-
flag: string;
|
|
16
|
-
searchableTokens: string[];
|
|
17
|
-
normalizedSearchableTokens: string[];
|
|
18
|
-
};
|
|
19
|
-
export type PhoneNumberSelectedCountry = {
|
|
20
|
-
code: CountryCode;
|
|
21
|
-
name: string;
|
|
22
|
-
dialCode: string;
|
|
23
|
-
flag: string;
|
|
24
|
-
};
|
|
25
|
-
export type PhoneNumberChangeDetails = {
|
|
26
|
-
formattedInternational: string;
|
|
27
|
-
formattedNational: string;
|
|
28
|
-
e164: string | null;
|
|
29
|
-
country: CountryCode;
|
|
30
|
-
countryCallingCode: string;
|
|
31
|
-
nationalNumber: string;
|
|
32
|
-
rawInput: string;
|
|
33
|
-
isValid: boolean;
|
|
34
|
-
selectedCountry: PhoneNumberSelectedCountry;
|
|
35
|
-
};
|
|
36
|
-
export type PhoneNumberInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> & {
|
|
37
|
-
value?: string;
|
|
38
|
-
defaultCountry?: CountryCode;
|
|
39
|
-
country?: CountryCode;
|
|
40
|
-
locale?: string | string[];
|
|
41
|
-
onChange?: (details: PhoneNumberChangeDetails) => void;
|
|
42
|
-
onCountryChange?: (country: CountryCode, selection: PhoneNumberSelectedCountry) => void;
|
|
43
|
-
className?: string;
|
|
44
|
-
inputClassName?: string;
|
|
45
|
-
selectProps?: Partial<SelectProps<CountryOption, false>>;
|
|
46
|
-
autofillShimName?: string;
|
|
47
|
-
messages?: Partial<PhoneNumberInputMessages>;
|
|
48
|
-
};
|
|
4
|
+
import type { CountryOption, PhoneNumberChangeDetails, PhoneNumberSelectedCountry } from "./types";
|
|
5
|
+
export type { CountryOption, PhoneNumberChangeDetails, PhoneNumberInputMessages, PhoneNumberInputProps, PhoneNumberSelectedCountry, } from "./types";
|
|
49
6
|
export declare const PhoneNumberInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "defaultValue"> & {
|
|
50
7
|
value?: string;
|
|
51
8
|
defaultCountry?: CountryCode;
|
|
@@ -57,7 +14,6 @@ export declare const PhoneNumberInput: React.ForwardRefExoticComponent<Omit<Reac
|
|
|
57
14
|
inputClassName?: string;
|
|
58
15
|
selectProps?: Partial<SelectProps<CountryOption, false>>;
|
|
59
16
|
autofillShimName?: string;
|
|
60
|
-
messages?: Partial<PhoneNumberInputMessages>;
|
|
17
|
+
messages?: Partial<import("./types").PhoneNumberInputMessages>;
|
|
61
18
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
62
|
-
export {};
|
|
63
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAe,EACb,KAAK,KAAK,IAAI,WAAW,EAG1B,MAAM,cAAc,CAAA;AAIrB,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EAExB,0BAA0B,EAC3B,MAAM,SAAS,CAAA;AA2ChB,YAAY,EACV,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;0CAqpC5B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAsBvD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACrC,SAAS,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAC5C,wBAAwB,CAU1B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CountryCode } from "libphonenumber-js";
|
|
2
|
+
import { AsYouType } from "libphonenumber-js";
|
|
3
|
+
export type LengthIssue = "TOO_LONG";
|
|
4
|
+
export declare function sanitizeDigits(value: string): string;
|
|
5
|
+
export declare function injectNationalPrefixDisplay(international: string, dialCode: string, options?: {
|
|
6
|
+
force?: boolean;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function detectNationalPrefixForDisplay(rawDigits: string, internationalDigits: string, dialCode: string, hasExplicitInternationalPrefix: boolean): boolean;
|
|
9
|
+
export declare function normalizeInputValue(rawValue: string, country: CountryCode, options?: {
|
|
10
|
+
allowJustPlus?: boolean;
|
|
11
|
+
removeNationalPrefix?: boolean;
|
|
12
|
+
previousValue?: string;
|
|
13
|
+
}): string;
|
|
14
|
+
export declare function formatWithAsYouType(value: string, baseCountry: CountryCode): {
|
|
15
|
+
international: string;
|
|
16
|
+
national: string;
|
|
17
|
+
formatted: string;
|
|
18
|
+
phoneNumber: null;
|
|
19
|
+
detectedCountry: undefined;
|
|
20
|
+
inferredCountry: undefined;
|
|
21
|
+
hasExplicitInternationalPrefix: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
international: string;
|
|
24
|
+
national: string;
|
|
25
|
+
formatted: string;
|
|
26
|
+
phoneNumber: import("libphonenumber-js").PhoneNumber | undefined;
|
|
27
|
+
detectedCountry: CountryCode | undefined;
|
|
28
|
+
inferredCountry: CountryCode | undefined;
|
|
29
|
+
hasExplicitInternationalPrefix: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare function stripPrefix(value: string, prefix: string): string;
|
|
32
|
+
export declare function getLengthIssue(value: string, country: CountryCode | undefined): LengthIssue | null;
|
|
33
|
+
type SuggestionState = {
|
|
34
|
+
shouldSuggest: boolean;
|
|
35
|
+
query: string;
|
|
36
|
+
};
|
|
37
|
+
export declare function getSuggestionState(normalized: string, baseCountry: CountryCode, phoneNumber: ReturnType<AsYouType["getNumber"]>, options?: {
|
|
38
|
+
hasRemovedNationalPrefix?: boolean;
|
|
39
|
+
detectedCountry?: CountryCode;
|
|
40
|
+
hasExplicitInternationalPrefix?: boolean;
|
|
41
|
+
}): SuggestionState;
|
|
42
|
+
export declare function shouldDisplayExplicitCountrySelection(suggestion: SuggestionState, options: {
|
|
43
|
+
detectedCountry?: CountryCode;
|
|
44
|
+
hasExplicitInternationalPrefix?: boolean;
|
|
45
|
+
}): boolean;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=normalization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAoD,MAAM,mBAAmB,CAAA;AAU/F,MAAM,MAAM,WAAW,GAAG,UAAU,CAAA;AAEpC,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,UAE3C;AAqBD,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,UA+BlC;AA4ED,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,8BAA8B,EAAE,OAAO,WA4BxC;AAWD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAA;CAClB,UA+EP;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;;;;;;;;;;;;;;;;EAwC1E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAExD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAWlG;AAED,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,OAAO,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAC/C,OAAO,GAAE;IACP,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,eAAe,CAAC,EAAE,WAAW,CAAA;IAC7B,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACpC,GACL,eAAe,CAiDjB;AAED,wBAAgB,qCAAqC,CACnD,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE;IAAE,eAAe,CAAC,EAAE,WAAW,CAAC;IAAC,8BAA8B,CAAC,EAAE,OAAO,CAAA;CAAE,WAarF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function skipFormattingCharactersLeft(value: string, index: number): number;
|
|
2
|
+
export declare function skipFormattingCharactersRight(value: string, index: number): number;
|
|
3
|
+
type SelectionSnapshot = {
|
|
4
|
+
selectionStart: number;
|
|
5
|
+
selectionEnd: number;
|
|
6
|
+
startDigits: number;
|
|
7
|
+
endDigits: number;
|
|
8
|
+
preserveStartIndex: boolean;
|
|
9
|
+
preserveEndIndex: boolean;
|
|
10
|
+
wasAtStart: boolean;
|
|
11
|
+
wasAtEnd: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function captureSelectionSnapshot(input: HTMLInputElement): SelectionSnapshot;
|
|
14
|
+
export declare function resolveSelection(snapshot: SelectionSnapshot, value: string): {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/selection.ts"],"names":[],"mappings":"AA+CA,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAUxE;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAUzE;AAED,KAAK,iBAAiB,GAAG;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAiBnF;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM;;;EAyC1E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CountryCode } from "libphonenumber-js";
|
|
3
|
+
import type { ControlProps, OptionProps, StylesConfig } from "react-select";
|
|
4
|
+
import type { CountryOption } from "./types";
|
|
5
|
+
export type SuggestionContextValue = {
|
|
6
|
+
highlightedValue: CountryCode | null;
|
|
7
|
+
setHighlightedOption: (option: CountryOption) => void;
|
|
8
|
+
renderOptionLabel: (option: CountryOption) => React.ReactNode;
|
|
9
|
+
consumeScrollBehavior: () => ScrollBehavior;
|
|
10
|
+
};
|
|
11
|
+
export declare const SuggestionContext: React.Context<SuggestionContextValue | null>;
|
|
12
|
+
export declare const SuggestionOption: (props: OptionProps<CountryOption, false>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const suggestionSelectStyles: StylesConfig<CountryOption, false>;
|
|
14
|
+
export declare const HiddenControl: (props: ControlProps<CountryOption, false>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const NullComponent: () => null;
|
|
16
|
+
export declare function formatCountryOption(option: CountryOption): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=suggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/suggestions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,MAAM,MAAM,sBAAsB,GAAG;IACnC,gBAAgB,EAAE,WAAW,GAAG,IAAI,CAAA;IACpC,oBAAoB,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAA;IACrD,iBAAiB,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,CAAA;IAC7D,qBAAqB,EAAE,MAAM,cAAc,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,iBAAiB,8CAA2D,CAAA;AAEzF,eAAO,MAAM,gBAAgB,GAAI,OAAO,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,4CAyExE,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAoCrE,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,4CAEtE,CAAA;AAED,eAAO,MAAM,aAAa,YAAa,CAAA;AAEvC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,2CAcxD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { CountryCode } from "libphonenumber-js";
|
|
3
|
+
import type { Props as SelectProps } from "react-select";
|
|
4
|
+
export type PhoneNumberInputMessages = {
|
|
5
|
+
lengthTooLong: (countryName: string | null) => string;
|
|
6
|
+
noMatches: string;
|
|
7
|
+
selectCountryLabel: string;
|
|
8
|
+
selectedCountryLabel: (countryName: string | null) => string;
|
|
9
|
+
};
|
|
10
|
+
export type CountryOption = {
|
|
11
|
+
value: CountryCode;
|
|
12
|
+
name: string;
|
|
13
|
+
dialCode: string;
|
|
14
|
+
label: string;
|
|
15
|
+
flag: string;
|
|
16
|
+
searchableTokens: string[];
|
|
17
|
+
normalizedSearchableTokens: string[];
|
|
18
|
+
};
|
|
19
|
+
export type PhoneNumberSelectedCountry = {
|
|
20
|
+
code: CountryCode;
|
|
21
|
+
name: string;
|
|
22
|
+
dialCode: string;
|
|
23
|
+
flag: string;
|
|
24
|
+
};
|
|
25
|
+
export type PhoneNumberChangeDetails = {
|
|
26
|
+
formattedInternational: string;
|
|
27
|
+
formattedNational: string;
|
|
28
|
+
e164: string | null;
|
|
29
|
+
country: CountryCode;
|
|
30
|
+
countryCallingCode: string;
|
|
31
|
+
nationalNumber: string;
|
|
32
|
+
rawInput: string;
|
|
33
|
+
isValid: boolean;
|
|
34
|
+
selectedCountry: PhoneNumberSelectedCountry;
|
|
35
|
+
};
|
|
36
|
+
export type PhoneNumberInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> & {
|
|
37
|
+
value?: string;
|
|
38
|
+
defaultCountry?: CountryCode;
|
|
39
|
+
country?: CountryCode;
|
|
40
|
+
locale?: string | string[];
|
|
41
|
+
onChange?: (details: PhoneNumberChangeDetails) => void;
|
|
42
|
+
onCountryChange?: (country: CountryCode, selection: PhoneNumberSelectedCountry) => void;
|
|
43
|
+
className?: string;
|
|
44
|
+
inputClassName?: string;
|
|
45
|
+
selectProps?: Partial<SelectProps<CountryOption, false>>;
|
|
46
|
+
autofillShimName?: string;
|
|
47
|
+
messages?: Partial<PhoneNumberInputMessages>;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/PhoneNumberInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,cAAc,CAAA;AAGxD,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;IACrD,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;CAC7D,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,WAAW,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,WAAW,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,iBAAiB,EAAE,MAAM,CAAA;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,OAAO,EAAE,WAAW,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,eAAe,EAAE,0BAA0B,CAAA;CAC5C,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,OAAO,GAAG,cAAc,GAAG,UAAU,CACtC,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,CAAA;IACtD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,0BAA0B,KAAK,IAAI,CAAA;IACvF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAA;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAA;CAC7C,CAAA"}
|