mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
chore: sync @rc-component/color-picker@1.1.0 (#42445)
* fix: sync @rc-component/color-picker@1.1.0 * Update package.json Co-authored-by: afc163 <afc163@gmail.com> --------- Co-authored-by: lijianan <574980606@qq.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
d90c1c62c0
commit
2722850c0d
@ -1,8 +1,4 @@
|
||||
import type {
|
||||
ColorPickerPanelProps as RcColorPickerPanelProps,
|
||||
TriggerPlacement,
|
||||
TriggerType,
|
||||
} from '@rc-component/color-picker';
|
||||
import type { ColorPickerProps as RcColorPickerProps } from '@rc-component/color-picker';
|
||||
import classNames from 'classnames';
|
||||
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
||||
import type { CSSProperties } from 'react';
|
||||
@ -17,15 +13,18 @@ import ColorPickerPanel from './ColorPickerPanel';
|
||||
import type { Color } from './color';
|
||||
import ColorTrigger from './components/ColorTrigger';
|
||||
import useColorState from './hooks/useColorState';
|
||||
import type { ColorFormat, ColorPickerBaseProps, PresetsItem } from './interface';
|
||||
import type {
|
||||
ColorFormat,
|
||||
ColorPickerBaseProps,
|
||||
PresetsItem,
|
||||
TriggerPlacement,
|
||||
TriggerType,
|
||||
} from './interface';
|
||||
import useStyle from './style/index';
|
||||
import { customizePrefixCls, generateColor } from './util';
|
||||
|
||||
export interface ColorPickerProps
|
||||
extends Omit<
|
||||
RcColorPickerPanelProps,
|
||||
'onChange' | 'arrow' | 'value' | 'defaultValue' | 'children' | 'panelRender'
|
||||
> {
|
||||
extends Omit<RcColorPickerProps, 'onChange' | 'value' | 'defaultValue' | 'panelRender'> {
|
||||
value?: Color | string;
|
||||
defaultValue?: Color | string;
|
||||
children?: React.ReactNode;
|
||||
@ -37,9 +36,6 @@ export interface ColorPickerProps
|
||||
allowClear?: boolean;
|
||||
presets?: PresetsItem[];
|
||||
arrow?: boolean | { pointAtCenter: boolean };
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: CSSProperties;
|
||||
styles?: { popup?: CSSProperties };
|
||||
rootClassName?: string;
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ColorPickerPanel as RcColorPickerPanel } from '@rc-component/color-picker';
|
||||
import RcColorPicker from '@rc-component/color-picker';
|
||||
import type { FC } from 'react';
|
||||
import React from 'react';
|
||||
import Divider from '../divider';
|
||||
@ -41,7 +41,7 @@ const ColorPickerPanel: FC<ColorPickerPanelProps> = (props) => {
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<RcColorPickerPanel
|
||||
<RcColorPicker
|
||||
prefixCls={prefixCls}
|
||||
value={color?.toHsb()}
|
||||
onChange={onChange}
|
||||
|
@ -12,7 +12,15 @@ export interface PresetsItem {
|
||||
label: ReactNode;
|
||||
colors: (string | Color)[];
|
||||
}
|
||||
export type TriggerType = 'click' | 'hover';
|
||||
|
||||
export type TriggerPlacement =
|
||||
| 'top'
|
||||
| 'topLeft'
|
||||
| 'topRight'
|
||||
| 'bottom'
|
||||
| 'bottomLeft'
|
||||
| 'bottomRight';
|
||||
export interface ColorPickerBaseProps {
|
||||
color?: Color;
|
||||
prefixCls: string;
|
||||
|
@ -113,7 +113,7 @@
|
||||
"@ant-design/react-slick": "~1.0.0",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@ctrl/tinycolor": "^3.6.0",
|
||||
"@rc-component/color-picker": "~1.0.0",
|
||||
"@rc-component/color-picker": "~1.1.0",
|
||||
"@rc-component/mutate-observer": "^1.0.0",
|
||||
"@rc-component/tour": "~1.8.0",
|
||||
"@rc-component/trigger": "^1.13.0",
|
||||
|
Loading…
Reference in New Issue
Block a user