{"name":"@rc-component/input","version":"1.4.0","keywords":["react","react-component","react-input","input","antd","ant-design"],"license":"MIT","_id":"@rc-component/input@1.4.0","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"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"}],"homepage":"https://react-component.github.io/input","bugs":{"url":"https://github.com/react-component/input/issues"},"cnpm":{"mode":"npm"},"dist":{"shasum":"879f500fbf7d4494c75997aa762f12627ad28490","tarball":"http://registry-npm.ywwl.com/@rc-component/input/download/@rc-component/input-1.4.0.tgz","fileCount":63,"integrity":"sha512-q/57onoIdJDfoN0thrWAcSiZd4rNYWWEsh9t9eZVNeoJE4x5g8uuCMXMU332clqB7HngBFl6WjhBZ3JB/ewNPQ==","signatures":[{"sig":"MEUCIDx6wDwBZDpqeehURuESbgILf//jLQN+8XV/2IAt6NMhAiEA4U2JJIpe71XEAory8vX0YVaZmjI2ahO3dV5ZntNtFZM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDgDroizkdb6/0P5UN/nlfx+b8gTywvjsGPkKBQYYGxWAIgUC5dq0U1H2ddtHvXl+y/zm5bh18JYUkiDAmQ+OVKheE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127726,"size":20636,"noattachment":false,"key":"/@rc-component/input/-/@rc-component/input-1.4.0.tgz"},"main":"./lib/index","tnpm":{"mode":"npm"},"types":"./es/index.d.ts","module":"./es/index","gitHead":"dc5c136e237ec485957cb56bcb60d0ad2b76d612","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"rc-test","build":"npm run docs:build","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","prepare":"husky","coverage":"rc-test --coverage","gh-pages":"cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy","prettier":"prettier --write --ignore-unknown .","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","postpublish":"npm run gh-pages","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+https://github.com/react-component/input.git","type":"git"},"_npmVersion":"11.19.1","description":"React input component","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"_nodeVersion":"26.9.0","dependencies":{"clsx":"^2.1.1","@rc-component/util":"^1.13.0","@rc-component/resize-observer":"^1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.38","less":"^4.6.7","husky":"^9.1.7","react":"^19.2.7","eslint":"^10.6.0","father":"^4.6.24","globals":"^17.7.0","rc-test":"^7.1.3","gh-pages":"^6.3.0","prettier":"^3.9.4","cross-env":"^10.1.0","react-dom":"^19.2.7","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^26.0.1","lint-staged":"^17.0.8","@types/react":"^19.2.17","@eslint/compat":"^2.1.0","@rc-component/np":"^1.0.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.62.1","eslint-plugin-jest":"^29.15.4","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","eslint-config-prettier":"^10.1.8","@testing-library/jest-dom":"^6.9.1","eslint-plugin-react-hooks":"^7.1.1","@rc-component/father-plugin":"^2.2.0","@testing-library/user-event":"^14.6.1"},"peerDependencies":{"react":">=16.0.0","react-dom":">=16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/input_1.4.0_1791796681575_0.24697214018606717","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/input</h1>\n  <p><sub><a href=\"https://ant.design\"><img alt=\"Ant Design\" height=\"14\" src=\"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg\" style=\"vertical-align: -0.125em;\" /></a> Ant Design 生态的一部分。</sub></p>\n  <p>📦 ⌨️ React 输入框基础组件，支持前后缀、清除按钮、计数和组合输入。</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/input\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/input.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/input\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/input.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/input/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/input/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/input\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/input/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/input\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/input?style=flat-square\"></a>\n    <a href=\"https://github.com/umijs/dumi\"><img alt=\"dumi\" src=\"https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\"></a>\n  </p>\n</div>\n\n<p align=\"center\"><a href=\"./README.md\">English</a> | 简体中文</p>\n\n## 特性\n\n- 提供可组合的 `Input`、`TextArea` 和 `BaseInput` 基础组件。\n- 支持前后缀、附加内容、清除图标和字符计数。\n- `TextArea` 支持自适应高度、尺寸变化回调和命令式 ref。\n- 提供 TypeScript 类型定义和语义化 `classNames` / `styles` 插槽。\n- 被 Ant Design 用作共享的 input 基础能力。\n\n## 安装\n\n```bash\nnpm install @rc-component/input\n```\n\n## 使用\n\n```tsx | pure\nimport Input from '@rc-component/input';\n\nexport default () => <Input allowClear placeholder=\"Type something\" />;\n```\n\n```tsx | pure\nimport { TextArea } from '@rc-component/input';\n\nexport default () => <TextArea autoSize showCount maxLength={100} />;\n```\n\n## 示例\n\n运行本地 dumi 站点：\n\n```bash\nnpm install\nnpm start\n```\n\n然后打开 `http://localhost:8000`。\n\n## API\n\n### Input\n\n| 参数         | 类型                                                       | 默认值     | 说明                                                 |\n| ------------ | ---------------------------------------------------------- | ---------- | ---------------------------------------------------- |\n| addonAfter   | `ReactNode`                                                | -          | 输入后显示的元素。                                   |\n| addonBefore  | `ReactNode`                                                | -          | 输入之前显示的元素。                                 |\n| allowClear   | `boolean \\| { disabled?: boolean; clearIcon?: ReactNode }` | `false`    | 显示当前值的清除按钮。                               |\n| className    | `string`                                                   | -          | 输入元素的 className。                               |\n| classNames   | `InputProps['classNames']`                                 | -          | 输入槽的语义 className。                             |\n| count        | `CountConfig`                                              | -          | 自定义计数策略、限制、可见性和超出格式化程序。       |\n| defaultValue | `string \\| number \\| readonly string[] \\| bigint`          | -          | 初始输入值。                                         |\n| disabled     | `boolean`                                                  | `false`    | 禁用输入。                                           |\n| htmlSize     | `number`                                                   | -          | 原生 input `size` 属性。                             |\n| maxLength    | `number`                                                   | -          | 原生 input `maxLength` 属性。                        |\n| prefix       | `ReactNode`                                                | -          | 输入包装器内的前缀内容。                             |\n| prefixCls    | `string`                                                   | `rc-input` | className 前缀。                                     |\n| showCount    | `boolean \\| { formatter: ShowCountFormatter }`             | `false`    | 显示字符数。新代码首选 `count.show`。                |\n| styles       | `InputProps['styles']`                                     | -          | 输入槽的语义样式。                                   |\n| suffix       | `ReactNode`                                                | -          | 输入包装器内的后缀内容。                             |\n| type         | `InputProps['type']`                                       | `text`     | 原生 input 类型。需要文本域行为时请使用 `TextArea`。 |\n| value        | `string \\| number \\| readonly string[] \\| bigint`          | -          | 受控输入值。                                         |\n| onChange     | `React.ChangeEventHandler<HTMLInputElement>`               | -          | 当值改变时触发。                                     |\n| onClear      | `() => void`                                               | -          | 单击清除按钮时触发。                                 |\n| onPressEnter | `React.KeyboardEventHandler<HTMLInputElement>`             | -          | 当按下 Enter 时触发。                                |\n\n### TextArea\n\n| 参数         | 类型                                                       | 默认值        | 说明                                           |\n| ------------ | ---------------------------------------------------------- | ------------- | ---------------------------------------------- |\n| allowClear   | `boolean \\| { disabled?: boolean; clearIcon?: ReactNode }` | `false`       | 显示当前值的清除按钮。                         |\n| autoSize     | `boolean \\| { minRows?: number; maxRows?: number }`        | `false`       | 根据内容自动调整高度。                         |\n| className    | `string`                                                   | -             | 文本区域的 className。                         |\n| classNames   | `TextAreaProps['classNames']`                              | -             | 文本区域槽的语义 className。                   |\n| count        | `CountConfig`                                              | -             | 自定义计数策略、限制、可见性和超出格式化程序。 |\n| defaultValue | `string \\| number \\| readonly string[] \\| bigint`          | -             | 初始文本区域值。                               |\n| maxLength    | `number`                                                   | -             | 本机文本区域 `maxLength` 属性。                |\n| prefixCls    | `string`                                                   | `rc-textarea` | className 前缀。                               |\n| showCount    | `boolean \\| { formatter: ShowCountFormatter }`             | `false`       | 显示字符数。新代码首选 `count.show`。          |\n| style        | `React.CSSProperties`                                      | -             | 文本区域的内联样式。                           |\n| styles       | `TextAreaProps['styles']`                                  | -             | 文本区域槽的语义样式。                         |\n| suffix       | `ReactNode`                                                | -             | textarea 包装器内的后缀内容。                  |\n| value        | `string \\| number \\| readonly string[] \\| bigint`          | -             | 受控文本区域值。                               |\n| onChange     | `React.ChangeEventHandler<HTMLTextAreaElement>`            | -             | 当值改变时触发。                               |\n| onClear      | `() => void`                                               | -             | 单击清除按钮时触发。                           |\n| onPressEnter | `React.KeyboardEventHandler<HTMLTextAreaElement>`          | -             | 当按下 Enter 时触发。                          |\n| onResize     | `(size: { width: number; height: number }) => void`        | -             | 当文本区域大小改变时触发。                     |\n\n### Refs\n\n```tsx | pure\nimport type { InputRef, TextAreaRef } from '@rc-component/input';\n\nfunction focusInput(inputRef: InputRef | null) {\n  inputRef?.focus();\n}\n\nfunction blurTextArea(textareaRef: TextAreaRef | null) {\n  textareaRef?.blur();\n}\n```\n\n| Ref           | 方法                                                                                    |\n| ------------- | --------------------------------------------------------------------------------------- |\n| `InputRef`    | `focus(options)`, `blur()`, `select()`, `setSelectionRange()`, `input`, `nativeElement` |\n| `TextAreaRef` | `focus()`, `blur()`, `resizableTextArea`, `nativeElement`                               |\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run tsc\nnpm run compile\nnpm run build\n```\n\ndumi 站点默认运行在 `http://localhost:8000`。\n\n## 发布\n\n```bash\nnpm run prepublishOnly\n```\n\n包构建完成后，发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。\n\n## 许可证\n\n@rc-component/input 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1791796681679,"_cnpm_publish_time":1791796681679,"dist-tags":{"latest":"1.4.1"}}