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

300 lines
9.4 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 5551
// Function ID: 5552
2026-07-20 16:05:17 +00:00
// Name: TableRowInner
2026-08-27 16:17:25 +00:00
// Dependencies: [19, 17, 21, 4445, 712, 1367, 5552, 4165, 5553, 5509, 5557, 5558, 5561, 4887, 500, 5562, 4441, 2]
2026-07-20 16:05:17 +00:00
2026-08-27 16:17:25 +00:00
// Module 5551 (TableRowInner)
2026-08-24 06:08:38 +00:00
import set from "set" /* 500 */;
import ThemesDefault from "Themes" /* 712 */;
import useIsMobileVisualRefreshExperimentEnabled from "useIsMobileVisualRefreshExperimentEnabled" /* 1367 */;
import useIsMobileVisualRefreshExperimentEnabledDefault from "useIsMobileVisualRefreshExperimentEnabled" /* 1367 */;
2026-08-26 06:04:24 +00:00
import map from "map" /* 4165 */;
2026-08-27 16:17:25 +00:00
import getFontScale from "getFontScale" /* 4887 */;
import context2 from "context" /* 5552 */;
import PressableCard from "PressableCard" /* 5553 */;
import TableRowTrailingText from "TableRowTrailingText" /* 5561 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-27 16:17:25 +00:00
import createCacheKey from "createCacheKey" /* 4445 */;
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 TableRow {
constructor(arg0) {
({ icon, disabled } = global);
({ label, subLabel, trailing, arrow, onPress } = global);
if (disabled === undefined) {
disabled = false;
}
({ variant, start, end, labelLineClamp, subLabelLineClamp } = global);
if (variant === undefined) {
variant = "default";
}
({ draggable, dragHandlePressableProps, height } = global);
2026-07-29 08:29:29 +00:00
merged = Object.assign(global, Object.create(null));
tmp2 = closure_0;
tmp3 = closure_2;
2026-07-23 10:11:24 +00:00
MobileVisualRefreshExperiment = require("useIsMobileVisualRefreshExperimentEnabled").MobileVisualRefreshExperiment;
2026-07-20 16:05:17 +00:00
enabled = MobileVisualRefreshExperiment.useConfig({ location: "TableRow" }).enabled;
2026-08-24 06:08:38 +00:00
context = closure_3.useContext(require("context").TableRowGroupContext);
2026-07-29 08:29:29 +00:00
tmp5 = !context;
if (!context) {
2026-07-20 16:05:17 +00:00
flag = true;
2026-07-29 08:29:29 +00:00
tmp5 = true === end;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2Result = require("map");
tmp7 = jsx;
token = tmp2Result.useToken(require("Themes").modules.mobile.TABLE_ROW_BORDER_RADIUS);
obj = { radius: token, shadow: "none", border: "none", variant: null, start: null, end: null, onPress: null, disabled: null, style: null };
2026-07-20 16:05:17 +00:00
str = undefined;
if (enabled) {
str = "muted";
}
2026-07-29 08:29:29 +00:00
obj[3] = str;
tmp8 = !context;
if (!context) {
2026-07-20 16:05:17 +00:00
flag2 = true;
2026-07-29 08:29:29 +00:00
tmp8 = true === start;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[4] = tmp8;
obj[5] = tmp5;
obj[6] = onPress;
obj[7] = disabled;
2026-08-24 06:08:38 +00:00
obj[8] = closure_9;
2026-07-20 16:05:17 +00:00
merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.children = tmp7(TableRowInner, { height, label, subLabel, icon, trailing, arrow, disabled, labelLineClamp, subLabelLineClamp, variant, draggable, dragHandlePressableProps, isRefreshEnabled: enabled });
tmp7Result = tmp7(require("PressableCard").InternalCard, obj);
tmp11 = tmp7Result;
2026-07-20 16:05:17 +00:00
if (!context) {
2026-07-29 08:29:29 +00:00
tmp11 = tmp7Result;
if (!tmp5) {
tmp12 = jsxs;
tmp13 = Fragment;
obj1 = { children: null };
2026-07-20 16:05:17 +00:00
items = [, ];
2026-07-29 08:29:29 +00:00
items[0] = tmp7Result;
obj2 = { adjustSpacingForIcon: null };
obj2[0] = null != icon;
items[1] = tmp7(require("TableRowDivider").TableRowDivider, obj2);
obj1[0] = items;
tmp11 = jsxs(Fragment, obj1);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp11;
2026-07-20 16:05:17 +00:00
}
}
class TableRowInner {
constructor(arg0) {
({ label, subLabel, icon, trailing, arrow, variant } = global);
({ labelLineClamp, subLabelLineClamp, disabled } = global);
if (variant === undefined) {
variant = "default";
}
flag = global.draggable;
if (flag === undefined) {
flag = false;
}
dragHandlePressableProps = global.dragHandlePressableProps;
2026-07-29 08:29:29 +00:00
tmp = closure_1;
tmp2 = closure_2;
2026-07-20 16:05:17 +00:00
({ borderRadius, height } = global);
2026-07-29 08:29:29 +00:00
tmp3 = require("useIsMobileVisualRefreshExperimentEnabled")("TableRowInner");
2026-08-24 06:08:38 +00:00
obj = closure_3;
2026-07-29 08:29:29 +00:00
tmp4 = undefined;
2026-08-24 06:08:38 +00:00
if (closure_3.isValidElement(trailing)) {
2026-07-29 08:29:29 +00:00
tmp5 = closure_0;
2026-07-23 10:11:24 +00:00
if (trailing.type === require("TableRowTrailingText").TableRowTrailingText) {
2026-07-29 08:29:29 +00:00
tmp4 = trailing;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp6 = closure_0;
obj2 = require("getFontScale");
fontScale = obj2.useFontScale();
obj3 = require("set");
if (obj3.isAndroid()) {
num2 = 1.2;
tmp8 = fontScale > 1.2;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
num = 1.5;
tmp8 = fontScale > 1.5;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
tmp9 = closure_10(true === disabled, null != tmp4, tmp8, tmp3);
2026-07-29 08:29:29 +00:00
tmp6Result = require("map");
token = tmp6Result.useToken(require("Themes").modules.mobile.TABLE_ROW_LABEL_TEXT_STYLE);
tmp6Result1 = require("map");
tmp12 = jsxs;
tmp13 = View;
obj = { style: items, children: null };
2026-07-20 16:05:17 +00:00
items = [, ];
2026-07-29 08:29:29 +00:00
items[0] = tmp9.row;
2026-07-20 16:05:17 +00:00
items[1] = { borderRadius, height };
2026-07-29 08:29:29 +00:00
token1 = tmp6Result1.useToken(require("Themes").modules.mobile.TABLE_ROW_LABEL_COLOR);
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
tmp14 = jsx;
tmp15 = Pressable;
2026-07-20 16:05:17 +00:00
obj1 = {};
2026-07-29 08:29:29 +00:00
tmp16 = obj1;
tmp17 = dragHandlePressableProps;
2026-07-20 16:05:17 +00:00
merged = Object.assign(dragHandlePressableProps);
2026-07-29 08:29:29 +00:00
obj2 = { size: "xs", style: null };
obj2[1] = tmp9.dragHandle;
obj1.children = jsx(require("DragIcon").DragIcon, obj2);
2026-07-20 16:05:17 +00:00
flag = jsx(Pressable, obj1);
}
items1 = [, , , , ];
items1[0] = flag;
2026-07-29 08:29:29 +00:00
tmp19 = null != icon;
if (tmp19) {
tmp20 = jsx;
obj3 = { style: null, children: null };
obj3[0] = tmp9.iconContainer;
obj3[1] = icon;
tmp19 = jsx(tmp13, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items1[1] = tmp19;
obj4 = { style: tmp9.content, children: null };
obj5 = { style: tmp9.labels, children: null };
tmp22Result = label;
if (!obj.isValidElement(label)) {
tmp22 = jsx;
obj6 = { variant: null, color: null, lineClamp: null, includeFontPadding: true, children: null };
obj6[0] = token;
str = "text-feedback-critical";
str2 = "danger";
2026-07-20 16:05:17 +00:00
if ("danger" !== variant) {
2026-07-29 08:29:29 +00:00
str = token1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj6[1] = str;
obj6[2] = labelLineClamp;
obj6[4] = label;
tmp22Result = tmp22(require("Text").Text, obj6);
2026-07-20 16:05:17 +00:00
}
items2 = [, ];
2026-07-29 08:29:29 +00:00
items2[0] = tmp22Result;
tmp23 = null != subLabel;
if (tmp23) {
tmp25Result = subLabel;
if (!obj.isValidElement(subLabel)) {
tmp25 = jsx;
str3 = "text-subtle";
str4 = "danger";
2026-07-20 16:05:17 +00:00
if ("danger" === variant) {
2026-07-29 08:29:29 +00:00
str3 = "text-feedback-critical";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj7 = { variant: "text-xs/medium", color: null, lineClamp: null, includeFontPadding: true, children: null };
obj7[1] = str3;
obj7[2] = subLabelLineClamp;
obj7[4] = subLabel;
tmp25Result = tmp25(require("Text").Text, obj7);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp23 = tmp25Result;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[1] = tmp23;
obj5[1] = items2;
2026-07-20 16:05:17 +00:00
items3 = [, ];
2026-07-29 08:29:29 +00:00
items3[0] = tmp12(tmp13, obj5);
tmp26 = null != tmp4;
if (tmp26) {
tmp27 = jsx;
obj8 = { style: null, children: null };
2026-07-20 16:05:17 +00:00
items4 = [, ];
2026-07-29 08:29:29 +00:00
({ trailing: arr5[0], trailingText: arr5[1] } = tmp9);
obj8[0] = items4;
obj8[1] = tmp4;
tmp26 = jsx(tmp13, obj8);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items3[1] = tmp26;
obj4[1] = items3;
items1[2] = tmp12(tmp13, obj4);
tmp28 = null != trailing && null == tmp4;
if (tmp28) {
tmp29 = jsx;
obj9 = { style: null, children: null };
obj9[0] = tmp9.trailing;
obj9[1] = trailing;
tmp28 = jsx(tmp13, obj9);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items1[3] = tmp28;
2026-07-20 16:05:17 +00:00
if (arrow) {
2026-07-29 08:29:29 +00:00
tmp30 = jsx;
2026-07-23 10:11:24 +00:00
arrow = jsx(require("TableRowArrow").TableRowArrow, {});
2026-07-20 16:05:17 +00:00
}
items1[4] = arrow;
2026-07-29 08:29:29 +00:00
obj[1] = items1;
return tmp12(tmp13, obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
({ Pressable: c4, View: c5 } = get_ActivityIndicator);
2026-08-24 06:08:38 +00:00
({ jsx: closure_6, Fragment: error, jsxs: closure_8 } = jsxProd);
2026-07-20 16:05:17 +00:00
let closure_9 = { padding: 0 };
2026-07-29 08:29:29 +00:00
let closure_10 = createCacheKey.createStyles((arg0, arg1, arg2) => {
2026-07-20 16:05:17 +00:00
let flag = arg3;
if (arg3 === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
let obj = { padding: ThemesDefault.modules.mobile.TABLE_ROW_PADDING, minHeight: ThemesDefault.modules.mobile.TABLE_ROW_HEIGHT, flexDirection: "row", alignItems: "center", opacity: null, borderRadius: null };
2026-07-20 16:05:17 +00:00
let num = 1;
if (arg0) {
num = 0.5;
}
2026-07-29 08:29:29 +00:00
obj[4] = num;
2026-07-20 16:05:17 +00:00
let md;
if (flag) {
2026-07-29 08:29:29 +00:00
md = tmp(712).radii.md;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj = { row: obj, iconContainer: null, trailing: null, content: null, labels: null, trailingText: md, dragHandle: null };
2026-07-29 08:29:29 +00:00
obj = { minWidth: tmp(712).modules.mobile.TABLE_ROW_ICON_SIZE, marginEnd: tmp(712).modules.mobile.TABLE_ROW_PADDING, alignItems: "center", justifyContent: "center" };
obj[1] = obj;
obj[2] = { marginStart: 18 };
let str = "row";
2026-07-20 16:05:17 +00:00
if (arg2) {
str = "column";
}
2026-08-24 06:08:38 +00:00
obj1 = { flexShrink: 1, flexGrow: 1, flexDirection: str, alignItems: null, justifyContent: "space-between" };
2026-07-29 08:29:29 +00:00
let str2 = "center";
2026-07-20 16:05:17 +00:00
if (arg2) {
str2 = "stretch";
}
2026-07-29 08:29:29 +00:00
obj1[3] = str2;
obj[3] = obj1;
2026-07-20 16:05:17 +00:00
let str3 = "100%";
if (arg1) {
str3 = "100%";
}
2026-07-29 08:29:29 +00:00
const obj2 = { width: str3, flexGrow: null, flexShrink: null, maxWidth: null };
let num2;
2026-07-20 16:05:17 +00:00
if (arg1) {
if (!arg2) {
2026-07-29 08:29:29 +00:00
num2 = 1;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj2[1] = num2;
let num3 = 1;
2026-07-20 16:05:17 +00:00
if (arg1) {
2026-07-29 08:29:29 +00:00
num3 = 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2[2] = num3;
2026-07-20 16:05:17 +00:00
let str4;
if (arg1) {
if (!arg2) {
str4 = "70%";
}
}
2026-07-29 08:29:29 +00:00
obj2[3] = str4;
obj[4] = obj2;
let num4 = 18;
2026-07-20 16:05:17 +00:00
if (arg2) {
2026-07-29 08:29:29 +00:00
num4 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[5] = { flexShrink: 1, marginStart: num4 };
obj[6] = { marginEnd: 8 };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
TableRow.Icon = require("TableRowIcon").TableRowIcon;
TableRow.Arrow = require("TableRowArrow").TableRowArrow;
TableRow.TrailingText = require("TableRowTrailingText").TableRowTrailingText;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("design/components/TableRow/native/TableRow.native.tsx");
2026-07-20 16:05:17 +00:00
export { TableRow };
export { TableRowInner };