@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
10 lines (9 loc) • 1.73 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 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 f=require("react"),m=require("../../utils/GridContext.js"),h=require("@progress/kendo-react-common"),a=require("@progress/kendo-svg-icons"),p=require("@progress/kendo-react-intl"),c=require("../../messages/index.js"),v=require("@progress/kendo-react-data-tools");function I(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const r=I(f),b=t=>{const e=r.useContext(m.GridContext),n=p.useLocalization(),o=t.expanded?c.groupCollapse:c.groupExpand,d=n.toLanguageString(o,c.messages[o]),i=e.dir==="rtl",u=i?"chevron-left":"chevron-right",g=i?a.chevronLeftIcon:a.chevronRightIcon;return r.createElement("a",{onClick:l=>{var s;l.preventDefault(),e!=null&&e.itemChange&&e.itemChange({dataItem:t.dataItem,dataIndex:t.dataIndex,syntheticEvent:l,field:void 0,value:!t.expanded}),(s=e==null?void 0:e.dispatchGroupExpand)==null||s.call(e,{type:v.GROUP_EXPAND_ACTION.TOGGLE,group:t.group})},href:"#",tabIndex:-1,"aria-label":d},r.createElement(h.IconWrap,{name:t.expanded?"chevron-down":u,icon:t.expanded?a.chevronDownIcon:g}))};exports.GridGroupCellToggle=b;