var c = Object.defineProperty;
var l = (t, e, s) => e in t ? c(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
var a = (t, e, s) => (l(t, typeof e != "symbol" ? e + "" : e, s), s);
import { ModelUtil as m } from "@ibiz-template/model";
import { defineComponent as d, h as i } from "vue";
import { useNamespace as p } from "@ibiz-template/vue-util";
import { PluginStaticResource as u } from "@ibiz-template/runtime";
class f {
  constructor() {
    a(this, "component", "IndexView");
  }
}
const h = d({
  name: "WFToolbar",
  props: {
    wfLinks: {
      type: Array,
      required: !0
    }
  },
  setup(t, {
    emit: e
  }) {
    const s = p("wf-toolbar"), o = async (n, r) => {
      e("wf-link-click", n, r);
    };
    return {
      ns: s,
      handleClick: async (n, r) => {
        setTimeout(() => {
          o(n, r);
        }, 30);
      }
    };
  },
  render() {
    const t = this.wfLinks || [];
    return i("div", {
      class: `${this.ns.b()}`
    }, [t.length > 0 && t.map((e) => {
      const s = e.sequenceFlowName.startsWith("驳回") || e.sequenceFlowName.startsWith("取消");
      return i("div", {
        key: e.sequenceFlowId,
        class: [this.ns.e("item"), s ? this.ns.em("item", "reject") : ""]
      }, [i("i-button", {
        attrs: {
          title: e.sequenceFlowName
        },
        on: {
          click: (o) => this.handleClick(e, o)
        }
      }, [e.sequenceFlowName || ""])]);
    })]);
  }
}), w = new u(import.meta.url);
const W = {
  mateUrl: import.meta.url,
  install(t) {
    m.getModelService().then((e) => {
      e.app.userParams.autoWidth === "true" && document.getElementsByClassName("app")[0].classList.add("auto-width");
    }), w.loadStyle(["/style.css"]), t.component("WfToolbar", h), ibiz.config.enableDataInfoBar = !1, ibiz.config.gridEditShowMode = "all", ibiz.register.view.register(
      "VIEW_CUSTOM_GsIndexCSS",
      new f()
    );
  }
};
export {
  W as default
};
