@os-design-mobile/menu 1.0.99 → 1.0.101

Sign up to get free protection for your applications and to get access to all the features.
package/dist/Menu.js CHANGED
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _modal=_interopRequireDefault(require("@os-design-mobile/modal"));var _menuUtils=require("@os-design/menu-utils");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _native=_interopRequireDefault(require("@emotion/native"));var _theming=require("@os-design-mobile/theming");var _MenuGroup=_interopRequireDefault(require("./MenuGroup.js"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["closeOnSelect","onClose","children"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var StyledModal=(0,_native.default)(_modal.default)({paddingLeft:0,paddingRight:0});var Menu=(0,_react.forwardRef)(function(_ref,ref){var _ref$closeOnSelect=_ref.closeOnSelect,closeOnSelect=_ref$closeOnSelect===void 0?true:_ref$closeOnSelect,_ref$onClose=_ref.onClose,onClose=_ref$onClose===void 0?function(){}:_ref$onClose,children=_ref.children,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useTheme=(0,_theming.useTheme)(),theme=_useTheme.theme;var childrenCount=(0,_react.useMemo)(function(){return _react.default.Children.count(children);},[children]);var menuContext=(0,_react.useMemo)(function(){return{closeOnSelect:closeOnSelect,onClose:onClose};},[closeOnSelect,onClose]);return(0,_jsxRuntime.jsx)(_menuUtils.MenuContext.Provider,{value:menuContext,children:(0,_jsxRuntime.jsx)(StyledModal,Object.assign({footer:null,onClose:onClose},rest,{ref:ref,children:(0,_jsxRuntime.jsx)(_reactNativeSafeAreaContext.SafeAreaProvider,{children:_react.default.Children.map(children,function(child,index){if(!_react.default.isValidElement(child)||child.type!==_MenuGroup.default)return child;var style={};if(index<childrenCount-1){style={paddingBottom:0.4*theme.fontSize,borderBottomWidth:1,borderBottomColor:(0,_theming.clr)(theme.menuGroupColorDivider)};}if(index>0){style={marginTop:theme.modalBodyPaddingVertical*theme.fontSize};}return _react.default.cloneElement(child,{style:style});})})}))});});Menu.displayName='Menu';var _default=exports.default=Menu;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _modal=_interopRequireDefault(require("@os-design-mobile/modal"));var _menuUtils=require("@os-design/menu-utils");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _native=_interopRequireDefault(require("@emotion/native"));var _theming=require("@os-design-mobile/theming");var _MenuGroup=_interopRequireDefault(require("./MenuGroup"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["closeOnSelect","onClose","children"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var StyledModal=(0,_native.default)(_modal.default)({paddingLeft:0,paddingRight:0});var Menu=(0,_react.forwardRef)(function(_ref,ref){var _ref$closeOnSelect=_ref.closeOnSelect,closeOnSelect=_ref$closeOnSelect===void 0?true:_ref$closeOnSelect,_ref$onClose=_ref.onClose,onClose=_ref$onClose===void 0?function(){}:_ref$onClose,children=_ref.children,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useTheme=(0,_theming.useTheme)(),theme=_useTheme.theme;var childrenCount=(0,_react.useMemo)(function(){return _react.default.Children.count(children);},[children]);var menuContext=(0,_react.useMemo)(function(){return{closeOnSelect:closeOnSelect,onClose:onClose};},[closeOnSelect,onClose]);return(0,_jsxRuntime.jsx)(_menuUtils.MenuContext.Provider,{value:menuContext,children:(0,_jsxRuntime.jsx)(StyledModal,Object.assign({footer:null,onClose:onClose},rest,{ref:ref,children:(0,_jsxRuntime.jsx)(_reactNativeSafeAreaContext.SafeAreaProvider,{children:_react.default.Children.map(children,function(child,index){if(!_react.default.isValidElement(child)||child.type!==_MenuGroup.default)return child;var style={};if(index<childrenCount-1){style={paddingBottom:0.4*theme.fontSize,borderBottomWidth:1,borderBottomColor:(0,_theming.clr)(theme.menuGroupColorDivider)};}if(index>0){style={marginTop:theme.modalBodyPaddingVertical*theme.fontSize};}return _react.default.cloneElement(child,{style:style});})})}))});});Menu.displayName='Menu';var _default=exports.default=Menu;
2
2
  //# sourceMappingURL=Menu.js.map
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","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","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, type PropsWithChildren, useMemo } from 'react';\nimport { View } from 'react-native';\nimport Modal, { type 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.js';\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,oBAAuC,IAAAQ,WAAA,CAAAR,OAAA,0BAAAS,SAAA,iDAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAZ,wBAAAY,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,MAAAQ,CAAA,EAAAC,SAAA,OAAAC,CAAA,CAAAC,MAAA,CAAAC,cAAA,EAAAD,MAAA,CAAAE,wBAAA,SAAAC,CAAA,IAAAd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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,CAAAC,OAAA,CAAAhE,OAAA,CAEXmB,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Menu.js","names":["_react","_interopRequireWildcard","require","_modal","_interopRequireDefault","_menuUtils","_reactNativeSafeAreaContext","_native","_theming","_MenuGroup","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","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, type PropsWithChildren, useMemo } from 'react';\nimport { View } from 'react-native';\nimport Modal, { type 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,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAZ,wBAAAY,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,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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,CAEA,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,CAAAC,OAAA,CAAAhE,OAAA,CAEXmB,IAAI","ignoreList":[]}
package/dist/MenuGroup.js CHANGED
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _native=_interopRequireDefault(require("@emotion/native"));var _theming=require("@os-design-mobile/theming");var _useForwardedState3=_interopRequireDefault(require("@os-design/use-forwarded-state"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _MenuItem=_interopRequireDefault(require("./MenuItem.js"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["title","multiple","maxSelectedItems","value","defaultValue","onChange","children"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Title=_native.default.Text(function(p){return{fontWeight:'500',fontSize:p.theme.sizes.small*p.theme.fontSize,color:(0,_theming.clr)(p.theme.menuGroupColorTitle),marginBottom:0.4*p.theme.fontSize,paddingHorizontal:p.theme.modalBodyPaddingHorizontal*p.theme.fontSize};});var MenuGroup=(0,_react.forwardRef)(function(_ref,ref){var title=_ref.title,_ref$multiple=_ref.multiple,multiple=_ref$multiple===void 0?false:_ref$multiple,_ref$maxSelectedItems=_ref.maxSelectedItems,maxSelectedItems=_ref$maxSelectedItems===void 0?0:_ref$maxSelectedItems,value=_ref.value,defaultValue=_ref.defaultValue,_ref$onChange=_ref.onChange,onChange=_ref$onChange===void 0?function(){}:_ref$onChange,children=_ref.children,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useForwardedState=(0,_useForwardedState3.default)({value:value,defaultValue:defaultValue,onChange:onChange}),_useForwardedState2=(0,_slicedToArray2.default)(_useForwardedState,2),forwardedValue=_useForwardedState2[0],setForwardedValue=_useForwardedState2[1];var safeAreaInsets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var onSelect=(0,_react.useCallback)(function(v){if(multiple){if((forwardedValue||[]).includes(v)){setForwardedValue((forwardedValue||[]).filter(function(item){return item!==v;}));return;}if(maxSelectedItems===0||(forwardedValue||[]).length<maxSelectedItems){setForwardedValue([].concat((0,_toConsumableArray2.default)(forwardedValue||[]),[v]));return;}return;}setForwardedValue(v);},[forwardedValue,maxSelectedItems,multiple,setForwardedValue]);var menuItems=(0,_react.useMemo)(function(){return _react.default.Children.map(children,function(child){if(!_react.default.isValidElement(child)||child.type!==_MenuItem.default)return child;var _child$props=child.props,childValue=_child$props.value,childOnPress=_child$props.onPress;var selected=multiple&&(forwardedValue||[]).includes(childValue)||!multiple&&forwardedValue===childValue;return _react.default.cloneElement(child,{key:childValue,selected:selected,onPress:function onPress(e){if(!childValue)return;onSelect(childValue);if(childOnPress)childOnPress(e);}});});},[children,forwardedValue,multiple,onSelect]);return(0,_jsxRuntime.jsxs)(_reactNative.View,Object.assign({},rest,{ref:ref,children:[title&&(0,_jsxRuntime.jsx)(Title,{numberOfLines:1,style:Object.assign({},safeAreaInsets.left>0?{paddingLeft:safeAreaInsets.left}:{},safeAreaInsets.right>0?{paddingRight:safeAreaInsets.right}:{}),children:title}),menuItems]}));});MenuGroup.displayName='MenuGroup';var _default=exports.default=MenuGroup;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _native=_interopRequireDefault(require("@emotion/native"));var _theming=require("@os-design-mobile/theming");var _useForwardedState3=_interopRequireDefault(require("@os-design/use-forwarded-state"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _MenuItem=_interopRequireDefault(require("./MenuItem"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["title","multiple","maxSelectedItems","value","defaultValue","onChange","children"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Title=_native.default.Text(function(p){return{fontWeight:'500',fontSize:p.theme.sizes.small*p.theme.fontSize,color:(0,_theming.clr)(p.theme.menuGroupColorTitle),marginBottom:0.4*p.theme.fontSize,paddingHorizontal:p.theme.modalBodyPaddingHorizontal*p.theme.fontSize};});var MenuGroup=(0,_react.forwardRef)(function(_ref,ref){var title=_ref.title,_ref$multiple=_ref.multiple,multiple=_ref$multiple===void 0?false:_ref$multiple,_ref$maxSelectedItems=_ref.maxSelectedItems,maxSelectedItems=_ref$maxSelectedItems===void 0?0:_ref$maxSelectedItems,value=_ref.value,defaultValue=_ref.defaultValue,_ref$onChange=_ref.onChange,onChange=_ref$onChange===void 0?function(){}:_ref$onChange,children=_ref.children,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useForwardedState=(0,_useForwardedState3.default)({value:value,defaultValue:defaultValue,onChange:onChange}),_useForwardedState2=(0,_slicedToArray2.default)(_useForwardedState,2),forwardedValue=_useForwardedState2[0],setForwardedValue=_useForwardedState2[1];var safeAreaInsets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var onSelect=(0,_react.useCallback)(function(v){if(multiple){if((forwardedValue||[]).includes(v)){setForwardedValue((forwardedValue||[]).filter(function(item){return item!==v;}));return;}if(maxSelectedItems===0||(forwardedValue||[]).length<maxSelectedItems){setForwardedValue([].concat((0,_toConsumableArray2.default)(forwardedValue||[]),[v]));return;}return;}setForwardedValue(v);},[forwardedValue,maxSelectedItems,multiple,setForwardedValue]);var menuItems=(0,_react.useMemo)(function(){return _react.default.Children.map(children,function(child){if(!_react.default.isValidElement(child)||child.type!==_MenuItem.default)return child;var _child$props=child.props,childValue=_child$props.value,childOnPress=_child$props.onPress;var selected=multiple&&(forwardedValue||[]).includes(childValue)||!multiple&&forwardedValue===childValue;return _react.default.cloneElement(child,{key:childValue,selected:selected,onPress:function onPress(e){if(!childValue)return;onSelect(childValue);if(childOnPress)childOnPress(e);}});});},[children,forwardedValue,multiple,onSelect]);return(0,_jsxRuntime.jsxs)(_reactNative.View,Object.assign({},rest,{ref:ref,children:[title&&(0,_jsxRuntime.jsx)(Title,{numberOfLines:1,style:Object.assign({},safeAreaInsets.left>0?{paddingLeft:safeAreaInsets.left}:{},safeAreaInsets.right>0?{paddingRight:safeAreaInsets.right}:{}),children:title}),menuItems]}));});MenuGroup.displayName='MenuGroup';var _default=exports.default=MenuGroup;
2
2
  //# sourceMappingURL=MenuGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuGroup.js","names":["_native","_interopRequireDefault","require","_theming","_useForwardedState3","_react","_interopRequireWildcard","_reactNative","_reactNativeSafeAreaContext","_MenuItem","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","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","key","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 type PropsWithChildren,\n useCallback,\n useMemo,\n} from 'react';\nimport { View, type ViewProps } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport MenuItem from './MenuItem.js';\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,2BA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AAU,CAAC,EACvD,CAACtC,QAAQ,EAAIc,cAAc,GAAKwB,UAAW,CAE9C,MAAO,CAAAT,cAAK,CAACa,YAAY,CAAMV,KAAK,CAAE,CACpCW,GAAG,CAAEL,UAAU,CACfG,QAAQ,CAARA,QAAQ,CACRD,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAGhF,CAAC,CAAK,CACd,GAAI,CAAC8E,UAAU,CAAE,OACjBpB,QAAQ,CAACoB,UAAU,CAAC,CACpB,GAAIC,YAAY,CAAEA,YAAY,CAAC/E,CAAC,CAAC,CACnC,CACF,CAAC,CAAC,CACJ,CAAC,CAAC,GACJ,CAAC+C,QAAQ,CAAEO,cAAc,CAAEd,QAAQ,CAAEkB,QAAQ,CAC/C,CAAC,CAED,MACE,GAAA7D,WAAA,CAAAuF,IAAA,EAAC1F,YAAA,CAAA2F,IAAI,CAAA1E,MAAA,CAAA2E,MAAA,IAAKtC,IAAI,EAAEX,GAAG,CAAEA,GAAI,CAAAU,QAAA,EACtBT,KAAK,EACJ,GAAAzC,WAAA,CAAA0F,GAAA,EAACpE,KAAK,EACJqE,aAAa,CAAE,CAAE,CACjBC,KAAK,CAAA9E,MAAA,CAAA2E,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,CAAAC,OAAA,CAAA3F,OAAA,CAErB6B,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"MenuGroup.js","names":["_native","_interopRequireDefault","require","_theming","_useForwardedState3","_react","_interopRequireWildcard","_reactNative","_reactNativeSafeAreaContext","_MenuItem","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","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","key","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 type PropsWithChildren,\n useCallback,\n useMemo,\n} from 'react';\nimport { View, type 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,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAP,wBAAAO,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,MAAAQ,CAAA,EAAAC,SAAA,OAAAC,CAAA,CAAAC,MAAA,CAAA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GAAA,EAACpE,KAAK,EACJqE,aAAa,CAAE,CAAE,CACjBC,KAAK,CAAA9E,MAAA,CAAA2E,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,CAAAC,OAAA,CAAA3F,OAAA,CAErB6B,SAAS","ignoreList":[]}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={Menu:true,MenuDivider:true,MenuGroup:true,MenuItem:true};Object.defineProperty(exports,"Menu",{enumerable:true,get:function get(){return _Menu.default;}});Object.defineProperty(exports,"MenuDivider",{enumerable:true,get:function get(){return _MenuDivider.default;}});Object.defineProperty(exports,"MenuGroup",{enumerable:true,get:function get(){return _MenuGroup.default;}});Object.defineProperty(exports,"MenuItem",{enumerable:true,get:function get(){return _MenuItem.default;}});var _Menu=_interopRequireWildcard(require("./Menu.js"));Object.keys(_Menu).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_Menu[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _Menu[key];}});});var _MenuDivider=_interopRequireWildcard(require("./MenuDivider.js"));Object.keys(_MenuDivider).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_MenuDivider[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _MenuDivider[key];}});});var _MenuGroup=_interopRequireWildcard(require("./MenuGroup.js"));Object.keys(_MenuGroup).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_MenuGroup[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _MenuGroup[key];}});});var _MenuItem=_interopRequireWildcard(require("./MenuItem.js"));Object.keys(_MenuItem).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_MenuItem[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _MenuItem[key];}});});function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}
1
+ Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={Menu:true,MenuDivider:true,MenuGroup:true,MenuItem:true};Object.defineProperty(exports,"Menu",{enumerable:true,get:function get(){return _Menu.default;}});Object.defineProperty(exports,"MenuDivider",{enumerable:true,get:function get(){return _MenuDivider.default;}});Object.defineProperty(exports,"MenuGroup",{enumerable:true,get:function get(){return _MenuGroup.default;}});Object.defineProperty(exports,"MenuItem",{enumerable:true,get:function get(){return _MenuItem.default;}});var _Menu=_interopRequireWildcard(require("./Menu"));Object.keys(_Menu).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_Menu[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _Menu[key];}});});var _MenuDivider=_interopRequireWildcard(require("./MenuDivider"));Object.keys(_MenuDivider).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_MenuDivider[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _MenuDivider[key];}});});var _MenuGroup=_interopRequireWildcard(require("./MenuGroup"));Object.keys(_MenuGroup).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_MenuGroup[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _MenuGroup[key];}});});var _MenuItem=_interopRequireWildcard(require("./MenuItem"));Object.keys(_MenuItem).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_MenuItem[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _MenuItem[key];}});});function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sources":["../src/index.ts"],"sourcesContent":["export { default as Menu } from './Menu.js';\nexport { default as MenuDivider } from './MenuDivider.js';\nexport { default as MenuGroup } from './MenuGroup.js';\nexport { default as MenuItem } from './MenuItem.js';\n\nexport * from './Menu.js';\nexport * from './MenuDivider.js';\nexport * from './MenuGroup.js';\nexport * from './MenuItem.js';\n"],"mappings":"4iBAAA,IAAAA,KAAA,CAAAC,uBAAA,CAAAC,OAAA,eAKAC,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,sBAKAC,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,CAAAL,GAAA,IAAAS,YAAA,CAAAT,GAAA,SAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,CAAAL,GAAA,EAAAO,UAAA,MAAAC,GAAA,UAAAA,IAAA,SAAAC,YAAA,CAAAT,GAAA,SAJA,IAAAU,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,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAR,GAAA,CAAAK,CAAA,MAAAO,CAAA,EAAAC,SAAA,OAAAC,CAAA,CAAAzB,MAAA,CAAAS,cAAA,EAAAT,MAAA,CAAA0B,wBAAA,SAAAC,CAAA,IAAAX,CAAA,gBAAAW,CAAA,KAAAtB,cAAA,CAAAC,IAAA,CAAAU,CAAA,CAAAW,CAAA,OAAAC,CAAA,CAAAH,CAAA,CAAAzB,MAAA,CAAA0B,wBAAA,CAAAV,CAAA,CAAAW,CAAA,OAAAC,CAAA,GAAAA,CAAA,CAAAjB,GAAA,EAAAiB,CAAA,CAAAC,GAAA,EAAA7B,MAAA,CAAAS,cAAA,CAAAc,CAAA,CAAAI,CAAA,CAAAC,CAAA,EAAAL,CAAA,CAAAI,CAAA,EAAAX,CAAA,CAAAW,CAAA,UAAAJ,CAAA,CAAAF,OAAA,CAAAL,CAAA,CAAAG,CAAA,EAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,CAAAO,CAAA,EAAAA,CAAA","ignoreList":[]}
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","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","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,c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AAAL,CAAA,CAAAI,CAAA,EAAAX,CAAA,CAAAW,CAAA,UAAAJ,CAAA,CAAAF,OAAA,CAAAL,CAAA,CAAAG,CAAA,EAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,CAAAO,CAAA,EAAAA,CAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@os-design-mobile/menu",
3
- "version": "1.0.99",
3
+ "version": "1.0.101",
4
4
  "license": "UNLICENSED",
