decord/source/modules/phone/native/FormPhoneOrEmail.tsx

154 lines
5.4 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 8303
// Function ID: 8304
2026-07-20 16:05:17 +00:00
// Name: CountryCodeSelector
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 17, 21, 4255, 712, 4797, 1236, 4251, 8273, 8249, 8250, 8252, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 8303 (CountryCodeSelector)
2026-07-29 08:29:29 +00:00
import importAllResult from "noop";
2026-07-23 10:11:24 +00:00
import { View } from "get ActivityIndicator";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
2026-07-20 16:05:17 +00:00
function CountryCodeSelector(alpha2) {
let countryCode;
let onPress;
let show;
2026-07-29 08:29:29 +00:00
let str = alpha2.alpha2;
2026-07-20 16:05:17 +00:00
({ show, countryCode, onPress } = alpha2);
const tmp = callback3();
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
const combined = "" + str + " " + countryCode;
let tmp3 = null;
if (show) {
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
obj[0] = tmp.selectorOuterContainer;
obj = { style: null, children: null };
obj[0] = tmp.selectorContainer;
obj = { onPress: null, style: null, androidRippleConfig: null, accessibilityRole: "button", accessibilityLabel: null, accessibilityHint: null, children: null };
obj[0] = onPress;
obj[1] = tmp.selectorPressable;
obj[2] = { borderless: true };
obj[4] = combined;
const intl = require(1236) /* getSystemLocale */.intl;
obj[5] = intl.string(require(1236) /* getSystemLocale */.t.GwAW3k);
const obj1 = { style: null, variant: "text-md/medium", color: "mobile-text-heading-primary", children: null };
obj1[0] = tmp.selectorText;
obj1[3] = combined;
2026-08-05 07:35:12 +00:00
obj[6] = callback(require(4251) /* Text */.Text, obj1);
const items = [callback(require(4797) /* PressableBase */.PressableOpacity, obj), ];
2026-07-29 08:29:29 +00:00
const obj2 = { style: null };
obj2[0] = tmp.separator;
items[1] = callback(View, obj2);
obj[1] = items;
obj[1] = callback2(View, obj);
2026-07-20 16:05:17 +00:00
tmp3 = callback(View, obj);
}
return tmp3;
}
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
({ jsx: c5, jsxs: closure_6 } = jsxProd);
let obj = { label: { marginBottom: 8 }, input: { flexGrow: 1, marginBottom: 8 }, error: { marginBottom: 8 }, hint: { marginBottom: 8 }, selectorOuterContainer: { overflow: "hidden" }, selectorContainer: { flex: 1, flexDirection: "row" }, selectorPressable: { justifyContent: "center" }, selectorText: { alignSelf: "center" }, separator: null };
obj = { borderLeftWidth: 1, borderLeftColor: require("Themes").colors.INTERACTIVE_BACKGROUND_SELECTED, marginHorizontal: 12, marginVertical: -4 };
obj[8] = obj;
let closure_7 = createCacheKey.createStyles(obj);
const forwardRefResult = importAllResult.forwardRef((arg0, ref) => {
2026-07-23 10:11:24 +00:00
let closure_3;
2026-07-20 16:05:17 +00:00
let countryCode;
let error;
let forceMode;
let hint;
2026-07-23 10:11:24 +00:00
let importDefault;
2026-07-20 16:05:17 +00:00
let label;
2026-07-23 10:11:24 +00:00
let require;
2026-07-20 16:05:17 +00:00
let style;
let textInputStyle;
let value;
2026-07-23 10:11:24 +00:00
({ label, error, value, hint, onChangeText: require, alpha2: importDefault, countryCode } = arg0);
2026-07-20 16:05:17 +00:00
({ onPressCountrySelector: closure_3, forceMode } = arg0);
({ style, textInputStyle } = arg0);
2026-07-29 08:29:29 +00:00
const merged = Object.assign(arg0, Object.create(null));
let callback;
let obj;
let callback3;
2026-07-20 16:05:17 +00:00
function handleChangeText(value) {
let str = "";
if (obj.shouldShowCountryCodeSelector(forceMode, value)) {
str = countryCode;
}
2026-07-29 08:29:29 +00:00
if (callback != null) {
2026-07-20 16:05:17 +00:00
callback(value, str);
}
}
2026-07-29 08:29:29 +00:00
const tmp2 = callback3();
obj = require(countryCode[8]);
callback = obj.shouldShowCountryCodeSelector(forceMode, value);
2026-07-20 16:05:17 +00:00
obj = { handleChangeText, value };
2026-07-23 10:11:24 +00:00
callback3 = importAllResult.useRef(obj);
2026-07-20 16:05:17 +00:00
const effect = importAllResult.useEffect(() => {
closure_7.current = obj;
});
const items = [countryCode];
const effect1 = importAllResult.useEffect(() => {
ref.current.handleChangeText(ref.current.value);
}, items);
2026-07-29 08:29:29 +00:00
obj = { style, children: null };
let tmp9 = null;
2026-07-20 16:05:17 +00:00
if (null != label) {
2026-07-29 08:29:29 +00:00
const obj1 = { style: null, children: null };
obj1[0] = tmp2.label;
obj1[1] = label;
tmp9 = callback(importDefault(tmp4[9]), obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items1 = [tmp9, , , ];
2026-07-20 16:05:17 +00:00
const obj2 = {};
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj2.renderLeadingComponent = function renderLeadingComponent() {
2026-07-23 10:11:24 +00:00
return callback2(outer1_8, { show: callback2, alpha2: closure_1, countryCode, onPress: closure_3 });
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj2.error = null != error;
obj2.ref = ref;
obj2.value = value;
const items2 = [tmp2.input, textInputStyle];
obj2.style = items2;
obj2.onChangeText = handleChangeText;
2026-07-20 16:05:17 +00:00
let str = "emailAddress";
2026-07-23 10:11:24 +00:00
if (forceMode === require(countryCode[8]).PhoneOrEmailSelectorForceMode.PHONE) {
2026-07-20 16:05:17 +00:00
str = "telephoneNumber";
}
2026-07-29 08:29:29 +00:00
obj2.textContentType = str;
2026-07-20 16:05:17 +00:00
let str2 = "email-address";
2026-07-23 10:11:24 +00:00
if (forceMode === require(countryCode[8]).PhoneOrEmailSelectorForceMode.PHONE) {
2026-07-20 16:05:17 +00:00
str2 = "phone-pad";
}
2026-07-29 08:29:29 +00:00
obj2.keyboardType = str2;
obj2.accessibilityLabel = label;
obj2.accessibilityHint = hint;
2026-07-23 10:11:24 +00:00
items1[1] = callback(importDefault(countryCode[10]), obj2);
2026-07-29 08:29:29 +00:00
let tmp12Result = null;
2026-07-20 16:05:17 +00:00
if (null != error) {
2026-07-29 08:29:29 +00:00
const obj3 = { style: null, children: null };
obj3[0] = tmp2.error;
obj3[1] = error;
tmp12Result = tmp12(importDefault(tmp4[11]), obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items1[2] = tmp12Result;
tmp12Result = null;
2026-07-20 16:05:17 +00:00
if (null != hint) {
2026-07-29 08:29:29 +00:00
const obj4 = { style: null, variant: "text-xs/medium", color: "text-muted", children: null };
obj4[0] = tmp2.hint;
obj4[3] = hint;
tmp12Result = tmp12(tmp3(tmp4[7]).Text, obj4);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items1[3] = tmp12Result;
obj[1] = items1;
2026-07-23 10:11:24 +00:00
return obj(forceMode, obj);
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const result = require("jsxProd").fileFinishedImporting("modules/phone/native/FormPhoneOrEmail.tsx");
2026-07-20 16:05:17 +00:00
export default forwardRefResult;