@domql/element 2.5.152 → 2.5.154
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 -0
- package/dist/cjs/create.js +1 -0
- package/dist/cjs/extend.js +1 -1
- package/dist/cjs/methods/index.js +12 -2
- package/dist/cjs/methods/set.js +2 -0
- package/dist/cjs/mixins/registry.js +2 -0
- package/dist/cjs/props/inherit.js +2 -1
- package/dist/cjs/utils/object.js +2 -0
- package/extend.js +1 -1
- package/methods/index.js +12 -1
- package/methods/set.js +4 -0
- package/mixins/registry.js +2 -0
- package/package.json +6 -6
- package/props/inherit.js +1 -1
- package/utils/object.js +2 -0
package/create.js
CHANGED
|
@@ -361,6 +361,8 @@ const onlyResolveExtends = (element, parent, key, options) => {
|
|
|
361
361
|
|
|
362
362
|
if (!element.props) element.props = {}
|
|
363
363
|
applyVariant(element, parent)
|
|
364
|
+
|
|
365
|
+
addElementIntoParentChildren(element, parent)
|
|
364
366
|
}
|
|
365
367
|
|
|
366
368
|
if (element.tag !== 'string' && element.tag !== 'fragment') {
|
package/dist/cjs/create.js
CHANGED
|
@@ -292,6 +292,7 @@ const onlyResolveExtends = (element, parent, key, options) => {
|
|
|
292
292
|
if (!element.props)
|
|
293
293
|
element.props = {};
|
|
294
294
|
(0, import_component.applyVariant)(element, parent);
|
|
295
|
+
addElementIntoParentChildren(element, parent);
|
|
295
296
|
}
|
|
296
297
|
if (element.tag !== "string" && element.tag !== "fragment") {
|
|
297
298
|
(0, import_iterate.throughInitialDefine)(element);
|
package/dist/cjs/extend.js
CHANGED
|
@@ -29,7 +29,7 @@ const applyExtend = (element, parent, options = {}) => {
|
|
|
29
29
|
if ((0, import_utils.isFunction)(element))
|
|
30
30
|
element = (0, import_utils.exec)(element, parent);
|
|
31
31
|
const { props, __ref } = element;
|
|
32
|
-
let extend = (props == null ? void 0 : props.extends) || element.extend;
|
|
32
|
+
let extend = (props == null ? void 0 : props.extends) || element.extends || element.extend;
|
|
33
33
|
const context = element.context || parent.context;
|
|
34
34
|
extend = (0, import_utils2.fallbackStringExtend)(extend, context, options);
|
|
35
35
|
const extendStack = (0, import_utils2.getExtendStack)(extend, context);
|
|
@@ -22,6 +22,8 @@ __export(methods_exports, {
|
|
|
22
22
|
defineSetter: () => defineSetter,
|
|
23
23
|
error: () => error,
|
|
24
24
|
get: () => get,
|
|
25
|
+
getPath: () => getPath,
|
|
26
|
+
getRef: () => getRef,
|
|
25
27
|
isMethod: () => isMethod,
|
|
26
28
|
keys: () => keys,
|
|
27
29
|
log: () => log,
|
|
@@ -161,6 +163,12 @@ function setProps(param, options) {
|
|
|
161
163
|
element.update({ props: param }, options);
|
|
162
164
|
return element;
|
|
163
165
|
}
|
|
166
|
+
function getRef() {
|
|
167
|
+
return this.__ref;
|
|
168
|
+
}
|
|
169
|
+
function getPath() {
|
|
170
|
+
return this.getRef().path;
|
|
171
|
+
}
|
|
164
172
|
const defineSetter = (element, key, get2, set) => Object.defineProperty(element, key, { get: get2, set });
|
|
165
173
|
function keys() {
|
|
166
174
|
const element = this;
|
|
@@ -222,9 +230,9 @@ function verbose(...args) {
|
|
|
222
230
|
} else {
|
|
223
231
|
console.log(ref.path);
|
|
224
232
|
const keys2 = element.keys();
|
|
225
|
-
keys2.forEach((v) => console.log(`%c${v}:
|
|
226
|
-
`, "font-weight: bold", element[v]));
|
|
233
|
+
keys2.forEach((v) => console.log(`%c${v}:`, "font-weight: bold", element[v]));
|
|
227
234
|
}
|
|
235
|
+
console.log(element);
|
|
228
236
|
console.groupEnd(element.key);
|
|
229
237
|
return element;
|
|
230
238
|
}
|
|
@@ -310,6 +318,8 @@ const METHODS = [
|
|
|
310
318
|
"lookup",
|
|
311
319
|
"lookdown",
|
|
312
320
|
"lookdownAll",
|
|
321
|
+
"getRef",
|
|
322
|
+
"getPath",
|
|
313
323
|
"setNodeStyles",
|
|
314
324
|
"spotByPath",
|
|
315
325
|
"keys",
|
package/dist/cjs/methods/set.js
CHANGED
|
@@ -49,6 +49,8 @@ const addMethods = (element, parent, options = {}) => {
|
|
|
49
49
|
lookup: import__.lookup,
|
|
50
50
|
lookdown: import__.lookdown,
|
|
51
51
|
lookdownAll: import__.lookdownAll,
|
|
52
|
+
getRef: import__.getRef,
|
|
53
|
+
getPath: import__.getPath,
|
|
52
54
|
setNodeStyles: import__.setNodeStyles,
|
|
53
55
|
spotByPath: import__.spotByPath,
|
|
54
56
|
parse: import__.parse,
|
|
@@ -29,6 +29,7 @@ const objectizeStringProperty = (propValue) => {
|
|
|
29
29
|
return propValue;
|
|
30
30
|
};
|
|
31
31
|
const inheritParentProps = (element, parent) => {
|
|
32
|
+
var _a;
|
|
32
33
|
let propsStack = [];
|
|
33
34
|
const parentProps = (0, import_utils.exec)(parent, parent.state).props;
|
|
34
35
|
const matchParent = parent.props && parentProps[element.key];
|
|
@@ -46,7 +47,7 @@ const inheritParentProps = (element, parent) => {
|
|
|
46
47
|
propsStack.push(objectizeStringProperty(matchParent));
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
if (matchParentChildProps)
|
|
50
|
+
if (matchParentChildProps && !((_a = element == null ? void 0 : element.props) == null ? void 0 : _a.ignoreChildProps))
|
|
50
51
|
propsStack.push(matchParentChildProps);
|
|
51
52
|
return propsStack;
|
|
52
53
|
};
|
package/dist/cjs/utils/object.js
CHANGED
package/extend.js
CHANGED
|
@@ -21,7 +21,7 @@ export const applyExtend = (element, parent, options = {}) => {
|
|
|
21
21
|
if (isFunction(element)) element = exec(element, parent)
|
|
22
22
|
|
|
23
23
|
const { props, __ref } = element
|
|
24
|
-
let extend = props?.extends || element.extend
|
|
24
|
+
let extend = props?.extends || element.extends || element.extend
|
|
25
25
|
const context = element.context || parent.context
|
|
26
26
|
|
|
27
27
|
extend = fallbackStringExtend(extend, context, options)
|
package/methods/index.js
CHANGED
|
@@ -123,6 +123,14 @@ export function setProps (param, options) {
|
|
|
123
123
|
return element
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
export function getRef () {
|
|
127
|
+
return this.__ref
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function getPath () {
|
|
131
|
+
return this.getRef().path
|
|
132
|
+
}
|
|
133
|
+
|
|
126
134
|
// export function set () {
|
|
127
135
|
// }
|
|
128
136
|
|
|
@@ -185,8 +193,9 @@ export function verbose (...args) {
|
|
|
185
193
|
} else {
|
|
186
194
|
console.log(ref.path)
|
|
187
195
|
const keys = element.keys()
|
|
188
|
-
keys.forEach(v => console.log(`%c${v}
|
|
196
|
+
keys.forEach(v => console.log(`%c${v}:`, 'font-weight: bold', element[v]))
|
|
189
197
|
}
|
|
198
|
+
console.log(element)
|
|
190
199
|
console.groupEnd(element.key)
|
|
191
200
|
return element
|
|
192
201
|
}
|
|
@@ -275,6 +284,8 @@ export const METHODS = [
|
|
|
275
284
|
'lookup',
|
|
276
285
|
'lookdown',
|
|
277
286
|
'lookdownAll',
|
|
287
|
+
'getRef',
|
|
288
|
+
'getPath',
|
|
278
289
|
'setNodeStyles',
|
|
279
290
|
'spotByPath',
|
|
280
291
|
'keys',
|
package/methods/set.js
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
lookup,
|
|
10
10
|
lookdown,
|
|
11
11
|
lookdownAll,
|
|
12
|
+
getRef,
|
|
13
|
+
getPath,
|
|
12
14
|
setNodeStyles,
|
|
13
15
|
setProps,
|
|
14
16
|
remove,
|
|
@@ -40,6 +42,8 @@ export const addMethods = (element, parent, options = {}) => {
|
|
|
40
42
|
lookup,
|
|
41
43
|
lookdown,
|
|
42
44
|
lookdownAll,
|
|
45
|
+
getRef,
|
|
46
|
+
getPath,
|
|
43
47
|
setNodeStyles,
|
|
44
48
|
spotByPath,
|
|
45
49
|
parse,
|
package/mixins/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.154",
|
|
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.154",
|
|
30
|
+
"@domql/render": "^2.5.154",
|
|
31
|
+
"@domql/state": "^2.5.154",
|
|
32
|
+
"@domql/utils": "^2.5.154"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "3971150df707cdc497b898f2f772946c1deb1fc1",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/props/inherit.js
CHANGED
|
@@ -28,7 +28,7 @@ export const inheritParentProps = (element, parent) => {
|
|
|
28
28
|
propsStack.push(objectizeStringProperty(matchParent))
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
if (matchParentChildProps) propsStack.push(matchParentChildProps)
|
|
31
|
+
if (matchParentChildProps && !element?.props?.ignoreChildProps) propsStack.push(matchParentChildProps)
|
|
32
32
|
|
|
33
33
|
return propsStack
|
|
34
34
|
}
|