@domql/element 2.5.73 → 2.5.75
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/create.js +2 -1
- package/dist/cjs/create.js +4 -1
- package/dist/cjs/node.js +2 -0
- package/dist/cjs/update.js +2 -0
- package/dist/cjs/utils/component.js +2 -2
- package/node.js +2 -0
- package/package.json +2 -2
- package/update.js +2 -0
- package/utils/component.js +2 -2
package/create.js
CHANGED
|
@@ -153,7 +153,8 @@ const redefineElement = (element, parent, key, options) => {
|
|
|
153
153
|
const elementWrapper = createBasedOnType(element, parent, key, options)
|
|
154
154
|
|
|
155
155
|
if (options.syntaxv3 || (element.props && element.props.syntaxv3) || (parent && parent.props && parent.props.syntaxv3) /* kalduna guard */) {
|
|
156
|
-
element.props.syntaxv3 = true
|
|
156
|
+
if (element.props) element.props.syntaxv3 = true
|
|
157
|
+
else element.syntaxv3 = true
|
|
157
158
|
return createValidDomqlObjectFromSugar(element, parent, key, options)
|
|
158
159
|
} else if (checkIfKeyIsComponent(key)) {
|
|
159
160
|
return applyKeyComponentAsExtend(elementWrapper, parent, key)
|
package/dist/cjs/create.js
CHANGED
|
@@ -117,7 +117,10 @@ const createBasedOnType = (element, parent, key, options) => {
|
|
|
117
117
|
const redefineElement = (element, parent, key, options) => {
|
|
118
118
|
const elementWrapper = createBasedOnType(element, parent, key, options);
|
|
119
119
|
if (options.syntaxv3 || element.props && element.props.syntaxv3 || parent && parent.props && parent.props.syntaxv3) {
|
|
120
|
-
element.props
|
|
120
|
+
if (element.props)
|
|
121
|
+
element.props.syntaxv3 = true;
|
|
122
|
+
else
|
|
123
|
+
element.syntaxv3 = true;
|
|
121
124
|
return (0, import_component.createValidDomqlObjectFromSugar)(element, parent, key, options);
|
|
122
125
|
} else if ((0, import_component.checkIfKeyIsComponent)(key)) {
|
|
123
126
|
return (0, import_component.applyKeyComponentAsExtend)(elementWrapper, parent, key);
|
package/dist/cjs/node.js
CHANGED
|
@@ -70,6 +70,8 @@ const createNode = (element, options) => {
|
|
|
70
70
|
}
|
|
71
71
|
for (const param in element) {
|
|
72
72
|
const value = element[param];
|
|
73
|
+
if (!Object.hasOwnProperty.call(element, param))
|
|
74
|
+
continue;
|
|
73
75
|
if ((0, import_utils.isUndefined)(value) || (0, import_methods.isMethod)(param) || (0, import_utils2.isVariant)(param) || (0, import_utils.isObject)(import_mixins.registry[param]))
|
|
74
76
|
continue;
|
|
75
77
|
const isElement = (0, import_applyParam.applyParam)(param, element, options);
|
package/dist/cjs/update.js
CHANGED
|
@@ -126,6 +126,8 @@ const update = function(params = {}, options = UPDATE_DEFAULT_OPTIONS) {
|
|
|
126
126
|
}
|
|
127
127
|
for (const param in element) {
|
|
128
128
|
const prop = element[param];
|
|
129
|
+
if (!Object.hasOwnProperty.call(element, param))
|
|
130
|
+
continue;
|
|
129
131
|
const hasOnlyUpdateFalsy = onlyUpdate && (onlyUpdate !== param || !element.lookup(onlyUpdate));
|
|
130
132
|
const isInPreventUpdate = (0, import_utils.isArray)(preventUpdate) && preventUpdate.includes(param);
|
|
131
133
|
const isInPreventDefineUpdate = (0, import_utils.isArray)(preventDefineUpdate) && preventDefineUpdate.includes(param);
|
|
@@ -76,8 +76,8 @@ const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
|
|
|
76
76
|
};
|
|
77
77
|
for (const k in el) {
|
|
78
78
|
const prop = el[k];
|
|
79
|
-
const isEvent =
|
|
80
|
-
const isMethod =
|
|
79
|
+
const isEvent = k.startsWith("on");
|
|
80
|
+
const isMethod = k.startsWith("$");
|
|
81
81
|
if (isEvent) {
|
|
82
82
|
const onKey = replaceOnKeys(prop);
|
|
83
83
|
newElem.on[onKey] = prop;
|
package/node.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.75",
|
|
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": "aed026de97492c8c0e4da1f47cb027bc6db63362",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/update.js
CHANGED
|
@@ -111,6 +111,8 @@ const update = function (params = {}, options = UPDATE_DEFAULT_OPTIONS) {
|
|
|
111
111
|
for (const param in element) {
|
|
112
112
|
const prop = element[param]
|
|
113
113
|
|
|
114
|
+
if (!Object.hasOwnProperty.call(element, param)) continue
|
|
115
|
+
|
|
114
116
|
const hasOnlyUpdateFalsy = onlyUpdate && (onlyUpdate !== param || !element.lookup(onlyUpdate))
|
|
115
117
|
const isInPreventUpdate = isArray(preventUpdate) && preventUpdate.includes(param)
|
|
116
118
|
const isInPreventDefineUpdate = isArray(preventDefineUpdate) && preventDefineUpdate.includes(param)
|
package/utils/component.js
CHANGED
|
@@ -49,8 +49,8 @@ export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
|
|
|
49
49
|
}
|
|
50
50
|
for (const k in el) {
|
|
51
51
|
const prop = el[k]
|
|
52
|
-
const isEvent =
|
|
53
|
-
const isMethod =
|
|
52
|
+
const isEvent = k.startsWith('on')
|
|
53
|
+
const isMethod = k.startsWith('$')
|
|
54
54
|
if (isEvent) {
|
|
55
55
|
const onKey = replaceOnKeys(prop)
|
|
56
56
|
newElem.on[onKey] = prop
|