import { defineComponent, useAttrs, computed, resolveComponent, createBlock, openBlock, mergeProps, unref, withCtx, createVNode, createElementBlock, Fragment, renderList, renderSlot, createTextVNode, toDisplayString } from 'vue';
import { checkboxGroupProps } from './checkbox.mjs';
import './checkbox.vue.mjs';
import '../../../utils/index.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';
import _sfc_main$1 from './checkbox.vue2.mjs';

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

export { _sfc_main as default };
//# sourceMappingURL=checkbox-group.vue2.mjs.map
