@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
package/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,kFAAkF;AAClF,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,6DAA6D;AAC7D,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC1C,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpD,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useNetwork } from '@m4l/core';
|
|
2
|
+
import { CountryPhoneCountry } from '../../types';
|
|
3
|
+
import { UseCountryPhoneCatalogOptions, UseCountryPhoneCatalogReturn } from './types';
|
|
4
|
+
type NetworkOperation = ReturnType<typeof useNetwork>['networkOperation'];
|
|
5
|
+
/** Retry one transient catalog failure while preserving auth failures for the host. */
|
|
6
|
+
export declare function shouldRetryCountryPhoneCatalog(failureCount: number, error: unknown): boolean;
|
|
7
|
+
/** Fetch every active page and reject truncated or duplicate catalog data. */
|
|
8
|
+
export declare function fetchCountryPhoneCatalog(networkOperation: NetworkOperation, signal: AbortSignal): Promise<readonly CountryPhoneCountry[]>;
|
|
9
|
+
/** Load the session- and locale-scoped catalog shared by phone controls. */
|
|
10
|
+
export declare function useCountryPhoneCatalog(options?: UseCountryPhoneCatalogOptions): UseCountryPhoneCatalogReturn;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useCountryPhoneCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCountryPhoneCatalog.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/hooks/useCountryPhoneCatalog/useCountryPhoneCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,UAAU,EAAsB,MAAM,WAAW,CAAC;AASpF,OAAO,KAAK,EAA2B,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAE3F,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAW1E,uFAAuF;AACvF,wBAAgB,8BAA8B,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAG5F;AA8BD,8EAA8E;AAC9E,wBAAsB,wBAAwB,CAC5C,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CA+CzC;AA0CD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,6BAAkC,GAC1C,4BAA4B,CAiG9B"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { useNetwork as _, useEnvironment as A, useAuth as S, useUserPreferences as q } from "@m4l/core";
|
|
2
|
+
import { useQuery as I } from "@tanstack/react-query";
|
|
3
|
+
import { useRef as k, useEffect as D, useCallback as H } from "react";
|
|
4
|
+
import { INDICATOR_COUNTRY_PHONE_STALE_TIME as P, INDICATOR_COUNTRY_PHONE_PAGE_LIMIT as L, INDICATOR_COUNTRY_PHONE_ENDPOINT as N } from "../../constants.js";
|
|
5
|
+
import { normalizeCountryPhoneItem as R } from "../../countryOptions.js";
|
|
6
|
+
function M(t) {
|
|
7
|
+
if (!(typeof t != "object" || t === null || !("status" in t)))
|
|
8
|
+
return typeof t.status == "number" ? t.status : void 0;
|
|
9
|
+
}
|
|
10
|
+
function T(t, i) {
|
|
11
|
+
const n = M(i);
|
|
12
|
+
return n !== 401 && n !== 403 && t < 1;
|
|
13
|
+
}
|
|
14
|
+
function b(t, i, n, a) {
|
|
15
|
+
const { data: r, pager: e } = t;
|
|
16
|
+
if (!Array.isArray(r) || !e || !Number.isInteger(e.total) || e.total < 0)
|
|
17
|
+
throw new Error("Countries response contains an invalid pager.");
|
|
18
|
+
if (!Number.isInteger(e.page) || e.page !== i)
|
|
19
|
+
throw new Error("Countries response did not advance on the requested page.");
|
|
20
|
+
if (!Number.isInteger(e.limit) || e.limit <= 0)
|
|
21
|
+
throw new Error("Countries response contains an invalid page limit.");
|
|
22
|
+
if (r.length > e.limit)
|
|
23
|
+
throw new Error("Countries response exceeds its reported page limit.");
|
|
24
|
+
if (n !== void 0 && e.total !== n)
|
|
25
|
+
throw new Error("Countries response changed its reported total between pages.");
|
|
26
|
+
if (a !== void 0 && e.limit !== a)
|
|
27
|
+
throw new Error("Countries response changed its reported page limit between pages.");
|
|
28
|
+
}
|
|
29
|
+
async function U(t, i) {
|
|
30
|
+
const n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
31
|
+
let r = 0, e = 0, l, p;
|
|
32
|
+
for (; ; ) {
|
|
33
|
+
const c = await t({
|
|
34
|
+
method: "GET",
|
|
35
|
+
endPoint: N,
|
|
36
|
+
isRemote: !0,
|
|
37
|
+
responseToCamelCase: !0,
|
|
38
|
+
toastError: !1,
|
|
39
|
+
signal: i,
|
|
40
|
+
parms: { page: e, limit: L }
|
|
41
|
+
});
|
|
42
|
+
if (b(c, e, l, p), l ??= c.pager.total, p ??= c.pager.limit, r + c.data.length > c.pager.total)
|
|
43
|
+
throw new Error("Countries response contains more rows than its reported total.");
|
|
44
|
+
for (const h of c.data) {
|
|
45
|
+
const o = R(h);
|
|
46
|
+
if (a.has(o.apiId))
|
|
47
|
+
throw new Error(`Countries response contains duplicate identifier ${o.apiId}.`);
|
|
48
|
+
a.add(o.apiId), r += 1, o.active && n.set(o.apiId, o);
|
|
49
|
+
}
|
|
50
|
+
if (r === c.pager.total)
|
|
51
|
+
return [...n.values()];
|
|
52
|
+
if (c.data.length === 0)
|
|
53
|
+
throw new Error("Countries response ended before its reported total.");
|
|
54
|
+
e += 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function z(t, i, n) {
|
|
58
|
+
const a = n.toUpperCase(), r = await t({
|
|
59
|
+
method: "GET",
|
|
60
|
+
endPoint: N,
|
|
61
|
+
isRemote: !0,
|
|
62
|
+
responseToCamelCase: !0,
|
|
63
|
+
toastError: !1,
|
|
64
|
+
signal: i,
|
|
65
|
+
parms: {
|
|
66
|
+
page: 0,
|
|
67
|
+
limit: 1,
|
|
68
|
+
f: [
|
|
69
|
+
{ n: "id", o: "e", o1: a },
|
|
70
|
+
{ n: "active", o: "e", o1: !1 }
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
if (b(r, 0), r.pager.total !== r.data.length)
|
|
75
|
+
throw new Error("Countries response returned an incomplete inactive lookup.");
|
|
76
|
+
const e = r.data.map((l) => R(l)).find((l) => l.apiId === a);
|
|
77
|
+
if (!e)
|
|
78
|
+
return null;
|
|
79
|
+
if (e.active)
|
|
80
|
+
throw new Error(`Countries response returned active country ${a} for an inactive lookup.`);
|
|
81
|
+
return e;
|
|
82
|
+
}
|
|
83
|
+
function j(t = {}) {
|
|
84
|
+
const { enabled: i = !0, selectedValue: n } = t, { networkOperation: a } = _(), { hostApiRemote: r, database: e } = A(), { isAuthenticated: l, user: p } = S(), { locale: c } = q(), h = c || "en", o = n?.trim().toLowerCase(), m = [
|
|
85
|
+
r,
|
|
86
|
+
e,
|
|
87
|
+
p?.accountId ?? null,
|
|
88
|
+
p?.id ?? null,
|
|
89
|
+
h
|
|
90
|
+
], g = m.join(""), f = k({
|
|
91
|
+
scopeIdentity: g,
|
|
92
|
+
countries: /* @__PURE__ */ new Map()
|
|
93
|
+
});
|
|
94
|
+
f.current.scopeIdentity !== g && (f.current = {
|
|
95
|
+
scopeIdentity: g,
|
|
96
|
+
countries: /* @__PURE__ */ new Map()
|
|
97
|
+
});
|
|
98
|
+
const y = i && l && !!p, s = I({
|
|
99
|
+
queryKey: ["indicator-country-phone", "active", ...m],
|
|
100
|
+
enabled: y,
|
|
101
|
+
staleTime: P,
|
|
102
|
+
retry: T,
|
|
103
|
+
queryFn: ({ signal: d }) => U(a, d)
|
|
104
|
+
}), C = s.data?.find(
|
|
105
|
+
(d) => d.value === o
|
|
106
|
+
), E = !!(y && s.isSuccess && o && !C), u = I({
|
|
107
|
+
queryKey: ["indicator-country-phone", "historical", ...m, o ?? null],
|
|
108
|
+
enabled: E,
|
|
109
|
+
staleTime: P,
|
|
110
|
+
retry: T,
|
|
111
|
+
/** Fetch the selected inactive country only after the active catalog has loaded. */
|
|
112
|
+
queryFn: ({ signal: d }) => z(
|
|
113
|
+
a,
|
|
114
|
+
d,
|
|
115
|
+
o
|
|
116
|
+
)
|
|
117
|
+
});
|
|
118
|
+
D(() => {
|
|
119
|
+
for (const d of s.data ?? [])
|
|
120
|
+
f.current.countries.set(d.value, d);
|
|
121
|
+
u.data && f.current.countries.set(u.data.value, u.data);
|
|
122
|
+
}, [s.data, u.data]);
|
|
123
|
+
const O = H(async () => {
|
|
124
|
+
if (u.isError) {
|
|
125
|
+
await u.refetch();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
await s.refetch();
|
|
129
|
+
}, [s, u]), w = s.data !== void 0, v = o ? f.current.countries.get(o) : void 0;
|
|
130
|
+
return {
|
|
131
|
+
countries: s.data ?? [],
|
|
132
|
+
selectedCountry: C ?? u.data ?? (v ? { ...v, active: !1 } : void 0),
|
|
133
|
+
locale: h,
|
|
134
|
+
status: i ? s.isError && !w ? "error" : s.isPending ? "loading" : "loaded" : "disabled",
|
|
135
|
+
isRefreshing: s.isFetching && w,
|
|
136
|
+
hasRefreshError: s.isError && w,
|
|
137
|
+
isSelectedLoading: E && u.isPending,
|
|
138
|
+
hasSelectedError: u.isError,
|
|
139
|
+
retry: O
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
U as fetchCountryPhoneCatalog,
|
|
144
|
+
T as shouldRetryCountryPhoneCatalog,
|
|
145
|
+
j as useCountryPhoneCatalog
|
|
146
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4CAA4C,EAAE,MAAM,cAAc,CAAC;AAC5E,YAAY,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum IndicatorCountryPhoneSlots {
|
|
2
|
+
root = "root",
|
|
3
|
+
trigger = "trigger",
|
|
4
|
+
chip = "chip",
|
|
5
|
+
popover = "popover",
|
|
6
|
+
menu = "menu",
|
|
7
|
+
menuItem = "menuItem",
|
|
8
|
+
flag = "flag",
|
|
9
|
+
code = "code",
|
|
10
|
+
codeInput = "codeInput",
|
|
11
|
+
emptyState = "emptyState",
|
|
12
|
+
skeleton = "skeleton",
|
|
13
|
+
statusButton = "statusButton",
|
|
14
|
+
virtualItems = "virtualItems"
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/slots.ts"],"names":[],"mappings":"AAAA,oBAAY,0BAA0B;IACpC,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;CAC9B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var p = /* @__PURE__ */ ((e) => (e.root = "root", e.trigger = "trigger", e.chip = "chip", e.popover = "popover", e.menu = "menu", e.menuItem = "menuItem", e.flag = "flag", e.code = "code", e.codeInput = "codeInput", e.emptyState = "emptyState", e.skeleton = "skeleton", e.statusButton = "statusButton", e.virtualItems = "virtualItems", e))(p || {});
|
|
2
|
+
export {
|
|
3
|
+
p as IndicatorCountryPhoneSlots
|
|
4
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ChipProps, M4LOverridesStyleRules } from '@m4l/components';
|
|
2
|
+
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
3
|
+
import { Theme } from '@mui/material/styles';
|
|
4
|
+
import { ComponentType, HTMLAttributes } from 'react';
|
|
5
|
+
import { INDICATOR_COUNTRY_PHONE_COMPONENT_KEY } from './constants';
|
|
6
|
+
import { IndicatorCountryPhoneSlots } from './slots';
|
|
7
|
+
/** Component type used by the generated ISO-to-flag artwork lookup. */
|
|
8
|
+
export type CountryPhoneFlagComponent = ComponentType<SvgIconProps>;
|
|
9
|
+
/** One country returned by the authenticated countries endpoint after normalization. */
|
|
10
|
+
export interface CountryPhoneCountry {
|
|
11
|
+
/** Uppercase ISO alpha-2 identity used by the API. */
|
|
12
|
+
apiId: string;
|
|
13
|
+
/** Lowercase ISO alpha-2 identity exposed by the component. */
|
|
14
|
+
value: string;
|
|
15
|
+
/** Localized name returned by the API. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** E.164 calling code formatted for display with one leading plus sign. */
|
|
18
|
+
callingCode: string;
|
|
19
|
+
/** Whether the API permits this country to be selected. */
|
|
20
|
+
active: boolean;
|
|
21
|
+
/** Local flag artwork when the ISO identifier exists in `@m4l/icons`. */
|
|
22
|
+
flag?: CountryPhoneFlagComponent;
|
|
23
|
+
}
|
|
24
|
+
/** Raw country row after the shared network layer converts keys to camelCase. */
|
|
25
|
+
export interface CountryPhoneApiItem {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
active: boolean;
|
|
29
|
+
callingCode: string;
|
|
30
|
+
}
|
|
31
|
+
/** Pager returned by the countries endpoint. */
|
|
32
|
+
export interface CountryPhoneApiPager {
|
|
33
|
+
total: number;
|
|
34
|
+
page: number;
|
|
35
|
+
limit: number;
|
|
36
|
+
}
|
|
37
|
+
/** Authenticated countries list response. */
|
|
38
|
+
export interface CountryPhoneApiResponse {
|
|
39
|
+
data: CountryPhoneApiItem[];
|
|
40
|
+
pager: CountryPhoneApiPager;
|
|
41
|
+
}
|
|
42
|
+
/** A country selected from the authenticated phone-prefix catalog. */
|
|
43
|
+
export interface IndicatorCountryPhoneOption {
|
|
44
|
+
/** Stable lowercase two-letter region identifier, usually ISO 3166-1 alpha-2. */
|
|
45
|
+
value: string;
|
|
46
|
+
/** Visible phone prefix, including the leading plus sign. */
|
|
47
|
+
callingCode: string;
|
|
48
|
+
/** Country name used by assistive technology. */
|
|
49
|
+
label: string;
|
|
50
|
+
}
|
|
51
|
+
/** Public props for the IndicatorCountryPhone wrapper. */
|
|
52
|
+
export interface IndicatorCountryPhoneProps {
|
|
53
|
+
/** E.164 calling codes to include, such as [34, 44, 33]. Omit for all countries. */
|
|
54
|
+
options?: readonly number[];
|
|
55
|
+
/** Controlled selected country identifier. */
|
|
56
|
+
value?: string;
|
|
57
|
+
/** Initially selected country identifier when uncontrolled. */
|
|
58
|
+
defaultValue?: string;
|
|
59
|
+
/** Called when a country is selected. */
|
|
60
|
+
onChange?: (option: IndicatorCountryPhoneOption) => void;
|
|
61
|
+
/** Controlled popover visibility. */
|
|
62
|
+
expanded?: boolean;
|
|
63
|
+
/** Initial popover visibility when uncontrolled. */
|
|
64
|
+
defaultExpanded?: boolean;
|
|
65
|
+
/** Called whenever popover visibility is requested to change. */
|
|
66
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
67
|
+
/** Prevent country changes while the surrounding field is disabled or read-only. */
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
/** Additional Chip configuration; the wrapper owns its flag, label and click behavior. */
|
|
70
|
+
chipProps?: Omit<ChipProps, 'startIcon' | 'label' | 'onClick'>;
|
|
71
|
+
/** Additional attributes for the popover panel; the wrapper owns its content. */
|
|
72
|
+
popoverProps?: Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML'>;
|
|
73
|
+
/** Additional class for the wrapper. */
|
|
74
|
+
className?: string;
|
|
75
|
+
/** Optional test identifier on the wrapper. */
|
|
76
|
+
dataTestId?: string;
|
|
77
|
+
}
|
|
78
|
+
/** State passed to the themeable component slots. */
|
|
79
|
+
export interface IndicatorCountryPhoneOwnerState {
|
|
80
|
+
expanded?: boolean;
|
|
81
|
+
codeLength?: number;
|
|
82
|
+
rowTop?: number;
|
|
83
|
+
totalHeight?: number;
|
|
84
|
+
viewportHeight?: number;
|
|
85
|
+
}
|
|
86
|
+
export type IndicatorCountryPhoneSlotsType = keyof typeof IndicatorCountryPhoneSlots;
|
|
87
|
+
export type IndicatorCountryPhoneStyles = M4LOverridesStyleRules<IndicatorCountryPhoneSlotsType, typeof INDICATOR_COUNTRY_PHONE_COMPONENT_KEY, Theme>;
|
|
88
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/indicators/IndicatorCountryPhone/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/indicators/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/indicators/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC"}
|