reactive-di
Advanced tools
Comparing version 6.0.6 to 6.0.7
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="6.0.7"></a> | ||
## [6.0.7](https://github.com/zerkalica/reactive-di/compare/v6.0.6...v6.0.7) (2017-12-18) | ||
<a name="6.0.6"></a> | ||
@@ -7,0 +12,0 @@ ## [6.0.6](https://github.com/zerkalica/reactive-di/compare/v6.0.5...v6.0.6) (2017-12-06) |
@@ -142,3 +142,3 @@ function _defineProperties(target, props) { | ||
this.id = ''; | ||
this.rendered = ''; | ||
this.props = undefined; | ||
this._resolved = false; | ||
@@ -484,2 +484,3 @@ this._listeners = undefined; | ||
_this._injector.id = name; | ||
_this._injector.props = props; | ||
cns.instance++; | ||
@@ -499,2 +500,3 @@ return _this; | ||
var keys = this._keys; | ||
this._injector.props = props; | ||
@@ -553,3 +555,2 @@ for (var i = 0, l = keys.length; i < l; i++) { | ||
injector.rendered = ''; | ||
Injector.parentContext = prevContext; | ||
@@ -594,3 +595,3 @@ | ||
function createCreateElement(atomize, createElement, compositeId) { | ||
function createCreateElement(atomize, createElement) { | ||
function lomCreateElement() { | ||
@@ -602,15 +603,37 @@ var args = arguments; | ||
var isAtomic = typeof el === 'function' && el.constructor.render === undefined; | ||
var id = attrs ? attrs._id || attrs.id : undefined; | ||
var parentContext = Injector.parentContext; | ||
var props = parentContext.props; | ||
var id = undefined; | ||
if (compositeId === true) { | ||
if (!attrs) attrs = {}; | ||
if (attrs) { | ||
var pid = parentContext.id; | ||
id = attrs.rdi_id || attrs.id; | ||
if (!attrs.id) { | ||
if (parentContext.rendered) throw new Error(parentContext.rendered + " need id"); | ||
attrs.id = parentContext.id; | ||
parentContext.rendered = parentContext.displayName + '.' + el; | ||
} else if (parentContext.id) attrs.id = parentContext.id + '.' + attrs.id; | ||
if (attrs.rdi_theme === true) { | ||
attrs.rdi_theme = undefined; | ||
if (!attrs.key) attrs.key = attrs.id; | ||
if (props) { | ||
var cls = props.class; | ||
if (cls !== undefined) { | ||
attrs.class = attrs.class !== undefined ? attrs.class + ' ' + cls : cls; | ||
} | ||
var style = props.style; | ||
if (style !== undefined) { | ||
var aStyle = attrs.style; | ||
if (aStyle) { | ||
for (var key in style) { | ||
aStyle[key] = style[key]; | ||
} | ||
} else attrs.style = style; | ||
} | ||
} | ||
attrs.id = pid; | ||
} else if (pid !== '' && attrs.id !== undefined) { | ||
attrs.id = pid + '.' + attrs.id; | ||
} | ||
} | ||
@@ -617,0 +640,0 @@ |
@@ -146,3 +146,3 @@ 'use strict'; | ||
this.id = ''; | ||
this.rendered = ''; | ||
this.props = undefined; | ||
this._resolved = false; | ||
@@ -488,2 +488,3 @@ this._listeners = undefined; | ||
_this._injector.id = name; | ||
_this._injector.props = props; | ||
cns.instance++; | ||
@@ -503,2 +504,3 @@ return _this; | ||
var keys = this._keys; | ||
this._injector.props = props; | ||
@@ -557,3 +559,2 @@ for (var i = 0, l = keys.length; i < l; i++) { | ||
injector.rendered = ''; | ||
Injector.parentContext = prevContext; | ||
@@ -598,3 +599,3 @@ | ||
function createCreateElement(atomize, createElement, compositeId) { | ||
function createCreateElement(atomize, createElement) { | ||
function lomCreateElement() { | ||
@@ -606,15 +607,37 @@ var args = arguments; | ||
var isAtomic = typeof el === 'function' && el.constructor.render === undefined; | ||
var id = attrs ? attrs._id || attrs.id : undefined; | ||
var parentContext = Injector.parentContext; | ||
var props = parentContext.props; | ||
var id = undefined; | ||
if (compositeId === true) { | ||
if (!attrs) attrs = {}; | ||
if (attrs) { | ||
var pid = parentContext.id; | ||
id = attrs.rdi_id || attrs.id; | ||
if (!attrs.id) { | ||
if (parentContext.rendered) throw new Error(parentContext.rendered + " need id"); | ||
attrs.id = parentContext.id; | ||
parentContext.rendered = parentContext.displayName + '.' + el; | ||
} else if (parentContext.id) attrs.id = parentContext.id + '.' + attrs.id; | ||
if (attrs.rdi_theme === true) { | ||
attrs.rdi_theme = undefined; | ||
if (!attrs.key) attrs.key = attrs.id; | ||
if (props) { | ||
var cls = props.class; | ||
if (cls !== undefined) { | ||
attrs.class = attrs.class !== undefined ? attrs.class + ' ' + cls : cls; | ||
} | ||
var style = props.style; | ||
if (style !== undefined) { | ||
var aStyle = attrs.style; | ||
if (aStyle) { | ||
for (var key in style) { | ||
aStyle[key] = style[key]; | ||
} | ||
} else attrs.style = style; | ||
} | ||
} | ||
attrs.id = pid; | ||
} else if (pid !== '' && attrs.id !== undefined) { | ||
attrs.id = pid + '.' + attrs.id; | ||
} | ||
} | ||
@@ -621,0 +644,0 @@ |
@@ -148,3 +148,3 @@ (function (global, factory) { | ||
this.id = ''; | ||
this.rendered = ''; | ||
this.props = undefined; | ||
this._resolved = false; | ||
@@ -490,2 +490,3 @@ this._listeners = undefined; | ||
_this._injector.id = name; | ||
_this._injector.props = props; | ||
cns.instance++; | ||
@@ -505,2 +506,3 @@ return _this; | ||
var keys = this._keys; | ||
this._injector.props = props; | ||
@@ -559,3 +561,2 @@ for (var i = 0, l = keys.length; i < l; i++) { | ||
injector.rendered = ''; | ||
Injector.parentContext = prevContext; | ||
@@ -600,3 +601,3 @@ | ||
function createCreateElement(atomize, createElement, compositeId) { | ||
function createCreateElement(atomize, createElement) { | ||
function lomCreateElement() { | ||
@@ -608,15 +609,37 @@ var args = arguments; | ||
var isAtomic = typeof el === 'function' && el.constructor.render === undefined; | ||
var id = attrs ? attrs._id || attrs.id : undefined; | ||
var parentContext = Injector.parentContext; | ||
var props = parentContext.props; | ||
var id = undefined; | ||
if (compositeId === true) { | ||
if (!attrs) attrs = {}; | ||
if (attrs) { | ||
var pid = parentContext.id; | ||
id = attrs.rdi_id || attrs.id; | ||
if (!attrs.id) { | ||
if (parentContext.rendered) throw new Error(parentContext.rendered + " need id"); | ||
attrs.id = parentContext.id; | ||
parentContext.rendered = parentContext.displayName + '.' + el; | ||
} else if (parentContext.id) attrs.id = parentContext.id + '.' + attrs.id; | ||
if (attrs.rdi_theme === true) { | ||
attrs.rdi_theme = undefined; | ||
if (!attrs.key) attrs.key = attrs.id; | ||
if (props) { | ||
var cls = props.class; | ||
if (cls !== undefined) { | ||
attrs.class = attrs.class !== undefined ? attrs.class + ' ' + cls : cls; | ||
} | ||
var style = props.style; | ||
if (style !== undefined) { | ||
var aStyle = attrs.style; | ||
if (aStyle) { | ||
for (var key in style) { | ||
aStyle[key] = style[key]; | ||
} | ||
} else attrs.style = style; | ||
} | ||
} | ||
attrs.id = pid; | ||
} else if (pid !== '' && attrs.id !== undefined) { | ||
attrs.id = pid + '.' + attrs.id; | ||
} | ||
} | ||
@@ -623,0 +646,0 @@ |
{ | ||
"name": "reactive-di", | ||
"version": "6.0.6", | ||
"version": "6.0.7", | ||
"description": "Reactive dependency injection", | ||
@@ -60,2 +60,3 @@ "publishConfig": { | ||
"@babel/plugin-proposal-decorators": "^7.0.0-beta.34", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.34", | ||
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.34", | ||
@@ -65,10 +66,10 @@ "@babel/preset-es2015": "^7.0.0-beta.34", | ||
"chokidar-cli": "^1.2.0", | ||
"flow-bin": "^0.60.1", | ||
"lom_atom": "^3.0.11", | ||
"mobx": "^3.3.3", | ||
"flow-bin": "^0.61.0", | ||
"lom_atom": "^3.0.20", | ||
"mobx": "^3.4.1", | ||
"mocha": "^4.0.1", | ||
"preact": "^8.2.6", | ||
"preact": "^8.2.7", | ||
"preact-render-to-string": "^3.7.0", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.52.1", | ||
"rollup": "^0.52.2", | ||
"rollup-plugin-babel": "^4.0.0-beta.0", | ||
@@ -78,4 +79,4 @@ "rollup-plugin-node-resolve": "^3.0.0", | ||
"standard-version": "^4.2.0", | ||
"uglify-es": "^3.2.1" | ||
"uglify-es": "^3.2.2" | ||
} | ||
} |
@@ -8,4 +8,3 @@ // @flow | ||
atomize: IAtomize<IElement, State>, | ||
createElement: CreateElement, | ||
compositeId?: boolean | ||
createElement: CreateElement | ||
): CreateElement { | ||
@@ -18,14 +17,31 @@ function lomCreateElement() { | ||
const isAtomic = typeof el === 'function' && el.constructor.render === undefined | ||
let id: string | void = attrs ? attrs._id || attrs.id : undefined | ||
const parentContext: Injector = Injector.parentContext | ||
const props = parentContext.props | ||
if (compositeId === true) { | ||
if(!attrs) attrs = {} | ||
if (!attrs.id) { | ||
if (parentContext.rendered) throw new Error(`${parentContext.rendered} need id`) | ||
attrs.id = parentContext.id | ||
parentContext.rendered = parentContext.displayName + '.' + el | ||
} else if (parentContext.id) attrs.id = parentContext.id + '.' + attrs.id | ||
let id: string | void = undefined | ||
if (!attrs.key) attrs.key = attrs.id | ||
if (attrs) { | ||
const pid = parentContext.id | ||
id = attrs.rdi_id || attrs.id | ||
if (attrs.rdi_theme === true) { | ||
attrs.rdi_theme = undefined | ||
if (props) { | ||
const cls = props.class | ||
if (cls !== undefined) { | ||
attrs.class = attrs.class !== undefined ? (attrs.class + ' ' + cls) : cls | ||
} | ||
const style = props.style | ||
if (style !== undefined) { | ||
const aStyle = attrs.style | ||
if (aStyle) { | ||
for (let key in style) { | ||
aStyle[key] = style[key] | ||
} | ||
} else attrs.style = style | ||
} | ||
} | ||
attrs.id = pid | ||
} else if (pid !== '' && attrs.id !== undefined) { | ||
attrs.id = pid + '.' + attrs.id | ||
} | ||
} | ||
@@ -32,0 +48,0 @@ |
@@ -50,2 +50,3 @@ // @flow | ||
this._injector.id = name | ||
this._injector.props = props | ||
cns.instance++ | ||
@@ -66,2 +67,3 @@ } | ||
const keys = this._keys | ||
this._injector.props = props | ||
for (let i = 0, l = keys.length; i < l; i++) { // eslint-disable-line | ||
@@ -111,4 +113,2 @@ const k = keys[i] | ||
} | ||
injector.rendered = '' | ||
Injector.parentContext = prevContext | ||
@@ -115,0 +115,0 @@ |
@@ -33,3 +33,4 @@ // @flow | ||
id = '' | ||
rendered = '' | ||
props: Object | void = undefined | ||
constructor( | ||
@@ -36,0 +37,0 @@ items?: IProvideItem[], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
316976
2832
22