"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _vue = require("vue");
var _util = require("../util");
var ColorClear = (0, _vue.defineComponent)({
  name: 'ColorClear',
  props: ['prefixCls', 'value', 'onChange', 'colorCleared'],
  setup: function setup(props) {
    var handleClick = function handleClick() {
      if (props.value && !props.colorCleared) {
        var _props$onChange;
        var hsba = props.value.toHsb();
        hsba.a = 0;
        var genColor = (0, _util.generateColor)(hsba);
        (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, genColor);
      }
    };
    return function () {
      return (0, _vue.createVNode)("div", {
        "class": "".concat(props.prefixCls, "-clear"),
        "onClick": handleClick
      }, null);
    };
  }
});
var _default = ColorClear;
exports.default = _default;