@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
119 lines (118 loc) • 4.6 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
*-------------------------------------------------------------------------------------------
*/
"use client";
import * as c from "react";
const W = c.createContext([{}, () => {
}, {}]), gt = () => c.useContext(W), ut = (t) => {
var R, r, w, k, T, B, G, P, H, D, F, b, j, q, y, z, A, I, J, K, L, M, N, O, Q, U, V;
const {
children: X,
onEditChange: g,
onFilterChange: i,
onSortChange: l,
onSearchChange: u,
onPageChange: h,
onGroupChange: o,
onDataStateChange: s,
onSelectionChange: S,
onDetailExpandChange: C,
onGroupExpandChange: f,
onHeaderSelectionChange: x,
onColumnsStateChange: E,
onRowPinChange: m
} = t, [n, d] = c.useState({
edit: (R = t.defaultEdit) != null ? R : t.edit,
filter: (r = t.defaultFilter) != null ? r : t.filter,
highlight: t.highlight,
select: (w = t.defaultSelect) != null ? w : t.select,
search: (k = t.defaultSearch) != null ? k : t.search,
sort: (T = t.defaultSort) != null ? T : t.sort,
take: (B = t.defaultTake) != null ? B : t.take,
skip: (G = t.defaultSkip) != null ? G : t.skip,
group: (P = t.defaultGroup) != null ? P : t.group,
detailExpand: (H = t.defaultDetailExpand) != null ? H : t.detailExpand,
groupExpand: (D = t.defaultGroupExpand) != null ? D : t.groupExpand,
columnsState: (F = t.defaultColumnsState) != null ? F : t.columnsState,
pinnedTopRows: (b = t.defaultPinnedTopRows) != null ? b : t.pinnedTopRows,
pinnedBottomRows: (j = t.defaultPinnedBottomRows) != null ? j : t.pinnedBottomRows
}), Y = {
edit: (q = t.edit) != null ? q : n.edit,
filter: (y = t.filter) != null ? y : n.filter,
highlight: (z = t.highlight) != null ? z : n.highlight,
search: (A = t.search) != null ? A : n.search,
sort: (I = t.sort) != null ? I : n.sort,
take: (J = t.take) != null ? J : n.take,
skip: (K = t.skip) != null ? K : n.skip,
group: (L = t.group) != null ? L : n.group,
select: (M = t.select) != null ? M : n.select,
detailExpand: (N = t.detailExpand) != null ? N : n.detailExpand,
groupExpand: (O = t.groupExpand) != null ? O : n.groupExpand,
columnsState: (Q = t.columnsState) != null ? Q : n.columnsState,
pinnedTopRows: (U = t.pinnedTopRows) != null ? U : n.pinnedTopRows,
pinnedBottomRows: (V = t.pinnedBottomRows) != null ? V : n.pinnedBottomRows
}, Z = (e) => {
}, _ = (e) => {
d((a) => ({ ...a, edit: e.edit })), g == null || g(e);
}, $ = (e) => {
d((a) => ({ ...a, filter: e.filter })), i == null || i(e);
}, v = (e) => {
d((a) => ({ ...a, highlight: e.highlight })), t.onHighlightChange && t.onHighlightChange(e);
}, p = (e) => {
d((a) => ({ ...a, search: e.search, skip: 0 })), u == null || u(e);
}, tt = (e) => {
d((a) => ({ ...a, sort: e.sort })), l == null || l(e);
}, et = (e) => {
d((a) => ({ ...a, ...e.page })), h == null || h(e);
}, at = (e) => {
d((a) => ({ ...a, group: e.group })), o == null || o(e);
}, nt = (e) => {
d((a) => ({ ...a, ...e.dataState })), s == null || s(e);
}, dt = (e) => {
d((a) => ({ ...a, select: e.select })), S == null || S(e);
}, it = (e) => {
d((a) => ({ ...a, select: e.select })), x == null || x(e);
}, lt = (e) => {
d((a) => ({ ...a, detailExpand: e.detailExpand })), C == null || C(e);
}, ht = (e) => {
d((a) => ({ ...a, groupExpand: e.groupExpand })), f == null || f(e);
}, ot = (e) => {
d((a) => ({ ...a, columnsState: e.columnsState })), E == null || E(e);
}, ct = (e) => {
d((a) => ({ ...a, pinnedTopRows: e.pinnedTopRows, pinnedBottomRows: e.pinnedBottomRows })), m == null || m(e);
};
return /* @__PURE__ */ c.createElement(
W.Provider,
{
value: [
Y,
Z,
{
onEditChange: _,
onFilterChange: i && $,
onSearchChange: p,
onHighlightChange: v,
onSortChange: l && tt,
onPageChange: h && et,
onGroupChange: o && at,
onDataStateChange: nt,
onSelectionChange: dt,
onHeaderSelectionChange: it,
onDetailExpandChange: lt,
onGroupExpandChange: ht,
onColumnsStateChange: ot,
onRowPinChange: ct
}
]
},
X
);
};
export {
ut as GridClientStateProvider,
gt as useGridState
};