import { defineComponent, useAttrs, ref, resolveComponent, createBlock, openBlock, mergeProps, unref, createSlots, withCtx, createElementBlock, renderSlot, toDisplayString, renderList, normalizeProps, guardReactiveProps } from 'vue';
import '../../../utils/index.mjs';
import { checkboxProps } from './checkbox.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';

"use strict";
const _hoisted_1 = { key: 0 };
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlCheckbox" },
  __name: "checkbox",
  props: checkboxProps,
  setup(__props, { expose: __expose }) {
    const attrs = useAttrs();
    const bem = createNamespace("checkbox");
    const checkboxRef = ref();
    const blur = () => {
      checkboxRef.value.blur();
    };
    const focus = () => {
      checkboxRef.value.focus();
    };
    __expose({
      blur,
      focus
    });
    return (_ctx, _cache) => {
      const _component_a_checkbox = resolveComponent("a-checkbox");
      return openBlock(), createBlock(_component_a_checkbox, mergeProps({
        ref_key: "checkboxRef",
        ref: checkboxRef
      }, unref(attrs), {
        class: unref(bem).b()
      }), createSlots({
        default: withCtx(() => [
          _ctx.checkboxLabel ? (openBlock(), createElementBlock(
            "span",
            _hoisted_1,
            toDisplayString(_ctx.checkboxLabel),
            1
            /* TEXT */
          )) : renderSlot(_ctx.$slots, "default", { key: 1 })
        ]),
        _: 2
        /* DYNAMIC */
      }, [
        renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (item) => {
          return {
            name: item,
            fn: withCtx((data) => [
              renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
            ])
          };
        })
      ]), 1040, ["class"]);
    };
  }
});

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