"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _vue = require("vue");
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _vcColorPicker = _interopRequireDefault(require("../../vc-color-picker"));
var _context = require("../context");
var _ColorClear = _interopRequireDefault(require("./ColorClear"));
var _ColorInput = _interopRequireDefault(require("./ColorInput"));
var PanelPicker = (0, _vue.defineComponent)({
  name: 'PanelPicker',
  setup: function setup() {
    var context = (0, _context.usePanelPickerContext)();
    return function () {
      var _context$value$value;
      return (0, _vue.createVNode)(_vue.Fragment, null, [context.value.allowClear && (0, _vue.createVNode)(_ColorClear.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
        "prefixCls": context.value.prefixCls,
        "value": context.value.value,
        "colorCleared": context.value.colorCleared
      }, context.value), {}, {
        "onChange": function onChange(clearColor) {
          var _context$value$onChan, _context$value, _context$value$onClea, _context$value2;
          (_context$value$onChan = (_context$value = context.value).onChange) === null || _context$value$onChan === void 0 ? void 0 : _context$value$onChan.call(_context$value, clearColor);
          (_context$value$onClea = (_context$value2 = context.value).onClear) === null || _context$value$onClea === void 0 ? void 0 : _context$value$onClea.call(_context$value2);
        }
      }), null), (0, _vue.createVNode)(_vcColorPicker.default, {
        "prefixCls": context.value.prefixCls,
        "value": (_context$value$value = context.value.value) === null || _context$value$value === void 0 ? void 0 : _context$value$value.toHsb(),
        "onChange": function onChange(colorValue, type) {
          var _context$value$onChan2, _context$value3;
          return (_context$value$onChan2 = (_context$value3 = context.value).onChange) === null || _context$value$onChan2 === void 0 ? void 0 : _context$value$onChan2.call(_context$value3, colorValue, type, true);
        },
        "onChangeComplete": context.value.onChangeComplete
      }, null), (0, _vue.createVNode)(_ColorInput.default, context.value, null)]);
    };
  }
});
var _default = PanelPicker;
exports.default = _default;