@headless-adminapp/app 1.0.0 → 1.0.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useOnFieldValueChangeListener(key: string, callback: (value: any) => any): void;
|
|
1
|
+
export declare function useOnFieldValueChangeListener(key: string, callback: (value: any, previousValue: any) => any): void;
|
|
@@ -9,7 +9,7 @@ function useOnFieldValueChangeListener(key, callback) {
|
|
|
9
9
|
const callbackRef = (0, react_1.useRef)(callback);
|
|
10
10
|
callbackRef.current = callback;
|
|
11
11
|
(0, react_1.useEffect)(() => {
|
|
12
|
-
const listener = (_key, value) => {
|
|
12
|
+
const listener = (_key, value, previousValue) => {
|
|
13
13
|
const _path = _key.split('.');
|
|
14
14
|
const path = key.split('.');
|
|
15
15
|
if (_path.length !== path.length) {
|
|
@@ -20,7 +20,7 @@ function useOnFieldValueChangeListener(key, callback) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
callbackRef.current(value);
|
|
23
|
+
callbackRef.current(value, previousValue);
|
|
24
24
|
};
|
|
25
25
|
eventManager.on(constants_1.EVENT_KEY_ON_FIELD_CHANGE, listener);
|
|
26
26
|
return () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
"keywords": [],
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "ISC",
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@tanstack/react-query": "^5.51.1"
|
|
25
|
+
},
|
|
23
26
|
"dependencies": {
|
|
24
27
|
"@hookform/resolvers": "^3.9.0",
|
|
25
|
-
"@tanstack/react-query": "5.51.1",
|
|
26
28
|
"clsx": "2.1.1",
|
|
27
29
|
"dayjs": "^1.11.13",
|
|
28
30
|
"exceljs": "^4.4.0",
|
|
@@ -34,5 +36,5 @@
|
|
|
34
36
|
"uuid": "11.0.3",
|
|
35
37
|
"yup": "^1.4.0"
|
|
36
38
|
},
|
|
37
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "fc167255beb567e4557fa7024f8db669db8aaa33"
|
|
38
40
|
}
|