From 74a1782976a931672f3dcb76a1568f3101178554 Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Thu, 28 Nov 2024 11:05:53 +0800 Subject: [PATCH] type: update key type (#51807) --- components/color-picker/index.en-US.md | 2 +- components/color-picker/index.zh-CN.md | 2 +- components/color-picker/interface.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/color-picker/index.en-US.md b/components/color-picker/index.en-US.md index f6cfdef3c3..23217bdbaa 100644 --- a/components/color-picker/index.en-US.md +++ b/components/color-picker/index.en-US.md @@ -54,7 +54,7 @@ Common props ref:[Common props](/docs/react/common-props) | format | Format of color | `rgb` \| `hex` \| `hsb` | `hex` | | | mode | Configure single or gradient color | `'single' \| 'gradient' \| ('single' \| 'gradient')[]` | `single` | 5.20.0 | | open | Whether to show popup | boolean | - | | -| presets | Preset colors | `{ label: ReactNode, colors: Array, defaultOpen?: boolean, key: React.Key }[]` | - | `defaultOpen: 5.11.0, key: 5.23.0` | +| presets | Preset colors | `{ label: ReactNode, colors: Array, defaultOpen?: boolean, key?: React.Key }[]` | - | `defaultOpen: 5.11.0, key: 5.23.0` | | placement | Placement of popup | The design of the [placement](/components/tooltip/#api) parameter is the same as the `Tooltips` component. | `bottomLeft` | | | panelRender | Custom Render Panel | `(panel: React.ReactNode, extra: { components: { Picker: FC; Presets: FC } }) => React.ReactNode` | - | 5.7.0 | | showText | Show color text | boolean \| `(color: Color) => React.ReactNode` | - | 5.7.0 | diff --git a/components/color-picker/index.zh-CN.md b/components/color-picker/index.zh-CN.md index 06524deca6..d8d653386a 100644 --- a/components/color-picker/index.zh-CN.md +++ b/components/color-picker/index.zh-CN.md @@ -55,7 +55,7 @@ group: | format | 颜色格式 | `rgb` \| `hex` \| `hsb` | `hex` | | | mode | 选择器模式,用于配置单色与渐变 | `'single' \| 'gradient' \| ('single' \| 'gradient')[]` | `single` | 5.20.0 | | open | 是否显示弹出窗口 | boolean | - | | -| presets | 预设的颜色 | `{ label: ReactNode, colors: Array, defaultOpen?: boolean, key: React.Key }[]` | - | `defaultOpen: 5.11.0, key: 5.23.0` | +| presets | 预设的颜色 | `{ label: ReactNode, colors: Array, defaultOpen?: boolean, key?: React.Key }[]` | - | `defaultOpen: 5.11.0, key: 5.23.0` | | placement | 弹出窗口的位置 | 同 `Tooltips` 组件的 [placement](/components/tooltip-cn/#api) 参数设计 | `bottomLeft` | | | panelRender | 自定义渲染面板 | `(panel: React.ReactNode, extra: { components: { Picker: FC; Presets: FC } }) => React.ReactNode` | - | 5.7.0 | | showText | 显示颜色文本 | boolean \| `(color: Color) => React.ReactNode` | - | 5.7.0 | diff --git a/components/color-picker/interface.ts b/components/color-picker/interface.ts index 3523b94c43..d213c8c712 100644 --- a/components/color-picker/interface.ts +++ b/components/color-picker/interface.ts @@ -38,7 +38,7 @@ export interface PresetsItem { * The key of the panel * @since 5.23.0 */ - key: React.Key; + key?: React.Key; } export type TriggerType = 'click' | 'hover';