@m4l/gclick 0.36.0 → 0.36.1-beta-feature-795-m4l-react-native-ui-indicator-flag.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/@types/types.d.ts +8 -0
- package/components/PhoneNumberField/PhoneNumberField.d.ts +4 -0
- package/components/PhoneNumberField/PhoneNumberField.d.ts.map +1 -0
- package/components/PhoneNumberField/PhoneNumberField.js +99 -0
- package/components/PhoneNumberField/index.d.ts +3 -0
- package/components/PhoneNumberField/index.d.ts.map +1 -0
- package/components/PhoneNumberField/phoneNumber.d.ts +5 -0
- package/components/PhoneNumberField/phoneNumber.d.ts.map +1 -0
- package/components/PhoneNumberField/phoneNumber.js +12 -0
- package/components/PhoneNumberField/types.d.ts +30 -0
- package/components/PhoneNumberField/types.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.d.ts +5 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.js +81 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.slots.d.ts +5 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.slots.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/RHFPhoneNumberField.slots.js +13 -0
- package/components/RHFs/RHFPhoneNumberField/index.d.ts +3 -0
- package/components/RHFs/RHFPhoneNumberField/index.d.ts.map +1 -0
- package/components/RHFs/RHFPhoneNumberField/types.d.ts +13 -0
- package/components/RHFs/RHFPhoneNumberField/types.d.ts.map +1 -0
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -1
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.d.ts +4 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.js +249 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.slots.d.ts +40 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.slots.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.slots.js +21 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.styles.d.ts +4 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.styles.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.styles.js +175 -0
- package/components/indicators/IndicatorCountryPhone/constants.d.ts +9 -0
- package/components/indicators/IndicatorCountryPhone/constants.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/constants.js +11 -0
- package/components/indicators/IndicatorCountryPhone/countryFlags.generated.d.ts +3 -0
- package/components/indicators/IndicatorCountryPhone/countryFlags.generated.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/countryFlags.generated.js +251 -0
- package/components/indicators/IndicatorCountryPhone/countryOptions.d.ts +6 -0
- package/components/indicators/IndicatorCountryPhone/countryOptions.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/countryOptions.js +31 -0
- package/components/indicators/IndicatorCountryPhone/dictionary.d.ts +15 -0
- package/components/indicators/IndicatorCountryPhone/dictionary.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/dictionary.js +21 -0
- package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/index.d.ts +3 -0
- package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/index.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/types.d.ts +19 -0
- package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/types.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/useCountryPhoneCatalog.d.ts +12 -0
- package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/useCountryPhoneCatalog.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/useCountryPhoneCatalog.js +146 -0
- package/components/indicators/IndicatorCountryPhone/index.d.ts +4 -0
- package/components/indicators/IndicatorCountryPhone/index.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/slots.d.ts +16 -0
- package/components/indicators/IndicatorCountryPhone/slots.d.ts.map +1 -0
- package/components/indicators/IndicatorCountryPhone/slots.js +4 -0
- package/components/indicators/IndicatorCountryPhone/types.d.ts +88 -0
- package/components/indicators/IndicatorCountryPhone/types.d.ts.map +1 -0
- package/components/indicators/index.d.ts +1 -0
- package/components/indicators/index.d.ts.map +1 -1
- package/index.js +248 -240
- package/package.json +3 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const TriggerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof import('react').ClassAttributes<HTMLButtonElement> | keyof import('react').ButtonHTMLAttributes<HTMLButtonElement>>, {}>;
|
|
7
|
+
export declare const ChipStyled: import('@emotion/styled').StyledComponent<Pick<import('@m4l/components').ChipProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('@m4l/components').ChipProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
8
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const PopoverStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
11
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
12
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
13
|
+
export declare const MenuStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
14
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
15
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
16
|
+
export declare const MenuItemStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
17
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
18
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof import('react').ClassAttributes<HTMLButtonElement> | keyof import('react').ButtonHTMLAttributes<HTMLButtonElement>>, {}>;
|
|
19
|
+
export declare const FlagStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
20
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
21
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
22
|
+
export declare const CodeStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
23
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
24
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
25
|
+
export declare const CodeInputStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
26
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
27
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof import('react').ClassAttributes<HTMLInputElement> | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, {}>;
|
|
28
|
+
export declare const EmptyStateStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
29
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
30
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
31
|
+
export declare const SkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../../../../dist/packages/@m4l/components/components/extended/mui/Skeleton/types').SkeletonProps, keyof import('../../../../../../dist/packages/@m4l/components/components/extended/mui/Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
32
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
33
|
+
}, {}, {}>;
|
|
34
|
+
export declare const StatusButtonStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
35
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
36
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof import('react').ClassAttributes<HTMLButtonElement> | keyof import('react').ButtonHTMLAttributes<HTMLButtonElement>>, {}>;
|
|
37
|
+
export declare const VirtualItemsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
38
|
+
ownerState?: (Partial<import('./types').IndicatorCountryPhoneOwnerState> & Record<string, unknown>) | undefined;
|
|
39
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
40
|
+
//# sourceMappingURL=IndicatorCountryPhone.slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorCountryPhone.slots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.slots.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU;;6NAAqH,CAAC;AAC7I,eAAO,MAAM,aAAa;;qPAA8H,CAAC;AACzJ,eAAO,MAAM,UAAU;;UAAoH,CAAC;AAC5I,eAAO,MAAM,aAAa;;6NAA2H,CAAC;AACtJ,eAAO,MAAM,UAAU;;6NAAqH,CAAC;AAC7I,eAAO,MAAM,cAAc;;qPAAgI,CAAC;AAC5J,eAAO,MAAM,UAAU;;iOAAsH,CAAC;AAC9I,eAAO,MAAM,UAAU;;iOAAsH,CAAC;AAC9I,eAAO,MAAM,eAAe;;+OAAiI,CAAC;AAC9J,eAAO,MAAM,gBAAgB;;iOAAkI,CAAC;AAChK,eAAO,MAAM,cAAc;;UAAgI,CAAC;AAC5J,eAAO,MAAM,kBAAkB;;qPAAwI,CAAC;AACxK,eAAO,MAAM,kBAAkB;;6NAAqI,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Skeleton as s, Chip as l } from "@m4l/components";
|
|
2
|
+
import { styled as t } from "@mui/material/styles";
|
|
3
|
+
import { INDICATOR_COUNTRY_PHONE_COMPONENT_KEY as o } from "./constants.js";
|
|
4
|
+
import { indicatorCountryPhoneStyles as e } from "./IndicatorCountryPhone.styles.js";
|
|
5
|
+
import { IndicatorCountryPhoneSlots as n } from "./slots.js";
|
|
6
|
+
const u = t("div", { name: o, slot: n.root })(e.root), i = t("button", { name: o, slot: n.trigger })(e.trigger), c = t(l, { name: o, slot: n.chip })(e.chip), S = t("div", { name: o, slot: n.popover })(e.popover), y = t("div", { name: o, slot: n.menu })(e.menu), I = t("button", { name: o, slot: n.menuItem })(e.menuItem), g = t("span", { name: o, slot: n.flag })(e.flag), v = t("span", { name: o, slot: n.code })(e.code), C = t("input", { name: o, slot: n.codeInput })(e.codeInput), f = t("span", { name: o, slot: n.emptyState })(e.emptyState), h = t(s, { name: o, slot: n.skeleton })(e.skeleton), N = t("button", { name: o, slot: n.statusButton })(e.statusButton), O = t("div", { name: o, slot: n.virtualItems })(e.virtualItems);
|
|
7
|
+
export {
|
|
8
|
+
c as ChipStyled,
|
|
9
|
+
C as CodeInputStyled,
|
|
10
|
+
v as CodeStyled,
|
|
11
|
+
f as EmptyStateStyled,
|
|
12
|
+
g as FlagStyled,
|
|
13
|
+
I as MenuItemStyled,
|
|
14
|
+
y as MenuStyled,
|
|
15
|
+
S as PopoverStyled,
|
|
16
|
+
u as RootStyled,
|
|
17
|
+
h as SkeletonStyled,
|
|
18
|
+
N as StatusButtonStyled,
|
|
19
|
+
i as TriggerStyled,
|
|
20
|
+
O as VirtualItemsStyled
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorCountryPhone.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/IndicatorCountryPhone.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,yEAAyE;AACzE,eAAO,MAAM,2BAA2B,EAAE,2BA2KzC,CAAC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
/** Keep the chip and popover in one positioning context. */
|
|
3
|
+
root: () => ({
|
|
4
|
+
display: "inline-flex",
|
|
5
|
+
position: "relative",
|
|
6
|
+
verticalAlign: "middle"
|
|
7
|
+
}),
|
|
8
|
+
/** Reset native button chrome while preserving keyboard focus. */
|
|
9
|
+
trigger: () => ({
|
|
10
|
+
appearance: "none",
|
|
11
|
+
display: "inline-flex",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
width: 16,
|
|
15
|
+
height: 16,
|
|
16
|
+
padding: 0,
|
|
17
|
+
border: 0,
|
|
18
|
+
background: "transparent",
|
|
19
|
+
cursor: "pointer",
|
|
20
|
+
"&:focus-visible": { outline: "2px solid currentColor", outlineOffset: 2 },
|
|
21
|
+
"&:disabled": { cursor: "default" }
|
|
22
|
+
}),
|
|
23
|
+
/** Give the 16 px flag breathing room inside the compact Chip variant. */
|
|
24
|
+
chip: ({ theme: e }) => ({
|
|
25
|
+
"&&": {
|
|
26
|
+
minWidth: 49,
|
|
27
|
+
width: "fit-content",
|
|
28
|
+
height: 20,
|
|
29
|
+
minHeight: 20,
|
|
30
|
+
maxHeight: 20,
|
|
31
|
+
padding: e.vars.size.baseSpacings["sp0-5"],
|
|
32
|
+
gap: e.vars.size.baseSpacings.sp1,
|
|
33
|
+
borderRadius: e.vars.size.borderRadius.r1,
|
|
34
|
+
borderRight: `1px solid ${e.vars.palette.border.secondary}`,
|
|
35
|
+
backgroundColor: e.vars.palette.background.default,
|
|
36
|
+
boxShadow: `0 2px 2px ${e.vars.palette.background.surface}`,
|
|
37
|
+
cursor: "inherit"
|
|
38
|
+
},
|
|
39
|
+
"&&& .M4LTypography-root": {
|
|
40
|
+
paddingLeft: 0,
|
|
41
|
+
paddingRight: 0,
|
|
42
|
+
color: e.vars.palette.text.primary,
|
|
43
|
+
fontSize: 11,
|
|
44
|
+
fontWeight: 500,
|
|
45
|
+
letterSpacing: "0.3px",
|
|
46
|
+
lineHeight: "16px"
|
|
47
|
+
},
|
|
48
|
+
"& svg": { width: 16, height: 16, flexShrink: 0 }
|
|
49
|
+
}),
|
|
50
|
+
/** Position the option panel below the selected country. */
|
|
51
|
+
popover: ({ theme: e }) => ({
|
|
52
|
+
position: "absolute",
|
|
53
|
+
left: 0,
|
|
54
|
+
top: `calc(100% + ${e.vars.size.baseSpacings["sp0-5"]})`,
|
|
55
|
+
zIndex: 1,
|
|
56
|
+
width: "max-content",
|
|
57
|
+
minWidth: 83,
|
|
58
|
+
'&[data-scrollable="true"]': { minWidth: 100 },
|
|
59
|
+
padding: e.vars.size.baseSpacings.sp3,
|
|
60
|
+
borderRadius: e.vars.size.borderRadius.r3,
|
|
61
|
+
backgroundColor: e.vars.palette.background.default,
|
|
62
|
+
boxShadow: e.vars.customShadows.z4
|
|
63
|
+
}),
|
|
64
|
+
/** Scroll through a bounded viewport while only mounting visible rows. */
|
|
65
|
+
menu: ({ ownerState: e }) => ({
|
|
66
|
+
position: "relative",
|
|
67
|
+
height: e?.viewportHeight ?? 0,
|
|
68
|
+
overflowY: "auto",
|
|
69
|
+
overflowX: "hidden",
|
|
70
|
+
padding: 0,
|
|
71
|
+
outline: 0,
|
|
72
|
+
'&[data-scrollable="true"]': { scrollbarGutter: "stable" }
|
|
73
|
+
}),
|
|
74
|
+
/** Give each country the dimensions and padding from Figma. */
|
|
75
|
+
menuItem: ({ theme: e, ownerState: i }) => ({
|
|
76
|
+
"&&": {
|
|
77
|
+
display: "flex",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
gap: e.vars.size.baseSpacings.sp1,
|
|
80
|
+
position: "absolute",
|
|
81
|
+
top: i?.rowTop ?? 0,
|
|
82
|
+
left: 0,
|
|
83
|
+
width: "100%",
|
|
84
|
+
minWidth: 59,
|
|
85
|
+
height: 28,
|
|
86
|
+
minHeight: 28,
|
|
87
|
+
padding: `${e.vars.size.baseSpacings["sp1-5"]} ${e.vars.size.baseSpacings.sp2}`,
|
|
88
|
+
border: 0,
|
|
89
|
+
borderRadius: e.vars.size.borderRadius["r1-5"],
|
|
90
|
+
background: "transparent",
|
|
91
|
+
cursor: "pointer",
|
|
92
|
+
'&:hover, &:focus-visible, &[data-active="true"]': {
|
|
93
|
+
backgroundColor: e.vars.palette.background.surface
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
/** Clip each country flag to the rounded 16 px icon slot from Figma. */
|
|
98
|
+
flag: ({ theme: e }) => ({
|
|
99
|
+
display: "inline-flex",
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: "center",
|
|
102
|
+
width: 16,
|
|
103
|
+
height: 16,
|
|
104
|
+
flexShrink: 0,
|
|
105
|
+
borderRadius: e.vars.size.borderRadius.r1,
|
|
106
|
+
overflow: "hidden",
|
|
107
|
+
color: e.vars.palette.text.secondary,
|
|
108
|
+
fontSize: 7,
|
|
109
|
+
fontWeight: 600,
|
|
110
|
+
"& svg": { width: 16, height: 16 }
|
|
111
|
+
}),
|
|
112
|
+
/** Set the phone prefix in the compact body typography. */
|
|
113
|
+
code: ({ theme: e }) => ({
|
|
114
|
+
color: e.vars.palette.text.primary,
|
|
115
|
+
fontSize: 11,
|
|
116
|
+
fontWeight: 500,
|
|
117
|
+
letterSpacing: "0.3px",
|
|
118
|
+
lineHeight: 1,
|
|
119
|
+
whiteSpace: "nowrap"
|
|
120
|
+
}),
|
|
121
|
+
/** Keep the selected prefix editable without changing the compact chip layout. */
|
|
122
|
+
codeInput: ({ theme: e, ownerState: i }) => ({
|
|
123
|
+
width: `calc(${typeof i?.codeLength == "number" ? i.codeLength : 3}ch + ${e.vars.size.baseSpacings["sp0-5"]})`,
|
|
124
|
+
minWidth: "3ch",
|
|
125
|
+
padding: 0,
|
|
126
|
+
border: 0,
|
|
127
|
+
outline: 0,
|
|
128
|
+
background: "transparent",
|
|
129
|
+
color: e.vars.palette.text.primary,
|
|
130
|
+
font: "inherit",
|
|
131
|
+
fontSize: 11,
|
|
132
|
+
fontWeight: 500,
|
|
133
|
+
letterSpacing: "0.3px",
|
|
134
|
+
lineHeight: "16px",
|
|
135
|
+
textAlign: "left",
|
|
136
|
+
"&:disabled": { color: e.vars.palette.text.disabled, cursor: "default" }
|
|
137
|
+
}),
|
|
138
|
+
/** Explain why a typed prefix has no options to select. */
|
|
139
|
+
emptyState: ({ theme: e }) => ({
|
|
140
|
+
display: "block",
|
|
141
|
+
padding: e.vars.size.baseSpacings.sp1,
|
|
142
|
+
color: e.vars.palette.text.secondary,
|
|
143
|
+
fontSize: 11,
|
|
144
|
+
whiteSpace: "nowrap"
|
|
145
|
+
}),
|
|
146
|
+
/** Preserve the compact trigger geometry while the catalog is loading. */
|
|
147
|
+
skeleton: () => ({
|
|
148
|
+
width: 49,
|
|
149
|
+
height: 20,
|
|
150
|
+
flexShrink: 0
|
|
151
|
+
}),
|
|
152
|
+
/** Render retry and empty states inside the same compact footprint. */
|
|
153
|
+
statusButton: ({ theme: e }) => ({
|
|
154
|
+
width: 49,
|
|
155
|
+
minWidth: 49,
|
|
156
|
+
height: 20,
|
|
157
|
+
padding: 0,
|
|
158
|
+
border: `1px solid ${e.vars.palette.border.secondary}`,
|
|
159
|
+
borderRadius: e.vars.size.borderRadius.r1,
|
|
160
|
+
backgroundColor: e.vars.palette.background.default,
|
|
161
|
+
color: e.vars.palette.text.secondary,
|
|
162
|
+
fontSize: 10,
|
|
163
|
+
cursor: "pointer",
|
|
164
|
+
"&:disabled": { cursor: "default" },
|
|
165
|
+
"&:focus-visible": { outline: "2px solid currentColor", outlineOffset: 2 }
|
|
166
|
+
}),
|
|
167
|
+
/** Own the measured virtual-list height without render-time inline styles. */
|
|
168
|
+
virtualItems: ({ ownerState: e }) => ({
|
|
169
|
+
position: "relative",
|
|
170
|
+
height: e?.totalHeight ?? 0
|
|
171
|
+
})
|
|
172
|
+
};
|
|
173
|
+
export {
|
|
174
|
+
t as indicatorCountryPhoneStyles
|
|
175
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const INDICATOR_COUNTRY_PHONE_COMPONENT_KEY = "M4LIndicatorCountryPhone";
|
|
2
|
+
export declare const INDICATOR_COUNTRY_PHONE_ROW_HEIGHT = 32;
|
|
3
|
+
export declare const INDICATOR_COUNTRY_PHONE_ROW_GAP = 4;
|
|
4
|
+
export declare const INDICATOR_COUNTRY_PHONE_VISIBLE_ROWS = 7;
|
|
5
|
+
export declare const INDICATOR_COUNTRY_PHONE_ENDPOINT = "countries";
|
|
6
|
+
export declare const INDICATOR_COUNTRY_PHONE_PAGE_LIMIT = 100;
|
|
7
|
+
export declare const INDICATOR_COUNTRY_PHONE_STALE_TIME: number;
|
|
8
|
+
export declare const INDICATOR_COUNTRY_PHONE_DEFAULT_VALUE = "es";
|
|
9
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,6BAA6B,CAAC;AAChF,eAAO,MAAM,kCAAkC,KAAK,CAAC;AACrD,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,eAAO,MAAM,oCAAoC,IAAI,CAAC;AACtD,eAAO,MAAM,gCAAgC,cAAc,CAAC;AAC5D,eAAO,MAAM,kCAAkC,MAAM,CAAC;AACtD,eAAO,MAAM,kCAAkC,QAAgB,CAAC;AAChE,eAAO,MAAM,qCAAqC,OAAO,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const _ = "M4LIndicatorCountryPhone", O = 32, N = 4, I = 7, T = "countries", R = 100, C = 3e5, E = "es";
|
|
2
|
+
export {
|
|
3
|
+
_ as INDICATOR_COUNTRY_PHONE_COMPONENT_KEY,
|
|
4
|
+
E as INDICATOR_COUNTRY_PHONE_DEFAULT_VALUE,
|
|
5
|
+
T as INDICATOR_COUNTRY_PHONE_ENDPOINT,
|
|
6
|
+
R as INDICATOR_COUNTRY_PHONE_PAGE_LIMIT,
|
|
7
|
+
N as INDICATOR_COUNTRY_PHONE_ROW_GAP,
|
|
8
|
+
O as INDICATOR_COUNTRY_PHONE_ROW_HEIGHT,
|
|
9
|
+
C as INDICATOR_COUNTRY_PHONE_STALE_TIME,
|
|
10
|
+
I as INDICATOR_COUNTRY_PHONE_VISIBLE_ROWS
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countryFlags.generated.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/countryFlags.generated.tsx"],"names":[],"mappings":"AAyPA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAsP7E,CAAC"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { FlagZwFill as l, FlagZmFill as F, FlagZaFill as g, FlagYtFill as a, FlagYeFill as i, FlagXkFill as m, FlagWsFill as s, FlagWfFill as t, FlagVuFill as c, FlagVnFill as e, FlagViFill as r, FlagVgFill as n, FlagVeFill as k, FlagVcFill as o, FlagVaFill as b, FlagUzFill as p, FlagUyFill as f, FlagUsFill as h, FlagUgFill as u, FlagUaFill as z, FlagTzFill as M, FlagTwFill as d, FlagTvFill as w, FlagTtFill as S, FlagTrFill as y, FlagToFill as B, FlagTnFill as C, FlagTmFill as G, FlagTlFill as v, FlagTkFill as A, FlagTjFill as T, FlagThFill as j, FlagTgFill as N, FlagTdFill as P, FlagTcFill as L, FlagTaFill as K, FlagSzFill as x, FlagSyFill as I, FlagSxFill as q, FlagSvFill as E, FlagStFill as V, FlagSsFill as D, FlagSrFill as R, FlagSoFill as U, FlagSnFill as H, FlagSmFill as J, FlagSlFill as Y, FlagSkFill as Z, FlagSjFill as O, FlagSiFill as W, FlagShFill as Q, FlagSgFill as X, FlagSeFill as _, FlagSdFill as $, FlagScFill as ll, FlagSbFill as Fl, FlagSaFill as gl, FlagRwFill as al, FlagRuFill as il, FlagRsFill as ml, FlagRoFill as sl, FlagReFill as tl, FlagQaFill as cl, FlagPyFill as el, FlagPwFill as rl, FlagPtFill as nl, FlagPsFill as kl, FlagPrFill as ol, FlagPmFill as bl, FlagPlFill as pl, FlagPkFill as fl, FlagPhFill as hl, FlagPgFill as ul, FlagPfFill as zl, FlagPeFill as Ml, FlagPaFill as dl, FlagOmFill as wl, FlagNzFill as Sl, FlagNuFill as yl, FlagNrFill as Bl, FlagNpFill as Cl, FlagNoFill as Gl, FlagNlFill as vl, FlagNiFill as Al, FlagNgFill as Tl, FlagNfFill as jl, FlagNeFill as Nl, FlagNcFill as Pl, FlagNaFill as Ll, FlagMzFill as Kl, FlagMyFill as xl, FlagMxFill as Il, FlagMwFill as ql, FlagMvFill as El, FlagMuFill as Vl, FlagMtFill as Dl, FlagMsFill as Rl, FlagMrFill as Ul, FlagMqFill as Hl, FlagMpFill as Jl, FlagMoFill as Yl, FlagMnFill as Zl, FlagMmFill as Ol, FlagMlFill as Wl, FlagMkFill as Ql, FlagMhFill as Xl, FlagMgFill as _l, FlagMfFill as $l, FlagMeFill as lF, FlagMdFill as FF, FlagMcFill as gF, FlagMaFill as aF, FlagLyFill as iF, FlagLvFill as mF, FlagLuFill as sF, FlagLtFill as tF, FlagLsFill as cF, FlagLrFill as eF, FlagLkFill as rF, FlagLiFill as nF, FlagLcFill as kF, FlagLbFill as oF, FlagLaFill as bF, FlagKzFill as pF, FlagKyFill as fF, FlagKwFill as hF, FlagKrFill as uF, FlagKpFill as zF, FlagKnFill as MF, FlagKmFill as dF, FlagKiFill as wF, FlagKhFill as SF, FlagKgFill as yF, FlagKeFill as BF, FlagJpFill as CF, FlagJoFill as GF, FlagJmFill as vF, FlagJeFill as AF, FlagItFill as TF, FlagIsFill as jF, FlagIrFill as NF, FlagIqFill as PF, FlagIoFill as LF, FlagInFill as KF, FlagImFill as xF, FlagIlFill as IF, FlagIeFill as qF, FlagIdFill as EF, FlagHuFill as VF, FlagHtFill as DF, FlagHrFill as RF, FlagHnFill as UF, FlagHkFill as HF, FlagGyFill as JF, FlagGwFill as YF, FlagGuFill as ZF, FlagGtFill as OF, FlagGrFill as WF, FlagGqFill as QF, FlagGpFill as XF, FlagGnFill as _F, FlagGmFill as $F, FlagGlFill as lg, FlagGiFill as Fg, FlagGhFill as gg, FlagGgFill as ag, FlagGfFill as ig, FlagGeFill as mg, FlagGdFill as sg, FlagGbFill as tg, FlagGaFill as cg, FlagFrFill as eg, FlagFoFill as rg, FlagFmFill as ng, FlagFkFill as kg, FlagFjFill as og, FlagFiFill as bg, FlagEtFill as pg, FlagEsFill as fg, FlagErFill as hg, FlagEhFill as ug, FlagEgFill as zg, FlagEeFill as Mg, FlagEcFill as dg, FlagDzFill as wg, FlagDoFill as Sg, FlagDmFill as yg, FlagDkFill as Bg, FlagDjFill as Cg, FlagDeFill as Gg, FlagCzFill as vg, FlagCyFill as Ag, FlagCxFill as Tg, FlagCwFill as jg, FlagCvFill as Ng, FlagCuFill as Pg, FlagCrFill as Lg, FlagCoFill as Kg, FlagCnFill as xg, FlagCmFill as Ig, FlagClFill as qg, FlagCkFill as Eg, FlagCiFill as Vg, FlagChFill as Dg, FlagCgFill as Rg, FlagCfFill as Ug, FlagCdFill as Hg, FlagCcFill as Jg, FlagCaFill as Yg, FlagBzFill as Zg, FlagByFill as Og, FlagBwFill as Wg, FlagBtFill as Qg, FlagBsFill as Xg, FlagBrFill as _g, FlagBqFill as $g, FlagBoFill as la, FlagBnFill as Fa, FlagBmFill as ga, FlagBlFill as aa, FlagBjFill as ia, FlagBiFill as ma, FlagBhFill as sa, FlagBgFill as ta, FlagBfFill as ca, FlagBeFill as ea, FlagBdFill as ra, FlagBbFill as na, FlagBaFill as ka, FlagAzFill as oa, FlagAxFill as ba, FlagAwFill as pa, FlagAuFill as fa, FlagAtFill as ha, FlagAsFill as ua, FlagArFill as za, FlagAoFill as Ma, FlagAmFill as da, FlagAlFill as wa, FlagAiFill as Sa, FlagAgFill as ya, FlagAfFill as Ba, FlagAeFill as Ca, FlagAdFill as Ga, FlagAcFill as va } from "@m4l/icons";
|
|
2
|
+
const Ta = {
|
|
3
|
+
ac: va,
|
|
4
|
+
ad: Ga,
|
|
5
|
+
ae: Ca,
|
|
6
|
+
af: Ba,
|
|
7
|
+
ag: ya,
|
|
8
|
+
ai: Sa,
|
|
9
|
+
al: wa,
|
|
10
|
+
am: da,
|
|
11
|
+
ao: Ma,
|
|
12
|
+
ar: za,
|
|
13
|
+
as: ua,
|
|
14
|
+
at: ha,
|
|
15
|
+
au: fa,
|
|
16
|
+
aw: pa,
|
|
17
|
+
ax: ba,
|
|
18
|
+
az: oa,
|
|
19
|
+
ba: ka,
|
|
20
|
+
bb: na,
|
|
21
|
+
bd: ra,
|
|
22
|
+
be: ea,
|
|
23
|
+
bf: ca,
|
|
24
|
+
bg: ta,
|
|
25
|
+
bh: sa,
|
|
26
|
+
bi: ma,
|
|
27
|
+
bj: ia,
|
|
28
|
+
bl: aa,
|
|
29
|
+
bm: ga,
|
|
30
|
+
bn: Fa,
|
|
31
|
+
bo: la,
|
|
32
|
+
bq: $g,
|
|
33
|
+
br: _g,
|
|
34
|
+
bs: Xg,
|
|
35
|
+
bt: Qg,
|
|
36
|
+
bw: Wg,
|
|
37
|
+
by: Og,
|
|
38
|
+
bz: Zg,
|
|
39
|
+
ca: Yg,
|
|
40
|
+
cc: Jg,
|
|
41
|
+
cd: Hg,
|
|
42
|
+
cf: Ug,
|
|
43
|
+
cg: Rg,
|
|
44
|
+
ch: Dg,
|
|
45
|
+
ci: Vg,
|
|
46
|
+
ck: Eg,
|
|
47
|
+
cl: qg,
|
|
48
|
+
cm: Ig,
|
|
49
|
+
cn: xg,
|
|
50
|
+
co: Kg,
|
|
51
|
+
cr: Lg,
|
|
52
|
+
cu: Pg,
|
|
53
|
+
cv: Ng,
|
|
54
|
+
cw: jg,
|
|
55
|
+
cx: Tg,
|
|
56
|
+
cy: Ag,
|
|
57
|
+
cz: vg,
|
|
58
|
+
de: Gg,
|
|
59
|
+
dj: Cg,
|
|
60
|
+
dk: Bg,
|
|
61
|
+
dm: yg,
|
|
62
|
+
do: Sg,
|
|
63
|
+
dz: wg,
|
|
64
|
+
ec: dg,
|
|
65
|
+
ee: Mg,
|
|
66
|
+
eg: zg,
|
|
67
|
+
eh: ug,
|
|
68
|
+
er: hg,
|
|
69
|
+
es: fg,
|
|
70
|
+
et: pg,
|
|
71
|
+
fi: bg,
|
|
72
|
+
fj: og,
|
|
73
|
+
fk: kg,
|
|
74
|
+
fm: ng,
|
|
75
|
+
fo: rg,
|
|
76
|
+
fr: eg,
|
|
77
|
+
ga: cg,
|
|
78
|
+
gb: tg,
|
|
79
|
+
gd: sg,
|
|
80
|
+
ge: mg,
|
|
81
|
+
gf: ig,
|
|
82
|
+
gg: ag,
|
|
83
|
+
gh: gg,
|
|
84
|
+
gi: Fg,
|
|
85
|
+
gl: lg,
|
|
86
|
+
gm: $F,
|
|
87
|
+
gn: _F,
|
|
88
|
+
gp: XF,
|
|
89
|
+
gq: QF,
|
|
90
|
+
gr: WF,
|
|
91
|
+
gt: OF,
|
|
92
|
+
gu: ZF,
|
|
93
|
+
gw: YF,
|
|
94
|
+
gy: JF,
|
|
95
|
+
hk: HF,
|
|
96
|
+
hn: UF,
|
|
97
|
+
hr: RF,
|
|
98
|
+
ht: DF,
|
|
99
|
+
hu: VF,
|
|
100
|
+
id: EF,
|
|
101
|
+
ie: qF,
|
|
102
|
+
il: IF,
|
|
103
|
+
im: xF,
|
|
104
|
+
in: KF,
|
|
105
|
+
io: LF,
|
|
106
|
+
iq: PF,
|
|
107
|
+
ir: NF,
|
|
108
|
+
is: jF,
|
|
109
|
+
it: TF,
|
|
110
|
+
je: AF,
|
|
111
|
+
jm: vF,
|
|
112
|
+
jo: GF,
|
|
113
|
+
jp: CF,
|
|
114
|
+
ke: BF,
|
|
115
|
+
kg: yF,
|
|
116
|
+
kh: SF,
|
|
117
|
+
ki: wF,
|
|
118
|
+
km: dF,
|
|
119
|
+
kn: MF,
|
|
120
|
+
kp: zF,
|
|
121
|
+
kr: uF,
|
|
122
|
+
kw: hF,
|
|
123
|
+
ky: fF,
|
|
124
|
+
kz: pF,
|
|
125
|
+
la: bF,
|
|
126
|
+
lb: oF,
|
|
127
|
+
lc: kF,
|
|
128
|
+
li: nF,
|
|
129
|
+
lk: rF,
|
|
130
|
+
lr: eF,
|
|
131
|
+
ls: cF,
|
|
132
|
+
lt: tF,
|
|
133
|
+
lu: sF,
|
|
134
|
+
lv: mF,
|
|
135
|
+
ly: iF,
|
|
136
|
+
ma: aF,
|
|
137
|
+
mc: gF,
|
|
138
|
+
md: FF,
|
|
139
|
+
me: lF,
|
|
140
|
+
mf: $l,
|
|
141
|
+
mg: _l,
|
|
142
|
+
mh: Xl,
|
|
143
|
+
mk: Ql,
|
|
144
|
+
ml: Wl,
|
|
145
|
+
mm: Ol,
|
|
146
|
+
mn: Zl,
|
|
147
|
+
mo: Yl,
|
|
148
|
+
mp: Jl,
|
|
149
|
+
mq: Hl,
|
|
150
|
+
mr: Ul,
|
|
151
|
+
ms: Rl,
|
|
152
|
+
mt: Dl,
|
|
153
|
+
mu: Vl,
|
|
154
|
+
mv: El,
|
|
155
|
+
mw: ql,
|
|
156
|
+
mx: Il,
|
|
157
|
+
my: xl,
|
|
158
|
+
mz: Kl,
|
|
159
|
+
na: Ll,
|
|
160
|
+
nc: Pl,
|
|
161
|
+
ne: Nl,
|
|
162
|
+
nf: jl,
|
|
163
|
+
ng: Tl,
|
|
164
|
+
ni: Al,
|
|
165
|
+
nl: vl,
|
|
166
|
+
no: Gl,
|
|
167
|
+
np: Cl,
|
|
168
|
+
nr: Bl,
|
|
169
|
+
nu: yl,
|
|
170
|
+
nz: Sl,
|
|
171
|
+
om: wl,
|
|
172
|
+
pa: dl,
|
|
173
|
+
pe: Ml,
|
|
174
|
+
pf: zl,
|
|
175
|
+
pg: ul,
|
|
176
|
+
ph: hl,
|
|
177
|
+
pk: fl,
|
|
178
|
+
pl,
|
|
179
|
+
pm: bl,
|
|
180
|
+
pr: ol,
|
|
181
|
+
ps: kl,
|
|
182
|
+
pt: nl,
|
|
183
|
+
pw: rl,
|
|
184
|
+
py: el,
|
|
185
|
+
qa: cl,
|
|
186
|
+
re: tl,
|
|
187
|
+
ro: sl,
|
|
188
|
+
rs: ml,
|
|
189
|
+
ru: il,
|
|
190
|
+
rw: al,
|
|
191
|
+
sa: gl,
|
|
192
|
+
sb: Fl,
|
|
193
|
+
sc: ll,
|
|
194
|
+
sd: $,
|
|
195
|
+
se: _,
|
|
196
|
+
sg: X,
|
|
197
|
+
sh: Q,
|
|
198
|
+
si: W,
|
|
199
|
+
sj: O,
|
|
200
|
+
sk: Z,
|
|
201
|
+
sl: Y,
|
|
202
|
+
sm: J,
|
|
203
|
+
sn: H,
|
|
204
|
+
so: U,
|
|
205
|
+
sr: R,
|
|
206
|
+
ss: D,
|
|
207
|
+
st: V,
|
|
208
|
+
sv: E,
|
|
209
|
+
sx: q,
|
|
210
|
+
sy: I,
|
|
211
|
+
sz: x,
|
|
212
|
+
ta: K,
|
|
213
|
+
tc: L,
|
|
214
|
+
td: P,
|
|
215
|
+
tg: N,
|
|
216
|
+
th: j,
|
|
217
|
+
tj: T,
|
|
218
|
+
tk: A,
|
|
219
|
+
tl: v,
|
|
220
|
+
tm: G,
|
|
221
|
+
tn: C,
|
|
222
|
+
to: B,
|
|
223
|
+
tr: y,
|
|
224
|
+
tt: S,
|
|
225
|
+
tv: w,
|
|
226
|
+
tw: d,
|
|
227
|
+
tz: M,
|
|
228
|
+
ua: z,
|
|
229
|
+
ug: u,
|
|
230
|
+
us: h,
|
|
231
|
+
uy: f,
|
|
232
|
+
uz: p,
|
|
233
|
+
va: b,
|
|
234
|
+
vc: o,
|
|
235
|
+
ve: k,
|
|
236
|
+
vg: n,
|
|
237
|
+
vi: r,
|
|
238
|
+
vn: e,
|
|
239
|
+
vu: c,
|
|
240
|
+
wf: t,
|
|
241
|
+
ws: s,
|
|
242
|
+
xk: m,
|
|
243
|
+
ye: i,
|
|
244
|
+
yt: a,
|
|
245
|
+
za: g,
|
|
246
|
+
zm: F,
|
|
247
|
+
zw: l
|
|
248
|
+
};
|
|
249
|
+
export {
|
|
250
|
+
Ta as COUNTRY_FLAGS
|
|
251
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CountryPhoneApiItem, CountryPhoneCountry } from './types';
|
|
2
|
+
/** Normalize and validate one API country without deriving business data locally. */
|
|
3
|
+
export declare function normalizeCountryPhoneItem(item: CountryPhoneApiItem): CountryPhoneCountry;
|
|
4
|
+
/** Apply the optional calling-code restriction and localized ordering. */
|
|
5
|
+
export declare function resolveIndicatorCountryPhoneCountries(countries: readonly CountryPhoneCountry[], options: readonly number[] | undefined, locale: string): readonly CountryPhoneCountry[];
|
|
6
|
+
//# sourceMappingURL=countryOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countryOptions.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/countryOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAExE,qFAAqF;AACrF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB,CA2BxF;AAED,0EAA0E;AAC1E,wBAAgB,qCAAqC,CACnD,SAAS,EAAE,SAAS,mBAAmB,EAAE,EACzC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACtC,MAAM,EAAE,MAAM,GACb,SAAS,mBAAmB,EAAE,CAkBhC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { COUNTRY_FLAGS as l } from "./countryFlags.generated.js";
|
|
2
|
+
function c(e) {
|
|
3
|
+
const r = typeof e?.id == "string" ? e.id.trim().toUpperCase() : "", a = typeof e?.name == "string" ? e.name.trim() : "", t = typeof e?.callingCode == "string" ? e.callingCode.trim() : "";
|
|
4
|
+
if (!/^[A-Z]{2}$/u.test(r))
|
|
5
|
+
throw new Error("Countries response contains an invalid ISO alpha-2 identifier.");
|
|
6
|
+
if (!a)
|
|
7
|
+
throw new Error(`Countries response contains an empty name for ${r}.`);
|
|
8
|
+
if (typeof e.active != "boolean")
|
|
9
|
+
throw new Error(`Countries response contains an invalid availability value for ${r}.`);
|
|
10
|
+
if (!/^\d+$/u.test(t))
|
|
11
|
+
throw new Error(`Countries response contains an invalid calling code for ${r}.`);
|
|
12
|
+
const o = r.toLowerCase();
|
|
13
|
+
return {
|
|
14
|
+
apiId: r,
|
|
15
|
+
value: o,
|
|
16
|
+
label: a,
|
|
17
|
+
active: e.active,
|
|
18
|
+
callingCode: `+${t}`,
|
|
19
|
+
flag: l[o]
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function f(e, r, a) {
|
|
23
|
+
if (r === void 0)
|
|
24
|
+
return [...e].filter((o) => o.active).sort((o, n) => o.label.localeCompare(n.label, a));
|
|
25
|
+
const t = /* @__PURE__ */ new Set();
|
|
26
|
+
return r.flatMap((o) => e.filter((n) => n.active && Number(n.callingCode.slice(1)) === o).sort((n, i) => n.label.localeCompare(i.label, a)).filter((n) => t.has(n.value) ? !1 : (t.add(n.value), !0)));
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
c as normalizeCountryPhoneItem,
|
|
30
|
+
f as resolveIndicatorCountryPhoneCountries
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GetLabelType } from '@m4l/core';
|
|
2
|
+
export declare const INDICATOR_COUNTRY_PHONE_DICTIONARY: {
|
|
3
|
+
readonly callingCode: "indicator_country_phone.label_calling_code";
|
|
4
|
+
readonly callingCodes: "indicator_country_phone.label_calling_codes";
|
|
5
|
+
readonly empty: "indicator_country_phone.label_empty";
|
|
6
|
+
readonly loading: "indicator_country_phone.label_loading";
|
|
7
|
+
readonly noMatches: "indicator_country_phone.label_no_matches";
|
|
8
|
+
readonly retry: "indicator_country_phone.label_retry";
|
|
9
|
+
readonly unavailable: "indicator_country_phone.label_unavailable";
|
|
10
|
+
};
|
|
11
|
+
/** Return the dictionary namespace required by IndicatorCountryPhone. */
|
|
12
|
+
export declare function getIndicatorCountryPhoneComponentsDictionary(): string[];
|
|
13
|
+
/** Resolve one component label while keeping a usable English fallback. */
|
|
14
|
+
export declare function resolveIndicatorCountryPhoneLabel(getLabel: GetLabelType, key: string, fallback: string): string;
|
|
15
|
+
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAK9C,eAAO,MAAM,kCAAkC;;;;;;;;CAQrC,CAAC;AAEX,yEAAyE;AACzE,wBAAgB,4CAA4C,IAAI,MAAM,EAAE,CAEvE;AAED,2EAA2E;AAC3E,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,MAAM,CAaR"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const l = "indicator_country_phone", o = "N_D:[", _ = {
|
|
2
|
+
callingCode: `${l}.label_calling_code`,
|
|
3
|
+
callingCodes: `${l}.label_calling_codes`,
|
|
4
|
+
empty: `${l}.label_empty`,
|
|
5
|
+
loading: `${l}.label_loading`,
|
|
6
|
+
noMatches: `${l}.label_no_matches`,
|
|
7
|
+
retry: `${l}.label_retry`,
|
|
8
|
+
unavailable: `${l}.label_unavailable`
|
|
9
|
+
};
|
|
10
|
+
function r() {
|
|
11
|
+
return [l];
|
|
12
|
+
}
|
|
13
|
+
function c(a, e, t) {
|
|
14
|
+
const n = a(e).trim();
|
|
15
|
+
return !n || n === e || n === `ND:${e}` || n === `label:${e}` || n.startsWith(o) ? t : n;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
_ as INDICATOR_COUNTRY_PHONE_DICTIONARY,
|
|
19
|
+
r as getIndicatorCountryPhoneComponentsDictionary,
|
|
20
|
+
c as resolveIndicatorCountryPhoneLabel
|
|
21
|
+
};
|
package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CountryPhoneCountry } from '../../types';
|
|
2
|
+
/** Input used to load the active catalog and an optional historical selection. */
|
|
3
|
+
export interface UseCountryPhoneCatalogOptions {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
selectedValue?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Observable state of the authenticated country catalog. */
|
|
8
|
+
export interface UseCountryPhoneCatalogReturn {
|
|
9
|
+
countries: readonly CountryPhoneCountry[];
|
|
10
|
+
selectedCountry?: CountryPhoneCountry;
|
|
11
|
+
locale: string;
|
|
12
|
+
status: 'disabled' | 'loading' | 'loaded' | 'error';
|
|
13
|
+
isRefreshing: boolean;
|
|
14
|
+
hasRefreshError: boolean;
|
|
15
|
+
isSelectedLoading: boolean;
|
|
16
|
+
hasSelectedError: boolean;
|
|
17
|
+
retry: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|