5
5
  "repository": "git@gitlab.com:os-team/libs/os-design-mobile.git",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "scripts": {
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
- "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist",
23
+ "build:types": "tsc --noCheck --emitDeclarationOnly --declaration --declarationDir dist",
24
24
  "build": "yarn clean && npm-run-all 'build:*'",
25
25
  "ncu": "ncu -u '/^(?!(react|react-native)$).*$/'"
26
26
  },
@@ -28,15 +28,15 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@os-design-mobile/button": "^1.0.67",
32
- "@os-design-mobile/icons": "^1.0.63",
33
- "@os-design-mobile/modal": "^1.0.103",
34
- "@os-design-mobile/theming": "^1.0.45",
35
- "@os-design/menu-utils": "^1.0.24",
36
- "@os-design/use-forwarded-state": "^1.0.26"
31
+ "@os-design-mobile/button": "^1.0.69",
32
+ "@os-design-mobile/icons": "^1.0.65",
33
+ "@os-design-mobile/modal": "^1.0.105",
34
+ "@os-design-mobile/theming": "^1.0.47",
35
+ "@os-design/menu-utils": "^1.0.25",
36
+ "@os-design/use-forwarded-state": "^1.0.27"
37
37
  },
38
38
  "devDependencies": {
39
- "@os-design-mobile/text": "^1.0.61"
39
+ "@os-design-mobile/text": "^1.0.63"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@emotion/native": ">=11",
@@ -48,5 +48,5 @@
48
48
  "react-native-safe-area-context": ">=3",
49
49
  "react-native-svg": ">=12"
50
50
  },
