{"name":"rc-mentions","version":"2.19.1","keywords":["react","react-component","react-mentions","mentions"],"license":"MIT","_id":"rc-mentions@2.19.1","maintainers":[{"name":"afc163","email":"afc163@gmail.com"},{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"}],"homepage":"http://github.com/react-component/mentions","bugs":{"url":"http://github.com/react-component/mentions/issues"},"dist":{"shasum":"3fd0dd0bf3dd63afdb6a21750cbae81f3824b9c4","tarball":"http://registry-npm.ywwl.com/rc-mentions/download/rc-mentions-2.19.1.tgz","fileCount":35,"integrity":"sha512-KK3bAc/bPFI993J3necmaMXD2reZTzytZdlTvkeBbp50IGH1BDPDvxLdHDUrpQx2b2TGaVJsn+86BvYa03kGqA==","signatures":[{"sig":"MEQCIDdISWAJMW30lpYGqquacWyvE4A9jn47RWh7OIU1F9yUAiBLBaardISaDXgnwKn3cIE8u1obTrCOONk9e4V5PUHdcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78533,"size":13448,"noattachment":false,"key":"/rc-mentions/-/rc-mentions-2.19.1.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","gitHead":"41a3e6ae4491998c678bd1d57fb9f9e98681be6e","scripts":{"lint":"eslint src/ --ext .tsx,.ts","test":"rc-test","start":"dumi dev","compile":"father build","prepare":"husky install","coverage":"rc-test --coverage","gh-pages":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d .doc","postpublish":"npm run gh-pages","prepublishOnly":"npm run compile && np --yolo --no-publish"},"_npmUser":{"name":"afc163","email":"afc163@gmail.com"},"repository":{"url":"git+ssh://git@github.com/react-component/mentions.git","type":"git"},"_npmVersion":"10.8.3","description":"React Mentions","directories":{},"lint-staged":{"**/*.{js,jsx,tsx,ts,md,json}":["prettier --write","git add"]},"_nodeVersion":"22.8.0","dependencies":{"rc-menu":"~9.16.0","rc-util":"^5.34.1","rc-input":"~1.7.1","classnames":"^2.2.6","rc-textarea":"~1.9.0","@babel/runtime":"^7.22.5","@rc-component/trigger":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"np":"^10.0.0","dumi":"^2.0.18","husky":"^9.1.6","react":"^18.0.0","eslint":"^7.0.0","father":"^4.0.0","rc-test":"^7.0.14","gh-pages":"^5.0.0","prettier":"^3.3.2","react-dom":"^18.0.0","typescript":"^5.0.4","lint-staged":"^15.2.7","@types/react":"^18.0.8","@umijs/fabric":"^3.0.0","@types/warning":"^3.0.0","@types/react-dom":"^18.0.3","@types/classnames":"^2.2.6","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.6","@rc-component/father-plugin":"^1.0.0"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_npmOperationalInternal":{"tmp":"tmp/rc-mentions_2.19.1_1735632936376_0.3935059488161581","host":"s3://npm-registry-packages-npm-production"},"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":1735632936586,"_cnpm_publish_time":1735632936586,"dist-tags":{"beta":"0.2.0-alpha.5","latest":"2.20.0"}}