decord/source/design/components/Menu/native/MenuItem.tsx

72 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 13589
// Function ID: 13590
2026-07-20 16:05:17 +00:00
// Name: MenuItem
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 21, 4380, 13587, 4817, 5473, 5493, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 13589 (MenuItem)
2026-08-24 06:08:38 +00:00
import importAllResult from "noop" /* 19 */;
import { jsx } from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
let closure_5 = createCacheKey.createStyles({ formIcon: { width: 20, height: 20 }, formLabel: { fontSize: 14, fontWeight: "500" } });
2026-07-20 16:05:17 +00:00
const forwardRefResult = importAllResult.forwardRef((action, ref) => {
({ label, IconComponent, iconSource, showIconFirst } = action);
if (showIconFirst === undefined) {
showIconFirst = false;
}
({ disabled, style } = action);
if (disabled === undefined) {
disabled = false;
}
2026-07-23 10:11:24 +00:00
action = action.action;
let menuClose;
2026-07-20 16:05:17 +00:00
const tmp = callback();
2026-08-25 06:04:03 +00:00
menuClose = importAllResult.useContext(action(13587).MenuContext).menuClose;
2026-07-20 16:05:17 +00:00
if (null != IconComponent) {
2026-07-29 08:29:29 +00:00
let tmp3 = <IconComponent size="sm" />;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp3 = null;
2026-07-20 16:05:17 +00:00
if (null != iconSource) {
2026-07-29 08:29:29 +00:00
let obj = { source: null, style: null };
obj[0] = iconSource;
obj[1] = tmp.formIcon;
2026-08-25 06:04:03 +00:00
tmp3 = jsx(menuClose(4817), { source: null, style: null });
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj = { ref, style, accessibilityRole: "menuitem", disabled, leading: null, trailing: null, label: null, onPress: null };
let tmp10 = null;
2026-07-20 16:05:17 +00:00
if (null != iconSource) {
2026-07-29 08:29:29 +00:00
tmp10 = null;
2026-07-20 16:05:17 +00:00
if (showIconFirst) {
2026-07-29 08:29:29 +00:00
tmp10 = tmp3;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj[4] = tmp10;
let tmp11 = null;
2026-07-20 16:05:17 +00:00
if (null != iconSource) {
2026-07-29 08:29:29 +00:00
tmp11 = null;
2026-07-20 16:05:17 +00:00
if (!showIconFirst) {
2026-07-29 08:29:29 +00:00
tmp11 = tmp3;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj[5] = tmp11;
let tmp7Result = label;
2026-08-04 21:03:28 +00:00
if (typeof label === "string") {
2026-07-29 08:29:29 +00:00
obj = { text: null, style: null };
obj[0] = label;
obj[1] = tmp.formLabel;
2026-08-25 06:04:03 +00:00
tmp7Result = tmp7(menuClose(5493), obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[6] = tmp7Result;
obj[7] = function onPress() {
2026-07-20 16:05:17 +00:00
action();
menuClose();
};
2026-08-25 06:04:03 +00:00
return jsx(menuClose(5473), { ref, style, accessibilityRole: "menuitem", disabled, leading: null, trailing: null, label: null, onPress: null });
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("design/components/Menu/native/MenuItem.tsx");
2026-07-20 16:05:17 +00:00
export const MenuItem = forwardRefResult;