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

110 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-06 08:05:19 +00:00
// Module ID: 7900
// Function ID: 7901
2026-07-29 08:29:29 +00:00
// Name: TextAreaField
2026-08-06 08:05:19 +00:00
// Dependencies: [19, 17, 21, 4285, 712, 5921, 5915, 3990, 7901, 1236, 5924, 4281, 2]
2026-07-20 16:05:17 +00:00
2026-08-06 08:05:19 +00:00
// Module 7900 (TextAreaField)
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";
import importAllResult from "noop";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c3;
let c4;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: c3, jsxs: c4 } = jsxProd);
let obj = { area: { height: 128, textAlignVertical: "top" }, maxLengthIndicator: null };
obj = { position: "absolute", bottom: require("Themes").space.PX_4, right: require("Themes").space.PX_16 };
obj[1] = obj;
let closure_5 = createCacheKey.createStyles(obj);
const forwardRefResult = require("noop").forwardRef((isDisabled, ref) => {
2026-07-20 16:05:17 +00:00
let focusProps;
let innerRef;
let inputProps;
let isFocused;
2026-07-29 08:29:29 +00:00
let state;
2026-07-25 08:10:48 +00:00
let label = isDisabled;
2026-07-29 08:29:29 +00:00
let obj = dependencyMap;
2026-08-06 08:05:19 +00:00
let obj1 = require(5921) /* useInputStyles */;
2026-07-23 10:11:24 +00:00
obj = { size: "lg", isRound: false, isDisabled: isDisabled.isDisabled };
2026-07-29 08:29:29 +00:00
const inputStyles = obj1.useInputStyles(obj);
2026-07-20 16:05:17 +00:00
const tmp2 = callback2();
const maxLength = isDisabled.maxLength;
2026-08-06 08:05:19 +00:00
let obj3 = require(5915) /* useTextFieldState */;
2026-07-29 08:29:29 +00:00
const textField = obj3.useTextField(isDisabled, ref);
({ state, inputProps, innerRef } = textField);
2026-08-06 08:05:19 +00:00
let obj4 = require(3990) /* getNodeText */;
2026-07-29 08:29:29 +00:00
const focus = obj4.useFocus();
2026-07-20 16:05:17 +00:00
let diff;
({ focusProps, isFocused } = focus);
if (null != maxLength) {
2026-07-29 08:29:29 +00:00
diff = maxLength - state.value.length;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
const result = _8Q_k1s(7901);
2026-07-29 08:29:29 +00:00
obj = { currentLength: state.value.length, maxLength, message: null };
const intl = _8Q_k1s(1236).intl;
obj[2] = intl.string(_8Q_k1s(1236).t.c2Jqed);
const characterLimitAnnouncement = result.useCharacterLimitAnnouncement(obj);
obj1 = {};
2026-07-25 08:10:48 +00:00
const merged = Object.assign(label);
2026-07-29 08:29:29 +00:00
obj1.isFocused = isFocused;
const obj2 = {};
2026-08-06 08:05:19 +00:00
const result1 = _8Q_k1s(3990);
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(result1.mergeProps(inputProps, focusProps));
obj2.ref = innerRef;
2026-07-20 16:05:17 +00:00
const items = [, , ];
({ padding: arr[0], text: arr[1] } = inputStyles);
items[2] = tmp2.area;
2026-07-29 08:29:29 +00:00
obj2.style = items;
obj2.placeholderTextColor = inputStyles.placeholderText.color;
obj2.multiline = true;
2026-08-06 08:05:19 +00:00
const items1 = [callback(_8Q_k1s(5924).NativeTextInput, obj2), ];
2026-07-25 08:10:48 +00:00
if (null == diff) {
items1[1] = null;
2026-07-29 08:29:29 +00:00
obj1.children = items1;
2026-08-06 08:05:19 +00:00
return closure_4(_8Q_k1s(5921).InputFieldContainer, obj1);
2026-07-25 08:10:48 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj3 = { style: null, children: null };
obj3[0] = tmp2.maxLengthIndicator;
let str3 = "text-muted";
let str = "text-muted";
if (null != maxLength) {
str = str3;
if (null != diff) {
let str2 = "text-feedback-critical";
if (diff > 0) {
if (diff < maxLength / 9) {
str3 = "text-feedback-warning";
}
str2 = str3;
}
str = str2;
}
}
obj4 = { variant: "text-xs/semibold", color: null, accessibilityLabel: null, children: null };
obj4[1] = str;
2026-08-04 21:03:28 +00:00
if (typeof label.label === "string") {
2026-07-29 08:29:29 +00:00
const intl2 = _8Q_k1s(1236).intl;
obj = { label: null, remainingCharacters: null };
2026-07-25 08:10:48 +00:00
label = label.label;
2026-07-29 08:29:29 +00:00
obj[0] = label;
obj[1] = diff;
let formatToPlainStringResult = intl2.formatToPlainString(_8Q_k1s, obj);
2026-07-25 08:10:48 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl3 = _8Q_k1s(1236).intl;
const obj5 = { remainingCharacters: null };
obj5[0] = diff;
formatToPlainStringResult = intl3.formatToPlainString(_8Q_k1s(1236).t.fR1cof, obj5);
2026-07-25 08:10:48 +00:00
}
2026-07-29 08:29:29 +00:00
obj4[2] = formatToPlainStringResult;
obj4[3] = diff;
2026-08-06 08:05:19 +00:00
obj4 = tmp9(_8Q_k1s(4281).Text, obj4);
2026-07-29 08:29:29 +00:00
obj3[1] = obj4;
tmp9(View, obj3);
const tmp13 = View;
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
let result = require("jsxProd").fileFinishedImporting("design/components/TextField/native/TextAreaField.native.tsx");
2026-07-20 16:05:17 +00:00
export const TextAreaField = forwardRefResult;