125 lines
4.4 KiB
TypeScript
125 lines
4.4 KiB
TypeScript
// Module ID: 4949
|
|
// Function ID: 4950
|
|
// Name: PressableBase
|
|
// Dependencies: [19, 17, 4823, 1301, 21, 4380, 712, 500, 4950, 2]
|
|
|
|
// Module 4949 (PressableBase)
|
|
import ThemesDefault from "Themes" /* 712 */;
|
|
import importAllResult from "noop" /* 19 */;
|
|
import { Pressable } from "get ActivityIndicator" /* 17 */;
|
|
import { IOS_POINTER_STYLE } from "IOS_POINTER_STYLE" /* 4823 */;
|
|
import { getThemedRippleConfig } from "semanticColor" /* 1301 */;
|
|
import { jsx } from "jsxProd" /* 21 */;
|
|
import createCacheKey from "createCacheKey" /* 4380 */;
|
|
|
|
const require = arg1;
|
|
function PressableBase(androidRippleConfig) {
|
|
androidRippleConfig = androidRippleConfig.androidRippleConfig;
|
|
const style = androidRippleConfig.style;
|
|
const type = androidRippleConfig.type;
|
|
const activeOpacity = androidRippleConfig.activeOpacity;
|
|
const underlayColor = androidRippleConfig.underlayColor;
|
|
({ children, innerRef } = androidRippleConfig);
|
|
let merged = Object.assign(androidRippleConfig, Object.create(null));
|
|
let backgroundColor;
|
|
backgroundColor = callback().pressedHighlight.backgroundColor;
|
|
let items = [type, activeOpacity, underlayColor, style, backgroundColor];
|
|
const items1 = [androidRippleConfig, style];
|
|
const memo = activeOpacity.useMemo(() => androidRippleConfig(type[7]).isAndroid() ? style : ((pressed) => {
|
|
const items = [closure_1, , ];
|
|
if (!pressed.pressed) {
|
|
items[1] = null;
|
|
items[2] = closure_1_5;
|
|
return items;
|
|
} else if ("highlight" === closure_2) {
|
|
let tmp2 = closure_4;
|
|
if (closure_4 == null) {
|
|
tmp2 = closure_5;
|
|
}
|
|
let obj = { backgroundColor: null };
|
|
obj[0] = tmp2;
|
|
} else {
|
|
let num = closure_3;
|
|
if (closure_3 == null) {
|
|
num = 0.2;
|
|
}
|
|
obj = { opacity: null };
|
|
obj[0] = num;
|
|
}
|
|
}), items);
|
|
let obj = {
|
|
android_ripple: activeOpacity.useMemo(() => {
|
|
let obj = androidRippleConfig(type[7]);
|
|
if (obj.isAndroid()) {
|
|
obj = androidRippleConfig;
|
|
if (androidRippleConfig == null) {
|
|
obj = {};
|
|
}
|
|
const cornerRadius = obj.cornerRadius;
|
|
let tmp4 = cornerRadius;
|
|
if (null == cornerRadius) {
|
|
const styleProp = style(tmp[8]).getStyleProp(style, "borderRadius");
|
|
tmp4 = cornerRadius;
|
|
if (null != styleProp) {
|
|
tmp4 = styleProp;
|
|
}
|
|
const obj3 = style(tmp[8]);
|
|
}
|
|
obj = {};
|
|
const merged = Object.assign(tmp2);
|
|
obj.cornerRadius = tmp4;
|
|
return closure_1_6(obj);
|
|
}
|
|
tmp = type;
|
|
}, items1),
|
|
style: memo,
|
|
ref: innerRef
|
|
};
|
|
const merged1 = Object.assign(merged);
|
|
obj.children = children;
|
|
return <underlayColor android_ripple={activeOpacity.useMemo(() => {
|
|
let obj = androidRippleConfig(type[7]);
|
|
if (obj.isAndroid()) {
|
|
obj = androidRippleConfig;
|
|
if (androidRippleConfig == null) {
|
|
obj = {};
|
|
}
|
|
const cornerRadius = obj.cornerRadius;
|
|
let tmp4 = cornerRadius;
|
|
if (null == cornerRadius) {
|
|
const styleProp = style(tmp[8]).getStyleProp(style, "borderRadius");
|
|
tmp4 = cornerRadius;
|
|
if (null != styleProp) {
|
|
tmp4 = styleProp;
|
|
}
|
|
const obj3 = style(tmp[8]);
|
|
}
|
|
obj = {};
|
|
const merged = Object.assign(tmp2);
|
|
obj.cornerRadius = tmp4;
|
|
return closure_1_6(obj);
|
|
}
|
|
tmp = type;
|
|
}, items1)} style={memo} ref={innerRef} />;
|
|
}
|
|
let c3 = importAllResult;
|
|
let obj = { pressedHighlight: null };
|
|
obj = { backgroundColor: ThemesDefault.colors.BACKGROUND_MOD_MUTED };
|
|
obj[0] = obj;
|
|
let closure_8 = createCacheKey.createStyles(obj);
|
|
const forwardRefResult = importAllResult.forwardRef((activeOpacity, innerRef) => {
|
|
let num = activeOpacity.activeOpacity;
|
|
if (num === undefined) {
|
|
num = 0.2;
|
|
}
|
|
const merged = Object.assign(Object.assign(activeOpacity, Object.create(null)));
|
|
return <PressableBase innerRef={arg1} type="opacity" activeOpacity={num} />;
|
|
});
|
|
const forwardRefResult1 = importAllResult.forwardRef((underlayColor, innerRef) => {
|
|
const merged = Object.assign(Object.assign(underlayColor, Object.create(null)));
|
|
return <PressableBase innerRef={arg1} type="highlight" underlayColor={arg0.underlayColor} />;
|
|
});
|
|
const result = require("set").fileFinishedImporting("design/void/Pressables/native/Pressables.tsx");
|
|
|
|
export const PressableOpacity = forwardRefResult;
|
|
export const PressableHighlight = forwardRefResult1;
|