@progress/kendo-vue-grid
Version:
62 lines (61 loc) • 1.93 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as g, createVNode as t, mergeProps as m, inject as o, computed as n } from "vue";
import { TextBox as p } from "@progress/kendo-vue-inputs";
import { KendoKey as f } from "./key.mjs";
import { getStringFromSearch as S } from "@progress/kendo-vue-data-tools";
import { Icon as x } from "@progress/kendo-vue-common";
import { searchIcon as C } from "@progress/kendo-svg-icons";
const K = /* @__PURE__ */ g({
name: "KendoVueGridSearchBox",
inheritAttrs: !1,
props: {
onChange: Function,
className: String,
placeholder: String
},
setup(r, {
emit: c
}) {
const h = o("kendoLocalizationService", {}), {
searchChange: a
} = o("kendo", {}), {
search: i
} = o(f, {}), s = (e) => {
a && a(e), c("change", e), r.onChange && r.onChange.call(void 0, e);
}, l = n(() => S(i.value)), d = n(() => ({
"k-grid-search": !0,
"k-searchbox": !0
})), u = n(() => {
const e = h;
return e != null && e.toLanguageString ? e.toLanguageString("searchboxPlaceholder", "Search...") : r.placeholder || "Search...";
});
return {
handleChange: s,
value: l,
rootClassName: d,
placeholder: u
};
},
render() {
return t(p, m({
placeholder: this.placeholder,
value: this.value,
prefix: () => t(x, {
name: "search",
icon: C
}, null)
}, this.$attrs, {
wrapperClass: "k-grid-search k-searchbox",
onInput: this.handleChange
}), null);
}
});
export {
K as GridSearchBox
};