@common-stack/client-core
Advanced tools
Comparing version 0.0.155 to 0.0.156
@@ -27,2 +27,3 @@ import { IFeature, FeatureParams } from '../interfaces'; | ||
middleMainPanelItems: any; | ||
middleMainPanelItemsProps: any; | ||
leftFooterItems: any; | ||
@@ -29,0 +30,0 @@ rightFooterItems: any; |
@@ -100,2 +100,3 @@ module.exports = | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const React = __webpack_require__(/*! react */ "react"); | ||
const lodash_1 = __webpack_require__(/*! lodash */ "lodash"); | ||
@@ -116,2 +117,3 @@ const combine = (features, extractor) => lodash_1.without(lodash_1.union(...lodash_1.map(features, res => lodash_1.castArray(extractor(res)))), undefined); | ||
this.middleMainPanelItems = combine(arguments, arg => arg.middleMainPanelItems); | ||
this.middleMainPanelItemsProps = combine(arguments, arg => arg.middleMainPanelItemsProps); | ||
this.leftFooterItems = combine(arguments, arg => arg.leftFooterItems); | ||
@@ -159,3 +161,11 @@ this.rightFooterItems = combine(arguments, arg => arg.rightFooterItems); | ||
get middleMainPanel() { | ||
return lodash_1.merge(...this.middleMainPanelItems); | ||
const panelObj = lodash_1.merge(...this.middleMainPanelItems); | ||
const withProps = {}; | ||
Object.keys(panelObj).forEach(key => { | ||
const props = this.middleMainPanelItemsProps.filter(el => !!el[key]); | ||
let mergedProps = []; | ||
props.forEach(el => { mergedProps = [...mergedProps, ...el[key]]; }); | ||
return withProps[key] = React.cloneElement(panelObj[key], Object.assign({}, lodash_1.merge(...mergedProps))); | ||
}); | ||
return withProps; | ||
} | ||
@@ -271,2 +281,13 @@ get leftFooter() { | ||
/***/ }), | ||
/***/ "react": | ||
/*!************************!*\ | ||
!*** external "react" ***! | ||
\************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("react"); | ||
/***/ }) | ||
@@ -273,0 +294,0 @@ |
@@ -28,2 +28,3 @@ export interface ClientStateParams { | ||
readonly middleMainPanelItems?: any; | ||
readonly middleMainPanelItemsProps?: any; | ||
readonly leftFooterItems?: any; | ||
@@ -60,2 +61,3 @@ readonly rightFooterItems?: any; | ||
readonly middleLowerPanelItems: any; | ||
readonly middleMainPanelItemsProps?: any; | ||
readonly getRouter: any; | ||
@@ -62,0 +64,0 @@ readonly getRoutes: any; |
{ | ||
"name": "@common-stack/client-core", | ||
"version": "0.0.155", | ||
"version": "0.0.156", | ||
"description": "Sample core for higher packages to depend on", | ||
@@ -56,3 +56,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@common-stack/core": "^0.0.155" | ||
"@common-stack/core": "^0.0.156" | ||
}, | ||
@@ -59,0 +59,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33980
400
+ Added@common-stack/core@0.0.156(transitive)
- Removed@common-stack/core@0.0.155(transitive)
Updated@common-stack/core@^0.0.156