@domql/element 2.5.19 → 2.5.21
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/dist/cjs/props/create.js +5 -10
- package/dist/cjs/set.js +4 -3
- package/package.json +2 -2
- package/props/create.js +5 -10
- package/set.js +4 -3
package/dist/cjs/props/create.js
CHANGED
|
@@ -64,17 +64,12 @@ const syncProps = (props, element) => {
|
|
|
64
64
|
const createProps = function(element, parent, cached) {
|
|
65
65
|
const { __ref: ref } = element;
|
|
66
66
|
if (ref.__if) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else {
|
|
73
|
-
element.props = {};
|
|
74
|
-
}
|
|
75
|
-
} catch (e) {
|
|
67
|
+
const propsStack = cached || createPropsStack(element, parent);
|
|
68
|
+
if (propsStack.length) {
|
|
69
|
+
ref.__props = propsStack;
|
|
70
|
+
syncProps(propsStack, element);
|
|
71
|
+
} else {
|
|
76
72
|
element.props = {};
|
|
77
|
-
ref.__props = cached || [];
|
|
78
73
|
}
|
|
79
74
|
} else {
|
|
80
75
|
element.props = {};
|
package/dist/cjs/set.js
CHANGED
|
@@ -38,11 +38,12 @@ var import_mixins = require("./mixins");
|
|
|
38
38
|
var import_content = require("./mixins/content");
|
|
39
39
|
const set = function(params, options = {}, el) {
|
|
40
40
|
const element = el || this;
|
|
41
|
-
const
|
|
41
|
+
const { __ref: ref, content } = element;
|
|
42
|
+
const __contentRef = content && content.__ref;
|
|
42
43
|
const lazyLoad = element.props && element.props.lazyLoad;
|
|
43
|
-
if (__contentRef && __contentRef.__cached && (0, import_utils.deepContains)(params,
|
|
44
|
+
if (ref.__noCollectionDifference || __contentRef && __contentRef.__cached && (0, import_utils.deepContains)(params, content)) {
|
|
44
45
|
console.log("is content equal");
|
|
45
|
-
return
|
|
46
|
+
return content.update();
|
|
46
47
|
}
|
|
47
48
|
if (options.preventContentUpdate === true)
|
|
48
49
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@domql/state": "latest",
|
|
32
32
|
"@domql/utils": "latest"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "bc6fd0276b416145cb0d1435a6ec12c97ea97753",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/props/create.js
CHANGED
|
@@ -52,16 +52,11 @@ export const createProps = function (element, parent, cached) {
|
|
|
52
52
|
const { __ref: ref } = element
|
|
53
53
|
|
|
54
54
|
if (ref.__if) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} else { element.props = {} }
|
|
61
|
-
} catch (e) {
|
|
62
|
-
element.props = {}
|
|
63
|
-
ref.__props = cached || []
|
|
64
|
-
}
|
|
55
|
+
const propsStack = cached || createPropsStack(element, parent)
|
|
56
|
+
if (propsStack.length) {
|
|
57
|
+
ref.__props = propsStack
|
|
58
|
+
syncProps(propsStack, element)
|
|
59
|
+
} else { element.props = {} }
|
|
65
60
|
} else {
|
|
66
61
|
element.props = {}
|
|
67
62
|
ref.__props = cached || []
|
package/set.js
CHANGED
|
@@ -9,12 +9,13 @@ import { removeContent } from './mixins/content'
|
|
|
9
9
|
|
|
10
10
|
const set = function (params, options = {}, el) {
|
|
11
11
|
const element = el || this
|
|
12
|
-
const
|
|
12
|
+
const { __ref: ref, content } = element
|
|
13
|
+
const __contentRef = content && content.__ref
|
|
13
14
|
const lazyLoad = element.props && element.props.lazyLoad
|
|
14
15
|
|
|
15
|
-
if (__contentRef && __contentRef.__cached && deepContains(params,
|
|
16
|
+
if (ref.__noCollectionDifference || (__contentRef && __contentRef.__cached && deepContains(params, content))) {
|
|
16
17
|
console.log('is content equal')
|
|
17
|
-
return
|
|
18
|
+
return content.update()
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
if (options.preventContentUpdate === true) return
|