@ovok/native 1.9.0 → 1.10.1
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/lib/commonjs/modules/auth/default-translation.js +8 -0
- package/lib/commonjs/modules/auth/default-translation.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/form-phone-field.js +186 -0
- package/lib/commonjs/modules/auth/profile/components/form-phone-field.js.map +1 -0
- package/lib/commonjs/modules/auth/profile/components/profile-form-choice-field.js +67 -0
- package/lib/commonjs/modules/auth/profile/components/profile-form-choice-field.js.map +1 -0
- package/lib/commonjs/modules/auth/profile/components/profile-form-field-component.js +48 -9
- package/lib/commonjs/modules/auth/profile/components/profile-form-field-component.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js +60 -30
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form.js +2 -0
- package/lib/commonjs/modules/auth/profile/components/profile-form.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/utils/phone.js +31 -0
- package/lib/commonjs/modules/auth/profile/utils/phone.js.map +1 -0
- package/lib/commonjs/modules/auth/register/components/form/inputs.js +32 -4
- package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +18 -4
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/register/contexts/register-form-context.js.map +1 -1
- package/lib/commonjs/modules/auth/register/utils/create-register-validation-schema.js +23 -3
- package/lib/commonjs/modules/auth/register/utils/create-register-validation-schema.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-entries.js +2 -2
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +7 -3
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js +4 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -1
- package/lib/commonjs/modules/helpers/form-items/form-date-field.js +27 -4
- package/lib/commonjs/modules/helpers/form-items/form-date-field.js.map +1 -1
- package/lib/commonjs/modules/helpers/form-items/form-field.js +3 -2
- package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/commonjs/modules/ui/components/nearby-device-prompt.js +7 -4
- package/lib/commonjs/modules/ui/components/nearby-device-prompt.js.map +1 -1
- package/lib/module/modules/auth/default-translation.js +8 -0
- package/lib/module/modules/auth/default-translation.js.map +1 -1
- package/lib/module/modules/auth/profile/components/form-phone-field.js +180 -0
- package/lib/module/modules/auth/profile/components/form-phone-field.js.map +1 -0
- package/lib/module/modules/auth/profile/components/profile-form-choice-field.js +61 -0
- package/lib/module/modules/auth/profile/components/profile-form-choice-field.js.map +1 -0
- package/lib/module/modules/auth/profile/components/profile-form-field-component.js +48 -9
- package/lib/module/modules/auth/profile/components/profile-form-field-component.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form-provider.js +60 -30
- package/lib/module/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form.js +2 -0
- package/lib/module/modules/auth/profile/components/profile-form.js.map +1 -1
- package/lib/module/modules/auth/profile/utils/phone.js +25 -0
- package/lib/module/modules/auth/profile/utils/phone.js.map +1 -0
- package/lib/module/modules/auth/register/components/form/inputs.js +32 -4
- package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +18 -4
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/register/contexts/register-form-context.js.map +1 -1
- package/lib/module/modules/auth/register/utils/create-register-validation-schema.js +23 -3
- package/lib/module/modules/auth/register/utils/create-register-validation-schema.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-entries.js +3 -3
- package/lib/module/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-devices.js +7 -3
- package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js +4 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -1
- package/lib/module/modules/helpers/form-items/form-date-field.js +27 -4
- package/lib/module/modules/helpers/form-items/form-date-field.js.map +1 -1
- package/lib/module/modules/helpers/form-items/form-field.js +3 -2
- package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/module/modules/ui/components/nearby-device-prompt.js +7 -4
- package/lib/module/modules/ui/components/nearby-device-prompt.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/default-translation.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/auth/default-translation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/form-phone-field.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/components/form-phone-field.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-choice-field.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-choice-field.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-field-component.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-field.d.ts +36 -3
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-props.d.ts +3 -8
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/utils/phone.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/utils/phone.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/contexts/register-form-context.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/auth/register/contexts/register-form-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/hooks/use-register-form.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/register/hooks/use-register-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/types/register-form-props.d.ts +16 -3
- package/lib/typescript/commonjs/src/modules/auth/register/types/register-form-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/types/register-form-values.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/auth/register/types/register-form-values.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/utils/create-register-validation-schema.d.ts +10 -3
- package/lib/typescript/commonjs/src/modules/auth/register/utils/create-register-validation-schema.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-date-field.d.ts +11 -2
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-date-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/ui/components/nearby-device-prompt.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/default-translation.d.ts +8 -0
- package/lib/typescript/module/src/modules/auth/default-translation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/form-phone-field.d.ts +20 -0
- package/lib/typescript/module/src/modules/auth/profile/components/form-phone-field.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-choice-field.d.ts +14 -0
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-choice-field.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-field-component.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-field.d.ts +36 -3
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-props.d.ts +3 -8
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/utils/phone.d.ts +6 -0
- package/lib/typescript/module/src/modules/auth/profile/utils/phone.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/contexts/register-form-context.d.ts +6 -0
- package/lib/typescript/module/src/modules/auth/register/contexts/register-form-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/hooks/use-register-form.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/register/hooks/use-register-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/types/register-form-props.d.ts +16 -3
- package/lib/typescript/module/src/modules/auth/register/types/register-form-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/types/register-form-values.d.ts +1 -0
- package/lib/typescript/module/src/modules/auth/register/types/register-form-values.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/utils/create-register-validation-schema.d.ts +10 -3
- package/lib/typescript/module/src/modules/auth/register/utils/create-register-validation-schema.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/form-items/form-date-field.d.ts +11 -2
- package/lib/typescript/module/src/modules/helpers/form-items/form-date-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +2 -1
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/ui/components/nearby-device-prompt.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -16,12 +16,20 @@ const defaultTranslation = exports.defaultTranslation = {
|
|
|
16
16
|
delete: "Delete"
|
|
17
17
|
},
|
|
18
18
|
profile: {
|
|
19
|
+
form: {
|
|
20
|
+
phone: {
|
|
21
|
+
country: "Country",
|
|
22
|
+
invalid: "Enter a valid phone number for the selected country.",
|
|
23
|
+
searchCountry: "Search countries"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
19
26
|
save: "Save"
|
|
20
27
|
},
|
|
21
28
|
register: {
|
|
22
29
|
"already-have-account": "Already have an account? <login/>",
|
|
23
30
|
button: "Create account",
|
|
24
31
|
name: "First name",
|
|
32
|
+
"full-name": "Full name",
|
|
25
33
|
"or-register-with": "Or register with",
|
|
26
34
|
"password-confirm": "Confirm password",
|
|
27
35
|
subtitle: "Create your account",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18next","_interopRequireDefault","require","e","__esModule","default","defaultTranslation","exports","auth","common","cancel","delete","profile","save","register","button","name","subtitle","surname","title","accountType","email","patient","practitioner","settings","logout","apple","footer","google","mfa","code","verify","password","errors","unavailable","network","generic","i18n","addResourceBundle","resources","options","englishResources","Object","assign","en","existingTranslation","translation"],"sourceRoot":"../../../../src","sources":["modules/auth/default-translation.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3B;AACO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,IAAI,EAAE;IAAE,YAAY,EAAE;EAAsD,CAAC;EAC7EC,MAAM,EAAE;IAAEC,MAAM,EAAE,QAAQ;IAAEC,MAAM,EAAE;EAAS,CAAC;EAC9CC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"names":["_i18next","_interopRequireDefault","require","e","__esModule","default","defaultTranslation","exports","auth","common","cancel","delete","profile","form","phone","country","invalid","searchCountry","save","register","button","name","subtitle","surname","title","accountType","email","patient","practitioner","settings","logout","apple","footer","google","mfa","code","verify","password","errors","unavailable","network","generic","i18n","addResourceBundle","resources","options","englishResources","Object","assign","en","existingTranslation","translation"],"sourceRoot":"../../../../src","sources":["modules/auth/default-translation.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAA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6
|
+
exports.getPhoneCountries = exports.FormPhoneField = void 0;
|
|
7
|
+
var _countriesList = require("countries-list");
|
|
8
|
+
var _formik = require("formik");
|
|
9
|
+
var _libphonenumberJs = require("libphonenumber-js");
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _reactI18next = require("react-i18next");
|
|
12
|
+
var _reactNative = require("react-native");
|
|
13
|
+
var _reactNativeElementDropdown = require("react-native-element-dropdown");
|
|
14
|
+
var _reactNativePaper = require("react-native-paper");
|
|
15
|
+
var _index = require("../../../theme/index.js");
|
|
16
|
+
var _profileFormContext = require("../contexts/profile-form-context.js");
|
|
17
|
+
var _phone = require("../utils/phone.js");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
const getPhoneCountries = (language, countryName) => {
|
|
21
|
+
const DisplayNames = Intl.DisplayNames;
|
|
22
|
+
let displayNames;
|
|
23
|
+
try {
|
|
24
|
+
displayNames = DisplayNames ? new DisplayNames([language], {
|
|
25
|
+
type: "region"
|
|
26
|
+
}) : undefined;
|
|
27
|
+
} catch {
|
|
28
|
+
displayNames = undefined;
|
|
29
|
+
}
|
|
30
|
+
return (0, _libphonenumberJs.getCountries)().filter(code => Boolean(_countriesList.countries[code])).map(code => {
|
|
31
|
+
const localizedName = countryName?.(code, language);
|
|
32
|
+
const displayName = displayNames?.of(code);
|
|
33
|
+
const name = localizedName || displayName || _countriesList.countries[code].name;
|
|
34
|
+
return {
|
|
35
|
+
value: code,
|
|
36
|
+
label: `${name} (+${(0, _libphonenumberJs.getCountryCallingCode)(code)})`
|
|
37
|
+
};
|
|
38
|
+
}).sort((first, second) => first.label.localeCompare(second.label, language));
|
|
39
|
+
};
|
|
40
|
+
exports.getPhoneCountries = getPhoneCountries;
|
|
41
|
+
const FormPhoneField = ({
|
|
42
|
+
name,
|
|
43
|
+
fieldName,
|
|
44
|
+
label,
|
|
45
|
+
defaultCountry,
|
|
46
|
+
countryName,
|
|
47
|
+
disabled = false,
|
|
48
|
+
testID
|
|
49
|
+
}) => {
|
|
50
|
+
const {
|
|
51
|
+
t,
|
|
52
|
+
i18n
|
|
53
|
+
} = (0, _reactI18next.useTranslation)();
|
|
54
|
+
const theme = (0, _index.useAppTheme)();
|
|
55
|
+
const language = i18n.language || "en";
|
|
56
|
+
const phoneCountries = React.useMemo(() => getPhoneCountries(language, countryName), [countryName, language]);
|
|
57
|
+
const {
|
|
58
|
+
values,
|
|
59
|
+
errors,
|
|
60
|
+
touched,
|
|
61
|
+
setFieldValue,
|
|
62
|
+
setFieldTouched
|
|
63
|
+
} = React.useContext(_profileFormContext.ProfileFormContext);
|
|
64
|
+
const storedValue = (0, _formik.getIn)(values, name) ?? "";
|
|
65
|
+
const countryFieldName = (0, _phone.phoneCountryFieldName)(fieldName);
|
|
66
|
+
const storedCountry = values[countryFieldName];
|
|
67
|
+
const parsedStoredValue = (0, _libphonenumberJs.parsePhoneNumberFromString)(storedValue);
|
|
68
|
+
const parsedStoredNational = parsedStoredValue?.formatNational();
|
|
69
|
+
const [country, setCountry] = React.useState(storedCountry ?? parsedStoredValue?.country ?? defaultCountry);
|
|
70
|
+
const [draft, setDraft] = React.useState(() => {
|
|
71
|
+
if (!storedValue) {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
return parsedStoredNational ?? storedValue;
|
|
75
|
+
});
|
|
76
|
+
const lastInputValue = React.useRef(storedValue);
|
|
77
|
+
const error = (0, _formik.getIn)(touched, name) && (0, _formik.getIn)(errors, name);
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
if (storedCountry && storedCountry !== country) {
|
|
80
|
+
setCountry(storedCountry);
|
|
81
|
+
}
|
|
82
|
+
}, [country, storedCountry]);
|
|
83
|
+
React.useEffect(() => {
|
|
84
|
+
if (storedValue === lastInputValue.current) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
lastInputValue.current = storedValue;
|
|
88
|
+
if (!storedValue) {
|
|
89
|
+
setDraft("");
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
setDraft(parsedStoredNational ?? storedValue);
|
|
93
|
+
}, [parsedStoredNational, storedValue]);
|
|
94
|
+
const handlePhoneChange = value => {
|
|
95
|
+
setDraft(value);
|
|
96
|
+
const e164Value = (0, _phone.toPhoneE164)(value, country);
|
|
97
|
+
lastInputValue.current = e164Value;
|
|
98
|
+
void setFieldValue(name, e164Value);
|
|
99
|
+
};
|
|
100
|
+
const handleCountryChange = item => {
|
|
101
|
+
setCountry(item.value);
|
|
102
|
+
void setFieldValue(countryFieldName, item.value);
|
|
103
|
+
const e164Value = (0, _phone.toPhoneE164)(draft, item.value);
|
|
104
|
+
lastInputValue.current = e164Value;
|
|
105
|
+
void setFieldValue(name, e164Value);
|
|
106
|
+
};
|
|
107
|
+
const handleBlur = () => {
|
|
108
|
+
void setFieldTouched(name, true);
|
|
109
|
+
const parsed = (0, _libphonenumberJs.parsePhoneNumberFromString)(draft, country);
|
|
110
|
+
if (parsed) {
|
|
111
|
+
setDraft(parsed.formatNational());
|
|
112
|
+
lastInputValue.current = parsed.number;
|
|
113
|
+
void setFieldValue(name, parsed.number);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const countryLabel = phoneCountries.find(item => item.value === country)?.label ?? country;
|
|
117
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
118
|
+
style: {
|
|
119
|
+
gap: theme.spacing(1.5)
|
|
120
|
+
},
|
|
121
|
+
testID: testID,
|
|
122
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
123
|
+
style: {
|
|
124
|
+
gap: theme.spacing(1.5)
|
|
125
|
+
},
|
|
126
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeElementDropdown.Dropdown, {
|
|
127
|
+
accessibilityLabel: t("profile.form.phone.country"),
|
|
128
|
+
data: phoneCountries,
|
|
129
|
+
labelField: "label",
|
|
130
|
+
valueField: "value",
|
|
131
|
+
value: country,
|
|
132
|
+
search: true,
|
|
133
|
+
disable: disabled,
|
|
134
|
+
testID: testID ? `${testID}-country` : undefined,
|
|
135
|
+
searchPlaceholder: t("profile.form.phone.searchCountry"),
|
|
136
|
+
maxHeight: 300,
|
|
137
|
+
dropdownPosition: "auto",
|
|
138
|
+
autoScroll: false,
|
|
139
|
+
onChange: handleCountryChange,
|
|
140
|
+
style: {
|
|
141
|
+
width: "100%",
|
|
142
|
+
borderWidth: 1,
|
|
143
|
+
borderColor: theme.colors.outline,
|
|
144
|
+
borderRadius: theme.borderRadius(2),
|
|
145
|
+
paddingHorizontal: theme.spacing(2)
|
|
146
|
+
},
|
|
147
|
+
selectedTextStyle: {
|
|
148
|
+
color: theme.colors.onSurface
|
|
149
|
+
},
|
|
150
|
+
itemTextStyle: {
|
|
151
|
+
color: theme.colors.onSurface
|
|
152
|
+
},
|
|
153
|
+
containerStyle: {
|
|
154
|
+
width: "100%",
|
|
155
|
+
backgroundColor: theme.colors.background,
|
|
156
|
+
borderColor: theme.colors.outline,
|
|
157
|
+
borderRadius: theme.spacing(2.5)
|
|
158
|
+
}
|
|
159
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePaper.TextInput, {
|
|
160
|
+
mode: "outlined",
|
|
161
|
+
label: label,
|
|
162
|
+
value: draft,
|
|
163
|
+
editable: !disabled,
|
|
164
|
+
keyboardType: "phone-pad",
|
|
165
|
+
autoCapitalize: "none",
|
|
166
|
+
error: !!error,
|
|
167
|
+
testID: testID ? `${testID}-input` : undefined,
|
|
168
|
+
accessibilityLabel: label,
|
|
169
|
+
onChangeText: handlePhoneChange,
|
|
170
|
+
onBlur: handleBlur,
|
|
171
|
+
theme: {
|
|
172
|
+
roundness: theme.borderRadius(2)
|
|
173
|
+
},
|
|
174
|
+
style: {
|
|
175
|
+
width: "100%"
|
|
176
|
+
},
|
|
177
|
+
accessibilityHint: countryLabel
|
|
178
|
+
})]
|
|
179
|
+
}), error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePaper.HelperText, {
|
|
180
|
+
type: "error",
|
|
181
|
+
children: t(error)
|
|
182
|
+
}) : null]
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
exports.FormPhoneField = FormPhoneField;
|
|
186
|
+
//# sourceMappingURL=form-phone-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_countriesList","require","_formik","_libphonenumberJs","React","_interopRequireWildcard","_reactI18next","_reactNative","_reactNativeElementDropdown","_reactNativePaper","_index","_profileFormContext","_phone","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getPhoneCountries","language","countryName","DisplayNames","Intl","displayNames","type","undefined","getCountries","filter","code","Boolean","countries","map","localizedName","displayName","of","name","value","label","getCountryCallingCode","sort","first","second","localeCompare","exports","FormPhoneField","fieldName","defaultCountry","disabled","testID","i18n","useTranslation","theme","useAppTheme","phoneCountries","useMemo","values","errors","touched","setFieldValue","setFieldTouched","useContext","ProfileFormContext","storedValue","getIn","countryFieldName","phoneCountryFieldName","storedCountry","parsedStoredValue","parsePhoneNumberFromString","parsedStoredNational","formatNational","country","setCountry","useState","draft","setDraft","lastInputValue","useRef","error","useEffect","current","handlePhoneChange","e164Value","toPhoneE164","handleCountryChange","item","handleBlur","parsed","number","countryLabel","find","jsxs","View","style","gap","spacing","children","jsx","Dropdown","accessibilityLabel","data","labelField","valueField","search","disable","searchPlaceholder","maxHeight","dropdownPosition","autoScroll","onChange","width","borderWidth","borderColor","colors","outline","borderRadius","paddingHorizontal","selectedTextStyle","color","onSurface","itemTextStyle","containerStyle","backgroundColor","background","TextInput","mode","editable","keyboardType","autoCapitalize","onChangeText","onBlur","roundness","accessibilityHint","HelperText"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/form-phone-field.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,2BAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AAEA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAoE,IAAAY,WAAA,GAAAZ,OAAA;AAAA,SAAAI,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAA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AAC,UAAU;QACfxF,KAAK,EAAEA,KAAM;QACbD,KAAK,EAAEsC,KAAM;QACboD,QAAQ,EAAE,CAAC/E,QAAS;QACpBgF,YAAY,EAAC,WAAW;QACxBC,cAAc,EAAC,MAAM;QACrBlD,KAAK,EAAE,CAAC,CAACA,KAAM;QACf9B,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,QAAQ,GAAGvB,SAAU;QAC/C0E,kBAAkB,EAAE9D,KAAM;QAC1B4F,YAAY,EAAEhD,iBAAkB;QAChCiD,MAAM,EAAE5C,UAAW;QACnBnC,KAAK,EAAE;UAAEgF,SAAS,EAAEhF,KAAK,CAACgE,YAAY,CAAC,CAAC;QAAE,CAAE;QAC5CtB,KAAK,EAAE;UAAEiB,KAAK,EAAE;QAAO,CAAE;QACzBsB,iBAAiB,EAAE3C;MAAa,CACjC,CAAC;IAAA,CACE,CAAC,EACNX,KAAK,gBAAG,IAAAhF,WAAA,CAAAmG,GAAA,EAACvG,iBAAA,CAAA2I,UAAU;MAAC7G,IAAI,EAAC,OAAO;MAAAwE,QAAA,EAAEhG,CAAC,CAAC8E,KAAK;IAAC,CAAa,CAAC,GAAG,IAAI;EAAA,CAC5D,CAAC;AAEX,CAAC;AAACnC,OAAA,CAAAC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ProfileFormChoiceField = void 0;
|
|
7
|
+
var _formik = require("formik");
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
var _reactNativePaper = require("react-native-paper");
|
|
12
|
+
var _index = require("../../../theme/index.js");
|
|
13
|
+
var _profileFormContext = require("../contexts/profile-form-context.js");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
const ProfileFormChoiceField = ({
|
|
17
|
+
name,
|
|
18
|
+
label,
|
|
19
|
+
options,
|
|
20
|
+
disabled = false,
|
|
21
|
+
testID
|
|
22
|
+
}) => {
|
|
23
|
+
const theme = (0, _index.useAppTheme)();
|
|
24
|
+
const {
|
|
25
|
+
t
|
|
26
|
+
} = (0, _reactI18next.useTranslation)();
|
|
27
|
+
const {
|
|
28
|
+
values,
|
|
29
|
+
errors,
|
|
30
|
+
touched,
|
|
31
|
+
setFieldValue,
|
|
32
|
+
setFieldTouched
|
|
33
|
+
} = React.useContext(_profileFormContext.ProfileFormContext);
|
|
34
|
+
const value = (0, _formik.getIn)(values, name) ?? "";
|
|
35
|
+
const error = (0, _formik.getIn)(touched, name) && (0, _formik.getIn)(errors, name);
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
37
|
+
testID: testID,
|
|
38
|
+
style: {
|
|
39
|
+
gap: theme.spacing(1)
|
|
40
|
+
},
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePaper.Text, {
|
|
42
|
+
variant: "labelLarge",
|
|
43
|
+
children: label
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePaper.RadioButton.Group, {
|
|
45
|
+
value: value,
|
|
46
|
+
onValueChange: nextValue => {
|
|
47
|
+
void setFieldValue(name, nextValue);
|
|
48
|
+
void setFieldTouched(name, true);
|
|
49
|
+
},
|
|
50
|
+
children: options.map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePaper.RadioButton.Item, {
|
|
51
|
+
label: option.label,
|
|
52
|
+
value: option.value,
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
testID: testID ? `${testID}-${option.value}` : undefined,
|
|
55
|
+
position: "leading",
|
|
56
|
+
labelStyle: {
|
|
57
|
+
textAlign: "left"
|
|
58
|
+
}
|
|
59
|
+
}, option.value))
|
|
60
|
+
}), error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePaper.HelperText, {
|
|
61
|
+
type: "error",
|
|
62
|
+
children: t(error)
|
|
63
|
+
}) : null]
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
exports.ProfileFormChoiceField = ProfileFormChoiceField;
|
|
67
|
+
//# sourceMappingURL=profile-form-choice-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_formik","require","React","_interopRequireWildcard","_reactI18next","_reactNative","_reactNativePaper","_index","_profileFormContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProfileFormChoiceField","name","label","options","disabled","testID","theme","useAppTheme","useTranslation","values","errors","touched","setFieldValue","setFieldTouched","useContext","ProfileFormContext","value","getIn","error","jsxs","View","style","gap","spacing","children","jsx","Text","variant","RadioButton","Group","onValueChange","nextValue","map","option","Item","undefined","position","labelStyle","textAlign","HelperText","type","exports"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/profile-form-choice-field.tsx"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA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S;QACnBC,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,IAAI4B,MAAM,CAACjB,KAAK,EAAE,GAAGmB,SAAU;QACzDC,QAAQ,EAAC,SAAS;QAClBC,UAAU,EAAE;UAAEC,SAAS,EAAE;QAAO;MAAE,GAN7BL,MAAM,CAACjB,KAOb,CACF;IAAC,CACe,CAAC,EACnBE,KAAK,gBAAG,IAAAtC,WAAA,CAAA6C,GAAA,EAAChD,iBAAA,CAAA8D,UAAU;MAACC,IAAI,EAAC,OAAO;MAAAhB,QAAA,EAAE1C,CAAC,CAACoC,KAAK;IAAC,CAAa,CAAC,GAAG,IAAI;EAAA,CAC5D,CAAC;AAEX,CAAC;AAACuB,OAAA,CAAAzC,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -8,6 +8,8 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _index = require("../../../helpers/index.js");
|
|
9
9
|
var _formDateField = require("../../../helpers/form-items/form-date-field.js");
|
|
10
10
|
var _profileFormContext = require("../contexts/profile-form-context.js");
|
|
11
|
+
var _formPhoneField = require("./form-phone-field.js");
|
|
12
|
+
var _profileFormChoiceField = require("./profile-form-choice-field.js");
|
|
11
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
15
|
const ProfileFormFieldComponent = ({
|
|
@@ -15,26 +17,63 @@ const ProfileFormFieldComponent = ({
|
|
|
15
17
|
}) => {
|
|
16
18
|
if (field.type === "text") {
|
|
17
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.FormField, {
|
|
18
|
-
...field,
|
|
20
|
+
...field.inputProps,
|
|
19
21
|
name: `['${field.name}']`,
|
|
20
|
-
context: _profileFormContext.ProfileFormContext
|
|
21
|
-
|
|
22
|
+
context: _profileFormContext.ProfileFormContext,
|
|
23
|
+
label: field.label,
|
|
24
|
+
testID: field.testID,
|
|
25
|
+
disabled: field.disabled ?? field.inputProps?.disabled,
|
|
26
|
+
editable: field.disabled ? false : field.inputProps?.editable,
|
|
27
|
+
keyboardType: field.keyboardType ?? field.inputProps?.keyboardType
|
|
28
|
+
});
|
|
22
29
|
}
|
|
23
30
|
if (field.type === "date") {
|
|
24
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_formDateField.FormDateField, {
|
|
25
|
-
...field,
|
|
26
32
|
name: `['${field.name}']`,
|
|
27
|
-
context: _profileFormContext.ProfileFormContext
|
|
28
|
-
|
|
33
|
+
context: _profileFormContext.ProfileFormContext,
|
|
34
|
+
label: field.label,
|
|
35
|
+
testID: field.testID,
|
|
36
|
+
disabled: field.disabled,
|
|
37
|
+
mode: field.mode,
|
|
38
|
+
initialDate: field.initialDate,
|
|
39
|
+
minimumDate: field.minimumDate,
|
|
40
|
+
maximumDate: field.maximumDate,
|
|
41
|
+
display: field.display,
|
|
42
|
+
locale: field.locale,
|
|
43
|
+
formatValue: field.formatValue
|
|
44
|
+
});
|
|
29
45
|
}
|
|
30
46
|
if (field.type === "select") {
|
|
31
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.FormSelect, {
|
|
32
|
-
...field,
|
|
33
48
|
context: _profileFormContext.ProfileFormContext,
|
|
34
49
|
labelField: "label",
|
|
35
50
|
valueField: "value",
|
|
36
|
-
name: `['${field.name}']
|
|
37
|
-
|
|
51
|
+
name: `['${field.name}']`,
|
|
52
|
+
label: field.label,
|
|
53
|
+
options: field.options,
|
|
54
|
+
testID: field.testID,
|
|
55
|
+
disable: field.disabled
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (field.type === "choice") {
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_profileFormChoiceField.ProfileFormChoiceField, {
|
|
60
|
+
name: `['${field.name}']`,
|
|
61
|
+
label: field.label,
|
|
62
|
+
options: field.options,
|
|
63
|
+
disabled: field.disabled,
|
|
64
|
+
testID: field.testID
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (field.type === "phone") {
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_formPhoneField.FormPhoneField, {
|
|
69
|
+
name: `['${field.name}']`,
|
|
70
|
+
fieldName: field.name,
|
|
71
|
+
label: field.label,
|
|
72
|
+
defaultCountry: field.defaultCountry,
|
|
73
|
+
countryName: field.countryName,
|
|
74
|
+
disabled: field.disabled,
|
|
75
|
+
testID: field.testID
|
|
76
|
+
});
|
|
38
77
|
}
|
|
39
78
|
return null;
|
|
40
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_index","_formDateField","_profileFormContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProfileFormFieldComponent","field","type","jsx","FormField","name","context","ProfileFormContext","FormDateField","FormSelect","labelField","valueField","exports"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/profile-form-field-component.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_index","_formDateField","_profileFormContext","_formPhoneField","_profileFormChoiceField","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProfileFormFieldComponent","field","type","jsx","FormField","inputProps","name","context","ProfileFormContext","label","testID","disabled","editable","keyboardType","FormDateField","mode","initialDate","minimumDate","maximumDate","display","locale","formatValue","FormSelect","labelField","valueField","options","disable","ProfileFormChoiceField","FormPhoneField","fieldName","defaultCountry","countryName","exports"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/profile-form-field-component.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAGA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AAAqE,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,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AAKL,KAAK,CAACK,IAAI,IAAK;MAC1BuB,SAAS,EAAE5B,KAAK,CAACK,IAAK;MACtBG,KAAK,EAAER,KAAK,CAACQ,KAAM;MACnBqB,cAAc,EAAE7B,KAAK,CAAC6B,cAAe;MACrCC,WAAW,EAAE9B,KAAK,CAAC8B,WAAY;MAC/BpB,QAAQ,EAAEV,KAAK,CAACU,QAAS;MACzBD,MAAM,EAAET,KAAK,CAACS;IAAO,CACtB,CAAC;EAEN;EAEA,OAAO,IAAI;AACb,CAAC;AAACsB,OAAA,CAAAhC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ProfileFormProvider = void 0;
|
|
7
7
|
var _core = require("@ovok/core");
|
|
8
8
|
var _formik = require("formik");
|
|
9
|
+
var _libphonenumberJs = require("libphonenumber-js");
|
|
9
10
|
var _react = _interopRequireDefault(require("react"));
|
|
10
11
|
var Yup = _interopRequireWildcard(require("yup"));
|
|
11
12
|
var _useShallowStableValue = require("../../../helpers/hooks/use-shallow-stable-value.js");
|
|
12
13
|
var _profileFormContext = require("../contexts/profile-form-context.js");
|
|
14
|
+
var _phone = require("../utils/phone.js");
|
|
13
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -20,9 +22,14 @@ const ProfileFormProvider = ({
|
|
|
20
22
|
onSuccess
|
|
21
23
|
}) => {
|
|
22
24
|
const client = (0, _core.useClient)();
|
|
25
|
+
const submitInProgress = _react.default.useRef(false);
|
|
23
26
|
const initialValues = _react.default.useMemo(() => {
|
|
24
27
|
const values = fields.reduce((acc, field) => {
|
|
25
|
-
|
|
28
|
+
const value = field.type === "phone" ? (0, _phone.toPhoneE164)(field.value ?? "", field.defaultCountry) : field.value ?? "";
|
|
29
|
+
acc[field.name] = value;
|
|
30
|
+
if (field.type === "phone") {
|
|
31
|
+
acc[(0, _phone.phoneCountryFieldName)(field.name)] = (0, _libphonenumberJs.parsePhoneNumberFromString)(value)?.country ?? field.defaultCountry;
|
|
32
|
+
}
|
|
26
33
|
return acc;
|
|
27
34
|
}, {});
|
|
28
35
|
return {
|
|
@@ -32,7 +39,14 @@ const ProfileFormProvider = ({
|
|
|
32
39
|
}, [fields]);
|
|
33
40
|
const validationSchema = _react.default.useMemo(() => {
|
|
34
41
|
const fieldRules = fields.reduce((acc, field) => {
|
|
35
|
-
|
|
42
|
+
const validation = field.validation ?? Yup.string();
|
|
43
|
+
acc[field.name] = field.type === "phone" ? validation.test("phone-country", "profile.form.phone.invalid", function validatePhone(value) {
|
|
44
|
+
if (!value) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
const country = this.parent[(0, _phone.phoneCountryFieldName)(field.name)] ?? field.defaultCountry;
|
|
48
|
+
return (0, _phone.isPhoneValidForCountry)(value, country);
|
|
49
|
+
}) : validation;
|
|
36
50
|
return acc;
|
|
37
51
|
}, {});
|
|
38
52
|
return Yup.object().shape(fieldRules);
|
|
@@ -43,38 +57,54 @@ const ProfileFormProvider = ({
|
|
|
43
57
|
validateOnBlur: true,
|
|
44
58
|
validationSchema,
|
|
45
59
|
onSubmit: async (values, formikHelpers) => {
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
60
|
+
if (submitInProgress.current) {
|
|
61
|
+
return;
|
|
48
62
|
}
|
|
63
|
+
submitInProgress.current = true;
|
|
49
64
|
try {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
let path = `/${field.name}`;
|
|
58
|
-
if (field.name.includes("[")) {
|
|
59
|
-
path = `/${field.name.split(/[[\].]/).filter(Boolean).join("/")}`;
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
op,
|
|
63
|
-
path,
|
|
64
|
-
value
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
const filteredOperations = operations.filter(op => Boolean(op) && op?.path !== "/submit");
|
|
68
|
-
const activeProfile = await client.getProfileAsync();
|
|
69
|
-
const response = await client.patchResource("Patient", activeProfile?.id ?? "", filteredOperations);
|
|
70
|
-
client.refetchProfile();
|
|
71
|
-
onSuccess?.(response);
|
|
72
|
-
} catch (error) {
|
|
73
|
-
if (error instanceof Error) {
|
|
74
|
-
formikHelpers.setFieldError("submit", error.message);
|
|
65
|
+
const submittedValues = fields.reduce((submitted, field) => {
|
|
66
|
+
submitted[field.name] = values[field.name] ?? "";
|
|
67
|
+
return submitted;
|
|
68
|
+
}, {});
|
|
69
|
+
if (onSubmit) {
|
|
70
|
+
await onSubmit(submittedValues, formikHelpers);
|
|
75
71
|
return;
|
|
76
72
|
}
|
|
77
|
-
|
|
73
|
+
try {
|
|
74
|
+
const activeProfile = (await client.refetchProfile()) ?? (await client.getProfileAsync());
|
|
75
|
+
const patient = activeProfile;
|
|
76
|
+
const operations = fields.flatMap(field => {
|
|
77
|
+
const value = values[field.name];
|
|
78
|
+
if (field.toPatch) {
|
|
79
|
+
return field.toPatch(value ?? "", patient);
|
|
80
|
+
}
|
|
81
|
+
const initialValue = initialValues[field.name];
|
|
82
|
+
const op = (0, _core.getPatchOperationType)(initialValue, value);
|
|
83
|
+
if (!op) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
let path = `/${field.name}`;
|
|
87
|
+
if (field.name.includes("[")) {
|
|
88
|
+
path = `/${field.name.split(/[[\].]/).filter(Boolean).join("/")}`;
|
|
89
|
+
}
|
|
90
|
+
return [{
|
|
91
|
+
op,
|
|
92
|
+
path,
|
|
93
|
+
value
|
|
94
|
+
}];
|
|
95
|
+
});
|
|
96
|
+
const response = await client.patchResource("Patient", activeProfile?.id ?? "", operations.filter(op => op.path !== "/submit"));
|
|
97
|
+
client.refetchProfile();
|
|
98
|
+
onSuccess?.(response, submittedValues);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (error instanceof Error) {
|
|
101
|
+
formikHelpers.setFieldError("submit", error.message);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
formikHelpers.setFieldError("submit", "profile.form.error.generic");
|
|
105
|
+
}
|
|
106
|
+
} finally {
|
|
107
|
+
submitInProgress.current = false;
|
|
78
108
|
}
|
|
79
109
|
}
|
|
80
110
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_formik","_react","_interopRequireDefault","Yup","_interopRequireWildcard","_useShallowStableValue","_profileFormContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProfileFormProvider","children","fields","onSubmit","onSuccess","client","useClient","
|
|
1
|
+
{"version":3,"names":["_core","require","_formik","_libphonenumberJs","_react","_interopRequireDefault","Yup","_interopRequireWildcard","_useShallowStableValue","_profileFormContext","_phone","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProfileFormProvider","children","fields","onSubmit","onSuccess","client","useClient","submitInProgress","React","useRef","initialValues","useMemo","values","reduce","acc","field","value","type","toPhoneE164","defaultCountry","name","phoneCountryFieldName","parsePhoneNumberFromString","country","submit","validationSchema","fieldRules","validation","string","test","validatePhone","parent","isPhoneValidForCountry","object","shape","formik","useFormik","enableReinitialize","validateOnBlur","formikHelpers","current","submittedValues","submitted","activeProfile","refetchProfile","getProfileAsync","patient","operations","flatMap","toPatch","initialValue","op","getPatchOperationType","path","includes","split","filter","Boolean","join","response","patchResource","id","error","Error","setFieldError","message","contextValue","useShallowStableValue","jsx","ProfileFormContext","Provider","exports"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/profile-form-provider.tsx"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,GAAA,GAAAC,uBAAA,CAAAN,OAAA;AAEA,IAAAO,sBAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AAGA,IAAAS,MAAA,GAAAT,OAAA;AAIwB,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAM,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAA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AAC,QAAQ,CAAC,CACfC,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC,EAAE;YAChB;YAEA,OAAO,CACL;cACEP,EAAE;cACFE,IAAI;cACJrC;YACF,CAAC,CACF;UACH,CAAC,CAAC;UAEF,MAAM2C,QAAQ,GAAG,MAAMtD,MAAM,CAACuD,aAAa,CACzC,SAAS,EACTjB,aAAa,EAAEkB,EAAE,IAAI,EAAE,EACvBd,UAAU,CAACS,MAAM,CAAEL,EAAE,IAAKA,EAAE,CAACE,IAAI,KAAK,SAAS,CACjD,CAAC;UAEDhD,MAAM,CAACuC,cAAc,CAAC,CAAC;UAEvBxC,SAAS,GAAGuD,QAAQ,EAAalB,eAAe,CAAC;QACnD,CAAC,CAAC,OAAOqB,KAAK,EAAE;UACd,IAAIA,KAAK,YAAYC,KAAK,EAAE;YAC1BxB,aAAa,CAACyB,aAAa,CAAC,QAAQ,EAAEF,KAAK,CAACG,OAAO,CAAC;YAEpD;UACF;UAEA1B,aAAa,CAACyB,aAAa,CAAC,QAAQ,EAAE,4BAA4B,CAAC;QACrE;MACF,CAAC,SAAS;QACRzD,gBAAgB,CAACiC,OAAO,GAAG,KAAK;MAClC;IACF;EACF,CAAC,CAAC;EAEF,MAAM0B,YAAY,GAAG,IAAAC,4CAAqB,EAAC;IAAE,GAAGhC;EAAO,CAAC,CAAC;EAEzD,oBACE,IAAAvD,WAAA,CAAAwF,GAAA,EAAC1F,mBAAA,CAAA2F,kBAAkB,CAACC,QAAQ;IAACtD,KAAK,EAAEkD,YAAa;IAAAjE,QAAA,EAC9CA;EAAQ,CACkB,CAAC;AAElC,CAAC;AAACsE,OAAA,CAAAvE,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -46,6 +46,8 @@ const ProfileForm = ({
|
|
|
46
46
|
onPress: () => handleSubmit(),
|
|
47
47
|
style: styles.button,
|
|
48
48
|
loading: isSubmitting,
|
|
49
|
+
disabled: isSubmitting,
|
|
50
|
+
testID: testID ? `${testID}-submit` : undefined,
|
|
49
51
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePaper.Text, {
|
|
50
52
|
style: [styles.buttonText, {
|
|
51
53
|
color: theme.colors.onPrimary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactI18next","require","_reactNative","_reactNativePaper","_index","_index2","_useProfileForm","_profileFormFieldComponent","_jsxRuntime","ProfileForm","style","fields","testID","theme","useAppTheme","t","useTranslation","isSubmitting","errors","handleSubmit","useProfileForm","jsxs","View","styles","container","padding","spacing","children","jsx","gap","map","field","ProfileFormFieldComponent","name","Button","mode","onPress","button","loading","Text","buttonText","color","colors","onPrimary","Conditional","condition","submit","HelperText","type","exports","StyleSheet","create","flex","input","width","fontSize"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/profile-form.tsx"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAGA,IAAAM,0BAAA,GAAAN,OAAA;AAA2E,IAAAO,WAAA,GAAAP,OAAA;AAEpE,MAAMQ,WAAW,GAAGA,CAAC;EAC1BC,KAAK;EACLC,MAAM;EACNC;AACkC,CAAC,KAAK;EACxC,MAAMC,KAAK,GAAG,IAAAC,mBAAW,EAAC,CAAC;EAE3B,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAAC,CAAC;EAE9B,MAAM;IAAEC,YAAY;IAAEC,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,8BAAc,EAAC,CAAC;EAE/D,oBACE,IAAAZ,WAAA,CAAAa,IAAA,EAACnB,YAAA,CAAAoB,IAAI;IACHZ,KAAK,EAAE,CAACa,MAAM,CAACC,SAAS,EAAE;MAAEC,OAAO,EAAEZ,KAAK,CAACa,OAAO,CAAC,CAAC;IAAE,CAAC,EAAEhB,KAAK,CAAE;IAChEE,MAAM,EAAEA,MAAO;IAAAe,QAAA,gBAEf,IAAAnB,WAAA,CAAAoB,GAAA,EAAC1B,YAAA,CAAAoB,IAAI;MAACZ,KAAK,EAAE;QAAEmB,GAAG,EAAEhB,KAAK,CAACa,OAAO,CAAC,CAAC;MAAE,CAAE;MAAAC,QAAA,EACpChB,MAAM,CAACmB,GAAG,CAAEC,KAAK,iBAChB,IAAAvB,WAAA,CAAAoB,GAAA,EAACrB,0BAAA,CAAAyB,yBAAyB;QAAkBD,KAAK,EAAEA;MAAM,GAAzBA,KAAK,CAACE,IAAqB,CAC5D;IAAC,CACE,CAAC,eAEP,IAAAzB,WAAA,CAAAoB,GAAA,EAAC1B,YAAA,CAAAoB,IAAI;MAACZ,KAAK,EAAEa,MAAM,CAACG;IAAQ,CAAE,CAAC,eAE/B,IAAAlB,WAAA,CAAAa,IAAA,EAACnB,YAAA,CAAAoB,IAAI;MAAAK,QAAA,gBACH,IAAAnB,WAAA,CAAAoB,GAAA,EAACzB,iBAAA,CAAA+B,MAAM;QACLC,IAAI,EAAC,WAAW;QAChBC,OAAO,EAAEA,CAAA,KAAMjB,YAAY,CAAC,CAAE;QAC9BT,KAAK,EAAEa,MAAM,CAACc,MAAO;QACrBC,OAAO,EAAErB,YAAa;
|
|
1
|
+
{"version":3,"names":["_reactI18next","require","_reactNative","_reactNativePaper","_index","_index2","_useProfileForm","_profileFormFieldComponent","_jsxRuntime","ProfileForm","style","fields","testID","theme","useAppTheme","t","useTranslation","isSubmitting","errors","handleSubmit","useProfileForm","jsxs","View","styles","container","padding","spacing","children","jsx","gap","map","field","ProfileFormFieldComponent","name","Button","mode","onPress","button","loading","disabled","undefined","Text","buttonText","color","colors","onPrimary","Conditional","condition","submit","HelperText","type","exports","StyleSheet","create","flex","input","width","fontSize"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/profile-form.tsx"],"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