@antscorp/antsomi-ui 1.3.5-beta.11 → 1.3.5-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -53,7 +53,7 @@ const styleContainAlpha = {
|
|
|
53
53
|
const CustomPicker = props => {
|
|
54
54
|
var _a, _b, _c, _d;
|
|
55
55
|
// Props
|
|
56
|
-
const { className, style, children, onChange, onChangeComplete, presetColors } = props, restOf = __rest(props, ["className", "style", "children", "onChange", "onChangeComplete", "presetColors"]);
|
|
56
|
+
const { className, style, children, isHideAlpha, onChange, onChangeComplete, presetColors } = props, restOf = __rest(props, ["className", "style", "children", "isHideAlpha", "onChange", "onChangeComplete", "presetColors"]);
|
|
57
57
|
// State
|
|
58
58
|
const [isShowRgbaInput, setShowRgbaInput] = useState(true);
|
|
59
59
|
const onChangeRgbaColor = (key, value) => {
|
|
@@ -101,9 +101,9 @@ const CustomPicker = props => {
|
|
|
101
101
|
React.createElement("div", { style: rgbaStyling },
|
|
102
102
|
React.createElement(InputNumberWrapper, { value: (_c = props.rgb) === null || _c === void 0 ? void 0 : _c.b, controls: false, onChange: value => onChangeRgbaColor('b', value) }),
|
|
103
103
|
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "B")),
|
|
104
|
-
React.createElement("div", { style: rgbaStyling },
|
|
104
|
+
!isHideAlpha && (React.createElement("div", { style: rgbaStyling },
|
|
105
105
|
React.createElement(InputNumberWrapper, { value: (_d = props.rgb) === null || _d === void 0 ? void 0 : _d.a, controls: false, onChange: value => onChangeRgbaColor('a', value) }),
|
|
106
|
-
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "A")))) : (React.createElement(EditableInputWrapper, null,
|
|
106
|
+
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "A"))))) : (React.createElement(EditableInputWrapper, null,
|
|
107
107
|
React.createElement(EditableInput, { value: props.color, onChange: onChange }),
|
|
108
108
|
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "HEX"))),
|
|
109
109
|
React.createElement(Button, { onClick: () => {
|
|
@@ -21,7 +21,7 @@ const styleBtnColor = {
|
|
|
21
21
|
};
|
|
22
22
|
export const ColorPicker = props => {
|
|
23
23
|
// Props
|
|
24
|
-
const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {}, } = props;
|
|
24
|
+
const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {}, isHideAlpha, } = props;
|
|
25
25
|
const { onChange = () => { } } = props;
|
|
26
26
|
// States
|
|
27
27
|
const [color, setColor] = useState(defaultColor);
|
|
@@ -74,7 +74,7 @@ export const ColorPicker = props => {
|
|
|
74
74
|
};
|
|
75
75
|
return (React.createElement(ColorPickerWrapper, { className: `antsomi-color-picker ${className || ''}`, style: style },
|
|
76
76
|
showInput && positionInput === 'left' && (React.createElement(Input, { style: { textTransform: 'uppercase' }, value: color, onChange: onChangeColorInput })),
|
|
77
|
-
React.createElement(Popover, { arrow: true, content: React.createElement(CustomPicker, { color: color, presetColors: presetColors, onChange: onChangeColorPicker, onChangeComplete: onChangeComplete }), trigger: "click", open: popoverVisible, getPopupContainer: triggerNode => triggerNode, onOpenChange: onPopoverVisibleChange },
|
|
77
|
+
React.createElement(Popover, { arrow: true, content: React.createElement(CustomPicker, { color: color, presetColors: presetColors, isHideAlpha: isHideAlpha, onChange: onChangeColorPicker, onChangeComplete: onChangeComplete }), trigger: "click", open: popoverVisible, getPopupContainer: triggerNode => triggerNode, onOpenChange: onPopoverVisibleChange },
|
|
78
78
|
React.createElement("div", { className: "antsomi-popover-button", style: styleBtnColor }, iconNode || (React.createElement("span", { style: {
|
|
79
79
|
backgroundColor: color,
|
|
80
80
|
display: 'block',
|
|
@@ -88,6 +88,7 @@ ColorPicker.defaultProps = {
|
|
|
88
88
|
className: '',
|
|
89
89
|
color: '#000000',
|
|
90
90
|
defaultColor: '#000000',
|
|
91
|
+
isHideAlpha: false,
|
|
91
92
|
onChange: () => { },
|
|
92
93
|
showInput: true,
|
|
93
94
|
positionInput: 'left',
|