@symbo.ls/atoms 2.11.410 → 2.11.421
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.
- package/Collection.js +8 -5
- package/Svg.js +1 -0
- package/Text.js +2 -0
- package/package.json +2 -2
package/Collection.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { isState, getChildStateInKey } from '@domql/state'
|
|
4
|
-
import { isString, isNot, isArray, isObject, isObjectLike, deepCloneWithExtend } from '@domql/utils'
|
|
4
|
+
import { isString, isNot, isArray, isObject, isObjectLike, exec, deepCloneWithExtend } from '@domql/utils'
|
|
5
5
|
|
|
6
6
|
export const Collection = {
|
|
7
7
|
define: {
|
|
8
8
|
$collection: (param, el, state) => {
|
|
9
9
|
const { __ref: ref } = el
|
|
10
10
|
const { children, childrenAs, childrenExtend } = (el.props || {})
|
|
11
|
-
const
|
|
11
|
+
const childrenExec = children && exec(children, el, state)
|
|
12
|
+
const hasChildren = isArray(childrenExec)
|
|
12
13
|
|
|
13
14
|
if (hasChildren) {
|
|
14
|
-
param =
|
|
15
|
+
param = deepCloneWithExtend(childrenExec)
|
|
15
16
|
if (childrenAs) param = param.map(v => ({ extend: childrenExtend, [childrenAs]: v }))
|
|
16
17
|
} else if (!param) return
|
|
17
18
|
|
|
@@ -79,7 +80,8 @@ export const Collection = {
|
|
|
79
80
|
},
|
|
80
81
|
|
|
81
82
|
$stateCollection: (param, el, state, ctx) => {
|
|
82
|
-
|
|
83
|
+
const { children, childrenAs } = (el.props || {})
|
|
84
|
+
if (!param || children || childrenAs) return
|
|
83
85
|
|
|
84
86
|
if (isString(param)) {
|
|
85
87
|
if (param === 'state') param = state.parse()
|
|
@@ -123,7 +125,8 @@ export const Collection = {
|
|
|
123
125
|
},
|
|
124
126
|
|
|
125
127
|
$propsCollection: (param, el, state) => {
|
|
126
|
-
|
|
128
|
+
const { children, childrenAs } = (el.props || {})
|
|
129
|
+
if (!param || children || childrenAs) return
|
|
127
130
|
|
|
128
131
|
if (isString(param)) {
|
|
129
132
|
if (param === 'state') param = state.parse()
|
package/Svg.js
CHANGED
|
@@ -17,6 +17,7 @@ export const Svg = {
|
|
|
17
17
|
const SVG = designSystem && designSystem.SVG
|
|
18
18
|
const useSvgSprite = props.spriteId || (context.designSystem && context.designSystem.useSvgSprite)
|
|
19
19
|
|
|
20
|
+
if (props.html) return props.html
|
|
20
21
|
if (!useSvgSprite && props.src) return props.src
|
|
21
22
|
|
|
22
23
|
const useSVGSymbol = icon => `<use xlink:href="#${icon}" />`
|
package/Text.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/atoms",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.421",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "c8c0374c888db13ddd96d6602f441ab80f13c203",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@domql/state": "latest",
|
|
9
9
|
"@domql/utils": "latest",
|