react-application-core
Version:
A react-based application core for the business applications.
228 lines • 8.19 kB
JavaScript
"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 __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenericContainer = void 0;
var generic_component_1 = require("./generic.component");
var di_1 = require("../../di");
var util_1 = require("../../util");
var GenericContainer = /** @class */ (function (_super) {
__extends(GenericContainer, _super);
function GenericContainer() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(GenericContainer.prototype, "dfccStoreProxy", {
/**
* @stable [27.11.2019]
* @returns {IDialogFormChangesConfirmStoreProxy}
*/
get: function () {
return this.$dfccStoreProxy = this.$dfccStoreProxy || di_1.getDialogFormChangesConfirmStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "formStoreProxy", {
/**
* @stable [30.11.2019]
* @returns {IFormStoreProxy}
*/
get: function () {
return this.$formStoreProxy = this.$formStoreProxy || di_1.getFormStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "tabPanelStoreProxy", {
/**
* @stable [12.04.2020]
* @returns {IFormStoreProxy}
*/
get: function () {
return this.$tabPanelStoreProxy = this.$tabPanelStoreProxy || di_1.getTabPanelStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "listStoreProxy", {
/**
* @stable [30.03.2020]
* @returns {IListStoreProxy}
*/
get: function () {
return this.$listStoreProxy = this.$listStoreProxy || di_1.getListStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "routerStoreProxy", {
/**
* @stable [18.12.2019]
* @returns {IRouterStoreProxy}
*/
get: function () {
return this.$routerStoreProxy = this.$routerStoreProxy || di_1.getRouterStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "notificationStoreProxy", {
/**
* @stable [30.03.2020]
* @returns {INotificationStoreProxy}
*/
get: function () {
return this.$notificationStoreProxy = this.$notificationStoreProxy || di_1.getNotificationStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "dictionaryStoreProxy", {
/**
* @stable [29.02.2020]
* @returns {IDictionaryStoreProxy}
*/
get: function () {
return this.$dictionaryStoreProxy = this.$dictionaryStoreProxy || di_1.getDictionaryStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
/**
* @stable [30.03.2020]
* @param {string} type
* @param {TChanges} data
*/
GenericContainer.prototype.dispatch = function (type, data) {
this.storeProxy.dispatch(type, data);
};
/**
* @stable [30.03.2020]
* @param {IEffectsAction} action
*/
GenericContainer.prototype.dispatchPlainAction = function (action) {
this.storeProxy.dispatchPlainAction(action);
};
/**
* @stable [30.03.2020]
* @param {string} type
* @param {TData} data
*/
GenericContainer.prototype.dispatchActionByType = function (type, data) {
this.storeProxy.dispatchActionByType(type, data);
};
Object.defineProperty(GenericContainer.prototype, "sectionName", {
/**
* @stable [23.04.2020]
* @returns {string}
*/
get: function () {
return this.props.sectionName;
},
enumerable: false,
configurable: true
});
/**
* @stable [16.04.2020]
* @returns {TUser}
*/
GenericContainer.prototype.getUser = function () {
return this.originalProps.user;
};
/**
* @stable [30.03.2020]
* @param {string | IOperationEntity} operations
* @returns {boolean}
*/
GenericContainer.prototype.hasTransportWorkingOperations = function () {
var operations = [];
for (var _i = 0; _i < arguments.length; _i++) {
operations[_i] = arguments[_i];
}
return util_1.hasTransportWrapperQueueOperations.apply(void 0, __spreadArrays([this.props], operations));
};
/**
* @stable [30.03.2020]
* @param {TPermission} permission
* @returns {boolean}
*/
GenericContainer.prototype.hasPermission = function (permission) {
return this.permissionsManager.isAccessible(permission);
};
Object.defineProperty(GenericContainer.prototype, "storeProxy", {
/**
* @stable [30.03.2020]
* @returns {IStoreProxy}
*/
get: function () {
return this.$storeProxy = this.$storeProxy || di_1.getStoreProxyFactory()(this);
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "permissionsManager", {
/**
* @stable [30.03.2020]
* @returns {IPermissionsManager<TPermission>}
*/
get: function () {
return this.$permissionsManager = this.$permissionsManager || di_1.getPermissionsManager();
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "userActivityManager", {
/**
* @stable [30.03.2020]
* @returns {IUserActivityManager}
*/
get: function () {
return this.$userActivityManager = this.$userActivityManager || di_1.getUserActivityManager();
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "auth", {
/**
* @stable [12.06.2020]
* @returns {IAuth}
*/
get: function () {
return this.$auth = this.$auth || di_1.DiServices.auth();
},
enumerable: false,
configurable: true
});
Object.defineProperty(GenericContainer.prototype, "dynamicRoutes", {
/**
* @stable [12.06.2020]
* @returns {DynamicRoutesT}
*/
get: function () {
return this.$dynamicRoutes = this.$dynamicRoutes || di_1.DiServices.dynamicRoutes();
},
enumerable: false,
configurable: true
});
return GenericContainer;
}(generic_component_1.GenericComponent));
exports.GenericContainer = GenericContainer;
//# sourceMappingURL=generic.container.js.map