element-plus
Version:
A Component Library for Vue 3
68 lines (67 loc) • 2.59 kB
TypeScript
import type { ComputedRef, ExtractPublicPropTypes, InjectionKey } from 'vue';
import type ColorPickerPanel from './color-picker-panel.vue';
import type Color from './utils/color';
export interface ColorPickerPanelProps {
/**
* @description binding value
*/
modelValue?: string | null;
/**
* @description whether the color picker is bordered
*/
border?: boolean;
/**
* @description whether to display the alpha slider
*/
showAlpha?: boolean;
/**
* @description color format of v-model
*/
colorFormat?: string;
/**
* @description whether to disable the color picker
*/
disabled?: boolean;
/**
* @description predefined color options
*/
predefine?: string[];
/**
* @description whether to trigger form validation
*/
validateEvent?: boolean;
}
/**
* @deprecated Removed after 3.0.0, Use `ColorPickerPanelProps` instead.
*/
export declare const colorPickerPanelProps: {
readonly modelValue: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown, undefined, boolean>;
readonly border: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly showAlpha: BooleanConstructor;
readonly colorFormat: StringConstructor;
readonly disabled: BooleanConstructor;
readonly predefine: {
readonly type: import("vue").PropType<string[]>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly validateEvent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
};
export declare const colorPickerPanelEmits: {
"update:modelValue": (val: string | null) => boolean;
};
/**
* @deprecated Removed after 3.0.0, Use `ColorPickerPanelProps` instead.
*/
export type ColorPickerPanelPropsPublic = ExtractPublicPropTypes<typeof colorPickerPanelProps>;
export type ColorPickerPanelEmits = typeof colorPickerPanelEmits;
export type ColorPickerPanelInstance = InstanceType<typeof ColorPickerPanel> & unknown;
export interface ColorPickerPanelContext {
currentColor: ComputedRef<string>;
}
export interface CommonColorContext {
color: Color;
}
export declare const ROOT_COMMON_COLOR_INJECTION_KEY: InjectionKey<CommonColorContext>;
export declare const colorPickerPanelContextKey: InjectionKey<ColorPickerPanelContext>;