UNPKG

@progress/kendo-vue-data-tools

Version:
88 lines (87 loc) 2.47 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as i, createVNode as r } from "vue"; import { DropDownList as a } from "@progress/kendo-vue-dropdowns"; import { NumericTextBox as u } from "@progress/kendo-vue-inputs"; import { DatePicker as s } from "@progress/kendo-vue-dateinputs"; import { cellBoolDropdownChange as p, cellInputChange as h } from "../filterCommon.mjs"; const C = /* @__PURE__ */ i({ props: { field: String, filterType: String, value: [Object, String, Number, Date, Boolean], operator: String, operators: Array, booleanValues: Array }, emits: { change: null, filtercellfocus: null }, methods: { handleFocus(t) { this.$emit("filtercellfocus", t); }, triggerChange(t) { this.$emit("change", t); }, inputChange(t, n) { const o = h(t, n, this.$props); this.triggerChange(o); }, boolDropdownChange(t, n) { const o = p(t.value.operator, n); this.triggerChange(o); } }, render() { const { filterType: t, value: n, booleanValues: o } = this.$props; let l; switch (t) { case "numeric": return r(u, { value: n, onChange: (e) => { this.inputChange(e.value, e.event); } }, null); case "date": return r(s, { value: n, onFocus: this.handleFocus, onChange: (e) => { this.inputChange(e.value, e.event); } }, null); case "boolean": return l = (e) => e == null, r(a, { onChange: this.boolDropdownChange, value: o.find((e) => e.operator === (l(n) ? "" : n)), "data-items": o, textField: "text" }, null); default: return r("span", { class: "k-textbox k-input k-input-md k-rounded-md k-input-solid" }, [r("input", { class: "k-input-inner", value: n || "", onInput: (e) => { this.inputChange(e.target.value, e); } }, null)]); } } }); export { C as ColumnMenuFilterCell };