@ledvance/ui-biz-bundle 1.1.19 → 1.1.21

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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.19",
7
+ "version": "1.1.21",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -300,7 +300,7 @@ export const defFlagList: FlagUiInfo[] = [
300
300
  version: 0,
301
301
  mode: SceneNodeTransitionMode.Jump,
302
302
  speed: 70,
303
- name: '',
303
+ name: I18n.getLang('flag_leverkusen'),
304
304
  icon: res.leverkusen_icon,
305
305
  whiteColors: [
306
306
  { brightness: 100, colorTemp: 0},
@@ -55,7 +55,7 @@ const TimerPage = () => {
55
55
  const runningTimer = () => {
56
56
  return progress.filter(p => p.progressHook.countdown > 0)
57
57
  }
58
-
58
+
59
59
  const getProgressByDp = useCallback((dpId: string) => {
60
60
  return progress.find(p => p.dpId === dpId)!.progressHook
61
61
  }, [progress])
@@ -153,7 +153,7 @@ const TimerPage = () => {
153
153
  {item.label}
154
154
  </Text>
155
155
  {progress.length > 1 && <TouchableOpacity onPress={() => handelTimer(item, false)}>
156
- <Image style={{ width: cx(16), height: cx(16), marginRight: cx(5) }} source={res.ic_arrows_nav_clear} />
156
+ <Image style={{ width: cx(16), height: cx(16), marginRight: cx(5) }} source={res.ic_arrows_nav_clear} />
157
157
  </TouchableOpacity>}
158
158
  </View>
159
159
  );
@@ -173,104 +173,104 @@ const TimerPage = () => {
173
173
  {/* picker */}
174
174
  <View style={styles.content}>
175
175
  {hasNotRunningTimer() && <>
176
- <LdvPickerView
177
- hour={state.hour}
178
- minute={state.minute}
179
- setHour={h => state.hour = h}
180
- setMinute={m => state.minute = m}
181
- unit={['h', 'min']}
182
- />
176
+ <LdvPickerView
177
+ hour={state.hour}
178
+ minute={state.minute}
179
+ setHour={h => state.hour = h}
180
+ setMinute={m => state.minute = m}
181
+ unit={['h', 'min']}
182
+ />
183
183
  {/* Apply for */}
184
- <View>
185
- <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline_text')}</Text>
186
- <View
187
- style={{
188
- backgroundColor: '#f6f6f6',
189
- borderRadius: 4,
190
- minHeight: cx(50),
191
- flex: 1,
192
- justifyContent: 'center',
193
- }}
194
- >
195
- {!state.selectedSkill.length ? <Text style={{ marginLeft: cx(10) }}>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text> :
184
+ <View>
185
+ <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline_text')}</Text>
196
186
  <View
197
- style={{
198
- marginHorizontal: cx(8),
199
- marginTop: cx(8),
200
- borderRadius: 4,
201
- }}
187
+ style={{
188
+ backgroundColor: '#f6f6f6',
189
+ borderRadius: 4,
190
+ minHeight: cx(50),
191
+ flex: 1,
192
+ justifyContent: 'center',
193
+ }}
202
194
  >
203
- <FlatList
204
- data={state.selectedSkill}
205
- renderItem={item => renderItem(item)}
206
- keyExtractor={(item: dpItem) => item.dpId}
207
- />
208
- </View>}
195
+ {!state.selectedSkill.length ? <Text style={{ marginLeft: cx(10) }}>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text> :
196
+ <View
197
+ style={{
198
+ marginHorizontal: cx(8),
199
+ marginTop: cx(8),
200
+ borderRadius: 4,
201
+ }}
202
+ >
203
+ <FlatList
204
+ data={state.selectedSkill}
205
+ renderItem={item => renderItem(item)}
206
+ keyExtractor={(item: dpItem) => item.dpId}
207
+ />
208
+ </View>}
209
+ </View>
210
+ {state.skillList.map((skill: dpItem) => {
211
+ return (
212
+ <TouchableOpacity style={styles.skillListItem} key={skill.dpId} onPress={() => handelTimer(skill, true)}>
213
+ <Text style={{ color: '#000' }}>{skill.label}</Text>
214
+ <Image style={{ width: cx(16), height: cx(16) }} source={res.device_panel_timer_add} />
215
+ </TouchableOpacity>
216
+ )
217
+ })}
209
218
  </View>
210
- {state.skillList.map((skill: dpItem) => {
211
- return (
212
- <TouchableOpacity style={styles.skillListItem} key={skill.dpId} onPress={() => handelTimer(skill, true)}>
213
- <Text style={{ color: '#000' }}>{skill.label}</Text>
214
- <Image style={{ width: cx(16), height: cx(16) }} source={res.device_panel_timer_add} />
215
- </TouchableOpacity>
216
- )
217
- })}
218
- </View>
219
219
 
220
220
  {/* Start */}
221
- <Spacer />
222
- <DeleteButton
223
- text={I18n.getLang('timer_sockets_button_text')}
224
- onPress={onStartPress}
225
- textStyle={{ fontSize: cx(14) }}
226
- style={{ backgroundColor: !state.selectedSkill.length ? '#FFE0D4' : '#f60' }}
227
- />
228
- <Spacer />
221
+ <Spacer />
222
+ <DeleteButton
223
+ text={I18n.getLang('timer_sockets_button_text')}
224
+ onPress={onStartPress}
225
+ textStyle={{ fontSize: cx(14) }}
226
+ style={{ backgroundColor: !state.selectedSkill.length ? '#FFE0D4' : '#f60' }}
227
+ />
228
+ <Spacer />
229
229
  </>}
230
230
 
231
231
  {/* Active timer */}
232
232
  {!!runningTimer().length && (
233
233
  showActiveView() ? <>
234
- <Text style={styles.itemTitle}>{I18n.formatValue('timer_nightplug_active_timer_subheadline2_text', runningTimer().length.toString())}</Text>
235
- {runningTimer().map(timer => (
236
- <View key={timer.dpId}>
237
- <Card containerStyle={styles.activeTimer}>
238
- <View style={styles.activeTimerTitleBox}>
239
- <Text style={styles.activeTimerTitle}>{timer.label}</Text>
240
- <TouchableOpacity
241
- onPress={() => {
242
- getProgressByDp(timer.dpId).endTimer()
243
- }}
244
- style={styles.activeTimerCancelBtn}>
245
- <Text style={{ color: '#fff', fontSize: cx(12) }}>{I18n.getLang('auto_scan_system_cancel')}</Text>
246
- </TouchableOpacity>
247
- </View>
248
- <View style={styles.activeTimerTimeBox}>
249
- <Progress.Double
250
- style={{
251
- width: 35,
252
- height: 35,
253
- // backgroundColor: 'red',
254
- justifyContent: 'center',
255
- alignItems: 'center',
256
- }}
257
- disabled={true}
258
- minValue={0}
259
- maxValue={getProgressByDp(timer.dpId).progressNumber}
260
- startDegree={270}
261
- andDegree={360}
262
- scaleHeight={2}
263
- thumbStrokeWidth={2}
264
- thumbRadius={0}
265
- />
266
- <Text style={{ marginLeft: cx(20), fontSize: cx(22) }}>{getActiveTimeString(timer.progressHook.countdown)}</Text>
267
- </View>
268
- <Text>{I18n.formatValue(timer.enable ? timer.stringOff : timer.stringOn, getSingleLightEndTimeString(timer.progressHook.countdown))}</Text>
269
- </Card>
270
- <Spacer height={cx(40)} />
271
- </View>
272
- ))}
273
- </> :
234
+ <Text style={styles.itemTitle}>{I18n.formatValue('timer_nightplug_active_timer_subheadline2_text', runningTimer().length.toString())}</Text>
235
+ {runningTimer().map(timer => (
236
+ <View key={timer.dpId}>
237
+ <Card containerStyle={styles.activeTimer}>
238
+ <View style={styles.activeTimerTitleBox}>
239
+ <Text style={styles.activeTimerTitle}>{timer.label}</Text>
240
+ <TouchableOpacity
241
+ onPress={() => {
242
+ getProgressByDp(timer.dpId).endTimer()
243
+ }}
244
+ style={styles.activeTimerCancelBtn}>
245
+ <Text style={{ color: '#fff', fontSize: cx(12) }}>{I18n.getLang('auto_scan_system_cancel')}</Text>
246
+ </TouchableOpacity>
247
+ </View>
248
+ <View style={styles.activeTimerTimeBox}>
249
+ <Progress.Double
250
+ style={{
251
+ width: 35,
252
+ height: 35,
253
+ // backgroundColor: 'red',
254
+ justifyContent: 'center',
255
+ alignItems: 'center',
256
+ }}
257
+ disabled={true}
258
+ minValue={0}
259
+ maxValue={getProgressByDp(timer.dpId).progressNumber}
260
+ startDegree={270}
261
+ andDegree={360}
262
+ scaleHeight={2}
263
+ thumbStrokeWidth={2}
264
+ thumbRadius={0}
265
+ />
266
+ <Text style={{ marginLeft: cx(20), fontSize: cx(22) }}>{getActiveTimeString(timer.progressHook.countdown)}</Text>
267
+ </View>
268
+ <Text>{I18n.formatValue(timer.enable ? timer.stringOff : timer.stringOn, getSingleLightEndTimeString(timer.progressHook.countdown))}</Text>
269
+ </Card>
270
+ <Spacer height={cx(40)} />
271
+ </View>
272
+ ))}
273
+ </> :
274
274
  <View
275
275
  style={{
276
276
  flexDirection: 'column',
@@ -18,8 +18,8 @@ export const useCountdowns = (dps: dpItem[]) => {
18
18
  }
19
19
 
20
20
  type FormateProgressType = {
21
- progressNumber: number
22
- countdown: number
21
+ progressNumber: number
22
+ countdown: number
23
23
  startTimer: (c: number, time: string) => Promise<void>
24
24
  endTimer: () => void
25
25
  }
@@ -41,7 +41,7 @@ const useFormateProgress: (dp: dpItem) => FormateProgressType = (dp) => {
41
41
  NativeApi.getJson(devId, dp.cloudKey).then(res => {
42
42
  if (res.success && res.data) {
43
43
  const result = JSON.parse(res.data)
44
- setCloudData(result)
44
+ setCloudData(result)
45
45
  setCloudProgressNumber(result.progressAllNumber)
46
46
  if (countdown > 0) setProgress(Date.now() + countdown * 1000)
47
47
  }
@@ -83,7 +83,7 @@ const useFormateProgress: (dp: dpItem) => FormateProgressType = (dp) => {
83
83
  }, [countdown, cloudData])
84
84
 
85
85
 
86
-
86
+
87
87
  const initTimerFn = useCallback(() =>{
88
88
  setProgressNumber(0)
89
89
  setCloudData(null)
@@ -113,7 +113,7 @@ const useFormateProgress: (dp: dpItem) => FormateProgressType = (dp) => {
113
113
  initTimerFn()
114
114
  })
115
115
  }
116
-
116
+
117
117
  return {
118
118
  progressNumber,
119
119
  countdown,