decord/source/components_native/channel_settings/ChannelSettingsPermissionsOverrideCheckbox.tsx

162 lines
7.8 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 15566
// Function ID: 120004
2026-07-20 16:05:17 +00:00
// Name: getAccessibilityLabel
2026-07-24 07:16:23 +00:00
// Dependencies: [31, 27, 33, 689, 4130, 3763, 1212, 10453, 8735, 15567, 3848, 2]
2026-07-20 16:05:17 +00:00
2026-07-24 07:16:23 +00:00
// Module 15566 (getAccessibilityLabel)
2026-07-23 10:11:24 +00:00
import get_ActivityIndicator from "get ActivityIndicator";
import { jsx } from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import importAllResult from "result";
let closure_3;
let closure_4;
const require = arg1;
2026-07-20 16:05:17 +00:00
function getAccessibilityLabel(arg0) {
2026-07-23 10:11:24 +00:00
if (require(3763) /* calculateElevatedPermissions */.DENY === arg0) {
const intl3 = require(1212) /* getSystemLocale */.intl;
return intl3.string(require(1212) /* getSystemLocale */.t["6639O5"]);
} else if (require(3763) /* calculateElevatedPermissions */.ALLOW === arg0) {
const intl2 = require(1212) /* getSystemLocale */.intl;
return intl2.string(require(1212) /* getSystemLocale */.t.RzDfSk);
} else if (require(3763) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
const intl = require(1212) /* getSystemLocale */.intl;
return intl.string(require(1212) /* getSystemLocale */.t.ujC3ZS);
2026-07-20 16:05:17 +00:00
}
}
function getIcon(arg0, arg1, icon) {
2026-07-23 10:11:24 +00:00
if (require(3763) /* calculateElevatedPermissions */.DENY === arg0) {
2026-07-20 16:05:17 +00:00
let obj = { size: "sm", style: icon.icon };
2026-07-23 10:11:24 +00:00
const colors3 = importDefault(689).colors;
2026-07-20 16:05:17 +00:00
obj.color = arg1 ? colors3.WHITE : colors3.ICON_FEEDBACK_CRITICAL;
2026-07-24 07:16:23 +00:00
return jsx(require(10453) /* DenyIcon */.DenyIcon, { size: "sm", style: icon.icon });
2026-07-23 10:11:24 +00:00
} else if (require(3763) /* calculateElevatedPermissions */.ALLOW === arg0) {
2026-07-20 16:05:17 +00:00
obj = { size: "sm", style: icon.icon };
2026-07-23 10:11:24 +00:00
const colors2 = importDefault(689).colors;
2026-07-20 16:05:17 +00:00
obj.color = arg1 ? colors2.WHITE : colors2.ICON_FEEDBACK_POSITIVE;
2026-07-24 07:16:23 +00:00
return jsx(require(8735) /* CheckmarkLargeBoldIcon */.CheckmarkLargeBoldIcon, { size: "sm", style: icon.icon });
2026-07-23 10:11:24 +00:00
} else if (require(3763) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
2026-07-20 16:05:17 +00:00
obj = { size: "sm", style: icon.icon };
2026-07-23 10:11:24 +00:00
const colors = importDefault(689).colors;
2026-07-20 16:05:17 +00:00
obj.color = arg1 ? colors.WHITE : colors.INTERACTIVE_TEXT_DEFAULT;
2026-07-24 07:16:23 +00:00
return jsx(require(15567) /* SlashIcon */.SlashIcon, { size: "sm", style: icon.icon });
2026-07-20 16:05:17 +00:00
} else {
return null;
}
}
function getPressableStyleOverrides(arg0, arg1, denySelected) {
2026-07-23 10:11:24 +00:00
if (require(3763) /* calculateElevatedPermissions */.DENY === arg0) {
2026-07-20 16:05:17 +00:00
return arg1 ? denySelected.denySelected : denySelected.denyActive;
2026-07-23 10:11:24 +00:00
} else if (require(3763) /* calculateElevatedPermissions */.ALLOW === arg0) {
2026-07-20 16:05:17 +00:00
return arg1 ? denySelected.allowSelected : denySelected.allowActive;
2026-07-23 10:11:24 +00:00
} else if (require(3763) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
2026-07-20 16:05:17 +00:00
return arg1 ? denySelected.passthroughSelected : denySelected.passthroughActive;
}
}
function OverrideOption(onPress) {
const type = onPress.type;
const selected = onPress.selected;
const styles = onPress.styles;
2026-07-23 10:11:24 +00:00
let obj = type(styles[10]);
2026-07-20 16:05:17 +00:00
const radioA11yNative = obj.useRadioA11yNative({ selected });
obj = {
accessibilityRole: radioA11yNative.accessibilityRole,
accessibilityLabel: getAccessibilityLabel(type),
accessibilityState: radioA11yNative.accessibilityState,
style(pressed) {
if (!selected) {
if (!pressed.pressed) {
let iconWrapper = styles.iconWrapper;
}
return iconWrapper;
}
2026-07-23 10:11:24 +00:00
const items = [outer1_10(type, selected, styles), styles.iconWrapper];
2026-07-20 16:05:17 +00:00
iconWrapper = items;
},
onPress: onPress.onPress,
children: getIcon(type, selected, styles)
};
2026-07-23 10:11:24 +00:00
return <closure_3 accessibilityRole={radioA11yNative.accessibilityRole} accessibilityLabel={getAccessibilityLabel(type)} accessibilityState={radioA11yNative.accessibilityState} style={function style(pressed) {
if (!selected) {
if (!pressed.pressed) {
let iconWrapper = styles.iconWrapper;
}
return iconWrapper;
}
const items = [outer1_10(type, selected, styles), styles.iconWrapper];
iconWrapper = items;
}} onPress={arg0.onPress}>{getIcon(type, selected, styles)}</closure_3>;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ Pressable: closure_3, View: closure_4 } = get_ActivityIndicator);
const PX_4 = require("_createForOfIteratorHelperLoose").space.PX_4;
const md = require("_createForOfIteratorHelperLoose").radii.md;
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
obj = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BASE_LOWEST, borderRadius: md, height: require("_createForOfIteratorHelperLoose").space.PX_32, paddingVertical: PX_4, paddingHorizontal: PX_4 / 2, flexDirection: "row" };
2026-07-20 16:05:17 +00:00
obj.ternaryCheckBox = obj;
2026-07-23 10:11:24 +00:00
_createForOfIteratorHelperLoose = { borderRadius: md - PX_4, marginHorizontal: PX_4 / 2, justifyContent: "center", height: "100%" };
obj.iconWrapper = _createForOfIteratorHelperLoose;
obj.icon = { marginHorizontal: require("_createForOfIteratorHelperLoose").space.PX_8 };
const obj2 = { marginHorizontal: require("_createForOfIteratorHelperLoose").space.PX_8 };
obj.denyActive = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_CRITICAL };
const obj3 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_CRITICAL };
obj.denySelected = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_CRITICAL, borderRadius: require("_createForOfIteratorHelperLoose").radii.sm - 2 };
const obj4 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_CRITICAL, borderRadius: require("_createForOfIteratorHelperLoose").radii.sm - 2 };
obj.allowActive = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_POSITIVE };
const obj5 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_POSITIVE };
obj.allowSelected = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_POSITIVE };
const obj6 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_POSITIVE };
obj.passthroughSelected = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_SELECTED };
const obj7 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_SELECTED };
obj.passthroughActive = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_HOVER };
2026-07-20 16:05:17 +00:00
obj.disabled = { opacity: 0.3 };
2026-07-23 10:11:24 +00:00
let closure_6 = _createForOfIteratorHelperLoose.createStyles(obj);
let items = [require("calculateElevatedPermissions").DENY, require("calculateElevatedPermissions").PASSTHROUGH, require("calculateElevatedPermissions").ALLOW];
const obj8 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_HOVER };
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function ChannelSettingsPermissionsOverrideCheckbox(onValueChange) {
let disabled;
2026-07-23 10:11:24 +00:00
let require;
({ value: require, disabled } = onValueChange);
2026-07-20 16:05:17 +00:00
if (disabled === undefined) {
disabled = false;
}
2026-07-23 10:11:24 +00:00
onValueChange = onValueChange.onValueChange;
let c2;
let tmp = callback();
c2 = tmp;
2026-07-20 16:05:17 +00:00
const obj = {};
const items = [tmp.ternaryCheckBox, ];
let disabled2 = disabled;
if (disabled) {
disabled2 = tmp.disabled;
}
items[1] = disabled2;
obj.style = items;
let str = "auto";
if (disabled) {
str = "none";
}
obj.pointerEvents = str;
obj.accessibilityRole = "radiogroup";
2026-07-23 10:11:24 +00:00
obj.children = items.map((type) => {
let closure_0 = type;
return outer1_5(outer1_11, {
type,
selected: closure_0 === type,
styles: c2,
onPress() {
let tmp = null != outer1_1;
if (tmp) {
tmp = closure_0 !== closure_0;
}
if (tmp) {
outer1_1(closure_0);
}
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
}, "checkbox-" + arg1);
});
return <closure_4 />;
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const result = require("jsxProd").fileFinishedImporting("components_native/channel_settings/ChannelSettingsPermissionsOverrideCheckbox.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;