@ledvance/ui-biz-bundle 1.1.122 → 1.1.124

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.
Files changed (283) hide show
  1. package/package.json +1 -1
  2. package/src/hooks/DeviceDpStateHooks.ts +41 -60
  3. package/src/modules/flags/FlagEditPage.tsx +3 -3
  4. package/src/modules/flags/FlagPage.tsx +1 -1
  5. package/src/modules/history/HistoryPage.tsx +13 -3
  6. package/src/modules/mood/DynamicMoodEditorPage.tsx +5 -5
  7. package/src/modules/mood/FantasyMoodEditPage.tsx +3 -3
  8. package/src/modules/mood/MixMood/MixMoodEditPage.tsx +6 -6
  9. package/src/modules/mood/MixMood/MixMoodItem.tsx +2 -2
  10. package/src/modules/music/MusicDataBean.ts +4 -4
  11. package/src/modules/music/MusicPage.tsx +2 -2
  12. package/src/modules/timeSchedule/DeviceState.tsx +2 -2
  13. package/src/modules/timeSchedule/TimeScheduleEditpage.tsx +11 -11
  14. package/src/modules/timeSchedule/TimeSchedulePage.tsx +1 -1
  15. package/src/modules/timer/TimerPage.tsx +6 -4
  16. package/src/newModules/biorhythm/BiorhythmActions.ts +11 -11
  17. package/src/newModules/biorhythm/BiorhythmBean.ts +6 -6
  18. package/src/newModules/biorhythm/BiorhythmEditPage.tsx +3 -4
  19. package/src/newModules/biorhythm/BiorhythmPage.tsx +8 -9
  20. package/src/newModules/biorhythm/IconSelect.tsx +1 -1
  21. package/src/newModules/biorhythm/circular/ItemIcon.tsx +1 -1
  22. package/src/newModules/biorhythm/circular/Progress.tsx +2 -2
  23. package/src/newModules/biorhythm/circular/TimeCircular.tsx +4 -4
  24. package/src/newModules/biorhythm/iconListData.ts +26 -26
  25. package/src/newModules/childLock/ChildLockPage.tsx +1 -1
  26. package/src/newModules/diyScene/DiySceneEditorPage.tsx +4 -4
  27. package/src/newModules/diyScene/DiyScenePage.tsx +1 -1
  28. package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +2 -2
  29. package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +3 -3
  30. package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +4 -4
  31. package/src/newModules/energyConsumption/component/DateSwitch.tsx +4 -4
  32. package/src/newModules/energyConsumption/component/EnergyModal.tsx +2 -2
  33. package/src/newModules/energyConsumption/component/Overview.tsx +4 -4
  34. package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +3 -3
  35. package/src/newModules/fixedTime/FixedTimePage.tsx +2 -1
  36. package/src/newModules/mood/DynamicMoodEditorPage.tsx +3 -3
  37. package/src/newModules/mood/MixDynamicMoodEditor.tsx +6 -6
  38. package/src/newModules/mood/MoodItem.tsx +1 -1
  39. package/src/newModules/mood/MoodPage.tsx +1 -1
  40. package/src/newModules/randomTime/RandomTimeDetailPage.tsx +2 -2
  41. package/src/newModules/randomTime/RandomTimePage.tsx +2 -1
  42. package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +15 -15
  43. package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +2 -2
  44. package/src/modules/biorhythm/BiorhythmActions.d.ts +0 -8
  45. package/src/modules/biorhythm/BiorhythmActions.ts +0 -324
  46. package/src/modules/biorhythm/BiorhythmBean.d.ts +0 -58
  47. package/src/modules/biorhythm/BiorhythmBean.ts +0 -230
  48. package/src/modules/biorhythm/BiorhythmEditPage.d.ts +0 -14
  49. package/src/modules/biorhythm/BiorhythmEditPage.tsx +0 -324
  50. package/src/modules/biorhythm/BiorhythmPage.d.ts +0 -10
  51. package/src/modules/biorhythm/BiorhythmPage.tsx +0 -796
  52. package/src/modules/biorhythm/IconSelect.d.ts +0 -2
  53. package/src/modules/biorhythm/IconSelect.tsx +0 -82
  54. package/src/modules/biorhythm/Router.ts +0 -34
  55. package/src/modules/biorhythm/circular/ItemIcon.d.ts +0 -22
  56. package/src/modules/biorhythm/circular/ItemIcon.tsx +0 -173
  57. package/src/modules/biorhythm/circular/Progress.d.ts +0 -24
  58. package/src/modules/biorhythm/circular/Progress.tsx +0 -412
  59. package/src/modules/biorhythm/circular/TimeCircular.d.ts +0 -11
  60. package/src/modules/biorhythm/circular/TimeCircular.tsx +0 -70
  61. package/src/modules/biorhythm/circular/biorhythm_plantimer.png +0 -0
  62. package/src/modules/biorhythm/circular/rhythm_icon.png +0 -0
  63. package/src/modules/biorhythm/iconListData.d.ts +0 -7
  64. package/src/modules/biorhythm/iconListData.ts +0 -30
  65. package/src/modules/biorhythm/pIdList.d.ts +0 -2
  66. package/src/modules/biorhythm/pIdList.ts +0 -36
  67. package/src/modules/biorhythm/res/BiologicalRes.d.ts +0 -43
  68. package/src/modules/biorhythm/res/BiologicalRes.ts +0 -42
  69. package/src/modules/biorhythm/res/Biological_Rhythm.png +0 -0
  70. package/src/modules/biorhythm/res/Biological_Rhythm_12.png +0 -0
  71. package/src/modules/biorhythm/res/Biological_Rhythm_new.png +0 -0
  72. package/src/modules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
  73. package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
  74. package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
  75. package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
  76. package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
  77. package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
  78. package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
  79. package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
  80. package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
  81. package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
  82. package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
  83. package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
  84. package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
  85. package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
  86. package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
  87. package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
  88. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
  89. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
  90. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
  91. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
  92. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
  93. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
  94. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
  95. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
  96. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
  97. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
  98. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
  99. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
  100. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
  101. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
  102. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
  103. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
  104. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
  105. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
  106. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
  107. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
  108. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
  109. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
  110. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
  111. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
  112. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
  113. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
  114. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
  115. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
  116. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
  117. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
  118. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
  119. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
  120. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
  121. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
  122. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
  123. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
  124. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
  125. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
  126. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
  127. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
  128. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
  129. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
  130. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
  131. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
  132. package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
  133. package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
  134. package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
  135. package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
  136. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
  137. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
  138. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
  139. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
  140. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
  141. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
  142. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
  143. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
  144. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
  145. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
  146. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
  147. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
  148. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
  149. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
  150. package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
  151. package/src/modules/fixedTime/FixedTimeActions.ts +0 -173
  152. package/src/modules/fixedTime/FixedTimeDetailPage.tsx +0 -373
  153. package/src/modules/fixedTime/FixedTimePage.tsx +0 -214
  154. package/src/modules/fixedTime/Router.ts +0 -26
  155. package/src/modules/music/res/app_music_ball@2x.png +0 -0
  156. package/src/modules/music/res/app_music_ball@3x.png +0 -0
  157. package/src/modules/music/res/app_music_game@2x.png +0 -0
  158. package/src/modules/music/res/app_music_game@3x.png +0 -0
  159. package/src/modules/music/res/app_music_music@2x.png +0 -0
  160. package/src/modules/music/res/app_music_music@3x.png +0 -0
  161. package/src/modules/music/res/app_music_romantic@2x.png +0 -0
  162. package/src/modules/music/res/app_music_romantic@3x.png +0 -0
  163. package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck.png +0 -0
  164. package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck@2x.png +0 -0
  165. package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck@3x.png +0 -0
  166. package/src/modules/music/res/illustrationsFeaturesMusic-dark.png +0 -0
  167. package/src/modules/music/res/illustrationsFeaturesMusic-dark@2x.png +0 -0
  168. package/src/modules/music/res/illustrationsFeaturesMusic-dark@3x.png +0 -0
  169. package/src/modules/music/res/illustrationsFeaturesMusic.png +0 -0
  170. package/src/modules/music/res/illustrationsFeaturesMusic@2x.png +0 -0
  171. package/src/modules/music/res/illustrationsFeaturesMusic@3x.png +0 -0
  172. package/src/modules/music/res/illustrationsFeaturesMusicDisabled.png +0 -0
  173. package/src/modules/music/res/illustrationsFeaturesMusicDisabled@2x.png +0 -0
  174. package/src/modules/music/res/illustrationsFeaturesMusicDisabled@3x.png +0 -0
  175. package/src/modules/music/res/index.d.ts +0 -10
  176. package/src/modules/music/res/index.ts +0 -10
  177. package/src/modules/powerOnBehavior/PowerOnBehaviorActions.ts +0 -12
  178. package/src/modules/powerOnBehavior/PowerOnBehaviorPage.tsx +0 -173
  179. package/src/modules/powerOnBehavior/Router.ts +0 -16
  180. package/src/modules/randomTime/RandomTimeActions.ts +0 -160
  181. package/src/modules/randomTime/RandomTimeDetailPage.tsx +0 -338
  182. package/src/modules/randomTime/RandomTimePage.tsx +0 -215
  183. package/src/modules/randomTime/Router.ts +0 -25
  184. package/src/modules/randomTime/Summary.tsx +0 -123
  185. package/src/modules/sleepWakeup/DeviceState.d.ts +0 -9
  186. package/src/modules/sleepWakeup/DeviceState.tsx +0 -100
  187. package/src/modules/sleepWakeup/LdvScheduleItem.d.ts +0 -15
  188. package/src/modules/sleepWakeup/LdvScheduleItem.tsx +0 -176
  189. package/src/modules/sleepWakeup/Router.ts +0 -25
  190. package/src/modules/sleepWakeup/SleepWakeUpActions.d.ts +0 -2
  191. package/src/modules/sleepWakeup/SleepWakeUpActions.ts +0 -180
  192. package/src/modules/sleepWakeup/SleepWakeUpDetailPage.d.ts +0 -2
  193. package/src/modules/sleepWakeup/SleepWakeUpDetailPage.tsx +0 -617
  194. package/src/modules/sleepWakeup/SleepWakeUpPage.d.ts +0 -13
  195. package/src/modules/sleepWakeup/SleepWakeUpPage.tsx +0 -425
  196. package/src/modules/sleepWakeup/utils.d.ts +0 -44
  197. package/src/modules/sleepWakeup/utils.ts +0 -254
  198. package/src/newModules/biorhythm/circular/biorhythm_plantimer.png +0 -0
  199. package/src/newModules/biorhythm/circular/rhythm_icon.png +0 -0
  200. package/src/newModules/biorhythm/res/BiologicalRes.d.ts +0 -43
  201. package/src/newModules/biorhythm/res/BiologicalRes.ts +0 -42
  202. package/src/newModules/biorhythm/res/Biological_Rhythm.png +0 -0
  203. package/src/newModules/biorhythm/res/Biological_Rhythm_12.png +0 -0
  204. package/src/newModules/biorhythm/res/Biological_Rhythm_new.png +0 -0
  205. package/src/newModules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
  206. package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
  207. package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
  208. package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
  209. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
  210. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
  211. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
  212. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
  213. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
  214. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
  215. package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
  216. package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
  217. package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
  218. package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
  219. package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
  220. package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
  221. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
  222. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
  223. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
  224. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
  225. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
  226. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
  227. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
  228. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
  229. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
  230. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
  231. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
  232. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
  233. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
  234. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
  235. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
  236. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
  237. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
  238. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
  239. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
  240. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
  241. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
  242. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
  243. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
  244. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
  245. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
  246. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
  247. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
  248. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
  249. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
  250. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
  251. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
  252. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
  253. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
  254. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
  255. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
  256. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
  257. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
  258. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
  259. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
  260. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
  261. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
  262. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
  263. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
  264. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
  265. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
  266. package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
  267. package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
  268. package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
  269. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
  270. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
  271. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
  272. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
  273. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
  274. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
  275. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
  276. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
  277. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
  278. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
  279. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
  280. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
  281. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
  282. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
  283. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
