@progress/kendo-react-chart-wizard
Version:
React Chart Wizard lets you create a chart using data from a Grid, another data-bound component, or an external source
35 lines (34 loc) • 1.27 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 { getter as n } from "@progress/kendo-react-common";
import { leafColumns as k } from "@progress/kendo-react-grid";
function M(f) {
const { grid: a, data: u, selectedState: c, dataItemKey: p } = f;
if (!a)
return [];
const o = k(a.columns || []), g = n(p), y = n("field"), S = n("title"), l = new Map(u.map((t) => [String(g(t)), t])), d = new Map(Array.from(l.keys()).map((t, e) => [t, e])), h = Object.keys(c).sort((t, e) => (d.get(t) || 0) - (d.get(e) || 0)), i = [];
return h.forEach((t) => {
let e = c[t];
if (e) {
e === !0 && (e = Array.from({ length: o.length }, (r, s) => s));
const m = e.slice();
m.sort((r, s) => r - s);
const G = m.map((r) => ({
title: S(o[r]),
field: y(o[r])
}));
i.push({
dataItem: l.get(t),
dataColumns: G
});
}
}), i;
}
export {
M as getGridSelectedRows
};