@progress/kendo-react-data-tools
Version:
Includes React Pager & React Filter component, an intuitive interface to create complex filter descriptions. KendoReact Data Tools package
32 lines (31 loc) • 1.04 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
*-------------------------------------------------------------------------------------------
*/
import { mapTree as n, extendDataItem as I } from "@progress/kendo-react-common";
const a = "groupId", d = "items", r = (t, e, s) => {
t.items && (t[a] = `${s}${s && "_"}${t.value}${t.field}`, e > 1 && t.items.forEach((c) => r(c, e - 1, t[a])));
}, f = (t) => {
const { group: e } = t;
if (e && e.length && t.data)
return t.data.forEach((s) => r(s, e.length, ""));
}, m = (t) => {
const e = [];
return n(t.data, d, (s) => {
s[a] && e.push(s[a]);
}), e;
}, E = (t) => n(
t.data,
d,
(e) => I(e, d, {
expanded: !t.collapsedIds.some((s) => s === e[a])
})
);
export {
m as getGroupIds,
E as setExpandedState,
f as setGroupIds
};