import { defineComponent as p, computed as o, openBlock as c, createBlock as v, mergeProps as i, unref as r, withCtx as y, createVNode as h } from "vue";
import { isValid as n } from "@aplus-frontend/utils";
import { omit as u } from "lodash-unified";
import { useInjectForm as B } from "../../ap-form/context.mjs";
import { getModelValue as b } from "../../ap-form/utils/get.mjs";
import "../../ap-form/item/index.vue2.mjs";
import "./index.vue2.mjs";
import g from "../../ap-form/item/index.vue.mjs";
import V from "./index.vue.mjs";
const P = /* @__PURE__ */ p({
  name: "ApFormItemBatchInputGroup",
  __name: "form-item",
  props: {
    htmlFor: {},
    prefixCls: {},
    label: {},
    help: {},
    extra: {},
    labelCol: {},
    wrapperCol: {},
    hasFeedback: { type: Boolean, default: !1 },
    colon: { type: Boolean, default: void 0 },
    labelAlign: {},
    prop: {},
    name: {},
    rules: {},
    autoLink: { type: Boolean, default: !0 },
    required: { type: Boolean, default: void 0 },
    validateFirst: { type: Boolean, default: void 0 },
    validateStatus: {},
    validateTrigger: {},
    messageVariables: {},
    hidden: { type: Boolean },
    noStyle: { type: Boolean },
    tooltip: {},
    span: {},
    order: {},
    offset: {},
    push: {},
    pull: {},
    xs: {},
    sm: {},
    md: {},
    lg: {},
    xl: {},
    xxl: {},
    flex: {},
    bordered: { type: Boolean, default: !1 },
    valuePropName: {},
    initialValue: {},
    _signal: {},
    transform: {},
    description: {},
    customFilled: {},
    disabled: { type: Boolean, default: void 0 },
    autoFocus: { type: Boolean },
    field: { default: () => ({}) },
    placeholer: {},
    trim: { type: Boolean, default: !0 },
    defaultSelectedAllKey: { type: Boolean }
  },
  setup(a) {
    const e = a, { internalInstance: d } = B(), s = o(() => e?.transform || {
      flat: !1,
      transformer: (t) => {
        if (t)
          return !t?.value || t?.value?.length < 1 ? void 0 : e?.field?.options ? {
            ...t,
            value: t?.value?.filter((l) => n(l?.trim()))?.map((l) => e.trim ? l?.trim() : l)
          } : t?.value?.filter((l) => n(l?.trim()))?.map((l) => e.trim ? l?.trim() : l);
      }
    }), f = o(() => e.field?.style || "width:auto"), m = o(() => {
      if (e.initialValue)
        return e.initialValue;
      const t = d?.getInitialValues();
      if (!b(t, e.name))
        return e.field.hasAll === !1 ? {
          key: [e?.field?.options?.[0]?.value]
        } : {
          key: e?.field?.options?.map((l) => l.value)
        };
    });
    return (t, l) => (c(), v(g, i(
      r(u)(e, [
        "field",
        "initialValue",
        "transform",
        "placeholder",
        "disabled"
      ]),
      {
        "initial-value": m.value,
        transform: s.value,
        bordered: a.field?.options?.length ? !1 : a.bordered
      }
    ), {
      default: y(() => [
        h(V, i(r(u)(e.field, ["style"]), {
          style: f.value,
          disabled: a.disabled,
          placeholer: a.placeholer
        }), null, 16, ["style", "disabled", "placeholer"])
      ]),
      _: 1
    }, 16, ["initial-value", "transform", "bordered"]));
  }
});
export {
  P as default
};
