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

111 lines
4.1 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 8128
// Function ID: 8129
2026-07-29 08:29:29 +00:00
// Name: TextAreaField
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 17, 21, 4380, 712, 6109, 6103, 4103, 8129, 1236, 6112, 4376, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 8128 (TextAreaField)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import getNodeText from "getNodeText" /* 4103 */;
import Text from "Text" /* 4376 */;
import useTextFieldState from "useTextFieldState" /* 6103 */;
import useInputStyles from "useInputStyles" /* 6109 */;
import useKeyboardBlurring from "useKeyboardBlurring" /* 6112 */;
import useCharacterLimitAnnouncement from "useCharacterLimitAnnouncement" /* 8129 */;
2026-08-24 06:08:38 +00:00
import { View } from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-08-24 06:08:38 +00:00
import importAllResult from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: c3, jsxs: c4 } = jsxProd);
let obj = { area: { height: 128, textAlignVertical: "top" }, maxLengthIndicator: null };
2026-08-24 06:08:38 +00:00
obj = { position: "absolute", bottom: ThemesDefault.space.PX_4, right: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
obj[1] = obj;
let closure_5 = createCacheKey.createStyles(obj);
2026-08-24 06:08:38 +00:00
const forwardRefResult = importAllResult.forwardRef((isDisabled, ref) => {
2026-07-25 08:10:48 +00:00
let label = isDisabled;
2026-07-29 08:29:29 +00:00
let obj = dependencyMap;
2026-08-24 06:08:38 +00:00
obj1 = 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-24 06:08:38 +00:00
let obj3 = useTextFieldState;
2026-07-29 08:29:29 +00:00
const textField = obj3.useTextField(isDisabled, ref);
({ state, inputProps, innerRef } = textField);
2026-08-24 06:08:38 +00:00
let obj4 = 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-24 06:08:38 +00:00
const result = useCharacterLimitAnnouncement;
2026-07-29 08:29:29 +00:00
obj = { currentLength: state.value.length, maxLength, message: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[2] = intl.string(getSystemLocale.t.c2Jqed);
2026-07-29 08:29:29 +00:00
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-24 06:08:38 +00:00
const result1 = getNodeText;
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-24 06:08:38 +00:00
const items1 = [callback(useKeyboardBlurring.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-24 06:08:38 +00:00
return closure_4(useInputStyles.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-08-24 06:08:38 +00:00
const intl2 = getSystemLocale.intl;
2026-07-29 08:29:29 +00:00
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-08-24 06:08:38 +00:00
const intl3 = getSystemLocale.intl;
2026-07-29 08:29:29 +00:00
const obj5 = { remainingCharacters: null };
obj5[0] = diff;
2026-08-24 06:08:38 +00:00
formatToPlainStringResult = intl3.formatToPlainString(getSystemLocale.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-24 06:08:38 +00:00
obj4 = tmp9(Text.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-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("design/components/TextField/native/TextAreaField.native.tsx");
2026-07-20 16:05:17 +00:00
export const TextAreaField = forwardRefResult;