ant-design/components/color-picker/interface.ts
红果汁 3e5a392f73
docs: Form add ColorPicker demo (#42880)
* 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
2023-07-12 10:15:04 +08:00

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;