@domql/event 2.31.26 → 2.31.27

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/on.js CHANGED
@@ -72,7 +72,7 @@ const triggerEventOnUpdate = async (param, updatedObj, element, options) => {
72
72
  element,
73
73
  state,
74
74
  context,
75
- options
75
+ { calleeElement: element, ...options }
76
76
  );
77
77
  }
78
78
  };
package/dist/esm/on.js CHANGED
@@ -1,3 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
1
17
  import { isFunction, isString, getContextFunction } from "@domql/utils";
2
18
  const getOnOrPropsEvent = (param, element) => {
3
19
  var _a, _b;
@@ -45,7 +61,7 @@ const triggerEventOnUpdate = async (param, updatedObj, element, options) => {
45
61
  element,
46
62
  state,
47
63
  context,
48
- options
64
+ __spreadValues({ calleeElement: element }, options)
49
65
  );
50
66
  }
51
67
  };
package/on.js CHANGED
@@ -12,6 +12,11 @@ const getOnOrPropsEvent = (param, element) => {
12
12
  export const applyEvent = (fnValue, element, state, context, options) => {
13
13
  if (isString(fnValue)) fnValue = getContextFunction.call(element, fnValue)
14
14
  if (!fnValue.call) element.warn(`Event is not executable: ${fnValue}`)
15
+
16
+ // console.log('2.1. applyEvent:')
17
+ // console.log(element.__ref.path?.join('.'))
18
+ // console.log(element, options)
19
+
15
20
  return fnValue.call(
16
21
  element,
17
22
  element,
@@ -23,6 +28,11 @@ export const applyEvent = (fnValue, element, state, context, options) => {
23
28
 
24
29
  export const triggerEventOn = async (param, element, options) => {
25
30
  const appliedFunction = getOnOrPropsEvent(param, element)
31
+
32
+ // console.log('----')
33
+ // console.log('1. trigger update', param)
34
+ // console.log(element, options, options.calleeElement)
35
+
26
36
  if (appliedFunction) {
27
37
  const { state, context } = element
28
38
  return await applyEvent(appliedFunction, element, state, context, options)
@@ -39,6 +49,11 @@ export const applyEventUpdate = (
39
49
  ) => {
40
50
  if (isString(fnValue)) fnValue = getContextFunction.call(element, fnValue)
41
51
  if (!fnValue.call) element.warn(`Event is not executable: ${fnValue}`)
52
+
53
+ // console.log('2.1. applyEventUpdate:')
54
+ // console.log(element.__ref.path?.join('.'))
55
+ // console.log(element, options)
56
+
42
57
  return fnValue.call(
43
58
  element,
44
59
  updatedObj,
@@ -55,6 +70,10 @@ export const triggerEventOnUpdate = async (
55
70
  element,
56
71
  options
57
72
  ) => {
73
+ // console.log('----')
74
+ // console.log('2. trigger update', param)
75
+ // console.log(element, options, options.calleeElement)
76
+
58
77
  const appliedFunction = getOnOrPropsEvent(param, element)
59
78
  if (appliedFunction) {
60
79
  const { state, context } = element
@@ -64,7 +83,7 @@ export const triggerEventOnUpdate = async (
64
83
  element,
65
84
  state,
66
85
  context,
67
- options
86
+ { calleeElement: element, ...options }
68
87
  )
69
88
  }
70
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/event",
3
- "version": "2.31.26",
3
+ "version": "2.31.27",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -28,8 +28,8 @@
28
28
  "prepublish": "npm run build; npm run copy:package:cjs"
29
29
  },
30
30
  "dependencies": {
31
- "@domql/report": "^2.31.26",
32
- "@domql/utils": "^2.31.26"
31
+ "@domql/report": "^2.31.27",
32
+ "@domql/utils": "^2.31.27"
33
33
  },
34
- "gitHead": "126577d65a218af7e2f66b0a3f9691942ee8b9d2"
34
+ "gitHead": "0edcd5aae5c16b6a53a7e9b6512bb2562e8eb8a1"
35
35
  }