@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
10 lines (9 loc) • 2.08 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
*-------------------------------------------------------------------------------------------
*/
"use client";
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),P=require("../drag/GroupingIndicator.js"),C=require("@progress/kendo-react-intl"),c=require("../messages/index.js"),G=require("../GridClientWrapper.js");function v(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}return t.default=r,Object.freeze(t)}const l=v(b),R=r=>{const t=l.useContext(G.GridContext),a=(o,e)=>{const n=r.group.slice();n.splice(e,1),t.groupChange(n,o)},s=(o,e,n,i)=>{const f=Object.assign({},n,{dir:i}),p=r.group.slice();p.splice(e,1,f),t.groupChange(p,o)},u=C.useLocalization(),d=r.group||[],m=o=>{const e=r.columns.find(i=>i.field===o),n=e&&(e.title||e.field);return n===void 0?o:n},g=d.map((o,e)=>l.createElement(P.GroupingIndicator,{key:e,index:e,dir:o.dir||"asc",title:m(o.field),onRemove:n=>{a(n,e)},onSortChange:(n,i)=>{s(n,e,o,i)},onPress:t.dragLogicRef.current.pressHandler,onDrag:t.dragLogicRef.current.dragHandler,onRelease:t.dragLogicRef.current.releaseHandler,onContextMenu:t.onContextMenu}));return l.createElement("div",{ref:t.dragLogicRef.current.refGroupPanelDiv,className:"k-grouping-header",role:"toolbar","aria-label":u.toLanguageString(c.groupPanelAriaLabel,c.messages[c.groupPanelAriaLabel]),"aria-controls":r.ariaControls||""},l.createElement("div",{className:"k-chip-list k-chip-list-md",role:"none"},g),l.createElement("div",{className:"k-grouping-drop-container"},!g.length&&u.toLanguageString(c.groupPanelEmpty,c.messages[c.groupPanelEmpty])," "))};exports.GroupPanel=R;