import { defineComponent as A, useSlots as B, computed as p, Comment as S, openBlock as m, createElementBlock as u, normalizeClass as r, unref as e, withDirectives as _, createElementVNode as o, renderSlot as i, vShow as w, createTextVNode as d, toDisplayString as l, createVNode as k, withCtx as N, createCommentVNode as b } from "vue";
import { Button as V } from "@aplus-frontend/antdv";
import "../../config-provider/index.mjs";
import $ from "./style/index.mjs";
import { useNamespace as g } from "../../config-provider/hooks/use-namespace.mjs";
import { useLocale as x } from "../../config-provider/hooks/use-locale.mjs";
const D = {
  key: 0,
  class: "selected-desc"
}, E = { class: "selected-desc-conut" }, K = { class: "selected-desc-clean" }, j = /* @__PURE__ */ A({
  __name: "ApBatchAction",
  props: {
    selectedRowKeys: {},
    clearAll: {},
    showSelected: { type: Boolean, default: !0 }
  },
  setup(h) {
    const { b: a } = g("ap-batch-action"), { t: n } = x(), f = $("ap-batch-action"), s = h, y = B(), v = p(() => s.selectedRowKeys?.length || 0), C = p(() => !!y.header?.()?.some(
      (t) => t.type !== S && (typeof t.children != "string" || t.children.trim() !== "")
    ));
    return (c, t) => (m(), u("div", {
      class: r([e(a)(), e(f)])
    }, [
      _(o("div", {
        class: r(e(a)("header"))
      }, [
        i(c.$slots, "header")
      ], 2), [
        [w, C.value]
      ]),
      o("div", {
        class: r(e(a)("body"))
      }, [
        i(c.$slots, "prefix"),
        s.showSelected ? (m(), u("div", D, [
          o("div", E, [
            d(l(e(n)("ap.apBatchAction.selected")) + " ", 1),
            o("span", null, l(v.value), 1),
            d(" " + l(e(n)("ap.apBatchAction.piecesOfData")), 1)
          ]),
          o("div", K, [
            k(e(V), {
              type: "link",
              onClick: t[0] || (t[0] = (R) => s.clearAll && s.clearAll())
            }, {
              default: N(() => [
                d(l(e(n)("ap.apBatchAction.empty")), 1)
              ]),
              _: 1
            })
          ])
        ])) : b("", !0),
        i(c.$slots, "suffix")
      ], 2)
    ], 2));
  }
});
export {
  j as default
};
