{"name":"rc-mentions","version":"2.18.0","description":"React Mentions","keywords":["react","react-component","react-mentions","mentions"],"homepage":"http://github.com/react-component/mentions","bugs":{"url":"http://github.com/react-component/mentions/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/react-component/mentions.git"},"license":"MIT","main":"./lib/index","module":"./es/index","scripts":{"compile":"father build","coverage":"rc-test --coverage","docs:build":"dumi build","docs:deploy":"gh-pages -d .doc","gh-pages":"npm run docs:build && npm run docs:deploy","lint":"eslint src/ --ext .tsx,.ts","prepare":"husky install","prepublishOnly":"npm run compile","postpublish":"npm run gh-pages","start":"dumi dev","test":"rc-test"},"lint-staged":{"**/*.{js,jsx,tsx,ts,md,json}":["prettier --write","git add"]},"dependencies":{"@babel/runtime":"^7.22.5","@rc-component/trigger":"^2.0.0","classnames":"^2.2.6","rc-input":"~1.6.0","rc-menu":"~9.16.0","rc-textarea":"~1.8.0","rc-util":"^5.34.1"},"devDependencies":{"@rc-component/father-plugin":"^1.0.0","@testing-library/jest-dom":"^6.4.6","@testing-library/react":"^16.0.0","@types/classnames":"^2.2.6","@types/react":"^18.0.8","@types/react-dom":"^18.0.3","@types/warning":"^3.0.0","@umijs/fabric":"^3.0.0","dumi":"^2.0.18","eslint":"^7.0.0","father":"^4.0.0","gh-pages":"^5.0.0","husky":"^8.0.3","lint-staged":"^15.2.7","np":"^10.0.0","prettier":"^3.3.2","rc-test":"^7.0.14","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^5.0.4"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_id":"rc-mentions@2.18.0","gitHead":"990531eb483bf453f84de49d16e97f747f5b1b9a","types":"./lib/index.d.ts","_nodeVersion":"22.5.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-R6x44v+2eokrjD6COdtUkLiOE3czPxftvD3wknwfGj67t59PooFaPXua/U6ICMJu5r7ppHN6w6kw3rZ4CevivQ==","shasum":"c7540de287294315b60fc378bdc915a029b40c1b","tarball":"http://registry-npm.ywwl.com/rc-mentions/download/rc-mentions-2.18.0.tgz","fileCount":35,"unpackedSize":78507,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAzG7TIWp88Ym3nwNy9G1trDT5lvSSoUAicCxiObS6OmAiA0VIlH7hiL3M2B0O9f7r53rFgZEsltHh4+fCEi15Kymg=="}],"size":13377,"noattachment":false,"key":"/rc-mentions/-/rc-mentions-2.18.0.tgz"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rc-mentions_2.18.0_1733134067670_0.7641284833177804"},"_hasShrinkwrap":false,"readme":"# rc-mentions\n\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-mentions.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-mentions\n[travis-image]: https://img.shields.io/travis/react-component/mentions/master?style=flat-square\n[travis-url]: https://travis-ci.com/react-component/mentions\n[github-actions-image]: https://github.com/react-component/mentions/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/mentions/actions\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/mentions/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/mentions\n[david-url]: https://david-dm.org/react-component/mentions\n[david-image]: https://david-dm.org/react-component/mentions/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/mentions?type=dev\n[david-dev-image]: https://david-dm.org/react-component/mentions/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/rc-mentions.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-mentions\n[bundlephobia-url]: https://bundlephobia.com/package/rc-mentions\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-mentions\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## Screenshots\n\n<img src=\"https://user-images.githubusercontent.com/5378891/57270992-2fd48780-70c0-11e9-91ae-c614d0b49a45.png\" />\n\n## Feature\n\n- support ie9,ie9+,chrome,firefox,safari\n\n### Keyboard\n\n- Open mentions (focus input || focus and click)\n- KeyDown/KeyUp/Enter to navigate menu\n\n## install\n\n[![rc-mentions](https://nodei.co/npm/rc-mentions.png)](https://npmjs.org/package/rc-mentions)\n\n## Usage\n\n### basic use\n\n```js\n/**\n * inline: true\n */\nimport Mentions from 'rc-mentions';\n// Import the default styles\nimport './index.less';\n\nconst { Option } = Mentions;\n\nvar Demo = (\n  <Mentions>\n    <Option value=\"light\">Light</Option>\n    <Option value=\"bamboo\">Bamboo</Option>\n    <Option value=\"cat\">Cat</Option>\n  </Mentions>\n);\nReact.render(<Demo />, container);\n```\n\n**Note:** We use [index.less](https://github.com/react-component/mentions/blob/master/assets/index.less) for styling, you can convert them into css and properly reference them to the code above.\n\n## API\n\n### Mentions props\n\n| name              | description                                                                                             | type                                                       | default     |\n| ----------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ----------- |\n| autoFocus         | Auto get focus when component mounted                                                                   | `boolean`                                                  | `false`     |\n| defaultValue      | Default value                                                                                           | `string`                                                   | -           |\n| filterOption      | Customize filter option logic                                                                           | `false \\| (input: string, option: OptionProps) => boolean` | -           |\n| notFoundContent   | Set mentions content when not match                                                                     | `ReactNode`                                                | 'Not Found' |\n| placement         | Set popup placement                                                                                     | `'top' \\| 'bottom'`                                        | 'bottom'    |\n| direction         | Set popup direction                                                                                     | `'ltr' \\| 'rtl'`                                           | 'ltr'       |\n| prefix            | Set trigger prefix keyword                                                                              | `string \\| string[]`                                       | '@'         |\n| rows              | Set row count                                                                                           | `number`                                                   | 1           |\n| split             | Set split string before and after selected mention                                                      | `string`                                                   | ' '         |\n| silent            | Used in transition phase, does not respond to keyboard enter events when equal to `true`                | `boolean`                                                  | `false`     |\n| validateSearch    | Customize trigger search logic                                                                          | `(text: string, props: MentionsProps) => void`             | -           |\n| value             | Set value of mentions                                                                                   | `string`                                                   | -           |\n| onChange          | Trigger when value changed                                                                              | `(text: string) => void`                                   | -           |\n| onKeyDown         | Trigger when user hits a key                                                                            | `React.KeyboardEventHandler<HTMLTextAreaElement>`          | -           |\n| onKeyUp           | Trigger when user releases a key                                                                        | `React.KeyboardEventHandler<HTMLTextAreaElement>`          | -           |\n| onSelect          | Trigger when user select the option                                                                     | `(option: OptionProps, prefix: string) => void`            | -           |\n| onSearch          | Trigger when prefix hit                                                                                 | `(text: string, prefix: string) => void`                   | -           |\n| onFocus           | Trigger when mentions get focus                                                                         | `React.FocusEventHandler<HTMLTextAreaElement>`             | -           |\n| onBlur            | Trigger when mentions lose focus                                                                        | `React.FocusEventHandler<HTMLTextAreaElement>`             | -           |\n| getPopupContainer | DOM Container for suggestions                                                                           | `() => HTMLElement`                                        | -           |\n| autoSize          | Textarea height autosize feature, can be set to `true\\|false` or an object `{ minRows: 2, maxRows: 6 }` | `boolean \\| object`                                        | -           |\n| onPressEnter      | The callback function that is triggered when Enter key is pressed                                       | `function(e)`                                              | -           |\n| onResize          | The callback function that is triggered when textarea resize                                            | `function({ width, height })`                              | -           |\n\n### Methods\n\n| name    | description          |\n| ------- | -------------------- |\n| focus() | Component get focus  |\n| blur()  | Component lose focus |\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Example\n\nhttp://localhost:9001/\n\nonline example: http://react-component.github.io/mentions/\n\n## Test Case\n\n```\nnpm test\n```\n\n## Coverage\n\n```\nnpm run coverage\n```\n\n## License\n\nrc-mentions is released under the MIT license.\n","publish_time":1733134067870,"maintainers":[{"name":"afc163","email":"afc163@gmail.com"},{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"}],"_cnpm_publish_time":1733134067870,"dist-tags":{"beta":"0.2.0-alpha.5","latest":"2.20.0"}}