/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var VueCompositionAPI = require('@vue/composition-api');
var components_colorPicker_props = require('../props.js');
var constants = require('../../../chunks/constants.js');
var components_radio_index = require('../../radio/index.js');
var components_colorPicker_hooks_index = require('../hooks/index.js');
require('../../../utils/map-props.js');
require('vue');
require('../../../utils/with-install.js');
require('lodash');
require('../../../config.js');
require('../../radio/radio.js');
require('../../../chunks/helper.js');
require('../../../utils/helper.js');
require('lodash/camelCase');
require('../../../utils/render-node.js');
require('../../../utils/event.js');
require('../../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../../config-provider/context.js');
require('../../../chunks/zh_CN.js');
require('../../../utils/mixins.js');
require('../../radio/props.js');
require('../../radio/group.js');
require('lodash/isString');
require('lodash/isNumber');
require('../../radio/radio-button.js');
require('../../../hooks/use-config.js');
require('../../config-provider/useConfig.js');

var PanelHeader = VueCompositionAPI.defineComponent({
  name: "PanelHeader",
  components: {
    LRadioGroup: components_radio_index.RadioGroup,
    LRadioButton: components_radio_index.RadioButton
  },
  props: {
    ...components_colorPicker_props["default"],
    mode: {
      type: String,
      default: "color"
    },
    togglePopup: {
      type: Function
    },
    handleModeChange: {
      type: Function,
      default: () => () => {}
    }
  },
  setup(props2) {
    const baseClassName = components_colorPicker_hooks_index.useBaseClassName();
    const modeValue = VueCompositionAPI.ref(props2.mode);
    VueCompositionAPI.watch(() => props2.mode, v => {
      modeValue.value = v;
    });
    return {
      baseClassName,
      modeValue
    };
  },
  render() {
    var _this$colorModes, _this$colorModes2;
    const h = arguments[0];
    if (((_this$colorModes = this.colorModes) === null || _this$colorModes === void 0 ? void 0 : _this$colorModes.length) === 1) return null;
    const {
      baseClassName
    } = this;
    return h("div", {
      "class": `${baseClassName}__head`
    }, [h("div", {
      "class": `${baseClassName}__mode`
    }, [((_this$colorModes2 = this.colorModes) === null || _this$colorModes2 === void 0 ? void 0 : _this$colorModes2.length) === 1 ? constants.COLOR_MODES[this.colorModes[0]] : h("l-radio-group", {
      "attrs": {
        "variant": "default-filled",
        "size": "small"
      },
      "on": {
        "change": this.handleModeChange
      },
      "model": {
        value: this.modeValue,
        callback: $$v => {
          this.modeValue = $$v;
        }
      }
    }, [Object.keys(constants.COLOR_MODES).map(key => h("l-radio-button", {
      "key": key,
      "attrs": {
        "value": key
      }
    }, [constants.COLOR_MODES[key]]))])])]);
  }
});

exports["default"] = PanelHeader;
//# sourceMappingURL=header.js.map
