@ledvance/base 1.2.83 → 1.2.85
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/.babelrc +31 -31
- package/.eslintignore +5 -5
- package/.eslintrc.js +27 -27
- package/.prettierrc.js +1 -1
- package/.versionrc +5 -5
- package/localazy.json +851 -848
- package/localazy.keys.json +4 -4
- package/package.json +74 -74
- package/rn-cli.config.js +8 -8
- package/src/api/native.d.ts +71 -71
- package/src/api/native.ts +423 -423
- package/src/api/nativeEventEmitter.d.ts +3 -3
- package/src/api/nativeEventEmitter.ts +125 -125
- package/src/components/AdvanceCard.d.ts +25 -25
- package/src/components/AdvanceCard.tsx +117 -117
- package/src/components/AdvanceList.d.ts +9 -9
- package/src/components/AdvanceList.tsx +69 -69
- package/src/components/ApplyForDeviceItem.d.ts +6 -6
- package/src/components/ApplyForDeviceItem.tsx +83 -83
- package/src/components/ApplyForDeviceList.d.ts +7 -7
- package/src/components/ApplyForDeviceList.tsx +61 -61
- package/src/components/ApplyForText.d.ts +6 -6
- package/src/components/ApplyForText.tsx +52 -52
- package/src/components/Card.d.ts +10 -10
- package/src/components/Card.tsx +40 -40
- package/src/components/Cell.d.ts +21 -21
- package/src/components/Cell.tsx +69 -69
- package/src/components/CircularProgress.d.ts +8 -8
- package/src/components/CircularProgress.tsx +42 -42
- package/src/components/ColorAdjustView.d.ts +12 -12
- package/src/components/ColorAdjustView.tsx +64 -64
- package/src/components/ColorExtractor.d.ts +73 -73
- package/src/components/ColorExtractor.tsx +374 -374
- package/src/components/ColorTempAdjustView.d.ts +13 -13
- package/src/components/ColorTempAdjustView.tsx +57 -57
- package/src/components/ColorsLine.d.ts +7 -7
- package/src/components/ColorsLine.tsx +47 -47
- package/src/components/CustomListDialog.d.ts +15 -15
- package/src/components/CustomListDialog.tsx +66 -66
- package/src/components/DeleteButton.d.ts +10 -10
- package/src/components/DeleteButton.tsx +40 -40
- package/src/components/Dialog.d.ts +10 -10
- package/src/components/Dialog.tsx +38 -38
- package/src/components/DrawToolView.d.ts +46 -46
- package/src/components/DrawToolView.tsx +262 -262
- package/src/components/FanAdjustView.d.ts +23 -23
- package/src/components/FanAdjustView.tsx +141 -141
- package/src/components/InfoText.d.ts +11 -11
- package/src/components/InfoText.tsx +45 -45
- package/src/components/LampAdjustView.d.ts +10 -10
- package/src/components/LampAdjustView.tsx +75 -75
- package/src/components/LampAdjustView2.d.ts +24 -24
- package/src/components/LampAdjustView2.tsx +104 -104
- package/src/components/LinearGradientLine.d.ts +9 -9
- package/src/components/LinearGradientLine.tsx +63 -63
- package/src/components/LoadingView.tsx +39 -39
- package/src/components/MoodColorsLine.d.ts +9 -9
- package/src/components/MoodColorsLine.tsx +38 -38
- package/src/components/Page.d.ts +21 -21
- package/src/components/Page.tsx +104 -104
- package/src/components/Popup.d.ts +7 -7
- package/src/components/Popup.tsx +71 -71
- package/src/components/Segmented.d.ts +14 -14
- package/src/components/Segmented.tsx +76 -76
- package/src/components/ShowSelect.d.ts +1 -1
- package/src/components/ShowSelect.tsx +158 -158
- package/src/components/SocketItem.d.ts +13 -13
- package/src/components/SocketItem.tsx +87 -87
- package/src/components/Spacer.d.ts +7 -7
- package/src/components/Spacer.tsx +13 -13
- package/src/components/Stepper.d.ts +19 -19
- package/src/components/Stepper.tsx +130 -130
- package/src/components/StripAdjustView.d.ts +16 -16
- package/src/components/StripAdjustView.tsx +129 -129
- package/src/components/StripLightView.d.ts +14 -14
- package/src/components/StripLightView.tsx +24 -24
- package/src/components/Summary.tsx +116 -116
- package/src/components/Tag.d.ts +8 -8
- package/src/components/Tag.tsx +56 -56
- package/src/components/TextButton.d.ts +9 -9
- package/src/components/TextButton.tsx +31 -31
- package/src/components/TextField.d.ts +9 -9
- package/src/components/TextField.tsx +92 -92
- package/src/components/TextFieldStyleButton.d.ts +8 -8
- package/src/components/TextFieldStyleButton.tsx +85 -85
- package/src/components/UATabTitle.d.ts +6 -6
- package/src/components/UATabTitle.tsx +31 -31
- package/src/components/UATabs.d.ts +12 -12
- package/src/components/UATabs.tsx +77 -77
- package/src/components/connect.d.ts +10 -10
- package/src/components/connect.tsx +20 -20
- package/src/components/ldvColorBrightness.d.ts +1 -1
- package/src/components/ldvColorBrightness.tsx +18 -18
- package/src/components/ldvColorSlider.d.ts +14 -14
- package/src/components/ldvColorSlider.tsx +131 -131
- package/src/components/ldvItemView.d.ts +12 -12
- package/src/components/ldvItemView.tsx +43 -43
- package/src/components/ldvPickerView.d.ts +13 -13
- package/src/components/ldvPickerView.tsx +97 -97
- package/src/components/ldvPresetView.d.ts +2 -2
- package/src/components/ldvPresetView.tsx +86 -86
- package/src/components/ldvSaturation.d.ts +2 -2
- package/src/components/ldvSaturation.tsx +22 -22
- package/src/components/ldvSlider.d.ts +15 -15
- package/src/components/ldvSlider.tsx +103 -103
- package/src/components/ldvSwitch.d.ts +10 -10
- package/src/components/ldvSwitch.tsx +52 -52
- package/src/components/ldvTemperatureSlider.d.ts +13 -13
- package/src/components/ldvTemperatureSlider.tsx +139 -139
- package/src/components/ldvTopBar.d.ts +10 -10
- package/src/components/ldvTopBar.tsx +76 -76
- package/src/components/ldvTopName.d.ts +9 -9
- package/src/components/ldvTopName.tsx +63 -63
- package/src/components/segmentControl.d.ts +1 -1
- package/src/components/segmentControl.tsx +65 -65
- package/src/components/weekSelect.d.ts +7 -7
- package/src/components/weekSelect.tsx +98 -98
- package/src/composeLayout.d.ts +30 -30
- package/src/composeLayout.tsx +261 -261
- package/src/config/dark-theme.ts +61 -61
- package/src/config/light-theme.ts +61 -61
- package/src/hooks/Hooks.d.ts +2 -2
- package/src/hooks/Hooks.ts +8 -8
- package/src/i18n/index.d.ts +16 -16
- package/src/i18n/index.ts +37 -37
- package/src/i18n/strings.d.ts +15953 -15953
- package/src/i18n/strings.ts +23781 -23723
- package/src/main.tsx +9 -9
- package/src/models/GlobalParams.d.ts +14 -14
- package/src/models/GlobalParams.ts +14 -14
- package/src/models/TuyaApi.d.ts +29 -29
- package/src/models/TuyaApi.ts +92 -92
- package/src/models/combine.d.ts +26 -26
- package/src/models/combine.ts +17 -17
- package/src/models/configureStore.d.ts +9 -9
- package/src/models/configureStore.ts +33 -33
- package/src/models/index.d.ts +31 -31
- package/src/models/index.ts +22 -22
- package/src/models/modules/NativePropsSlice.d.ts +61 -61
- package/src/models/modules/NativePropsSlice.tsx +467 -467
- package/src/models/modules/Result.d.ts +14 -14
- package/src/models/modules/Result.ts +15 -15
- package/src/models/modules/common.d.ts +44 -44
- package/src/models/modules/common.ts +161 -161
- package/src/res/index.d.ts +70 -70
- package/src/res/index.ts +73 -73
- package/src/utils/ColorParser.d.ts +66 -66
- package/src/utils/ColorParser.ts +189 -189
- package/src/utils/ColorUtils.d.ts +71 -71
- package/src/utils/ColorUtils.tsx +448 -448
- package/src/utils/Support.d.ts +13 -13
- package/src/utils/Support.ts +108 -108
- package/src/utils/TypeUtils.d.ts +3 -3
- package/src/utils/cctUtils.d.ts +1 -1
- package/src/utils/cctUtils.ts +110 -110
- package/src/utils/common.d.ts +35 -35
- package/src/utils/common.ts +379 -379
- package/src/utils/index.d.ts +26 -26
- package/src/utils/index.ts +191 -191
- package/src/utils/interface.d.ts +6 -6
- package/src/utils/interface.ts +50 -50
- package/src/utils/loopsCompare.d.ts +1 -1
- package/src/utils/loopsCompare.ts +62 -62
- package/tsconfig.json +50 -50
- package/update-localazy.py +52 -52
package/src/utils/Support.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const isPlug: (dpCodes: Record<string, string>) => boolean;
|
|
2
|
-
export declare const isGlassRGBWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
3
|
-
export declare const isMixRGBWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
4
|
-
export declare const isRGBWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
5
|
-
export declare const isRGBLamp: (dpCodes: Record<string, string>) => boolean;
|
|
6
|
-
export declare const isOnlyRGBLamp: (dpCodes: Record<string, string>) => boolean;
|
|
7
|
-
export declare const isTWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
8
|
-
export declare const isFanLamp: (dpCodes: Record<string, string>) => boolean;
|
|
9
|
-
export declare const isDIMLamp: (dpCodes: Record<string, string>) => boolean;
|
|
10
|
-
export declare const isGARDOT: (dpCodes: Record<string, string>) => boolean;
|
|
11
|
-
export declare const isSupportColor: (dpCodes: Record<string, string>) => boolean;
|
|
12
|
-
export declare const isSupportTemperature: (dpCodes: Record<string, string>) => boolean;
|
|
13
|
-
export declare const isSupportBrightness: (dpCodes: Record<string, string>) => boolean;
|
|
1
|
+
export declare const isPlug: (dpCodes: Record<string, string>) => boolean;
|
|
2
|
+
export declare const isGlassRGBWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
3
|
+
export declare const isMixRGBWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
4
|
+
export declare const isRGBWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
5
|
+
export declare const isRGBLamp: (dpCodes: Record<string, string>) => boolean;
|
|
6
|
+
export declare const isOnlyRGBLamp: (dpCodes: Record<string, string>) => boolean;
|
|
7
|
+
export declare const isTWLamp: (dpCodes: Record<string, string>) => boolean;
|
|
8
|
+
export declare const isFanLamp: (dpCodes: Record<string, string>) => boolean;
|
|
9
|
+
export declare const isDIMLamp: (dpCodes: Record<string, string>) => boolean;
|
|
10
|
+
export declare const isGARDOT: (dpCodes: Record<string, string>) => boolean;
|
|
11
|
+
export declare const isSupportColor: (dpCodes: Record<string, string>) => boolean;
|
|
12
|
+
export declare const isSupportTemperature: (dpCodes: Record<string, string>) => boolean;
|
|
13
|
+
export declare const isSupportBrightness: (dpCodes: Record<string, string>) => boolean;
|
package/src/utils/Support.ts
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
// 判断是否是plug
|
|
3
|
-
export const isPlug = (dpCodes: Record<string, string>) => {
|
|
4
|
-
return !!dpCodes.switch_1
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// 玻璃灯:支持颜色和色温灯同时调节
|
|
8
|
-
export const isGlassRGBWLamp = (dpCodes: Record<string, string>) => {
|
|
9
|
-
return !!(
|
|
10
|
-
!dpCodes.mix_rgbcw &&
|
|
11
|
-
!dpCodes.temp_value &&
|
|
12
|
-
dpCodes.colour_data &&
|
|
13
|
-
dpCodes.bright_value
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
// 双灯泡吸顶灯:支持颜色和色温灯同时调节
|
|
17
|
-
export const isMixRGBWLamp = (dpCodes: Record<string, string>) => {
|
|
18
|
-
return !!(
|
|
19
|
-
dpCodes.mix_rgbcw &&
|
|
20
|
-
dpCodes.colour_data &&
|
|
21
|
-
dpCodes.temp_value &&
|
|
22
|
-
dpCodes.bright_value
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// 支持调节:颜色/色温+亮度
|
|
27
|
-
export const isRGBWLamp = (dpCodes: Record<string, string>) => {
|
|
28
|
-
return !!(
|
|
29
|
-
!dpCodes.mix_rgbcw &&
|
|
30
|
-
dpCodes.colour_data &&
|
|
31
|
-
dpCodes.temp_value &&
|
|
32
|
-
dpCodes.bright_value
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// 支持调节:颜色/单一色温亮度
|
|
37
|
-
export const isRGBLamp = (dpCodes: Record<string, string>) => {
|
|
38
|
-
return !!(
|
|
39
|
-
!dpCodes.mix_rgbcw &&
|
|
40
|
-
!dpCodes.temp_value &&
|
|
41
|
-
dpCodes.colour_data &&
|
|
42
|
-
dpCodes.bright_value
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// 支持调节:颜色
|
|
47
|
-
export const isOnlyRGBLamp = (dpCodes: Record<string, string>) => {
|
|
48
|
-
return !!(
|
|
49
|
-
!dpCodes.mix_rgbcw &&
|
|
50
|
-
!dpCodes.temp_value &&
|
|
51
|
-
!dpCodes.bright_value &&
|
|
52
|
-
dpCodes.colour_data
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 支持调节:色温+亮度
|
|
57
|
-
export const isTWLamp = (dpCodes: Record<string, string>) => {
|
|
58
|
-
return !!(
|
|
59
|
-
!dpCodes.mix_rgbcw &&
|
|
60
|
-
!dpCodes.colour_data &&
|
|
61
|
-
dpCodes.temp_value &&
|
|
62
|
-
dpCodes.bright_value
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// 支持调节: 色温+ 温度
|
|
67
|
-
export const isFanLamp = (dpCodes: Record<string, string>) => {
|
|
68
|
-
return !!(
|
|
69
|
-
!dpCodes.mix_rgbcw &&
|
|
70
|
-
!dpCodes.colour_data &&
|
|
71
|
-
dpCodes.temp_value &&
|
|
72
|
-
dpCodes.bright_value &&
|
|
73
|
-
dpCodes.fan_speed
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// 支持调节:单一色温亮度
|
|
78
|
-
export const isDIMLamp = (dpCodes: Record<string, string>) => {
|
|
79
|
-
return !!(
|
|
80
|
-
!dpCodes.mix_rgbcw &&
|
|
81
|
-
!dpCodes.colour_data &&
|
|
82
|
-
!dpCodes.temp_value &&
|
|
83
|
-
dpCodes.bright_value
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// GARDOT灯具
|
|
88
|
-
export const isGARDOT = (dpCodes: Record<string, string>) => {
|
|
89
|
-
return !!(
|
|
90
|
-
dpCodes.switch_led &&
|
|
91
|
-
dpCodes.work_mode &&
|
|
92
|
-
dpCodes.colour_data &&
|
|
93
|
-
dpCodes.scene_data &&
|
|
94
|
-
dpCodes.countdown &&
|
|
95
|
-
dpCodes.control_data
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export const isSupportColor = (dpCodes: Record<string, string>) => {
|
|
100
|
-
return !!(dpCodes.colour_data)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export const isSupportTemperature = (dpCodes: Record<string, string>) => {
|
|
104
|
-
return !!(dpCodes.temp_value)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export const isSupportBrightness = (dpCodes: Record<string, string>) => {
|
|
108
|
-
return !!(dpCodes.bright_value)
|
|
1
|
+
|
|
2
|
+
// 判断是否是plug
|
|
3
|
+
export const isPlug = (dpCodes: Record<string, string>) => {
|
|
4
|
+
return !!dpCodes.switch_1
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// 玻璃灯:支持颜色和色温灯同时调节
|
|
8
|
+
export const isGlassRGBWLamp = (dpCodes: Record<string, string>) => {
|
|
9
|
+
return !!(
|
|
10
|
+
!dpCodes.mix_rgbcw &&
|
|
11
|
+
!dpCodes.temp_value &&
|
|
12
|
+
dpCodes.colour_data &&
|
|
13
|
+
dpCodes.bright_value
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
// 双灯泡吸顶灯:支持颜色和色温灯同时调节
|
|
17
|
+
export const isMixRGBWLamp = (dpCodes: Record<string, string>) => {
|
|
18
|
+
return !!(
|
|
19
|
+
dpCodes.mix_rgbcw &&
|
|
20
|
+
dpCodes.colour_data &&
|
|
21
|
+
dpCodes.temp_value &&
|
|
22
|
+
dpCodes.bright_value
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 支持调节:颜色/色温+亮度
|
|
27
|
+
export const isRGBWLamp = (dpCodes: Record<string, string>) => {
|
|
28
|
+
return !!(
|
|
29
|
+
!dpCodes.mix_rgbcw &&
|
|
30
|
+
dpCodes.colour_data &&
|
|
31
|
+
dpCodes.temp_value &&
|
|
32
|
+
dpCodes.bright_value
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 支持调节:颜色/单一色温亮度
|
|
37
|
+
export const isRGBLamp = (dpCodes: Record<string, string>) => {
|
|
38
|
+
return !!(
|
|
39
|
+
!dpCodes.mix_rgbcw &&
|
|
40
|
+
!dpCodes.temp_value &&
|
|
41
|
+
dpCodes.colour_data &&
|
|
42
|
+
dpCodes.bright_value
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 支持调节:颜色
|
|
47
|
+
export const isOnlyRGBLamp = (dpCodes: Record<string, string>) => {
|
|
48
|
+
return !!(
|
|
49
|
+
!dpCodes.mix_rgbcw &&
|
|
50
|
+
!dpCodes.temp_value &&
|
|
51
|
+
!dpCodes.bright_value &&
|
|
52
|
+
dpCodes.colour_data
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 支持调节:色温+亮度
|
|
57
|
+
export const isTWLamp = (dpCodes: Record<string, string>) => {
|
|
58
|
+
return !!(
|
|
59
|
+
!dpCodes.mix_rgbcw &&
|
|
60
|
+
!dpCodes.colour_data &&
|
|
61
|
+
dpCodes.temp_value &&
|
|
62
|
+
dpCodes.bright_value
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 支持调节: 色温+ 温度
|
|
67
|
+
export const isFanLamp = (dpCodes: Record<string, string>) => {
|
|
68
|
+
return !!(
|
|
69
|
+
!dpCodes.mix_rgbcw &&
|
|
70
|
+
!dpCodes.colour_data &&
|
|
71
|
+
dpCodes.temp_value &&
|
|
72
|
+
dpCodes.bright_value &&
|
|
73
|
+
dpCodes.fan_speed
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// 支持调节:单一色温亮度
|
|
78
|
+
export const isDIMLamp = (dpCodes: Record<string, string>) => {
|
|
79
|
+
return !!(
|
|
80
|
+
!dpCodes.mix_rgbcw &&
|
|
81
|
+
!dpCodes.colour_data &&
|
|
82
|
+
!dpCodes.temp_value &&
|
|
83
|
+
dpCodes.bright_value
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// GARDOT灯具
|
|
88
|
+
export const isGARDOT = (dpCodes: Record<string, string>) => {
|
|
89
|
+
return !!(
|
|
90
|
+
dpCodes.switch_led &&
|
|
91
|
+
dpCodes.work_mode &&
|
|
92
|
+
dpCodes.colour_data &&
|
|
93
|
+
dpCodes.scene_data &&
|
|
94
|
+
dpCodes.countdown &&
|
|
95
|
+
dpCodes.control_data
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const isSupportColor = (dpCodes: Record<string, string>) => {
|
|
100
|
+
return !!(dpCodes.colour_data)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const isSupportTemperature = (dpCodes: Record<string, string>) => {
|
|
104
|
+
return !!(dpCodes.temp_value)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const isSupportBrightness = (dpCodes: Record<string, string>) => {
|
|
108
|
+
return !!(dpCodes.bright_value)
|
|
109
109
|
}
|
package/src/utils/TypeUtils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare type PropertyValueTypes<T> = {
|
|
2
|
-
[K in keyof T]: T[K];
|
|
3
|
-
}[keyof T];
|
|
1
|
+
export declare type PropertyValueTypes<T> = {
|
|
2
|
+
[K in keyof T]: T[K];
|
|
3
|
+
}[keyof T];
|
package/src/utils/cctUtils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const cctToColor: (key: string | number, brightness?: string | number | undefined) => any;
|
|
1
|
+
export declare const cctToColor: (key: string | number, brightness?: string | number | undefined) => any;
|
package/src/utils/cctUtils.ts
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
const ccts = {
|
|
2
|
-
'0': 'rgb(254, 172, 91)',
|
|
3
|
-
'1': 'rgb(254, 174, 94)',
|
|
4
|
-
'2': 'rgb(253, 176, 97)',
|
|
5
|
-
'3': 'rgb(253, 178, 101)',
|
|
6
|
-
'4': 'rgb(253, 180, 105)',
|
|
7
|
-
'5': 'rgb(253, 181, 109)',
|
|
8
|
-
'6': 'rgb(252, 183, 112)',
|
|
9
|
-
'7': 'rgb(252, 185, 116)',
|
|
10
|
-
'8': 'rgb(252, 187, 120)',
|
|
11
|
-
'9': 'rgb(252, 189, 123)',
|
|
12
|
-
'10': 'rgb(251, 191, 127)',
|
|
13
|
-
'11': 'rgb(251, 193, 131)',
|
|
14
|
-
'12': 'rgb(251, 194, 134)',
|
|
15
|
-
'13': 'rgb(251, 196, 138)',
|
|
16
|
-
'14': 'rgb(250, 198, 142)',
|
|
17
|
-
'15': 'rgb(250, 200, 146)',
|
|
18
|
-
'16': 'rgb(250, 202, 149)',
|
|
19
|
-
'17': 'rgb(250, 204, 153)',
|
|
20
|
-
'18': 'rgb(249, 206, 157)',
|
|
21
|
-
'19': 'rgb(249, 207, 160)',
|
|
22
|
-
'20': 'rgb(249, 209, 164)',
|
|
23
|
-
'21': 'rgb(249, 211, 167)',
|
|
24
|
-
'22': 'rgb(250, 213, 170)',
|
|
25
|
-
'23': 'rgb(250, 214, 173)',
|
|
26
|
-
'24': 'rgb(250, 216, 176)',
|
|
27
|
-
'25': 'rgb(250, 218, 179)',
|
|
28
|
-
'26': 'rgb(251, 220, 182)',
|
|
29
|
-
'27': 'rgb(251, 221, 185)',
|
|
30
|
-
'28': 'rgb(251, 223, 188)',
|
|
31
|
-
'29': 'rgb(251, 225, 191)',
|
|
32
|
-
'30': 'rgb(252, 227, 194)',
|
|
33
|
-
'31': 'rgb(252, 228, 197)',
|
|
34
|
-
'32': 'rgb(252, 230, 199)',
|
|
35
|
-
'33': 'rgb(252, 232, 203)',
|
|
36
|
-
'34': 'rgb(253, 234, 206)',
|
|
37
|
-
'35': 'rgb(253, 235, 209)',
|
|
38
|
-
'36': 'rgb(253, 237, 211)',
|
|
39
|
-
'37': 'rgb(253, 239, 214)',
|
|
40
|
-
'38': 'rgb(254, 241, 217)',
|
|
41
|
-
'39': 'rgb(254, 242, 220)',
|
|
42
|
-
'40': 'rgb(254, 244, 223)',
|
|
43
|
-
'41': 'rgb(254, 244, 224)',
|
|
44
|
-
'42': 'rgb(254, 245, 225)',
|
|
45
|
-
'43': 'rgb(254, 245, 226)',
|
|
46
|
-
'44': 'rgb(254, 245, 227)',
|
|
47
|
-
'45': 'rgb(253, 246, 228)',
|
|
48
|
-
'46': 'rgb(253, 246, 229)',
|
|
49
|
-
'47': 'rgb(253, 246, 230)',
|
|
50
|
-
'48': 'rgb(253, 246, 231)',
|
|
51
|
-
'49': 'rgb(253, 247, 232)',
|
|
52
|
-
'50': 'rgb(253, 247, 233)',
|
|
53
|
-
'51': 'rgb(253, 247, 234)',
|
|
54
|
-
'52': 'rgb(253, 248, 234)',
|
|
55
|
-
'53': 'rgb(253, 248, 235)',
|
|
56
|
-
'54': 'rgb(253, 248, 236)',
|
|
57
|
-
'55': 'rgb(252, 249, 237)',
|
|
58
|
-
'56': 'rgb(252, 249, 238)',
|
|
59
|
-
'57': 'rgb(252, 249, 239)',
|
|
60
|
-
'58': 'rgb(252, 249, 240)',
|
|
61
|
-
'59': 'rgb(252, 250, 241)',
|
|
62
|
-
'60': 'rgb(252, 250, 242)',
|
|
63
|
-
'61': 'rgb(251, 249, 242)',
|
|
64
|
-
'62': 'rgb(249, 248, 243)',
|
|
65
|
-
'63': 'rgb(248, 248, 243)',
|
|
66
|
-
'64': 'rgb(247, 247, 243)',
|
|
67
|
-
'65': 'rgb(246, 246, 243)',
|
|
68
|
-
'66': 'rgb(244, 245, 244)',
|
|
69
|
-
'67': 'rgb(243, 245, 244)',
|
|
70
|
-
'68': 'rgb(241, 244, 244)',
|
|
71
|
-
'69': 'rgb(240, 243, 245)',
|
|
72
|
-
'70': 'rgb(239, 242, 245)',
|
|
73
|
-
'71': 'rgb(238, 242, 245)',
|
|
74
|
-
'72': 'rgb(236, 241, 246)',
|
|
75
|
-
'73': 'rgb(235, 240, 246)',
|
|
76
|
-
'74': 'rgb(234, 239, 246)',
|
|
77
|
-
'75': 'rgb(232, 239, 247)',
|
|
78
|
-
'76': 'rgb(231, 238, 247)',
|
|
79
|
-
'77': 'rgb(230, 237, 247)',
|
|
80
|
-
'78': 'rgb(228, 236, 247)',
|
|
81
|
-
'79': 'rgb(227, 236, 248)',
|
|
82
|
-
'80': 'rgb(226, 235, 248)',
|
|
83
|
-
'81': 'rgb(224, 234, 248)',
|
|
84
|
-
'82': 'rgb(223, 233, 249)',
|
|
85
|
-
'83': 'rgb(221, 232, 249)',
|
|
86
|
-
'84': 'rgb(219, 231, 249)',
|
|
87
|
-
'85': 'rgb(218, 230, 250)',
|
|
88
|
-
'86': 'rgb(216, 230, 250)',
|
|
89
|
-
'87': 'rgb(215, 229, 250)',
|
|
90
|
-
'88': 'rgb(213, 228, 250)',
|
|
91
|
-
'89': 'rgb(212, 227, 251)',
|
|
92
|
-
'90': 'rgb(210, 226, 251)',
|
|
93
|
-
'91': 'rgb(208, 225, 251)',
|
|
94
|
-
'92': 'rgb(207, 224, 252)',
|
|
95
|
-
'93': 'rgb(205, 223, 252)',
|
|
96
|
-
'94': 'rgb(203, 222, 252)',
|
|
97
|
-
'95': 'rgb(202, 221, 253)',
|
|
98
|
-
'96': 'rgb(200, 221, 253)',
|
|
99
|
-
'97': 'rgb(199, 220, 253)',
|
|
100
|
-
'98': 'rgb(197, 219, 253)',
|
|
101
|
-
'99': 'rgb(196, 218, 254)',
|
|
102
|
-
'100': 'rgb(194, 217, 254)',
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export const cctToColor = (key: string | number, brightness?: string | number) => {
|
|
106
|
-
let color = ccts[String(key)]
|
|
107
|
-
if (color && (brightness || brightness === 0)) {
|
|
108
|
-
color = Number(brightness) === 0 ? 'rgb(0,0,0)' : `rgba(${color.slice(4, -1)}, ${Number(brightness) / 100 < 0.1 ? 0.1 : Number(brightness) / 100})`
|
|
109
|
-
}
|
|
110
|
-
return color
|
|
1
|
+
const ccts = {
|
|
2
|
+
'0': 'rgb(254, 172, 91)',
|
|
3
|
+
'1': 'rgb(254, 174, 94)',
|
|
4
|
+
'2': 'rgb(253, 176, 97)',
|
|
5
|
+
'3': 'rgb(253, 178, 101)',
|
|
6
|
+
'4': 'rgb(253, 180, 105)',
|
|
7
|
+
'5': 'rgb(253, 181, 109)',
|
|
8
|
+
'6': 'rgb(252, 183, 112)',
|
|
9
|
+
'7': 'rgb(252, 185, 116)',
|
|
10
|
+
'8': 'rgb(252, 187, 120)',
|
|
11
|
+
'9': 'rgb(252, 189, 123)',
|
|
12
|
+
'10': 'rgb(251, 191, 127)',
|
|
13
|
+
'11': 'rgb(251, 193, 131)',
|
|
14
|
+
'12': 'rgb(251, 194, 134)',
|
|
15
|
+
'13': 'rgb(251, 196, 138)',
|
|
16
|
+
'14': 'rgb(250, 198, 142)',
|
|
17
|
+
'15': 'rgb(250, 200, 146)',
|
|
18
|
+
'16': 'rgb(250, 202, 149)',
|
|
19
|
+
'17': 'rgb(250, 204, 153)',
|
|
20
|
+
'18': 'rgb(249, 206, 157)',
|
|
21
|
+
'19': 'rgb(249, 207, 160)',
|
|
22
|
+
'20': 'rgb(249, 209, 164)',
|
|
23
|
+
'21': 'rgb(249, 211, 167)',
|
|
24
|
+
'22': 'rgb(250, 213, 170)',
|
|
25
|
+
'23': 'rgb(250, 214, 173)',
|
|
26
|
+
'24': 'rgb(250, 216, 176)',
|
|
27
|
+
'25': 'rgb(250, 218, 179)',
|
|
28
|
+
'26': 'rgb(251, 220, 182)',
|
|
29
|
+
'27': 'rgb(251, 221, 185)',
|
|
30
|
+
'28': 'rgb(251, 223, 188)',
|
|
31
|
+
'29': 'rgb(251, 225, 191)',
|
|
32
|
+
'30': 'rgb(252, 227, 194)',
|
|
33
|
+
'31': 'rgb(252, 228, 197)',
|
|
34
|
+
'32': 'rgb(252, 230, 199)',
|
|
35
|
+
'33': 'rgb(252, 232, 203)',
|
|
36
|
+
'34': 'rgb(253, 234, 206)',
|
|
37
|
+
'35': 'rgb(253, 235, 209)',
|
|
38
|
+
'36': 'rgb(253, 237, 211)',
|
|
39
|
+
'37': 'rgb(253, 239, 214)',
|
|
40
|
+
'38': 'rgb(254, 241, 217)',
|
|
41
|
+
'39': 'rgb(254, 242, 220)',
|
|
42
|
+
'40': 'rgb(254, 244, 223)',
|
|
43
|
+
'41': 'rgb(254, 244, 224)',
|
|
44
|
+
'42': 'rgb(254, 245, 225)',
|
|
45
|
+
'43': 'rgb(254, 245, 226)',
|
|
46
|
+
'44': 'rgb(254, 245, 227)',
|
|
47
|
+
'45': 'rgb(253, 246, 228)',
|
|
48
|
+
'46': 'rgb(253, 246, 229)',
|
|
49
|
+
'47': 'rgb(253, 246, 230)',
|
|
50
|
+
'48': 'rgb(253, 246, 231)',
|
|
51
|
+
'49': 'rgb(253, 247, 232)',
|
|
52
|
+
'50': 'rgb(253, 247, 233)',
|
|
53
|
+
'51': 'rgb(253, 247, 234)',
|
|
54
|
+
'52': 'rgb(253, 248, 234)',
|
|
55
|
+
'53': 'rgb(253, 248, 235)',
|
|
56
|
+
'54': 'rgb(253, 248, 236)',
|
|
57
|
+
'55': 'rgb(252, 249, 237)',
|
|
58
|
+
'56': 'rgb(252, 249, 238)',
|
|
59
|
+
'57': 'rgb(252, 249, 239)',
|
|
60
|
+
'58': 'rgb(252, 249, 240)',
|
|
61
|
+
'59': 'rgb(252, 250, 241)',
|
|
62
|
+
'60': 'rgb(252, 250, 242)',
|
|
63
|
+
'61': 'rgb(251, 249, 242)',
|
|
64
|
+
'62': 'rgb(249, 248, 243)',
|
|
65
|
+
'63': 'rgb(248, 248, 243)',
|
|
66
|
+
'64': 'rgb(247, 247, 243)',
|
|
67
|
+
'65': 'rgb(246, 246, 243)',
|
|
68
|
+
'66': 'rgb(244, 245, 244)',
|
|
69
|
+
'67': 'rgb(243, 245, 244)',
|
|
70
|
+
'68': 'rgb(241, 244, 244)',
|
|
71
|
+
'69': 'rgb(240, 243, 245)',
|
|
72
|
+
'70': 'rgb(239, 242, 245)',
|
|
73
|
+
'71': 'rgb(238, 242, 245)',
|
|
74
|
+
'72': 'rgb(236, 241, 246)',
|
|
75
|
+
'73': 'rgb(235, 240, 246)',
|
|
76
|
+
'74': 'rgb(234, 239, 246)',
|
|
77
|
+
'75': 'rgb(232, 239, 247)',
|
|
78
|
+
'76': 'rgb(231, 238, 247)',
|
|
79
|
+
'77': 'rgb(230, 237, 247)',
|
|
80
|
+
'78': 'rgb(228, 236, 247)',
|
|
81
|
+
'79': 'rgb(227, 236, 248)',
|
|
82
|
+
'80': 'rgb(226, 235, 248)',
|
|
83
|
+
'81': 'rgb(224, 234, 248)',
|
|
84
|
+
'82': 'rgb(223, 233, 249)',
|
|
85
|
+
'83': 'rgb(221, 232, 249)',
|
|
86
|
+
'84': 'rgb(219, 231, 249)',
|
|
87
|
+
'85': 'rgb(218, 230, 250)',
|
|
88
|
+
'86': 'rgb(216, 230, 250)',
|
|
89
|
+
'87': 'rgb(215, 229, 250)',
|
|
90
|
+
'88': 'rgb(213, 228, 250)',
|
|
91
|
+
'89': 'rgb(212, 227, 251)',
|
|
92
|
+
'90': 'rgb(210, 226, 251)',
|
|
93
|
+
'91': 'rgb(208, 225, 251)',
|
|
94
|
+
'92': 'rgb(207, 224, 252)',
|
|
95
|
+
'93': 'rgb(205, 223, 252)',
|
|
96
|
+
'94': 'rgb(203, 222, 252)',
|
|
97
|
+
'95': 'rgb(202, 221, 253)',
|
|
98
|
+
'96': 'rgb(200, 221, 253)',
|
|
99
|
+
'97': 'rgb(199, 220, 253)',
|
|
100
|
+
'98': 'rgb(197, 219, 253)',
|
|
101
|
+
'99': 'rgb(196, 218, 254)',
|
|
102
|
+
'100': 'rgb(194, 217, 254)',
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const cctToColor = (key: string | number, brightness?: string | number) => {
|
|
106
|
+
let color = ccts[String(key)]
|
|
107
|
+
if (color && (brightness || brightness === 0)) {
|
|
108
|
+
color = Number(brightness) === 0 ? 'rgb(0,0,0)' : `rgba(${color.slice(4, -1)}, ${Number(brightness) / 100 < 0.1 ? 0.1 : Number(brightness) / 100})`
|
|
109
|
+
}
|
|
110
|
+
return color
|
|
111
111
|
}
|
package/src/utils/common.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export declare const loopText: (loop: any, time?: string) => string;
|
|
2
|
-
export declare const loopTommorrowText: (loop: any, isTommorrow: any) => string;
|
|
3
|
-
export declare const toFixed: (str: any, count: any) => string;
|
|
4
|
-
export declare function getArray(arr: any, size: any): string[];
|
|
5
|
-
export declare function getWeek(weekString: any): number[];
|
|
6
|
-
/**
|
|
7
|
-
* 按位分割字符串
|
|
8
|
-
* @param {*} str 要分割的字符串
|
|
9
|
-
* @param {*} step 按多少位分割
|
|
10
|
-
* @returns ['','',...]
|
|
11
|
-
*/
|
|
12
|
-
export declare function spliceByStep(str: string, step: number): string[];
|
|
13
|
-
export declare function hex2Int(hex: string): number;
|
|
14
|
-
export declare const localeNumber: (v: number | string, fixed?: number | undefined, showGroup?: boolean | undefined) => string | number;
|
|
15
|
-
export declare const exchangeNumber: (v: number | string) => string;
|
|
16
|
-
export declare const exportFile: (list: any) => void;
|
|
17
|
-
export declare const exportHistoryFile: (list: any) => void;
|
|
18
|
-
export declare const monthFormat: (v: number | string) => string;
|
|
19
|
-
export declare const tagTitle: string[];
|
|
20
|
-
export declare function isTimeSpanValid(timeData: any): number;
|
|
21
|
-
export declare function modifyPopup(beforeValue: object, editValue: object): boolean;
|
|
22
|
-
interface DialogProps {
|
|
23
|
-
method: 'alert' | 'confirm';
|
|
24
|
-
title: string;
|
|
25
|
-
showCancelText?: boolean;
|
|
26
|
-
showConfirmText?: boolean;
|
|
27
|
-
cancelText?: string;
|
|
28
|
-
confirmText?: string;
|
|
29
|
-
subTitle?: string;
|
|
30
|
-
onConfirm: (data: any, args: {
|
|
31
|
-
close: () => void;
|
|
32
|
-
}) => void;
|
|
33
|
-
}
|
|
34
|
-
export declare function showDialog(props: DialogProps): void;
|
|
35
|
-
export {};
|
|
1
|
+
export declare const loopText: (loop: any, time?: string) => string;
|
|
2
|
+
export declare const loopTommorrowText: (loop: any, isTommorrow: any) => string;
|
|
3
|
+
export declare const toFixed: (str: any, count: any) => string;
|
|
4
|
+
export declare function getArray(arr: any, size: any): string[];
|
|
5
|
+
export declare function getWeek(weekString: any): number[];
|
|
6
|
+
/**
|
|
7
|
+
* 按位分割字符串
|
|
8
|
+
* @param {*} str 要分割的字符串
|
|
9
|
+
* @param {*} step 按多少位分割
|
|
10
|
+
* @returns ['','',...]
|
|
11
|
+
*/
|
|
12
|
+
export declare function spliceByStep(str: string, step: number): string[];
|
|
13
|
+
export declare function hex2Int(hex: string): number;
|
|
14
|
+
export declare const localeNumber: (v: number | string, fixed?: number | undefined, showGroup?: boolean | undefined) => string | number;
|
|
15
|
+
export declare const exchangeNumber: (v: number | string) => string;
|
|
16
|
+
export declare const exportFile: (list: any) => void;
|
|
17
|
+
export declare const exportHistoryFile: (list: any) => void;
|
|
18
|
+
export declare const monthFormat: (v: number | string) => string;
|
|
19
|
+
export declare const tagTitle: string[];
|
|
20
|
+
export declare function isTimeSpanValid(timeData: any): number;
|
|
21
|
+
export declare function modifyPopup(beforeValue: object, editValue: object): boolean;
|
|
22
|
+
interface DialogProps {
|
|
23
|
+
method: 'alert' | 'confirm';
|
|
24
|
+
title: string;
|
|
25
|
+
showCancelText?: boolean;
|
|
26
|
+
showConfirmText?: boolean;
|
|
27
|
+
cancelText?: string;
|
|
28
|
+
confirmText?: string;
|
|
29
|
+
subTitle?: string;
|
|
30
|
+
onConfirm: (data: any, args: {
|
|
31
|
+
close: () => void;
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function showDialog(props: DialogProps): void;
|
|
35
|
+
export {};
|