@domql/element 2.5.74 → 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/utils/component.js +2 -2
- package/package.json +2 -2
- 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);
|
|
@@ -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/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/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
|