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

105 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7216
// Function ID: 7217
2026-07-20 16:05:17 +00:00
// Name: TableSwitchRow
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 21, 4668, 500, 4102, 6322, 4739, 7217, 2]
2026-07-20 16:05:17 +00:00
// Exports: TableSwitchRow
2026-08-24 06:08:38 +00:00
// Module 7216 (TableSwitchRow)
import set from "set" /* 500 */;
import getNodeText from "getNodeText" /* 4102 */;
import TableRowInner from "TableRowInner" /* 6322 */;
import FormSwitch from "FormSwitch" /* 7217 */;
import closure_2 from "_slicedToArray" /* 32 */;
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: c5, jsxs: closure_6 } = jsxProd);
let closure_7 = createCacheKey.createStyles(() => ({ labelWithTrailing: { flexDirection: "row", alignItems: "center", gap: 8 } }));
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("design/components/TableRow/native/TableSwitchRow.native.tsx");
2026-07-20 16:05:17 +00:00
export const TableSwitchRow = function TableSwitchRow(value) {
value = value.value;
2026-08-24 06:08:38 +00:00
require = value;
2026-07-23 10:11:24 +00:00
({ onValueChange: dependencyMap, label, subLabel, trailing, disabled } = value);
2026-07-20 16:05:17 +00:00
if (disabled === undefined) {
disabled = false;
}
const variant = value.variant;
2026-07-29 08:29:29 +00:00
const merged = Object.assign(value, Object.create(null));
2026-07-20 16:05:17 +00:00
let callback;
2026-08-24 06:08:38 +00:00
let obj = set;
2026-07-29 08:29:29 +00:00
const tmp2 = callback2();
2026-08-24 06:08:38 +00:00
obj1 = getNodeText;
2026-07-29 08:29:29 +00:00
const nodeText = obj1.getNodeText(label);
const isAndroidResult = obj.isAndroid();
2026-08-24 06:08:38 +00:00
const nodeText1 = getNodeText.getNodeText(subLabel);
2026-07-29 08:29:29 +00:00
const tmp8 = callback(React.useState(value), 2);
callback = tmp8[1];
2026-07-20 16:05:17 +00:00
const items = [value];
const effect = React.useEffect(() => {
2026-07-29 08:29:29 +00:00
callback(closure_0);
2026-07-20 16:05:17 +00:00
}, items);
obj = {};
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.variant = variant;
obj.arrow = false;
let tmp15Result = label;
2026-07-20 16:05:17 +00:00
if (null != trailing) {
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp2.labelWithTrailing;
let tmp10Result = label;
2026-07-20 16:05:17 +00:00
if (!React.isValidElement(label)) {
2026-07-23 10:11:24 +00:00
let str = "mobile-text-heading-primary";
2026-07-20 16:05:17 +00:00
if ("danger" === variant) {
2026-07-23 10:11:24 +00:00
str = "text-feedback-critical";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1 = { variant: "text-md/semibold", color: null, includeFontPadding: true, children: null };
obj1[1] = str;
obj1[3] = label;
2026-08-24 06:08:38 +00:00
tmp10Result = tmp10(tmp3(4739).Text, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items1 = [tmp10Result, trailing];
obj[1] = items1;
tmp15Result = closure_6(View, obj);
const tmp15 = closure_6;
const tmp16 = View;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.label = tmp15Result;
obj.subLabel = subLabel;
obj.disabled = disabled;
obj.accessibilityState = { disabled, checked: tmp8[0] };
obj.accessible = true;
obj.accessibilityRole = "switch";
let str3 = nodeText1;
if (nodeText1 == null) {
str3 = "";
}
function handleOnPress() {
let tmpResult;
if (closure_1 != null) {
tmpResult = tmp(!closure_0);
}
return tmpResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.accessibilityLabel = "" + nodeText + ", " + str3;
obj.accessibilityHint = value.accessibilityHint;
let tmp14;
2026-07-20 16:05:17 +00:00
if (isAndroidResult) {
2026-07-29 08:29:29 +00:00
tmp14 = handleOnPress;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.onPress = tmp14;
obj.onAccessibilityTap = function onAccessibilityTap() {
callback(!closure_0);
2026-07-20 16:05:17 +00:00
const timerId = setTimeout(() => {
2026-07-29 08:29:29 +00:00
if (closure_1 != null) {
tmp(!closure_0);
2026-07-20 16:05:17 +00:00
}
});
};
2026-08-24 06:08:38 +00:00
obj.trailing = closure_5(FormSwitch.FormSwitch, { "aria-hidden": true, value, onValueChange: handleOnPress, disabled });
return closure_5(TableRowInner.TableRow, obj);
2026-07-20 16:05:17 +00:00
};