@cclr/react 0.1.24 → 0.1.26
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/lib/cjs/index.js +456 -187
- package/lib/esm/index.js +448 -180
- package/lib/type/index.d.ts +11 -4
- package/package.json +8 -8
package/lib/type/index.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
1
3
|
import { TPlainObject, TAny, TPlainFunction, TNoop } from '@cclr/lang';
|
|
2
|
-
import * as react from 'react';
|
|
3
4
|
import { TEventMap } from '@cclr/front';
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* 适配子元素为DOM元素
|
|
8
|
+
* 如果没有传入dom子元素,则返回一个空的div
|
|
9
|
+
*/
|
|
10
|
+
declare const AdaptDomChildren: React__default.ForwardRefExoticComponent<Omit<any, "ref"> & React__default.RefAttributes<any>>;
|
|
11
|
+
|
|
5
12
|
/**
|
|
6
13
|
* 简化 createContext 的使用
|
|
7
14
|
* @param defaultValue 默认值
|
|
@@ -70,7 +77,7 @@ declare const useEventListenerMultiple: <T extends HTMLElement = HTMLElement>(re
|
|
|
70
77
|
* @param eventMap 事件监听器映射
|
|
71
78
|
*/
|
|
72
79
|
declare const useEventListenerMultipleRef: <T extends HTMLElement = HTMLElement>(eventMap: TEventMap) => {
|
|
73
|
-
ref:
|
|
80
|
+
ref: React$1.RefObject<T>;
|
|
74
81
|
};
|
|
75
82
|
|
|
76
83
|
/**
|
|
@@ -86,7 +93,7 @@ declare const useOnceFun: (fun: TNoop) => void;
|
|
|
86
93
|
* @param initFun 初始化函数
|
|
87
94
|
* @returns
|
|
88
95
|
*/
|
|
89
|
-
declare const useRefPro: <T>(initFun: (() => T) | T) =>
|
|
96
|
+
declare const useRefPro: <T>(initFun: (() => T) | T) => React$1.MutableRefObject<T | undefined>;
|
|
90
97
|
|
|
91
98
|
/**
|
|
92
99
|
* 节流
|
|
@@ -125,4 +132,4 @@ interface ICommonUiProps {
|
|
|
125
132
|
children?: React.ReactNode;
|
|
126
133
|
}
|
|
127
134
|
|
|
128
|
-
export { type ICommonUiProps, type IControlProps, createCtx, useCallbackRef, useControl, useDebounceFn, useEventListenerMultiple, useEventListenerMultipleRef, useOnceFun, useRefPro, useThrottleFn, useUpdate, useUuid };
|
|
135
|
+
export { AdaptDomChildren, type ICommonUiProps, type IControlProps, createCtx, useCallbackRef, useControl, useDebounceFn, useEventListenerMultiple, useEventListenerMultipleRef, useOnceFun, useRefPro, useThrottleFn, useUpdate, useUuid };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cclr/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "react 相关功能",
|
|
5
5
|
"author": "cclr <18843152354@163.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "vitest",
|
|
25
25
|
"relese": "npm run test && npm publish",
|
|
26
|
-
"build": "
|
|
26
|
+
"build": "ccf build",
|
|
27
27
|
"g:test": "vitest run",
|
|
28
|
-
"g:build": "
|
|
28
|
+
"g:build": "ccf build"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "a643554f19e182f0735f9e3206c64dc497cd3d73",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cclr/front": "0.1.
|
|
33
|
-
"@cclr/lang": "0.1.
|
|
34
|
-
"@cclr/model": "0.1.
|
|
35
|
-
"@cclr/utils": "0.1.
|
|
32
|
+
"@cclr/front": "0.1.26",
|
|
33
|
+
"@cclr/lang": "0.1.26",
|
|
34
|
+
"@cclr/model": "0.1.26",
|
|
35
|
+
"@cclr/utils": "0.1.26"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/react": "^18.3.18",
|