UNPKG

@progress/kendo-react-pivotgrid

Version:

React PivotGrid (also called Pivot Table) can be data-bound to an OLAP service and customized extensively. KendoReact PivotGrid package

57 lines (56 loc) 1.89 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { toTree as c, toRows as f, toColumns as h, toData as g } from "@progress/kendo-pivotgrid-common"; const S = (e, t, r) => { const n = JSON.parse(JSON.stringify(e || [])), o = JSON.parse(JSON.stringify(t || [])), s = JSON.parse(JSON.stringify(r || [])), a = c(n), [, u, i] = f(a), p = c(o), [, d, , m] = h(p); return g(s, d, u, m, i); }, w = (e = [], t = {}, r = null) => e.map((n) => { const o = { dataItem: n }; return Object.keys(t).forEach((s) => { o[s] = t[s](o, r); }), o; }), O = (e = []) => { let t = [...e]; return (e || []).forEach((r) => { t = t.concat(O(r.children)); }), t; }, y = (e = []) => { const t = /* @__PURE__ */ new Set(); return e.forEach((r) => { t.add(String(r.name)); }), Array.from(t); }, l = (e = []) => `${e.join(",")}`, J = (e, t) => `${l(e.map((r) => r.name))}|${l(t.map((r) => r.name))}`, D = (e, t, r) => { if (!e) return; let n = 0, o; const s = e.length; let a; for (; n < s; n++) a = e[n].operator, a === r && e[n].field === t && (o = e[n]); return o; }, x = (e, t, r) => { if (!e) return []; let n = 0; const o = [], s = e.length; let a; for (; n < s; n++) a = e[n].operator, (!r && a !== "in" || a === r) && e[n].field === t && o.push(e[n]); return o; }, F = (e, t) => e.uniqueName === t.uniqueName; export { F as compareFields, S as dataCells, y as extractDefaultFields, D as findFilter, x as findFilters, O as flatMap, J as generateDataKey, l as generateKey, w as recursiveMap };