Home Reference Source Repository
import ColorPicker from 'melon-colorpicker/src/index.js'
public class | source

ColorPicker

Extends:

melon-core/InputComponent~InputComponent → ColorPicker

melon 选色器

Constructor Summary

Public Constructor
public

constructor(props: *, context: *)

Member Summary

Public Members
public

state: *

Method Summary

Public Methods
public
public

当选色器打开后,根据点击事件位置判断是都关闭选色器,点击选色器组件外关闭选择器

public

用户点击色调块(hue div)选择基本色调时的响应函数

public

点击TextBox时打开颜色选择器,当选择器打开后,再次点击关闭

public

render(): React.Element

渲染

public

renderBox(box: *): *

public

renderBoxes(boxes: *): *

Protected Methods
protected

检查用户输入的rgb是否正确

protected

用户点击了选色器下面的颜色样例后的行为

protected

当用户手动修改输入框的颜色值,旁边的颜色展示区跟着变化

protected

当用户点击饱和度(saturation)区域时,输入框和颜色展示区显示相应颜色

protected

提交所选颜色

Public Constructors

public constructor(props: *, context: *) source

Params:

NameTypeAttributeDescription
props *
context *

Public Members

public state: * source

Public Methods

public componentWillUnmount() source

public onClickAway(e: Object) source

当选色器打开后,根据点击事件位置判断是都关闭选色器,点击选色器组件外关闭选择器

Params:

NameTypeAttributeDescription
e Object

点击事件

public onHueChange(e: Object) source

用户点击色调块(hue div)选择基本色调时的响应函数

Params:

NameTypeAttributeDescription
e Object

用户点击色调块事件

public onLabelClick(e: Object) source

点击TextBox时打开颜色选择器,当选择器打开后,再次点击关闭

Params:

NameTypeAttributeDescription
e Object

点击事件

public render(): React.Element source

渲染

Return:

React.Element

public renderBox(box: *): * source

Params:

NameTypeAttributeDescription
box *

Return:

*

public renderBoxes(boxes: *): * source

Params:

NameTypeAttributeDescription
boxes *

Return:

*

Protected Methods

protected isRawInputError(color: number): boolean source

检查用户输入的rgb是否正确

Params:

NameTypeAttributeDescription
color number

页数

Return:

boolean

error 验证结果

protected onBoxClick(opt: Object) source

用户点击了选色器下面的颜色样例后的行为

Params:

NameTypeAttributeDescription
opt Object

即将验证value值的对象

protected onHexChange(e: Object) source

当用户手动修改输入框的颜色值,旁边的颜色展示区跟着变化

Params:

NameTypeAttributeDescription
e Object

即将验证value值的对象

protected onSaturationChange(e: Event) source

当用户点击饱和度(saturation)区域时,输入框和颜色展示区显示相应颜色

Params:

NameTypeAttributeDescription
e Event

事件

protected onSubmit() source

提交所选颜色