Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,206 @@
|
||||
/* Metro module 12726; source: design/void/RadioGroup/native/RadioGroup.tsx; dependencies: [31, 27, 482, 33, 4501, 697, 3874, 6746, 12727, 2] */
|
||||
function _fun97420(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:6, offset: 0x021804b8, size: 764 bytes, params: 8, frame: 26
|
||||
var object5;
|
||||
const env0_0 = require;
|
||||
const closure = RadioIndicator;
|
||||
const closure2 = RadioItem;
|
||||
const closure3 = RadioGroup;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
||||
const env0_5 = (require(482) /* metro dependency 482: Constants */).NOOP;
|
||||
let value = require(33) /* metro dependency 33 */;
|
||||
const env0_6 = value.jsx;
|
||||
const env0_7 = value.jsxs;
|
||||
object5 = {SMALL: 8};
|
||||
object5[8] = 'SMALL';
|
||||
object5.MEDIUM = 10;
|
||||
object5[10] = 'MEDIUM';
|
||||
object5.LARGE = 12;
|
||||
object5[12] = 'LARGE';
|
||||
const object7 = {};
|
||||
const SMALL = object5.SMALL;
|
||||
object7[SMALL] = 2;
|
||||
const MEDIUM = object5.MEDIUM;
|
||||
object7[MEDIUM] = 3;
|
||||
const LARGE = object5.LARGE;
|
||||
object7[LARGE] = 4;
|
||||
value = require(4501) /* metro dependency 4501: createStyles */;
|
||||
const createStyles = value.createStyles;
|
||||
const object8 = {};
|
||||
const object10 = {'flex': 0, 'marginRight': 8, 'borderRadius': null, 'borderColor': null, 'borderWidth': 2};
|
||||
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
||||
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
|
||||
object10.borderColor = TEXT_MUTED;
|
||||
object8.radioIcon = object10;
|
||||
const INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
|
||||
object8.radioIconSelected = {borderColor: INTERACTIVE_TEXT_ACTIVE};
|
||||
const object11 = {};
|
||||
object11.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
||||
const CONTROL_BRAND_FOREGROUND = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_BRAND_FOREGROUND;
|
||||
object11.backgroundColor = CONTROL_BRAND_FOREGROUND;
|
||||
object8.radioTick = object11;
|
||||
object8.disabled = {opacity: 0.3};
|
||||
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
||||
object8.divider = {'height': 1, 'alignSelf': 'stretch', 'backgroundColor': null, 'marginLeft': 16,
|
||||
backgroundColor: BORDER_SUBTLE};
|
||||
const object12 = {};
|
||||
object12.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
||||
object12.overflow = 'hidden';
|
||||
object8.collapsibleStyle = object12;
|
||||
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
||||
object8.collapsibleBackgroundSelected = {backgroundColor: BACKGROUND_BASE_LOWEST};
|
||||
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
||||
object8.collapsibleBackground = {backgroundColor: BACKGROUND_SURFACE_HIGH};
|
||||
object8.collapsibleContainer = {'paddingVertical': 4, 'paddingHorizontal': 12};
|
||||
const env0_10 = Reflect.apply(createStyles, value, [object8]);
|
||||
closure.Sizes = object5;
|
||||
closure3.Sizes = object5;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/void/RadioGroup/native/RadioGroup.tsx');
|
||||
exports.default = closure3;
|
||||
exports.RadioIndicator = closure;
|
||||
exports.RadioItem = closure2;
|
||||
}
|
||||
|
||||
function getOuterStylesFromSize() { // fn#97421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:1034, offset: 0x021807b4, size: 60 bytes, params: 1, frame: 4
|
||||
const value = a0;
|
||||
const r2 = value !== undefined ? value : env0_8.MEDIUM;
|
||||
return {width: 2 * r2, height: 2 * r2, padding: env0_9[r2]};
|
||||
}
|
||||
|
||||
function getTickStylesFromSize() { // fn#97422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:1120, offset: 0x021807f0, size: 34 bytes, params: 1, frame: 3
|
||||
const value = a0;
|
||||
const r1 = value !== undefined ? value : env0_8.MEDIUM;
|
||||
return {width: r1, height: r1};
|
||||
}
|
||||
|
||||
function RadioEmpty({size, style}) { // fn#97423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:1188, offset: 0x02180812, size: 79 bytes, params: 2, frame: 18
|
||||
const styles = useStyles();
|
||||
const items2 = [styles.radioIcon];
|
||||
items2[1] = getOuterStylesFromSize(size);
|
||||
items2[2] = style;
|
||||
return <View style={items2} />;
|
||||
}
|
||||
|
||||
function RadioSelected({size, active, style}) { // fn#97424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:1298, offset: 0x02180861, size: 149 bytes, params: 2, frame: 20
|
||||
const styles = useStyles();
|
||||
const items3 = [styles.radioIcon];
|
||||
items3[1] = getOuterStylesFromSize(size);
|
||||
items3[2] = active && styles.radioIconSelected;
|
||||
items3[3] = style;
|
||||
const items2 = [styles.radioTick];
|
||||
items2[1] = getTickStylesFromSize(size);
|
||||
return (
|
||||
<View style={items3}>
|
||||
<View style={items2} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function RadioIndicator({size, active, style}) { // fn#97425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:1504, offset: 0x021808f6, size: 82 bytes, params: 2, frame: 17
|
||||
return active ? <RadioSelected size={size} active={active} style={style} /> : <RadioEmpty size={size} style={style} />;
|
||||
}
|
||||
|
||||
function RadioBar({checked, option, style, size, disabled, indicatorLeft, showIndicator, onPress}) { // fn#97426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:1638, offset: 0x02180948, size: 334 bytes, params: 2, frame: 25
|
||||
const styles = useStyles();
|
||||
const radioIndicator = <RadioIndicator size={size} active={checked} />;
|
||||
const r11 = checked ? styles.collapsibleBackgroundSelected : styles.collapsibleBackground;
|
||||
const {accessibilityRole,
|
||||
accessibilityState} = (require(3874) /* metro dependency 3874: useA11yRolesNative */).useRadioA11yNative({selected: checked,
|
||||
disabled: disabled});
|
||||
const formRow = importDefault(6746) /* metro dependency 6746: FormRow */;
|
||||
const valueProps = {accessibilityRole: accessibilityRole, accessibilityState: accessibilityState,
|
||||
disabled: disabled, onPress: disabled ? undefined : onPress};
|
||||
disabled = disabled && styles.disabled;
|
||||
valueProps.DEPRECATED_style = [style, disabled, option.collapsibleContent != null && r11];
|
||||
valueProps.label = option.name;
|
||||
valueProps.subLabel = option.desc;
|
||||
valueProps.trailing = indicatorLeft ? null : showIndicator ? radioIndicator : null;
|
||||
valueProps.leading = option.leading ?? (indicatorLeft && showIndicator ? radioIndicator : null);
|
||||
return ((Component) => <Component {...valueProps} />)(formRow);
|
||||
}
|
||||
|
||||
function RadioItem({option, checked, style, size, disabled, indicatorLeft, showIndicator, onPress}) { // fn#97427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:2206, offset: 0x02180a96, size: 290 bytes, params: 2, frame: 25
|
||||
var r0;
|
||||
const closure = onPress_97428;
|
||||
var value;
|
||||
const styles = useStyles();
|
||||
disabled = !disabled ? option.disabled : disabled;
|
||||
if (option.collapsibleContent != null) {
|
||||
var viewBindingProps = {style: styles.collapsibleContainer};
|
||||
value = importDefault(12727) /* metro dependency 12727: Collapsible */;
|
||||
value = <View {...viewBindingProps}>{((Component) => <Component isExpanded={checked} collapsibleContent={option.collapsibleContent} style={styles.collapsibleStyle}>{children_97429}</Component>)(value)}</View>;
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = <RadioBar option={option} checked={checked} style={style} size={size} disabled={!!disabled} onPress={closure} indicatorLeft={indicatorLeft} showIndicator={showIndicator} />;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function RadioGroup({value = null, options = [], style, size = env0_8.MEDIUM, disabled, withSpacing, indicatorLeft, showIndicator, withDividers, onChange = NOOP}) { // fn#97431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:2852, offset: 0x02180c7c, size: 232 bytes, params: 2, frame: 16
|
||||
if (disabled !== undefined) {
|
||||
}
|
||||
if (withSpacing !== undefined) {
|
||||
}
|
||||
if (indicatorLeft !== undefined) {
|
||||
}
|
||||
if (showIndicator !== undefined) {
|
||||
}
|
||||
if (withDividers !== undefined) {
|
||||
}
|
||||
const env0_10 = useStyles();
|
||||
return (
|
||||
<View>
|
||||
{options.map(_fun97432)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function RadioItemOnPress(a0) { // fn#97428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:2325, owner: RadioItem.onPress, offset: 0x02180bb8, size: 48 bytes, params: 2, frame: 12
|
||||
a0.preventDefault();
|
||||
return onPress?.(option);
|
||||
}
|
||||
|
||||
function RadioItemChildren({onPress}) { // fn#97429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:2585, owner: RadioItem.children, offset: 0x02180be8, size: 117 bytes, params: 2, frame: 15
|
||||
return (
|
||||
<RadioBar
|
||||
option={option}
|
||||
checked={checked}
|
||||
style={style}
|
||||
size={size}
|
||||
disabled={!!disabled}
|
||||
onPress={function(a0) {
|
||||
onPress_97428(a0);
|
||||
onPress(a0);
|
||||
}}
|
||||
indicatorLeft={indicatorLeft}
|
||||
showIndicator={showIndicator}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function _fun97432(a0, a1) { // fn#97432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12916:3063, offset: 0x02180d64, size: 363 bytes, params: 3, frame: 26
|
||||
let value = environment.__proto__;
|
||||
const Fragment = env1_3.Fragment;
|
||||
let length = env0_1.length;
|
||||
let JSON = global.JSON;
|
||||
let stringify = JSON.stringify;
|
||||
const radioItem = <RadioItem option={a0} checked={env0_0 === a0.value} style={[style,
|
||||
a1 === length - 1 ? {marginBottom: 0} : withSpacing ? {marginBottom: 8} : {}]} size={env0_3} disabled={disabled} onPress={env0_9} indicatorLeft={indicatorLeft} showIndicator={showIndicator} key={'radio-option-' + Reflect.apply(stringify,
|
||||
JSON, [a0.value]) + '-' + a1} />;
|
||||
length = env0_1.length;
|
||||
const value8 = null;
|
||||
const r10 = a1 === length - 1 ? value8 : withDividers ? <View style={styles.divider} /> : value8;
|
||||
JSON = global.JSON;
|
||||
stringify = JSON.stringify;
|
||||
value = a0.value;
|
||||
value = Reflect.apply(stringify, JSON, [value]);
|
||||
return (
|
||||
<Fragment key={'radio-option-' + value + '-' + a1}>
|
||||
{radioItem}
|
||||
{r10}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user