@domql/element 2.5.105 → 2.5.107
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 +5 -2
- package/dist/cjs/methods/set.js +1 -0
- package/dist/cjs/mixins/registry.js +1 -0
- package/dist/cjs/set.js +10 -0
- package/methods/index.js +3 -2
- package/methods/set.js +2 -1
- package/mixins/registry.js +1 -0
- package/package.json +2 -2
- package/set.js +10 -0
|
@@ -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
|
};
|
|
@@ -231,6 +233,7 @@ const previousElement = function(el) {
|
|
|
231
233
|
};
|
|
232
234
|
const METHODS = [
|
|
233
235
|
"set",
|
|
236
|
+
"reset",
|
|
234
237
|
"update",
|
|
235
238
|
"remove",
|
|
236
239
|
"updateContent",
|
package/dist/cjs/methods/set.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_content = require("../mixins/content");
|
|
|
39
39
|
const addMethods = (element, parent) => {
|
|
40
40
|
const proto = {
|
|
41
41
|
set: import_set.default.bind(element),
|
|
42
|
+
reset: import_set.reset.bind(element),
|
|
42
43
|
update: import_update.default.bind(element),
|
|
43
44
|
remove: import__.remove.bind(element),
|
|
44
45
|
updateContent: import_content.updateContent.bind(element),
|
package/dist/cjs/set.js
CHANGED
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var set_exports = {};
|
|
30
30
|
__export(set_exports, {
|
|
31
31
|
default: () => set_default,
|
|
32
|
+
reset: () => reset,
|
|
32
33
|
resetElement: () => resetElement
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(set_exports);
|
|
@@ -47,6 +48,15 @@ const resetElement = (params, element, options) => {
|
|
|
47
48
|
...options
|
|
48
49
|
});
|
|
49
50
|
};
|
|
51
|
+
const reset = (options) => {
|
|
52
|
+
const element = void 0;
|
|
53
|
+
(0, import_create.default)(element, element.parent, void 0, {
|
|
54
|
+
ignoreChildExtend: true,
|
|
55
|
+
...import_mixins.registry.defaultOptions,
|
|
56
|
+
...import_options.default.create,
|
|
57
|
+
...options
|
|
58
|
+
});
|
|
59
|
+
};
|
|
50
60
|
const set = function(params, options = {}, el) {
|
|
51
61
|
const element = el || this;
|
|
52
62
|
const { __ref: ref, content } = element;
|
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
|
|
@@ -209,6 +209,7 @@ export const previousElement = function (el) {
|
|
|
209
209
|
|
|
210
210
|
export const METHODS = [
|
|
211
211
|
'set',
|
|
212
|
+
'reset',
|
|
212
213
|
'update',
|
|
213
214
|
'remove',
|
|
214
215
|
'updateContent',
|
package/methods/set.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { isDevelopment } from '@domql/utils'
|
|
4
4
|
|
|
5
|
-
import set from '../set'
|
|
5
|
+
import set, { reset } from '../set'
|
|
6
6
|
import update from '../update'
|
|
7
7
|
|
|
8
8
|
import {
|
|
@@ -26,6 +26,7 @@ import { removeContent, updateContent } from '../mixins/content'
|
|
|
26
26
|
export const addMethods = (element, parent) => {
|
|
27
27
|
const proto = {
|
|
28
28
|
set: set.bind(element),
|
|
29
|
+
reset: reset.bind(element),
|
|
29
30
|
update: update.bind(element),
|
|
30
31
|
remove: remove.bind(element),
|
|
31
32
|
updateContent: updateContent.bind(element),
|
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.107",
|
|
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": "a313ce03e61603c66db67f1264c172805edb273e",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/set.js
CHANGED
|
@@ -17,6 +17,16 @@ export const resetElement = (params, element, options) => {
|
|
|
17
17
|
})
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export const reset = (options) => {
|
|
21
|
+
const element = this
|
|
22
|
+
create(element, element.parent, undefined, {
|
|
23
|
+
ignoreChildExtend: true,
|
|
24
|
+
...registry.defaultOptions,
|
|
25
|
+
...OPTIONS.create,
|
|
26
|
+
...options
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
20
30
|
const set = function (params, options = {}, el) {
|
|
21
31
|
const element = el || this
|
|
22
32
|
const { __ref: ref, content } = element
|