{"name":"@rc-component/input","version":"1.0.1","keywords":["react","react-component","react-input","input","antd","ant-design"],"license":"MIT","_id":"@rc-component/input@1.0.1","maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"peachscript","email":"scdzwyxst@gmail.com"}],"homepage":"https://github.com/react-component/input","bugs":{"url":"http://github.com/react-component/input/issues"},"cnpm":{"mode":"npm"},"dist":{"shasum":"efe2ac0ee902d3aadb838d145f84a81ae2e86ace","tarball":"http://registry-npm.ywwl.com/@rc-component/input/download/@rc-component/input-1.0.1.tgz","fileCount":33,"integrity":"sha512-omxsjWpB+RamzDDB0NzgV6qI7Ok/U6nrN2KLL/hLZJcI7sZZgLYAN+Xs1pN7OYBnUeyn25PizcntEE0nofHv8Q==","signatures":[{"sig":"MEYCIQD3vLQQrNZJW3B+f8eA9nIvIiXreh3hoTyrKu/xZlEMRAIhAMWAEUfwn2SVOJBceW+WlM6ZRh2Q+TOI6+2z/SkFQQhy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62000,"size":11531,"noattachment":false,"key":"/@rc-component/input/-/@rc-component/input-1.0.1.tgz"},"main":"./lib/index","tnpm":{"mode":"npm"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"types":"./lib/index.d.ts","module":"./es/index","gitHead":"fd1275a9567f801d1cc2ebade77723bdd52c0451","scripts":{"lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"rc-test","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","prepare":"husky install","coverage":"rc-test --coverage","gh-pages":"GH_PAGES=1 npm run docs:build && npm run docs:deploy","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","docs:build":"dumi build","docs:deploy":"gh-pages -d .doc","lint-staged":"lint-staged","postpublish":"npm run gh-pages","pretty-quick":"pretty-quick","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"afc163","email":"afc163@gmail.com"},"repository":{"url":"git+ssh://git@github.com/react-component/input.git","type":"git"},"_npmVersion":"10.8.3","description":"React input component","directories":{},"lint-staged":{"**/*.{js,jsx,tsx,ts,md,json}":["prettier --write"]},"_nodeVersion":"22.8.0","dependencies":{"classnames":"^2.2.1","@rc-component/util":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.1.14","less":"^4.2.1","husky":"^9.1.7","react":"^18.0.0","eslint":"^8.0.0","father":"^4.3.7","rc-test":"^7.0.15","gh-pages":"^6.2.0","prettier":"^3.4.2","coveralls":"^3.0.6","cross-env":"^7.0.2","react-dom":"^18.0.0","typescript":"^5.7.2","@types/jest":"^29.5.14","lint-staged":"^15.2.11","@types/react":"^19.0.0","pretty-quick":"^4.0.0","@umijs/fabric":"^4.0.0","@rc-component/np":"^1.0.3","@types/react-dom":"^19.0.1","@types/classnames":"^2.2.9","@testing-library/react":"^16.0.1","@testing-library/jest-dom":"^6.6.3","@rc-component/father-plugin":"^2.0.3","@testing-library/user-event":"^14.0.0-beta"},"peerDependencies":{"react":">=16.0.0","react-dom":">=16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/input_1.0.1_1740561320959_0.030333723600007412","host":"s3://npm-registry-packages-npm-production"},"readme":"# @rc-component/input ⌨️\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-component/input.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/@rc-component/input\n[travis-image]: https://img.shields.io/travis/react-component/input/master?style=flat-square\n[travis-url]: https://travis-ci.com/react-component/input\n[github-actions-image]: https://github.com/react-component/input/actions/workflows/main.yml/badge.svg\n[github-actions-url]: https://github.com/react-component/input/actions/workflows/main.yml\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/input/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/input\n[david-url]: https://david-dm.org/react-component/input\n[david-image]: https://david-dm.org/react-component/input/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/input?type=dev\n[david-dev-image]: https://david-dm.org/react-component/input/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/@rc-component/input.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@rc-component/input\n[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/input\n[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/@rc-component/input?style=flat-square\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## Install\n\n[![@rc-component/input](https://nodei.co/npm/@rc-component/input.png)](https://npmjs.org/package/@rc-component/input)\n\n## Usage\n\n```js\nimport Input from '@rc-component/input';\nimport { render } from 'react-dom';\n\nrender(<Input placeholder=\"input\" allowClear />, mountNode);\n```\n\n```js\nimport { TextArea } from '@rc-component/input';\nimport { render } from 'react-dom';\n\nrender(<TextArea autoSize showCount />, mountNode);\n```\n\n## API\n\n| Property              | Type                                                                                              | Default  | Description                                                                                                                                                                    |\n| --------------------- | ------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| prefixCls             | string                                                                                            | rc-input |                                                                                                                                                                                |\n| className             | string                                                                                            | ''       | additional class name of input                                                                                                                                                 |\n| style                 | React.CSSProperties                                                                               |          | style properties of input                                                                                                                                                      |\n| affixWrapperClassName | string                                                                                            | -        | className with '@rc-component/input-affix-wrapper'                                                                                                                             |\n| groupClassName        | string                                                                                            | -        | className with '@rc-component/input-group-wrapper'                                                                                                                             |\n| wrapperClassName      | string                                                                                            | -        | className with '@rc-component/input-wrapper'                                                                                                                                   |\n| addonAfter            | ReactNode                                                                                         | -        | The label text displayed after (on the right side of) the input field                                                                                                          |\n| addonBefore           | ReactNode                                                                                         | -        | The label text displayed before (on the left side of) the input field                                                                                                          |\n| allowClear            | boolean &#124; { clearIcon: ReactNode }                                                           | false    | If allow to remove input content with clear icon                                                                                                                               |\n| bordered              | boolean                                                                                           | true     | Whether has border style                                                                                                                                                       |\n| defaultValue          | string                                                                                            | -        | The initial input content                                                                                                                                                      |\n| disabled              | boolean                                                                                           | false    | Whether the input is disabled                                                                                                                                                  |\n| id                    | string                                                                                            | -        | The ID for input                                                                                                                                                               |\n| maxLength             | number                                                                                            | -        | The max length                                                                                                                                                                 |\n| showCount             | boolean &#124; { formatter: ({ value: string, count: number, maxLength?: number }) => ReactNode } | false    | Whether show text count                                                                                                                                                        |\n| prefix                | ReactNode                                                                                         | -        | The prefix icon for the Input                                                                                                                                                  |\n| suffix                | ReactNode                                                                                         | -        | The suffix icon for the Input                                                                                                                                                  |\n| type                  | string                                                                                            | `text`   | The type of input, see: [MDN](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types) (use the named `TextArea` export instead of `type=\"textarea\"`) |\n| value                 | string                                                                                            | -        | The input content value                                                                                                                                                        |\n| onChange              | function(e)                                                                                       | -        | Callback when user input                                                                                                                                                       |\n| onPressEnter          | function(e)                                                                                       | -        | The callback function that is triggered when Enter key is pressed                                                                                                              |\n\n## TextArea\n\n`rc-textarea` has been migrated into `@rc-component/input`. Use the named `TextArea` export for all textarea-related features.\n\n```js\nimport { TextArea } from '@rc-component/input';\n\n<TextArea showCount maxLength={100} />;\n<TextArea allowClear autoSize />;\n```\n\n| Property     | Type                        | Default     | Description                                                                                    |\n| ------------ | --------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |\n| prefixCls    | string                      | rc-textarea |                                                                                                |\n| className    | string                      | ''          | additional class name of textarea                                                              |\n| style        | React.CSSProperties         | -           | style properties of textarea                                                                   |\n| autoSize     | boolean \\| object           | -           | Height autosize feature, can be set to `true\\|false` or an object `{ minRows: 2, maxRows: 6 }` |\n| allowClear   | boolean \\| { clearIcon }    | false       | If allow to remove textarea content with clear icon                                            |\n| showCount    | boolean \\| { formatter }    | false       | Whether show text count                                                                        |\n| count        | CountConfig                 | -           | Custom count strategy / max / exceed formatter                                                 |\n| onPressEnter | function(e)                 | -           | The callback function that is triggered when Enter key is pressed                              |\n| onResize     | function({ width, height }) | -           | The callback function that is triggered when resize                                            |\n\n## inputRef\n\n```tsx | pure\nconst inputRef = useRef(null);\n\nuseEffect(() => {\n  inputRef.current.focus(); // the input will get focus\n  inputRef.current.blur(); // the input will lose focus\n  console.log(inputRef.current.input); // The origin input element\n}, []);\n// ....\n<Input ref={inputRef} />;\n```\n\n| Property | Type                                    | Description                       |\n| -------- | --------------------------------------- | --------------------------------- |\n| focus    | `(options?: InputFocusOptions) => void` | The input get focus when called   |\n| blur     | `() => void`                            | The input loses focus when called |\n| input    | `HTMLInputElement \\| null`              | The origin input element          |\n\n## textareaRef\n\n```tsx | pure\nconst textareaRef = useRef(null);\n\nuseEffect(() => {\n  textareaRef.current.focus();\n  textareaRef.current.blur();\n  console.log(textareaRef.current.resizableTextArea);\n}, []);\n\n<TextArea ref={textareaRef} />;\n```\n\n| Property          | Type                   | Description                              |\n| ----------------- | ---------------------- | ---------------------------------------- |\n| focus             | `() => void`           | The textarea get focus when called       |\n| blur              | `() => void`           | The textarea loses focus when called     |\n| resizableTextArea | `ResizableTextAreaRef` | Wrapped resizable textarea instance      |\n| nativeElement     | `HTMLElement \\| null`  | The outer holder element or textarea DOM |\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## License\n\n@rc-component/input is released under the MIT license.\n","publish_time":1740561321192,"_cnpm_publish_time":1740561321192,"dist-tags":{"latest":"1.4.1"}}