UNPKG

@progress/kendo-react-grid

Version:
43 lines 2.08 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var utils_1 = require("./../utils"); var kendo_react_common_1 = require("@progress/kendo-react-common"); /** * @hidden */ var GridSelectionCell = /** @class */ (function (_super) { __extends(GridSelectionCell, _super); function GridSelectionCell() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._inputId = kendo_react_common_1.guid(); _this.handleOnChange = function (syntheticEvent) { if (_this.props.selectionChange) { _this.props.selectionChange({ syntheticEvent: syntheticEvent }); } }; return _this; } GridSelectionCell.prototype.render = function () { var data = utils_1.getNestedValue(this.props.field, this.props.dataItem); var defaultRendering = this.props.rowType !== 'groupHeader' ? (React.createElement("td", { style: this.props.style, className: this.props.className }, React.createElement("input", { checked: data, id: this._inputId, type: "checkbox", className: "k-checkbox", onChange: this.handleOnChange }), React.createElement("label", { className: "k-checkbox-label", htmlFor: this._inputId }))) : null; return this.props.render ? this.props.render.call(undefined, defaultRendering, this.props) : defaultRendering; }; return GridSelectionCell; }(React.Component)); exports.GridSelectionCell = GridSelectionCell; //# sourceMappingURL=GridSelectionCell.js.map