UNPKG

@progress/kendo-react-grid

Version:
47 lines 2.1 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_intl_1 = require("@progress/kendo-react-intl"); var GridCell = /** @class */ (function (_super) { __extends(GridCell, _super); function GridCell() { return _super !== null && _super.apply(this, arguments) || this; } /** * @hidden */ GridCell.prototype.render = function () { var defaultRendering = null; if (this.props.rowType === 'groupFooter') { defaultRendering = React.createElement("td", { className: this.props.className }); } else if (this.props.field !== undefined && this.props.rowType !== 'groupHeader') { var data = utils_1.getNestedValue(this.props.field, this.props.dataItem); var dataAsString = ''; if (data !== undefined && data !== null) { dataAsString = this.props.format ? kendo_react_intl_1.provideIntlService(this).format(this.props.format, data) : data.toString(); } defaultRendering = (React.createElement("td", { colSpan: this.props.colSpan, style: this.props.style, className: this.props.className }, dataAsString)); } return this.props.render ? this.props.render.call(undefined, defaultRendering, this.props) : defaultRendering; }; return GridCell; }(React.Component)); exports.GridCell = GridCell; kendo_react_intl_1.registerForIntl(GridCell); //# sourceMappingURL=GridCell.js.map