import { createVNode as _createVNode } from "vue";
import { CheckOutlined } from "@ant-design/icons-vue";
import { arrayType, classNames, funcType, stringType } from "@antdv/pro-utils";
import { Tooltip } from "ant-design-vue";
import { defineComponent } from "vue";
const blockCheckboxProps = {
  value: stringType().def(""),
  onChange: funcType().isRequired,
  list: arrayType(),
  configType: stringType().isRequired,
  prefixCls: stringType().isRequired,
  hashId: stringType().isRequired
};
const BlockCheckbox = defineComponent({
  name: "BlockCheckbox",
  props: blockCheckboxProps,
  setup(props) {
    return () => {
      const {
        value,
        configType,
        onChange,
        list,
        prefixCls,
        hashId
      } = props;
      const baseClassName = `${prefixCls}-block-checkbox`;
      return _createVNode("div", {
        "class": classNames(baseClassName, hashId)
      }, [(list || []).map((item) => _createVNode(Tooltip, {
        "title": item.title,
        "key": item.key
      }, {
        default: () => [_createVNode("div", {
          "class": classNames(hashId, `${baseClassName}-item`, `${baseClassName}-item-${item.key}`, `${baseClassName}-${configType}-item`),
          "onClick": () => onChange(item.key)
        }, [_createVNode(CheckOutlined, {
          "class": `${baseClassName}-selectIcon ${hashId}`.trim(),
          "style": {
            display: value === item.key ? "block" : "none"
          }
        }, null), (item == null ? void 0 : item.icon) ? _createVNode("div", {
          "class": `${baseClassName}-icon ${hashId}`.trim()
        }, [item.icon]) : null])]
      }))]);
    };
  }
});
export {
  BlockCheckbox
};
