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

106 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 6721
// Function ID: 59104
2026-07-23 10:11:24 +00:00
// Name: collapseNewlines
2026-07-28 08:39:19 +00:00
// Dependencies: [31, 33, 477, 1324, 6719, 3874, 6722, 3873, 2]
2026-07-20 16:05:17 +00:00
2026-07-28 08:39:19 +00:00
// Module 6721 (collapseNewlines)
2026-07-23 10:11:24 +00:00
import importAllResult from "result";
import jsxProd from "jsxProd";
let closure_4;
let closure_5;
const require = arg1;
function collapseNewlines(defaultValue) {
let replaced = defaultValue;
if (null != defaultValue) {
replaced = defaultValue.replace(/\r\n?|\n/g, " ");
}
return replaced;
}
({ jsx: closure_4, jsxs: closure_5 } = jsxProd);
const forwardRefResult = importAllResult.forwardRef((size, photosButtonExternalRef) => {
2026-07-20 16:05:17 +00:00
let autoComplete;
let focusProps;
let isFocused;
let keyboardType;
let secureTextEntry;
2026-07-28 08:39:19 +00:00
let obj = ref(6719);
2026-07-23 10:11:24 +00:00
obj = { size: size.size, isRound: size.isRound, hasLeadingIcon: null != size.leadingIcon, isRefreshEnabled: onChangeText(1324)("InputFieldContainer") };
2026-07-20 16:05:17 +00:00
const inputStyles = obj.useInputStyles(obj);
2026-07-28 08:39:19 +00:00
let obj2 = ref(3874);
2026-07-20 16:05:17 +00:00
const focus = obj2.useFocus();
({ focusProps, isFocused } = focus);
2026-07-23 10:11:24 +00:00
ref = importAllResult.useRef(null);
let tmp5 = 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";
}
obj = {};
let str = "off";
if (!obj5.isAndroid()) {
str = autoComplete;
}
obj.autoComplete = str;
2026-07-23 10:11:24 +00:00
obj5 = ref(477);
const tmp10 = !ref(477).isAndroid();
let tmp11 = !tmp10;
if (tmp10) {
tmp11 = secureTextEntry;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj.secureTextEntry = tmp11;
const obj6 = ref(477);
2026-07-20 16:05:17 +00:00
let str2 = "visible-password";
if (!obj7.isAndroid()) {
str2 = keyboardType;
}
obj.keyboardType = str2;
2026-07-23 10:11:24 +00:00
tmp5 = obj;
obj7 = ref(477);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
onChangeText = size.onChangeText;
const items = [onChangeText];
const callback = importAllResult.useCallback((arg0) => {
const tmp = outer1_6(arg0);
if (tmp !== arg0) {
const current = ref.current;
if (null != current) {
const obj = { text: tmp };
current.setNativeProps(obj);
}
}
if (null != onChangeText) {
onChangeText(tmp);
}
}, items);
2026-07-20 16:05:17 +00:00
const obj1 = {};
const merged = Object.assign(size);
obj1["isFocused"] = isFocused;
2026-07-23 10:11:24 +00:00
const items1 = [size.leading, , ];
2026-07-20 16:05:17 +00:00
obj2 = {};
2026-07-23 10:11:24 +00:00
const merged1 = Object.assign(tmp5);
let tmp = onChangeText(1324)("InputFieldContainer");
2026-07-28 08:39:19 +00:00
const merged2 = Object.assign(ref(3873).mergeProps(size, focusProps));
2026-07-23 10:11:24 +00:00
obj2["value"] = collapseNewlines(size.value);
obj2["defaultValue"] = collapseNewlines(size.defaultValue);
obj2["onChangeText"] = callback;
2026-07-28 08:39:19 +00:00
const obj10 = ref(3873);
obj2["ref"] = ref(3873).mergeRefs(ref, photosButtonExternalRef);
2026-07-23 10:11:24 +00:00
const items2 = [, , ];
({ padding: arr3[0], text: arr3[1] } = inputStyles);
items2[2] = size.inputStyle;
obj2["style"] = items2;
2026-07-20 16:05:17 +00:00
obj2["placeholderTextColor"] = inputStyles.placeholderText.color;
2026-07-28 08:39:19 +00:00
items1[1] = callback(ref(6722).NativeTextInput, obj2);
2026-07-23 10:11:24 +00:00
items1[2] = size.trailing;
obj1["children"] = items1;
2026-07-28 08:39:19 +00:00
return callback2(ref(6719).InputFieldContainer, obj1);
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("design/components/TextField/native/BaseTextField.native.tsx");
2026-07-20 16:05:17 +00:00
export const BaseTextField = forwardRefResult;