mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 22:39:34 +08:00
3e5a392f73
* docs: form add color-picker demo * test: update snapshot * fix: color-picker support form * perf: optimize code logic * refactor: optimize code * test: update snapshot * test: update snap * test: update snap * chore: fix prettier * chore: fix prettier
38 lines
888 B
TypeScript
38 lines
888 B
TypeScript
import type { ReactNode } from 'react';
|
|
import type { ColorPickerProps } from './ColorPicker';
|
|
import type { Color } from './color';
|
|
|
|
export enum ColorFormat {
|
|
hex = 'hex',
|
|
rgb = 'rgb',
|
|
hsb = 'hsb',
|
|
}
|
|
|
|
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;
|
|
format?: keyof typeof ColorFormat;
|
|
allowClear?: boolean;
|
|
colorCleared?: boolean;
|
|
disabled?: boolean;
|
|
presets?: PresetsItem[];
|
|
panelRender?: ColorPickerProps['panelRender'];
|
|
onFormatChange?: ColorPickerProps['onFormatChange'];
|
|
onChangeComplete?: ColorPickerProps['onChangeComplete'];
|
|
}
|
|
|
|
export type ColorValueType = Color | string | null;
|