'use strict';

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

var vue = require('vue');
var checkbox = require('./checkbox.js');
require('./checkbox.vue.js');
require('../../../utils/index.js');
var createNamespace = require('../../../utils/create-namespace.js');
var checkbox_vue_vue_type_script_setup_true_lang = require('./checkbox.vue2.js');

"use strict";
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlCheckboxGroup" },
  __name: "checkbox-group",
  props: checkbox.checkboxGroupProps,
  setup(__props) {
    const props = __props;
    const bem = createNamespace.createNamespace("checkbox-group");
    const attrs = vue.useAttrs();
    const groupDirection = vue.computed(
      () => props.direction === "vertical" ? "vertical" : "horizontal"
    );
    const itemSpace = vue.computed(() => ({
      gap: props.itemSpace + "px"
    }));
    return (_ctx, _cache) => {
      const _component_a_col = vue.resolveComponent("a-col");
      const _component_a_row = vue.resolveComponent("a-row");
      const _component_a_checkbox_group = vue.resolveComponent("a-checkbox-group");
      return props.useGrid ? (vue.openBlock(), vue.createBlock(_component_a_checkbox_group, vue.mergeProps({
        key: 0,
        class: [vue.unref(bem).b(), vue.unref(bem).is("use-grid")]
      }, vue.unref(attrs)), {
        default: vue.withCtx(() => [
          vue.createVNode(_component_a_row, vue.mergeProps({
            gutter: [_ctx.gutterHorizontal, _ctx.gutterVertical]
          }, props.rowOptions), {
            default: vue.withCtx(() => [
              (vue.openBlock(true), vue.createElementBlock(
                vue.Fragment,
                null,
                vue.renderList(props.options, (item, idx) => {
                  return vue.openBlock(), vue.createBlock(_component_a_col, vue.mergeProps({ ref_for: true }, item.colOptions, {
                    key: idx,
                    span: item.span || props.allSpan
                  }), {
                    default: vue.withCtx(() => [
                      vue.createVNode(
                        checkbox_vue_vue_type_script_setup_true_lang.default,
                        vue.mergeProps({ ref_for: true }, item),
                        {
                          default: vue.withCtx(() => [
                            vue.renderSlot(_ctx.$slots, "label", vue.mergeProps({ ref_for: true }, item), () => [
                              vue.createTextVNode(
                                vue.toDisplayString(item.label),
                                1
                                /* TEXT */
                              )
                            ])
                          ]),
                          _: 2
                          /* DYNAMIC */
                        },
                        1040
                        /* FULL_PROPS, DYNAMIC_SLOTS */
                      )
                    ]),
                    _: 2
                    /* DYNAMIC */
                  }, 1040, ["span"]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ]),
            _: 3
            /* FORWARDED */
          }, 16, ["gutter"])
        ]),
        _: 3
        /* FORWARDED */
      }, 16, ["class"])) : (vue.openBlock(), vue.createBlock(_component_a_checkbox_group, vue.mergeProps({
        key: 1,
        class: [vue.unref(bem).b(), vue.unref(bem).is(groupDirection.value)],
        options: props.options,
        style: itemSpace.value
      }, vue.unref(attrs)), null, 16, ["class", "options", "style"]));
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=checkbox-group.vue2.js.map
