223 lines
12 KiB
TypeScript
223 lines
12 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] */
|
|
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
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = useInputStyles;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
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;
|
|
object2 = {};
|
|
const INPUT_BORDER_ERROR_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BORDER_ERROR_DEFAULT;
|
|
object2.error = INPUT_BORDER_ERROR_DEFAULT;
|
|
object2.default = 'transparent';
|
|
const INPUT_BORDER_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BORDER_ACTIVE;
|
|
object2.focused = INPUT_BORDER_ACTIVE;
|
|
const env0_9 = Reflect.apply(createStyleProperties, value, [object2]);
|
|
object2 = {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};}"};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/Input/native/InputFieldContainer.native.tsx');
|
|
exports.useInputStyles = closure;
|
|
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;
|
|
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
|
|
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]);
|
|
const moduleValue2 = useTokenModule;
|
|
useToken = moduleValue2.useToken;
|
|
const INPUT_FIELD_ROUND_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_ROUND_RADIUS;
|
|
const r3 = isRound ? Reflect.apply(useToken, moduleValue2, [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);
|
|
const moduleValue4 = useTokenModule;
|
|
useToken = moduleValue4.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, moduleValue4,
|
|
[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
|
|
var object5;
|
|
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} = (require(6993) /* metro dependency 6993: InputTypesNative */).InputHeights;
|
|
const property = ({sm: SM, md: MD, lg: LG})[r1];
|
|
object5 = {};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.sm = PX_8;
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.md = PX_12;
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.lg = PX_16;
|
|
const property2 = object5[r1];
|
|
object5 = {};
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object5.sm = PX_4;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.md = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.lg = PX_8;
|
|
const property3 = object5[r1];
|
|
object5 = {};
|
|
const object7 = {};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object7.paddingHorizontal = PX_8;
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object7.paddingVertical = PX_4;
|
|
object5.sm = object7;
|
|
const object8 = {};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object8.paddingHorizontal = PX_12;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object8.paddingVertical = PX_8;
|
|
object5.md = object8;
|
|
const object9 = {};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object9.paddingHorizontal = PX_16;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object9.paddingVertical = PX_8 + 2;
|
|
object5.lg = object9;
|
|
const property4 = object5[r1];
|
|
object5 = {};
|
|
const value6 = 1;
|
|
object5.container = {opacity: r11 ? 0.5 : value6, pointerEvents: r11 ? 'none' : 'auto', flexDirection: 'row',
|
|
flexGrow: r14 ? value6 : 0, alignItems: 'center'};
|
|
const object13 = {};
|
|
let colors = (importDefault(697) /* metro dependency 697: native */).colors;
|
|
const INPUT_BACKGROUND_DEFAULT = colors.INPUT_BACKGROUND_DEFAULT;
|
|
object13.backgroundColor = INPUT_BACKGROUND_DEFAULT;
|
|
const INPUT_FIELD_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_BORDER_WIDTH;
|
|
object13.borderWidth = INPUT_FIELD_BORDER_WIDTH;
|
|
const INPUT_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BORDER_DEFAULT;
|
|
object13.borderColor = INPUT_BORDER_DEFAULT;
|
|
object5.background = object13;
|
|
const INPUT_PLACEHOLDER_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_PLACEHOLDER_TEXT_DEFAULT;
|
|
object5.placeholderText = {color: INPUT_PLACEHOLDER_TEXT_DEFAULT};
|
|
object5.minHeight = {minHeight: property};
|
|
object5.radius = {borderRadius: r7};
|
|
object5.padding = property4;
|
|
const object14 = {};
|
|
const TextStyleSheet = (require(4573) /* metro dependency 4573: Text */).TextStyleSheet;
|
|
copyDataProperties(object14, TextStyleSheet[r12], importDefault);
|
|
object14['lineHeight'] = undefined;
|
|
colors = (importDefault(697) /* metro dependency 697: native */).colors;
|
|
r11 = r11 ? colors.TEXT_MUTED : colors.TEXT_DEFAULT;
|
|
object14['color'] = r11;
|
|
object14['flexGrow'] = value6;
|
|
object5.text = object14;
|
|
const object16 = {'position': 'absolute', 'left': 0};
|
|
copyDataProperties(object16, property4, importDefault);
|
|
object16['paddingEnd'] = property3;
|
|
object16['zIndex'] = value6;
|
|
object16['pointerEvents'] = 'none';
|
|
object5.leadingText = object16;
|
|
const object17 = {'position': 'absolute', 'right': 0};
|
|
copyDataProperties(object17, property4, importDefault);
|
|
object17['paddingStart'] = property3;
|
|
object17['zIndex'] = value6;
|
|
object17['pointerEvents'] = 'none';
|
|
object5.trailingText = object17;
|
|
object5.leadingIcon = {'position': 'absolute', 'left': 0, 'top': 0, 'bottom': 0, paddingTop: property2,
|
|
paddingBottom: property2, paddingStart: property2, paddingEnd: property3, justifyContent: 'center',
|
|
zIndex: value6, pointerEvents: 'none'};
|
|
object5.trailingIcon = {'position': 'absolute', 'right': 0, 'top': 0, 'bottom': 0, paddingTop: property2,
|
|
paddingBottom: property2, paddingStart: property3, paddingEnd: property2, justifyContent: 'center',
|
|
zIndex: value6, pointerEvents: 'none'};
|
|
const object18 = {};
|
|
copyDataProperties(object18, property4, importDefault);
|
|
object18['borderRightWidth'] = value6;
|
|
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
|
|
object18['borderRightColor'] = BORDER_STRONG;
|
|
object5.splitBorder = object18;
|
|
return object5;
|
|
}
|
|
|
|
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
|
|
var object2;
|
|
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 reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
|
|
const closure = InputFieldContainerS;
|
|
object2 = {status: r13, ringColors: value2, isFocused: r7};
|
|
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
|
|
object2.RING_SPRING_CONFIG = env0_7;
|
|
closure.__closure = object2;
|
|
closure.__workletHash = 1037178877006;
|
|
closure.__initData = env0_10;
|
|
const value6 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
|
|
const items2 = [value5.container];
|
|
items2[1] = value5.background;
|
|
items2[2] = value5.radius;
|
|
items2[3] = value5.minHeight;
|
|
const View2 = (importDefault(4017) /* metro dependency 4017: 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 object2 = {};
|
|
let value = environment.__proto__;
|
|
const springModule = require(4577) /* metro dependency 4577: spring */;
|
|
const withSpring = springModule.withSpring;
|
|
const binding = env1_7;
|
|
object2.borderWidth = Reflect.apply(withSpring, springModule, [r1, binding]);
|
|
object2.borderColor = springModule.withSpring(r5, binding);
|
|
value = -r1;
|
|
object2.left = value;
|
|
object2.right = value;
|
|
object2.top = value;
|
|
object2.bottom = value;
|
|
return object2;
|
|
}
|
|
|