UNPKG

@progress/kendo-react-grid

Version:

React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package

88 lines (87 loc) 2.66 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use client"; import * as n from "react"; import { DropDownList as m } from "@progress/kendo-react-dropdowns"; import { TextBox as h, NumericTextBox as s } from "@progress/kendo-react-inputs"; import { DatePicker as f } from "@progress/kendo-react-dateinputs"; import { cellOperatorChange as x, cellInputChange as E, cellBoolDropdownChange as b } from "../filterCommon.mjs"; import { GridContext as p } from "../utils/GridContext.mjs"; const w = (e) => { const o = n.useContext(p), d = () => { if (e.filterType === "boolean") return; const t = e.operators.find((r) => r.operator === e.operator) || null; return /* @__PURE__ */ n.createElement( m, { adaptive: o.adaptive, size: o.mobileMode ? "large" : "medium", value: t, onChange: c, data: e.operators, textField: "text" } ); }, i = (t) => { E(t.value, t.syntheticEvent, e); }, c = (t) => { x(t, e.value, e.onChange); }, u = (t) => { b(t, e.onChange); }, g = (t, r, l) => { switch (t) { case "numeric": return /* @__PURE__ */ n.createElement( s, { value: r, size: o.mobileMode ? "large" : "medium", onChange: i, rangeOnEnter: !1 } ); case "date": return /* @__PURE__ */ n.createElement( f, { value: r, size: o.mobileMode ? "large" : "medium", onChange: i } ); case "boolean": { const C = (a) => a == null; return /* @__PURE__ */ n.createElement( m, { adaptive: o.adaptive, onChange: u, size: o.mobileMode ? "large" : "medium", value: l.find((a) => a.operator === (C(r) ? "" : r)), data: l, textField: "text" } ); } default: return /* @__PURE__ */ n.createElement( h, { size: o.mobileMode ? "large" : "medium", value: r || "", onChange: i } ); } }; return /* @__PURE__ */ n.createElement(n.Fragment, null, d(), g(e.filterType, e.value, e.booleanValues)); }; export { w as GridColumnMenuFilterCell };