react-url-table
Version:
Smart and flexible table component built with React and for React projects. based on React16 hooks and mobx-react-lite
23 lines • 712 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const get_1 = tslib_1.__importDefault(require("lodash/get"));
class FieldModel {
constructor(props, index) {
this.index = index;
if (typeof props === 'string') {
this.property = props;
}
else {
this.property = props.property;
this.renderHandler = props.render;
}
return this;
}
render(object) {
const value = get_1.default(object, this.property);
return this.renderHandler ? this.renderHandler(value, object) : value;
}
}
exports.default = FieldModel;
//# sourceMappingURL=field.js.map