UNPKG

react-application-core

Version:

A react-based application core for the business applications.

109 lines 4.35 kB
"use strict"; 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.ToolbarToolsContainer = void 0; var React = require("react"); var base_1 = require("../base"); var util_1 = require("../../util"); var toolbar_tools_component_1 = require("./toolbar-tools.component"); var action_1 = require("../../action"); /** * @component-container-impl * @stable [01.08.2020] * * Please use the "Mappers.toolbarToolsContainerProps" */ var ToolbarToolsContainer = /** @class */ (function (_super) { __extends(ToolbarToolsContainer, _super); /** * @stable [22.04.2020] * @param {IToolbarToolsContainerProps} props */ function ToolbarToolsContainer(props) { var _this = _super.call(this, props) || this; _this.onDownloadFileClick = _this.onDownloadFileClick.bind(_this); _this.onFilterClick = _this.onFilterClick.bind(_this); _this.onRefreshClick = _this.onRefreshClick.bind(_this); return _this; } /** * @stable [10.05.2020] * @returns {JSX.Element} */ ToolbarToolsContainer.prototype.render = function () { return (React.createElement(toolbar_tools_component_1.ToolbarTools, __assign({}, util_1.Mappers.toolbarToolsContainerPropsAsToolbarToolsProps(this.originalProps), { onDownloadFileClick: this.onDownloadFileClick, onFilterClick: this.onFilterClick, onRefreshClick: this.onRefreshClick }))); }; /** * @stable [10.03.2019] */ ToolbarToolsContainer.prototype.onRefreshClick = function () { var onRefreshClick = this.toolbarToolsConfiguration.onRefreshClick; if (util_1.TypeUtils.isFn(onRefreshClick)) { onRefreshClick(); } else { this.dispatchPlainAction(action_1.ToolbarToolsActionBuilder.buildRefreshPlainAction(this.sectionName)); } }; /** * @stable [22.04.2020] */ ToolbarToolsContainer.prototype.onFilterClick = function () { var onFilterClick = this.toolbarToolsConfiguration.onFilterClick; if (util_1.TypeUtils.isFn(onFilterClick)) { onFilterClick(); } else { this.dispatchPlainAction(action_1.ToolbarToolsActionBuilder.buildFilterPlainAction(this.sectionName)); } }; /** * @stable [22.04.2020] */ ToolbarToolsContainer.prototype.onDownloadFileClick = function () { var onDownloadFileClick = this.toolbarToolsConfiguration.onDownloadFileClick; if (util_1.TypeUtils.isFn(onDownloadFileClick)) { onDownloadFileClick(); } else { this.dispatchPlainAction(action_1.ToolbarToolsActionBuilder.buildDownloadFilePlainAction(this.sectionName)); } }; Object.defineProperty(ToolbarToolsContainer.prototype, "toolbarToolsConfiguration", { /** * @stable [22.04.2020] * @returns {IToolbarToolsProps} */ get: function () { return this.originalProps.toolbarToolsConfiguration || {}; }, enumerable: false, configurable: true }); return ToolbarToolsContainer; }(base_1.GenericContainer)); exports.ToolbarToolsContainer = ToolbarToolsContainer; //# sourceMappingURL=toolbar-tools.container.js.map