UNPKG

@progress/kendo-react-data-tools

Version:

Includes React Pager & React Filter component, an intuitive interface to create complex filter descriptions. KendoReact Data Tools package

50 lines (49 loc) 1.65 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 s from "react"; import { createFilterComponent as p } from "./FilterComponent.mjs"; import { DropDownList as u } from "@progress/kendo-react-dropdowns"; const f = "eq", m = { emptyFilter: { operator: f, value: "" }, inputComponent: (o) => null, operatorComponent: function(o, r) { const { filter: i = [], field: n } = r, e = i.find((t) => t.field === n); return /* @__PURE__ */ s.createElement( u, { ...o, value: o.data.find((t) => t.operator === (e ? e.value : "")), onChange: (t) => { if (!r.onFilterChange) return; const l = t.target.value.operator; if (l === "") { e && r.onFilterChange.call(void 0, { filter: i.filter((a) => a.field !== e.field), field: n, syntheticEvent: t.syntheticEvent }); return; } const c = e ? i.map((a) => a.field === n ? { ...e, value: l } : a) : [...i, { value: l, field: n, operator: f }]; r.onFilterChange.call(void 0, { filter: c, field: n, syntheticEvent: t.syntheticEvent }); } } ); } }; class h extends p(m) { } export { h as BooleanFilterCell };