{"name":"rc-image","version":"3.0.5","keywords":["react","react-component","react-image","image"],"license":"MIT","_id":"rc-image@3.0.5","maintainers":[{"name":"dahong","email":"darryshaw@gmail.com"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"zombiej","email":"smith3816@gmail.com"}],"homepage":"http://github.com/react-component/image","bugs":{"url":"http://github.com/react-component/image/issues"},"dist":{"shasum":"43eee9868382976c542a322b070e8dbb0a254f21","tarball":"http://registry-npm.ywwl.com/rc-image/download/rc-image-3.0.5.tgz","fileCount":24,"integrity":"sha512-XQnw4Xv9qcfSQhJwqQEWoUTSvHGkmXzGQG/0yIADJ2EHk5A0ckCzA/ywHG31ILt1cwoDsIbaOUzAaZ9RhO/UXA==","signatures":[{"sig":"MEUCIQCCjxccYmkHMrX11zC2hga8qFOJJUleC4SBIBpNZD6AJgIgAcPgnuYlq4m9mp5vybu8fQrqQmkvQWAwwuIrq9HplW4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVZmACRA9TVsSAnZWagAA/fsP/2EivJPRu2INyzJDxZY8\nMOs7+VO5OWtt/G5MAjOE4/zUQ2cjDYynLTN4fjkrdhnqnKBrlxWdI5T111kZ\n1/kFXrr/zpgKiRH9/qWeAaZHmIvchsilznhAYbtAlxg67HA3jqqaXdQGwrHP\no6cizOel/rJ4SzlZk9lWGo4yvjKaY+l5sy9Belb5atEk3Z8fJUILG8i5BW6G\nTQSNVu7x1FTEuvUG+inD9dxOmDA9d/2WHuy0UO9oCADdnqnXrjfndZO8a5qX\nsNQjLwd+eSfLTrYTesyZlXw5UMxxxlRiXDAmBxYRDWngWWk4tqlG6Ez+mdCX\n9rY41/MZqIIDdIevXH3C9ybe1QUD7NO9dXX8rPD38ersCRlMgTJjuDtEYWsK\nwN2hCaHZ/+m2u2ajmDvDp8y5zB4hy/ajUF4LjXfINAZa7Ro06k0IoyoPS6xa\nfRLkPyJDHeF1la6TBtB8JFG6jAMEjtIOg7rSca3X0tPDAQlqN6GHf3Lwtfzw\niVV0qe6MnwtfwOZeMWgkzjD/o7/xTyCt01wogItWvtkHLiCW6wxrdwVw17Cb\nyoJ/UjFQKVdfYsr4EU6RksFrLk1xVGaYDqzNBubiVtgaWgP0u7JbvhBQxyEO\ndQEfxP1tq890xIo4R5hP2jy9OMAlJG29lwevkNaBbpZTf2zq8mC7nUlYfoEt\naeXG\r\n=ojA9\r\n-----END PGP SIGNATURE-----\r\n","size":10518,"noattachment":false,"key":"/rc-image/-/rc-image-3.0.5.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","gitHead":"905076b6e56cfd2e93bf82e53b5f236abfa63b2d","scripts":{"lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"father test","build":"father doc build --storybook","start":"cross-env NODE_ENV=development father doc dev --storybook","compile":"father build && lessc assets/index.less assets/index.css","coverage":"father test --coverage","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","prepublishOnly":"npm run compile && np --yolo --no-publish"},"_npmUser":{"name":"dahong","email":"darryshaw@gmail.com"},"repository":{"url":"git+ssh://git@github.com/react-component/image.git","type":"git"},"_npmVersion":"6.13.4","description":"React easy to use image component","directories":{},"_nodeVersion":"12.16.1","dependencies":{"rc-util":"^5.0.6","rc-dialog":"^8.3.2","classnames":"^2.2.6","@babel/runtime":"^7.11.2","@ant-design/icons":"^4.2.2"},"_hasShrinkwrap":false,"devDependencies":{"np":"^6.3.2","less":"^3.12.2","react":"^16.13.1","enzyme":"^3.11.0","eslint":"^7.6.0","father":"^2.29.6","cross-env":"^7.0.2","react-dom":"^16.13.1","typescript":"^4.0.2","@types/jest":"^26.0.9","@types/react":"^16.9.44","@types/enzyme":"^3.10.5","@umijs/fabric":"^2.2.2","enzyme-to-json":"^3.5.0","@types/react-dom":"^16.9.8","@types/classnames":"^2.2.10","enzyme-adapter-react-16":"^1.15.2"},"peerDependencies":{"react":"^16.8.0","react-dom":"^16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/rc-image_3.0.5_1599445375523_0.9603685561770556","host":"s3://npm-registry-packages"},"readme":"# rc-image\n\nReact Image.\n\n<!-- prettier-ignore -->\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][github-actions-image]][github-actions-url]\n[![Codecov][codecov-image]][codecov-url]\n[![bundle size][bundlephobia-image]][bundlephobia-url]\n[![dumi][dumi-image]][dumi-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-image.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-image\n[github-actions-image]: https://github.com/react-component/image/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/image/actions\n[travis-image]: https://img.shields.io/travis/react-component/image/master?style=flat-square\n[travis-url]: https://travis-ci.org/react-component/image\n[circleci-image]: https://img.shields.io/circleci/build/github/react-component/image/master?style=flat-square\n[circleci-url]: https://circleci.com/gh/react-component/image\n[coveralls-image]: https://img.shields.io/coveralls/react-component/image.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/react-component/image?branch=master\n[codecov-image]: https://img.shields.io/codecov/c/gh/react-component/image?style=flat-square\n[codecov-url]: https://codecov.io/gh/react-component/image\n[david-url]: https://david-dm.org/react-component/image\n[david-image]: https://david-dm.org/react-component/image/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/image?type=dev\n[david-dev-image]: https://david-dm.org/react-component/image/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/rc-image.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-image\n[bundlephobia-url]: https://bundlephobia.com/result?p=rc-image\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-image\n[dumi-url]: https://github.com/umijs/dumi\n[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\n\n## Feature\n\n- [x] Placeholder\n- [x] Preview\n- [x] Rotate\n- [x] Zoom\n- [x] Flip\n- [x] Fallback\n- [x] Multiple Preview\n\n## install\n\n[![rc-image](https://nodei.co/npm/rc-image.png)](https://npmjs.org/package/rc-image)\n\n## Usage\n\n```bash\nnpm install\nnpm start\n```\n\n```js\nimport Image from 'rc-image';\n\nexport default () => (\n  <Image src=\"https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png\" />\n);\n```\n\n## API\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| preview | boolean \\| [PreviewType](#PreviewType) | true | Whether to show preview |\n| prefixCls | string | rc-image | Classname prefix |\n| placeholder | boolean \\| ReactElement | - | if `true` will set default placeholder or use `ReactElement` set customize placeholder |\n| fallback | string | - | Load failed src |\n| previewPrefixCls | string | rc-image-preview | Preview classname prefix |\n| onError | (event: Event) => void | - | Load failed callback |\n\n### PreviewType\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| visible | boolean | - | Whether the preview is open or not |\n| closeIcon | React.ReactNode | - | Custom close icon |\n| src | string | - | Customize preview src |\n| movable | boolean | true | Enable drag |\n| scaleStep | number | 0.5 | The number to which the scale is increased or decreased |\n| minScale | number | 1 | Min scale |\n| maxScale | number | 50 | Max scale |\n| forceRender | boolean | - | Force render preview |\n| getContainer | string \\| HTMLElement \\| (() => HTMLElement) \\| false | document.body | Return the mount node for preview |\n| imageRender | (originalNode: React.ReactElement, info: { transform: [TransformType](#TransformType) }) => React.ReactNode | - | Customize image |\n| toolbarRender | (originalNode: React.ReactElement, info: Omit<[ToolbarRenderInfoType](#ToolbarRenderInfoType), 'current' \\| 'total'>) => React.ReactNode | - | Customize toolbar |\n| onVisibleChange | (visible: boolean, prevVisible: boolean) => void | - | Callback when visible is changed |\n| onTransform | { transform: [TransformType](#TransformType), action: [TransformAction](#TransformAction) } | - | Callback when transform is changed |\n\n## Image.PreviewGroup\n\npreview the merged src\n\n```js\nimport Image from 'rc-image';\n\nexport default () => (\n  <Image.PreviewGroup>\n    <Image src=\"https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png\" />\n    <Image src=\"https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*P0S-QIRUbsUAAAAAAAAAAABkARQnAQ\" />\n  </Image.PreviewGroup>\n);\n```\n\n### API\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| preview | boolean \\| [PreviewGroupType](#PreviewGroupType) | true | Whether to show preview, <br> current: If Preview the show img index, default 0 |\n| previewPrefixCls | string | rc-image-preview | Preview classname prefix |\n| icons | { [iconKey]?: ReactNode } | - | Icons in the top operation bar, iconKey: 'rotateLeft' \\| 'rotateRight' \\| 'zoomIn' \\| 'zoomOut' \\| 'close' \\| 'left' \\| 'right' |\n| fallback | string | - | Load failed src |\n| items | (string \\| { src: string, alt: string, crossOrigin: string, ... })[] | - | preview group |\n\n### PreviewGroupType\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| visible | boolean | - | Whether the preview is open or not |\n| movable | boolean | true | Enable drag |\n| current | number | - | Current index |\n| closeIcon | React.ReactNode | - | Custom close icon |\n| scaleStep | number | 0.5 | The number to which the scale is increased or decreased |\n| minScale | number | 1 | Min scale |\n| maxScale | number | 50 | Max scale |\n| forceRender | boolean | - | Force render preview |\n| getContainer | string \\| HTMLElement \\| (() => HTMLElement) \\| false | document.body | Return the mount node for preview |\n| countRender | (current: number, total: number) => ReactNode | - | Customize count |\n| imageRender | (originalNode: React.ReactElement, info: { transform: [TransformType](#TransformType), current: number }) => React.ReactNode | - | Customize image |\n| toolbarRender | (originalNode: React.ReactElement, info: [ToolbarRenderInfoType](#ToolbarRenderInfoType)) => React.ReactNode | - | Customize toolbar |\n| onVisibleChange | (visible: boolean, prevVisible: boolean, current: number) => void | - | Callback when visible is changed |\n| onTransform | { transform: [TransformType](#TransformType), action: [TransformAction](#TransformAction) } | - | Callback when transform is changed |\n\n### TransformType\n\n```typescript\n{\n  x: number;\n  y: number;\n  rotate: number;\n  scale: number;\n  flipX: boolean;\n  flipY: boolean;\n}\n```\n\n### TransformAction\n\n```typescript\ntype TransformAction =\n  | 'flipY'\n  | 'flipX'\n  | 'rotateLeft'\n  | 'rotateRight'\n  | 'zoomIn'\n  | 'zoomOut'\n  | 'close'\n  | 'prev'\n  | 'next'\n  | 'wheel'\n  | 'doubleClick'\n  | 'move'\n  | 'dragRebound';\n```\n\n### ToolbarRenderInfoType\n\n```typescript\n{\n  icons: {\n    prevIcon?: React.ReactNode;\n    nextIcon?: React.ReactNode;\n    flipYIcon: React.ReactNode;\n    flipXIcon: React.ReactNode;\n    rotateLeftIcon: React.ReactNode;\n    rotateRightIcon: React.ReactNode;\n    zoomOutIcon: React.ReactNode;\n    zoomInIcon: React.ReactNode;\n  };\n  actions: {\n    onActive?: (offset: number) => void;\n    onFlipY: () => void;\n    onFlipX: () => void;\n    onRotateLeft: () => void;\n    onRotateRight: () => void;\n    onZoomOut: () => void;\n    onZoomIn: () => void;\n    onClose: () => void;\n    onReset: () => void;\n  };\n  transform: {\n    x: number;\n    y: number;\n    rotate: number;\n    scale: number;\n    flipX: boolean;\n    flipY: boolean;\n  },\n  current: number;\n  total: number;\n}\n```\n\n## Example\n\nhttp://localhost:8003/examples/\n\n## Test Case\n\n```\nnpm test\n```\n\n## Coverage\n\n```\nnpm run coverage\n```\n\n## License\n\nrc-image is released under the MIT license.\n","publish_time":1599445375700,"_cnpm_publish_time":1599445375700,"dist-tags":{"latest":"7.12.0"}}