@pisell/utils 3.0.5 → 3.0.7
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/es/arrayUtils.d.ts +72 -0
- package/es/arrayUtils.js +142 -3
- package/es/common/index.d.ts +5 -0
- package/es/common/index.js +5 -0
- package/es/common/stateHelper.d.ts +18 -0
- package/es/common/stateHelper.js +25 -0
- package/es/common/types.d.ts +28 -0
- package/es/common/types.js +1 -0
- package/es/componentStorage.d.ts +36 -0
- package/es/componentStorage.js +142 -0
- package/es/format.d.ts +5 -1
- package/es/format.js +53 -8
- package/es/index.d.ts +6 -0
- package/es/index.js +6 -0
- package/es/jsBridge/index.d.ts +9 -105
- package/es/jsBridge/index.js +28 -12
- package/es/jsBridge/types.d.ts +149 -0
- package/es/jsBridge/types.js +1 -0
- package/es/locales.d.ts +2 -5
- package/es/locales.js +36 -7
- package/es/miniRedux.js +7 -2
- package/es/number-input/hooks/index.d.ts +4 -0
- package/es/number-input/hooks/index.js +5 -0
- package/es/number-input/hooks/useNumberInputState.d.ts +25 -0
- package/es/number-input/hooks/useNumberInputState.js +129 -0
- package/es/number-input/index.d.ts +14 -0
- package/es/number-input/index.js +21 -0
- package/es/number-input/types.d.ts +96 -0
- package/es/number-input/types.js +1 -0
- package/es/number-input/utils/formatter.d.ts +53 -0
- package/es/number-input/utils/formatter.js +82 -0
- package/es/number-input/utils/index.d.ts +7 -0
- package/es/number-input/utils/index.js +8 -0
- package/es/number-input/utils/validation.d.ts +27 -0
- package/es/number-input/utils/validation.js +67 -0
- package/es/otherUtils.d.ts +48 -0
- package/es/select/hooks/index.d.ts +5 -0
- package/es/select/hooks/index.js +6 -0
- package/es/select/hooks/useDebouncedSearch.d.ts +20 -0
- package/es/select/hooks/useDebouncedSearch.js +55 -0
- package/es/select/hooks/useSelectState.d.ts +19 -0
- package/es/select/hooks/useSelectState.js +117 -0
- package/es/select/index.d.ts +8 -0
- package/es/select/index.js +13 -0
- package/es/select/types.d.ts +256 -0
- package/es/select/types.js +1 -0
- package/es/select/utils/filterOptions.d.ts +22 -0
- package/es/select/utils/filterOptions.js +34 -0
- package/es/select/utils/helpers.d.ts +42 -0
- package/es/select/utils/helpers.js +61 -0
- package/es/select/utils/index.d.ts +7 -0
- package/es/select/utils/index.js +8 -0
- package/es/select/utils/sortOptions.d.ts +12 -0
- package/es/select/utils/sortOptions.js +32 -0
- package/es/select/utils/tagAggregation.d.ts +25 -0
- package/es/select/utils/tagAggregation.js +48 -0
- package/es/text-input/hooks/index.d.ts +4 -0
- package/es/text-input/hooks/index.js +5 -0
- package/es/text-input/hooks/useTextInputState.d.ts +24 -0
- package/es/text-input/hooks/useTextInputState.js +127 -0
- package/es/text-input/index.d.ts +14 -0
- package/es/text-input/index.js +20 -0
- package/es/text-input/types.d.ts +56 -0
- package/es/text-input/types.js +1 -0
- package/es/text-input/utils/index.d.ts +5 -0
- package/es/text-input/utils/index.js +7 -0
- package/es/text-input/utils/validation.d.ts +23 -0
- package/es/text-input/utils/validation.js +71 -0
- package/es/walletValidity.d.ts +55 -0
- package/es/walletValidity.js +143 -38
- package/es/weighing.d.ts +62 -0
- package/es/weighing.js +119 -0
- package/lib/arrayUtils.d.ts +72 -0
- package/lib/arrayUtils.js +75 -0
- package/lib/common/index.d.ts +5 -0
- package/lib/common/index.js +29 -0
- package/lib/common/stateHelper.d.ts +18 -0
- package/lib/common/stateHelper.js +34 -0
- package/lib/common/types.d.ts +28 -0
- package/lib/common/types.js +17 -0
- package/lib/componentStorage.d.ts +36 -0
- package/lib/componentStorage.js +144 -0
- package/lib/format.d.ts +5 -1
- package/lib/format.js +45 -5
- package/lib/index.d.ts +6 -0
- package/lib/index.js +13 -1
- package/lib/jsBridge/index.d.ts +9 -105
- package/lib/jsBridge/index.js +20 -1
- package/lib/jsBridge/types.d.ts +149 -0
- package/lib/jsBridge/types.js +17 -0
- package/lib/locales.d.ts +2 -5
- package/lib/locales.js +34 -7
- package/lib/miniRedux.js +5 -7
- package/lib/number-input/hooks/index.d.ts +4 -0
- package/lib/number-input/hooks/index.js +29 -0
- package/lib/number-input/hooks/useNumberInputState.d.ts +25 -0
- package/lib/number-input/hooks/useNumberInputState.js +83 -0
- package/lib/number-input/index.d.ts +14 -0
- package/lib/number-input/index.js +41 -0
- package/lib/number-input/types.d.ts +96 -0
- package/lib/number-input/types.js +17 -0
- package/lib/number-input/utils/formatter.d.ts +53 -0
- package/lib/number-input/utils/formatter.js +55 -0
- package/lib/number-input/utils/index.d.ts +7 -0
- package/lib/number-input/utils/index.js +39 -0
- package/lib/number-input/utils/validation.d.ts +27 -0
- package/lib/number-input/utils/validation.js +54 -0
- package/lib/otherUtils.d.ts +48 -0
- package/lib/select/hooks/index.d.ts +5 -0
- package/lib/select/hooks/index.js +34 -0
- package/lib/select/hooks/useDebouncedSearch.d.ts +20 -0
- package/lib/select/hooks/useDebouncedSearch.js +43 -0
- package/lib/select/hooks/useSelectState.d.ts +19 -0
- package/lib/select/hooks/useSelectState.js +97 -0
- package/lib/select/index.d.ts +8 -0
- package/lib/select/index.js +53 -0
- package/lib/select/types.d.ts +256 -0
- package/lib/select/types.js +17 -0
- package/lib/select/utils/filterOptions.d.ts +22 -0
- package/lib/select/utils/filterOptions.js +41 -0
- package/lib/select/utils/helpers.d.ts +42 -0
- package/lib/select/utils/helpers.js +51 -0
- package/lib/select/utils/index.d.ts +7 -0
- package/lib/select/utils/index.js +48 -0
- package/lib/select/utils/sortOptions.d.ts +12 -0
- package/lib/select/utils/sortOptions.js +41 -0
- package/lib/select/utils/tagAggregation.d.ts +25 -0
- package/lib/select/utils/tagAggregation.js +43 -0
- package/lib/text-input/hooks/index.d.ts +4 -0
- package/lib/text-input/hooks/index.js +29 -0
- package/lib/text-input/hooks/useTextInputState.d.ts +24 -0
- package/lib/text-input/hooks/useTextInputState.js +81 -0
- package/lib/text-input/index.d.ts +14 -0
- package/lib/text-input/index.js +35 -0
- package/lib/text-input/types.d.ts +56 -0
- package/lib/text-input/types.js +17 -0
- package/lib/text-input/utils/index.d.ts +5 -0
- package/lib/text-input/utils/index.js +32 -0
- package/lib/text-input/utils/validation.d.ts +23 -0
- package/lib/text-input/utils/validation.js +60 -0
- package/lib/walletValidity.d.ts +55 -0
- package/lib/walletValidity.js +120 -40
- package/lib/weighing.d.ts +62 -0
- package/lib/weighing.js +159 -0
- package/package.json +1 -1
- package/es/date.d.ts +0 -28
- package/es/document.d.ts +0 -13
- package/es/firebase/config/index.d.ts +0 -13
- package/es/firebase/index.d.ts +0 -28
- package/es/image.d.ts +0 -11
- package/es/typeUtils.d.ts +0 -42
- package/lib/date.d.ts +0 -28
- package/lib/document.d.ts +0 -13
- package/lib/firebase/config/index.d.ts +0 -13
- package/lib/firebase/index.d.ts +0 -28
- package/lib/image.d.ts +0 -11
- package/lib/typeUtils.d.ts +0 -42
package/lib/date.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @title: 格式化日期
|
|
3
|
-
* @description:
|
|
4
|
-
* @param {string} date
|
|
5
|
-
* @param {string} format
|
|
6
|
-
* @return {*}
|
|
7
|
-
* @Author: zhiwei.Wang
|
|
8
|
-
* @Date: 2023-07-21 10:49
|
|
9
|
-
*/
|
|
10
|
-
export declare const formatDate: (date: string | Date, format?: string) => string;
|
|
11
|
-
/**
|
|
12
|
-
* @title: excel日期 转 js日期
|
|
13
|
-
* @description:
|
|
14
|
-
* @param {number} excelDate
|
|
15
|
-
* @return {*}
|
|
16
|
-
* @Author: zhiwei.Wang
|
|
17
|
-
* @Date: 2023-07-21 10:49
|
|
18
|
-
*/
|
|
19
|
-
export declare const excelDateToJSDate: (excelDate: number) => string;
|
|
20
|
-
/**
|
|
21
|
-
* @title: js日期 转 excel日期
|
|
22
|
-
* @description:
|
|
23
|
-
* @param {string} jsDate
|
|
24
|
-
* @return {*}
|
|
25
|
-
* @Author: zhiwei.Wang
|
|
26
|
-
* @Date: 2023-07-21 10:49
|
|
27
|
-
*/
|
|
28
|
-
export declare const jsDateToExcelDate: (jsDate: string) => number;
|
package/lib/document.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @Title: 设置主题
|
|
3
|
-
* @Describe: 传入字符串键值对
|
|
4
|
-
* @Author: Wzw
|
|
5
|
-
*/
|
|
6
|
-
export declare const setTheme: (themes: {
|
|
7
|
-
[key: string]: string;
|
|
8
|
-
}) => void;
|
|
9
|
-
/**
|
|
10
|
-
* 复制到剪切板
|
|
11
|
-
* @param text
|
|
12
|
-
*/
|
|
13
|
-
export declare const copyToClipboard: (text: string) => Promise<void>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare type InjectedConfigType = {
|
|
2
|
-
apiKey: string;
|
|
3
|
-
authDomain: string;
|
|
4
|
-
projectId: string;
|
|
5
|
-
storageBucket: string;
|
|
6
|
-
messagingSenderId: string;
|
|
7
|
-
appId: string;
|
|
8
|
-
databaseURL: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const injectConfig: (context: InjectedConfigType) => void;
|
|
11
|
-
export declare const firebaseConfig: any;
|
|
12
|
-
declare const _default: any;
|
|
13
|
-
export default _default;
|
package/lib/firebase/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FirebaseApp } from 'firebase/app';
|
|
2
|
-
import { Auth } from 'firebase/auth';
|
|
3
|
-
import { ref, Database, goOnline, goOffline } from 'firebase/database';
|
|
4
|
-
declare let firebaseApp: FirebaseApp;
|
|
5
|
-
declare let auth: Auth;
|
|
6
|
-
declare let database: Database;
|
|
7
|
-
export declare const initFirebase: (config?: any) => void;
|
|
8
|
-
export { database, firebaseApp, auth, ref, goOnline, goOffline };
|
|
9
|
-
export declare const getPath: (path: string) => string;
|
|
10
|
-
export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
|
|
11
|
-
export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
12
|
-
export declare const signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
13
|
-
export declare const signOutUser: () => Promise<void>;
|
|
14
|
-
export declare const readData: (path: string) => Promise<any>;
|
|
15
|
-
export declare const writeData: (path: string, data: any) => Promise<void>;
|
|
16
|
-
export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
17
|
-
export declare const onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
18
|
-
export declare const removeDataListener: (listener: any) => void;
|
|
19
|
-
declare const _default: {
|
|
20
|
-
signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
21
|
-
signOutUser: () => Promise<void>;
|
|
22
|
-
readData: (path: string) => Promise<any>;
|
|
23
|
-
writeData: (path: string, data: any) => Promise<void>;
|
|
24
|
-
onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
25
|
-
removeDataListener: (listener: any) => void;
|
|
26
|
-
onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
27
|
-
};
|
|
28
|
-
export default _default;
|
package/lib/image.d.ts
DELETED
package/lib/typeUtils.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 判断是否是函数
|
|
3
|
-
* @param obj
|
|
4
|
-
*/
|
|
5
|
-
export declare const isFunction: (obj: any) => obj is Function;
|
|
6
|
-
/**
|
|
7
|
-
* 判断是否是数组
|
|
8
|
-
* @param obj
|
|
9
|
-
*/
|
|
10
|
-
export declare const isArr: (obj: any) => obj is any[];
|
|
11
|
-
/**
|
|
12
|
-
* 判断是否是字符串
|
|
13
|
-
* @param obj
|
|
14
|
-
*/
|
|
15
|
-
export declare const isString: (obj: any) => obj is string;
|
|
16
|
-
/**
|
|
17
|
-
* 判断是否是数字
|
|
18
|
-
* @param obj
|
|
19
|
-
*/
|
|
20
|
-
export declare const isNumber: (obj: any) => obj is number;
|
|
21
|
-
/**
|
|
22
|
-
* 判断是否是undefined
|
|
23
|
-
* @param obj
|
|
24
|
-
*/
|
|
25
|
-
export declare const isUndefined: (obj: any) => obj is undefined;
|
|
26
|
-
/**
|
|
27
|
-
* 判断是否是boolean
|
|
28
|
-
* @param obj
|
|
29
|
-
*/
|
|
30
|
-
export declare const isBoolean: (obj: any) => obj is boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 判断是否是json字符串
|
|
33
|
-
* @param v
|
|
34
|
-
*/
|
|
35
|
-
export declare const isJson: (v: any) => boolean;
|
|
36
|
-
/**
|
|
37
|
-
* @Title: 判断是否为对象
|
|
38
|
-
* @Describe:
|
|
39
|
-
* @Author: Wzw
|
|
40
|
-
* @param {any} obj
|
|
41
|
-
*/
|
|
42
|
-
export declare const isPlainObject: (obj: any) => boolean;
|