decord/source/design/components/TableRow/native/RowButton.native.tsx

161 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 8121
// Function ID: 8122
2026-07-20 16:05:17 +00:00
// Name: RowButtonWrapper
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 21, 4380, 712, 1367, 5486, 5480, 4120, 5482, 8122, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 8121 (RowButtonWrapper)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import useIsMobileVisualRefreshExperimentEnabledDefault from "useIsMobileVisualRefreshExperimentEnabled" /* 1367 */;
2026-08-25 06:04:03 +00:00
import TableRowInner from "TableRowInner" /* 5480 */;
import TableRowIcon from "TableRowIcon" /* 5486 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import { jsx } from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
class RowButton {
constructor(arg0) {
flag = global.arrow;
if (flag === undefined) {
flag = true;
}
flag2 = global.disabled;
if (flag2 === undefined) {
flag2 = false;
}
str = global.variant;
if (str === undefined) {
str = "secondary";
}
({ icon, experimental_withBlurBackground } = global);
2026-07-29 08:29:29 +00:00
merged = Object.assign(global, Object.create(null));
tmp3 = closure_2;
tmp2 = closure_1;
tmp4 = require("useIsMobileVisualRefreshExperimentEnabled")("RowButton");
tmp5 = icon;
2026-07-20 16:05:17 +00:00
if (null != icon) {
2026-08-24 06:08:38 +00:00
tmp6 = closure_3;
2026-07-29 08:29:29 +00:00
tmp5 = icon;
2026-08-24 06:08:38 +00:00
if (!closure_3.isValidElement(icon)) {
2026-07-20 16:05:17 +00:00
str2 = "translucent";
if (!experimental_withBlurBackground) {
str3 = "secondary";
str4 = "primary";
if ("primary" === str) {
str3 = "default";
}
str2 = str3;
}
2026-07-29 08:29:29 +00:00
tmp7 = jsx;
tmp8 = closure_0;
obj = { source: null, variant: null };
obj[0] = icon;
obj[1] = str2;
tmp5 = jsx(require("TableRowIcon").TableRowIcon, obj);
2026-07-20 16:05:17 +00:00
}
}
tmp9 = jsx;
2026-07-29 08:29:29 +00:00
obj = { isRefreshEnabled: tmp4, experimental_withBlurBackground, onPress: global.onPress, disabled: flag2 };
2026-07-20 16:05:17 +00:00
tmp10 = RowButtonWrapper;
merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj1 = { icon: tmp5, arrow: flag, disabled: flag2, borderRadius: null };
2026-07-20 16:05:17 +00:00
xl = undefined;
2026-07-29 08:29:29 +00:00
if (tmp4) {
xl = require("Themes").radii.xl;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1[3] = xl;
2026-07-20 16:05:17 +00:00
merged2 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.children = tmp9(require("TableRowInner").TableRowInner, obj1);
return tmp9(tmp10, obj);
2026-07-20 16:05:17 +00:00
}
}
function RowButtonWrapper(isRefreshEnabled) {
let flag = isRefreshEnabled.isRefreshEnabled;
if (flag === undefined) {
flag = false;
}
({ onPress, disabled, children } = isRefreshEnabled);
2026-07-29 08:29:29 +00:00
const merged = Object.assign(isRefreshEnabled, Object.create(null));
2026-07-23 10:11:24 +00:00
let sharedValue;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-20 16:05:17 +00:00
let React;
2026-07-29 08:29:29 +00:00
const tmp2 = callback(flag);
2026-08-25 06:04:03 +00:00
let obj = merged(4120);
2026-07-29 08:29:29 +00:00
sharedValue = obj.useSharedValue(0);
2026-07-20 16:05:17 +00:00
const items = [sharedValue];
2026-07-23 10:11:24 +00:00
dependencyMap = React.useCallback(() => {
2026-07-20 16:05:17 +00:00
const result = sharedValue.set(1);
}, items);
const items1 = [sharedValue];
React = React.useCallback(() => {
const result = sharedValue.set(0);
}, items1);
if (isRefreshEnabled.experimental_withBlurBackground) {
2026-07-29 08:29:29 +00:00
obj = { shadow: "none", border: "none", start: true, end: true, onPress: null, onPressIn: null, onPressOut: null, style: null, disabled: null };
obj[4] = onPress;
obj[5] = function onPressIn(arg0) {
const onPressIn = merged.onPressIn;
if (onPressIn != null) {
onPressIn(arg0);
}
callback();
};
obj[6] = function onPressOut(arg0) {
const onPressOut = merged.onPressOut;
if (onPressOut != null) {
onPressOut(arg0);
}
callback2();
2026-07-20 16:05:17 +00:00
};
const items2 = [, ];
2026-07-29 08:29:29 +00:00
({ card: arr3[0], cardWithBlur: arr3[1] } = tmp2);
obj[7] = items2;
obj[8] = disabled;
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.variant = "transparent";
obj = { pressed: null, children: null };
obj[0] = sharedValue;
obj[1] = children;
2026-08-25 06:04:03 +00:00
obj.children = jsx(tmp3(8122).BackgroundBlurView, { pressed: null, children: null });
return jsx(tmp3(5482).InternalCard, { pressed: null, children: null });
2026-07-20 16:05:17 +00:00
} else {
let str = "subtle";
if (flag) {
str = "control-secondary";
}
let str2 = "control-secondary";
if (!flag) {
let variant;
2026-07-29 08:29:29 +00:00
if (merged != null) {
2026-07-20 16:05:17 +00:00
variant = merged.variant;
}
str2 = variant;
}
2026-08-24 06:08:38 +00:00
obj1 = { shadow: "low", start: true, end: true, onPress: null, style: null, disabled: null };
2026-07-29 08:29:29 +00:00
obj1[3] = onPress;
obj1[4] = tmp2.card;
obj1[5] = disabled;
2026-07-20 16:05:17 +00:00
const merged2 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj1.variant = str2;
obj1.border = str;
obj1.children = children;
2026-08-25 06:04:03 +00:00
return jsx(tmp3(5482).InternalCard, { shadow: "low", start: true, end: true, onPress: null, style: null, disabled: null });
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let closure_5 = createCacheKey.createStyles(() => {
2026-07-20 16:05:17 +00:00
let flag = arg0;
if (arg0 === undefined) {
flag = false;
}
2026-07-29 08:29:29 +00:00
let obj = { card: null, cardWithBlur: null };
2026-08-24 06:08:38 +00:00
obj = { padding: num, borderTopStartRadius: ThemesDefault.modules.mobile.TABLE_ROW_BORDER_RADIUS, borderTopEndRadius: ThemesDefault.modules.mobile.TABLE_ROW_BORDER_RADIUS, borderBottomStartRadius: ThemesDefault.modules.mobile.TABLE_ROW_BORDER_RADIUS, borderBottomEndRadius: ThemesDefault.modules.mobile.TABLE_ROW_BORDER_RADIUS };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
obj[1] = { overflow: "hidden" };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
RowButton.Icon = require("TableRowIcon").TableRowIcon;
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("design/components/TableRow/native/RowButton.native.tsx");
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
export const RowButtonIconProps = require("TableRowIcon").TableRowIconProps;
2026-07-20 16:05:17 +00:00
export { RowButton };