@@ -1,796 +0,0 @@
1
- import React, { useCallback, useEffect, useMemo } from 'react'
2
- import { FlatList, Image, Linking, Platform, ScrollView, Switch, Text, TouchableOpacity, View } from 'react-native'
3
- import { useNavigation } from '@react-navigation/native'
4
- import TimeCircular from './circular/TimeCircular'
5
- import { useDebounceFn, useReactive, useUpdateEffect } from 'ahooks'
6
- import {
7
- BiorhythmBean,
8
- BiorhythmGradientType,
9
- colorTemperatureValue,
10
- getDefBiorhythmUIState,
11
- Plan,
12
- } from './BiorhythmBean'
13
- import { Dialog, Modal, Utils, Toast } from 'tuya-panel-kit'
14
- import _ from 'lodash'
15
- import dayjs from 'dayjs'
16
- import iconList from './iconListData'
17
- import pIdList from './pIdList'
18
- import {
19
- useDeviceId,
20
- useDeviceInfo,
21
- useTimeSchedule
22
- } from '@ledvance/base/src/models/modules/NativePropsSlice'
23
- import I18n from '@ledvance/base/src/i18n'
24
- import LDVTopBar from '@ledvance/base/src/components/ldvTopBar'
25
- import res from '@ledvance/base/src/res'
26
- import { ui_biz_routerKey } from '../../navigation/Routers'
27
- import BiologicalRes from './res/BiologicalRes'
28
- import { cctToColor } from '@ledvance/base/src/utils/cctUtils'
29
- import { NativeApi } from '@ledvance/base/src/api/native'
30
- import { setDataSource } from '@ledvance/base/src/components/weekSelect'
31
- import { useRoute } from '@react-navigation/core'
32
- import { BiorhythmEditPageParams } from './BiorhythmEditPage'
33
- import { useBiorhythm, userOperation } from './BiorhythmActions'
34
- import { useSleepPlan, useWakeUpPlan } from '../sleepWakeup/SleepWakeUpActions'
35
- import { showDialog as showCommonDialog } from '@ledvance/base/src/utils/common'
36
-
37
- const cx = Utils.RatioUtils.convertX
38
- const width = Utils.RatioUtils.width
39
-
40
- const weekSign = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
41
-
42
- interface UIState extends BiorhythmBean {
43
- showGradientTypeSelectModal: boolean;
44
- showMaskModal: boolean;
45
- flag: symbol;
46
- weekString: string,
47
- timeSchedule: any[]
48
- loading: boolean
49
- }
50
-
51
- export interface BiorhythmPageParams {
52
- biorhythmDp: string
53
- sleepPlanDp: string
54
- wakeUpPlanDp: string
55
- isSupportTemperature: boolean
56
- isSupportBrightness: boolean
57
- isMixRGBWLamp: boolean
58
- }
59
-
60
- const BiorhythmPage = () => {
61
- const navigation = useNavigation()
62
- const params = useRoute<any>().params as BiorhythmPageParams
63
- const [biorhythm, setBiorhythm] = useBiorhythm(params.biorhythmDp)
64
- const deviceId = useDeviceId()
65
- const deviceInfo = useDeviceInfo()
66
- const { productId } = deviceInfo
67
- const devicesJudge = pIdList.some(val => val === productId)
68
- const [, setTimeSchedule] = useTimeSchedule()
69
- const [sleepList, setSleepList] = useSleepPlan({ sleep_mode: params.sleepPlanDp })
70
- const [wakeUpList, setWakeUpList] = useWakeUpPlan({ wakeup_mode: params.wakeUpPlanDp })
71
- const sleepWakeUpStatus = [...sleepList, ...wakeUpList].some(ele => ele.enable)
72
- const state = useReactive<UIState>({
73
- ...biorhythm,
74
- showGradientTypeSelectModal: false,
75
- showMaskModal: false,
76
- flag: Symbol(),
77
- weekString: '',
78
- timeSchedule: [],
79
- loading: false
80
- })
81
-
82
- const checkWeekConflict = (weeksStr: string) => {
83
- const dayjsDate = dayjs()
84
- const todayWeek = dayjsDate.format('ddd')
85
- const weekIndex = weekSign.indexOf(todayWeek)
86
- const externalWeeks = weeksStr.split('').map(val => !!Number(val))
87
- const biorhythmWeeks = state.repeatPeriod.map(val => val?.enabled)
88
-
89
- for (let i = 0; i < biorhythmWeeks.length; i++) {
90
- if (biorhythmWeeks[i] && externalWeeks[i]) {
91
- return true
92
- }
93
- }
94
- return (externalWeeks.every(val => !val) && (biorhythmWeeks[weekIndex] || biorhythmWeeks.every(val => !val)));
95
- }
96
-
97
- const enableTimeScheduleStatus = state.timeSchedule?.some(val => !!val.mStatus && checkWeekConflict(val.mLoops))
98
- const showGradientTypeSelectModal = useCallback((show: boolean) => {
99
- state.showGradientTypeSelectModal = show
100
- }, [])
101
-
102
- const onPlanEdited = useCallback((isAdd: boolean, newPlan: Plan) => {
103
- if (isAdd) {
104
- state.planList.push(newPlan)
105
- state.planList = _.sortBy(state.planList, p => p.startTime)
106
- } else {
107
- state.planList = state.planList.map(plan => (plan.id === newPlan.id ? newPlan : plan))
108
- }
109
- state.flag = Symbol()
110
- }, [])
111
-
112
- const onPlanDelete = useCallback((id: number) => {
113
- state.planList = state.planList.filter(plan => plan.id !== id)
114
- state.flag = Symbol()
115
- }, [])
116
- const requestSetBiorhythm: () => void = useCallback(async () => {
117
- const planList = state.planList?.map(item => { return { ...item, icon: `${item.icon}` } })
118
- .sort((a, b) => {
119
- const timeA = a.startTime.split(":");
120
- const timeB = b.startTime.split(":");
121
- // 比较小时
122
- if (parseInt(timeA[0]) !== parseInt(timeB[0])) {
123
- return parseInt(timeA[0]) - parseInt(timeB[0]);
124
- }
125
- // 如果小时相等,比较分钟
126
- return parseInt(timeA[1]) - parseInt(timeB[1]);
127
- });
128
- console.log('设置生物节律数据', state)
129
- await userOperation(deviceId, false)
130
- const res = await setBiorhythm(deviceId, { ...state, planList })
131
- state.loading = false
132
- console.log('设置生物节律res', res)
133
- if (res.success) {
134
- console.log('设置生物节律 OK')
135
- }
136
- }, [])
137
-
138
- useUpdateEffect(() => {
139
- if (state.planList?.length === 0) {
140
- const data = getDefBiorhythmUIState()
141
- data.planList = data.planList?.map(item => {
142
- return { ...item, icon: `${item.icon}` }
143
- })
144
- setBiorhythm(deviceId, data).then()
145
- }
146
- }, [state.planList])
147
-
148
- const setTimer = value => {
149
- switch (value) {
150
- case 'Sunrise':
151
- return I18n.getLang('bio_ryhthm_default_field_text')
152
- case 'Wake Up':
153
- return I18n.getLang('bio_ryhthm_default_field_text2')
154
- case 'Sunlight':
155
- return I18n.getLang('bio_ryhthm_default_field_text3')
156
- case 'Comfortable':
157
- return I18n.getLang('bio_ryhthm_default_field_text4')
158
- case 'Night light':
159
- return I18n.getLang('bio_ryhthm_default_field_text5')
160
- default:
161
- return value
162
- }
163
- }
164
-
165
- const showDialog = useCallback(enable => {
166
- Dialog.confirm({
167
- title: I18n.getLang('conflict_dialog_save_item_bio_rhythm_titel'),
168
- subTitle: I18n.getLang('conflict_dialog_save_item_bio_rhythm_description'),
169
- cancelText: I18n.getLang('conflict_dialog_save_item_bio_rhythm_answer_no_text'),
170
- confirmText: I18n.getLang('conflict_dialog_save_item_bio_rhythm_answer_yes_text'),
171
- onConfirm: (_, { close }) => {
172
- const timeSchedule = state.timeSchedule
173
- const enableSleep = sleepList.some(item => item.enable)
174
- const enableWakeUp = wakeUpList.some(item => item.enable)
175
- const enableTimeSchedule = timeSchedule?.some(val => !!val?.mStatus)
176
- if (enableSleep) {
177
- sleepList.forEach(item => item.enable = 0)
178
- setSleepList(sleepList).then()
179
- }
180
- if (enableWakeUp) {
181
- wakeUpList.forEach(item => item.enable = 0)
182
- setWakeUpList(wakeUpList).then()
183
- }
184
- if (enableTimeSchedule) {
185
- timeSchedule?.forEach(item => {
186
- if (checkWeekConflict(item?.mLoops) && !!item?.mStatus) {
187
- const data = {
188
- time: item?.mTime,
189
- status: Platform.OS === 'ios' ? false : 0,
190
- loops: item?.mLoops,
191
- id: item?.mDpId,
192
- dps: item?.mValue && JSON.parse(item?.mValue),
193
- data: item?.mDate,
194
- timerId: item?.mTimerId,
195
- aliasName: item?.aliasName || item?.remark,
196
- value: item?.mValue,
197
- mStatus: Platform.OS === 'ios' ? false : 0,
198
- }
199
- NativeApi.editTimer(deviceId, data, () => {
200
- setTimeSchedule(false)
201
- })
202
- }
203
- })
204
- }
205
-
206
- state.enable = enable
207
- state.showMaskModal = !enable
208
- state.flag = Symbol()
209
- close()
210
- },
211
- motionConfig: {
212
- hideDuration: 0,
213
- showDuration: 100
214
- }
215
- })
216
- }, [sleepList, wakeUpList])
217
-
218
- const minimumEnable = (plan: Plan) => {
219
- const [h, m] = plan.startTime.split(':').map(str => parseInt(str, 10))
220
- const min = h * 60 + m
221
- const minutes = state.planList
222
- .filter(item => item.id !== plan.id && item.enable)
223
- .map(item => {
224
- const [hour, minute] = item.startTime.split(':').map(str => parseInt(str, 10))
225
- return hour * 60 + minute
226
- })
227
- let enable = false
228
- minutes.forEach(item => {
229
- const diff = Math.abs(min - item)
230
- if (diff < 15) enable = true
231
- })
232
- return enable
233
- }
234
-
235
- const showDeleteBtn = useMemo(() => {
236
- return state.planList?.length > 1
237
- }, [state.planList?.length])
238
-
239
- const { run } = useDebounceFn(requestSetBiorhythm, { wait: 500 })
240
-
241
- useUpdateEffect(() => {
242
- run()
243
- }, [state.flag])
244
-
245
- const replaceImg = (img) => {
246
- const item = iconList?.find(val => val.id === Number(img))
247
- switch (img) {
248
- case 'rhythm_icon1':
249
- case '31':
250
- return { icon: BiologicalRes.biorhythom_Icon1, iconId: 1 }
251
- case 'rhythm_icon2':
252
- case '33':
253
- return { icon: BiologicalRes.biorhythom_Icon5, iconId: 5 }
254
- case 'rhythm_icon3':
255
- case '35':
256
- return { icon: BiologicalRes.biorhythom_Icon2, iconId: 2 }
257
- case 'rhythm_icon4':
258
- case '32':
259
- return { icon: BiologicalRes.biorhythom_Icon9, iconId: 9 }
260
- case 'rhythm_icon12':
261
- case '39':
262
- return { icon: BiologicalRes.biorhythom_Icon3, iconId: 3 }
263
- default:
264
- return { icon: item?.icon, iconId: item?.id }
265
- }
266
- }
267
-
268
- useUpdateEffect(() => {
269
- console.log('Redux 生物节律数据更新', biorhythm)
270
- const planList = biorhythm.planList?.map(item => {
271
- return {
272
- ...item,
273
- icon: replaceImg(item?.iconId || item?.icon)?.icon,
274
- iconId: replaceImg(item?.iconId || item?.icon)?.iconId,
275
- }
276
- })
277
- state.enable = biorhythm.enable
278
- state.gradient = biorhythm.gradient
279
- state.repeatPeriod = biorhythm.repeatPeriod
280
- state.planList = planList
281
- state.showMaskModal = !biorhythm.enable
282
- const weeks: string[] = setDataSource(
283
- biorhythm.repeatPeriod.map(item => {
284
- return item?.enabled ? 1 : 0
285
- })).filter(item => item.enabled)
286
- .map(item => item.title)
287
-
288
- if (weeks.length > 0) {
289
- // / more than one
290
- if (weeks.length === 7) {
291
- // / seven
292
- state.weekString = I18n.getLang('motion_detection_time_schedule_notifications_field_weekdays_text4')
293
- } else {
294
- state.weekString = I18n.formatValue('timeschedule_add_schedule_text', weeks.join(', '))
295
- }
296
- } else {
297
- // / zero
298
- state.weekString = I18n.getLang('motion_detection_time_schedule_notifications_field_weekdays_text2')
299
- }
300
- }, [JSON.stringify(biorhythm)])
301
-
302
-
303
- const setImg = (id) => {
304
- const imgIcon = iconList?.find(val => val?.id === Number(id))?.icon
305
- return imgIcon || ''
306
- }
307
-
308
- const openLink = () => {
309
- const url = I18n.getLang('biorhythm_product_link') // 需要打开的链接
310
- Linking.openURL(url).catch((error) => console.error('无法打开链接:', error))
311
- }
312
-
313
- const sunHomeText = string => {
314
- const text = string.split('SUN@HOME')
315
- return text?.length === 1 && <Text style={{ fontSize: cx(14) }}>{text[0]}</Text> ||
316
- <Text style={{
317
- fontSize: cx(14),
318
- flexDirection: 'row',
319
- }}>
320
- <Text>{text[0]}</Text>
321
- <Text onPress={openLink}
322
- style={{
323
- fontFamily: 'helvetica_neue_lt_std_roman',
324
- color: '#ff6600',
325
- textDecorationLine: 'underline',
326
- flexWrap: 'wrap',
327
- }}>SUN@HOME</Text>
328
- <Text>{text[1]}</Text>
329
- </Text>
330
- }
331
-
332
- const randomIcon = () => {
333
- const iconIdList = state.planList?.map(item => {
334
- return item.iconId
335
- })
336
- const allIcon = iconList?.map(item => {
337
- return item.id
338
- })
339
- const availableChart = allIcon.filter((element) => !iconIdList.includes(element))
340
- const randomIndex = Math.floor(Math.random() * availableChart.length)
341
- return availableChart[randomIndex]
342
- }
343
-
344
- const reloadData = async () => {
345
- const res: any = await NativeApi.getAllTaskTimer(deviceId)
346
- console.log('reload data', res)
347
- if (res.success && res.data) {
348
- // 原生传过来的dps是json字符串。
349
- if (Array.isArray(res.data) && res.data.length) {
350
- state.timeSchedule = res.data
351
- }
352
- }
353
- }
354
-
355
- useEffect(() => {
356
- reloadData().then()
357
- }, [])
358
-
359
- return (
360
- <>
361
- <View style={{ flex: 1, flexDirection: 'column' }}>
362
- <LDVTopBar
363
- title={deviceInfo.name}
364
- onBackPress={() => {
365
- navigation.goBack()
366
- }}
367
- />
368
- <ScrollView nestedScrollEnabled={true} style={{ position: 'relative' }}>
369
- <View
370
- style={{
371
- height: cx(60),
372
- flexDirection: 'row',
373
- justifyContent: 'space-between',
374
- alignItems: 'center',
375
- marginHorizontal: cx(24),
376
- }}
377
- >
378
- <Text
379
- style={{
380
- color: '#FF6600',
381
- fontSize: cx(24),
382
- fontFamily: 'helvetica_neue_lt_std_roman',
383
- }}
384
- >
385
- {I18n.getLang('add_new_trigger_time_system_back_text')}
386
- </Text>
387
- <Switch
388
- value={state.enable}
389
- thumbColor={'#f60'}
390
- trackColor={{ false: '#00000026', true: '#ff660036' }}
391
- onValueChange={async enable => {
392
- if (enable && (sleepWakeUpStatus || enableTimeScheduleStatus)) return showDialog(enable)
393
- state.loading = true
394
- state.enable = enable
395
- state.flag = Symbol()
396
- }}
397
- />
398
- </View>
399
- <View style={{ marginHorizontal: cx(24) }}>
400
- {sunHomeText(I18n.getLang(devicesJudge ? 'bio_ryhthm_default_description_text' : 'bio_ryhthm_non_sun_home_products_description_text'))}
401
- </View>
402
- <View style={{ height: cx(10) }} />
403
- <View
404
- style={{
405
- flexDirection: 'row',
406
- justifyContent: 'space-between',
407
- marginHorizontal: cx(24),
408
- }}
409
- >
410
- {state.repeatPeriod.map(period => {
411
- return (
412
- <TouchableOpacity
413
- key={period.title}
414
- onPress={() => {
415
- const periodNum = state.repeatPeriod.filter(p => p.enabled)?.length
416
- if (periodNum === 1 && period.enabled) return
417
- period.enabled = !period.enabled
418
- state.flag = Symbol()
419
- }}
420
- >
421
- <View
422
- style={{
423
- width: cx(40),
424
- height: cx(40),
425
- justifyContent: 'center',
426
- alignItems: 'center',
427
- borderRadius: cx(20),
428
- backgroundColor: period.enabled ? '#ffe0d4' : '#fff',
429
- borderWidth: cx(1),
430
- borderColor: '#f60',
431
- }}
432
- >
433
- <Text
434
- style={{
435
- color: '#FF6600',
436
- textAlign: 'center',
437
- }}
438
- >
439
- {period.title}
440
- </Text>
441
- </View>
442
- </TouchableOpacity>
443
- )
444
- })}
445
- </View>
446
- <View style={{ marginHorizontal: cx(24), marginTop: cx(20) }}>
447
- <Text>{state.weekString}</Text>
448
- </View>
449
- <View style={{ marginHorizontal: cx(24), marginTop: cx(16) }}>
450
- <Text>
451
- {I18n.getLang('bio_ryhthm_default_selectionfield_topic_text')}
452
- </Text>
453
- <TouchableOpacity
454
- onPress={() => {
455
- showGradientTypeSelectModal(true)
456
- }}
457
- >
458
- <View
459
- style={{
460
- flexDirection: 'row',
461
- borderRadius: cx(4),
462
- backgroundColor: '#f6f6f6',
463
- alignItems: 'center',
464
- flex: 1,
465
- height: cx(44),
466
- borderBottomWidth: cx(1),
467
- borderBottomColor: '#cbcbcb',
468
- }}
469
- >
470
- <Text style={{
471
- fontSize: cx(16),
472
- color: '#000',
473
- fontFamily: 'helvetica_neue_lt_std_roman',
474
- paddingLeft: cx(16),
475
- }}>
476
- {
477
- I18n.getLang(
478
- state.gradient === BiorhythmGradientType.DirectGradient
479
- ? 'add_new_dynamic_mood_color_changing_mode_value2'
480
- : 'add_new_dynamic_mood_color_changing_mode_value',
481
- )
482
- }
483
-
484
- </Text>
485
- </View>
486
- </TouchableOpacity>
487
- </View>
488
- <View style={{ height: cx(20) }} />
489
- <TimeCircular
490
- planEdit={true}
491
- planList={state.planList}
492
- onPanMoved={(id, time) => {
493
- state.planList = state.planList.map(plan => {
494
- return {
495
- ...plan,
496
- startTime: plan.id === id ? time : plan.startTime,
497
- }
498
- })
499
- state.flag = Symbol()
500
- }}
501
- replaceStatus={devicesJudge}
502
- gradient={state.gradient === BiorhythmGradientType.DirectGradient}
503
- isSupportTemperature={!params.isSupportTemperature} />
504
- <View
505
- style={{
506
- flexDirection: 'row',
507
- justifyContent: 'space-between',
508
- marginHorizontal: cx(24),
509
- marginBottom: cx(-8),
510
- marginTop: cx(26),
511
- }}>
512
- {state.planList.length === 8 && <View
513
- style={{ marginVertical: cx(10), flexDirection: 'row', alignItems: 'center', width: width - cx(48) }}>
514
- <Image style={{ width: cx(16), height: cx(16), tintColor: '#ff9500' }} source={res.ic_warning_amber} />
515
- <Text
516
- style={{
517
- flexWrap: 'wrap',
518
- fontSize: cx(12),
519
- }}>{I18n.getLang('add_new_trigger_time_warning_max_number_text')}</Text>
520
- </View>}
521
- {state.planList.length < 8 &&
522
- <>
523
- <Text
524
- style={{
525
- fontSize: cx(16),
526
- fontWeight: 'bold',
527
- color: 'rgb(0,0,0)',
528
- }}>{I18n.getLang('bio_ryhthm_default_subheadline_text')}</Text>
529
- <TouchableOpacity
530
- onPress={() => {
531
- const ids: number[] = state.planList.map(p => p.id)
532
- const newPlan: Plan = {
533
- id: Math.max(...ids) + 1,
534
- icon: res.rhythm_icon1,
535
- startTime: '00:00',
536
- name: '',
537
- colorTemperature: 0,
538
- brightness: 100,
539
- action: [
540
- {
541
- uri: 'model/attribute/set/LightCtrl/ColorTemperature',
542
- startValue: `${colorTemperatureValue(0)}`,
543
- },
544
- {
545
- uri: 'model/attribute/set/LightCtrl/Brightness',
546
- startValue: '100',
547
- },
548
- ],
549
- enable: true,
550
- iconId: randomIcon(),
551
- }
552
- const editPageParams: BiorhythmEditPageParams = {
553
- planData: newPlan,
554
- isAdd: true,
555
- onPlanEdited,
556
- onPlanDelete,
557
- minimumEnable,
558
- iconIdList: state.planList?.map(item => {
559
- return item.iconId
560
- }),
561
- isMixRGBWLamp: params.isMixRGBWLamp,
562
- isSupportTemperature: params.isSupportTemperature,
563
- isSupportBrightness: params.isSupportBrightness,
564
- showDeleteBtn
565
- }
566
- navigation.navigate(ui_biz_routerKey.bi_biz_biological_edit, editPageParams)
567
- }}>
568
- <Image source={BiologicalRes.biorhythom_add} style={{ height: cx(24), width: cx(24) }} />
569
- </TouchableOpacity>
570
- </>
571
- }
572
- </View>
573
- <FlatList
574
- data={state.planList}
575
- style={{
576
- flex: 1,
577
- marginTop: cx(12),
578
- }}
579
- nestedScrollEnabled={true}
580
- renderItem={({ item }) => {
581
- const type = typeof item?.icon === 'string'
582
- const bgColor = item?.brightness === 0 ? '#000' : !params.isSupportTemperature && cctToColor(1) || cctToColor(item.colorTemperature.toFixed(), item?.brightness)
583
- return (
584
- <View
585
- style={{
586
- height: cx(118),
587
- backgroundColor: 'white',
588
- elevation: cx(7),
589
- shadowColor: '#000000',
590
- shadowOpacity: 0.2,
591
- shadowRadius: cx(7),
592
- shadowOffset: {
593
- width: 0,
594
- height: cx(4),
595
- },
596
- borderRadius: cx(10),
597
- marginHorizontal: cx(24),
598
- marginVertical: cx(8),
599
- }}
600
- >
601
- <TouchableOpacity
602
- style={{ flex: 1 }}
603
- onPress={() => {
604
- const editPageParams: BiorhythmEditPageParams = {
605
- planData: {
606
- ...item,
607
- name: setTimer(item?.name)
608
- },
609
- isAdd: false,
610
- onPlanEdited,
611
- onPlanDelete,
612
- minimumEnable,
613
- iconIdList: state.planList?.map(item => {
614
- return item.iconId
615
- }),
616
- isMixRGBWLamp: params.isMixRGBWLamp,
617
- isSupportTemperature: params.isSupportTemperature,
618
- isSupportBrightness: params.isSupportBrightness,
619
- showDeleteBtn
620
- }
621
- navigation.navigate(ui_biz_routerKey.bi_biz_biological_edit, editPageParams)
622
- }}
623
- >
624
- <View
625
- style={{
626
- flex: 1,
627
- flexDirection: 'column',
628
- }}
629
- >
630
- <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginTop: cx(16) }}>
631
- <View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
632
- <Image
633
- source={setImg(item?.iconId) || type && { uri: item?.icon } || item?.icon}
634
- style={{
635
- width: cx(24),
636
- height: cx(24),
637
- marginStart: cx(10),
638
- marginRight: cx(6),
639
- tintColor: '#474e5d',
640
- }}
641
- />
642
- <Text
643
- style={{
644
- fontSize: cx(16),
645
- color: '#000',
646
- fontFamily: 'helvetica_neue_lt_std_roman',
647
- }}
648
- >
649
- {item.startTime}
650
- </Text>
651
- </View>
652
- <Switch
653
- value={item.enable}
654
- thumbColor={'#f60'}
655
- trackColor={{ false: '#00000026', true: '#ff660036' }}
656
- onValueChange={e => {
657
- item.enable = e
658
- state.flag = Symbol()
659
- }}
660
- style={{ marginRight: cx(10) }}
661
- />
662
- </View>
663
- <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
664
- <Text
665
- style={{
666
- fontSize: cx(12),
667
- color: '#666',
668
- fontFamily: 'helvetica_neue_lt_std_roman',
669
- paddingLeft: cx(20),
670
- }}
671
- >
672
- {setTimer(item?.name)}
673
- </Text>
674
- </View>
675
- <View
676
- style={{
677
- width: cx(295),
678
- height: cx(24),
679
- backgroundColor: bgColor,
680
- marginLeft: cx(20),
681
- marginTop: cx(-5),
682
- marginBottom: cx(24),
683
- borderRadius: cx(8),
684
- }} />
685
- </View>
686
- </TouchableOpacity>
687
- </View>
688
- )
689
- }}
690
- keyExtractor={item => `${item.id}`}
691
- ListFooterComponent={() => {
692
- return (
693
- <View>
694
- <View
695
- style={{
696
- height: cx(50),
697
- backgroundColor: '#666',
698
- elevation: cx(7),
699
- shadowColor: '#000000',
700
- shadowOpacity: 0.2,
701
- shadowRadius: cx(7),
702
- shadowOffset: {
703
- width: 0,
704
- height: cx(4),
705
- },
706
- borderRadius: cx(10),
707
- marginHorizontal: cx(24),
708
- marginTop: cx(16),
709
- }}>
710
- <TouchableOpacity
711
- style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}
712
- onPress={() => {
713
- showCommonDialog({
714
- method: 'confirm',
715
- title: I18n.getLang('bio_ryhthm_reset_description_text'),
716
- onConfirm: (_, { close }) => {
717
- const defBiorhythmUIState = getDefBiorhythmUIState()
718
- state.enable = defBiorhythmUIState.enable
719
- state.gradient = defBiorhythmUIState.gradient
720
- state.repeatPeriod = defBiorhythmUIState.repeatPeriod
721
- state.planList = defBiorhythmUIState.planList
722
- state.flag = Symbol()
723
- close()
724
- }
725
- })
726
- }}>
727
- <Text
728
- style={{
729
- fontSize: cx(16),
730
- color: '#fff',
731
- fontFamily: 'helvetica_neue_lt_std_roman',
732
- }}>{I18n.getLang('bio_ryhthm_default_button_reset_text')}</Text>
733
- </TouchableOpacity>
734
- </View>
735
- <View style={{ height: cx(20) }} />
736
- </View>
737
- ) || <></>
738
- }}
739
- />
740
- {state.showMaskModal && (
741
- <View
742
- style={{
743
- backgroundColor: 'rgba(0,0,0,.5)',
744
- width: '100%',
745
- height: '100%',
746
- position: 'absolute',
747
- top: cx(45),
748
- zIndex: 999,
749
- }}
750
- />
751
- )}
752
- </ScrollView>
753
- </View>
754
- <Modal.List
755
- type={'radio'}
756
- visible={state.showGradientTypeSelectModal}
757
- value={state.gradient}
758
- dataSource={[
759
- {
760
- title: I18n.getLang('add_new_dynamic_mood_color_changing_mode_value'),
761
- key: BiorhythmGradientType.EntireGradient,
762
- value: BiorhythmGradientType.EntireGradient,
763
- },
764
- {
765
- title: I18n.getLang('add_new_dynamic_mood_color_changing_mode_value2'),
766
- key: BiorhythmGradientType.DirectGradient,
767
- value: BiorhythmGradientType.DirectGradient,
768
- },
769
- ]}
770
- title={I18n.getLang('add_new_dynamic_mood_color_changing_mode_headline')}
771
- onMaskPress={() => {
772
- showGradientTypeSelectModal(false)
773
- }}
774
- onCancel={() => {
775
- showGradientTypeSelectModal(false)
776
- }}
777
- cancelText={I18n.getLang('auto_scan_system_cancel')}
778
- confirmText={I18n.getLang('auto_scan_system_wifi_confirm')}
779
- onConfirm={(item: BiorhythmGradientType) => {
780
- state.gradient = item
781
- state.flag = Symbol()
782
- showGradientTypeSelectModal(false)
783
- }}
784
- />
785
- <Toast.Loading
786
- show={!!state.loading}
787
- onFinish={() => {
788
-
789
- }} />
790
- </>
791
- )
792
- }
793
-
794
- export default BiorhythmPage
795
-
796
-