@domql/element 2.5.106 → 2.5.108
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/methods/index.js +4 -2
- package/dist/cjs/mixins/attr.js +1 -1
- package/dist/cjs/mixins/html.js +2 -1
- package/dist/cjs/set.js +2 -4
- package/methods/index.js +2 -2
- package/mixins/attr.js +2 -2
- package/mixins/html.js +1 -1
- package/package.json +2 -2
- package/set.js +2 -3
|
@@ -77,6 +77,7 @@ const lookup = function(param) {
|
|
|
77
77
|
return parent;
|
|
78
78
|
};
|
|
79
79
|
const lookdown = function(param) {
|
|
80
|
+
var _a;
|
|
80
81
|
const el = this;
|
|
81
82
|
const { __ref: ref } = el;
|
|
82
83
|
const children = ref.__children;
|
|
@@ -91,13 +92,14 @@ const lookdown = function(param) {
|
|
|
91
92
|
return childElem;
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
const lookdown2 = childElem == null ? void 0 : childElem.lookdown(param);
|
|
95
|
+
const lookdown2 = (_a = childElem == null ? void 0 : childElem.lookdown) == null ? void 0 : _a.call(childElem, param);
|
|
95
96
|
if (lookdown2)
|
|
96
97
|
return lookdown2;
|
|
97
98
|
}
|
|
98
99
|
return null;
|
|
99
100
|
};
|
|
100
101
|
const lookdownAll = function(param, results = []) {
|
|
102
|
+
var _a;
|
|
101
103
|
const el = this;
|
|
102
104
|
const { __ref: ref } = el;
|
|
103
105
|
const children = ref.__children;
|
|
@@ -111,7 +113,7 @@ const lookdownAll = function(param, results = []) {
|
|
|
111
113
|
if (childElem.state && exec)
|
|
112
114
|
results.push(childElem);
|
|
113
115
|
}
|
|
114
|
-
childElem == null ? void 0 : childElem.lookdownAll(param, results);
|
|
116
|
+
(_a = childElem == null ? void 0 : childElem.lookdownAll) == null ? void 0 : _a.call(childElem, param, results);
|
|
115
117
|
}
|
|
116
118
|
return results.length ? results : null;
|
|
117
119
|
};
|
package/dist/cjs/mixins/attr.js
CHANGED
|
@@ -31,7 +31,7 @@ var attr_default = (params, element, node) => {
|
|
|
31
31
|
if (params) {
|
|
32
32
|
for (const attr in params) {
|
|
33
33
|
const val = (0, import_utils.exec)(params[attr], element);
|
|
34
|
-
if ((0, import_utils.
|
|
34
|
+
if (!(0, import_utils.isUndefined)(val) && !(0, import_utils.isNull)(val) && node.setAttribute)
|
|
35
35
|
node.setAttribute(attr, val);
|
|
36
36
|
else if (node.removeAttribute)
|
|
37
37
|
node.removeAttribute(attr);
|
package/dist/cjs/mixins/html.js
CHANGED
|
@@ -23,7 +23,8 @@ __export(html_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(html_exports);
|
|
24
24
|
var import_utils = require("@domql/utils");
|
|
25
25
|
var html_default = (param, element, node) => {
|
|
26
|
-
|
|
26
|
+
var _a;
|
|
27
|
+
const prop = (0, import_utils.exec)(param, element) || (0, import_utils.exec)((_a = element == null ? void 0 : element.props) == null ? void 0 : _a.html, element);
|
|
27
28
|
const { __ref } = element;
|
|
28
29
|
if (prop !== __ref.__html) {
|
|
29
30
|
if (node.nodeName === "SVG")
|
package/dist/cjs/set.js
CHANGED
|
@@ -48,11 +48,9 @@ const resetElement = (params, element, options) => {
|
|
|
48
48
|
...options
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
-
const reset = (
|
|
51
|
+
const reset = (options) => {
|
|
52
52
|
const element = void 0;
|
|
53
|
-
|
|
54
|
-
(0, import_content.removeContent)(element, options);
|
|
55
|
-
(0, import_create.default)(params, element, options.contentElementKey || "content", {
|
|
53
|
+
(0, import_create.default)(element, element.parent, void 0, {
|
|
56
54
|
ignoreChildExtend: true,
|
|
57
55
|
...import_mixins.registry.defaultOptions,
|
|
58
56
|
...import_options.default.create,
|
package/methods/index.js
CHANGED
|
@@ -58,7 +58,7 @@ export const lookdown = function (param) {
|
|
|
58
58
|
return childElem
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const lookdown = childElem?.lookdown(param)
|
|
61
|
+
const lookdown = childElem?.lookdown?.(param)
|
|
62
62
|
if (lookdown) return lookdown
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -79,7 +79,7 @@ export const lookdownAll = function (param, results = []) {
|
|
|
79
79
|
const exec = param(childElem, childElem.state, childElem.context)
|
|
80
80
|
if (childElem.state && exec) results.push(childElem)
|
|
81
81
|
}
|
|
82
|
-
childElem?.lookdownAll(param, results)
|
|
82
|
+
childElem?.lookdownAll?.(param, results)
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
return results.length ? results : null
|
package/mixins/attr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { exec, isNot,
|
|
3
|
+
import { exec, isNot, isNull, isUndefined } from '@domql/utils'
|
|
4
4
|
import { report } from '@domql/report'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -14,7 +14,7 @@ export default (params, element, node) => {
|
|
|
14
14
|
for (const attr in params) {
|
|
15
15
|
const val = exec(params[attr], element)
|
|
16
16
|
// if (__attr[attr] === val) return
|
|
17
|
-
if (
|
|
17
|
+
if (!isUndefined(val) && !isNull(val) && node.setAttribute) node.setAttribute(attr, val)
|
|
18
18
|
else if (node.removeAttribute) node.removeAttribute(attr)
|
|
19
19
|
__attr[attr] = val
|
|
20
20
|
}
|
package/mixins/html.js
CHANGED
|
@@ -7,7 +7,7 @@ import { exec } from '@domql/utils'
|
|
|
7
7
|
* an original one as a child
|
|
8
8
|
*/
|
|
9
9
|
export default (param, element, node) => {
|
|
10
|
-
const prop = exec(param, element)
|
|
10
|
+
const prop = exec(param, element) || exec(element?.props?.html, element)
|
|
11
11
|
const { __ref } = element
|
|
12
12
|
if (prop !== __ref.__html) {
|
|
13
13
|
// const parser = new window.DOMParser()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.108",
|
|
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": "ff2aaabca6543ef8e045b928e8bd222d62f4a409",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/set.js
CHANGED
|
@@ -17,10 +17,9 @@ export const resetElement = (params, element, options) => {
|
|
|
17
17
|
})
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export const reset = (
|
|
20
|
+
export const reset = (options) => {
|
|
21
21
|
const element = this
|
|
22
|
-
|
|
23
|
-
create(params, element, options.contentElementKey || 'content', {
|
|
22
|
+
create(element, element.parent, undefined, {
|
|
24
23
|
ignoreChildExtend: true,
|
|
25
24
|
...registry.defaultOptions,
|
|
26
25
|
...OPTIONS.create,
|