UNPKG

react-application-core

Version:

A react-based application core for the business applications.

97 lines 3.56 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.TabPanelContainer = void 0; var React = require("react"); var generic_container_1 = require("../base/generic.container"); var tab_panel_component_1 = require("./tab-panel.component"); var util_1 = require("../../util"); /** * @component-container-impl * @stable [30.07.2020] * * Please use the "Mappers.tabPanelContainerProps" */ var TabPanelContainer = /** @class */ (function (_super) { __extends(TabPanelContainer, _super); /** * @stable [30.07.2020] * @param originalProps */ function TabPanelContainer(originalProps) { var _this = _super.call(this, originalProps) || this; _this.onDeactivate = _this.onDeactivate.bind(_this); _this.onTabClick = _this.onTabClick.bind(_this); return _this; } /** * @stable [30.07.2020] */ TabPanelContainer.prototype.render = function () { return (React.createElement(tab_panel_component_1.TabPanel, __assign({}, this.tabPanelProps, { onClick: this.onTabClick, onDeactivate: this.onDeactivate }), this.originalChildren)); }; /** * @stable [12.04.2020] * @param {number} value */ TabPanelContainer.prototype.dispatchActiveValue = function (value) { this.tabPanelStoreProxy.dispatchTabPanelActiveValue(value); }; /** * @stable [12.04.2020] * @param {number} value */ TabPanelContainer.prototype.dispatchInactiveValue = function (value) { this.tabPanelStoreProxy.dispatchTabPanelInactiveValue(value); }; Object.defineProperty(TabPanelContainer.prototype, "tabPanelProps", { /** * @stable [30.07.2020] */ get: function () { return util_1.Mappers.tabPanelContainerPropsAsTabPanelProps(this.originalProps); }, enumerable: false, configurable: true }); /** * @stable [12.04.2020] * @param {ITabProps} tab */ TabPanelContainer.prototype.onTabClick = function (tab) { this.dispatchActiveValue(tab.value); }; /** * @stable [12.04.2020] * @param {number} activeValue */ TabPanelContainer.prototype.onDeactivate = function (activeValue) { this.dispatchInactiveValue(activeValue); }; return TabPanelContainer; }(generic_container_1.GenericContainer)); exports.TabPanelContainer = TabPanelContainer; //# sourceMappingURL=tab-panel.container.js.map