nakedobjects.spa
Version:
Single Page Application client for a Naked Objects application.
22 lines • 1.13 kB
JavaScript
import find from 'lodash/find';
import map from 'lodash/map';
var TableRowViewModel = (function () {
function TableRowViewModel(viewModelFactory, properties, paneId, title) {
var _this = this;
this.viewModelFactory = viewModelFactory;
this.paneId = paneId;
this.title = title;
this.showTitle = false;
this.getPlaceHolderTableRowColumnViewModel = function (id) { return _this.viewModelFactory.propertyTableViewModel(id); }; // no property so place holder for column
this.conformColumns = function (showTitle, columns) {
_this.showTitle = showTitle;
if (columns) {
_this.properties = map(columns, function (c) { return find(_this.properties, function (tp) { return tp.id === c; }) || _this.getPlaceHolderTableRowColumnViewModel(c); });
}
};
this.properties = map(properties, function (property, id) { return viewModelFactory.propertyTableViewModel(id, property); });
}
return TableRowViewModel;
}());
export { TableRowViewModel };
//# sourceMappingURL=table-row-view-model.js.map