UNPKG

@progress/kendo-react-grid

Version:

React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package

38 lines (37 loc) 1.67 kB
/** * @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"; import * as l from "react"; import { minusIcon as u, plusIcon as g } from "@progress/kendo-svg-icons"; import { useLocalization as E } from "@progress/kendo-react-intl"; import { DETAIL_EXPAND_ACTION as h } from "@progress/kendo-react-data-tools"; import { Button as D } from "@progress/kendo-react-buttons"; import { GridContext as y } from "../utils/GridContext.mjs"; import { detailCollapse as I, detailExpand as k, messages as v } from "../messages/index.mjs"; const G = (c) => { const { dataItem: t, dataIndex: m, expanded: a, field: r } = c, e = l.useContext(y), d = E(), o = a ? I : k, p = d.toLanguageString(o, v[o]), f = (i) => { i.preventDefault(), e != null && e.itemChange && e.itemChange({ dataItem: t, dataIndex: m, syntheticEvent: i, field: r, value: !a, _expand: !0 }); const n = e == null ? void 0 : e.dataItemKey, s = n ? t == null ? void 0 : t[n] : void 0; s !== void 0 && (e != null && e.dispatchDetailExpand) && e.dispatchDetailExpand({ type: h.TOGGLE, id: s }); }; return /* @__PURE__ */ l.createElement(D, { fillMode: "flat", themeColor: "primary", svgIcon: a ? u : g, onClick: f }, p); }; G.displayName = "KendoReactGridStackedDetailToggle"; export { G as GridStackedDetailToggle };