@tamagui/menu 1.79.11 → 1.79.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Menu.js +2 -2
- package/dist/cjs/Menu.js.map +1 -1
- package/dist/cjs/Menu.native.js +2 -2
- package/dist/cjs/Menu.native.js.map +1 -1
- package/dist/cjs/createNativeMenu/createNativeMenu.android.js +263 -0
- package/dist/cjs/createNativeMenu/createNativeMenu.android.js.map +6 -0
- package/dist/cjs/createNativeMenu/createNativeMenu.ios.js +336 -0
- package/dist/cjs/createNativeMenu/createNativeMenu.ios.js.map +6 -0
- package/dist/cjs/createNativeMenu/createNativeMenu.js +46 -0
- package/dist/cjs/createNativeMenu/createNativeMenu.js.map +6 -0
- package/dist/cjs/createNativeMenu/createNativeMenu.native.js +47 -0
- package/dist/cjs/createNativeMenu/createNativeMenu.native.js.map +6 -0
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.js +14 -0
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.js.map +6 -0
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.native.js +15 -0
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.native.js.map +6 -0
- package/dist/cjs/createNativeMenu/index.js +21 -0
- package/dist/cjs/createNativeMenu/index.js.map +6 -0
- package/dist/cjs/createNativeMenu/index.native.js +22 -0
- package/dist/cjs/createNativeMenu/index.native.js.map +6 -0
- package/dist/cjs/createNativeMenu/utils.js +78 -0
- package/dist/cjs/createNativeMenu/utils.js.map +6 -0
- package/dist/cjs/createNativeMenu/utils.native.js +79 -0
- package/dist/cjs/createNativeMenu/utils.native.js.map +6 -0
- package/dist/cjs/createNativeMenu/withNativeMenu.js +40 -0
- package/dist/cjs/createNativeMenu/withNativeMenu.js.map +6 -0
- package/dist/cjs/createNativeMenu/withNativeMenu.native.js +41 -0
- package/dist/cjs/createNativeMenu/withNativeMenu.native.js.map +6 -0
- package/dist/esm/Menu.js +2 -1
- package/dist/esm/Menu.js.map +1 -1
- package/dist/esm/Menu.native.js +2 -1
- package/dist/esm/Menu.native.js.map +1 -1
- package/dist/esm/createNativeMenu/createNativeMenu.android.js +251 -0
- package/dist/esm/createNativeMenu/createNativeMenu.android.js.map +6 -0
- package/dist/esm/createNativeMenu/createNativeMenu.ios.js +323 -0
- package/dist/esm/createNativeMenu/createNativeMenu.ios.js.map +6 -0
- package/dist/esm/createNativeMenu/createNativeMenu.js +26 -0
- package/dist/esm/createNativeMenu/createNativeMenu.js.map +6 -0
- package/dist/esm/createNativeMenu/createNativeMenu.native.js +26 -0
- package/dist/esm/createNativeMenu/createNativeMenu.native.js.map +6 -0
- package/dist/esm/createNativeMenu/createNativeMenuTypes.js +1 -0
- package/dist/esm/createNativeMenu/createNativeMenuTypes.js.map +6 -0
- package/dist/esm/createNativeMenu/createNativeMenuTypes.native.js +1 -0
- package/dist/esm/createNativeMenu/createNativeMenuTypes.native.js.map +6 -0
- package/dist/esm/createNativeMenu/index.js +3 -0
- package/dist/esm/createNativeMenu/index.js.map +6 -0
- package/dist/esm/createNativeMenu/index.native.js +3 -0
- package/dist/esm/createNativeMenu/index.native.js.map +6 -0
- package/dist/esm/createNativeMenu/utils.js +47 -0
- package/dist/esm/createNativeMenu/utils.js.map +6 -0
- package/dist/esm/createNativeMenu/utils.native.js +47 -0
- package/dist/esm/createNativeMenu/utils.native.js.map +6 -0
- package/dist/esm/createNativeMenu/withNativeMenu.js +21 -0
- package/dist/esm/createNativeMenu/withNativeMenu.js.map +6 -0
- package/dist/esm/createNativeMenu/withNativeMenu.native.js +21 -0
- package/dist/esm/createNativeMenu/withNativeMenu.native.js.map +6 -0
- package/dist/jsx/Menu.js +2 -1
- package/dist/jsx/Menu.js.map +1 -1
- package/dist/jsx/Menu.native.js +2 -1
- package/dist/jsx/Menu.native.js.map +1 -1
- package/dist/jsx/createNativeMenu/createNativeMenu.android.js +245 -0
- package/dist/jsx/createNativeMenu/createNativeMenu.android.js.map +6 -0
- package/dist/jsx/createNativeMenu/createNativeMenu.ios.js +322 -0
- package/dist/jsx/createNativeMenu/createNativeMenu.ios.js.map +6 -0
- package/dist/jsx/createNativeMenu/createNativeMenu.js +26 -0
- package/dist/jsx/createNativeMenu/createNativeMenu.js.map +6 -0
- package/dist/jsx/createNativeMenu/createNativeMenu.native.js +26 -0
- package/dist/jsx/createNativeMenu/createNativeMenu.native.js.map +6 -0
- package/dist/jsx/createNativeMenu/createNativeMenuTypes.js +1 -0
- package/dist/jsx/createNativeMenu/createNativeMenuTypes.js.map +6 -0
- package/dist/jsx/createNativeMenu/createNativeMenuTypes.native.js +1 -0
- package/dist/jsx/createNativeMenu/createNativeMenuTypes.native.js.map +6 -0
- package/dist/jsx/createNativeMenu/index.js +3 -0
- package/dist/jsx/createNativeMenu/index.js.map +6 -0
- package/dist/jsx/createNativeMenu/index.native.js +3 -0
- package/dist/jsx/createNativeMenu/index.native.js.map +6 -0
- package/dist/jsx/createNativeMenu/utils.js +46 -0
- package/dist/jsx/createNativeMenu/utils.js.map +6 -0
- package/dist/jsx/createNativeMenu/utils.native.js +49 -0
- package/dist/jsx/createNativeMenu/utils.native.js.map +6 -0
- package/dist/jsx/createNativeMenu/withNativeMenu.js +20 -0
- package/dist/jsx/createNativeMenu/withNativeMenu.js.map +6 -0
- package/dist/jsx/createNativeMenu/withNativeMenu.native.js +20 -0
- package/dist/jsx/createNativeMenu/withNativeMenu.native.js.map +6 -0
- package/package.json +5 -4
- package/src/Menu.tsx +3 -2
- package/types/Menu.d.ts.map +1 -1
- package/types/createNativeMenu/createNativeMenu.android.d.ts.map +1 -0
- package/types/createNativeMenu/createNativeMenu.d.ts.map +1 -0
- package/types/createNativeMenu/createNativeMenu.ios.d.ts.map +1 -0
- package/types/createNativeMenu/createNativeMenuTypes.d.ts.map +1 -0
- package/types/createNativeMenu/index.d.ts.map +1 -0
- package/types/createNativeMenu/utils.d.ts.map +1 -0
- package/types/createNativeMenu/withNativeMenu.d.ts.map +1 -0
package/dist/jsx/Menu.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Menu.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AAErC,SAAS,4BAA4B;AACrC,SAAgB,eAAe;AAE/B,MAAM,WAAW,CAAC,UACT,MAAM,UAWF,OAAO;AAAA,EAClB,CAAC,EAAE,UAAU,MAAM,UAAU,aAAa,SAAS,aAAa,MAAiB;AAC/E,UAAM,QAAQ,SAAS,GACjB,CAAC,MAAM,OAAO,IAAI,qBAAqB;AAAA,MAC3C,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,MAAM;AACb,uBAAe,IAAI;AAAA,MACrB;AAAA,IACF,CAAC,GAEK,eAAe,QAAQ,OACpB;AAAA,MACL,SAAS,MAAM;AACb,gBAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,MACnB;AAAA,IACF,IACC,CAAC,CAAC;AAaL,WAAO;AAAA,EAeT;AAAA,EACA;AAAA,IACE,MAAM;AAAA;AAAA,EAER;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/jsx/Menu.native.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useMedia
|
|
1
|
+
import { useMedia } from "@tamagui/core";
|
|
2
|
+
import { withStaticProperties } from "@tamagui/helpers";
|
|
2
3
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
3
4
|
import { useMemo } from "react";
|
|
4
5
|
const MenuItem = (props) => props.children, Menu = withStaticProperties(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Menu.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AAErC,SAAS,4BAA4B;AACrC,SAAgB,eAAe;AAE/B,MAAM,WAAW,CAAC,UACT,MAAM,UAWF,OAAO;AAAA,EAClB,CAAC,EAAE,UAAU,MAAM,UAAU,aAAa,SAAS,aAAa,MAAiB;AAC/E,UAAM,QAAQ,SAAS,GACjB,CAAC,MAAM,OAAO,IAAI,qBAAqB;AAAA,MAC3C,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,MAAM;AACb,6CAAe;AAAA,MACjB;AAAA,IACF,CAAC,GAEK,eAAe,QAAQ,OACpB;AAAA,MACL,SAAS,MAAM;AACb,gBAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,MACnB;AAAA,IACF,IACC,CAAC,CAAC;AAaL,WAAO;AAAA,EAeT;AAAA,EACA;AAAA,IACE,MAAM;AAAA;AAAA,EAER;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { MenuView } from "@react-native-menu/menu";
|
|
2
|
+
import { withStaticProperties } from "@tamagui/core";
|
|
3
|
+
import { Children, cloneElement } from "react";
|
|
4
|
+
import { View } from "tamagui";
|
|
5
|
+
import { NativePropProvider } from "../Menu";
|
|
6
|
+
import {
|
|
7
|
+
create,
|
|
8
|
+
filterNull,
|
|
9
|
+
flattenChildren,
|
|
10
|
+
isInstanceOfComponent,
|
|
11
|
+
pickChildren
|
|
12
|
+
} from "./utils";
|
|
13
|
+
const COMPONENTS_TO_IGNORE = ["Portal", "Radio"], createAndroidMenu = (MenuType) => {
|
|
14
|
+
const Trigger = create(({ children, asChild, ...rest }) => asChild ? cloneElement(children, {
|
|
15
|
+
...rest
|
|
16
|
+
}) : <View {...rest}>{children}</View>, `${MenuType}Trigger`), Auxiliary = create(
|
|
17
|
+
({ children }) => null,
|
|
18
|
+
`${MenuType}Auxiliary`
|
|
19
|
+
), Group = create(({ children }) => <>{children}</>, `${MenuType}Group`), Content = create(({ children }) => (children || console.error(`Menu <Content /> children must be written directly inline.
|
|
20
|
+
|
|
21
|
+
You cannot wrap this component into its own component. It should look like this:
|
|
22
|
+
|
|
23
|
+
<Menu>
|
|
24
|
+
<Content>
|
|
25
|
+
<Item />
|
|
26
|
+
<Item />
|
|
27
|
+
</Content>
|
|
28
|
+
</Menu>
|
|
29
|
+
|
|
30
|
+
Notice that the <Item /> are all children of the <Content /> component. That's important.
|
|
31
|
+
|
|
32
|
+
If you want to use a custom component as your <Content />, you can use the create() method. But you still need to pass all items as children of <Content />.`), <>{children}</>), `${MenuType}Content`), ItemTitle = create(({ children }) => {
|
|
33
|
+
if (typeof children != "string")
|
|
34
|
+
throw new Error("Menu <ItemTitle /> child must be a string");
|
|
35
|
+
return <>{children}</>;
|
|
36
|
+
}, `${MenuType}ItemTitle`), ItemIcon = create((props) => (props.androidIconName || console.warn(
|
|
37
|
+
"Menu <ItemIcon /> missing androidIconName prop. Will do nothing on android. Consider passing an androidIconName or switching to <ItemImage />."
|
|
38
|
+
), <>{}</>), `${MenuType}ItemIcon`), ItemImage = create((props) => (props.androidIconName || console.warn(
|
|
39
|
+
"Menu <ItemImage /> will not use your custom image on android. You should use the androidIconName prop to render an icon on android too."
|
|
40
|
+
), <>{}</>), `${MenuType}ItemImage`), ItemSubtitle = create(({ children }) => {
|
|
41
|
+
if (children && typeof children != "string")
|
|
42
|
+
throw new Error("Menu <ItemSubtitle /> child must be a string");
|
|
43
|
+
return <>{children}</>;
|
|
44
|
+
}, `${MenuType}ItemSubtitle`), Item = create(({ children }) => {
|
|
45
|
+
const titleChild = pickChildren(children, ItemTitle).targetChildren;
|
|
46
|
+
return typeof children != "string" && !(titleChild != null && titleChild.length) && console.error(
|
|
47
|
+
`Menu Invalid <Item />. It either needs <ItemTitle /> in the children.
|
|
48
|
+
|
|
49
|
+
<Item>
|
|
50
|
+
<ItemTitle>
|
|
51
|
+
Title here
|
|
52
|
+
</ItemTitle>
|
|
53
|
+
</Item>
|
|
54
|
+
`
|
|
55
|
+
), <>{children}</>;
|
|
56
|
+
}, `${MenuType}Item`), SubTrigger = create(({ children }) => {
|
|
57
|
+
const titleChild = pickChildren(children, ItemTitle).targetChildren;
|
|
58
|
+
return typeof children != "string" && !(titleChild != null && titleChild.length) && console.error(
|
|
59
|
+
`Menu Invalid <SubTrigger />. It either needs an <ItemTitle /> in the children.
|
|
60
|
+
|
|
61
|
+
<SubTrigger>
|
|
62
|
+
<ItemTitle>
|
|
63
|
+
Title here
|
|
64
|
+
</ItemTitle>
|
|
65
|
+
</SubTrigger>
|
|
66
|
+
`
|
|
67
|
+
), <>{children}</>;
|
|
68
|
+
}, `${MenuType}SubTrigger`), Sub = create((_) => <></>, `${MenuType}Sub`), SubContent = create((_) => <></>, `${MenuType}SubContent`), CheckboxItem = create(({ children }) => <></>, `${MenuType}CheckboxItem`), Label = create(({ children }) => (typeof children != "string" && console.error("Menu <Label /> children must be a string."), <></>), `${MenuType}Label`), Menu = create((props) => {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
const trigger = pickChildren(props.children, Trigger), content = (_a = pickChildren(
|
|
71
|
+
props.children,
|
|
72
|
+
Content,
|
|
73
|
+
COMPONENTS_TO_IGNORE
|
|
74
|
+
).targetChildren) == null ? void 0 : _a[0], callbacks = {}, getItemFromChild = (child, index) => {
|
|
75
|
+
var _a2, _b2, _c2, _d;
|
|
76
|
+
let title;
|
|
77
|
+
const key = child.key ? `${child.key}` : `item-${index}`;
|
|
78
|
+
let subtitle;
|
|
79
|
+
const menuAttributes = {};
|
|
80
|
+
child.props.disabled && (menuAttributes.disabled = !0), child.props.destructive && (menuAttributes.destructive = !0), child.props.hidden && (menuAttributes.hidden = !0);
|
|
81
|
+
let icon;
|
|
82
|
+
if (typeof child.props.children == "string")
|
|
83
|
+
title = child.props.children;
|
|
84
|
+
else {
|
|
85
|
+
const titleChild = pickChildren(
|
|
86
|
+
child.props.children,
|
|
87
|
+
ItemTitle,
|
|
88
|
+
COMPONENTS_TO_IGNORE
|
|
89
|
+
).targetChildren, maybeTitle = child.props.textValue ?? ((_a2 = titleChild == null ? void 0 : titleChild[0]) == null ? void 0 : _a2.props.children);
|
|
90
|
+
typeof maybeTitle == "string" ? title = maybeTitle : console.error(
|
|
91
|
+
`Menu Invalid <${Menu}.Item key="${key}" /> Missing valid title. Make sure you do one of the following:
|
|
92
|
+
|
|
93
|
+
1. pass a string as the child of <${Menu}.ItemTitle />, nested directly inside of <${Menu}.Item />.
|
|
94
|
+
2. OR, use the textValue prop on <${Menu}.Item textValue="Some value" />`
|
|
95
|
+
);
|
|
96
|
+
const subtitleChild = pickChildren(
|
|
97
|
+
child.props.children,
|
|
98
|
+
ItemSubtitle
|
|
99
|
+
).targetChildren;
|
|
100
|
+
typeof ((_b2 = subtitleChild == null ? void 0 : subtitleChild[0]) == null ? void 0 : _b2.props.children) == "string" && (subtitle = subtitleChild[0].props.children);
|
|
101
|
+
const iconChildren = pickChildren(
|
|
102
|
+
child.props.children,
|
|
103
|
+
ItemIcon
|
|
104
|
+
).targetChildren;
|
|
105
|
+
if ((_c2 = iconChildren == null ? void 0 : iconChildren[0]) != null && _c2.props.androidIconName)
|
|
106
|
+
icon = iconChildren[0].props.androidIconName;
|
|
107
|
+
else {
|
|
108
|
+
const imageChild = (_d = pickChildren(
|
|
109
|
+
child.props.children,
|
|
110
|
+
ItemImage
|
|
111
|
+
).targetChildren) == null ? void 0 : _d[0];
|
|
112
|
+
if (imageChild) {
|
|
113
|
+
const { androidIconName } = imageChild.props;
|
|
114
|
+
androidIconName && (icon = androidIconName);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (title) {
|
|
119
|
+
const maybeIndexKey = typeof child.key == "string" && child.key.startsWith(".") ? child.key.substring(1) : void 0;
|
|
120
|
+
if (
|
|
121
|
+
// if the key doesn't exist as a string
|
|
122
|
+
(typeof child.key != "string" || // or if flattenChildren assigned the key as `.${key}${index}`
|
|
123
|
+
child.key.startsWith(".") && !isNaN(Number(maybeIndexKey))) && console.warn(
|
|
124
|
+
`Menu <Item /> is missing a unique key. Pass a unique key string for each item, such as: <Item key="${title.toLowerCase().replace(/ /g, "-") || `action-${index}`}" />. Falling back to index (${key}) instead, but this may have negative consequences.`
|
|
125
|
+
), "onSelect" in child.props && child.props.onSelect
|
|
126
|
+
)
|
|
127
|
+
callbacks[key] = child.props.onSelect;
|
|
128
|
+
else if ("onValueChange" in child.props) {
|
|
129
|
+
const menuState = child.props.value, currentState = menuState === !0 ? "on" : menuState === !1 ? "off" : menuState, nextState = currentState === "mixed" || currentState === "on" ? "off" : "on", { onValueChange } = child.props;
|
|
130
|
+
callbacks[key] = () => {
|
|
131
|
+
onValueChange == null || onValueChange(nextState, currentState);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
key,
|
|
136
|
+
title,
|
|
137
|
+
subtitle,
|
|
138
|
+
menuAttributes,
|
|
139
|
+
icon
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}, mapItemsChildren = (children) => Children.map(
|
|
143
|
+
flattenChildren(children, [...COMPONENTS_TO_IGNORE, "Group"]),
|
|
144
|
+
(_child, index) => {
|
|
145
|
+
var _a2, _b2;
|
|
146
|
+
if (isInstanceOfComponent(_child, Item)) {
|
|
147
|
+
const item = getItemFromChild(_child, index);
|
|
148
|
+
if (item) {
|
|
149
|
+
const { icon, title, key, menuAttributes, subtitle } = item;
|
|
150
|
+
return {
|
|
151
|
+
id: key,
|
|
152
|
+
title,
|
|
153
|
+
image: icon,
|
|
154
|
+
attributes: menuAttributes,
|
|
155
|
+
subtitle
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
} else if (isInstanceOfComponent(_child, CheckboxItem)) {
|
|
159
|
+
const child = _child, item = getItemFromChild(child, index);
|
|
160
|
+
if (item) {
|
|
161
|
+
const { icon, title, key, menuAttributes, subtitle } = item, menuState = child.props.value;
|
|
162
|
+
return {
|
|
163
|
+
id: key,
|
|
164
|
+
title,
|
|
165
|
+
image: icon,
|
|
166
|
+
attributes: menuAttributes,
|
|
167
|
+
subtitle,
|
|
168
|
+
state: menuState === !0 ? "on" : menuState === !1 ? "off" : menuState
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
} else if (isInstanceOfComponent(_child, Sub)) {
|
|
172
|
+
const child = _child, key = child.key ? `${child.key}` : `sub-${index}`, triggerItemChild = (_a2 = pickChildren(
|
|
173
|
+
child.props.children,
|
|
174
|
+
SubTrigger
|
|
175
|
+
).targetChildren) == null ? void 0 : _a2[0], triggerItem2 = triggerItemChild && getItemFromChild(triggerItemChild, index);
|
|
176
|
+
if (triggerItem2) {
|
|
177
|
+
const nestedContent = (_b2 = pickChildren(
|
|
178
|
+
child.props.children,
|
|
179
|
+
SubContent,
|
|
180
|
+
COMPONENTS_TO_IGNORE
|
|
181
|
+
).targetChildren) == null ? void 0 : _b2[0];
|
|
182
|
+
if (nestedContent) {
|
|
183
|
+
const nestedItems = mapItemsChildren(nestedContent.props.children).filter(
|
|
184
|
+
filterNull
|
|
185
|
+
);
|
|
186
|
+
if (nestedItems.length)
|
|
187
|
+
return {
|
|
188
|
+
id: key,
|
|
189
|
+
title: triggerItem2 == null ? void 0 : triggerItem2.title,
|
|
190
|
+
image: triggerItem2 == null ? void 0 : triggerItem2.icon,
|
|
191
|
+
subactions: nestedItems,
|
|
192
|
+
attributes: triggerItem2.menuAttributes
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
), menuItems = mapItemsChildren(content == null ? void 0 : content.props.children).filter(filterNull), labelComp = (_b = pickChildren(content == null ? void 0 : content.props.children, Label).targetChildren) == null ? void 0 : _b[0];
|
|
200
|
+
let menuTitle = "";
|
|
201
|
+
typeof (labelComp == null ? void 0 : labelComp.props.children) == "string" ? menuTitle = labelComp.props.children : labelComp != null && labelComp.props.textValue && (menuTitle = labelComp.props.textValue);
|
|
202
|
+
const triggerItem = (_c = trigger.targetChildren) == null ? void 0 : _c[0];
|
|
203
|
+
let shouldOpenOnLongPress = MenuType === "ContextMenu";
|
|
204
|
+
return triggerItem != null && triggerItem.props.action && (shouldOpenOnLongPress = triggerItem.props.action === "longPress"), <NativePropProvider
|
|
205
|
+
native
|
|
206
|
+
scope={MenuType === "DropdownMenu" ? "DropdownMenuContext" : "ContextMenuContext"}
|
|
207
|
+
><MenuView
|
|
208
|
+
title={menuTitle}
|
|
209
|
+
onPressAction={({ nativeEvent }) => {
|
|
210
|
+
callbacks[nativeEvent.event]();
|
|
211
|
+
}}
|
|
212
|
+
shouldOpenOnLongPress={shouldOpenOnLongPress}
|
|
213
|
+
actions={menuItems}
|
|
214
|
+
>{triggerItem}</MenuView></NativePropProvider>;
|
|
215
|
+
}, `${MenuType}`), Separator = create((_) => <></>, `${MenuType}Separator`), ItemIndicator = create(
|
|
216
|
+
(_) => <></>,
|
|
217
|
+
`${MenuType}ItemIndicator`
|
|
218
|
+
), Preview = create((_) => <></>, `${MenuType}Preview`), Arrow = create((_) => <></>, `${MenuType}Arrow`);
|
|
219
|
+
return {
|
|
220
|
+
Menu: withStaticProperties(Menu, {
|
|
221
|
+
Trigger,
|
|
222
|
+
Content,
|
|
223
|
+
Item,
|
|
224
|
+
ItemTitle,
|
|
225
|
+
ItemSubtitle,
|
|
226
|
+
SubTrigger,
|
|
227
|
+
Group,
|
|
228
|
+
Separator,
|
|
229
|
+
ItemIcon,
|
|
230
|
+
ItemIndicator,
|
|
231
|
+
CheckboxItem,
|
|
232
|
+
ItemImage,
|
|
233
|
+
Label,
|
|
234
|
+
Preview,
|
|
235
|
+
Arrow,
|
|
236
|
+
Sub,
|
|
237
|
+
SubContent,
|
|
238
|
+
Auxiliary
|
|
239
|
+
})
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
export {
|
|
243
|
+
createAndroidMenu as createNativeMenu
|
|
244
|
+
};
|
|
245
|
+
//# sourceMappingURL=createNativeMenu.android.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
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
1
|
+
import { withStaticProperties } from "@tamagui/core";
|
|
2
|
+
import { Children, cloneElement, useRef } from "react";
|
|
3
|
+
import { Image } from "react-native";
|
|
4
|
+
import {
|
|
5
|
+
ContextMenuButton,
|
|
6
|
+
ContextMenuView
|
|
7
|
+
} from "react-native-ios-context-menu";
|
|
8
|
+
import { View } from "tamagui";
|
|
9
|
+
import { NativePropProvider } from "../Menu";
|
|
10
|
+
import {
|
|
11
|
+
create,
|
|
12
|
+
filterNull,
|
|
13
|
+
flattenChildren,
|
|
14
|
+
isInstanceOfComponent,
|
|
15
|
+
pickChildren
|
|
16
|
+
} from "./utils";
|
|
17
|
+
const COMPONENTS_TO_IGNORE = ["Portal", "Radio"], createIosMenu = (MenuType) => {
|
|
18
|
+
const Trigger = create(({ children, asChild, ...rest }) => asChild ? cloneElement(children, {
|
|
19
|
+
...rest
|
|
20
|
+
}) : <View {...rest}>{children}</View>, `${MenuType}Trigger`), Auxiliary = create(({ children }) => <></>, `${MenuType}Auxiliary`), Group = create(({ children }) => <>{children}</>, `${MenuType}Group`), Content = create(({ children }) => (children || console.error(`Menu <Content /> children must be written directly inline.
|
|
21
|
+
|
|
22
|
+
You cannot wrap this component into its own component. It should look like this:
|
|
23
|
+
|
|
24
|
+
<Menu>
|
|
25
|
+
<Content>
|
|
26
|
+
<Item />
|
|
27
|
+
<Item />
|
|
28
|
+
</Content>
|
|
29
|
+
</Menu>
|
|
30
|
+
|
|
31
|
+
Notice that the <Item /> are all children of the <Content /> component. That's important.
|
|
32
|
+
|
|
33
|
+
If you want to use a custom component as your <Content />, you can use the create() method. But you still need to pass all items as children of <Content />.`), <>{children}</>), `${MenuType}Content`), ItemTitle = create(({ children }) => {
|
|
34
|
+
if (typeof children != "string")
|
|
35
|
+
throw new Error("Menu <ItemTitle /> child must be a string");
|
|
36
|
+
return <>{children}</>;
|
|
37
|
+
}, `${MenuType}ItemTitle`), ItemIcon = create((_) => <>{}</>, `${MenuType}ItemIcon`), ItemImage = create((_) => <>{}</>, `${MenuType}ItemImage`), ItemSubtitle = create(({ children }) => {
|
|
38
|
+
if (children && typeof children != "string")
|
|
39
|
+
throw new Error("Menu <ItemSubtitle /> child must be a string");
|
|
40
|
+
return <>{children}</>;
|
|
41
|
+
}, `${MenuType}ItemSubtitle`), Item = create(({ children }) => {
|
|
42
|
+
const titleChild = pickChildren(children, ItemTitle).targetChildren;
|
|
43
|
+
return typeof children != "string" && !(titleChild != null && titleChild.length) && console.error(
|
|
44
|
+
`Menu Invalid <Item />. It either needs <ItemTitle /> in the children.
|
|
45
|
+
|
|
46
|
+
<Item>
|
|
47
|
+
<ItemTitle>
|
|
48
|
+
Title here
|
|
49
|
+
</ItemTitle>
|
|
50
|
+
</Item>
|
|
51
|
+
`
|
|
52
|
+
), <>{children}</>;
|
|
53
|
+
}, `${MenuType}Item`), SubTrigger = create(({ children }) => {
|
|
54
|
+
const titleChild = pickChildren(children, ItemTitle).targetChildren;
|
|
55
|
+
return typeof children != "string" && !(titleChild != null && titleChild.length) && console.error(
|
|
56
|
+
`Menu Invalid <SubTrigger />. It either needs a string as the children, or a <ItemTitle /> in the children. However, it got neither.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
<SubTrigger>
|
|
60
|
+
<ItemTitle>
|
|
61
|
+
Title here
|
|
62
|
+
</ItemTitle>
|
|
63
|
+
</SubTrigger>
|
|
64
|
+
`
|
|
65
|
+
), <>{children}</>;
|
|
66
|
+
}, `${MenuType}SubTrigger`), Sub = create((_) => <></>, `${MenuType}Sub`), SubContent = create((_) => <></>, `${MenuType}SubContent`), Preview = create((_) => <></>, `${MenuType}Preview`);
|
|
67
|
+
Preview.defaultProps = {
|
|
68
|
+
isResizeAnimated: !0
|
|
69
|
+
};
|
|
70
|
+
const CheckboxItem = create(({ children }) => <></>, `${MenuType}CheckboxItem`), Label = create(({ children }) => (typeof children != "string" && console.error("Menu <Label /> children must be a string."), <></>), `${MenuType}Label`), Menu = create((props) => {
|
|
71
|
+
var _a, _b, _c, _d, _e, _f;
|
|
72
|
+
const trigger = pickChildren(props.children, Trigger), content = (_a = pickChildren(
|
|
73
|
+
props.children,
|
|
74
|
+
Content,
|
|
75
|
+
COMPONENTS_TO_IGNORE
|
|
76
|
+
).targetChildren) == null ? void 0 : _a[0], callbacks = {}, getItemFromChild = (child, index) => {
|
|
77
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
78
|
+
let title;
|
|
79
|
+
const key = child.key ? `${child.key}` : `item-${index}`;
|
|
80
|
+
let subtitle;
|
|
81
|
+
const menuAttributes = [];
|
|
82
|
+
child.props.disabled && menuAttributes.push("disabled"), child.props.destructive && menuAttributes.push("destructive"), child.props.hidden && menuAttributes.push("hidden");
|
|
83
|
+
let icon;
|
|
84
|
+
if (typeof child.props.children == "string")
|
|
85
|
+
title = child.props.children;
|
|
86
|
+
else {
|
|
87
|
+
const titleChild = pickChildren(
|
|
88
|
+
child.props.children,
|
|
89
|
+
ItemTitle
|
|
90
|
+
).targetChildren, maybeTitle = child.props.textValue ?? ((_a2 = titleChild == null ? void 0 : titleChild[0]) == null ? void 0 : _a2.props.children);
|
|
91
|
+
typeof maybeTitle == "string" ? title = maybeTitle : console.error(
|
|
92
|
+
`Menu Invalid <${Menu}.Item key="${key}" /> Missing valid title. Make sure you do one of the following:
|
|
93
|
+
|
|
94
|
+
1. pass a string as the child of <${Menu}.ItemTitle />, nested directly inside of <${Menu}.Item />.
|
|
95
|
+
2. OR, use the textValue prop on <${Menu}.Item textValue="Some value" />`
|
|
96
|
+
);
|
|
97
|
+
const subtitleChild = pickChildren(
|
|
98
|
+
child.props.children,
|
|
99
|
+
ItemSubtitle
|
|
100
|
+
).targetChildren;
|
|
101
|
+
typeof ((_b2 = subtitleChild == null ? void 0 : subtitleChild[0]) == null ? void 0 : _b2.props.children) == "string" && (subtitle = subtitleChild[0].props.children);
|
|
102
|
+
const iconChildren = pickChildren(
|
|
103
|
+
child.props.children,
|
|
104
|
+
ItemIcon
|
|
105
|
+
).targetChildren;
|
|
106
|
+
if ((_c2 = iconChildren == null ? void 0 : iconChildren[0]) != null && _c2.props.iosIconName || (_d2 = iconChildren == null ? void 0 : iconChildren[0]) != null && _d2.props.ios) {
|
|
107
|
+
const iconConfiguration = (_e2 = iconChildren == null ? void 0 : iconChildren[0]) == null ? void 0 : _e2.props.ios;
|
|
108
|
+
icon = {
|
|
109
|
+
type: "IMAGE_SYSTEM",
|
|
110
|
+
imageValue: {
|
|
111
|
+
...iconConfiguration,
|
|
112
|
+
systemName: (iconConfiguration == null ? void 0 : iconConfiguration.name) ?? iconChildren[0].props.iosIconName
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
} else {
|
|
116
|
+
const imageChild = (_f2 = pickChildren(
|
|
117
|
+
child.props.children,
|
|
118
|
+
ItemImage
|
|
119
|
+
).targetChildren) == null ? void 0 : _f2[0];
|
|
120
|
+
if (imageChild && imageChild.props.source) {
|
|
121
|
+
const { source, ios: { lazy = !0, style } = {} } = imageChild.props;
|
|
122
|
+
typeof source == "object" && "uri" in source && source.uri ? icon = {
|
|
123
|
+
type: "IMAGE_REMOTE_URL",
|
|
124
|
+
imageValue: {
|
|
125
|
+
url: source.uri
|
|
126
|
+
},
|
|
127
|
+
imageLoadingConfig: {
|
|
128
|
+
shouldLazyLoad: lazy ?? !0
|
|
129
|
+
},
|
|
130
|
+
imageOptions: style
|
|
131
|
+
} : icon = {
|
|
132
|
+
type: "IMAGE_REQUIRE",
|
|
133
|
+
imageValue: Image.resolveAssetSource(imageChild.props.source)
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (title) {
|
|
139
|
+
const maybeIndexKey = typeof child.key == "string" && child.key.startsWith(".") ? child.key.substring(1) : void 0;
|
|
140
|
+
if (
|
|
141
|
+
// if the key doesn't exist as a string
|
|
142
|
+
(typeof child.key != "string" || // or if flattenChildren assigned the key as `.${key}${index}`
|
|
143
|
+
child.key.startsWith(".") && !isNaN(Number(maybeIndexKey))) && console.warn(
|
|
144
|
+
`Menu <Item /> is missing a unique key. Pass a unique key string for each item, such as: <Item key="${title.toLowerCase().replace(/ /g, "-") || `action-${index}`}" />. Falling back to index (${key}) instead, but this may have negative consequences.`
|
|
145
|
+
), "onSelect" in child.props && child.props.onSelect
|
|
146
|
+
)
|
|
147
|
+
callbacks[key] = child.props.onSelect;
|
|
148
|
+
else if ("onValueChange" in child.props) {
|
|
149
|
+
const menuState = child.props.value, currentState = menuState === !0 ? "on" : menuState === !1 ? "off" : menuState, nextState = currentState === "mixed" || currentState === "on" ? "off" : "on", { onValueChange } = child.props;
|
|
150
|
+
callbacks[key] = () => {
|
|
151
|
+
onValueChange == null || onValueChange(nextState, currentState);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
key,
|
|
156
|
+
title,
|
|
157
|
+
subtitle,
|
|
158
|
+
menuAttributes,
|
|
159
|
+
icon
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}, mapItemsChildren = (children) => Children.map(flattenChildren(children), (_child, index) => {
|
|
163
|
+
var _a2, _b2;
|
|
164
|
+
if (isInstanceOfComponent(_child, Item)) {
|
|
165
|
+
const item = getItemFromChild(_child, index);
|
|
166
|
+
if (item) {
|
|
167
|
+
const { icon, title, key, menuAttributes, subtitle } = item;
|
|
168
|
+
return {
|
|
169
|
+
actionKey: key,
|
|
170
|
+
actionTitle: title,
|
|
171
|
+
icon,
|
|
172
|
+
menuAttributes,
|
|
173
|
+
discoverabilityTitle: subtitle
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
} else if (isInstanceOfComponent(_child, CheckboxItem)) {
|
|
177
|
+
const child = _child, item = getItemFromChild(child, index);
|
|
178
|
+
if (item) {
|
|
179
|
+
const { icon, title, key, menuAttributes, subtitle } = item, menuState = child.props.value;
|
|
180
|
+
return {
|
|
181
|
+
actionKey: key,
|
|
182
|
+
actionTitle: title,
|
|
183
|
+
icon,
|
|
184
|
+
menuAttributes,
|
|
185
|
+
discoverabilityTitle: subtitle,
|
|
186
|
+
menuState: menuState === !0 ? "on" : menuState === !1 ? "off" : menuState
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
} else if (isInstanceOfComponent(_child, Sub)) {
|
|
190
|
+
const child = _child, triggerItemChild = (_a2 = pickChildren(
|
|
191
|
+
child.props.children,
|
|
192
|
+
SubTrigger
|
|
193
|
+
).targetChildren) == null ? void 0 : _a2[0], triggerItem2 = triggerItemChild && getItemFromChild(triggerItemChild, index);
|
|
194
|
+
if (triggerItem2) {
|
|
195
|
+
const nestedContent = (_b2 = pickChildren(child.props.children, SubContent, COMPONENTS_TO_IGNORE).targetChildren) == null ? void 0 : _b2[0];
|
|
196
|
+
if (nestedContent) {
|
|
197
|
+
const nestedItems = mapItemsChildren(nestedContent.props.children).filter(
|
|
198
|
+
filterNull
|
|
199
|
+
);
|
|
200
|
+
if (nestedItems.length) {
|
|
201
|
+
const menuOptions = [];
|
|
202
|
+
return new Set(triggerItem2.menuAttributes || []).has("destructive") && menuOptions.push("destructive"), {
|
|
203
|
+
menuTitle: triggerItem2 == null ? void 0 : triggerItem2.title,
|
|
204
|
+
icon: triggerItem2 == null ? void 0 : triggerItem2.icon,
|
|
205
|
+
menuItems: nestedItems,
|
|
206
|
+
menuOptions,
|
|
207
|
+
menuAttributes: triggerItem2.menuAttributes
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
} else if (isInstanceOfComponent(_child, Group))
|
|
213
|
+
return {
|
|
214
|
+
menuTitle: "",
|
|
215
|
+
menuItems: mapItemsChildren(_child.props.children).filter(filterNull),
|
|
216
|
+
menuOptions: ["displayInline"]
|
|
217
|
+
};
|
|
218
|
+
return null;
|
|
219
|
+
}), menuItems = mapItemsChildren(content == null ? void 0 : content.props.children).filter(filterNull), labelComp = (_b = pickChildren(content == null ? void 0 : content.props.children, Label).targetChildren) == null ? void 0 : _b[0];
|
|
220
|
+
let menuTitle = "";
|
|
221
|
+
typeof (labelComp == null ? void 0 : labelComp.props.children) == "string" ? menuTitle = labelComp.props.children : labelComp != null && labelComp.props.textValue && (menuTitle = labelComp.props.textValue);
|
|
222
|
+
const Component = MenuType === "ContextMenu" ? ContextMenuView : ContextMenuButton, preview = (_c = pickChildren(content == null ? void 0 : content.props.children, Preview).targetChildren) == null ? void 0 : _c[0], previewProps = preview == null ? void 0 : preview.props, onMenuDidHide = props.onOpenChange && (() => {
|
|
223
|
+
var _a2;
|
|
224
|
+
(_a2 = props.onOpenChange) == null || _a2.call(props, !1);
|
|
225
|
+
}), onMenuDidShow = props.onOpenChange && (() => {
|
|
226
|
+
var _a2;
|
|
227
|
+
(_a2 = props.onOpenChange) == null || _a2.call(props, !0);
|
|
228
|
+
}), onMenuWillShow = props.onOpenWillChange && (() => {
|
|
229
|
+
var _a2;
|
|
230
|
+
(_a2 = props.onOpenWillChange) == null || _a2.call(props, !0);
|
|
231
|
+
}), onMenuWillHide = props.onOpenWillChange && (() => {
|
|
232
|
+
var _a2;
|
|
233
|
+
(_a2 = props.onOpenWillChange) == null || _a2.call(props, !1);
|
|
234
|
+
}), triggerItem = (_d = trigger.targetChildren) == null ? void 0 : _d[0];
|
|
235
|
+
let shouldOpenOnSingleTap = MenuType === "DropdownMenu";
|
|
236
|
+
triggerItem != null && triggerItem.props.action && (shouldOpenOnSingleTap = triggerItem.props.action === "press");
|
|
237
|
+
const auxiliary = MenuType === "ContextMenu" ? (_e = pickChildren(content == null ? void 0 : content.props.children, Auxiliary)) == null ? void 0 : _e.targetChildren : void 0, auxiliaryProps = (_f = auxiliary == null ? void 0 : auxiliary[0]) == null ? void 0 : _f.props, menuRef = useRef();
|
|
238
|
+
return <NativePropProvider
|
|
239
|
+
native
|
|
240
|
+
scope={MenuType === "DropdownMenu" ? "DropdownMenuContext" : "ContextMenuContext"}
|
|
241
|
+
><Component
|
|
242
|
+
ref={menuRef}
|
|
243
|
+
onPressMenuItem={({ nativeEvent }) => {
|
|
244
|
+
callbacks[nativeEvent.actionKey] && callbacks[nativeEvent.actionKey]();
|
|
245
|
+
}}
|
|
246
|
+
isMenuPrimaryAction={shouldOpenOnSingleTap}
|
|
247
|
+
style={[{ flexGrow: 0 }, props.style]}
|
|
248
|
+
menuConfig={{
|
|
249
|
+
menuTitle,
|
|
250
|
+
menuItems
|
|
251
|
+
}}
|
|
252
|
+
renderPreview={MenuType === "ContextMenu" && preview && (previewProps != null && previewProps.children) ? () => <>{typeof (previewProps == null ? void 0 : previewProps.children) == "function" ? previewProps.children() : previewProps == null ? void 0 : previewProps.children}</> : void 0}
|
|
253
|
+
lazyPreview={MenuType === "ContextMenu" ? typeof (previewProps == null ? void 0 : previewProps.children) == "function" : void 0}
|
|
254
|
+
onPressMenuPreview={MenuType === "ContextMenu" ? previewProps == null ? void 0 : previewProps.onPress : void 0}
|
|
255
|
+
auxiliaryPreviewConfig={auxiliaryProps != null && auxiliaryProps.children ? {
|
|
256
|
+
alignmentHorizontal: auxiliaryProps == null ? void 0 : auxiliaryProps.alignmentHorizontal,
|
|
257
|
+
anchorPosition: auxiliaryProps == null ? void 0 : auxiliaryProps.anchorPosition,
|
|
258
|
+
height: auxiliaryProps == null ? void 0 : auxiliaryProps.height,
|
|
259
|
+
marginAuxiliaryPreview: auxiliaryProps == null ? void 0 : auxiliaryProps.marginWithScreenEdge,
|
|
260
|
+
marginPreview: auxiliaryProps == null ? void 0 : auxiliaryProps.marginPreview,
|
|
261
|
+
transitionConfigEntrance: auxiliaryProps == null ? void 0 : auxiliaryProps.transitionConfigEntrance,
|
|
262
|
+
transitionEntranceDelay: auxiliaryProps == null ? void 0 : auxiliaryProps.transitionEntranceDelay,
|
|
263
|
+
width: auxiliaryProps == null ? void 0 : auxiliaryProps.width
|
|
264
|
+
} : void 0}
|
|
265
|
+
isAuxiliaryPreviewEnabled={!!(auxiliaryProps != null && auxiliaryProps.children)}
|
|
266
|
+
onMenuAuxiliaryPreviewDidShow={auxiliaryProps == null ? void 0 : auxiliaryProps.onDidShow}
|
|
267
|
+
onMenuAuxiliaryPreviewWillShow={auxiliaryProps == null ? void 0 : auxiliaryProps.onWillShow}
|
|
268
|
+
renderAuxiliaryPreview={auxiliaryProps != null && auxiliaryProps.children ? () => {
|
|
269
|
+
const child = typeof (auxiliaryProps == null ? void 0 : auxiliaryProps.children) == "function" ? auxiliaryProps == null ? void 0 : auxiliaryProps.children({
|
|
270
|
+
dismissMenu() {
|
|
271
|
+
var _a2;
|
|
272
|
+
(_a2 = menuRef.current) == null || _a2.dismissMenu();
|
|
273
|
+
}
|
|
274
|
+
}) : auxiliaryProps == null ? void 0 : auxiliaryProps.children;
|
|
275
|
+
return <>{child}</>;
|
|
276
|
+
} : void 0}
|
|
277
|
+
previewConfig={preview ? {
|
|
278
|
+
// ...previewProps,
|
|
279
|
+
previewType: "CUSTOM",
|
|
280
|
+
previewSize: previewProps == null ? void 0 : previewProps.size,
|
|
281
|
+
backgroundColor: previewProps == null ? void 0 : previewProps.backgroundColor,
|
|
282
|
+
borderRadius: previewProps == null ? void 0 : previewProps.borderRadius,
|
|
283
|
+
isResizeAnimated: previewProps == null ? void 0 : previewProps.isResizeAnimated,
|
|
284
|
+
preferredCommitStyle: previewProps == null ? void 0 : previewProps.preferredCommitStyle
|
|
285
|
+
} : void 0}
|
|
286
|
+
onMenuDidHide={onMenuDidHide}
|
|
287
|
+
onMenuDidShow={onMenuDidShow}
|
|
288
|
+
onMenuWillHide={onMenuWillHide}
|
|
289
|
+
onMenuWillShow={onMenuWillShow}
|
|
290
|
+
{...props.__unsafeIosProps}
|
|
291
|
+
>{triggerItem}</Component></NativePropProvider>;
|
|
292
|
+
}, `${MenuType}`), Separator = create((_) => <></>, `${MenuType}Separator`), ItemIndicator = create(
|
|
293
|
+
(_) => <></>,
|
|
294
|
+
`${MenuType}ItemIndicator`
|
|
295
|
+
), Arrow = create((_) => <></>, `${MenuType}Arrow`);
|
|
296
|
+
return {
|
|
297
|
+
Menu: withStaticProperties(Menu, {
|
|
298
|
+
Trigger,
|
|
299
|
+
Content,
|
|
300
|
+
Item,
|
|
301
|
+
ItemTitle,
|
|
302
|
+
ItemSubtitle,
|
|
303
|
+
SubTrigger,
|
|
304
|
+
Group,
|
|
305
|
+
Separator,
|
|
306
|
+
ItemIcon,
|
|
307
|
+
ItemIndicator,
|
|
308
|
+
CheckboxItem,
|
|
309
|
+
ItemImage,
|
|
310
|
+
Label,
|
|
311
|
+
Preview,
|
|
312
|
+
Arrow,
|
|
313
|
+
Sub,
|
|
314
|
+
SubContent,
|
|
315
|
+
Auxiliary
|
|
316
|
+
})
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
export {
|
|
320
|
+
createIosMenu as createNativeMenu
|
|
321
|
+
};
|
|
322
|
+
//# sourceMappingURL=createNativeMenu.ios.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/createNativeMenu/createNativeMenu.ios.tsx"],
|
|
4
|
+
"mappings": "AAGA,SAAS,4BAA4B;AACrC,SAAgB,UAAwB,cAAc,cAAc;AACpE,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,YAAY;AAErB,SAAS,0BAA0B;AAwBnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,uBAAuB,CAAC,UAAU,OAAO,GAEzC,gBAAgB,CAAC,aAA6C;AAClE,QAAM,UAAU,OAAO,CAAC,EAAE,UAAU,SAAS,GAAG,KAAK,MAC/C,UACK,aAAa,UAAU;AAAA,IAC5B,GAAG;AAAA,EACL,CAAC,IAEI,CAAC,SAAS,OAAO,SAAS,EAAzB,OACP,GAAG,QAAQ,SAAS,GAEjB,YAAY,OAAO,CAAC,EAAE,SAAS,MAC5B,EAAE,KACR,GAAG,QAAQ,WAAW,GAEnB,QAAQ,OAAO,CAAC,EAAE,SAAS,MACxB,GAAG,SAA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