@symbo.ls/atoms 2.11.323 → 2.11.331
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/Block.js +5 -5
- package/Collection.js +12 -9
- package/Overflow.js +4 -1
- package/Theme.js +1 -1
- package/Timing.js +1 -0
- package/package.json +2 -2
package/Block.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { isUndefined } from '@domql/utils'
|
|
3
|
+
import { isUndefined, isString } from '@domql/utils'
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
getSpacingBasedOnRatio,
|
|
@@ -71,7 +71,7 @@ export const Block = {
|
|
|
71
71
|
const [minHeight, minWidth] = props.heightRange.split(' ')
|
|
72
72
|
return {
|
|
73
73
|
...deps.transformSize('minHeight', minHeight),
|
|
74
|
-
...deps.transformSize('
|
|
74
|
+
...deps.transformSize('minWidth', minWidth || minHeight)
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
|
|
@@ -80,7 +80,7 @@ export const Block = {
|
|
|
80
80
|
const [maxHeight, maxWidth] = props.heightRange.split(' ')
|
|
81
81
|
return {
|
|
82
82
|
...deps.transformSize('maxHeight', maxHeight),
|
|
83
|
-
...deps.transformSize('
|
|
83
|
+
...deps.transformSize('maxWidth', maxWidth || maxHeight)
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
|
|
@@ -105,7 +105,7 @@ export const Block = {
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
paddingBlock: ({ props, deps }) => {
|
|
108
|
-
if (
|
|
108
|
+
if (isString(props.paddingBlock)) return
|
|
109
109
|
const [paddingBlockStart, paddingBlockEnd] = props.paddingBlock.split(' ')
|
|
110
110
|
return {
|
|
111
111
|
...deps.transformSize('paddingBlockStart', paddingBlockStart),
|
|
@@ -165,7 +165,7 @@ export const Block = {
|
|
|
165
165
|
alignSelf: ({ props }) => !isUndefined(props.alignSelf) && ({
|
|
166
166
|
alignSelf: props.alignSelf
|
|
167
167
|
}),
|
|
168
|
-
order: ({ props }) => props.order && ({
|
|
168
|
+
order: ({ props }) => !isUndefined(props.order) && ({
|
|
169
169
|
order: props.order
|
|
170
170
|
}),
|
|
171
171
|
|
package/Collection.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { isState, getChildStateInKey } from '@domql/state'
|
|
4
|
-
import { isString, isNot, isArray, isObject, isObjectLike, deepClone } from '@domql/utils'
|
|
4
|
+
import { isString, isNot, isArray, isObject, isObjectLike, deepClone, 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
|
+
const children = isArray(el.props?.children)
|
|
11
|
+
|
|
12
|
+
if (children) param = children
|
|
13
|
+
else if (!param) return
|
|
10
14
|
|
|
11
15
|
if (isString(param)) {
|
|
12
16
|
if (param === 'state') param = state.parse()
|
|
@@ -15,7 +19,6 @@ export const Collection = {
|
|
|
15
19
|
if (isState(param)) param = param.parse()
|
|
16
20
|
if (isNot(param)('array', 'object')) return
|
|
17
21
|
|
|
18
|
-
const { __ref: ref } = el
|
|
19
22
|
param = deepClone(param)
|
|
20
23
|
|
|
21
24
|
if (ref.__collectionCache) {
|
|
@@ -24,11 +27,11 @@ export const Collection = {
|
|
|
24
27
|
ref.__noCollectionDifference = true
|
|
25
28
|
return
|
|
26
29
|
} else {
|
|
27
|
-
ref.__collectionCache =
|
|
30
|
+
ref.__collectionCache = param
|
|
28
31
|
delete ref.__noCollectionDifference
|
|
29
32
|
}
|
|
30
33
|
} else {
|
|
31
|
-
ref.__collectionCache =
|
|
34
|
+
ref.__collectionCache = param
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
const obj = {
|
|
@@ -40,7 +43,7 @@ export const Collection = {
|
|
|
40
43
|
|
|
41
44
|
for (const key in param) {
|
|
42
45
|
const value = param[key]
|
|
43
|
-
obj[key] = isObjectLike(value) ? value : { value }
|
|
46
|
+
if (value) obj[key] = isObjectLike(value) ? value : { value }
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
el.removeContent()
|
|
@@ -83,7 +86,7 @@ export const Collection = {
|
|
|
83
86
|
if (isNot(param)('array', 'object')) return
|
|
84
87
|
|
|
85
88
|
const { __ref: ref } = el
|
|
86
|
-
param =
|
|
89
|
+
param = deepCloneWithExtend(param)
|
|
87
90
|
|
|
88
91
|
if (ref.__stateCollectionCache) {
|
|
89
92
|
const equals = JSON.stringify(param) === JSON.stringify(ref.__stateCollectionCache)
|
|
@@ -107,7 +110,7 @@ export const Collection = {
|
|
|
107
110
|
|
|
108
111
|
for (const key in param) {
|
|
109
112
|
const value = param[key]
|
|
110
|
-
obj[key] = { state: isObjectLike(value) ? value : { value } }
|
|
113
|
+
if (value) obj[key] = { state: isObjectLike(value) ? value : { value } }
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
el.removeContent()
|
|
@@ -151,7 +154,7 @@ export const Collection = {
|
|
|
151
154
|
|
|
152
155
|
for (const key in param) {
|
|
153
156
|
const value = param[key]
|
|
154
|
-
obj[key] = { props: isObjectLike(value) ? value : { value } }
|
|
157
|
+
if (value) obj[key] = { props: isObjectLike(value) ? value : { value } }
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
el.removeContent()
|
package/Overflow.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
export const Overflow = {
|
|
4
4
|
class: {
|
|
5
|
-
overflow: ({ props }) => props.overflow && ({
|
|
5
|
+
overflow: ({ props }) => props.overflow && ({
|
|
6
|
+
overflow: props.overflow,
|
|
7
|
+
scrollBehavior: 'smooth'
|
|
8
|
+
}),
|
|
6
9
|
overflowX: ({ props }) => props.overflowX && ({ overflowX: props.overflowX }),
|
|
7
10
|
overflowY: ({ props }) => props.overflowY && ({ overflowY: props.overflowY })
|
|
8
11
|
}
|
package/Theme.js
CHANGED
|
@@ -143,7 +143,7 @@ export const Theme = {
|
|
|
143
143
|
const globalTheme = deps.getSystemTheme(element)
|
|
144
144
|
if (!props.backgroundImage) return
|
|
145
145
|
return ({
|
|
146
|
-
boxShadow: deps.transformShadow(props.
|
|
146
|
+
boxShadow: deps.transformShadow(props.shadow, globalTheme)
|
|
147
147
|
})
|
|
148
148
|
},
|
|
149
149
|
|
package/Timing.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.331",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "c1ce82619a9c90dcb12862a1cef1d7fc10b8718b",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@domql/state": "latest",
|
|
9
9
|
"@domql/utils": "latest",
|