diff --git a/src/components/cascader/cascader.tsx b/src/components/cascader/cascader.tsx index 6024e31174..11710b9651 100644 --- a/src/components/cascader/cascader.tsx +++ b/src/components/cascader/cascader.tsx @@ -50,6 +50,20 @@ export type CascaderProps = { onTabsChange?: (index: number) => void activeIcon?: ReactNode fieldNames?: FieldNamesType + classNames?: { + popup?: { + root?: string + mask?: string + body?: string + } + } + styles?: { + popup?: { + root?: React.CSSProperties + mask?: React.CSSProperties + body?: React.CSSProperties + } + } } & Pick< PopupProps, | 'getContainer' @@ -79,6 +93,10 @@ export const Cascader = forwardRef((p, ref) => { }, p ) + const { + classNames: { popup: popupClassNames = {} } = {}, + styles: { popup: popupStyles = {} } = {}, + } = props const [visible, setVisible] = usePropsValue({ value: props.visible, @@ -166,6 +184,12 @@ export const Cascader = forwardRef((p, ref) => { const popupElement = ( { diff --git a/src/components/cascader/index.en.md b/src/components/cascader/index.en.md index 78100ec70f..9304304add 100644 --- a/src/components/cascader/index.en.md +++ b/src/components/cascader/index.en.md @@ -37,6 +37,7 @@ type CascaderValueExtend = { | activeIcon | The icon displayed when selected | `ReactNode` | - | | cancelText | Text of the cancel button | `ReactNode` | `'取消'` | | children | Render function of the selected options | `(items: CascaderOption[], actions: CascaderActions) => ReactNode` | - | +| classNames | Semantic structure class | `{ popup?: { root?: string; mask?: string; body?: string } }` | - | | confirmText | Text of the ok button | `ReactNode` | `'确定'` | | defaultValue | Default selected options | `CascaderValue[]` | `[]` | | destroyOnClose | Destroy `dom` when not visible | `boolean` | `true` | @@ -48,6 +49,7 @@ type CascaderValueExtend = { | onTabsChange | Callback when switching panel | `(index: number) => void` | - | | options | Data of the cascade options | `CascaderOption[]` | - | | placeholder | Hint text | `string` | `'请选择'` | +| styles | Semantic structure style | `{ popup?: { root?: React.CSSProperties; mask?: React.CSSProperties; body?: React.CSSProperties } }` | - | | title | Title | `ReactNode` | - | | value | Selected options | `CascaderValue[]` | - | | visible | Whether to show or hide the Picker | `boolean` | `false` | diff --git a/src/components/cascader/index.zh.md b/src/components/cascader/index.zh.md index 9310cb7bd1..66db5e9d85 100644 --- a/src/components/cascader/index.zh.md +++ b/src/components/cascader/index.zh.md @@ -37,6 +37,7 @@ type CascaderValueExtend = { | activeIcon | 选中图标 | `ReactNode` | - | | cancelText | 取消按钮的文字 | `ReactNode` | `'取消'` | | children | 所选项的渲染函数 | `(items: CascaderOption[], actions: CascaderActions) => ReactNode` | - | +| classNames | 语义化类名 | `{ popup?: { root?: string; mask?: string; body?: string } }` | - | | confirmText | 确定按钮的文字 | `ReactNode` | `'确定'` | | defaultValue | 默认选中项 | `CascaderValue[]` | `[]` | | destroyOnClose | 不可见时是否销毁 `DOM` 结构 | `boolean` | `true` | @@ -48,6 +49,7 @@ type CascaderValueExtend = { | onTabsChange | 切换面板的回调 | `(index: number) => void` | - | | options | 级联数据 | `CascaderOption[]` | - | | placeholder | 未选中时的提示文案 | `string` | `'请选择'` | +| styles | 语义化样式 | `{ popup?: { root?: React.CSSProperties; mask?: React.CSSProperties; body?: React.CSSProperties } }` | - | | title | 标题 | `ReactNode` | - | | value | 选中项 | `CascaderValue[]` | - | | visible | 是否显示级联选择 | `boolean` | `false` |