@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
41 lines (40 loc) • 1.44 kB
JavaScript
/**
* @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 a from "react";
import { GridContext as u } from "../../GridClientWrapper.mjs";
import { cloneReactElement as f } from "../../utils/index.mjs";
const x = (t) => {
const i = a.useContext(u), s = (e, o, c, C) => {
if (!i.filterChange)
return;
const l = [];
(e !== "" && e !== null || o !== "") && l.push({
field: c,
operator: o,
value: e
}), t.filter && t.filter.filters && (t.filter.filters || []).forEach((n) => {
n && n.field !== c && l.push(n);
});
const h = t.filter && t.filter.logic ? t.filter.logic : "and";
i.filterChange(l.length > 0 ? { logic: h, filters: l } : null, C);
}, d = i.getCellPositionStyle(t.column), r = t.isCustom ? {
style: { ...d }
} : {};
return i.isClient || t.isClient ? f(t.children, {
render: t.render,
onChange: (e) => {
s(e.value, e.operator, t.field, e.syntheticEvent);
},
tdProps: { ...t.tdProps, ...r },
thProps: { ...t.tdProps, ...r }
}) : f(t.children, {});
};
export {
x as GridFilterCellContainer
};