react-url-table
Version:
Smart and flexible table component built with React and for React projects. based on React16 hooks and mobx-react-lite
31 lines • 935 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class HeaderModel {
constructor(props, index) {
this.sortable = true;
this.searchable = true;
this.index = index;
if (typeof props === 'string') {
this.name = props;
}
else {
this.renderHandler = props.render;
this.name = props.name;
if (props.searchable === false) {
this.searchable = props.searchable;
}
if (props.sortable === false) {
this.sortable = props.sortable;
}
if (props.hasOwnProperty('editable')) {
this.editable = props.editable;
}
}
return this;
}
render() {
return this.renderHandler ? this.renderHandler(this.name) : this.name;
}
}
exports.default = HeaderModel;
//# sourceMappingURL=header.js.map