mixlea-utils-js 0.1.46 → 0.1.48
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/mixlea-utils-js.js +313 -297
- package/dist/mixlea-utils-js.umd.js +2 -2
- package/dist/types/index.d.ts +19 -8
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -567,6 +567,14 @@ export declare function getFileTypeFromPath(path: string): {
|
|
|
567
567
|
mime: string;
|
|
568
568
|
};
|
|
569
569
|
|
|
570
|
+
/**
|
|
571
|
+
* 根据占比调整 HEX 颜色的亮度(通过 HSL)
|
|
572
|
+
* @param hexColor 十六进制颜色(如 "#4CAF50")
|
|
573
|
+
* @param percentage 占比(0~1,0=最亮,1=最暗)
|
|
574
|
+
* @returns 调整后的 HEX 颜色
|
|
575
|
+
*/
|
|
576
|
+
export declare function getHexPercentColor(hexColor: string, percentage: number): string;
|
|
577
|
+
|
|
570
578
|
export declare function getMonthStartTimestamp(value: any, defaultValue: number): number;
|
|
571
579
|
|
|
572
580
|
export declare function getNextMonthDate(value: any, defaultValue?: Date): Date;
|
|
@@ -587,14 +595,6 @@ export declare function getOffsetMonthsDate(input: any, months: number, fallback
|
|
|
587
595
|
|
|
588
596
|
export declare function getOffsetYearsDate(input: any, years: number, fallbackDate?: Date): Date;
|
|
589
597
|
|
|
590
|
-
/**
|
|
591
|
-
* 根据占比调整 HEX 颜色的亮度(通过 HSL)
|
|
592
|
-
* @param hexColor 十六进制颜色(如 "#4CAF50")
|
|
593
|
-
* @param percentage 占比(0~1,0=最亮,1=最暗)
|
|
594
|
-
* @returns 调整后的 HEX 颜色
|
|
595
|
-
*/
|
|
596
|
-
export declare function getPercentHexColor(hexColor: string, percentage: number): string;
|
|
597
|
-
|
|
598
598
|
export declare function getPercentRGB(rgb: [number, number, number], percentage: number, darken?: boolean): number[];
|
|
599
599
|
|
|
600
600
|
export declare function getPrevMonthDate(value: any, defaultValue?: Date): Date;
|
|
@@ -607,6 +607,15 @@ export declare function getRangeDateMonthSegments([startDate, endDate]: [Date, D
|
|
|
607
607
|
|
|
608
608
|
export declare function getRangeDateYearSegments([startDate, endDate]: [Date, Date]): string[];
|
|
609
609
|
|
|
610
|
+
/**
|
|
611
|
+
* 在两个 HEX 颜色之间平滑过渡
|
|
612
|
+
* @param startHex 起始颜色(如 "#FF0000")
|
|
613
|
+
* @param endHex 结束颜色(如 "#00FF00")
|
|
614
|
+
* @param percent 过渡比例(0~1,0=起始色,1=结束色)
|
|
615
|
+
* @returns 过渡后的 HEX 颜色
|
|
616
|
+
*/
|
|
617
|
+
export declare function getRangeHexPercentColor(startHex: string, endHex: string, percent: number): string;
|
|
618
|
+
|
|
610
619
|
export declare function getToday(): Date;
|
|
611
620
|
|
|
612
621
|
export declare function getTodayEndTimestamp(): number;
|
|
@@ -1095,6 +1104,8 @@ export declare function objectShallowMap(obj: Record<any, any>, keyFn: (key: any
|
|
|
1095
1104
|
*/
|
|
1096
1105
|
export declare function objectSome(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[] | null, defaultValue?: boolean): boolean;
|
|
1097
1106
|
|
|
1107
|
+
export declare function objectSomeFields(input: any, fields: string[], func: (fieldValue: any, field: string) => boolean): boolean;
|
|
1108
|
+
|
|
1098
1109
|
export declare function objectStringify(obj: Record<string, any>, allowDots?: boolean): string;
|
|
1099
1110
|
|
|
1100
1111
|
export declare function objectToArray<T extends Record<string, any>>(obj: Record<string, any>, callback: (key: string, value: any) => T): T[];
|