UNPKG

@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

9 lines (8 loc) 1.12 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@progress/kendo-react-common"),h=require("@progress/kendo-react-grid");function w(g){const{grid:c,data:m,selectedState:a,dataItemKey:f}=g;if(!c)return[];const o=h.leafColumns(c.columns||[]),S=n.getter(f),p=n.getter("field"),y=n.getter("title"),l=new Map(m.map(e=>[String(S(e)),e])),d=new Map(Array.from(l.keys()).map((e,t)=>[e,t])),G=Object.keys(a).sort((e,t)=>(d.get(e)||0)-(d.get(t)||0)),i=[];return G.forEach(e=>{let t=a[e];if(t){t===!0&&(t=Array.from({length:o.length},(r,s)=>s));const u=t.slice();u.sort((r,s)=>r-s);const k=u.map(r=>({title:y(o[r]),field:p(o[r])}));i.push({dataItem:l.get(e),dataColumns:k})}}),i}exports.getGridSelectedRows=w;