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