@os-design-mobile/menu 1.0.72 → 1.0.74
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Menu.js.map +1 -1
- package/dist/MenuDivider.js.map +1 -1
- package/dist/MenuGroup.js.map +1 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/Menu.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Menu.js","names":["StyledModal","styled","Modal","paddingLeft","paddingRight","Menu","forwardRef","ref","closeOnSelect","onClose","children","rest","useTheme","theme","childrenCount","useMemo","React","Children","count","menuContext","map","child","index","isValidElement","type","MenuGroup","style","paddingBottom","fontSize","borderBottomWidth","borderBottomColor","clr","menuGroupColorDivider","marginTop","modalBodyPaddingVertical","cloneElement","displayName"],"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,
|
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,wBA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I,GAAKC,kBAAS,CAC1D,MAAO,CAAAJ,KAAK,CACd,GAAI,CAAAK,KAAK,CAAG,CAAC,CAAC,CACd,GAAIJ,KAAK,CAAGf,aAAa,CAAG,CAAC,CAAE,CAC7BmB,KAAK,CAAG,CACNC,aAAa,CAAE,GAAG,CAAGrB,KAAK,CAACsB,QAAQ,CACnCC,iBAAiB,CAAE,CAAC,CACpBC,iBAAiB,CAAE,GAAAC,YAAG,EAACzB,KAAK,CAAC0B,qBAAqB,CACpD,CAAC,CACH,CACA,GAAIV,KAAK,CAAG,CAAC,CAAE,CACbI,KAAK,CAAG,CACNO,SAAS,CAAE3B,KAAK,CAAC4B,wBAAwB,CAAG5B,KAAK,CAACsB,QACpD,CAAC,CACH,CACA,MAAO,CAAAnB,cAAK,CAAC0B,YAAY,CAAMd,KAAK,CAAE,CAAEK,KAAK,CAALA,KAAM,CAAC,CAAC,CAClD,CAAC,CAAC,CACc,CAAC,EACR,CAAC,CACM,CAAC,CAE3B,CACF,CAAC,CAEDjC,IAAI,CAAC2C,WAAW,CAAG,MAAM,CAAC,IAAAC,QAAA,CAEX5C,IAAI,CAAA6C,OAAA,CAAAjE,OAAA,CAAAgE,QAAA"}
|
package/dist/MenuDivider.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuDivider.js","names":["StyledView","styled","View","p","paddingTop","theme","menuDividerIndent","fontSize","borderBottomWidth","borderBottomColor","clr","menuDividerColor","marginBottom","MenuDivider","forwardRef","props","ref","displayName"],"sources":["../src/MenuDivider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { View, ViewProps } from 'react-native';\nimport styled from '@emotion/native';\nimport { clr } from '@os-design-mobile/theming';\n\nexport type MenuDividerProps = ViewProps;\n\nconst StyledView = styled.View((p) => ({\n paddingTop: p.theme.menuDividerIndent * p.theme.fontSize,\n borderBottomWidth: 1,\n borderBottomColor: clr(p.theme.menuDividerColor),\n marginBottom: p.theme.menuDividerIndent * p.theme.fontSize,\n}));\n\n/**\n * The divider of menu items.\n */\nconst MenuDivider = forwardRef<View, MenuDividerProps>((props, ref) => (\n <StyledView {...props} ref={ref} />\n));\n\nMenuDivider.displayName = 'MenuDivider';\n\nexport default MenuDivider;\n"],"mappings":"mKAAA,
|
1
|
+
{"version":3,"file":"MenuDivider.js","names":["_react","_interopRequireWildcard","require","_native","_interopRequireDefault","_theming","_jsxRuntime","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledView","styled","View","p","paddingTop","theme","menuDividerIndent","fontSize","borderBottomWidth","borderBottomColor","clr","menuDividerColor","marginBottom","MenuDivider","forwardRef","props","ref","jsx","assign","displayName","_default","exports"],"sources":["../src/MenuDivider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { View, ViewProps } from 'react-native';\nimport styled from '@emotion/native';\nimport { clr } from '@os-design-mobile/theming';\n\nexport type MenuDividerProps = ViewProps;\n\nconst StyledView = styled.View((p) => ({\n paddingTop: p.theme.menuDividerIndent * p.theme.fontSize,\n borderBottomWidth: 1,\n borderBottomColor: clr(p.theme.menuDividerColor),\n marginBottom: p.theme.menuDividerIndent * p.theme.fontSize,\n}));\n\n/**\n * The divider of menu items.\n */\nconst MenuDivider = forwardRef<View, MenuDividerProps>((props, ref) => (\n <StyledView {...props} ref={ref} />\n));\n\nMenuDivider.displayName = 'MenuDivider';\n\nexport default MenuDivider;\n"],"mappings":"mKAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAEA,IAAAC,OAAA,CAAAC,sBAAA,CAAAF,OAAA,qBACA,IAAAG,QAAA,CAAAH,OAAA,8BAAgD,IAAAI,WAAA,CAAAJ,OAAA,+BAAAK,yBAAAC,WAAA,YAAAC,OAAA,8BAAAC,iBAAA,KAAAD,OAAA,OAAAE,gBAAA,KAAAF,OA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CAACE,KAAK,CAACM,gBAAgB,CAAC,CAChDC,YAAY,CAAET,CAAC,CAACE,KAAK,CAACC,iBAAiB,CAAGH,CAAC,CAACE,KAAK,CAACE,QACpD,CAAC,EAAC,CAAC,CAKH,GAAM,CAAAM,WAAW,CAAG,GAAAC,iBAAU,EAAyB,SAACC,KAAK,CAAEC,GAAG,QAChE,GAAAvC,WAAA,CAAAwC,GAAA,EAACjB,UAAU,CAAAT,MAAA,CAAA2B,MAAA,IAAKH,KAAK,EAAEC,GAAG,CAAEA,GAAI,EAAE,CAAC,EACpC,CAAC,CAEFH,WAAW,CAACM,WAAW,CAAG,aAAa,CAAC,IAAAC,QAAA,CAEzBP,WAAW,CAAAQ,OAAA,CAAApC,OAAA,CAAAmC,QAAA"}
|
package/dist/MenuGroup.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuGroup.js","names":["Title","styled","Text","p","fontWeight","fontSize","theme","sizes","small","color","clr","menuGroupColorTitle","marginBottom","paddingHorizontal","modalBodyPaddingHorizontal","MenuGroup","forwardRef","ref","title","multiple","maxSelectedItems","value","defaultValue","onChange","children","rest","useForwardedState","forwardedValue","setForwardedValue","safeAreaInsets","useSafeAreaInsets","onSelect","useCallback","v","includes","filter","item","length","menuItems","useMemo","React","Children","map","child","isValidElement","type","MenuItem","props","childValue","childOnPress","onPress","selected","cloneElement","key","e","left","paddingLeft","right","paddingRight","displayName"],"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>\n )}\n {menuItems}\n </View>\n );\n }\n);\n\nMenuGroup.displayName = 'MenuGroup';\n\nexport default MenuGroup;\n"],"mappings":"mdAAA,+DACA,kDACA,0FACA,qDAMA,yCACA,0EACA,4DAAkC,0oCA8ClC,GAAMA,MAAK,CAAGC,eAAM,CAACC,IAAI,CAAC,SAACC,CAAC,QAAM,CAChCC,UAAU,CAAE,KAAK,CACjBC,QAAQ,CAAEF,CAAC,CAACG,KAAK,CAACC,KAAK,CAACC,KAAK,CAAGL,CAAC,CAACG,KAAK,CAACD,QAAQ,CAChDI,KAAK,CAAE,GAAAC,YAAG,EAACP,CAAC,CAACG,KAAK,CAACK,mBAAmB,CAAC,CACvCC,YAAY,CAAE,GAAG,CAAGT,CAAC,CAACG,KAAK,CAACD,QAAQ,CACpCQ,iBAAiB,CAAEV,CAAC,CAACG,KAAK,CAACQ,0BAA0B,CAAGX,CAAC,CAACG,KAAK,CAACD,QAClE,CAAC,EAAC,CAAC,CAKH,GAAMU,UAAS,CAAG,GAAAC,iBAAU,EAC1B,cAWEC,GAAG,CACA,IAVDC,MAAK,MAALA,KAAK,oBACLC,QAAQ,CAARA,QAAQ,wBAAG,KAAK,0CAChBC,gBAAgB,CAAhBA,gBAAg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UAAU,cAAjB3B,KAAK,CAAuB4B,YAAY,cAArBC,OAAO,CAClC,GAAMC,SAAQ,CACXhC,QAAQ,EAAI,CAACQ,cAAc,EAAI,EAAE,EAAEO,QAAQ,CAACc,UAAU,CAAC,EACvD,CAAC7B,QAAQ,EAAIQ,cAAc,GAAKqB,UAAW,CAC9C,MAAOR,eAAK,CAACY,YAAY,CAAMT,KAAK,CAAE,CACpCU,GAAG,CAAEL,UAAU,CACfG,QAAQ,CAARA,QAAQ,CACRD,OAAO,CAAE,iBAACI,CAAC,CAAK,CACd,GAAI,CAACN,UAAU,CAAE,OACjBjB,QAAQ,CAACiB,UAAU,CAAC,CACpB,GAAIC,YAAY,CAAEA,YAAY,CAACK,CAAC,CAAC,CACnC,CACF,CAAC,CAAC,CACJ,CAAC,CAAC,GACJ,CAAC9B,QAAQ,CAAEG,cAAc,CAAER,QAAQ,CAAEY,QAAQ,CAAC,CAC/C,CAED,MACE,qBAAC,iBAAI,kBAAKN,IAAI,EAAE,GAAG,CAAER,GAAI,WACtBC,KAAK,EACJ,oBAAC,KAAK,EACJ,aAAa,CAAE,CAAE,CACjB,KAAK,kBACCW,cAAc,CAAC0B,IAAI,CAAG,CAAC,CACvB,CAAEC,WAAW,CAAE3B,cAAc,CAAC0B,IAAK,CAAC,CACpC,CAAC,CAAC,CACF1B,cAAc,CAAC4B,KAAK,CAAG,CAAC,CACxB,CAAEC,YAAY,CAAE7B,cAAc,CAAC4B,KAAM,CAAC,CACtC,CAAC,CAAC,CACN,UAEDvC,KAAK,EAET,CACAoB,SAAS,IACL,CAEX,CAAC,CACF,CAEDvB,SAAS,CAAC4C,WAAW,CAAG,WAAW,CAAC,aAErB5C,SAAS"}
|
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>\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,WAAA,YAAAP,wBAAAW,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,KAAAW,GAAA,cAAAH,MAAA,CAAAI,SAAA,CA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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/dist/MenuItem.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MenuItem.js","names":["selectedStyles","p","selected","backgroundColor","clr","theme","menuItemSelectedColorBg","StyledButton","styled","Button","MenuItem","forwardRef","ref","value","right","viewProps","textProps","onPress","rest","useContext","MenuContext","closeOnSelect","onClose","onPressRef","useRef","useTheme","safeAreaInsets","useSafeAreaInsets","useEffect","current","clickHandler","useCallback","e","t","buttonGhostColorText","colorText","borderRadius","buttonHeight","menuItemHeight","buttonPaddingHorizontal","menuItemPaddingHorizontal","menuItemSelectedColorIcon","style","left","paddingLeft","paddingRight","flex","textAlign","fontWeight","displayName"],"sources":["../src/MenuItem.tsx"],"sourcesContent":["import React, {\n forwardRef,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useRef,\n} from 'react';\nimport { clr, ThemeOverrider, useTheme } from '@os-design-mobile/theming';\nimport { Check } from '@os-design-mobile/icons';\nimport Button, { ButtonProps } from '@os-design-mobile/button';\nimport { RectButton } from 'react-native-gesture-handler';\nimport styled from '@emotion/native';\nimport { MenuContext } from '@os-design/menu-utils';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nexport interface MenuItemProps\n extends PropsWithChildren<Omit<ButtonProps, 'type' | 'size'>> {\n /**\n * Whether the menu item is selected.\n * @default false\n */\n selected?: boolean;\n /**\n * The value of the menu item.\n * @default undefined\n */\n value?: string;\n}\n\nconst selectedStyles = (p) =>\n p.selected\n ? {\n backgroundColor: clr(p.theme.menuItemSelectedColorBg),\n }\n : {};\n\ntype StyledButtonProps = Required<Pick<MenuItemProps, 'selected'>>;\nconst StyledButton = styled(Button)<StyledButtonProps>(selectedStyles);\n\n/**\n * The base menu item.\n */\nconst MenuItem = forwardRef<RectButton, MenuItemProps>(\n (\n {\n selected = false,\n value,\n right,\n viewProps = {},\n textProps = {},\n onPress = () => {},\n ...rest\n },\n ref\n ) => {\n const { closeOnSelect, onClose } = useContext(MenuContext);\n const onPressRef = useRef<MenuItemProps['onPress']>();\n const { theme } = useTheme();\n const safeAreaInsets = useSafeAreaInsets();\n\n useEffect(() => {\n onPressRef.current = onPress;\n }, [onPress]);\n\n const clickHandler = useCallback(\n (e) => {\n if (onPressRef.current) onPressRef.current(e);\n if (closeOnSelect) onClose();\n },\n [closeOnSelect, onClose]\n );\n\n return (\n <ThemeOverrider\n overrides={(t) => ({\n buttonGhostColorText: t.colorText,\n borderRadius: 0,\n buttonHeight: theme.menuItemHeight,\n buttonPaddingHorizontal: theme.menuItemPaddingHorizontal,\n })}\n >\n <StyledButton\n selected={selected}\n right={\n selected ? (\n <ThemeOverrider\n overrides={(t) => ({ colorText: t.menuItemSelectedColorIcon })}\n >\n <Check />\n </ThemeOverrider>\n ) : (\n right\n )\n }\n type='ghost'\n onPress={clickHandler}\n viewProps={{\n ...viewProps,\n style: {\n ...(safeAreaInsets.left > 0\n ? { paddingLeft: safeAreaInsets.left }\n : {}),\n ...(safeAreaInsets.right > 0\n ? { paddingRight: safeAreaInsets.right }\n : {}),\n ...(typeof viewProps?.style === 'object' ? viewProps.style : {}),\n },\n }}\n textProps={{\n ...textProps,\n style: {\n flex: 1,\n textAlign: 'left',\n fontWeight: 'normal',\n ...(typeof textProps?.style === 'object' ? textProps.style : {}),\n },\n }}\n {...rest}\n ref={ref}\n />\n </ThemeOverrider>\n );\n }\n);\n\nMenuItem.displayName = 'MenuItem';\n\nexport default MenuItem;\n"],"mappings":"mRAAA,
|
1
|
+
{"version":3,"file":"MenuItem.js","names":["_react","_interopRequireWildcard","require","_theming","_icons","_button","_interopRequireDefault","_native","_menuUtils","_reactNativeSafeAreaContext","_jsxRuntime","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","selectedStyles","p","selected","backgroundColor","clr","theme","menuItemSelectedColorBg","StyledButton","styled","Button","MenuItem","forwardRef","_ref","ref","_ref$selected","value","right","_ref$viewProps","viewProps","_ref$textProps","textProps","_ref$onPress","onPress","rest","_objectWithoutProperties2","_useContext","useContext","MenuContext","closeOnSelect","onClose","onPressRef","useRef","_useTheme","useTheme","safeAreaInsets","useSafeAreaInsets","useEffect","current","clickHandler","useCallback","e","jsx","ThemeOverrider","overrides","t","buttonGhostColorText","colorText","borderRadius","buttonHeight","menuItemHeight","buttonPaddingHorizontal","menuItemPaddingHorizontal","children","assign","menuItemSelectedColorIcon","Check","type","style","left","paddingLeft","paddingRight","flex","textAlign","fontWeight","displayName","_default","exports"],"sources":["../src/MenuItem.tsx"],"sourcesContent":["import React, {\n forwardRef,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useRef,\n} from 'react';\nimport { clr, ThemeOverrider, useTheme } from '@os-design-mobile/theming';\nimport { Check } from '@os-design-mobile/icons';\nimport Button, { ButtonProps } from '@os-design-mobile/button';\nimport { RectButton } from 'react-native-gesture-handler';\nimport styled from '@emotion/native';\nimport { MenuContext } from '@os-design/menu-utils';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nexport interface MenuItemProps\n extends PropsWithChildren<Omit<ButtonProps, 'type' | 'size'>> {\n /**\n * Whether the menu item is selected.\n * @default false\n */\n selected?: boolean;\n /**\n * The value of the menu item.\n * @default undefined\n */\n value?: string;\n}\n\nconst selectedStyles = (p) =>\n p.selected\n ? {\n backgroundColor: clr(p.theme.menuItemSelectedColorBg),\n }\n : {};\n\ntype StyledButtonProps = Required<Pick<MenuItemProps, 'selected'>>;\nconst StyledButton = styled(Button)<StyledButtonProps>(selectedStyles);\n\n/**\n * The base menu item.\n */\nconst MenuItem = forwardRef<RectButton, MenuItemProps>(\n (\n {\n selected = false,\n value,\n right,\n viewProps = {},\n textProps = {},\n onPress = () => {},\n ...rest\n },\n ref\n ) => {\n const { closeOnSelect, onClose } = useContext(MenuContext);\n const onPressRef = useRef<MenuItemProps['onPress']>();\n const { theme } = useTheme();\n const safeAreaInsets = useSafeAreaInsets();\n\n useEffect(() => {\n onPressRef.current = onPress;\n }, [onPress]);\n\n const clickHandler = useCallback(\n (e) => {\n if (onPressRef.current) onPressRef.current(e);\n if (closeOnSelect) onClose();\n },\n [closeOnSelect, onClose]\n );\n\n return (\n <ThemeOverrider\n overrides={(t) => ({\n buttonGhostColorText: t.colorText,\n borderRadius: 0,\n buttonHeight: theme.menuItemHeight,\n buttonPaddingHorizontal: theme.menuItemPaddingHorizontal,\n })}\n >\n <StyledButton\n selected={selected}\n right={\n selected ? (\n <ThemeOverrider\n overrides={(t) => ({ colorText: t.menuItemSelectedColorIcon })}\n >\n <Check />\n </ThemeOverrider>\n ) : (\n right\n )\n }\n type='ghost'\n onPress={clickHandler}\n viewProps={{\n ...viewProps,\n style: {\n ...(safeAreaInsets.left > 0\n ? { paddingLeft: safeAreaInsets.left }\n : {}),\n ...(safeAreaInsets.right > 0\n ? { paddingRight: safeAreaInsets.right }\n : {}),\n ...(typeof viewProps?.style === 'object' ? viewProps.style : {}),\n },\n }}\n textProps={{\n ...textProps,\n style: {\n flex: 1,\n textAlign: 'left',\n fontWeight: 'normal',\n ...(typeof textProps?.style === 'object' ? textProps.style : {}),\n },\n }}\n {...rest}\n ref={ref}\n />\n </ThemeOverrider>\n );\n }\n);\n\nMenuItem.displayName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,EAACvE,MAAA,CAAAqF,KAAK,GAAE,CAAC,CACK,CAAC,CAEjBvC,KAEH,CACDwC,IAAI,CAAC,OAAO,CACZlC,OAAO,CAAEgB,YAAa,CACtBpB,SAAS,CAAA3B,MAAA,CAAA8D,MAAA,IACJnC,SAAS,EACZuC,KAAK,CAAAlE,MAAA,CAAA8D,MAAA,IACCnB,cAAc,CAACwB,IAAI,CAAG,CAAC,CACvB,CAAEC,WAAW,CAAEzB,cAAc,CAACwB,IAAK,CAAC,CACpC,CAAC,CAAC,CACFxB,cAAc,CAAClB,KAAK,CAAG,CAAC,CACxB,CAAE4C,YAAY,CAAE1B,cAAc,CAAClB,KAAM,CAAC,CACtC,CAAC,CAAC,CACF,OAAOE,SAAS,cAATA,SAAS,CAAEuC,KAAK,IAAK,QAAQ,CAAGvC,SAAS,CAACuC,KAAK,CAAG,CAAC,CAAC,CAChE,EACD,CACFrC,SAAS,CAAA7B,MAAA,CAAA8D,MAAA,IACJjC,SAAS,EACZqC,KAAK,CAAAlE,MAAA,CAAA8D,MAAA,EACHQ,IAAI,CAAE,CAAC,CACPC,SAAS,CAAE,MAAM,CACjBC,UAAU,CAAE,QAAQ,EAChB,OAAO3C,SAAS,cAATA,SAAS,CAAEqC,KAAK,IAAK,QAAQ,CAAGrC,SAAS,CAACqC,KAAK,CAAG,CAAC,CAAC,CAChE,EACD,EACElC,IAAI,EACRV,GAAG,CAAEA,GAAI,EACV,CAAC,CACY,CAAC,CAErB,CACF,CAAC,CAEDH,QAAQ,CAACsD,WAAW,CAAG,UAAU,CAAC,IAAAC,QAAA,CAEnBvD,QAAQ,CAAAwD,OAAA,CAAAjF,OAAA,CAAAgF,QAAA"}
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export { default as Menu } from './Menu';\nexport { default as MenuDivider } from './MenuDivider';\nexport { default as MenuGroup } from './MenuGroup';\nexport { default as MenuItem } from './MenuItem';\n\nexport * from './Menu';\nexport * from './MenuDivider';\nexport * from './MenuGroup';\nexport * from './MenuItem';\n"],"mappings":"4iBAAA,
|
1
|
+
{"version":3,"file":"index.js","names":["_Menu","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_MenuDivider","_MenuGroup","_MenuItem","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["../src/index.ts"],"sourcesContent":["export { default as Menu } from './Menu';\nexport { default as MenuDivider } from './MenuDivider';\nexport { default as MenuGroup } from './MenuGroup';\nexport { default as MenuItem } from './MenuItem';\n\nexport * from './Menu';\nexport * from './MenuDivider';\nexport * from './MenuGroup';\nexport * from './MenuItem';\n"],"mappings":"4iBAAA,IAAAA,KAAA,CAAAC,uBAAA,CAAAC,OAAA,YAKAC,MAAA,CAAAC,IAAA,CAAAJ,KAAA,EAAAK,OAAA,UAAAC,GAAA,KAAAA,GAAA,cAAAA,GAAA,0BAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,CAAAJ,GAAA,YAAAA,GAAA,IAAAK,OAAA,EAAAA,OAAA,CAAAL,GAAA,IAAAN,KAAA,CAAAM,GAAA,SAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,CAAAL,GAAA,EAAAO,UAAA,MAAAC,GAAA,UAAAA,IAAA,SAAAd,KAAA,CAAAM,GAAA,SAJA,IAAAS,YAAA,CAAAd,uBAAA,CAAAC,OAAA,mBAKAC,MAAA,CAAAC,IAAA,CAAAW,YAAA,EAAAV,OAAA,UAAAC,GAAA,KAAAA,GAAA,cAAAA,GAAA,0BAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,CAAAJ,GAAA,YAAAA,GAAA,IAAAK,OAAA,EAAAA,OAAA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,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,CAAAZ,GAAA,CAAAS,GAAA,OAAAK,MAAA,QAAAC,qBAAA,CAAA1B,MAAA,CAAAS,cAAA,EAAAT,MAAA,CAAA2B,wBAAA,SAAAxB,GAAA,IAAAiB,GAAA,KAAAjB,GAAA,cAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAc,GAAA,CAAAjB,GAAA,OAAAyB,IAAA,CAAAF,qBAAA,CAAA1B,MAAA,CAAA2B,wBAAA,CAAAP,GAAA,CAAAjB,GAAA,UAAAyB,IAAA,GAAAA,IAAA,CAAAjB,GAAA,EAAAiB,IAAA,CAAAC,GAAA,GAAA7B,MAAA,CAAAS,cAAA,CAAAgB,MAAA,CAAAtB,GAAA,CAAAyB,IAAA,QAAAH,MAAA,CAAAtB,GAAA,EAAAiB,GAAA,CAAAjB,GAAA,KAAAsB,MAAA,CAAAH,OAAA,CAAAF,GAAA,IAAAG,KAAA,EAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,CAAAK,MAAA,UAAAA,MAAA"}
|
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.74",
|
4
4
|
"license": "UNLICENSED",
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design-mobile.git",
|
6
6
|
"main": "dist/index.js",
|
@@ -19,25 +19,25 @@
|
|
19
19
|
"access": "public"
|
20
20
|
},
|
21
21
|
"dependencies": {
|
22
|
-
"@os-design-mobile/button": "^1.0.
|
23
|
-
"@os-design-mobile/icons": "^1.0.
|
24
|
-
"@os-design-mobile/modal": "^1.0.
|
25
|
-
"@os-design-mobile/theming": "^1.0.
|
22
|
+
"@os-design-mobile/button": "^1.0.48",
|
23
|
+
"@os-design-mobile/icons": "^1.0.47",
|
24
|
+
"@os-design-mobile/modal": "^1.0.78",
|
25
|
+
"@os-design-mobile/theming": "^1.0.33",
|
26
26
|
"@os-design/menu-utils": "^1.0.14",
|
27
|
-
"@os-design/use-forwarded-state": "^1.0.
|
27
|
+
"@os-design/use-forwarded-state": "^1.0.13"
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
|
-
"@os-design-mobile/text": "^1.0.
|
30
|
+
"@os-design-mobile/text": "^1.0.45"
|
31
31
|
},
|
32
32
|
"peerDependencies": {
|
33
33
|
"@emotion/native": ">=11",
|
34
34
|
"@emotion/react": ">=11",
|
35
35
|
"@react-native-async-storage/async-storage": ">=1",
|
36
|
-
"react": "18.
|
37
|
-
"react-native": "0.
|
36
|
+
"react": "18.2.0",
|
37
|
+
"react-native": "0.71.7",
|
38
38
|
"react-native-gesture-handler": ">=2",
|
39
39
|
"react-native-safe-area-context": ">=3",
|
40
40
|
"react-native-svg": ">=12"
|
41
41
|
},
|
42
|
-
"gitHead": "
|
42
|
+
"gitHead": "5e40b3e42750d5636fd1a9fabe7acce564f0f973"
|
43
43
|
}
|