import { defineComponent as f, computed as d, createElementBlock as h, openBlock as r, normalizeClass as c, createVNode as V, withDirectives as k, createBlock as v, createCommentVNode as y, unref as s, createElementVNode as b, vModelText as B, withModifiers as C } from "vue";
import M from "../PlIcon16/PlIcon16.vue.js";
import E from "../PlIcon24/PlIcon24.vue.js";
const N = ["disabled", "placeholder"], F = /* @__PURE__ */ f({
  __name: "PlSearchField",
  props: {
    modelValue: {},
    clearable: { type: Boolean },
    placeholder: {},
    disabled: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(e, { emit: m }) {
    const t = m, a = e, o = d({
      get() {
        return a.modelValue ?? "";
      },
      set(l) {
        t("update:modelValue", l);
      }
    }), i = d(() => !!a.modelValue), u = () => t("update:modelValue", "");
    return (l, n) => (r(), h("div", {
      ref: "root",
      class: c(["pl-search-field", [l.$style.component]])
    }, [
      V(s(E), { name: "search" }),
      k(b("input", {
        ref: "input",
        "onUpdate:modelValue": n[0] || (n[0] = (p) => o.value = p),
        disabled: e.disabled,
        placeholder: e.placeholder || "Find...",
        type: "text",
        spellcheck: "false"
      }, null, 8, N), [
        [B, o.value]
      ]),
      e.clearable && i.value ? (r(), v(s(M), {
        key: 0,
        class: c(l.$style.clear),
        name: "delete-clear",
        onClick: C(u, ["stop"])
      }, null, 8, ["class"])) : y("", !0)
    ], 2));
  }
});
export {
  F as default
};
//# sourceMappingURL=PlSearchField.vue2.js.map
