domql 1.5.59 → 1.5.61
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "DOM rendering Javascript framework at early stage.",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "symbo.ls",
|
|
6
|
-
"version": "1.5.
|
|
6
|
+
"version": "1.5.61",
|
|
7
7
|
"repository": "https://github.com/domql/domql",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"registry": "https://registry.npmjs.org"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import DOM from '../../src'
|
|
4
|
-
import { isObjectLike, exec, isObject, isEqualDeep
|
|
4
|
+
import { isObjectLike, exec, isObject, isEqualDeep } from '../../src/utils'
|
|
5
5
|
import { classList } from '../../src/element/mixins'
|
|
6
6
|
import createEmotion from '@emotion/css/create-instance'
|
|
7
7
|
const ENV = process.env.NODE_ENV
|
|
8
8
|
|
|
9
9
|
export const transformEmotionStyle = (emotion, live) => {
|
|
10
|
-
return
|
|
10
|
+
return (params, element, node) => {
|
|
11
11
|
const execPareams = exec(params, element)
|
|
12
12
|
if (params) {
|
|
13
13
|
if (isObjectLike(element.class)) element.class.elementStyle = execPareams
|
|
@@ -26,7 +26,7 @@ export const classify = (obj, element) => {
|
|
|
26
26
|
|
|
27
27
|
export default (params, element, node, live) => {
|
|
28
28
|
if (!params) return
|
|
29
|
-
const { key, __className } = element
|
|
29
|
+
const { key, __className } = element // eslint-disable-line
|
|
30
30
|
if (params === true) params = element.class = { key }
|
|
31
31
|
if (isString(params)) params = element.class = { default: params }
|
|
32
32
|
if (isObject(params)) params = classify(params, element)
|
package/src/element/state.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { on } from '../event'
|
|
4
4
|
import { deepClone, exec, overwriteDeep } from '../utils'
|
|
5
|
-
import { is, isObject, isFunction } from '@domql/utils'
|
|
5
|
+
import { is, isObject, isFunction, isUndefined } from '@domql/utils'
|
|
6
6
|
|
|
7
7
|
export const IGNORE_STATE_PARAMS = [
|
|
8
8
|
'update', 'parse', 'clean', 'parent', '__element', '__depends', '__ref', '__root',
|
|
@@ -113,9 +113,10 @@ export default function (element, parent) {
|
|
|
113
113
|
if (stateKey) {
|
|
114
114
|
let parentState = parent.state
|
|
115
115
|
let parentStateKey
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
const parents = stateKey.split('../')
|
|
117
|
+
for (let i = 1; i < parents.length; i++) {
|
|
118
|
+
stateKey = parents[i]
|
|
119
|
+
parentState = parentState.parent
|
|
119
120
|
}
|
|
120
121
|
if (stateKey.includes('.')) {
|
|
121
122
|
[parentStateKey, stateKey] = stateKey.split('.')
|
|
@@ -127,6 +128,9 @@ export default function (element, parent) {
|
|
|
127
128
|
state = deepClone(keyInParentState)
|
|
128
129
|
} else if (is(keyInParentState)('string', 'number')) {
|
|
129
130
|
state = { value: keyInParentState }
|
|
131
|
+
} else if (isUndefined(keyInParentState)) {
|
|
132
|
+
console.warn(stateKey, 'is not in present', 'replacing with ', {})
|
|
133
|
+
state = {}
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
}
|