react-application-core
Version:
A react-based application core for the business applications.
57 lines • 2.44 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.List = void 0;
var React = require("react");
var base_list_component_1 = require("./base-list.component");
var basic_1 = require("./basic");
var item_1 = require("./item");
var util_1 = require("../../util");
var List = /** @class */ (function (_super) {
__extends(List, _super);
function List() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* @stable [17.08.2020]
*/
List.prototype.getView = function () {
return (React.createElement(basic_1.BasicList, __assign({ forwardedRef: this.actualRef }, util_1.Mappers.listPropsAsBasicListProps(this.originalProps)), this.dataSource.map(this.getItem, this)));
};
/**
* @stable [17.08.2020]
* @param entity
* @param index
*/
List.prototype.getItem = function (entity, index) {
var originalProps = this.originalProps;
var itemConfiguration = originalProps.itemConfiguration, onSelect = originalProps.onSelect;
return (React.createElement(item_1.ListItem, __assign({ index: index, entity: entity, selected: this.isEntitySelected(entity), onClick: onSelect }, itemConfiguration, { key: this.toRowKey(entity) })));
};
return List;
}(base_list_component_1.BaseList));
exports.List = List;
//# sourceMappingURL=list.component.js.map