@domql/element 2.5.140 → 2.5.141
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 +2 -1
- package/dist/cjs/set.js +7 -1
- package/package.json +6 -6
- package/set.js +6 -2
package/create.js
CHANGED
|
@@ -259,10 +259,11 @@ const checkIfPrimitive = (element) => is(element)('string', 'number')
|
|
|
259
259
|
const applyValueAsText = (element, parent, key) => {
|
|
260
260
|
const extendTag = element.extend && element.extend.tag
|
|
261
261
|
const childExtendTag = parent.childExtend && parent.childExtend.tag
|
|
262
|
+
const childPropsTag = parent.props.childProps && parent.props.childProps.tag
|
|
262
263
|
const isKeyValidHTMLTag = ((HTML_TAGS.body.indexOf(key) > -1) && key)
|
|
263
264
|
return {
|
|
264
265
|
text: element,
|
|
265
|
-
tag: extendTag || childExtendTag || isKeyValidHTMLTag || 'string'
|
|
266
|
+
tag: extendTag || childExtendTag || childPropsTag || isKeyValidHTMLTag || 'string'
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
269
|
|
package/dist/cjs/create.js
CHANGED
|
@@ -208,10 +208,11 @@ const checkIfPrimitive = (element) => (0, import_utils.is)(element)("string", "n
|
|
|
208
208
|
const applyValueAsText = (element, parent, key) => {
|
|
209
209
|
const extendTag = element.extend && element.extend.tag;
|
|
210
210
|
const childExtendTag = parent.childExtend && parent.childExtend.tag;
|
|
211
|
+
const childPropsTag = parent.props.childProps && parent.props.childProps.tag;
|
|
211
212
|
const isKeyValidHTMLTag = import_utils.HTML_TAGS.body.indexOf(key) > -1 && key;
|
|
212
213
|
return {
|
|
213
214
|
text: element,
|
|
214
|
-
tag: extendTag || childExtendTag || isKeyValidHTMLTag || "string"
|
|
215
|
+
tag: extendTag || childExtendTag || childPropsTag || isKeyValidHTMLTag || "string"
|
|
215
216
|
};
|
|
216
217
|
};
|
|
217
218
|
const applyContext = (element, parent, options) => {
|
package/dist/cjs/set.js
CHANGED
|
@@ -60,6 +60,7 @@ const reset = (options) => {
|
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
const set = function(params, options = {}, el) {
|
|
63
|
+
var _a;
|
|
63
64
|
const element = el || this;
|
|
64
65
|
const { __ref: ref } = element;
|
|
65
66
|
const content = (0, import_utils.setContentKey)(element, options);
|
|
@@ -79,9 +80,14 @@ const set = function(params, options = {}, el) {
|
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
82
|
if (params) {
|
|
82
|
-
const { childExtend } = params;
|
|
83
|
+
const { childExtend, childProps, props } = params;
|
|
83
84
|
if (!childExtend && element.childExtend)
|
|
84
85
|
params.childExtend = element.childExtend;
|
|
86
|
+
if (!childProps && element.childProps)
|
|
87
|
+
params.childProps = element.childProps;
|
|
88
|
+
if (!(props == null ? void 0 : props.childProps) && ((_a = element.props) == null ? void 0 : _a.childProps)) {
|
|
89
|
+
params.props.childProps = element.props.childProps;
|
|
90
|
+
}
|
|
85
91
|
if (lazyLoad) {
|
|
86
92
|
window.requestAnimationFrame(() => resetElement(params, element, options));
|
|
87
93
|
} else
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.141",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"prepublish": "rimraf -I dist && yarn build && yarn 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.141",
|
|
30
|
+
"@domql/render": "^2.5.141",
|
|
31
|
+
"@domql/state": "^2.5.141",
|
|
32
|
+
"@domql/utils": "^2.5.141"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "c77d004ddb710821445be4dce056410b004f13ea",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/set.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { deepContains
|
|
3
|
+
import { deepContains, setContentKey } from '@domql/utils'
|
|
4
4
|
|
|
5
5
|
import create from './create'
|
|
6
6
|
import OPTIONS from './cache/options'
|
|
@@ -51,8 +51,12 @@ const set = function (params, options = {}, el) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (params) {
|
|
54
|
-
const { childExtend } = params
|
|
54
|
+
const { childExtend, childProps, props } = params
|
|
55
55
|
if (!childExtend && element.childExtend) params.childExtend = element.childExtend
|
|
56
|
+
if (!childProps && element.childProps) params.childProps = element.childProps
|
|
57
|
+
if (!props?.childProps && element.props?.childProps) {
|
|
58
|
+
params.props.childProps = element.props.childProps
|
|
59
|
+
}
|
|
56
60
|
|
|
57
61
|
if (lazyLoad) {
|
|
58
62
|
window.requestAnimationFrame(() => resetElement(params, element, options))
|