import '@das-fed/upf-ui/packages/components/custom-search-item/style.css';
import { defineComponent as p, ref as u, watchEffect as h, watch as v, openBlock as b, createElementBlock as g, createElementVNode as c, normalizeStyle as y, toDisplayString as i, createVNode as V, unref as d, mergeProps as C, normalizeClass as I, renderSlot as w } from "vue";
import { withInstall as P } from "@das-fed/upf-utils/with-install/index";
import { t as S, setI18nRule as k } from "@das-fed/upf-web/packages/i18n/index";
import { DasRadio as z } from "@das-fed/upf-ui/packages/components/radio/index";
const D = { class: "das-ui-custom-search-item" }, x = /* @__PURE__ */ p({
  __name: "Index",
  props: {
    label: { default: "" },
    defaultProps: { default: () => ({
      value: "value",
      label: "label"
    }) },
    options: { default: () => [] },
    modelValue: { default: "" },
    customerActive: { type: Boolean, default: !1 },
    labelLength: {},
    labelPosition: {}
  },
  emits: ["change", "update:modelValue"],
  setup(t, { emit: r }) {
    const o = t, s = r, a = u();
    h(() => {
      a.value = o.modelValue;
    }), v(a, (e) => {
      s("update:modelValue", e);
    });
    const m = () => {
      s("change", a.value);
    }, f = u(((e, n) => {
      if (n === "top")
        return "fit-content";
      let l = 4;
      return typeof e == "string" ? l = parseInt(e) : typeof e == "number" && (l = e), `${l * 12}px`;
    })(o.labelLength, o.labelPosition));
    return (e, n) => (b(), g("div", D, [
      c(
        "div",
        {
          class: "label",
          style: y({ width: f.value })
        },
        i(t.label) + "：",
        5
        /* TEXT, STYLE */
      ),
      V(d(z), C({
        modelValue: a.value,
        "onUpdate:modelValue": n[0] || (n[0] = (l) => a.value = l),
        optionType: "filterSquare",
        radioType: "group",
        options: t.options,
        defaultProps: t.defaultProps,
        onChange: m
      }, e.$attrs), null, 16, ["modelValue", "options", "defaultProps"]),
      c(
        "span",
        {
          class: I(["custom-label", { active: t.customerActive }])
        },
        i(d(S)("自定义")),
        3
        /* TEXT, CLASS */
      ),
      w(e.$slots, "default", {}, void 0, !0)
    ]));
  }
}), B = (t, r) => {
  const o = t.__vccOpts || t;
  for (const [s, a] of r)
    o[s] = a;
  return o;
}, E = /* @__PURE__ */ B(x, [["__scopeId", "data-v-6cc9aa34"]]), N = { 自定义: { "zh-CN": "自定义", en: "Custom", "zh-MO": "自定義", _appCode: "framework" } };
k(N);
const T = () => u(null), q = P(E);
export {
  q as DasCustomSearchItem,
  T as DasCustomSearchItemRef,
  q as default
};
