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

154 lines
4.3 KiB
TypeScript
Raw Normal View History

// Module ID: 7070
// Function ID: 7071
// Name: PhoneOrEmailInput
// Dependencies: [32, 19, 21, 7071, 7072, 1115, 7074, 2]
2026-07-20 16:05:17 +00:00
// Module 7070 (PhoneOrEmailInput)
import util from "util" /* 1115 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const jsx = fn(21).jsx;
const size = fn(2);
let result = size.fileFinishedImporting("modules/phone/native/PhoneOrEmailInput.tsx");
export default noop.forwardRef((onChange, ref) => {
2026-07-20 16:05:17 +00:00
onChange = onChange.onChange;
({ alpha2, countryCode } = onChange);
const onPressCountrySelector = onChange.onPressCountrySelector;
const forceMode = onChange.forceMode;
const merged = Object.assign(onChange, Object.assign({ onChange: 0, alpha2: 0, countryCode: 0, onPressCountrySelector: 0, forceMode: 0 }));
noop = undefined;
[tmp3, c4] = forceMode(noop.useState(""), 2);
ref = noop.useRef(null);
const imperativeHandle = noop.useImperativeHandle(ref, () => ({
2026-07-20 16:05:17 +00:00
blur() {
const current = ref.current;
2026-07-20 16:05:17 +00:00
let blurResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
blurResult = current.blur();
}
return blurResult;
},
focus() {
const current = ref.current;
2026-07-20 16:05:17 +00:00
let focusResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
focusResult = current.focus();
}
return focusResult;
},
isFocused() {
const current = ref.current;
2026-07-29 08:29:29 +00:00
let flag;
if (current != null) {
flag = current.isFocused();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
}
return flag;
2026-07-20 16:05:17 +00:00
},
setText(arg0) {
_undefined(arg0);
const current = ref.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.setText(arg0);
}
},
getText() {
const current = ref.current;
2026-07-29 08:29:29 +00:00
let str;
if (current != null) {
str = current.getText();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
return str;
},
measure(arg0) {
const current = ref.current;
2026-07-20 16:05:17 +00:00
let measureResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
measureResult = current.measure(arg0);
}
return measureResult;
},
measureInWindow(arg0) {
const current = ref.current;
2026-07-20 16:05:17 +00:00
let measureInWindowResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
measureInWindowResult = current.measureInWindow(arg0);
}
return measureInWindowResult;
},
measureLayout(arg0, arg1, arg2) {
const current = ref.current;
2026-07-20 16:05:17 +00:00
let measureLayoutResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
measureLayoutResult = current.measureLayout(arg0, arg1, arg2);
}
return measureLayoutResult;
}
}), []);
let obj = noop;
const tmp2 = forceMode(noop.useState(""), 2);
2026-07-29 08:29:29 +00:00
const tmp6 = onChange;
const tmp7 = onPressCountrySelector;
2026-07-20 16:05:17 +00:00
const items = [countryCode, forceMode, onChange];
2026-07-29 08:29:29 +00:00
const result = onChange(onPressCountrySelector[3]).shouldShowCountryCodeSelector(forceMode, tmp3);
const callback = noop.useCallback((value) => {
2026-07-29 08:29:29 +00:00
_undefined(value);
2026-07-20 16:05:17 +00:00
let str = "";
if (obj.shouldShowCountryCodeSelector(forceMode, value)) {
str = countryCode;
}
2026-07-29 08:29:29 +00:00
if (onChange != null) {
2026-07-20 16:05:17 +00:00
onChange(value, str);
}
}, items);
2026-07-29 08:29:29 +00:00
const tmp10 = countryCode(onPressCountrySelector[4])(callback);
2026-08-24 06:08:38 +00:00
closure_6 = tmp10;
2026-07-29 08:29:29 +00:00
const items1 = [countryCode, tmp10];
const effect = noop.useEffect(() => {
2026-07-20 16:05:17 +00:00
const current = ref.current;
2026-07-29 08:29:29 +00:00
let str;
if (current != null) {
str = current.getText();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_6(str);
2026-07-20 16:05:17 +00:00
}, items1);
let combined;
2026-07-20 16:05:17 +00:00
if (result) {
2026-07-29 08:29:29 +00:00
if (alpha2 == null) {
alpha2 = "";
2026-07-20 16:05:17 +00:00
}
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
combined = "" + alpha2 + " " + countryCode;
2026-07-20 16:05:17 +00:00
}
const items2 = [combined, onPressCountrySelector];
2026-07-29 08:29:29 +00:00
const memo = obj.useMemo(() => {
const obj = { onPress: onPressCountrySelector, accessibilityRole: "button", accessibilityLabel: null, accessibilityHint: null };
let str = combined;
if (combined == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
obj.accessibilityLabel = str;
const intl = util.intl;
obj.accessibilityHint = intl.string(util.t.GwAW3k);
2026-07-20 16:05:17 +00:00
return obj;
}, items2);
const obj3 = {};
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
obj3.ref = ref;
obj3.onChange = callback;
obj3.leadingText = combined;
obj3.leadingPressableProps = memo;
return ref(tmp6(tmp7[6]).SplitTextInput, obj3);
2026-07-20 16:05:17 +00:00
});