@domql/element 2.5.131 → 2.5.132
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/update.js +1 -3
- package/dist/cjs/utils/applyParam.js +3 -1
- package/package.json +2 -2
- package/update.js +2 -3
- package/utils/applyParam.js +5 -1
package/dist/cjs/update.js
CHANGED
|
@@ -109,7 +109,6 @@ const update = function(params = {}, opts) {
|
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
const {
|
|
112
|
-
onlyUpdate,
|
|
113
112
|
preventUpdate,
|
|
114
113
|
preventDefineUpdate,
|
|
115
114
|
preventContentUpdate,
|
|
@@ -134,11 +133,10 @@ const update = function(params = {}, opts) {
|
|
|
134
133
|
}
|
|
135
134
|
if (!Object.hasOwnProperty.call(element, param))
|
|
136
135
|
continue;
|
|
137
|
-
const hasOnlyUpdateFalsy = onlyUpdate && (onlyUpdate !== param || !element.lookup(onlyUpdate));
|
|
138
136
|
const isInPreventUpdate = (0, import_utils.isArray)(preventUpdate) && preventUpdate.includes(param);
|
|
139
137
|
const isInPreventDefineUpdate = (0, import_utils.isArray)(preventDefineUpdate) && preventDefineUpdate.includes(param);
|
|
140
138
|
const hasCollection = element.$collection || element.$stateCollection || element.$propsCollection;
|
|
141
|
-
if ((0, import_utils.isUndefined)(prop) ||
|
|
139
|
+
if ((0, import_utils.isUndefined)(prop) || isInPreventUpdate || isInPreventDefineUpdate || preventDefineUpdate === true || preventDefineUpdate === param || preventContentUpdate && param === "content" && !hasCollection || (preventStateUpdate && param) === "state" || (0, import_methods.isMethod)(param) || (0, import_utils.isObject)(import_mixins.registry[param]) || (0, import_utils.isVariant)(param))
|
|
142
140
|
continue;
|
|
143
141
|
if (preventStateUpdate === "once")
|
|
144
142
|
options.preventStateUpdate = false;
|
|
@@ -26,6 +26,7 @@ var import_mixins = require("../mixins");
|
|
|
26
26
|
const applyParam = (param, element, options) => {
|
|
27
27
|
const { node, context, __ref: ref } = element;
|
|
28
28
|
const prop = element[param];
|
|
29
|
+
const { onlyUpdate } = options;
|
|
29
30
|
const DOMQLProperty = import_mixins.registry[param];
|
|
30
31
|
const DOMQLPropertyFromContext = context && context.registry && context.registry[param];
|
|
31
32
|
const isGlobalTransformer = DOMQLPropertyFromContext || DOMQLProperty;
|
|
@@ -33,7 +34,8 @@ const applyParam = (param, element, options) => {
|
|
|
33
34
|
const hasContextDefine = context && context.define && context.define[param];
|
|
34
35
|
if (!ref.__if)
|
|
35
36
|
return;
|
|
36
|
-
|
|
37
|
+
const hasOnlyUpdate = onlyUpdate ? onlyUpdate === param || element.lookup(onlyUpdate) : true;
|
|
38
|
+
if (isGlobalTransformer && !hasContextDefine && hasOnlyUpdate) {
|
|
37
39
|
if ((0, import_utils.isFunction)(isGlobalTransformer)) {
|
|
38
40
|
isGlobalTransformer(prop, element, node, options);
|
|
39
41
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.132",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@domql/state": "latest",
|
|
33
33
|
"@domql/utils": "latest"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "d4f45522f7132c6d8413f7babae9c1780eb70300",
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "^7.12.0"
|
|
38
38
|
}
|
package/update.js
CHANGED
|
@@ -101,7 +101,7 @@ const update = function (params = {}, opts) {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
const {
|
|
104
|
-
|
|
104
|
+
preventUpdate, preventDefineUpdate, preventContentUpdate, preventStateUpdate,
|
|
105
105
|
preventRecursive, preventUpdateListener, preventUpdateAfter, preventUpdateAfterCount
|
|
106
106
|
} = options
|
|
107
107
|
|
|
@@ -120,7 +120,6 @@ const update = function (params = {}, opts) {
|
|
|
120
120
|
|
|
121
121
|
if (!Object.hasOwnProperty.call(element, param)) continue
|
|
122
122
|
|
|
123
|
-
const hasOnlyUpdateFalsy = onlyUpdate && (onlyUpdate !== param || !element.lookup(onlyUpdate))
|
|
124
123
|
const isInPreventUpdate = isArray(preventUpdate) && preventUpdate.includes(param)
|
|
125
124
|
const isInPreventDefineUpdate = isArray(preventDefineUpdate) && preventDefineUpdate.includes(param)
|
|
126
125
|
|
|
@@ -128,7 +127,6 @@ const update = function (params = {}, opts) {
|
|
|
128
127
|
|
|
129
128
|
if (
|
|
130
129
|
isUndefined(prop) ||
|
|
131
|
-
hasOnlyUpdateFalsy ||
|
|
132
130
|
isInPreventUpdate ||
|
|
133
131
|
isInPreventDefineUpdate ||
|
|
134
132
|
preventDefineUpdate === true ||
|
|
@@ -137,6 +135,7 @@ const update = function (params = {}, opts) {
|
|
|
137
135
|
(preventStateUpdate && param) === 'state' ||
|
|
138
136
|
isMethod(param) || isObject(registry[param]) || isVariant(param)
|
|
139
137
|
) continue
|
|
138
|
+
|
|
140
139
|
if (preventStateUpdate === 'once') options.preventStateUpdate = false
|
|
141
140
|
|
|
142
141
|
const isElement = applyParam(param, element, options)
|
package/utils/applyParam.js
CHANGED
|
@@ -7,6 +7,8 @@ export const applyParam = (param, element, options) => {
|
|
|
7
7
|
const { node, context, __ref: ref } = element
|
|
8
8
|
const prop = element[param]
|
|
9
9
|
|
|
10
|
+
const { onlyUpdate } = options
|
|
11
|
+
|
|
10
12
|
const DOMQLProperty = registry[param]
|
|
11
13
|
const DOMQLPropertyFromContext = context && context.registry && context.registry[param]
|
|
12
14
|
const isGlobalTransformer = DOMQLPropertyFromContext || DOMQLProperty
|
|
@@ -16,7 +18,9 @@ export const applyParam = (param, element, options) => {
|
|
|
16
18
|
|
|
17
19
|
if (!ref.__if) return
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
const hasOnlyUpdate = onlyUpdate ? (onlyUpdate === param || element.lookup(onlyUpdate)) : true
|
|
22
|
+
|
|
23
|
+
if (isGlobalTransformer && !hasContextDefine && hasOnlyUpdate) {
|
|
20
24
|
if (isFunction(isGlobalTransformer)) {
|
|
21
25
|
isGlobalTransformer(prop, element, node, options)
|
|
22
26
|
return
|