import { defineComponent, computed, h } from 'vue';
import { getVnodesByGmName } from './tableHelper.mjs';

var TableOperateVNodeRenderer = /* @__PURE__ */ defineComponent({
  functional: true,
  props: {
    // 当前原始vnode vue模板中的attribute
    vnode: {
      type: [Object, Array],
      required: true
    },
    // 当前要重新覆盖掉的 props
    customPropsList: {
      type: Array,
      default: () => []
    }
  },
  setup(props) {
    const vnodes = computed(() => {
      return getVnodesByGmName(Array.isArray(props.vnode) ? props.vnode : [props.vnode], "GmOperateButton");
    });
    const res = computed(() => props.customPropsList.filter((props2) => props2.isShow).map((props2) => {
      const findVnode = vnodes.value.find((it) => it.props.prop === props2.prop);
      if (findVnode) {
        findVnode.props = {
          ...findVnode.props ?? {},
          label: props2.label,
          type: props2.type
        };
      }
      return findVnode;
    }));
    const render = computed(() => {
      return res.value.map((it) => it && h(it));
    });
    return () => render.value;
  }
});

export { TableOperateVNodeRenderer as default };
//# sourceMappingURL=TableOperateVNodeRenderer.mjs.map