51
- "gitHead": "907868cd4979c2d1a6a2affa2d14b8434f8f06d9"
51
+ "gitHead": "3fc1de944cb4da0b0225dbfb471641f65ab1a320"
52
52
  }
package/src/Menu.tsx CHANGED
@@ -5,7 +5,7 @@ import { MenuContext } from '@os-design/menu-utils';
5
5
  import { SafeAreaProvider } from 'react-native-safe-area-context';
6
6
  import styled from '@emotion/native';
7
7
  import { clr, useTheme } from '@os-design-mobile/theming';
8
- import MenuGroup from './MenuGroup.js';
8
+ import MenuGroup from './MenuGroup';
9
9
 
10
10
  export interface MenuProps extends PropsWithChildren<ModalProps> {
11
11
  /**
package/src/MenuGroup.tsx CHANGED
@@ -9,7 +9,7 @@ import React, {
9
9
  } from 'react';
10
10
  import { View, type ViewProps } from 'react-native';
11
11
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
12
- import MenuItem from './MenuItem.js';
12
+ import MenuItem from './MenuItem';
13
13
 
14
14
  interface BaseMenuGroupProps<T> extends PropsWithChildren<ViewProps> {
15
15
  /**
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { default as Menu } from './Menu.js';
2
- export { default as MenuDivider } from './MenuDivider.js';
3
- export { default as MenuGroup } from './MenuGroup.js';
4
- export { default as MenuItem } from './MenuItem.js';
1
+ export { default as Menu } from './Menu';
2
+ export { default as MenuDivider } from './MenuDivider';
3
+ export { default as MenuGroup } from './MenuGroup';
4
+ export { default as MenuItem } from './MenuItem';
5
5
 
6
- export * from './Menu.js';
7
- export * from './MenuDivider.js';
8
- export * from './MenuGroup.js';
9
- export * from './MenuItem.js';
6
+ export * from './Menu';
7
+ export * from './MenuDivider';
8
+ export * from './MenuGroup';
9
+ export * from './MenuItem';
package/dist/Menu.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- import { View } from 'react-native';
3
- import { type ModalProps } from '@os-design-mobile/modal';
4
- export interface MenuProps extends PropsWithChildren<ModalProps> {
5
- /**
6
- * Whether the menu closes when the user selects a menu item.
7
- * @default true
8
- */
9
- closeOnSelect?: boolean;
10
- }
11
- /**
12
- * The dropdown menu.
13
- */
14
- declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<View>>;
15
- export default Menu;
16
- //# sourceMappingURL=Menu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../src/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAOjE,MAAM,WAAW,SAAU,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAC9D;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAOD;;GAEG;AACH,QAAA,MAAM,IAAI,wEAwCT,CAAC;AAIF,eAAe,IAAI,CAAC"}
@@ -1,8 +0,0 @@
1
- import { View, type ViewProps } from 'react-native';
2
- export type MenuDividerProps = ViewProps;
3
- /**
4
- * The divider of menu items.
5
- */
6
- declare const MenuDivider: import("react").ForwardRefExoticComponent<ViewProps & import("react").RefAttributes<View>>;
7
- export default MenuDivider;
8
- //# sourceMappingURL=MenuDivider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuDivider.d.ts","sourceRoot":"","sources":["../src/MenuDivider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC;AASzC;;GAEG;AACH,QAAA,MAAM,WAAW,4FAEf,CAAC;AAIH,eAAe,WAAW,CAAC"}
@@ -1,51 +0,0 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- import { View, type ViewProps } from 'react-native';
3
- interface BaseMenuGroupProps<T> extends PropsWithChildren<ViewProps> {
4
- /**
5
- * The title of the menu group.
6
- * @default undefined
7
- */
8
- title?: string;
9
- /**
10
- * The max number of options that the user can select. Zero means unlimited.
11
- * Works only when multiple is true.
12
- * @default 0
13
- */
14
- maxSelectedItems?: number;
15
- /**
16
- * Selected menu items.
17
- * @default undefined
18
- */
19
- value?: T;
20
- /**
21
- * The default value.
22
- * @default undefined
23
- */
24
- defaultValue?: T;
25
- /**
26
- * The change event handler.
27
- * @default undefined
28
- */
29
- onChange?: (value: T) => void;
30
- }
31
- interface MenuGroupNotMultipleProps extends BaseMenuGroupProps<string | null> {
32
- /**
33
- * Is it possible to select multiple values.
34
- * @default false
35
- */
36
- multiple?: false;
37
- }
38
- interface MenuGroupMultipleProps extends BaseMenuGroupProps<string[]> {
39
- /**
40
- * Is it possible to select multiple values.
41
- * @default false
42
- */
43
- multiple: true;
44
- }
45
- export type MenuGroupProps = MenuGroupNotMultipleProps | MenuGroupMultipleProps;
46
- /**
47
- * The group of menu items.
48
- */
49
- declare const MenuGroup: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<View>>;
50
- export default MenuGroup;
51
- //# sourceMappingURL=MenuGroup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuGroup.d.ts","sourceRoot":"","sources":["../src/MenuGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAEZ,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,UAAU,kBAAkB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IAClE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,CAAC;IACV;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B;AACD,UAAU,yBAA0B,SAAQ,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC;IAC3E;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AACD,UAAU,sBAAuB,SAAQ,kBAAkB,CAAC,MAAM,EAAE,CAAC;IACnE;;;OAGG;IACH,QAAQ,EAAE,IAAI,CAAC;CAChB;AACD,MAAM,MAAM,cAAc,GAAG,yBAAyB,GAAG,sBAAsB,CAAC;AAUhF;;GAEG;AACH,QAAA,MAAM,SAAS,6EA4Fd,CAAC;AAIF,eAAe,SAAS,CAAC"}
@@ -1,20 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
- import { type ButtonProps } from '@os-design-mobile/button';
3
- export interface MenuItemProps extends PropsWithChildren<Omit<ButtonProps, 'type' | 'size'>> {
4
- /**
5
- * Whether the menu item is selected.
6
- * @default false
7
- */
8
- selected?: boolean;
9
- /**
10
- * The value of the menu item.
11
- * @default undefined
12
- */
13
- value?: string;
14
- }
15
- /**
16
- * The base menu item.
17
- */
18
- declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<import("react").ForwardRefExoticComponent<Omit<import("react-native-gesture-handler").RectButtonProps, "innerRef"> & import("react").RefAttributes<any>>>>;
19
- export default MenuItem;
20
- //# sourceMappingURL=MenuItem.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../src/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAKvB,MAAM,OAAO,CAAC;AAGf,OAAe,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMpE,MAAM,WAAW,aACf,SAAQ,iBAAiB,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC7D;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD;;GAEG;AACH,QAAA,MAAM,QAAQ,oPAiFb,CAAC;AAIF,eAAe,QAAQ,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export { default as Menu } from './Menu.js';
2
- export { default as MenuDivider } from './MenuDivider.js';
3
- export { default as MenuGroup } from './MenuGroup.js';
4
- export { default as MenuItem } from './MenuItem.js';
5
- export * from './Menu.js';
6
- export * from './MenuDivider.js';
7
- export * from './MenuGroup.js';
8
- export * from './MenuItem.js';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}