@os-design-mobile/menu 1.0.81 → 1.0.83
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js.map +1 -1
- package/dist/MenuGroup.d.ts.map +1 -1
- package/dist/MenuGroup.js.map +1 -1
- package/package.json +11 -11
- package/src/Menu.tsx +1 -0
- package/src/MenuGroup.tsx +1 -0
package/dist/Menu.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../src/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAW,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAO5D,MAAM,WAAW,SAAU,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAK9D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAUD,QAAA,MAAM,IAAI,
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../src/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAW,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAO5D,MAAM,WAAW,SAAU,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAK9D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAUD,QAAA,MAAM,IAAI,wEAwCT,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
package/dist/Menu.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Menu.js","names":["_react","_interopRequireWildcard","require","_modal","_interopRequireDefault","_menuUtils","_reactNativeSafeAreaContext","_native","_theming","_MenuGroup","_jsxRuntime","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledModal","styled","Modal","paddingLeft","paddingRight","Menu","forwardRef","_ref","ref","_ref$closeOnSelect","closeOnSelect","_ref$onClose","onClose","children","rest","_objectWithoutProperties2","_useTheme","useTheme","theme","childrenCount","useMemo","React","Children","count","menuContext","jsx","MenuContext","Provider","value","assign","footer","SafeAreaProvider","map","child","index","isValidElement","type","MenuGroup","style","paddingBottom","fontSize","borderBottomWidth","borderBottomColor","clr","menuGroupColorDivider","marginTop","modalBodyPaddingVertical","cloneElement","displayName","_default","exports"],"sources":["../src/Menu.tsx"],"sourcesContent":["import React, { forwardRef, PropsWithChildren, useMemo } from 'react';\nimport { View } from 'react-native';\nimport Modal, { ModalProps } from '@os-design-mobile/modal';\nimport { MenuContext } from '@os-design/menu-utils';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\nimport styled from '@emotion/native';\nimport { clr, useTheme } from '@os-design-mobile/theming';\nimport MenuGroup from './MenuGroup';\n\nexport interface MenuProps extends PropsWithChildren<ModalProps> {\n /**\n * Whether the menu closes when the user selects a menu item.\n * @default true\n */\n closeOnSelect?: boolean;\n}\n\nconst StyledModal = styled(Modal)({\n paddingLeft: 0,\n paddingRight: 0,\n});\n\n/**\n * The dropdown menu.\n */\nconst Menu = forwardRef<View, MenuProps>(\n ({ closeOnSelect = true, onClose = () => {}, children, ...rest }, ref) => {\n const { theme } = useTheme();\n const childrenCount = useMemo(\n () => React.Children.count(children),\n [children]\n );\n const menuContext = useMemo(\n () => ({ closeOnSelect, onClose }),\n [closeOnSelect, onClose]\n );\n\n return (\n <MenuContext.Provider value={menuContext}>\n <StyledModal footer={null} onClose={onClose} {...rest} ref={ref}>\n <SafeAreaProvider>\n {React.Children.map(children, (child, index) => {\n if (!React.isValidElement(child) || child.type !== MenuGroup)\n return child;\n let style = {};\n if (index < childrenCount - 1) {\n style = {\n paddingBottom: 0.4 * theme.fontSize,\n borderBottomWidth: 1,\n borderBottomColor: clr(theme.menuGroupColorDivider),\n };\n }\n if (index > 0) {\n style = {\n marginTop: theme.modalBodyPaddingVertical * theme.fontSize,\n };\n }\n return React.cloneElement<any>(child, { style });\n })}\n </SafeAreaProvider>\n </StyledModal>\n </MenuContext.Provider>\n );\n }\n);\n\nMenu.displayName = 'Menu';\n\nexport default Menu;\n"],"mappings":"mRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAEA,IAAAC,MAAA,CAAAC,sBAAA,CAAAF,OAAA,6BACA,IAAAG,UAAA,CAAAH,OAAA,0BACA,IAAAI,2BAAA,CAAAJ,OAAA,mCACA,IAAAK,OAAA,CAAAH,sBAAA,CAAAF,OAAA,qBACA,IAAAM,QAAA,CAAAN,OAAA,8BACA,IAAAO,UAAA,CAAAL,sBAAA,CAAAF,OAAA,iBAAoC,IAAAQ,WAAA,CAAAR,OAAA,0BAAAS,SAAA,iDAAAC,yBAAAC,WAAA,YAAAC,OAAA,8BAAAC,iBAAA,KAAAD,OAAA,OAAAE,gBAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,WAAA,SAAAA,WAAA,CAAAG,gBAAA,CAAAD,iBAAA,IAAAF,WAAA,YAAAZ,wBAAAgB,GAAA,CAAAJ,WAAA,MAAAA,WAAA,EAAAI,GAAA,EAAAA,GAAA,CAAAC,UAAA,SAAAD,GAAA,KAAAA,GAAA,gBAAAA,GAAA,oBAAAA,GAAA,sBAAAE,OAAA,CAAAF,GAAA,OAAAG,KAAA,CAAAR,wBAAA,CAAAC,WAAA,KAAAO,KAAA,EAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,UAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,OAAAM,MAAA,QAAAC,qBAAA,CAAAC,MAAA,CAAAC,cAAA,EAAAD,MAAA,CAAAE,wBAAA,SAAAC,GAAA,IAAAX,GAAA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opRequireWildcard","require","_modal","_interopRequireDefault","_menuUtils","_reactNativeSafeAreaContext","_native","_theming","_MenuGroup","_jsxRuntime","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledModal","styled","Modal","paddingLeft","paddingRight","Menu","forwardRef","_ref","ref","_ref$closeOnSelect","closeOnSelect","_ref$onClose","onClose","children","rest","_objectWithoutProperties2","_useTheme","useTheme","theme","childrenCount","useMemo","React","Children","count","menuContext","jsx","MenuContext","Provider","value","assign","footer","SafeAreaProvider","map","child","index","isValidElement","type","MenuGroup","style","paddingBottom","fontSize","borderBottomWidth","borderBottomColor","clr","menuGroupColorDivider","marginTop","modalBodyPaddingVertical","cloneElement","displayName","_default","exports"],"sources":["../src/Menu.tsx"],"sourcesContent":["import React, { forwardRef, PropsWithChildren, useMemo } from 'react';\nimport { View } from 'react-native';\nimport Modal, { ModalProps } from '@os-design-mobile/modal';\nimport { MenuContext } from '@os-design/menu-utils';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\nimport styled from '@emotion/native';\nimport { clr, useTheme } from '@os-design-mobile/theming';\nimport MenuGroup from './MenuGroup';\n\nexport interface MenuProps extends PropsWithChildren<ModalProps> {\n /**\n * Whether the menu closes when the user selects a menu item.\n * @default true\n */\n closeOnSelect?: boolean;\n}\n\nconst StyledModal = styled(Modal)({\n paddingLeft: 0,\n paddingRight: 0,\n});\n\n/**\n * The dropdown menu.\n */\nconst Menu = forwardRef<View, MenuProps>(\n ({ closeOnSelect = true, onClose = () => {}, children, ...rest }, ref) => {\n const { theme } = useTheme();\n const childrenCount = useMemo(\n () => React.Children.count(children),\n [children]\n );\n const menuContext = useMemo(\n () => ({ closeOnSelect, onClose }),\n [closeOnSelect, onClose]\n );\n\n return (\n <MenuContext.Provider value={menuContext}>\n <StyledModal footer={null} onClose={onClose} {...rest} ref={ref}>\n <SafeAreaProvider>\n {React.Children.map(children, (child, index) => {\n if (!React.isValidElement(child) || child.type !== MenuGroup)\n return child;\n let style = {};\n if (index < childrenCount - 1) {\n style = {\n paddingBottom: 0.4 * theme.fontSize,\n borderBottomWidth: 1,\n borderBottomColor: clr(theme.menuGroupColorDivider),\n };\n }\n if (index > 0) {\n style = {\n marginTop: theme.modalBodyPaddingVertical * theme.fontSize,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return React.cloneElement<any>(child, { style });\n })}\n </SafeAreaProvider>\n </StyledModal>\n </MenuContext.Provider>\n );\n }\n);\n\nMenu.displayName = 'Menu';\n\nexport default Menu;\n"],"mappings":"mRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAEA,IAAAC,MAAA,CAAAC,sBAAA,CAAAF,OAAA,6BACA,IAAAG,UAAA,CAAAH,OAAA,0BACA,IAAAI,2BAAA,CAAAJ,OAAA,mCACA,IAAAK,OAAA,CAAAH,sBAAA,CAAAF,OAAA,qBACA,IAAAM,QAAA,CAAAN,OAAA,8BACA,IAAAO,UAAA,CAAAL,sBAAA,CAAAF,OAAA,iBAAoC,IAAAQ,WAAA,CAAAR,OAAA,0BAAAS,SAAA,iDAAAC,yBAAAC,WAAA,YAAAC,OAAA,8BAAAC,iBAAA,KAAAD,OAAA,OAAAE,gBAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,WAAA,SAAAA,WAAA,CAAAG,gBAAA,CAAAD,iBAAA,IAAAF,WAAA,YAAAZ,wBAAAgB,GAAA,CAAAJ,WAAA,MAAAA,WAAA,EAAAI,GAAA,EAAAA,GAAA,CAAAC,UAAA,SAAAD,GAAA,KAAAA,GAAA,gBAAAA,GAAA,oBAAAA,GAAA,sBAAAE,OAAA,CAAAF,GAAA,OAAAG,KAAA,CAAAR,wBAAA,CAAAC,WAAA,KAAAO,KAAA,EAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA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SAAS,
|
1
|
+
{"version":3,"file":"MenuGroup.d.ts","sourceRoot":"","sources":["../src/MenuGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAEZ,iBAAiB,EAGlB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,kBAAkB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IAKlE,KAAK,CAAC,EAAE,MAAM,CAAC;IAMf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAK1B,KAAK,CAAC,EAAE,CAAC,CAAC;IAKV,YAAY,CAAC,EAAE,CAAC,CAAC;IAKjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B;AACD,UAAU,yBAA0B,SAAQ,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC;IAK3E,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AACD,UAAU,sBAAuB,SAAQ,kBAAkB,CAAC,MAAM,EAAE,CAAC;IAKnE,QAAQ,EAAE,IAAI,CAAC;CAChB;AACD,MAAM,MAAM,cAAc,GAAG,yBAAyB,GAAG,sBAAsB,CAAC;AAahF,QAAA,MAAM,SAAS,6EA4Fd,CAAC;AAIF,eAAe,SAAS,CAAC"}
|
package/dist/MenuGroup.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuGroup.js","names":["_native","_interopRequireDefault","require","_theming","_useForwardedState3","_react","_interopRequireWildcard","_reactNative","_reactNativeSafeAreaContext","_MenuItem","_jsxRuntime","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Title","styled","Text","p","fontWeight","fontSize","theme","sizes","small","color","clr","menuGroupColorTitle","marginBottom","paddingHorizontal","modalBodyPaddingHorizontal","MenuGroup","forwardRef","_ref","ref","title","_ref$multiple","multiple","_ref$maxSelectedItems","maxSelectedItems","value","defaultValue","_ref$onChange","onChange","children","rest","_objectWithoutProperties2","_useForwardedState","useForwardedState","_useForwardedState2","_slicedToArray2","forwardedValue","setForwardedValue","safeAreaInsets","useSafeAreaInsets","onSelect","useCallback","v","includes","filter","item","length","concat","_toConsumableArray2","menuItems","useMemo","React","Children","map","child","isValidElement","type","MenuItem","_child$props","props","childValue","childOnPress","onPress","selected","cloneElement","e","jsxs","View","assign","jsx","numberOfLines","style","left","paddingLeft","right","paddingRight","displayName","_default","exports"],"sources":["../src/MenuGroup.tsx"],"sourcesContent":["import styled from '@emotion/native';\nimport { clr } from '@os-design-mobile/theming';\nimport useForwardedState from '@os-design/use-forwarded-state';\nimport React, {\n forwardRef,\n PropsWithChildren,\n useCallback,\n useMemo,\n} from 'react';\nimport { View, ViewProps } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport MenuItem from './MenuItem';\n\ninterface BaseMenuGroupProps<T> extends PropsWithChildren<ViewProps> {\n /**\n * The title of the menu group.\n * @default undefined\n */\n title?: string;\n /**\n * The max number of options that the user can select. Zero means unlimited.\n * Works only when multiple is true.\n * @default 0\n */\n maxSelectedItems?: number;\n /**\n * Selected menu items.\n * @default undefined\n */\n value?: T;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: T;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: T) => void;\n}\ninterface MenuGroupNotMultipleProps extends BaseMenuGroupProps<string | null> {\n /**\n * Is it possible to select multiple values.\n * @default false\n */\n multiple?: false;\n}\ninterface MenuGroupMultipleProps extends BaseMenuGroupProps<string[]> {\n /**\n * Is it possible to select multiple values.\n * @default false\n */\n multiple: true;\n}\nexport type MenuGroupProps = MenuGroupNotMultipleProps | MenuGroupMultipleProps;\n\nconst Title = styled.Text((p) => ({\n fontWeight: '500',\n fontSize: p.theme.sizes.small * p.theme.fontSize,\n color: clr(p.theme.menuGroupColorTitle),\n marginBottom: 0.4 * p.theme.fontSize,\n paddingHorizontal: p.theme.modalBodyPaddingHorizontal * p.theme.fontSize,\n}));\n\n/**\n * The group of menu items.\n */\nconst MenuGroup = forwardRef<View, MenuGroupProps>(\n (\n {\n title,\n multiple = false,\n maxSelectedItems = 0,\n value,\n defaultValue,\n onChange = () => {},\n children,\n ...rest\n },\n ref\n ) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [forwardedValue, setForwardedValue] = useForwardedState<any>({\n value,\n defaultValue,\n onChange,\n });\n const safeAreaInsets = useSafeAreaInsets();\n\n const onSelect = useCallback(\n (v: string) => {\n if (multiple) {\n // Delete the value because it was already selected\n if ((forwardedValue || []).includes(v)) {\n setForwardedValue(\n (forwardedValue || []).filter((item) => item !== v)\n );\n return;\n }\n\n // Add a new value if the number of selected items is less than max\n if (\n maxSelectedItems === 0 ||\n (forwardedValue || []).length < maxSelectedItems\n ) {\n setForwardedValue([...(forwardedValue || []), v]);\n return;\n }\n return;\n }\n setForwardedValue(v);\n },\n [forwardedValue, maxSelectedItems, multiple, setForwardedValue]\n );\n\n const menuItems = useMemo(\n () =>\n React.Children.map(children, (child) => {\n if (!React.isValidElement(child) || child.type !== MenuItem)\n return child;\n const { value: childValue, onPress: childOnPress } = child.props;\n const selected =\n (multiple && (forwardedValue || []).includes(childValue)) ||\n (!multiple && forwardedValue === childValue);\n return React.cloneElement<any>(child, {\n key: childValue,\n selected,\n onPress: (e) => {\n if (!childValue) return;\n onSelect(childValue);\n if (childOnPress) childOnPress(e);\n },\n });\n }),\n [children, forwardedValue, multiple, onSelect]\n );\n\n return (\n <View {...rest} ref={ref}>\n {title && (\n <Title\n numberOfLines={1}\n style={{\n ...(safeAreaInsets.left > 0\n ? { paddingLeft: safeAreaInsets.left }\n : {}),\n ...(safeAreaInsets.right > 0\n ? { paddingRight: safeAreaInsets.right }\n : {}),\n }}\n >\n {title}\n </Title>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cAAc,CAACoC,KAAM,CAAC,CACtC,CAAC,CAAC,CACN,CAAA7C,QAAA,CAEDT,KAAK,CACD,CACR,CACA6B,SAAS,GACN,CAAC,CAEX,CACF,CAAC,CAEDjC,SAAS,CAAC4D,WAAW,CAAG,WAAW,CAAC,IAAAC,QAAA,CAErB7D,SAAS,CAAA8D,OAAA,CAAA5F,OAAA,CAAA2F,QAAA"}
|
1
|
+
{"version":3,"file":"MenuGroup.js","names":["_native","_interopRequireDefault","require","_theming","_useForwardedState3","_react","_interopRequireWildcard","_reactNative","_reactNativeSafeAreaContext","_MenuItem","_jsxRuntime","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Title","styled","Text","p","fontWeight","fontSize","theme","sizes","small","color","clr","menuGroupColorTitle","marginBottom","paddingHorizontal","modalBodyPaddingHorizontal","MenuGroup","forwardRef","_ref","ref","title","_ref$multiple","multiple","_ref$maxSelectedItems","maxSelectedItems","value","defaultValue","_ref$onChange","onChange","children","rest","_objectWithoutProperties2","_useForwardedState","useForwardedState","_useForwardedState2","_slicedToArray2","forwardedValue","setForwardedValue","safeAreaInsets","useSafeAreaInsets","onSelect","useCallback","v","includes","filter","item","length","concat","_toConsumableArray2","menuItems","useMemo","React","Children","map","child","isValidElement","type","MenuItem","_child$props","props","childValue","childOnPress","onPress","selected","cloneElement","e","jsxs","View","assign","jsx","numberOfLines","style","left","paddingLeft","right","paddingRight","displayName","_default","exports"],"sources":["../src/MenuGroup.tsx"],"sourcesContent":["import styled from '@emotion/native';\nimport { clr } from '@os-design-mobile/theming';\nimport useForwardedState from '@os-design/use-forwarded-state';\nimport React, {\n forwardRef,\n PropsWithChildren,\n useCallback,\n useMemo,\n} from 'react';\nimport { View, ViewProps } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport MenuItem from './MenuItem';\n\ninterface BaseMenuGroupProps<T> extends PropsWithChildren<ViewProps> {\n /**\n * The title of the menu group.\n * @default undefined\n */\n title?: string;\n /**\n * The max number of options that the user can select. Zero means unlimited.\n * Works only when multiple is true.\n * @default 0\n */\n maxSelectedItems?: number;\n /**\n * Selected menu items.\n * @default undefined\n */\n value?: T;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: T;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: T) => void;\n}\ninterface MenuGroupNotMultipleProps extends BaseMenuGroupProps<string | null> {\n /**\n * Is it possible to select multiple values.\n * @default false\n */\n multiple?: false;\n}\ninterface MenuGroupMultipleProps extends BaseMenuGroupProps<string[]> {\n /**\n * Is it possible to select multiple values.\n * @default false\n */\n multiple: true;\n}\nexport type MenuGroupProps = MenuGroupNotMultipleProps | MenuGroupMultipleProps;\n\nconst Title = styled.Text((p) => ({\n fontWeight: '500',\n fontSize: p.theme.sizes.small * p.theme.fontSize,\n color: clr(p.theme.menuGroupColorTitle),\n marginBottom: 0.4 * p.theme.fontSize,\n paddingHorizontal: p.theme.modalBodyPaddingHorizontal * p.theme.fontSize,\n}));\n\n/**\n * The group of menu items.\n */\nconst MenuGroup = forwardRef<View, MenuGroupProps>(\n (\n {\n title,\n multiple = false,\n maxSelectedItems = 0,\n value,\n defaultValue,\n onChange = () => {},\n children,\n ...rest\n },\n ref\n ) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [forwardedValue, setForwardedValue] = useForwardedState<any>({\n value,\n defaultValue,\n onChange,\n });\n const safeAreaInsets = useSafeAreaInsets();\n\n const onSelect = useCallback(\n (v: string) => {\n if (multiple) {\n // Delete the value because it was already selected\n if ((forwardedValue || []).includes(v)) {\n setForwardedValue(\n (forwardedValue || []).filter((item) => item !== v)\n );\n return;\n }\n\n // Add a new value if the number of selected items is less than max\n if (\n maxSelectedItems === 0 ||\n (forwardedValue || []).length < maxSelectedItems\n ) {\n setForwardedValue([...(forwardedValue || []), v]);\n return;\n }\n return;\n }\n setForwardedValue(v);\n },\n [forwardedValue, maxSelectedItems, multiple, setForwardedValue]\n );\n\n const menuItems = useMemo(\n () =>\n React.Children.map(children, (child) => {\n if (!React.isValidElement(child) || child.type !== MenuItem)\n return child;\n const { value: childValue, onPress: childOnPress } = child.props;\n const selected =\n (multiple && (forwardedValue || []).includes(childValue)) ||\n (!multiple && forwardedValue === childValue);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return React.cloneElement<any>(child, {\n key: childValue,\n selected,\n onPress: (e) => {\n if (!childValue) return;\n onSelect(childValue);\n if (childOnPress) childOnPress(e);\n },\n });\n }),\n [children, forwardedValue, multiple, onSelect]\n );\n\n return (\n <View {...rest} ref={ref}>\n {title && (\n <Title\n numberOfLines={1}\n style={{\n ...(safeAreaInsets.left > 0\n ? { paddingLeft: safeAreaInsets.left }\n : {}),\n ...(safeAreaInsets.right > 0\n ? { paddingRight: safeAreaInsets.right }\n : {}),\n }}\n >\n {title}\n </Title>\n )}\n {menuItems}\n </View>\n );\n }\n);\n\nMenuGroup.displayName = 'MenuGroup';\n\nexport default MenuGroup;\n"],"mappings":"mdAAA,IAAAA,OAAA,CAAAC,sBAAA,CAAAC,OAAA,qBACA,IAAAC,QAAA,CAAAD,OAAA,8BACA,IAAAE,mBAAA,CAAAH,sBAAA,CAAAC,OAAA,oCACA,IAAAG,MAAA,CAAAC,uBAAA,CAAAJ,OAAA,WAMA,IAAAK,YAAA,CAAAL,OAAA,iBACA,IAAAM,2BAAA,CAAAN,OAAA,mCACA,IAAAO,SAAA,CAAAR,sBAAA,CAAAC,OAAA,gBAAkC,IAAAQ,WAAA,CAAAR,OAAA,0BAAAS,SAAA,+FAAAC,yBAAAC,WAAA,YAAAC,OAAA,8BAAAC,iBAAA,KAAAD,OAAA,OAAAE,gBAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,WAAA,SAAAA,WAAA,CAAAG,gBAAA,CAAAD,iBAAA,IAAAF,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C,CACpB,GAAIC,YAAY,CAAEA,YAAY,CAACI,CAAC,CAAC,CACnC,CACF,CAAC,CAAC,CACJ,CAAC,CAAC,GACJ,CAACpC,QAAQ,CAAEO,cAAc,CAAEd,QAAQ,CAAEkB,QAAQ,CAC/C,CAAC,CAED,MACE,GAAA/D,WAAA,CAAAyF,IAAA,EAAC5F,YAAA,CAAA6F,IAAI,CAAA3E,MAAA,CAAA4E,MAAA,IAAKtC,IAAI,EAAEX,GAAG,CAAEA,GAAI,CAAAU,QAAA,EACtBT,KAAK,EACJ,GAAA3C,WAAA,CAAA4F,GAAA,EAACpE,KAAK,EACJqE,aAAa,CAAE,CAAE,CACjBC,KAAK,CAAA/E,MAAA,CAAA4E,MAAA,IACC9B,cAAc,CAACkC,IAAI,CAAG,CAAC,CACvB,CAAEC,WAAW,CAAEnC,cAAc,CAACkC,IAAK,CAAC,CACpC,CAAC,CAAC,CACFlC,cAAc,CAACoC,KAAK,CAAG,CAAC,CACxB,CAAEC,YAAY,CAAErC,cAAc,CAACoC,KAAM,CAAC,CACtC,CAAC,CAAC,CACN,CAAA7C,QAAA,CAEDT,KAAK,CACD,CACR,CACA6B,SAAS,GACN,CAAC,CAEX,CACF,CAAC,CAEDjC,SAAS,CAAC4D,WAAW,CAAG,WAAW,CAAC,IAAAC,QAAA,CAErB7D,SAAS,CAAA8D,OAAA,CAAA5F,OAAA,CAAA2F,QAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@os-design-mobile/menu",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.83",
|
4
4
|
"license": "UNLICENSED",
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design-mobile.git",
|
6
6
|
"main": "dist/index.js",
|
@@ -21,32 +21,32 @@
|
|
21
21
|
"clean": "rimraf dist",
|
22
22
|
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx --out-dir dist --source-maps",
|
23
23
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist",
|
24
|
-
"build": "yarn clean && npm-run-all build:*",
|
24
|
+
"build": "yarn clean && npm-run-all 'build:*'",
|
25
25
|
"ncu": "ncu -u '/^(?!(react|react-native)$).*$/'"
|
26
26
|
},
|
27
27
|
"publishConfig": {
|
28
28
|
"access": "public"
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
|
-
"@os-design-mobile/button": "^1.0.
|
32
|
-
"@os-design-mobile/icons": "^1.0.
|
33
|
-
"@os-design-mobile/modal": "^1.0.
|
34
|
-
"@os-design-mobile/theming": "^1.0.
|
35
|
-
"@os-design/menu-utils": "^1.0.
|
36
|
-
"@os-design/use-forwarded-state": "^1.0.
|
31
|
+
"@os-design-mobile/button": "^1.0.55",
|
32
|
+
"@os-design-mobile/icons": "^1.0.53",
|
33
|
+
"@os-design-mobile/modal": "^1.0.87",
|
34
|
+
"@os-design-mobile/theming": "^1.0.39",
|
35
|
+
"@os-design/menu-utils": "^1.0.20",
|
36
|
+
"@os-design/use-forwarded-state": "^1.0.20"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@os-design-mobile/text": "^1.0.
|
39
|
+
"@os-design-mobile/text": "^1.0.51"
|
40
40
|
},
|
41
41
|
"peerDependencies": {
|
42
42
|
"@emotion/native": ">=11",
|
43
43
|
"@emotion/react": ">=11",
|
44
44
|
"@react-native-async-storage/async-storage": ">=1",
|
45
45
|
"react": "18.2.0",
|
46
|
-
"react-native": "0.72.
|
46
|
+
"react-native": "0.72.3",
|
47
47
|
"react-native-gesture-handler": ">=2",
|
48
48
|
"react-native-safe-area-context": ">=3",
|
49
49
|
"react-native-svg": ">=12"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "a3ada9e54c48761193af9ed7e6f95def64a9def8"
|
52
52
|
}
|
package/src/Menu.tsx
CHANGED
@@ -55,6 +55,7 @@ const Menu = forwardRef<View, MenuProps>(
|
|
55
55
|
marginTop: theme.modalBodyPaddingVertical * theme.fontSize,
|
56
56
|
};
|
57
57
|
}
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
58
59
|
return React.cloneElement<any>(child, { style });
|
59
60
|
})}
|
60
61
|
</SafeAreaProvider>
|
package/src/MenuGroup.tsx
CHANGED
@@ -123,6 +123,7 @@ const MenuGroup = forwardRef<View, MenuGroupProps>(
|
|
123
123
|
const selected =
|
124
124
|
(multiple && (forwardedValue || []).includes(childValue)) ||
|
125
125
|
(!multiple && forwardedValue === childValue);
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
126
127
|
return React.cloneElement<any>(child, {
|
127
128
|
key: childValue,
|
128
129
|
selected,
|