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