207 lines
12 KiB
TypeScript
207 lines
12 KiB
TypeScript
/* Metro module 6238; source: design/components/TableRow/native/TableRow.native.tsx; dependencies: [31, 27, 33, 4501, 697, 1357, 6236, 3860, 6239, 6232, 6242, 6243, 6246, 4584, 477, 6247, 4573, 2] */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import MobileVisualRefreshExperiment2 from '../../../../modules/themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as MobileVisualRefreshExperimentModule from '../../../../modules/themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
|
|
import * as UseTokenModule from '../../../tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
import * as CreateStylesModule from '../../Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UseFontScaleModule from '../../../../modules/screen/native/useFontScale.tsx'; /* Metro dependency 4584 */
|
|
import * as TableRowGroupContextNativeModule from './TableRowGroupContext.native.tsx'; /* Metro dependency 6236 */
|
|
import * as CardNativeModule from '../../Card/native/Card.native.tsx'; /* Metro dependency 6239 */
|
|
import * as TableRowIconNativeModule from './TableRowIcon.native.tsx'; /* Metro dependency 6242 */
|
|
import * as TableRowArrowNativeModule from './TableRowArrow.native.tsx'; /* Metro dependency 6243 */
|
|
import * as TableRowTrailingTextNativeModule from './TableRowTrailingText.native.tsx'; /* Metro dependency 6246 */
|
|
|
|
function _fun49314(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6416:6, offset: 0x011f4dd6, size: 318 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const TableRow2 = TableRow;
|
|
const TableRowInner2 = TableRowInner;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.Pressable;
|
|
const env0_5 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.Fragment;
|
|
const env0_8 = value.jsxs;
|
|
object = {padding: 0};
|
|
const env0_10 = (CreateStylesModule).createStyles(_fun49317);
|
|
const TableRowIcon = (TableRowIconNativeModule).TableRowIcon;
|
|
TableRow2.Icon = TableRowIcon;
|
|
const TableRowArrow = (TableRowArrowNativeModule).TableRowArrow;
|
|
TableRow2.Arrow = TableRowArrow;
|
|
const TableRowTrailingText = (TableRowTrailingTextNativeModule).TableRowTrailingText;
|
|
TableRow2.TrailingText = TableRowTrailingText;
|
|
(FileImportTrackerModule).fileFinishedImporting('design/components/TableRow/native/TableRow.native.tsx');
|
|
exports.TableRow = TableRow2;
|
|
exports.TableRowInner = TableRowInner2;
|
|
function TableRow(a0) { // fn#49315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6416:899, offset: 0x011f4f14, size: 579 bytes, params: 2, frame: 36
|
|
const label = a0.label;
|
|
const subLabel = a0.subLabel;
|
|
const icon = a0.icon;
|
|
const trailing = a0.trailing;
|
|
const arrow = a0.arrow;
|
|
const onPress = a0.onPress;
|
|
let disabled = a0.disabled;
|
|
const value = undefined;
|
|
disabled = !(disabled === value) && disabled;
|
|
const start = a0.start;
|
|
const end = a0.end;
|
|
const labelLineClamp = a0.labelLineClamp;
|
|
const subLabelLineClamp = a0.subLabelLineClamp;
|
|
let variant = a0.variant;
|
|
variant = variant === value ? 'default' : variant;
|
|
const draggable = a0.draggable;
|
|
const dragHandlePressableProps = a0.dragHandlePressableProps;
|
|
const object = {'label': 0, 'subLabel': 0, 'icon': 0, 'trailing': 0, 'arrow': 0, 'onPress': 0, 'disabled': 0,
|
|
'start': 0, 'end': 0, 'labelLineClamp': 0, 'subLabelLineClamp': 0, 'variant': 0, 'draggable': 0,
|
|
'dragHandlePressableProps': 0};
|
|
silentSetPrototypeOf(object, null, undefined);
|
|
const value4 = copyDataProperties({}, a0, object, undefined);
|
|
const MobileVisualRefreshExperiment = (MobileVisualRefreshExperimentModule).MobileVisualRefreshExperiment;
|
|
const useConfig = MobileVisualRefreshExperiment.useConfig;
|
|
const enabled = Reflect.apply(useConfig, MobileVisualRefreshExperiment, [{location: 'TableRow'}]).enabled;
|
|
const useContext = ReactModule.useContext;
|
|
const TableRowGroupContext = (TableRowGroupContextNativeModule).TableRowGroupContext;
|
|
const value6 = Reflect.apply(useContext, ReactModule, [TableRowGroupContext]);
|
|
const value7 = !value6;
|
|
const r1 = value6 ? value7 : end === true;
|
|
const useToken = UseTokenModule.useToken;
|
|
const TABLE_ROW_BORDER_RADIUS = (Native).modules.mobile.TABLE_ROW_BORDER_RADIUS;
|
|
const value9 = Reflect.apply(useToken, UseTokenModule, [TABLE_ROW_BORDER_RADIUS]);
|
|
const InternalCard = (CardNativeModule).InternalCard;
|
|
const internalCard = (
|
|
<InternalCard
|
|
radius={value9}
|
|
shadow="none"
|
|
border="none"
|
|
variant={enabled ? 'muted' : value}
|
|
start={value6 ? value7 : start === true}
|
|
end={r1}
|
|
onPress={onPress}
|
|
disabled={disabled}
|
|
style={env0_9}
|
|
{...value4}
|
|
>
|
|
<TableRowInner
|
|
label={label}
|
|
subLabel={subLabel}
|
|
icon={icon}
|
|
trailing={trailing}
|
|
arrow={arrow}
|
|
disabled={disabled}
|
|
labelLineClamp={labelLineClamp}
|
|
subLabelLineClamp={subLabelLineClamp}
|
|
variant={variant}
|
|
draggable={draggable}
|
|
dragHandlePressableProps={dragHandlePressableProps}
|
|
isRefreshEnabled={enabled}
|
|
/>
|
|
</InternalCard>
|
|
);
|
|
return (
|
|
value6 || r1
|
|
? internalCard
|
|
: (
|
|
<>
|
|
{internalCard}
|
|
{((TableRowDivider) => <TableRowDivider adjustSpacingForIcon={icon != null} />)((require(6232) /* metro dependency 6232: TableRowDividerNative */).TableRowDivider)}
|
|
</>
|
|
)
|
|
);
|
|
}
|
|
|
|
function TableRowInner({label, labelLineClamp, subLabel, subLabelLineClamp, icon, trailing, arrow, disabled, variant, draggable, dragHandlePressableProps, borderRadius, height}) { // fn#49316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6416:1742, offset: 0x011f5157, size: 1043 bytes, params: 2, frame: 40
|
|
variant = variant === undefined ? 'default' : variant;
|
|
draggable = !(draggable === undefined) && draggable;
|
|
const value5 = (MobileVisualRefreshExperiment2)('TableRowInner');
|
|
let binding = ReactModule;
|
|
const r9 = binding.isValidElement(trailing) ? trailing.type !== (require(6246) /* metro dependency 6246: TableRowTrailingTextNative */).TableRowTrailingText ? undefined : trailing : undefined;
|
|
const value6 = (UseFontScaleModule).useFontScale();
|
|
const styles = useStyles(disabled === true, r9 != null,
|
|
PlatformUtilsModule.isAndroid() ? value6 > 1.2 : value6 > 1.5, value5);
|
|
let useToken = UseTokenModule.useToken;
|
|
const TABLE_ROW_LABEL_TEXT_STYLE = (Native).modules.mobile.TABLE_ROW_LABEL_TEXT_STYLE;
|
|
const value9 = Reflect.apply(useToken, UseTokenModule, [TABLE_ROW_LABEL_TEXT_STYLE]);
|
|
useToken = UseTokenModule.useToken;
|
|
const TABLE_ROW_LABEL_COLOR = (Native).modules.mobile.TABLE_ROW_LABEL_COLOR;
|
|
const value10 = Reflect.apply(useToken, UseTokenModule, [TABLE_ROW_LABEL_COLOR]);
|
|
const items4 = [styles.row];
|
|
items4[1] = {borderRadius: borderRadius, height: height};
|
|
const items2 = [
|
|
draggable && <Pressable {...dragHandlePressableProps}>{((DragIcon) => <DragIcon size="xs" style={styles.dragHandle} />)((require(6247) /* metro dependency 6247: DragIcon */).DragIcon)}</Pressable>,
|
|
|
|
];
|
|
items2[1] = icon != null && <View style={styles.iconContainer}>{icon}</View>;
|
|
binding = ReactModule;
|
|
const items3 = [
|
|
binding.isValidElement(label)
|
|
? label
|
|
: ((Text) => <Text variant={value9} color={variant === 'danger' ? 'text-feedback-critical' : value10} lineClamp={labelLineClamp}>{label}</Text>)((require(4573) /* metro dependency 4573: Text */).Text),
|
|
|
|
];
|
|
items3[1] = subLabel != null && (ReactModule.isValidElement(subLabel) ? subLabel : ((Text) => <Text variant="text-xs/medium" color={variant !== 'danger' ? 'text-subtle' : 'text-feedback-critical'} lineClamp={subLabelLineClamp}>{subLabel}</Text>)((require(4573) /* metro dependency 4573: Text */).Text));
|
|
items2[2] = (
|
|
<View style={styles.content}>
|
|
<View style={styles.labels}>
|
|
{items3}
|
|
</View>
|
|
{r9 != null && <View style={[styles.trailing, styles.trailingText]}>{r9}</View>}
|
|
</View>
|
|
);
|
|
items2[3] = trailing != null && r9 == null && <View style={styles.trailing}>{trailing}</View>;
|
|
items2[4] = arrow && ((TableRowArrow) => <TableRowArrow />)((require(6243) /* metro dependency 6243: TableRowArrowNative */).TableRowArrow);
|
|
return (
|
|
<View style={items4}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun49317(a0, a1, a2) { // fn#49317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6416:217, offset: 0x011f556a, size: 419 bytes, params: 4, frame: 21
|
|
let value = a3;
|
|
const value2 = undefined;
|
|
const r11 = value !== value2 ? value : false;
|
|
const object = {};
|
|
const object2 = {};
|
|
let TABLE_ROW_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.TABLE_ROW_PADDING;
|
|
object2.padding = TABLE_ROW_PADDING;
|
|
const TABLE_ROW_HEIGHT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.TABLE_ROW_HEIGHT;
|
|
object2.minHeight = TABLE_ROW_HEIGHT;
|
|
const value3 = 'row';
|
|
object2.flexDirection = value3;
|
|
const value4 = 'center';
|
|
object2.alignItems = value4;
|
|
const value5 = 1;
|
|
object2.opacity = a0 ? 0.5 : value5;
|
|
object2.borderRadius = r11 ? (importDefault(697) /* metro dependency 697: native */).radii.md : value2;
|
|
object.row = object2;
|
|
const object3 = {};
|
|
const TABLE_ROW_ICON_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.TABLE_ROW_ICON_SIZE;
|
|
object3.minWidth = TABLE_ROW_ICON_SIZE;
|
|
TABLE_ROW_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.TABLE_ROW_PADDING;
|
|
object3.marginEnd = TABLE_ROW_PADDING;
|
|
object3.alignItems = value4;
|
|
object3.justifyContent = value4;
|
|
object.iconContainer = object3;
|
|
value = 18;
|
|
object.trailing = {marginStart: value};
|
|
object.content = {'flexShrink': 1, 'flexGrow': 1, 'flexDirection': null, 'alignItems': null,
|
|
'justifyContent': 'space-between', flexDirection: a2 ? 'column' : value3, alignItems: a2 ? 'stretch' : value4};
|
|
object.labels = {flexGrow: value5, flexShrink: a1 ? a2 ? value5 : value2 : value5,
|
|
maxWidth: a1 ? a2 ? value2 : '70%' : value2};
|
|
object.trailingText = {flexShrink: value5, marginStart: a2 ? 0 : value};
|
|
object.dragHandle = {marginEnd: 8};
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun49314, 6238, [31, 27, 33, 4501, 697, 1357, 6236, 3860, 6239, 6232, 6242, 6243, 6246, 4584, 477, 6247,
|
|
4573,
|
|
2]) /* metro module 6238, dependencies: [31, 27, 33, 4501, 697, 1357, 6236, 3860, 6239, 6232, 6242, 6243, 6246, 4584, 477, 6247, 4573, 2] */;
|