@canlooks/can-ui 0.0.178 → 0.0.180
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/components/button/button.style.js +4 -0
- package/dist/cjs/extensions/reactiveForm/reactiveFormItem.js +0 -4
- package/dist/cjs/utils/hooks.js +10 -5
- package/dist/esm/components/button/button.style.js +4 -0
- package/dist/esm/extensions/reactiveForm/reactiveFormItem.js +0 -4
- package/dist/esm/utils/hooks.js +10 -5
- package/package.json +11 -11
|
@@ -26,10 +26,6 @@ function InnerFormItem({ dependencies, checked, value, onChange, ...props }) {
|
|
|
26
26
|
props.children.props?.onChange?.(e);
|
|
27
27
|
onChange?.(e);
|
|
28
28
|
context.onChange?.();
|
|
29
|
-
},
|
|
30
|
-
onkeydown(e) {
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
props.children.props?.onkeydown?.(e);
|
|
33
29
|
}
|
|
34
30
|
};
|
|
35
31
|
return ((0, jsx_runtime_1.jsx)(form_1.FormItem, { ...props, ref: (0, utils_1.cloneRef)(formItemRef, props.ref), _fieldValue: checked ?? value, children: (_, styleProps, key) => {
|
package/dist/cjs/utils/hooks.js
CHANGED
|
@@ -82,11 +82,15 @@ function useUnmounted(onUnmount) {
|
|
|
82
82
|
(0, react_1.useMemo)(() => {
|
|
83
83
|
mountTimes.current++;
|
|
84
84
|
}, []);
|
|
85
|
-
(0, react_1.useEffect)(() =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
(0, react_1.useEffect)(() => {
|
|
86
|
+
// 在<Activity/>组件中,组件可以重新激活
|
|
87
|
+
isUnmounted.current = false;
|
|
88
|
+
return () => {
|
|
89
|
+
if (!--mountTimes.current) {
|
|
90
|
+
isUnmounted.current = true;
|
|
91
|
+
onUnmount?.();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
90
94
|
}, []);
|
|
91
95
|
return isUnmounted;
|
|
92
96
|
}
|
|
@@ -122,6 +126,7 @@ function useLoading(fn, referredLoading = false) {
|
|
|
122
126
|
return await res;
|
|
123
127
|
}
|
|
124
128
|
finally {
|
|
129
|
+
console.log(157, unmounted.current);
|
|
125
130
|
!unmounted.current && setLoading(false);
|
|
126
131
|
}
|
|
127
132
|
}
|
|
@@ -23,10 +23,6 @@ function InnerFormItem({ dependencies, checked, value, onChange, ...props }) {
|
|
|
23
23
|
props.children.props?.onChange?.(e);
|
|
24
24
|
onChange?.(e);
|
|
25
25
|
context.onChange?.();
|
|
26
|
-
},
|
|
27
|
-
onkeydown(e) {
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
props.children.props?.onkeydown?.(e);
|
|
30
26
|
}
|
|
31
27
|
};
|
|
32
28
|
return (_jsx(FormItem, { ...props, ref: cloneRef(formItemRef, props.ref), _fieldValue: checked ?? value, children: (_, styleProps, key) => {
|
package/dist/esm/utils/hooks.js
CHANGED
|
@@ -67,11 +67,15 @@ export function useUnmounted(onUnmount) {
|
|
|
67
67
|
useMemo(() => {
|
|
68
68
|
mountTimes.current++;
|
|
69
69
|
}, []);
|
|
70
|
-
useEffect(() =>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
// 在<Activity/>组件中,组件可以重新激活
|
|
72
|
+
isUnmounted.current = false;
|
|
73
|
+
return () => {
|
|
74
|
+
if (!--mountTimes.current) {
|
|
75
|
+
isUnmounted.current = true;
|
|
76
|
+
onUnmount?.();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
75
79
|
}, []);
|
|
76
80
|
return isUnmounted;
|
|
77
81
|
}
|
|
@@ -107,6 +111,7 @@ export function useLoading(fn, referredLoading = false) {
|
|
|
107
111
|
return await res;
|
|
108
112
|
}
|
|
109
113
|
finally {
|
|
114
|
+
console.log(157, unmounted.current);
|
|
110
115
|
!unmounted.current && setLoading(false);
|
|
111
116
|
}
|
|
112
117
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canlooks/can-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.180",
|
|
4
4
|
"author": "C.CanLiang <canlooks@gmail.com>",
|
|
5
5
|
"description": "My ui framework",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@fortawesome/free-brands-svg-icons": "^7.2.0",
|
|
52
52
|
"@fortawesome/free-regular-svg-icons": "^7.2.0",
|
|
53
53
|
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
54
|
-
"@fortawesome/react-fontawesome": "^3.3.
|
|
54
|
+
"@fortawesome/react-fontawesome": "^3.3.1",
|
|
55
55
|
"@types/react-transition-group": "^4.4.12",
|
|
56
56
|
"color": "^5.0.3",
|
|
57
57
|
"dayjs": "^1.11.20",
|
|
@@ -60,25 +60,25 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@ant-design/icons": "^6.1.1",
|
|
63
|
-
"@canlooks/react-router": "^
|
|
64
|
-
"@canlooks/reactive": "^4.7.
|
|
63
|
+
"@canlooks/react-router": "^2.0.6",
|
|
64
|
+
"@canlooks/reactive": "^4.7.18",
|
|
65
65
|
"@emotion/styled": "^11.14.1",
|
|
66
66
|
"@mdi/js": "^7.4.47",
|
|
67
67
|
"@mdi/react": "^1.6.1",
|
|
68
|
-
"@mui/icons-material": "^
|
|
69
|
-
"@types/node": "^25.
|
|
68
|
+
"@mui/icons-material": "^9.0.0",
|
|
69
|
+
"@types/node": "^25.6.0",
|
|
70
70
|
"@types/react": "^19.2.14",
|
|
71
71
|
"@types/react-dom": "^19.2.3",
|
|
72
72
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
73
73
|
"mime": "^4.1.0",
|
|
74
|
-
"next": "^16.2.
|
|
75
|
-
"react": "^19.2.
|
|
76
|
-
"react-dom": "^19.2.
|
|
74
|
+
"next": "^16.2.4",
|
|
75
|
+
"react": "^19.2.5",
|
|
76
|
+
"react-dom": "^19.2.5",
|
|
77
77
|
"react-markdown": "^10.1.0",
|
|
78
78
|
"react-syntax-highlighter": "^16.1.1",
|
|
79
79
|
"remark-gfm": "^4.0.1",
|
|
80
80
|
"tsc-alias": "^1.8.16",
|
|
81
|
-
"typescript": "^6.0.
|
|
82
|
-
"vite": "^8.0.
|
|
81
|
+
"typescript": "^6.0.3",
|
|
82
|
+
"vite": "^8.0.9"
|
|
83
83
|
}
|
|
84
84
|
}
|