import { computed as s, unref as p } from "vue";
import { noRenderAsFormItemValueList as l } from "../../ap-table/constants.mjs";
import { getColumnOrder as t, updateFormProps as u, getFieldProps as i, getSearchFormItemRenderNode as m } from "../../ap-table/utils.mjs";
import "../../config-provider/index.mjs";
import { useGlobalConfig as f } from "../../config-provider/hooks/use-global-config.mjs";
const P = (a) => {
  let d = 0;
  const n = f("valueTypeMap");
  return s(() => (d++, a.columns?.filter(
    (e) => !e.hideInSearch && (e.field ?? e.dataIndex ?? e.key) && (e.valueType || e.customRenderFormItem) && !l.includes(e.valueType)
  )?.sort((e, o) => {
    const r = t(e.order);
    return t(o.order) - r;
  })?.map((e) => {
    const o = u(
      e,
      i(e.fieldProps, {})
    ), r = {
      ...e,
      fieldProps: {
        label: e.title,
        name: e.field ?? e.dataIndex ?? e.key,
        // tips: 在表格中的查询表单项默认是带边框的
        bordered: !0,
        ...o || {},
        _signal: d
      },
      renderNode: void 0
    };
    return r.renderNode = m(
      r,
      p(n)
    ), r;
  }) || []));
};
export {
  P as useSearchForm
};
