@domql/element 2.5.109 → 2.5.111
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 +8 -4
- package/methods/index.js +7 -5
- package/package.json +2 -2
|
@@ -120,13 +120,17 @@ const lookdownAll = function(param, results = []) {
|
|
|
120
120
|
const setNodeStyles = function(params = {}) {
|
|
121
121
|
var _a;
|
|
122
122
|
const el = this;
|
|
123
|
-
|
|
124
|
-
if (!style)
|
|
123
|
+
if (!((_a = el.node) == null ? void 0 : _a.style))
|
|
125
124
|
return;
|
|
126
125
|
for (const param in params) {
|
|
127
|
-
|
|
126
|
+
const value = params[param];
|
|
127
|
+
const childElem = el[param];
|
|
128
|
+
if ((0, import_utils.isObject)(value) && childElem)
|
|
129
|
+
setNodeStyles.call(childElem, value);
|
|
130
|
+
else
|
|
131
|
+
el.node.style[param] = value;
|
|
128
132
|
}
|
|
129
|
-
return
|
|
133
|
+
return el;
|
|
130
134
|
};
|
|
131
135
|
const remove = function() {
|
|
132
136
|
const element = this;
|
package/methods/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { isDefined, isFunction, isObjectLike, isProduction } from '@domql/utils'
|
|
3
|
+
import { isDefined, isObject, isFunction, isObjectLike, isProduction } from '@domql/utils'
|
|
4
4
|
import { TREE } from '../tree'
|
|
5
5
|
import { parseFilters, registry } from '../mixins'
|
|
6
6
|
|
|
@@ -87,14 +87,16 @@ export const lookdownAll = function (param, results = []) {
|
|
|
87
87
|
|
|
88
88
|
export const setNodeStyles = function (params = {}) {
|
|
89
89
|
const el = this
|
|
90
|
-
|
|
91
|
-
if (!style) return
|
|
90
|
+
if (!el.node?.style) return
|
|
92
91
|
|
|
93
92
|
for (const param in params) {
|
|
94
|
-
|
|
93
|
+
const value = params[param]
|
|
94
|
+
const childElem = el[param]
|
|
95
|
+
if (isObject(value) && childElem) setNodeStyles.call(childElem, value)
|
|
96
|
+
else el.node.style[param] = value
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
return
|
|
99
|
+
return el
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
export const remove = function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.111",
|
|
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": "ec0f20662c99a27fa314328fc20e4c2ac2650cde",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|