@domql/element 2.5.57 → 2.5.59
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/update.js +0 -2
- package/dist/cjs/utils/propEvents.js +5 -3
- package/package.json +2 -2
- package/update.js +1 -1
- package/utils/propEvents.js +5 -4
package/dist/cjs/update.js
CHANGED
|
@@ -92,8 +92,6 @@ const update = function(params = {}, options = UPDATE_DEFAULT_OPTIONS) {
|
|
|
92
92
|
}
|
|
93
93
|
const overwriteChanges = (0, import_utils.overwriteDeep)(element, params, import_utils2.METHODS_EXL);
|
|
94
94
|
const execChanges = (0, import_iterate.throughUpdatedExec)(element, { ignore: UPDATE_DEFAULT_OPTIONS });
|
|
95
|
-
if (element.key === "Navigation")
|
|
96
|
-
debugger;
|
|
97
95
|
const definedChanges = (0, import_iterate.throughUpdatedDefine)(element);
|
|
98
96
|
if (!options.isForced && !options.preventListeners) {
|
|
99
97
|
(0, import_event.triggerEventOn)("beforeClassAssign", element, options);
|
|
@@ -27,10 +27,12 @@ const propagateEventsFromProps = (element) => {
|
|
|
27
27
|
const eventKeysFromProps = Object.keys(props).filter((key) => key.startsWith("on"));
|
|
28
28
|
eventKeysFromProps.forEach((v) => {
|
|
29
29
|
const eventName = (0, import_utils.lowercaseFirstLetter)(v.split("on")[1]);
|
|
30
|
-
|
|
30
|
+
const origEvent = on[eventName];
|
|
31
|
+
if ((0, import_utils.isFunction)(origEvent)) {
|
|
31
32
|
on[eventName] = (...args) => {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const originalEventRetunrs = origEvent(...args);
|
|
34
|
+
if (originalEventRetunrs !== false)
|
|
35
|
+
props[v](...args);
|
|
34
36
|
};
|
|
35
37
|
} else
|
|
36
38
|
on[eventName] = props[v];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.59",
|
|
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": "8f9fd6c8f0c9b79542859548862864a0edc15e8e",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.0"
|
|
37
37
|
}
|
package/update.js
CHANGED
|
@@ -79,7 +79,7 @@ const update = function (params = {}, options = UPDATE_DEFAULT_OPTIONS) {
|
|
|
79
79
|
|
|
80
80
|
const overwriteChanges = overwriteDeep(element, params, METHODS_EXL)
|
|
81
81
|
const execChanges = throughUpdatedExec(element, { ignore: UPDATE_DEFAULT_OPTIONS })
|
|
82
|
-
if (element.key === 'Navigation') debugger
|
|
82
|
+
// if (element.key === 'Navigation') debugger
|
|
83
83
|
const definedChanges = throughUpdatedDefine(element)
|
|
84
84
|
|
|
85
85
|
if (!options.isForced && !options.preventListeners) {
|
package/utils/propEvents.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { lowercaseFirstLetter } from '@domql/utils'
|
|
3
|
+
import { isFunction, lowercaseFirstLetter } from '@domql/utils'
|
|
4
4
|
|
|
5
5
|
export const propagateEventsFromProps = (element) => {
|
|
6
6
|
const { props, on } = element
|
|
7
7
|
const eventKeysFromProps = Object.keys(props).filter(key => key.startsWith('on'))
|
|
8
8
|
eventKeysFromProps.forEach(v => {
|
|
9
9
|
const eventName = lowercaseFirstLetter(v.split('on')[1])
|
|
10
|
-
|
|
10
|
+
const origEvent = on[eventName]
|
|
11
|
+
if (isFunction(origEvent)) {
|
|
11
12
|
on[eventName] = (...args) => {
|
|
12
|
-
|
|
13
|
-
props[v](...args)
|
|
13
|
+
const originalEventRetunrs = origEvent(...args)
|
|
14
|
+
if (originalEventRetunrs !== false) props[v](...args)
|
|
14
15
|
}
|
|
15
16
|
} else on[eventName] = props[v]
|
|
16
17
|
})
|