95 lines
5.8 KiB
TypeScript
95 lines
5.8 KiB
TypeScript
/* Metro module 7687; source: design/components/TextField/native/TextAreaField.native.tsx; dependencies: [31, 27, 33, 4501, 697, 6992, 6986, 3862, 7688, 1244, 6995, 4573, 2] */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as NativeModule from '../../../utils/native.tsx'; /* Metro dependency 3862 */
|
|
import * as CreateStylesModule from '../../Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UseTextFieldNativeModule from './useTextField.native.tsx'; /* Metro dependency 6986 */
|
|
import * as InputFieldContainerNativeModule from '../../Input/native/InputFieldContainer.native.tsx'; /* Metro dependency 6992 */
|
|
import * as NativeTextInputNativeModule from '../../Input/native/NativeTextInput.native.tsx'; /* Metro dependency 6995 */
|
|
import * as UseCharacterLimitAnnouncementModule from '../../../../external/discord_common/js/packages/design/components/AccessibilityAnnouncer/useCharacterLimitAnnouncement.tsx'; /* Metro dependency 7688 */
|
|
|
|
function _fun61368(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7865:6, offset: 0x01b3d186, size: 294 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const getLengthRemainingTextColor = function(a0, a1) {
|
|
var value = 'text-muted';
|
|
return a0 == null || a1 == null ? value : a1 <= 0 ? 'text-feedback-critical' : a1 < a0 / 9 ? 'text-feedback-warning' : value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const object2 = {position: 'absolute'};
|
|
const PX_4 = (Native).space.PX_4;
|
|
object2.bottom = PX_4;
|
|
const PX_16 = (Native).space.PX_16;
|
|
object2.right = PX_16;
|
|
const env0_5 = Reflect.apply(createStyles, CreateStylesModule, [{area: {'height': 128, 'textAlignVertical': 'top'},
|
|
maxLengthIndicator: object2}]);
|
|
value = value.forwardRef(_fun61370);
|
|
(FileImportTrackerModule).fileFinishedImporting('design/components/TextField/native/TextAreaField.native.tsx');
|
|
exports.TextAreaField = value;
|
|
function _fun61370(a0, a1) { // fn#61370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7865:481, offset: 0x01b3d2f9, size: 651 bytes, params: 3, frame: 32
|
|
var object2;
|
|
var r4;
|
|
var Text;
|
|
const value2 = undefined;
|
|
const value3 = (InputFieldContainerNativeModule).useInputStyles({'size': 'lg',
|
|
'isRound': false, isDisabled: a0.isDisabled});
|
|
const styles = useStyles();
|
|
const maxLength = a0.maxLength;
|
|
const {inputProps, innerRef,
|
|
state} = (UseTextFieldNativeModule).useTextField(a0, a1);
|
|
const {focusProps, isFocused} = (NativeModule).useFocus();
|
|
const value6 = null;
|
|
const r11 = value6 != maxLength ? maxLength - state.value.length : value2;
|
|
const useCharacterLimitAnnouncement = UseCharacterLimitAnnouncementModule.useCharacterLimitAnnouncement;
|
|
object2 = {currentLength: state.value.length, maxLength: maxLength};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object2.message = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.c2Jqed);
|
|
Reflect.apply(useCharacterLimitAnnouncement, UseCharacterLimitAnnouncementModule, [object2]);
|
|
const InputFieldContainer = (InputFieldContainerNativeModule).InputFieldContainer;
|
|
const inputFieldContainerProps = {...a0};
|
|
inputFieldContainerProps['isFocused'] = isFocused;
|
|
const NativeTextInput = (NativeTextInputNativeModule).NativeTextInput;
|
|
const object = {};
|
|
copyDataProperties(object, NativeModule.mergeProps(inputProps, focusProps), intl);
|
|
object['ref'] = innerRef;
|
|
object['style'] = [value3.padding, value3.text, styles.area];
|
|
object['placeholderTextColor'] = value3.placeholderText.color;
|
|
object['multiline'] = true;
|
|
const nativeTextInput = <NativeTextInput {...object} />;
|
|
if (value6 == r11) {
|
|
r4 = value6;
|
|
} else {
|
|
var viewBindingProps = {style: styles.maxLengthIndicator};
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
r4 = (
|
|
<View {...viewBindingProps}>
|
|
<Text
|
|
variant="text-xs/semibold"
|
|
color={getLengthRemainingTextColor(maxLength, r11)}
|
|
accessibilityLabel={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.fR1cof,
|
|
|
|
{remainingCharacters: r11})}
|
|
>
|
|
{r11}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
return (
|
|
<InputFieldContainer {...inputFieldContainerProps}>
|
|
{nativeTextInput}
|
|
{r4}
|
|
</InputFieldContainer>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun61368, 7687, [31, 27, 33, 4501, 697, 6992, 6986, 3862, 7688, 1244, 6995, 4573,
|
|
2]) /* metro module 7687, dependencies: [31, 27, 33, 4501, 697, 6992, 6986, 3862, 7688, 1244, 6995, 4573, 2] */;
|