@nutui/nutui-react-taro 3.0.9-beta.0 → 3.0.9-beta.1
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/hooks/index.d.ts +2 -0
- package/dist/cjs/hooks/taro/use-custom-event.d.ts +7 -0
- package/dist/cjs/hooks/taro/use-lock-scoll.d.ts +1 -0
- package/dist/cjs/utils/index.d.ts +6 -0
- package/dist/cjs/utils/taro/add-color-for-harmony.d.ts +8 -0
- package/dist/cjs/utils/taro/get-rect-by-id.d.ts +1 -0
- package/dist/cjs/utils/taro/get-rect.d.ts +12 -0
- package/dist/cjs/utils/taro/get-system-info.d.ts +19 -0
- package/dist/cjs/utils/taro/platform.d.ts +3 -0
- package/dist/cjs/utils/taro/px-transform.d.ts +1 -0
- package/dist/es/hooks/index.d.ts +2 -0
- package/dist/es/hooks/taro/use-custom-event.d.ts +7 -0
- package/dist/es/hooks/taro/use-lock-scoll.d.ts +1 -0
- package/dist/es/utils/index.d.ts +6 -0
- package/dist/es/utils/taro/add-color-for-harmony.d.ts +8 -0
- package/dist/es/utils/taro/get-rect-by-id.d.ts +1 -0
- package/dist/es/utils/taro/get-rect.d.ts +12 -0
- package/dist/es/utils/taro/get-system-info.d.ts +19 -0
- package/dist/es/utils/taro/platform.d.ts +3 -0
- package/dist/es/utils/taro/px-transform.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/style.scss +35 -35
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './use-click-away';
|
|
2
|
+
export * from './taro/use-custom-event';
|
|
2
3
|
export * from './use-force-update';
|
|
3
4
|
export * from './use-isomprphic-layout-effect';
|
|
5
|
+
export * from './taro/use-lock-scoll';
|
|
4
6
|
export * from './use-lock-scroll';
|
|
5
7
|
export * from './use-memo';
|
|
6
8
|
export * from './use-pagination';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const customEvents: TaroGeneral.Events;
|
|
2
|
+
export declare function useCustomEventsPath(selector?: string): string;
|
|
3
|
+
export declare function useCustomEvent(selector: string, cb: any): (<T = any>(args: T) => void)[];
|
|
4
|
+
export declare function useParams<T = any>(args: T): {
|
|
5
|
+
params: T;
|
|
6
|
+
setParams: (args: T) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLockScrollTaro: (shouldLock: boolean) => import("react").MutableRefObject<null>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
export * from './taro/add-color-for-harmony';
|
|
1
2
|
export * from './bound';
|
|
2
3
|
export * from './camel-case';
|
|
3
4
|
export * from './can-use-dom';
|
|
4
5
|
export * from './clamp';
|
|
5
6
|
export * from './date';
|
|
7
|
+
export * from './taro/get-rect';
|
|
8
|
+
export * from './taro/get-rect-by-id';
|
|
6
9
|
export * from './get-rect';
|
|
7
10
|
export * from './get-scroll-parent';
|
|
11
|
+
export * from './taro/get-system-info';
|
|
8
12
|
export * from './interceptor';
|
|
9
13
|
export * from './is-date';
|
|
10
14
|
export * from './is-empty';
|
|
@@ -16,8 +20,10 @@ export * from './lru';
|
|
|
16
20
|
export * from './merge';
|
|
17
21
|
export * from './merge-props';
|
|
18
22
|
export * from './pad-zero';
|
|
23
|
+
export * from './taro/platform';
|
|
19
24
|
export * from './prevent-default';
|
|
20
25
|
export * from './px-check';
|
|
26
|
+
export * from './taro/px-transform';
|
|
21
27
|
export * from './raf';
|
|
22
28
|
export * from './render';
|
|
23
29
|
export * from './rubberband';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 为支持 Harmony 的 React 元素添加颜色属性
|
|
4
|
+
* @param maybeElement - 要处理的 React 节点
|
|
5
|
+
* @param color - 要添加的颜色值(如:'#ff0000')
|
|
6
|
+
* @returns 处理后的 React 节点
|
|
7
|
+
*/
|
|
8
|
+
export declare function addColorForHarmony(maybeElement: ReactNode, color?: string): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRectById: (id: string) => Promise<unknown>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Rect {
|
|
2
|
+
dataset: Record<string, any>;
|
|
3
|
+
id: string;
|
|
4
|
+
top: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
left: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function makeRect(width: number, height: number): Rect;
|
|
12
|
+
export declare const getRectInMultiPlatform: (element: any, harmonyId?: string) => Promise<Rect>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Taro from '@tarojs/taro';
|
|
2
|
+
interface IDeviceInfo extends Omit<Taro.getDeviceInfo.Result, 'deviceAbi' | 'CPUType'> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* 获取设备基础信息,兼容新旧 API
|
|
6
|
+
* @returns {IDeviceInfo} 设备基础信息
|
|
7
|
+
*/
|
|
8
|
+
export declare const getDeviceInfo: () => IDeviceInfo;
|
|
9
|
+
/**
|
|
10
|
+
* 获取窗口信息,兼容新旧 API
|
|
11
|
+
* @returns {Taro.getWindowInfo.Result} 窗口信息
|
|
12
|
+
*/
|
|
13
|
+
export declare const getWindowInfo: () => Taro.getWindowInfo.Result;
|
|
14
|
+
/**
|
|
15
|
+
* 获取应用基础信息,兼容新旧 API
|
|
16
|
+
* @returns {Taro.getAppBaseInfo.Result} 应用基础信息
|
|
17
|
+
*/
|
|
18
|
+
export declare const getAppBaseInfo: () => Taro.getAppBaseInfo.Result;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pxTransform(value: number, radix?: number): any;
|
package/dist/es/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './use-click-away';
|
|
2
|
+
export * from './taro/use-custom-event';
|
|
2
3
|
export * from './use-force-update';
|
|
3
4
|
export * from './use-isomprphic-layout-effect';
|
|
5
|
+
export * from './taro/use-lock-scoll';
|
|
4
6
|
export * from './use-lock-scroll';
|
|
5
7
|
export * from './use-memo';
|
|
6
8
|
export * from './use-pagination';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const customEvents: TaroGeneral.Events;
|
|
2
|
+
export declare function useCustomEventsPath(selector?: string): string;
|
|
3
|
+
export declare function useCustomEvent(selector: string, cb: any): (<T = any>(args: T) => void)[];
|
|
4
|
+
export declare function useParams<T = any>(args: T): {
|
|
5
|
+
params: T;
|
|
6
|
+
setParams: (args: T) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLockScrollTaro: (shouldLock: boolean) => import("react").MutableRefObject<null>;
|
package/dist/es/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
export * from './taro/add-color-for-harmony';
|
|
1
2
|
export * from './bound';
|
|
2
3
|
export * from './camel-case';
|
|
3
4
|
export * from './can-use-dom';
|
|
4
5
|
export * from './clamp';
|
|
5
6
|
export * from './date';
|
|
7
|
+
export * from './taro/get-rect';
|
|
8
|
+
export * from './taro/get-rect-by-id';
|
|
6
9
|
export * from './get-rect';
|
|
7
10
|
export * from './get-scroll-parent';
|
|
11
|
+
export * from './taro/get-system-info';
|
|
8
12
|
export * from './interceptor';
|
|
9
13
|
export * from './is-date';
|
|
10
14
|
export * from './is-empty';
|
|
@@ -16,8 +20,10 @@ export * from './lru';
|
|
|
16
20
|
export * from './merge';
|
|
17
21
|
export * from './merge-props';
|
|
18
22
|
export * from './pad-zero';
|
|
23
|
+
export * from './taro/platform';
|
|
19
24
|
export * from './prevent-default';
|
|
20
25
|
export * from './px-check';
|
|
26
|
+
export * from './taro/px-transform';
|
|
21
27
|
export * from './raf';
|
|
22
28
|
export * from './render';
|
|
23
29
|
export * from './rubberband';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 为支持 Harmony 的 React 元素添加颜色属性
|
|
4
|
+
* @param maybeElement - 要处理的 React 节点
|
|
5
|
+
* @param color - 要添加的颜色值(如:'#ff0000')
|
|
6
|
+
* @returns 处理后的 React 节点
|
|
7
|
+
*/
|
|
8
|
+
export declare function addColorForHarmony(maybeElement: ReactNode, color?: string): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRectById: (id: string) => Promise<unknown>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Rect {
|
|
2
|
+
dataset: Record<string, any>;
|
|
3
|
+
id: string;
|
|
4
|
+
top: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
left: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function makeRect(width: number, height: number): Rect;
|
|
12
|
+
export declare const getRectInMultiPlatform: (element: any, harmonyId?: string) => Promise<Rect>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Taro from '@tarojs/taro';
|
|
2
|
+
interface IDeviceInfo extends Omit<Taro.getDeviceInfo.Result, 'deviceAbi' | 'CPUType'> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* 获取设备基础信息,兼容新旧 API
|
|
6
|
+
* @returns {IDeviceInfo} 设备基础信息
|
|
7
|
+
*/
|
|
8
|
+
export declare const getDeviceInfo: () => IDeviceInfo;
|
|
9
|
+
/**
|
|
10
|
+
* 获取窗口信息,兼容新旧 API
|
|
11
|
+
* @returns {Taro.getWindowInfo.Result} 窗口信息
|
|
12
|
+
*/
|
|
13
|
+
export declare const getWindowInfo: () => Taro.getWindowInfo.Result;
|
|
14
|
+
/**
|
|
15
|
+
* 获取应用基础信息,兼容新旧 API
|
|
16
|
+
* @returns {Taro.getAppBaseInfo.Result} 应用基础信息
|
|
17
|
+
*/
|
|
18
|
+
export declare const getAppBaseInfo: () => Taro.getAppBaseInfo.Result;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pxTransform(value: number, radix?: number): any;
|