{"name":"@rc-component/picker","version":"1.3.0","keywords":["react","react-component","react-picker"],"license":"MIT","_id":"@rc-component/picker@1.3.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"}],"homepage":"https://react-component.github.io/picker","bugs":{"url":"http://github.com/react-component/picker/issues"},"dist":{"shasum":"68447ffd3498ce9d9a8058d99216a8bfa03a478f","tarball":"http://registry-npm.ywwl.com/@rc-component/picker/download/@rc-component/picker-1.3.0.tgz","fileCount":573,"integrity":"sha512-6QKzWly6q6VaQ9WFU73Y98EJFcICyRSgpyY0Mot0wcNHOFbuOBqV6urWzM+dGsmF/MusBt2A2cF+FcjmQfd2JQ==","signatures":[{"sig":"MEUCIQDFW36RoQmzJbQZsJIs8C73NJCBy4W24uwd+OFs2RwHbAIgLuBRvmf9Bv/6BKvntU79t8uKo/tScLQwqshdkCQxX1w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1345737,"size":153479,"noattachment":false,"key":"/@rc-component/picker/-/@rc-component/picker-1.3.0.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"0e289d524d1fa2ea62eb30b1920cb8e775c19825","scripts":{"lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"rc-test","build":"dumi build","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","prepare":"npx husky","coverage":"father test --coverage","gh-pages":"npm run build && father doc deploy","lint:tsc":"tsc -p tsconfig.json --noEmit","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","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/picker.git","type":"git"},"_npmVersion":"10.8.2","description":"React date & time picker","directories":{},"_nodeVersion":"22.5.1","dependencies":{"classnames":"^2.2.1","rc-overflow":"^1.3.2","@rc-component/util":"^1.2.1","@rc-component/trigger":"^3.0.0","@rc-component/resize-observer":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.1.15","glob":"^10.4.1","less":"^4.2.0","dayjs":"1.x","husky":"^9.0.11","luxon":"3.x","react":"^18.2.0","eslint":"^8.56.0","father":"^4.0.0","moment":"^2.24.0","rc-test":"^7.0.9","date-fns":"2.x","mockdate":"^3.0.2","prettier":"^3.1.0","coveralls":"^3.0.6","cross-env":"^7.0.2","react-dom":"^18.2.0","typescript":"^5.3.0","@types/jest":"^29.4.0","lint-staged":"^15.2.7","@types/luxon":"^3.2.0","@types/react":"^18.0.28","moment-timezone":"^0.5.45","@rc-component/np":"^1.0.3","@types/react-dom":"^18.0.8","@types/classnames":"^2.2.9","eslint-plugin-jest":"^28.8.1","eslint-plugin-unicorn":"^55.0.0","@testing-library/react":"^16.0.0","eslint-plugin-react-hooks":"^4.6.0","@rc-component/father-plugin":"^1.0.0","eslint-plugin-eslint-comments":"^3.2.0"},"peerDependencies":{"dayjs":">= 1.x","luxon":">= 3.x","react":">=16.9.0","moment":">= 2.x","date-fns":">= 2.x","react-dom":">=16.9.0"},"peerDependenciesMeta":{"dayjs":{"optional":true},"luxon":{"optional":true},"moment":{"optional":true},"date-fns":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/picker_1.3.0_1744966444244_0.9580931715913943","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/picker</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/picker\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/picker.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/picker\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/picker.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/picker/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/picker/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/picker\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/picker/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/picker\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/picker?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- 适用于 date-fns、dayjs、luxon 和 moment 的可插拔 `generateConfig` 适配器。\n- 从 `@rc-component/picker/locale/*` 公开的语言环境包。\n- 受控值、弹层状态、面板值、预设、禁用日期、语义 className 和自定义单元格渲染。\n- 选择器属性、范围值、区域设置、日期库适配器和引用的 TypeScript 定义。\n- 被 Ant Design 共享的日期和时间选择器基础能力。\n\n## 安装\n\n```bash\nnpm install @rc-component/picker\n```\n\n如果项目尚未安装日期库，请先安装计划使用的日期库：\n\n```bash\nnpm install dayjs\n```\n\n## 使用\n\n```tsx | pure\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport Picker from '@rc-component/picker';\nimport dayjsGenerateConfig from '@rc-component/picker/generate/dayjs';\nimport enUS from '@rc-component/picker/locale/en_US';\nimport '@rc-component/picker/assets/index.css';\nexport default () => (\n  <Picker<Dayjs> generateConfig={dayjsGenerateConfig} locale={enUS} defaultValue={dayjs()} />\n);\n```\n\n```tsx | pure\nimport type { Dayjs } from 'dayjs';\nimport { RangePicker } from '@rc-component/picker';\nimport dayjsGenerateConfig from '@rc-component/picker/generate/dayjs';\nimport enUS from '@rc-component/picker/locale/en_US';\nexport default () => (\n  <RangePicker<Dayjs>\n    generateConfig={dayjsGenerateConfig}\n    locale={enUS}\n    showTime\n    presets={[\n      {\n        label: 'Today',\n        value: () => [dayjsGenerateConfig.getNow(), dayjsGenerateConfig.getNow()],\n      },\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### Exports\n\n| Export        | 说明                                                     |\n| ------------- | -------------------------------------------------------- |\n| `Picker`      | 用于单个或多个日期/时间值的输入型选择器。                |\n| `RangePicker` | 用于开始和结束日期/时间值的输入型范围选择器。            |\n| `PickerPanel` | 仅面板选择器，没有输入触发器。                           |\n| `generate/*`  | 适用于 date-fns、dayjs、luxon 和 moment 的日期库适配器。 |\n| `locale/*`    | 选择器 UI 文本和格式的区域设置对象。                     |\n| `interface`   | 共享 TypeScript 类型。                                   |\n\n### Shared Picker Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| allowClear | `boolean \\| { clearIcon?: ReactNode }` | `false` | 显示清除按钮或自定义它。 |\n| cellRender | `CellRender<DateType>` | - | 自定义日期、时间和范围单元格。 |\n| changeOnBlur | `boolean` | - | 当有效时，提交关于模糊的键入值。 |\n| className | `string` | - | 选择器根的 className。 |\n| classNames | `SemanticClassNames` | - | 根槽和弹层槽的语义 className。 |\n| components | `Components<DateType>` | - | 组件覆盖配置。 |\n| defaultOpen | `boolean` | - | 初始弹层打开状态。 |\n| disabledDate | `DisabledDate<DateType>` | - | 禁用可选择的日期。 |\n| format | `string \\| string[] \\| FormatType<DateType>[]` | 依赖于语言环境 | 格式化并解析输入值。 |\n| generateConfig | `GenerateConfig<DateType>` | 必需的 | 日期库适配器。 |\n| getPopupContainer | `(node: HTMLElement) => HTMLElement` | - | 弹层容器。 |\n| inputReadOnly | `boolean` | - | 使输入只读。 |\n| locale | `Locale` | 必需的 | 区域设置文本和格式。 |\n| maxDate | `DateType` | - | 最晚可选日期。 |\n| minDate | `DateType` | - | 最早可选日期。 |\n| needConfirm | `boolean` | - | 更改前需要确定确认。 |\n| open | `boolean` | - | 受控弹层打开状态。 |\n| picker | `'time' \\| 'date' \\| 'week' \\| 'month' \\| 'quarter' \\| 'year'` | `date` | 选择器模式。 |\n| pickerValue | `DateType \\| [DateType, DateType] \\| null` | - | 受控面板日期。 |\n| placeholder | `string \\| [string, string]` | - | 输入框占位文本。 |\n| popupClassName | `string` | - | 弹层窗口的 className。 |\n| presets | `ValueDate<DateType>[]` | - | 预设值。 |\n| previewValue | `false \\| 'hover'` | `hover` | 预览输入中的悬停值。 |\n| showNow | `boolean` | - | 显示“现在”按钮。 |\n| showTime | `boolean \\| SharedTimeProps` | `false` | 启用时间选择。 |\n| showToday | `boolean` | - | 显示“今天”按钮。 |\n| styles | `SemanticStyles` | - | 根槽和弹层槽的语义样式。 |\n| suffix | `ReactNode` | - | 自定义后缀。 |\n| onOpenChange | `(open: boolean) => void` | - | 当弹层窗口打开状态改变时触发。 |\n| onPanelChange | `(value, mode) => void` | - | 当面板模式改变时触发。 |\n\n### Picker Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| defaultPickerValue | `DateType \\| null` | - | 弹层窗口打开时的初始面板日期。 |\n| defaultValue | `DateType \\| DateType[]` | - | 初始选中值。 |\n| multiple | `boolean` | `false` | 为支持的模式启用多重选择。 |\n| tagRender | `(props: CustomTagProps<DateType>) => ReactNode` | - | 自定义多个值标签。 |\n| value | `DateType \\| DateType[] \\| null` | - | 受控选中值。 |\n| onCalendarChange | `(date, dateString, info) => void` | - | 日历选择更改时触发。 |\n| onChange | `(date, dateString) => void` | - | 当所选值更改时触发。 |\n| onOk | `(value) => void` | - | 单击“确定”时触发。 |\n\n### RangePicker Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| allowEmpty | `boolean \\| [boolean, boolean]` | `false` | 允许空的开始值或结束值。 |\n| defaultPickerValue | `[DateType, DateType] \\| DateType \\| null` | - | 弹层窗口打开时的初始面板日期。 |\n| defaultValue | `[DateType \\| null \\| undefined, DateType \\| null \\| undefined]` | - | 初始选定范围。 |\n| disabled | `boolean \\| [boolean, boolean]` | `false` | 禁用整个范围或一侧。 |\n| order | `boolean` | `true` | 保持选定范围的顺序。 |\n| ranges | `Record<string, RangeValue \\| () => RangeValue>` | - | 已弃用预设 API。使用 `presets`。 |\n| separator | `ReactNode` | - | 范围输入之间的分隔符。 |\n| value | `[DateType \\| null \\| undefined, DateType \\| null \\| undefined] \\| null` | - | 受控选定范围。 |\n| onCalendarChange | `(dates, dateStrings, info) => void` | - | 当范围选择更改时触发。 |\n| onChange | `(dates, dateStrings) => void` | - | 当选定范围更改时触发。 |\n| onOk | `(values) => void` | - | 单击“确定”时触发。 |\n\n### Time Options\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| changeOnScroll | `boolean` | `false` | 更改滚动上的时间值。 |\n| defaultOpenValue | `DateType \\| DateType[]` | - | 选择为空时的默认时间模板。 |\n| disabledTime | `(date, range?, info?) => DisabledTimes` | - | 禁用小时、分钟、秒或毫秒。 |\n| format | `string` | - | Time format. |\n| hideDisabledOptions | `boolean` | `false` | 隐藏禁用的时间选项。 |\n| hourStep | `number` | `1` | 小时间隔。 |\n| millisecondStep | `number` | `1` | 毫秒间隔。 |\n| minuteStep | `number` | `1` | 分钟间隔。 |\n| secondStep | `number` | `1` | 秒间隔。 |\n| showHour | `boolean` | `true` | 显示小时列。 |\n| showMillisecond | `boolean` | `false` | 显示毫秒列。 |\n| showMinute | `boolean` | `true` | 显示分钟栏。 |\n| showNow | `boolean` | - | 现在显示快捷方式。 |\n| showSecond | `boolean` | `true` | 显示第二列。 |\n| use12Hours | `boolean` | `false` | 使用 12 小时制显示。 |\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run tsc\nnpm run coverage\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/picker 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1744966444485,"_cnpm_publish_time":1744966444485,"dist-tags":{"latest":"1.17.0"}}