@ledvance/ui-biz-bundle 1.1.33 → 1.1.35
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/package.json
CHANGED
|
@@ -57,19 +57,7 @@ export const useFlag: UseFlagType = (flagCode, extra) => {
|
|
|
57
57
|
setDps({ [flagCode]: hex})
|
|
58
58
|
}, idx * 50)
|
|
59
59
|
})
|
|
60
|
-
|
|
61
|
-
if(extra.isCeilingLight){
|
|
62
|
-
const whiteHex = obj2Dp(flagItem, extra)
|
|
63
|
-
extraDps[extra.switchLedCode] = true,
|
|
64
|
-
extraDps[extra.rgbcSwitchLedCode!] = true
|
|
65
|
-
extraDps[extra.rgbcWorkModeCode!] = WORK_MODE.COLOUR
|
|
66
|
-
extraDps[extra.workModeCode] = WORK_MODE.SCENE
|
|
67
|
-
extraDps[extra.sceneDataCode!!] = whiteHex
|
|
68
|
-
}else{
|
|
69
|
-
extraDps[extra.switchLedCode] = true
|
|
70
|
-
extraDps[extra.workModeCode] = WORK_MODE.COLOUR
|
|
71
|
-
}
|
|
72
|
-
return setDps(extraDps)
|
|
60
|
+
return setDps({ [extra.switchLedCode]: true, [extra.workModeCode]: WORK_MODE.COLOUR})
|
|
73
61
|
} else {
|
|
74
62
|
const hex = obj2Dp(flagItem, extra)
|
|
75
63
|
return setDps({ [flagCode]: hex, [extra.workModeCode]: WORK_MODE.SCENE, [extra.switchLedCode]: true })
|
|
@@ -81,7 +69,6 @@ export const useFlag: UseFlagType = (flagCode, extra) => {
|
|
|
81
69
|
export interface FlagOption {
|
|
82
70
|
isMixLight?: boolean
|
|
83
71
|
isStringLight?: boolean
|
|
84
|
-
isCeilingLight?: boolean
|
|
85
72
|
workModeCode: string
|
|
86
73
|
}
|
|
87
74
|
|
|
@@ -142,8 +129,8 @@ export function obj2Dp(flagItem: FlagItemInfo, option?: FlagOption): string {
|
|
|
142
129
|
} else {
|
|
143
130
|
const switchingIntervalHex = nToHS(flagItem.speed)
|
|
144
131
|
const transitionTimeHex = nToHS(flagItem.speed)
|
|
145
|
-
const transitionModeHex = nToHS(
|
|
146
|
-
const
|
|
132
|
+
const transitionModeHex = nToHS(flagItem.mode)
|
|
133
|
+
const hex = idHex + flagItem.colors.map(color => {
|
|
147
134
|
const hHex = nToHS(Math.round(color.h), 4)
|
|
148
135
|
const sHex = nToHS(Math.round(color.s * 10), 4)
|
|
149
136
|
const vHex = nToHS(Math.round(color.v * 10), 4)
|
|
@@ -151,9 +138,6 @@ export function obj2Dp(flagItem: FlagItemInfo, option?: FlagOption): string {
|
|
|
151
138
|
const colorTempHex = '0000'
|
|
152
139
|
return switchingIntervalHex + transitionTimeHex + transitionModeHex + hHex + sHex + vHex + brightnessHex + colorTempHex
|
|
153
140
|
}).join('')
|
|
154
|
-
const whiteColor = flagItem.whiteColors[0]
|
|
155
|
-
const whiteHex = switchingIntervalHex + transitionTimeHex + transitionModeHex + '0000' + '0000' + '0000' + nToHS(whiteColor?.brightness * 10, 4) + nToHS(whiteColor?.colorTemp * 10, 4)
|
|
156
|
-
const hex = idHex + (option?.isCeilingLight ? whiteHex : colorHex)
|
|
157
141
|
return hex
|
|
158
142
|
}
|
|
159
143
|
}
|
|
@@ -270,7 +270,7 @@ export const defFlagList: FlagUiInfo[] = [
|
|
|
270
270
|
whiteColors: [
|
|
271
271
|
{ brightness: 100, colorTemp: 0},
|
|
272
272
|
],
|
|
273
|
-
colors: [{h:
|
|
273
|
+
colors: [{h: 220, s: 89, v: 100},{h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
|
|
274
274
|
},
|
|
275
275
|
{
|
|
276
276
|
id: 234,
|
|
@@ -314,7 +314,7 @@ export const defFlagList: FlagUiInfo[] = [
|
|
|
314
314
|
whiteColors: [
|
|
315
315
|
{ brightness: 100, colorTemp: 0},
|
|
316
316
|
],
|
|
317
|
-
colors: [{h:
|
|
317
|
+
colors: [{h: 50, s: 100, v: 100}, {h: 211, s: 100, v: 100}]
|
|
318
318
|
},
|
|
319
319
|
]
|
|
320
320
|
|
|
@@ -609,7 +609,7 @@ export const def2FlagList: FlagUiInfo[] = [
|
|
|
609
609
|
whiteColors: [
|
|
610
610
|
{ brightness: 100, colorTemp: 0},
|
|
611
611
|
],
|
|
612
|
-
colors: [{h:
|
|
612
|
+
colors: [{h: 50, s: 100, v: 100}, {h: 211, s: 100, v: 100}]
|
|
613
613
|
},
|
|
614
614
|
]
|
|
615
615
|
|
|
@@ -859,7 +859,7 @@ export const def3FlagList: FlagUiInfo[] = [
|
|
|
859
859
|
whiteColors: [
|
|
860
860
|
{ brightness: 100, colorTemp: 0},
|
|
861
861
|
],
|
|
862
|
-
colors: [{h:
|
|
862
|
+
colors: [{h: 220, s: 89, v: 100},{h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
|
|
863
863
|
},
|
|
864
864
|
{
|
|
865
865
|
id: 234,
|
|
@@ -903,6 +903,6 @@ export const def3FlagList: FlagUiInfo[] = [
|
|
|
903
903
|
whiteColors: [
|
|
904
904
|
{ brightness: 100, colorTemp: 0},
|
|
905
905
|
],
|
|
906
|
-
colors: [{h:
|
|
906
|
+
colors: [{h: 50, s: 100, v: 100}, {h: 211, s: 100, v: 100}]
|
|
907
907
|
},
|
|
908
908
|
]
|
|
@@ -27,7 +27,6 @@ export interface FlagPageProps {
|
|
|
27
27
|
isSupportTemperature?: boolean
|
|
28
28
|
isStringLight?: boolean
|
|
29
29
|
isStripLight?: boolean
|
|
30
|
-
isCeilingLight?: boolean
|
|
31
30
|
isSupportMixScene?: boolean
|
|
32
31
|
drawToolLight?: {
|
|
33
32
|
drawToolCode: string
|
|
@@ -38,8 +37,6 @@ export interface FlagPageProps {
|
|
|
38
37
|
sceneDataCode?: string
|
|
39
38
|
workModeCode: string
|
|
40
39
|
switchLedCode: string
|
|
41
|
-
rgbcWorkModeCode?: string
|
|
42
|
-
rgbcSwitchLedCode?: string
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
const FlagPage = () => {
|
|
@@ -51,10 +48,9 @@ const FlagPage = () => {
|
|
|
51
48
|
const [moods, setMoods] = useMoods()
|
|
52
49
|
const [flags, setFlags] = useFlags()
|
|
53
50
|
const [flagMode, setFlagMode] = useFlagMode()
|
|
54
|
-
const [flagState, setFlag] = useFlag((
|
|
51
|
+
const [flagState, setFlag] = useFlag((params.isStripLight ? params?.drawToolLight?.drawToolCode : params.sceneDataCode)!!, {
|
|
55
52
|
isMixLight: params.isSupportMixScene,
|
|
56
53
|
isStringLight: params.isStringLight,
|
|
57
|
-
isCeilingLight: params.isCeilingLight,
|
|
58
54
|
...params
|
|
59
55
|
})
|
|
60
56
|
const state = useReactive({
|