@domql/element 2.5.168 → 2.5.170
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/utils/component.js +2 -9
- package/package.json +6 -6
- package/utils/component.js +2 -11
|
@@ -26,27 +26,20 @@ module.exports = __toCommonJS(component_exports);
|
|
|
26
26
|
var import_utils = require("@domql/utils");
|
|
27
27
|
var import_extend = require("../extend");
|
|
28
28
|
var import_mixins = require("../mixins");
|
|
29
|
-
const replaceOnKeys = (key) => key.replace(/on\w+/g, (match) => match.substring(2));
|
|
30
29
|
const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
|
|
31
30
|
const newElem = {
|
|
32
31
|
props: {},
|
|
33
|
-
define: {}
|
|
34
|
-
on: {}
|
|
32
|
+
define: {}
|
|
35
33
|
};
|
|
36
34
|
for (const k in el) {
|
|
37
35
|
const prop = el[k];
|
|
38
|
-
const isEvent = k.startsWith("on");
|
|
39
|
-
if (isEvent) {
|
|
40
|
-
const onKey = replaceOnKeys(prop);
|
|
41
|
-
newElem.on[onKey] = prop;
|
|
42
|
-
}
|
|
43
36
|
const isDefine = k.startsWith("is") || k.startsWith("has") || k.startsWith("use");
|
|
44
37
|
if (isDefine) {
|
|
45
38
|
newElem.define[k] = prop;
|
|
46
39
|
}
|
|
47
40
|
const isComponent = (0, import_utils.checkIfKeyIsComponent)(k);
|
|
48
41
|
const isRegistry = import_mixins.REGISTRY[k];
|
|
49
|
-
if (isComponent || isRegistry) {
|
|
42
|
+
if (isComponent || isRegistry || k === "data" || k === "state") {
|
|
50
43
|
newElem[k] = prop;
|
|
51
44
|
} else {
|
|
52
45
|
newElem.props[k] = prop;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.170",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@domql/event": "^2.5.
|
|
30
|
-
"@domql/render": "^2.5.
|
|
31
|
-
"@domql/state": "^2.5.
|
|
32
|
-
"@domql/utils": "^2.5.
|
|
29
|
+
"@domql/event": "^2.5.170",
|
|
30
|
+
"@domql/render": "^2.5.170",
|
|
31
|
+
"@domql/state": "^2.5.170",
|
|
32
|
+
"@domql/utils": "^2.5.170"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "44f9d2c4157170a03784d6abca2eee3604b97270",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/utils/component.js
CHANGED
|
@@ -13,22 +13,13 @@ import {
|
|
|
13
13
|
import { applyExtend } from '../extend'
|
|
14
14
|
import { REGISTRY } from '../mixins'
|
|
15
15
|
|
|
16
|
-
const replaceOnKeys = key => key.replace(/on\w+/g, match => match.substring(2))
|
|
17
|
-
|
|
18
16
|
export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
|
|
19
17
|
const newElem = {
|
|
20
18
|
props: {},
|
|
21
|
-
define: {}
|
|
22
|
-
on: {}
|
|
19
|
+
define: {}
|
|
23
20
|
}
|
|
24
21
|
for (const k in el) {
|
|
25
22
|
const prop = el[k]
|
|
26
|
-
const isEvent = k.startsWith('on')
|
|
27
|
-
if (isEvent) {
|
|
28
|
-
const onKey = replaceOnKeys(prop)
|
|
29
|
-
newElem.on[onKey] = prop
|
|
30
|
-
// } else if (!isMethod && checkIfKeyIsProperty(k)) {
|
|
31
|
-
}
|
|
32
23
|
|
|
33
24
|
const isDefine = k.startsWith('is') || k.startsWith('has') || k.startsWith('use')
|
|
34
25
|
if (isDefine) {
|
|
@@ -38,7 +29,7 @@ export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
|
|
|
38
29
|
|
|
39
30
|
const isComponent = checkIfKeyIsComponent(k)
|
|
40
31
|
const isRegistry = REGISTRY[k]
|
|
41
|
-
if (isComponent || isRegistry) {
|
|
32
|
+
if (isComponent || isRegistry || k === 'data' || k === 'state') {
|
|
42
33
|
newElem[k] = prop
|
|
43
34
|
} else {
|
|
44
35
|
newElem.props[k] = prop
|