@symbo.ls/atoms 2.10.290 → 2.11.9
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 +14 -14
- package/Media.js +7 -3
- package/package.json +3 -2
package/Collection.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
import { isState } from '@domql/state'
|
|
3
4
|
import { isNot, isArray, isObject, isObjectLike, diff, deepClone } from '@domql/utils'
|
|
4
5
|
|
|
5
6
|
export const Collection = {
|
|
@@ -31,7 +32,7 @@ export const Collection = {
|
|
|
31
32
|
|
|
32
33
|
$setStateCollection: (param, el, state) => {
|
|
33
34
|
if (!param) return
|
|
34
|
-
if (param
|
|
35
|
+
if (isState(param)) param = param.parse()
|
|
35
36
|
if (isNot(param)('array', 'object')) return
|
|
36
37
|
|
|
37
38
|
if (el.key === 'cnt') {
|
|
@@ -49,19 +50,15 @@ export const Collection = {
|
|
|
49
50
|
obj[key] = { state: isObjectLike(value) ? value : { value } }
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (el.props.lazyLoad) {
|
|
57
|
-
window.requestAnimationFrame(set)
|
|
58
|
-
} else set()
|
|
53
|
+
el.removeContent()
|
|
54
|
+
el.content = obj
|
|
59
55
|
|
|
60
56
|
return obj
|
|
61
57
|
},
|
|
62
58
|
|
|
63
59
|
$setPropsCollection: (param, el, state) => {
|
|
64
60
|
if (!param) return
|
|
61
|
+
if (isState(param)) param = param.parse()
|
|
65
62
|
if (isNot(param)('array', 'object')) return
|
|
66
63
|
|
|
67
64
|
const obj = { tag: 'fragment' }
|
|
@@ -70,13 +67,16 @@ export const Collection = {
|
|
|
70
67
|
obj[key] = { props: isObjectLike(value) ? value : { value } }
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
el.removeContent()
|
|
71
|
+
el.content = obj
|
|
72
|
+
|
|
73
|
+
// const set = () => {
|
|
74
|
+
// el.set(obj, { preventDefineUpdate: '$setPropsCollection' })
|
|
75
|
+
// }
|
|
76
76
|
|
|
77
|
-
if (el.props.lazyLoad) {
|
|
78
|
-
|
|
79
|
-
} else set()
|
|
77
|
+
// if (el.props && el.props.lazyLoad) {
|
|
78
|
+
// window.requestAnimationFrame(set)
|
|
79
|
+
// } else set()
|
|
80
80
|
|
|
81
81
|
return obj
|
|
82
82
|
}
|
package/Media.js
CHANGED
|
@@ -119,7 +119,7 @@ const beforeClassAssign = (element, s) => {
|
|
|
119
119
|
merge(className, CLASS_NAMES)
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
const initUpdate = element => {
|
|
122
|
+
const initUpdate = (changes, element) => {
|
|
123
123
|
const { props, context, class: className } = element
|
|
124
124
|
const globalTheme = context.designSystem.globalTheme
|
|
125
125
|
|
|
@@ -130,7 +130,7 @@ const initUpdate = element => {
|
|
|
130
130
|
inheritSpacingRatio: true
|
|
131
131
|
}, {
|
|
132
132
|
preventRecursive: true,
|
|
133
|
-
|
|
133
|
+
preventInitUpdateListener: true
|
|
134
134
|
})
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -146,7 +146,11 @@ const initUpdate = element => {
|
|
|
146
146
|
if (key === 'theme') {
|
|
147
147
|
props.update({
|
|
148
148
|
themeModifier: globalTheme
|
|
149
|
-
}, {
|
|
149
|
+
}, {
|
|
150
|
+
preventRecursive: true,
|
|
151
|
+
preventInitUpdateListener: true,
|
|
152
|
+
preventDefineUpdate: true
|
|
153
|
+
})
|
|
150
154
|
} else if (key === 'true') applyTrueProps(props[key], CLASS_NAMES, element)
|
|
151
155
|
if (setter) setter(key, props[key], CLASS_NAMES, element)
|
|
152
156
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/atoms",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.9",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "4b3675a0ee95441998a2c3d064d67bff82cc8b8d",
|
|
7
7
|
"dependencies": {
|
|
8
|
+
"@domql/state": "latest",
|
|
8
9
|
"@domql/utils": "latest",
|
|
9
10
|
"@symbo.ls/emotion": "latest",
|
|
10
11
|
"@symbo.ls/init": "latest",
|