mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat: inputColor 支持配置弹层选择器
This commit is contained in:
parent
655e554613
commit
4a677ed823
@ -84,11 +84,12 @@ List 的内容、Card 卡片的内容配置同上
|
||||
|
||||
## 属性表
|
||||
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
| ------------ | --------- | ------ | -------------------------------------------------------------------------------------- |
|
||||
| type | `string` | | 如果在 Table、Card 和 List 中,为`"color"`;在 Form 中用作静态展示,为`"static-color"` |
|
||||
| className | `string` | | 外层 CSS 类名 |
|
||||
| value | `string` | | 显示的颜色值 |
|
||||
| name | `string` | | 在其他组件中,时,用作变量映射 |
|
||||
| defaultColor | `string` | | 默认颜色值 |
|
||||
| showValue | `boolean` | `true` | 是否显示右边的颜色值 |
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
| ------------------------ | --------- | ------ | -------------------------------------------------------------------------------------- | ------- |
|
||||
| type | `string` | | 如果在 Table、Card 和 List 中,为`"color"`;在 Form 中用作静态展示,为`"static-color"` |
|
||||
| className | `string` | | 外层 CSS 类名 |
|
||||
| value | `string` | | 显示的颜色值 |
|
||||
| name | `string` | | 在其他组件中,时,用作变量映射 |
|
||||
| defaultColor | `string` | | 默认颜色值 |
|
||||
| showValue | `boolean` | `true` | 是否显示右边的颜色值 |
|
||||
| popOverContainerSelector | `string` | | 弹层挂载位置选择器,会通过`querySelector`获取 | `6.4.2` |
|
||||
|
@ -342,6 +342,8 @@ export class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
|
||||
? null
|
||||
: React.isValidElement(schema.children)
|
||||
? schema.children
|
||||
: typeof schema.children !== 'function'
|
||||
? null
|
||||
: (schema.children as Function)({
|
||||
...rest,
|
||||
...exprProps,
|
||||
|
@ -27,6 +27,7 @@ export interface ColorProps extends LocaleProps, ThemeProps {
|
||||
popoverClassName?: string;
|
||||
disabled?: boolean;
|
||||
popOverContainer?: any;
|
||||
popOverContainerSelector?: string;
|
||||
placement?: string;
|
||||
value?: any;
|
||||
onChange: (value: any) => void;
|
||||
@ -243,6 +244,7 @@ export class ColorControl extends React.PureComponent<
|
||||
placeholder,
|
||||
disabled,
|
||||
popOverContainer,
|
||||
popOverContainerSelector,
|
||||
format,
|
||||
clearable,
|
||||
placement,
|
||||
@ -313,6 +315,7 @@ export class ColorControl extends React.PureComponent<
|
||||
target={() => findDOMNode(this)}
|
||||
onHide={this.close}
|
||||
container={popOverContainer || (() => findDOMNode(this))}
|
||||
containerSelector={popOverContainerSelector}
|
||||
rootClose={false}
|
||||
show
|
||||
>
|
||||
|
@ -46,6 +46,10 @@ export interface InputColorControlSchema extends FormBaseControlSchema {
|
||||
* 是否允许用户输入颜色。
|
||||
*/
|
||||
allowCustomColor?: boolean;
|
||||
/**
|
||||
* 弹窗容器选择器
|
||||
*/
|
||||
popOverContainerSelector?: string;
|
||||
}
|
||||
|
||||
export interface ColorProps
|
||||
|
Loading…
Reference in New Issue
Block a user