element-plus
Version:
A Component Library for Vue 3
120 lines (116 loc) • 3.1 kB
JavaScript
;
var lodashUnified = require('lodash-unified');
var runtime = require('../../../utils/vue/props/runtime.js');
var index = require('../../../hooks/use-aria/index.js');
var index$1 = require('../../../hooks/use-empty-values/index.js');
var content = require('../../tooltip/src/content.js');
var index$2 = require('../../../hooks/use-size/index.js');
var shared = require('@vue/shared');
var event = require('../../../constants/event.js');
const colorPickerProps = runtime.buildProps({
/**
* @description when color-picker inactive and persistent is false, the color panel will be destroyed
*/
persistent: {
type: Boolean,
default: true
},
/**
* @description binding value
*/
modelValue: {
type: runtime.definePropType(String),
default: void 0
},
/**
* @description ColorPicker id
*/
id: String,
/**
* @description whether to display the alpha slider
*/
showAlpha: Boolean,
/**
* @description color format of v-model
*/
colorFormat: String,
/**
* @description whether to disable the ColorPicker
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether to show clear button
*/
clearable: {
type: Boolean,
default: true
},
/**
* @description size of ColorPicker
*/
size: index$2.useSizeProp,
/**
* @description custom class name for ColorPicker's dropdown
*/
popperClass: content.useTooltipContentProps.popperClass,
/**
* @description custom style for ColorPicker's dropdown
*/
popperStyle: content.useTooltipContentProps.popperStyle,
/**
* @description ColorPicker tabindex
*/
tabindex: {
type: [String, Number],
default: 0
},
/**
* @description whether color-picker popper is teleported to the body
*/
teleported: content.useTooltipContentProps.teleported,
/**
* @description which color-picker panel appends to
*/
appendTo: content.useTooltipContentProps.appendTo,
/**
* @description predefined color options
*/
predefine: {
type: runtime.definePropType(Array)
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
...index$1.useEmptyValuesProps,
...index.useAriaProps(["ariaLabel"])
});
const colorPickerEmits = {
[event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || lodashUnified.isNil(val),
[event.CHANGE_EVENT]: (val) => shared.isString(val) || lodashUnified.isNil(val),
activeChange: (val) => shared.isString(val) || lodashUnified.isNil(val),
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true
};
const colorPickerPropsDefaults = {
persistent: true,
modelValue: void 0,
disabled: void 0,
clearable: true,
popperStyle: void 0,
tabindex: 0,
teleported: true,
validateEvent: true,
valueOnClear: void 0
};
exports.colorPickerEmits = colorPickerEmits;
exports.colorPickerProps = colorPickerProps;
exports.colorPickerPropsDefaults = colorPickerPropsDefaults;
//# sourceMappingURL=color-picker.js.map