import { defineComponent as _, computed as s, createElementBlock as n, createCommentVNode as r, openBlock as l, createElementVNode as v, toDisplayString as u, Fragment as w, renderList as b, withModifiers as g } from "vue";
import { injectState as h } from "./keys.js";
const k = {
  key: 0,
  class: "command-menu"
}, f = { key: 0 }, C = ["onClick"], V = /* @__PURE__ */ _({
  __name: "RowsCommandMenu",
  setup(R) {
    const t = h(), o = s(() => t.getSelectedRows()), d = s(() => o.value.length > 0), i = s(() => {
      var e;
      return ((e = t.settings) == null ? void 0 : e.value.onSelectedRows) ?? [];
    }), m = s(
      () => i.value.map((e) => ({
        label: e.label,
        cb: () => {
          e.cb(o.value), t.data.selectedRows.clear(), t.data.rows = [];
        }
      }))
    );
    return (e, a) => d.value ? (l(), n("div", k, [
      o.value.length ? (l(), n("span", f, u(o.value.length) + " rows selected", 1)) : r("", !0),
      a[0] || (a[0] = v("hr", null, null, -1)),
      (l(!0), n(w, null, b(m.value, (c, p) => (l(), n("span", {
        key: p,
        class: "command",
        onClick: g(c.cb, ["stop"])
      }, u(c.label), 9, C))), 128))
    ])) : r("", !0);
  }
});
export {
  V as default
};
//# sourceMappingURL=RowsCommandMenu.vue.js.map
