{"name":"rmc-tabs","version":"0.3.2","description":"React Mobile Tabs Component(web)","keywords":["react","react-component","react-m-tabs","m-tabs"],"homepage":"https://github.com/react-component/m-tabs","repository":{"type":"git","url":"git+https://github.com/react-component/m-tabs.git"},"bugs":{"url":"https://github.com/react-component/m-tabs/issues"},"files":["lib","es","assets/*.css"],"licenses":"MIT","main":"./lib/index","module":"./es/index","config":{"port":8021},"scripts":{"watch-tsc":"rc-tools run watch-tsc","compile":"rc-tools run compile --babel-runtime","build":"rc-tools run build","gh-pages":"rc-tools run gh-pages","start":"rc-tools run server","pub":"rc-tools run pub --babel-runtime","lint":"rc-tools run lint --no-js-lint","rn-start":"node node_modules/react-native/local-cli/cli.js start","test":"jest","update-snap":"jest --updateSnapshot","coverage":"jest --coverage","coverage:upload":"npm run coverage && cat ./coverage/lcov.info | coveralls"},"jest":{"testMatch":["**/__tests__/**/*.ts?(x)","**/?(*.)(spec|test).ts?(x)"],"coverageDirectory":"./coverage/","moduleFileExtensions":["ts","tsx","js"],"collectCoverageFrom":["src/**/*"],"transform":{"\\.tsx?$":"./node_modules/rc-tools/scripts/jestPreprocessor.js","\\.jsx?$":"./node_modules/rc-tools/scripts/jestPreprocessor.js"}},"dependencies":{"babel-runtime":"6.x","rc-gesture":"^0.0.15"},"devDependencies":{"@types/jest":"^20.0.7","@types/react-sticky":"5.0.4","jest":"^20.0.4","enzyme":"^2.9.1","enzyme-to-json":"^1.5.1","coveralls":"^2.13.1","@types/react":"^15.0.27","@types/react-dom":"^15.5.0","pre-commit":"1.x","rc-test":"6.x","rc-tools":"6.x","react":"15.5.x","react-dom":"15.5.x","react-sticky":"5.x","react-test-renderer":"^15.5.0","stylelint-config-standard":"^17.0.0"},"typings":"./lib/index.d.ts","pre-commit":["lint"],"gitHead":"ffa520fd6b8d77925bd116e90b6d9c24462e785b","_id":"rmc-tabs@0.3.2","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"zhang740","email":"zhang740@vmzclub.com"},"dist":{"integrity":"sha512-o26rq9w1YwyWwwHHXhG2/eHb9iWWOZ1gD81YpVEu2T0pArHnpVTxwAtBLU0Z3EL1+WfL3ObTzHJuJ+1qvSPu9w==","shasum":"9f3e7d661f0c209a4523f33a5d96466ec0d24678","tarball":"http://registry-npm.ywwl.com/rmc-tabs/download/rmc-tabs-0.3.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAS5WJqjLnEuNLZJnH3tqNXazXOVhEvkSdhOAsxhNPvEAiBDNpDkgTAKa73xwRohzA/XYSUoDXmI/f5Bz0zaX8Aghw=="}],"size":14441,"noattachment":false,"key":"/rmc-tabs/-/rmc-tabs-0.3.2.tgz"},"maintainers":[{"name":"zhang740","email":"zhang740@vmzclub.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rmc-tabs-0.3.2.tgz_1504264627602_0.3889782188925892"},"directories":{},"readme":"# rmc-tabs\n---\n\nReact Mobile Tabs Component (web & react-native), inspired by [react-native-scrollable-tab-view](https://github.com/skv-headless/react-native-scrollable-tab-view)\n\n[![NPM version][npm-image]][npm-url]\n![react](https://img.shields.io/badge/react-%3E%3D_15.2.0-green.svg)\n[![build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![gemnasium deps][gemnasium-image]][gemnasium-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: http://img.shields.io/npm/v/rmc-tabs.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rmc-tabs\n[travis-image]: https://img.shields.io/travis/react-component/m-tabs.svg?style=flat-square\n[travis-url]: https://travis-ci.org/react-component/m-tabs\n[coveralls-image]: https://img.shields.io/coveralls/react-component/m-tabs.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/react-component/m-tabs?branch=master\n[gemnasium-image]: http://img.shields.io/gemnasium/react-component/m-tabs.svg?style=flat-square\n[gemnasium-url]: https://gemnasium.com/react-component/m-tabs\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/rmc-tabs.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rmc-tabs\n\n## Screenshots\n\n## Development\n\n```\nnpm i\nnpm start\n```\n\n## Example\n\nhttp://localhost:8000/examples/\n\nonline example: http://react-component.github.io/m-tabs/\n\n\n## install\n\n[![rmc-tabs](https://nodei.co/npm/rmc-tabs.png)](https://npmjs.org/package/rmc-tabs)\n\n\n# docs\n\n## Usage\n```jsx\n// normal\n<Tabs tabs={[\n    { key: 't1', title: 't1' },\n    { key: 't2', title: 't2' },\n    { key: 't3', title: 't3' },\n    { key: 't4', title: 't4' },\n    { key: 't5', title: 't5' },\n]} initalPage={'t2'}\n>\n  <div key=\"t1\"><p>content1</p></div>\n  <div key=\"t2\"><p>content2</p></div>\n  <div key=\"t3\"><p>content3</p></div>\n  <div key=\"t4\"><p>content4</p></div>\n  <div key=\"t5\"><p>content5</p></div>\n</Tabs>\n\n// single content\n<Tabs tabs={[\n    { title: 't1' },\n    { title: 't2' },\n    { title: 't3' },\n    { title: 't4' },\n    { title: 't5' },\n]} onChange={(tab, index) => {\n    this.setState({\n        scData: JSON.stringify({ index: index + Math.random(), tab })\n    });\n}}\n>\n    <div>\n        <p>single content</p>\n        <p>{this.state.scData}</p>\n    </div>\n</Tabs>\n\n// single content function\n<Tabs tabs={[\n    { title: 't1' },\n    { title: 't2' },\n    { title: 't3' },\n    { title: 't4' },\n    { title: 't5' },\n]}\n>\n    {\n        (index, tab) =>\n            <div>\n                <p>single content</p>\n                <p>{JSON.stringify({ index: index + Math.random(), tab })}</p>\n            </div>\n    }\n</Tabs>\n\n// renderTabBar e.g: Sticky, react-sticky\n./examples/sticky.tsx\n```\n\n## react-native\n\n```\nnpm run rn-init\nnpm run watch-tsc\nreact-native start\nreact-native run-ios\n```\n\n## API\n\n### Tabs:\n属性 | 说明 | 类型 | 默认值 | 必选\n----|-----|------|------|------\ntabs | tabs data | Models.TabData[] |  | true\ntabBarPosition | TabBar's position | 'top' \\| 'bottom' \\| 'left' \\| 'right' |  top | false\nrenderTabBar | render for TabBar | ((props: TabBarPropsType) => React.ReactNode) \\| false |  | false\ninitialPage | initial Tab, index or key | number \\| string |  | false\npage | current tab, index or key | number \\| string |  | false\nswipeable | whether to switch tabs with swipe gestrue in the content | boolean |  true | false\nuseOnPan (`web only`) | use scroll follow pan | boolean |  true | false\nprerenderingSiblingsNumber | pre-render nearby # sibling, Infinity: render all the siblings, 0: render current page | number |  1 | false\nanimated | whether to change tabs with animation | boolean |  true | false\nonChange | callback when tab is switched | (tab: Models.TabData, index: number) => void |  | false\nonTabClick | on tab click | (tab: Models.TabData, index: number) => void |  | false\ndestroyInactiveTab | destroy inactive tab | boolean |  false | false\ndistanceToChangeTab | distance to change tab, width ratio | number |  0.3 | false\nusePaged | use paged | boolean |  true | false\ntabDirection | tab paging direction | 'horizontal' \\| 'vertical' |  horizontal | false\ntabBarUnderlineStyle | tabBar underline style | React.CSSProperties \\| any |  | false\ntabBarBackgroundColor | tabBar background color | string |  | false\ntabBarActiveTextColor | tabBar active text color | string |  | false\ntabBarInactiveTextColor | tabBar inactive text color | string |  | false\ntabBarTextStyle | tabBar text style | React.CSSProperties \\| any |  | false\n\n### TabBarPropsType (Common):\n属性 | 说明 | 类型 | 默认值 | 必选\n----|-----|------|------|------\ngoToTab | call this function to switch tab | (index: number) => void |  | true\ntabs | tabs data | Models.TabData[] |  | true\nactiveTab | current active tab | number |  | true\nanimated | use animate | boolean |  true | true\nrenderTab | render the tab of tabbar | (tab: Models.TabData) => React.ReactNode |  | false\npage | page size of tabbar's tab | number |  5 | false\nonTabClick | on tab click | (tab: Models.TabData, index: number) => void |  | false\ntabBarPosition | tabBar's position defualt: top | 'top' \\| 'bottom' \\| 'left' \\| 'right' |  | false\ntabBarUnderlineStyle | tabBar underline style | React.CSSProperties \\| any |  | false\ntabBarBackgroundColor | tabBar background color | string |  | false\ntabBarActiveTextColor | tabBar active text color | string |  | false\ntabBarInactiveTextColor | tabBar inactive text color | string |  | false\ntabBarTextStyle | tabBar text style | React.CSSProperties \\| any |  | false\n\n## Test Case\n\n```\nnpm test\nnpm run chrome-test\n```\n\n## Coverage\n\n```\nnpm run coverage\n```\n\nopen coverage/ dir\n\n## License\n\nrmc-tabs is released under the MIT license.\n","publish_time":1504264628616,"_cnpm_publish_time":1504264628616,"dist-tags":{"beta":"1.2.17-alpha.3","latest":"1.2.29"}}