228 lines
14 KiB
TypeScript
228 lines
14 KiB
TypeScript
/* Metro module 6992; source: design/components/Input/native/InputFieldContainer.native.tsx; dependencies: [31, 27, 33, 697, 3860, 4501, 6993, 4573, 4017, 4577, 2] */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import ReanimatedRexport from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
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 UseTokenModule from '../../../tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as TextModule from '../../Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as SpringModule from '../../../animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
|
|
import * as InputTypesNativeModule from './InputTypes.native.tsx'; /* Metro dependency 6993 */
|
|
|
|
function _fun55410(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7170:6, offset: 0x013a5f3a, size: 344 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const useInputStyles2 = useInputStyles;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = ReactNativeModule;
|
|
value.Platform;
|
|
const env0_3 = value.StyleSheet;
|
|
const env0_4 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_5 = value.jsx;
|
|
const env0_6 = value.jsxs;
|
|
const env0_7 = {'mass': 0.5, 'damping': 15, 'stiffness': 200, 'overshootClamping': true};
|
|
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun55412);
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyleProperties = value.createStyleProperties;
|
|
object = {};
|
|
const INPUT_BORDER_ERROR_DEFAULT = (Native).colors.INPUT_BORDER_ERROR_DEFAULT;
|
|
object.error = INPUT_BORDER_ERROR_DEFAULT;
|
|
object.default = 'transparent';
|
|
const INPUT_BORDER_ACTIVE = (Native).colors.INPUT_BORDER_ACTIVE;
|
|
object.focused = INPUT_BORDER_ACTIVE;
|
|
const env0_9 = Reflect.apply(createStyleProperties, value, [object]);
|
|
object = {code: "function InputFieldContainerNativeTsx1(){const{status,ringColors,isFocused,withSpring,RING_SPRING_CONFIG}=this.__closure;let borderWidth=0;let borderColor='transparent';if(status!=='default'){borderWidth=2;borderColor=ringColors.error;}else if(isFocused){borderWidth=1;borderColor=ringColors.focused;}return{borderWidth:withSpring(borderWidth,RING_SPRING_CONFIG),borderColor:withSpring(borderColor,RING_SPRING_CONFIG),left:-borderWidth,right:-borderWidth,top:-borderWidth,bottom:-borderWidth};}"};
|
|
(FileImportTrackerModule).fileFinishedImporting('design/components/Input/native/InputFieldContainer.native.tsx');
|
|
exports.useInputStyles = useInputStyles2;
|
|
exports.InputFieldContainer = InputFieldContainer;
|
|
function useInputStyles({size, isRound, isDisabled, grow}) { // fn#55411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7170:236, offset: 0x013a6092, size: 526 bytes, params: 2, frame: 29
|
|
size = size === undefined ? 'lg' : size;
|
|
isRound = !(isRound === undefined) && isRound;
|
|
isDisabled = !(isDisabled === undefined) && isDisabled;
|
|
grow = grow === undefined || grow;
|
|
let useToken = UseTokenModule.useToken;
|
|
const value7 = Reflect.apply(useToken, UseTokenModule,
|
|
[size === 'sm' ? (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_RADIUS_SM : size === 'md' ? (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_RADIUS_MD : size !== 'lg' ? undefined : (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_RADIUS_LG]);
|
|
useToken = UseTokenModule.useToken;
|
|
const INPUT_FIELD_ROUND_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_ROUND_RADIUS;
|
|
const r3 = isRound ? Reflect.apply(useToken, UseTokenModule, [INPUT_FIELD_ROUND_RADIUS]) : value7;
|
|
const value9 = UseTokenModule.useToken(size === 'sm' ? (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_TEXT_STYLE_SM : size === 'md' ? (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_TEXT_STYLE_MD : size !== 'lg' ? undefined : (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_TEXT_STYLE_LG);
|
|
useToken = UseTokenModule.useToken;
|
|
const INPUT_FIELD_PADDING_VERTICAL_SM_IOS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_PADDING_VERTICAL_SM_IOS;
|
|
return useStyles(size, isDisabled, grow, r3, value9, Reflect.apply(useToken, UseTokenModule,
|
|
[INPUT_FIELD_PADDING_VERTICAL_SM_IOS]));
|
|
}
|
|
|
|
function _fun55412() { // fn#55412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7170:1028, offset: 0x013a62a0, size: 1106 bytes, params: 1, frame: 26
|
|
const value = a0;
|
|
const value2 = a1;
|
|
const value3 = a2;
|
|
const value4 = a3;
|
|
const value5 = a4;
|
|
const r1 = value !== undefined ? value : 'lg';
|
|
let r11 = value2 !== undefined ? value2 : false;
|
|
const r14 = !(value3 !== undefined) || value3;
|
|
const r7 = value4 !== undefined ? value4 : 12;
|
|
const r12 = value5 !== undefined ? value5 : 'text-md/medium';
|
|
const {SM, MD, LG} = (InputTypesNativeModule).InputHeights;
|
|
const property = ({sm: SM, md: MD, lg: LG})[r1];
|
|
object = {};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.sm = PX_8;
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.md = PX_12;
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.lg = PX_16;
|
|
const property2 = object[r1];
|
|
object = {};
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.sm = PX_4;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.md = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.lg = PX_8;
|
|
const property3 = object[r1];
|
|
object = {};
|
|
const object2 = {};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.paddingHorizontal = PX_8;
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object2.paddingVertical = PX_4;
|
|
object.sm = object2;
|
|
const object3 = {};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.paddingHorizontal = PX_12;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.paddingVertical = PX_8;
|
|
object.md = object3;
|
|
const object4 = {};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.paddingHorizontal = PX_16;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.paddingVertical = PX_8 + 2;
|
|
object.lg = object4;
|
|
const property4 = object[r1];
|
|
object = {};
|
|
const value6 = 1;
|
|
object.container = {opacity: r11 ? 0.5 : value6, pointerEvents: r11 ? 'none' : 'auto', flexDirection: 'row',
|
|
flexGrow: r14 ? value6 : 0, alignItems: 'center'};
|
|
const object6 = {};
|
|
let colors = (importDefault(697) /* metro dependency 697: native */).colors;
|
|
const INPUT_BACKGROUND_DEFAULT = colors.INPUT_BACKGROUND_DEFAULT;
|
|
object6.backgroundColor = INPUT_BACKGROUND_DEFAULT;
|
|
const INPUT_FIELD_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_BORDER_WIDTH;
|
|
object6.borderWidth = INPUT_FIELD_BORDER_WIDTH;
|
|
const INPUT_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BORDER_DEFAULT;
|
|
object6.borderColor = INPUT_BORDER_DEFAULT;
|
|
object.background = object6;
|
|
const INPUT_PLACEHOLDER_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_PLACEHOLDER_TEXT_DEFAULT;
|
|
object.placeholderText = {color: INPUT_PLACEHOLDER_TEXT_DEFAULT};
|
|
object.minHeight = {minHeight: property};
|
|
object.radius = {borderRadius: r7};
|
|
object.padding = property4;
|
|
const object10 = {};
|
|
const TextStyleSheet = (TextModule).TextStyleSheet;
|
|
copyDataProperties(object10, TextStyleSheet[r12], importDefault);
|
|
object10['lineHeight'] = undefined;
|
|
colors = (importDefault(697) /* metro dependency 697: native */).colors;
|
|
r11 = r11 ? colors.TEXT_MUTED : colors.TEXT_DEFAULT;
|
|
object10['color'] = r11;
|
|
object10['flexGrow'] = value6;
|
|
object.text = object10;
|
|
const object11 = {'position': 'absolute', 'left': 0};
|
|
copyDataProperties(object11, property4, importDefault);
|
|
object11['paddingEnd'] = property3;
|
|
object11['zIndex'] = value6;
|
|
object11['pointerEvents'] = 'none';
|
|
object.leadingText = object11;
|
|
const object12 = {'position': 'absolute', 'right': 0};
|
|
copyDataProperties(object12, property4, importDefault);
|
|
object12['paddingStart'] = property3;
|
|
object12['zIndex'] = value6;
|
|
object12['pointerEvents'] = 'none';
|
|
object.trailingText = object12;
|
|
object.leadingIcon = {'position': 'absolute', 'left': 0, 'top': 0, 'bottom': 0, paddingTop: property2,
|
|
paddingBottom: property2, paddingStart: property2, paddingEnd: property3, justifyContent: 'center',
|
|
zIndex: value6, pointerEvents: 'none'};
|
|
object.trailingIcon = {'position': 'absolute', 'right': 0, 'top': 0, 'bottom': 0, paddingTop: property2,
|
|
paddingBottom: property2, paddingStart: property3, paddingEnd: property2, justifyContent: 'center',
|
|
zIndex: value6, pointerEvents: 'none'};
|
|
const object15 = {};
|
|
copyDataProperties(object15, property4, importDefault);
|
|
object15['borderRightWidth'] = value6;
|
|
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
|
|
object15['borderRightColor'] = BORDER_STRONG;
|
|
object.splitBorder = object15;
|
|
return object;
|
|
}
|
|
|
|
function InputFieldContainer(a0) { // fn#55413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7170:3520, offset: 0x013a66f2, size: 402 bytes, params: 2, frame: 23
|
|
const value2 = env0_9();
|
|
const isFocused = a0.isFocused;
|
|
const r7 = isFocused !== undefined && isFocused;
|
|
const status = a0.status;
|
|
const r13 = status === undefined ? 'default' : status;
|
|
const children = a0.children;
|
|
const value5 = useInputStyles({size: a0.size, isRound: a0.isRound, isDisabled: a0.isDisabled, grow: a0.grow,
|
|
hasLeadingIcon: a0.leadingIcon != null});
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
const InputFieldContainerS2 = InputFieldContainerS;
|
|
object = {status: r13, ringColors: value2, isFocused: r7};
|
|
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
|
|
object.RING_SPRING_CONFIG = env0_7;
|
|
InputFieldContainerS2.__closure = object;
|
|
InputFieldContainerS2.__workletHash = 1037178877006;
|
|
InputFieldContainerS2.__initData = env0_10;
|
|
const value6 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [InputFieldContainerS2]);
|
|
const items2 = [value5.container];
|
|
items2[1] = value5.background;
|
|
items2[2] = value5.radius;
|
|
items2[3] = value5.minHeight;
|
|
const View2 = (ReanimatedRexport).View;
|
|
return (
|
|
<View style={items2}>
|
|
<View2 style={[StyleSheet.absoluteFill, value5.radius, value6]} />
|
|
{children}
|
|
</View>
|
|
);
|
|
function InputFieldContainerS() { // fn#55414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7170:3795, owner: InputFieldContainer.s, offset: 0x013a6884, size: 148 bytes, params: 1, frame: 19
|
|
var r1;
|
|
var r5;
|
|
var focused;
|
|
var error;
|
|
if (env0_2 !== 'default') {
|
|
error = env0_0.error;
|
|
r1 = 2;
|
|
r5 = error;
|
|
} else if (env0_1) {
|
|
focused = env0_0.focused;
|
|
r1 = 1;
|
|
r5 = focused;
|
|
} else {
|
|
r1 = 0;
|
|
r5 = 'transparent';
|
|
}
|
|
const object = {};
|
|
let value = environment.__proto__;
|
|
const withSpring = SpringModule.withSpring;
|
|
const binding = env1_7;
|
|
object.borderWidth = Reflect.apply(withSpring, SpringModule, [r1, binding]);
|
|
object.borderColor = SpringModule.withSpring(r5, binding);
|
|
value = -r1;
|
|
object.left = value;
|
|
object.right = value;
|
|
object.top = value;
|
|
object.bottom = value;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55410, 6992, [31, 27, 33, 697, 3860, 4501, 6993, 4573, 4017, 4577,
|
|
2]) /* metro module 6992, dependencies: [31, 27, 33, 697, 3860, 4501, 6993, 4573, 4017, 4577, 2] */;
|