import { defineComponent as _, computed as n, createElementBlock as l, createCommentVNode as u, openBlock as o, createElementVNode as C, toDisplayString as m, Fragment as v, 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 }, y = ["onClick"], B = /* @__PURE__ */ _({
  __name: "ColumnsCommandMenu",
  setup(S) {
    const s = h(), t = n(() => s.getSelectedColumns()), r = n(() => t.value.length > 0), i = n(() => {
      var e;
      return ((e = s.settings) == null ? void 0 : e.value.onSelectedColumns) ?? [];
    }), d = n(
      () => i.value.map((e) => ({
        label: e.label,
        cb: () => {
          e.cb(t.value), s.data.selectedColumns.clear();
        }
      }))
    );
    return (e, a) => r.value ? (o(), l("div", k, [
      t.value.length ? (o(), l("span", f, "selected columns " + m(t.value.length), 1)) : u("", !0),
      a[0] || (a[0] = C("hr", null, null, -1)),
      (o(!0), l(v, null, b(d.value, (c, p) => (o(), l("span", {
        key: p,
        class: "command",
        onClick: g(c.cb, ["stop"])
      }, m(c.label), 9, y))), 128))
    ])) : u("", !0);
  }
});
export {
  B as default
};
//# sourceMappingURL=ColumnsCommandMenu.vue.js.map
