{"name":"@rc-component/select","version":"1.6.9","keywords":["react","react-component","react-select","select"],"license":"MIT","_id":"@rc-component/select@1.6.9","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":"http://github.com/react-component/select","bugs":{"url":"http://github.com/react-component/select/issues"},"dist":{"shasum":"edf60bb7531e31548b4f6f02fe6d685b843f8ff2","tarball":"http://registry-npm.ywwl.com/@rc-component/select/download/@rc-component/select-1.6.9.tgz","fileCount":154,"integrity":"sha512-kr8eMrr6ejYCLsX3GWnl+p1DkZAOJuQ6BK1E6K6k3z2DuDgO5uWDtMre2YUC4CYUc1HNFdvXg99QmWSOFa5FCA==","signatures":[{"sig":"MEYCIQC0DcXdFEEXgiNZ7/lfh5l5n3xCdpNM9UHxQmEpKI5RPAIhAJWTJEq/Frwd9Ocy7AFDZ4bWqVOJzHAvcHKO2oGt58ib","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":327429,"size":51906,"noattachment":false,"key":"/@rc-component/select/-/@rc-component/select-1.6.9.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"832791044ff6c07a25b46948269739d5e5e0d774","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ docs/ tests/ --ext .tsx,.ts,.jsx,.js","test":"rc-test","build":"dumi build","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","prepare":"husky && dumi setup","prettier":"prettier --write --ignore-unknown .","now-build":"npm run build","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+ssh://git@github.com/react-component/select.git","type":"git"},"_npmVersion":"11.7.0","description":"React Select","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"_nodeVersion":"22.15.1","dependencies":{"clsx":"^2.1.1","@rc-component/util":"^1.3.0","@rc-component/trigger":"^3.0.0","@rc-component/overflow":"^1.0.0","@rc-component/virtual-list":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.2.13","less":"^4.2.0","husky":"^9.1.5","jsonp":"^0.2.1","react":"^18.2.0","eslint":"^8.55.0","father":"^4.0.0","rc-test":"^7.1.2","prettier":"^3.1.1","rc-dialog":"^9.0.0","react-dom":"^18.2.0","babel-jest":"^29.6.1","typescript":"^5.2.2","@types/jest":"^29.5.12","@types/node":"^24.5.2","lint-staged":"^15.2.9","querystring":"^0.2.1","@types/react":"^18.3.0","@umijs/fabric":"^4.0.1","@rc-component/np":"^1.0.0","@types/react-dom":"^18.3.0","@testing-library/react":"^15.0.6","@testing-library/jest-dom":"^6.4.5","@rc-component/father-plugin":"^2.0.2"},"peerDependencies":{"react":"*","react-dom":"*"},"_npmOperationalInternal":{"tmp":"tmp/select_1.6.9_1770967329227_0.6019332149634928","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/select</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/select\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/select.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/select\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/select.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/select/actions/workflows/test.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/select/actions/workflows/test.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/select\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/select/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/select\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/select?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| 范围 | 支持                                         |\n| ---- | -------------------------------------------- |\n| 数据 | `options` 数据，旧版 `Option` 子项，分组选项 |\n| 模式 | 单选、`multiple`、`tags` 和 `combobox` 模式  |\n| 搜索 | 受控搜索、自定义过滤和自定义排序             |\n| 渲染 | 自定义选项、标签、选中项、清除图标和菜单图标 |\n| 规模 | 支持可配置项高度的虚拟滚动                   |\n\n## 安装\n\n```bash\nnpm install @rc-component/select\n```\n\n## 使用\n\n```tsx | pure\nimport Select from '@rc-component/select';\nimport '@rc-component/select/assets/index.css';\n\nexport default () => (\n  <Select\n    placeholder=\"Select a user\"\n    options={[\n      { value: 'jack', label: 'Jack' },\n      { value: 'lucy', label: 'Lucy' },\n      { value: 'yiminghe', label: 'Yiminghe' },\n    ]}\n  />\n);\n```\n\n## 示例\n\n运行本地 dumi 站点：\n\n```bash\nnpm install\nnpm start\n```\n\n然后打开 `http://localhost:8000`。\n\n## API\n\n### Select\n\nSelect 还接受来自 `BaseSelect` 的公共属性，但由 Select 重新定义的 `showSearch` 除外。\n\n| 名称 | 说明 | 类型 | 默认值 |\n| --- | --- | --- | --- |\n| autoClearSearchValue | 已弃用。请改用 `showSearch.autoClearSearchValue`。 | boolean | true |\n| backfill | 将活动选项回填到输入中。仅适用于 `combobox` 模式。 | boolean | false |\n| children | 旧版选项子节点。新代码推荐使用 `options`。 | ReactNode | - |\n| classNames | 语义 className。 | `Partial<Record<SemanticName, string>>` | - |\n| defaultActiveFirstOption | 默认情况下第一个选项是否处于活动状态。 | boolean | true |\n| defaultValue | 初始选中值。 | `ValueType` \\| null | - |\n| direction | 下拉方向。 | `ltr` \\| `rtl` | `ltr` |\n| fieldNames | 自定义选项字段名称。 | `FieldNames` | - |\n| filterOption | 已弃用。请改用 `showSearch.filterOption`。 | boolean \\| `FilterFunc<OptionType>` | - |\n| filterSort | 已弃用。请改用 `showSearch.filterSort`。 | `(optionA, optionB, info) => number` | - |\n| labelInValue | 返回标记值对象而不是原始值。 | boolean | false |\n| labelRender | 自定义选定的标签渲染。 | `(props: LabelInValueType) => ReactNode` | - |\n| listHeight | 弹层列表高度。 | number | 200 |\n| listItemHeight | 弹层列表项的高度。 | number | 20 |\n| maxCount | 最大选定项目数。 | number | - |\n| menuItemSelectedIcon | 自定义选定的选项图标。 | `RenderNode` | - |\n| mode | 选择模式。 | `combobox` \\| `multiple` \\| `tags` | - |\n| onActive | 当活动值改变时调用。 | `(value: ValueType) => void` | - |\n| onChange | 当选定值更改时调用。 | `(value: ValueType, option?: OptionType \\| OptionType[]) => void` | - |\n| onDeselect | 当取消选择某个值时调用。 | `(value, option) => void` | - |\n| onSearch | 已弃用。请改用 `showSearch.onSearch`。 | `(value: string) => void` | - |\n| onSelect | 选择值时调用。 | `(value, option) => void` | - |\n| optionFilterProp | 已废弃。请使用 `showSearch.optionFilterProp`。 | string \\| string[] | - |\n| optionLabelProp | 用作所选标签的选项道具。 | string | - |\n| optionRender | 自定义选项渲染器。 | `(oriOption, info: { index: number }) => ReactNode` | - |\n| options | 选项数据。 | `OptionType[]` | - |\n| searchValue | 已弃用。请改用 `showSearch.searchValue`。 | string | - |\n| showSearch | 启用搜索或配置搜索行为。 | boolean \\| `SearchConfig<OptionType>` | - |\n| styles | 语义化样式。 | `Partial<Record<SemanticName, CSSProperties>>` | - |\n| value | 受控选中值。 | `ValueType` \\| null | - |\n| virtual | 设置为 `false` 时禁用虚拟滚动。 | boolean | true |\n\n### 方法\n\n| 名称  | 说明         | 参数 |\n| ----- | ------------ | ---- |\n| blur  | 移除焦点。   | -    |\n| focus | 聚焦选择器。 | -    |\n\n### SearchConfig\n\n| 名称 | 说明 | 类型 | 默认值 |\n| --- | --- | --- | --- |\n| autoClearSearchValue | 在多种模式下选择或取消选择后清除搜索输入。 | boolean | true |\n| filterOption | 按搜索输入过滤选项。 | boolean \\| `FilterFunc<OptionType>` | - |\n| filterSort | 对过滤的选项进行排序。 | `(optionA, optionB, info: { searchValue: string }) => number` | - |\n| onSearch | 当搜索输入更改时调用。 | `(value: string) => void` | - |\n| optionFilterProp | 启用 `filterOption` 时用于过滤的选项属性。 | string \\| string[] | - |\n| searchValue | 受控搜索输入值。 | string | - |\n\n### Option\n\n`Option` 是一个旧的占位符组件。对于新用途，更喜欢 `options` 属性。\n\n| 名称      | 说明             | 类型                     | 默认值 |\n| --------- | ---------------- | ------------------------ | ------ |\n| children  | 选项标签。       | ReactNode                | -      |\n| className | 选项 className。 | string                   | -      |\n| disabled  | 禁用该选项。     | boolean                  | false  |\n| title     | 选项标题。       | string                   | -      |\n| value     | 选项值。         | string \\| number \\| null | -      |\n\n### OptGroup\n\n`OptGroup` 是一个旧的占位符组件。优选嵌套 `options` 数据以供新用途。\n\n| 名称      | 说明             | 类型      | 默认值 |\n| --------- | ---------------- | --------- | ------ |\n| children  | 组选项。         | ReactNode | -      |\n| className | 分组 className。 | string    | -      |\n| disabled  | 禁用该组。       | boolean   | false  |\n| label     | Group label.     | ReactNode | -      |\n| title     | Group title.     | string    | -      |\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run lint\nnpm run tsc\nnpm run compile\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/select 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1770967329374,"_cnpm_publish_time":1770967329374,"dist-tags":{"latest":"1.12.0"}}