@symbo.ls/atoms 2.11.341 → 2.11.346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Collection.js +6 -3
  2. package/package.json +2 -2
package/Collection.js CHANGED
@@ -7,10 +7,13 @@ export const Collection = {
7
7
  define: {
8
8
  $collection: (param, el, state) => {
9
9
  const { __ref: ref } = el
10
- const children = isArray(el.props?.children)
10
+ const hasChildren = isArray(el.props?.children)
11
11
 
12
- if (children) param = children
13
- else if (!param) return
12
+ if (hasChildren) {
13
+ param = el.props?.children
14
+ const childrenAs = el.props?.childrenAs
15
+ if (childrenAs) param = param.map(v => ({ [childrenAs]: v }))
16
+ } else if (!param) return
14
17
 
15
18
  if (isString(param)) {
16
19
  if (param === 'state') param = state.parse()
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.341",
3
+ "version": "2.11.346",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "dda6f64ae91be00bcc78bc94b658810c181bc085",
6
+ "gitHead": "69805f4092a5b502348c2587845b47f5e66495f8",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",