@xn-lib/base 0.0.22 → 0.0.23
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/index.cjs +2 -2
- package/dist/index.iife.js +2 -2
- package/dist/index.mjs +3 -3
- package/dist/index.umd.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/data.utils.d.ts +16 -0
- package/package.json +1 -1
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
type CommonOption = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: any;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
1
7
|
/**
|
|
2
8
|
* 两个数相乘
|
|
3
9
|
* @param a 数字a
|
|
@@ -194,3 +200,13 @@ export declare function formatStringList(str: string): string;
|
|
|
194
200
|
* @param defaultValue 默认值
|
|
195
201
|
*/
|
|
196
202
|
export declare function formatAmount(value: number | string, defaultValue?: string): string;
|
|
203
|
+
export declare function thousandMark(value: number): string;
|
|
204
|
+
export declare function percentage(value: number): string;
|
|
205
|
+
export declare function objectToOptions(obj: Record<string, string>): {
|
|
206
|
+
value: string;
|
|
207
|
+
label: string;
|
|
208
|
+
}[];
|
|
209
|
+
export declare function listToOptions<T extends object>(list: T[], labelKey: keyof T, valueKey: keyof T, options?: {
|
|
210
|
+
mapFn?: (item: T, index: number) => Record<string, any>;
|
|
211
|
+
}): CommonOption[] & Record<string, any>;
|
|
212
|
+
export {};
|