decord/source/design/components/TextField/native/BaseTextField.native.tsx

101 lines
3.3 KiB
TypeScript
Raw Normal View History

// Module ID: 6724
// Function ID: 6725
2026-07-29 08:29:29 +00:00
// Name: BaseTextField
// Dependencies: [19, 21, 1150, 6722, 4344, 6725, 4343, 2]
2026-07-20 16:05:17 +00:00
// Module 6724 (BaseTextField)
import mergeProps from "mergeProps" /* 4343 */;
import useFocus from "useFocus" /* 4344 */;
import InputFieldContainer from "InputFieldContainer" /* 6722 */;
import NativeTextInput from "NativeTextInput" /* 6725 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const jsxProd = fn(21);
({ jsx: c3, jsxs: closure_4 } = jsxProd);
const size = fn(2);
const result = size.fileFinishedImporting("design/components/TextField/native/BaseTextField.native.tsx");
export const BaseTextField = noop.forwardRef((size, ref2) => {
const inputStyles = InputFieldContainer.useInputStyles({ size: size.size, isRound: size.isRound, hasLeadingIcon: null != size.leadingIcon });
const obj2 = { size: size.size, isRound: size.isRound, hasLeadingIcon: null != size.leadingIcon };
const focus = useFocus.useFocus();
2026-07-20 16:05:17 +00:00
({ focusProps, isFocused } = focus);
const ref = noop.useRef(null);
2026-08-31 15:47:37 +00:00
let tmp6 = null;
2026-07-20 16:05:17 +00:00
if (size.enableAndroidSanitizedInputWorkaround) {
({ secureTextEntry, keyboardType, autoComplete } = size);
if (secureTextEntry === undefined) {
secureTextEntry = false;
}
if (keyboardType === undefined) {
keyboardType = "default";
}
let str = "off";
2026-08-31 15:47:37 +00:00
if (!tmpResult.isAndroid()) {
2026-07-20 16:05:17 +00:00
str = autoComplete;
}
const obj5 = { autoComplete: str, secureTextEntry: null, keyboardType: null };
tmpResult = tmp(1150);
const tmpResult5 = tmp(1150);
obj5.secureTextEntry = tmp(1150).isAndroid() || secureTextEntry;
const tmp7 = tmp(1150).isAndroid() || secureTextEntry;
2026-07-20 16:05:17 +00:00
let str2 = "visible-password";
if (!tmpResult6.isAndroid()) {
2026-07-20 16:05:17 +00:00
str2 = keyboardType;
}
obj5.keyboardType = str2;
tmp6 = obj5;
tmpResult6 = tmp(1150);
2026-07-20 16:05:17 +00:00
}
const onChangeText = size.onChangeText;
2026-07-23 10:11:24 +00:00
const items = [onChangeText];
const callback = noop.useCallback((str) => {
2026-07-29 08:29:29 +00:00
let replaced = str;
if (null != str) {
replaced = str.replace(/\r\n?|\n/g, " ");
}
if (replaced !== str) {
2026-07-23 10:11:24 +00:00
const current = ref.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
const obj = { text: replaced };
2026-07-23 10:11:24 +00:00
current.setNativeProps(obj);
}
}
2026-07-29 08:29:29 +00:00
if (onChangeText != null) {
tmp4(replaced);
2026-07-23 10:11:24 +00:00
}
}, items);
const obj6 = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(size);
obj6.isFocused = isFocused;
2026-07-23 10:11:24 +00:00
const items1 = [size.leading, , ];
const obj7 = {};
2026-08-31 15:47:37 +00:00
const merged1 = Object.assign(tmp6);
const tmp11 = React3;
const tmp9 = React4;
const merged2 = Object.assign(mergeProps.mergeProps(size, focusProps));
2026-07-29 08:29:29 +00:00
let replaced = str3;
if (null != size.value) {
replaced = str3.replace(/\r\n?|\n/g, " ");
}
obj7.value = replaced;
2026-07-29 08:29:29 +00:00
let replaced1 = str5;
if (null != size.defaultValue) {
replaced1 = str5.replace(/\r\n?|\n/g, " ");
}
obj7.defaultValue = replaced1;
obj7.onChangeText = callback;
const tmpResult7 = mergeProps;
obj7.ref = mergeProps.mergeRefs(ref, ref2);
2026-07-23 10:11:24 +00:00
const items2 = [, , ];
({ padding: arr3[0], text: arr3[1] } = inputStyles);
items2[2] = size.inputStyle;
obj7.style = items2;
obj7.placeholderTextColor = inputStyles.placeholderText.color;
items1[1] = tmp11(NativeTextInput.NativeTextInput, obj7);
2026-07-23 10:11:24 +00:00
items1[2] = size.trailing;
obj6.children = items1;
return tmp9(InputFieldContainer.InputFieldContainer, obj6);
2026-07-20 16:05:17 +00:00
});