158 lines
7.6 KiB
TypeScript
158 lines
7.6 KiB
TypeScript
// Module ID: 15588
|
|
// Function ID: 120179
|
|
// Name: getAccessibilityLabel
|
|
// Dependencies: [31, 27, 33, 689, 4131, 3764, 1212, 10388, 8623, 15589, 3849, 2]
|
|
|
|
// Module 15588 (getAccessibilityLabel)
|
|
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;
|
|
function getAccessibilityLabel(arg0) {
|
|
if (require(3764) /* calculateElevatedPermissions */.DENY === arg0) {
|
|
const intl3 = require(1212) /* getSystemLocale */.intl;
|
|
return intl3.string(require(1212) /* getSystemLocale */.t["6639O5"]);
|
|
} else if (require(3764) /* calculateElevatedPermissions */.ALLOW === arg0) {
|
|
const intl2 = require(1212) /* getSystemLocale */.intl;
|
|
return intl2.string(require(1212) /* getSystemLocale */.t.RzDfSk);
|
|
} else if (require(3764) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
|
|
const intl = require(1212) /* getSystemLocale */.intl;
|
|
return intl.string(require(1212) /* getSystemLocale */.t.ujC3ZS);
|
|
}
|
|
}
|
|
function getIcon(arg0, arg1, icon) {
|
|
if (require(3764) /* calculateElevatedPermissions */.DENY === arg0) {
|
|
let obj = { size: "sm", style: icon.icon };
|
|
const colors3 = importDefault(689).colors;
|
|
obj.color = arg1 ? colors3.WHITE : colors3.ICON_FEEDBACK_CRITICAL;
|
|
return jsx(require(10388) /* DenyIcon */.DenyIcon, { size: "sm", style: icon.icon });
|
|
} else if (require(3764) /* calculateElevatedPermissions */.ALLOW === arg0) {
|
|
obj = { size: "sm", style: icon.icon };
|
|
const colors2 = importDefault(689).colors;
|
|
obj.color = arg1 ? colors2.WHITE : colors2.ICON_FEEDBACK_POSITIVE;
|
|
return jsx(require(8623) /* CheckmarkLargeBoldIcon */.CheckmarkLargeBoldIcon, { size: "sm", style: icon.icon });
|
|
} else if (require(3764) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
|
|
obj = { size: "sm", style: icon.icon };
|
|
const colors = importDefault(689).colors;
|
|
obj.color = arg1 ? colors.WHITE : colors.INTERACTIVE_TEXT_DEFAULT;
|
|
return jsx(require(15589) /* SlashIcon */.SlashIcon, { size: "sm", style: icon.icon });
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
function getPressableStyleOverrides(arg0, arg1, denySelected) {
|
|
if (require(3764) /* calculateElevatedPermissions */.DENY === arg0) {
|
|
return arg1 ? denySelected.denySelected : denySelected.denyActive;
|
|
} else if (require(3764) /* calculateElevatedPermissions */.ALLOW === arg0) {
|
|
return arg1 ? denySelected.allowSelected : denySelected.allowActive;
|
|
} else if (require(3764) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
|
|
return arg1 ? denySelected.passthroughSelected : denySelected.passthroughActive;
|
|
}
|
|
}
|
|
function OverrideOption(type) {
|
|
let onPress;
|
|
let permissionTitle;
|
|
type = type.type;
|
|
const selected = type.selected;
|
|
const styles = type.styles;
|
|
({ permissionTitle, onPress } = type);
|
|
let obj = type(styles[10]);
|
|
const radioA11yNative = obj.useRadioA11yNative({ selected });
|
|
obj = { accessibilityRole: radioA11yNative.accessibilityRole };
|
|
let items = [permissionTitle, getAccessibilityLabel(type)];
|
|
const found = items.filter(Boolean);
|
|
obj.accessibilityLabel = found.join(", ");
|
|
obj.accessibilityState = radioA11yNative.accessibilityState;
|
|
obj.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;
|
|
};
|
|
obj.onPress = onPress;
|
|
obj.children = getIcon(type, selected, styles);
|
|
return <closure_3 accessibilityRole={radioA11yNative.accessibilityRole} />;
|
|
}
|
|
({ Pressable: closure_3, View: closure_4 } = get_ActivityIndicator);
|
|
const PX_4 = require("_createForOfIteratorHelperLoose").space.PX_4;
|
|
const md = require("_createForOfIteratorHelperLoose").radii.md;
|
|
let obj = {};
|
|
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" };
|
|
obj.ternaryCheckBox = obj;
|
|
_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 };
|
|
obj.disabled = { opacity: 0.3 };
|
|
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 };
|
|
const memoResult = importAllResult.memo(function ChannelSettingsPermissionsOverrideCheckbox(permissionTitle) {
|
|
let disabled;
|
|
let importDefault;
|
|
permissionTitle = permissionTitle.permissionTitle;
|
|
({ value: importDefault, disabled } = permissionTitle);
|
|
if (disabled === undefined) {
|
|
disabled = false;
|
|
}
|
|
const onValueChange = permissionTitle.onValueChange;
|
|
let c3;
|
|
let tmp = callback();
|
|
c3 = tmp;
|
|
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";
|
|
obj.accessibilityLabel = permissionTitle;
|
|
obj.children = items.map((type) => {
|
|
let closure_0 = type;
|
|
return outer1_5(outer1_11, {
|
|
permissionTitle: closure_0,
|
|
type,
|
|
selected: closure_1 === type,
|
|
styles: c3,
|
|
onPress() {
|
|
let tmp = null != outer1_2;
|
|
if (tmp) {
|
|
tmp = outer1_1 !== closure_0;
|
|
}
|
|
if (tmp) {
|
|
outer1_2(closure_0);
|
|
}
|
|
}
|
|
}, "checkbox-" + arg1);
|
|
});
|
|
return <closure_4 />;
|
|
});
|
|
const result = require("jsxProd").fileFinishedImporting("components_native/channel_settings/ChannelSettingsPermissionsOverrideCheckbox.tsx");
|
|
|
|
export default memoResult;
|