react-application-core
Version:
A react-based application core for the business applications.
87 lines • 3.59 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.PageToolbarContainer = void 0;
var React = require("react");
var generic_container_1 = require("../../base/generic.container");
var util_1 = require("../../../util");
var page_toolbar_component_1 = require("./page-toolbar.component");
var action_1 = require("../../../action");
/**
* @component-container-impl
* @stable [31.07.2020]
*
* Please use the "Mappers.pageToolbarContainerProps"
*/
var PageToolbarContainer = /** @class */ (function (_super) {
__extends(PageToolbarContainer, _super);
/**
* @stable [06.05.2020]
* @param {IPageToolbarContainerProps} props
*/
function PageToolbarContainer(props) {
var _this = _super.call(this, props) || this;
_this.onFirst = _this.onFirst.bind(_this);
_this.onLast = _this.onLast.bind(_this);
_this.onNext = _this.onNext.bind(_this);
_this.onPrevious = _this.onPrevious.bind(_this);
return _this;
}
/**
* @stable [31.07.2020]
* @returns {JSX.Element}
*/
PageToolbarContainer.prototype.render = function () {
return (React.createElement(page_toolbar_component_1.PageToolbar, __assign({}, util_1.Mappers.pageToolbarContainerPropsAsPageToolbarProps(this.originalProps), { onFirst: this.onFirst, onLast: this.onLast, onNext: this.onNext, onPrevious: this.onPrevious }), this.originalChildren));
};
/**
* @stable [06.05.2020]
*/
PageToolbarContainer.prototype.onNext = function () {
this.dispatchPlainAction(action_1.PageToolbarActionBuilder.buildNextPagePlainAction(this.sectionName));
};
/**
* @stable [06.05.2020]
*/
PageToolbarContainer.prototype.onPrevious = function () {
this.dispatchPlainAction(action_1.PageToolbarActionBuilder.buildPreviousPagePlainAction(this.sectionName));
};
/**
* @stable [06.05.2020]
*/
PageToolbarContainer.prototype.onLast = function () {
this.dispatchPlainAction(action_1.PageToolbarActionBuilder.buildLastPagePlainAction(this.sectionName));
};
/**
* @stable [06.05.2020]
*/
PageToolbarContainer.prototype.onFirst = function () {
this.dispatchPlainAction(action_1.PageToolbarActionBuilder.buildFirstPagePlainAction(this.sectionName));
};
return PageToolbarContainer;
}(generic_container_1.GenericContainer));
exports.PageToolbarContainer = PageToolbarContainer;
//# sourceMappingURL=page-toolbar.container.js.map