UNPKG

@progress/kendo-react-grid

Version:

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

44 lines (43 loc) 1.55 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 client"; import * as a from "react"; import { GridContext as r } from "../../utils/GridContext.mjs"; import { useId as u, getNestedValue as I } from "@progress/kendo-react-common"; import { useLocalization as x } from "@progress/kendo-react-intl"; import { selectRow as d, messages as k } from "../../messages/index.mjs"; const C = (e) => { var o; const t = a.useContext(r), l = u(), m = x(), n = (o = e.isSelected) != null ? o : I(e.field, e.dataItem), c = typeof n == "boolean" && n, i = a.useCallback( (s) => { t == null || t.selectionChange({ event: s, dataItem: e.dataItem, dataIndex: e.rowDataIndex, columnIndex: e.columnIndex }); }, [t, e.columnIndex, e.rowDataIndex, e.dataItem] ); return /* @__PURE__ */ a.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ a.createElement( "input", { id: l, tabIndex: -1, type: "checkbox", className: "k-checkbox k-checkbox-md k-rounded-md", "aria-label": m.toLanguageString(d, k[d]), "aria-checked": c, checked: c, onChange: i } )); }; export { C as GridSelectionCellInput };