@domql/element 2.5.107 → 2.5.109
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/mixins/attr.js +1 -1
- package/dist/cjs/mixins/html.js +2 -1
- package/mixins/attr.js +2 -2
- package/mixins/html.js +1 -1
- package/package.json +2 -2
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 (val !== false && !(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/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 (val !== false && !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.109",
|
|
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": "dfa037cb33f1053acf140d2efc28e02e68a35eac",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|