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

155 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8636
// Function ID: 8637
// Dependencies: [32, 19, 21, 8637, 8638, 1236, 8640, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 8636
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import { jsx } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
const forwardRefResult = importAllResult.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;
2026-07-29 08:29:29 +00:00
const merged = Object.assign(onChange, Object.create(null));
ref = undefined;
2026-08-24 06:08:38 +00:00
closure_6 = undefined;
2026-07-20 16:05:17 +00:00
let combined;
2026-07-29 08:29:29 +00:00
let obj = importAllResult;
[tmp3, c4] = forceMode(undefined.useState(""), 2);
ref = importAllResult.useRef(null);
const imperativeHandle = importAllResult.useImperativeHandle(ref, () => ({
2026-07-20 16:05:17 +00:00
blur() {
2026-07-29 08:29:29 +00:00
const current = closure_5.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() {
2026-07-29 08:29:29 +00:00
const current = closure_5.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() {
2026-07-29 08:29:29 +00:00
const current = closure_5.current;
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) {
2026-07-29 08:29:29 +00:00
callback(arg0);
const current = closure_5.current;
if (current != null) {
2026-07-20 16:05:17 +00:00
current.setText(arg0);
}
},
getText() {
2026-07-29 08:29:29 +00:00
const current = closure_5.current;
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) {
2026-07-29 08:29:29 +00:00
const current = closure_5.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) {
2026-07-29 08:29:29 +00:00
const current = closure_5.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) {
2026-07-29 08:29:29 +00:00
const current = closure_5.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;
}
}), []);
2026-07-29 08:29:29 +00:00
const tmp2 = forceMode(undefined.useState(""), 2);
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);
2026-07-23 10:11:24 +00:00
const callback = importAllResult.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];
2026-07-20 16:05:17 +00:00
const effect = importAllResult.useEffect(() => {
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);
combined = undefined;
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
}
2026-07-29 08:29:29 +00:00
obj[2] = str;
2026-07-20 16:05:17 +00:00
const intl = onChange(onPressCountrySelector[5]).intl;
2026-07-29 08:29:29 +00:00
obj[3] = intl.string(onChange(onPressCountrySelector[5]).t.GwAW3k);
2026-07-20 16:05:17 +00:00
return obj;
}, items2);
obj = {};
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.ref = ref;
obj.onChange = callback;
obj.leadingText = combined;
obj.leadingPressableProps = memo;
return ref(tmp6(tmp7[6]).SplitTextInput, obj);
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/phone/native/PhoneOrEmailInput.tsx");
2026-07-20 16:05:17 +00:00
export default forwardRefResult;