@symbo.ls/atoms
Advanced tools
Comparing version 2.11.475 to 2.11.477
'use strict' | ||
import { isState, getChildStateInKey } from '@domql/state' | ||
import { isString, isNot, isArray, isObject, isObjectLike, exec, deepClone, addAdditionalExtend } from '@domql/utils' | ||
import { isString, isNumber, isNot, isArray, isObject, isObjectLike, exec, deepClone, addAdditionalExtend } from '@domql/utils' | ||
@@ -10,30 +10,30 @@ export const Collection = { | ||
const { __ref: ref } = el | ||
const { children, childrenAs, childExtends } = (el.props || {}) | ||
const childrenExec = children && exec(children, el, state) | ||
const { children: childrenProps, childrenAs, childExtends } = (el.props || {}) | ||
const children = childrenProps && exec(childrenProps, el, state) | ||
if (isArray(childrenExec)) { | ||
param = deepClone(childrenExec) | ||
if (childrenAs) param = param.map(v => ({ extend: childExtends, [childrenAs]: v })) | ||
} else if (isObject(childrenExec)) { | ||
if (childrenExec.$$typeof) return el.call('renderReact', childrenExec, el) | ||
param = deepClone(childrenExec) | ||
param = Object.keys(param).map(v => { | ||
const val = param[v] | ||
return addAdditionalExtend(v, val) | ||
}) | ||
el.removeContent() | ||
el.content = { | ||
extend: childExtends, | ||
props: { | ||
childProps: el.props && el.props.childProps | ||
if (children) { | ||
if (isObject(children)) { | ||
if (children.$$typeof) return el.call('renderReact', children, el) | ||
param = deepClone(children) | ||
param = Object.keys(param).map(v => { | ||
const val = param[v] | ||
return addAdditionalExtend(v, val) | ||
}) | ||
} else if (isArray(children)) { | ||
param = deepClone(children) | ||
if (childrenAs) { | ||
param = param.map(v => ({ | ||
extend: childExtends, | ||
[childrenAs]: v | ||
})) | ||
} | ||
} else if (isString(children) || isNumber(children)) { | ||
el.removeContent() | ||
el.content = { text: param } | ||
return | ||
} | ||
return | ||
} else if (childrenExec) { | ||
el.removeContent() | ||
el.content = { text: param } | ||
return | ||
} | ||
if (!param) return | ||
const filterReact = param.filter(v => !v.$$typeof) | ||
@@ -43,4 +43,3 @@ if (filterReact.length !== param.length) { | ||
el.call('renderReact', extractedReactComponents, el) | ||
} | ||
param = filterReact | ||
} param = filterReact | ||
@@ -72,2 +71,3 @@ if (isString(param)) { | ||
props: { | ||
ignoreChildProps: true, | ||
childProps: el.props && el.props.childProps | ||
@@ -74,0 +74,0 @@ } |
{ | ||
"name": "@symbo.ls/atoms", | ||
"version": "2.11.475", | ||
"version": "2.11.477", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"gitHead": "d2198b5f44d161e2cf0dd8a9d88a5301192bcb02", | ||
"gitHead": "47546f8e3e61900fb07e92c3faf7abf2bce919ae", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "@domql/state": "^2.5.0", |
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
68307
29
1872