|
|
|
@ -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;
|
|
|
|
|