/** * 请在 /packages/pandora-ui/src/index.ts 中导入该组件 */ import React, { CSSProperties } from 'react'; import { ColorResult } from 'react-color'; import { type ClassValue } from '../../utils/cx'; export declare type PresetColor = { color: string; title: string; } | string; export declare enum TagEnum { INPUT = "input", BUTTON = "button" } export interface InputColorProps { className?: ClassValue; size?: any; /** * */ style?: CSSProperties; /** * 占位符 */ placeholder?: string; /** * 组件展示方式,默认为input */ format: string; /** * 是否展示清除按钮,默认开启 */ clearable: boolean; /** * 浮窗类名 */ popoverClassName?: string; /** * 是否禁用 */ disabled?: boolean; /** * 浮窗位置,默认body */ container?: any; /** * 位置 */ placement?: string; /** * 默认值 */ value?: any; /** * * @param value 色值 * @returns */ onChange: (value: any) => void; /** * 预设颜色 */ presetColors?: PresetColor[]; /** * 初始化颜色 */ resetValue?: string; /** * 是否允许自定义颜色 默认true */ allowCustomColor?: boolean; /** * 快速编辑 */ quickEdit?: boolean; /** * 静态展示 */ quickStatic?: boolean; /** * 静态模式纯字符串 */ quickStaticStr?: boolean; /** * 是否允许自定义颜色 默认true */ tag: TagEnum; translate?: any; } export interface InputColorState { isOpened: boolean; isFocused: boolean; inputValue: string; } export declare class InputColor extends React.PureComponent { static contextType?: React.Context | undefined; static defaultProps: { format: string; clearable: boolean; placeholder: string; allowCustomColor: boolean; tag: TagEnum; }; state: { isOpened: boolean; isFocused: boolean; inputValue: any; }; popover: any; closeTimer: number; preview: React.RefObject; input: React.RefObject; constructor(props: InputColorProps); componentDidUpdate(prevProps: InputColorProps): void; handleFocus(): void; handleBlur(): void; focus(): void; blur(): void; open(fn?: () => void): void; close(): void; clearValue(): void; handleClick(): void; handleInputChange(e: any): void; validateColor(value: string): boolean; handleChange(color: ColorResult): void; render(): JSX.Element; } declare const _default: any; export default _default;