@zeppos/zeus-cli 1.3.3 → 1.3.5

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 (173) hide show
  1. package/package.json +2 -2
  2. package/private-modules/zeppos-app-utils/dist/config/device.js +2 -443
  3. package/private-modules/zeppos-app-utils/dist/modules/create/local-app.js +1 -1
  4. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/app-widget/index.js +99 -0
  5. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/app.js +9 -15
  6. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/app.json +24 -0
  7. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/page/gts/food-list.js +4 -0
  8. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/page/gts/index.js +24 -24
  9. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/secondary-widget/index.js +139 -0
  10. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/utils/styles-gts-3.js +23 -24
  11. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/utils/styles.js +24 -24
  12. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/empty/jsconfig.json +2 -7
  13. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/fetch-api/pages/index.js +12 -12
  14. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/app.json +8 -0
  15. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/page/home/index.page.js +16 -16
  16. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/page/home/index.style.js +11 -11
  17. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/page/i18n/en-US.po +1 -1
  18. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/fetch-api/todo-list/secondary-widget/index.js +160 -0
  19. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/fetch-api/todo-list/utils/constants.js +1 -0
  20. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/app.json +2 -18
  21. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/page/gtr/home/index.page.js +5 -5
  22. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/page/gtr/home/index.style.js +7 -7
  23. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/page/gts/home/index.page.js +5 -5
  24. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/page/gts/home/index.style.js +6 -6
  25. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/app.json +23 -9
  26. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_0.png +0 -0
  27. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_1.png +0 -0
  28. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_10.png +0 -0
  29. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_11.png +0 -0
  30. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_12.png +0 -0
  31. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_13.png +0 -0
  32. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_14.png +0 -0
  33. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_15.png +0 -0
  34. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_16.png +0 -0
  35. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_17.png +0 -0
  36. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_18.png +0 -0
  37. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_19.png +0 -0
  38. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_2.png +0 -0
  39. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_20.png +0 -0
  40. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_21.png +0 -0
  41. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_22.png +0 -0
  42. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_23.png +0 -0
  43. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_24.png +0 -0
  44. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_25.png +0 -0
  45. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_26.png +0 -0
  46. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_27.png +0 -0
  47. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_28.png +0 -0
  48. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_29.png +0 -0
  49. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_3.png +0 -0
  50. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_30.png +0 -0
  51. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_31.png +0 -0
  52. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_32.png +0 -0
  53. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_33.png +0 -0
  54. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_34.png +0 -0
  55. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_35.png +0 -0
  56. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_36.png +0 -0
  57. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_4.png +0 -0
  58. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_5.png +0 -0
  59. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_6.png +0 -0
  60. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_7.png +0 -0
  61. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_8.png +0 -0
  62. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/anim/animation_9.png +0 -0
  63. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/button_normal.png +0 -0
  64. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/button_press.png +0 -0
  65. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/false copy.png +0 -0
  66. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/icon copy.png +0 -0
  67. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/0.png +0 -0
  68. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/1.png +0 -0
  69. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/2.png +0 -0
  70. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/3.png +0 -0
  71. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/4.png +0 -0
  72. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/5.png +0 -0
  73. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/6.png +0 -0
  74. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/7.png +0 -0
  75. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/8.png +0 -0
  76. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/number-img/9.png +0 -0
  77. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/radio_select.png +0 -0
  78. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/select.png +0 -0
  79. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/selected.png +0 -0
  80. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/switch_off.png +0 -0
  81. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/switch_on.png +0 -0
  82. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/unselect.png +0 -0
  83. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/unselected.png +0 -0
  84. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/gt4/zeppos.png +0 -0
  85. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/assets/raw/custom.ttf +0 -0
  86. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/config/tree.js +76 -2
  87. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/global.d.ts +1 -1
  88. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/jsconfig.json +1 -1
  89. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/index.js +7 -5
  90. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/interaction/on_digital_crown.js +26 -0
  91. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/interaction/on_key.js +32 -0
  92. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/interaction/on_wrist_motion.js +27 -0
  93. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/router/set_launch_app_timeout.js +32 -0
  94. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/sensor/pai.js +1 -1
  95. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/arc.js +28 -0
  96. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/button.js +44 -0
  97. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/checkbox_group.js +45 -0
  98. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/circle.js +28 -0
  99. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/cycle_image_text_list.js +43 -0
  100. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/cycle_list.js +26 -0
  101. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/dialog.js +32 -0
  102. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/fill_rect.js +29 -0
  103. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/histogram.js +76 -0
  104. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/img.js +23 -0
  105. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/img_anim.js +37 -0
  106. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/page_indicator.js +32 -0
  107. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/pick_date.js +43 -0
  108. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/polyline.js +36 -0
  109. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/qrcode.js +22 -0
  110. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/radio_group.js +44 -0
  111. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/scroll_list.js +106 -0
  112. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/slide_switch.js +28 -0
  113. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/stroke_rect.js +28 -0
  114. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/text.js +51 -0
  115. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/page/ui/widget/view_container.js +81 -0
  116. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/utils/UI/TextByLine.js +19 -12
  117. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/utils/UI/Title.js +2 -1
  118. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/utils/styles.js +2 -0
  119. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/showcase/utils/test.js +3 -2
  120. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/calories/assets/gt.r/icon.png +0 -0
  121. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/calories/assets/gt.s/icon.png +0 -0
  122. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/calories/global.d.ts +1 -1
  123. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/calories/jsconfig.json +1 -1
  124. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/download/assets/gt.r/icon.png +0 -0
  125. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/download/global.d.ts +1 -1
  126. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/download/jsconfig.json +1 -1
  127. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/empty/global.d.ts +1 -1
  128. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/empty/jsconfig.json +1 -1
  129. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/fetch-api/assets/common.r/icon.png +0 -0
  130. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/fetch-api/assets/common.s/icon.png +0 -0
  131. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/fetch-api/global.d.ts +1 -1
  132. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/fetch-api/jsconfig.json +1 -1
  133. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/hello-world/assets/gt.r/icon.png +0 -0
  134. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/hello-world/assets/gt.s/icon.png +0 -0
  135. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/hello-world/global.d.ts +1 -1
  136. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/hello-world/jsconfig.json +1 -1
  137. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/notification/assets/gt.r/icon.png +0 -0
  138. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/notification/global.d.ts +1 -1
  139. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/notification/jsconfig.json +1 -1
  140. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/todo-list/assets/gt.r/icon.png +0 -0
  141. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/todo-list/assets/gt.s/icon.png +0 -0
  142. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/todo-list/global.d.ts +1 -1
  143. package/private-modules/zeppos-app-utils/dist/public/template/os3.0/app/todo-list/jsconfig.json +1 -1
  144. package/private-modules/zeppos-app-utils/package.json +1 -1
  145. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/_package.json +0 -14
  146. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/jsconfig.json +0 -14
  147. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/calories/utils/storage.js +0 -40
  148. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/fetch-api/_package.json +0 -14
  149. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/fetch-api/jsconfig.json +0 -14
  150. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/_package.json +0 -14
  151. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/app-side/index.js +0 -11
  152. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/jsconfig.json +0 -14
  153. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/setting/i18n/en-US.po +0 -2
  154. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/hello-world/setting/index.js +0 -5
  155. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/todo-list/_package.json +0 -14
  156. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/todo-list/jsconfig.json +0 -14
  157. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/todo-list/utils/constants.js +0 -3
  158. package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/todo-list/utils/fs.js +0 -34
  159. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/.prettierrc.js +0 -0
  160. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/app-side/index.js +0 -0
  161. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/app.js +0 -0
  162. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/assets/gts/icon.png +0 -0
  163. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/page/home/index.page.json +0 -0
  164. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/setting/i18n/en-US.po +0 -0
  165. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/setting/index.js +0 -0
  166. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/shared/data.js +0 -0
  167. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/shared/defer.js +0 -0
  168. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/shared/device-polyfill.js +0 -0
  169. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/shared/es6-promise.js +0 -0
  170. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/shared/event.js +0 -0
  171. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/shared/message-side.js +0 -0
  172. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/shared/message.js +0 -0
  173. /package/private-modules/zeppos-app-utils/dist/public/template/os2.0/app/{todo-list → fetch-api/todo-list}/utils/index.js +0 -0
@@ -0,0 +1,44 @@
1
+ import { createWidget, widget, prop } from '@zos/ui'
2
+ import { px } from '@zos/utils'
3
+ import PageAdvanced from '../../../utils/template/PageAdvanced'
4
+
5
+ PageAdvanced({
6
+ state: {
7
+ pageName: 'RADIO_GROUP'
8
+ },
9
+ build() {
10
+ const radioGroup = createWidget(widget.RADIO_GROUP, {
11
+ x: px(0),
12
+ y: px(0),
13
+ w: px(480),
14
+ h: px(64),
15
+ select_src: 'selected.png',
16
+ unselect_src: 'unselected.png',
17
+ check_func: (group, index, checked) => {
18
+ this.state.logger.log('index', index)
19
+ this.state.logger.log('checked', checked)
20
+ }
21
+ })
22
+
23
+ const button1 = radioGroup.createWidget(widget.STATE_BUTTON, {
24
+ x: px(40),
25
+ y: px(200),
26
+ w: px(64),
27
+ h: px(64)
28
+ })
29
+ const button2 = radioGroup.createWidget(widget.STATE_BUTTON, {
30
+ x: px(190),
31
+ y: px(200),
32
+ w: px(64),
33
+ h: px(64)
34
+ })
35
+ const button3 = radioGroup.createWidget(widget.STATE_BUTTON, {
36
+ x: px(340),
37
+ y: px(200),
38
+ w: px(64),
39
+ h: px(64)
40
+ })
41
+
42
+ radioGroup.setProperty(prop.INIT, button3)
43
+ }
44
+ })
@@ -0,0 +1,106 @@
1
+ import { createWidget, widget, prop } from '@zos/ui'
2
+ import { px } from '@zos/utils'
3
+ import PageAdvanced from '../../../utils/template/PageAdvanced'
4
+
5
+ PageAdvanced({
6
+ state: {
7
+ pageName: 'SCROLL_LIST'
8
+ },
9
+ build() {
10
+ const dataList = [
11
+ { name: 'Amazfit T-Rex 2', size: 454, img_src: 'true.png' },
12
+ { name: 'Amazfit GTR 3 Pro', size: 480, img_src: 'true.png' },
13
+ { name: 'Amazfit GTR 3', size: 454, img_src: 'true.png' }
14
+ ]
15
+
16
+ const updateDataList = [
17
+ ...dataList,
18
+ { name: 'Amazfit GTS 3', size: 390 },
19
+ ]
20
+
21
+ const scroll_list = createWidget(widget.SCROLL_LIST, {
22
+ x: 0,
23
+ y: px(120),
24
+ h: px(300),
25
+ w: px(480),
26
+ snap_to_center: true,
27
+ item_enable_horizon_drag: true,
28
+ item_drag_max_distance: -px(200),
29
+ item_space: px(20),
30
+ item_config: [
31
+ {
32
+ type_id: 1,
33
+ item_bg_color: 0xef5350,
34
+ item_bg_radius: px(10),
35
+ text_view: [
36
+ { x: 0, y: 0, w: px(480), h: px(80), key: 'name', color: 0xffffff, text_size: px(20), action: true },
37
+ { x: 0, y: px(80), w: px(480), h: px(40), key: 'size', color: 0xffffff }
38
+ ],
39
+ text_view_count: 2,
40
+ image_view: [
41
+ { x: px(520), y: px(0), w: px(80), h: px(63), key: 'img_src', action: true },
42
+ ],
43
+ image_view_count: 1,
44
+ item_height: px(120)
45
+ },
46
+ {
47
+ type_id: 2,
48
+ item_bg_color: 0xef5350,
49
+ item_bg_radius: px(10),
50
+ text_view: [
51
+ { x: 0, y: 0, w: px(480), h: px(80), key: 'name', color: 0x000000, text_size: px(20) },
52
+ { x: 0, y: px(80), w: px(480), h: px(40), key: 'size', color: 0x000000 }
53
+ ],
54
+ text_view_count: 2,
55
+ image_view: [
56
+ { x: px(520), y: px(0), w: px(80), h: px(63), key: 'img_src', action: true },
57
+ ],
58
+ image_view_count: 1,
59
+ item_height: px(120)
60
+ }
61
+ ],
62
+ item_config_count: 2,
63
+ data_array: dataList,
64
+ data_count: dataList.length,
65
+ item_click_func: (list, index, data_key) => {
66
+ this.state.logger.log('list', list)
67
+ this.state.logger.log(`scrollListItemClick index=${index}`)
68
+ this.state.logger.log(`scrollListItemClick data_key=${data_key}`)
69
+ updateConfig()
70
+ },
71
+ item_focus_change_func: (list, index, focus) => {
72
+ this.state.logger.log('index', index)
73
+ this.state.logger.log(`itemFocusChange focus=${focus}`)
74
+ },
75
+ data_type_config: [
76
+ {
77
+ start: 0,
78
+ end: 1,
79
+ type_id: 1
80
+ },
81
+ {
82
+ start: 1,
83
+ end: 2,
84
+ type_id: 2
85
+ }
86
+ ],
87
+ data_type_config_count: 2
88
+ })
89
+
90
+ function updateConfig() {
91
+ scroll_list.setProperty(prop.UPDATE_DATA, {
92
+ data_type_config: [
93
+ {
94
+ start: 0,
95
+ end: updateDataList.length - 1,
96
+ type_id: 1
97
+ },
98
+ ],
99
+ data_type_config_count: 1,
100
+ data_array: updateDataList,
101
+ data_count: updateDataList.length,
102
+ on_page: 1
103
+ })
104
+ }
105
+ }
106
+ })
@@ -0,0 +1,28 @@
1
+ import { createWidget, widget, prop } from '@zos/ui'
2
+ import { px } from '@zos/utils'
3
+ import PageAdvanced from '../../../utils/template/PageAdvanced'
4
+
5
+ PageAdvanced({
6
+ state: {
7
+ pageName: 'SLIDE_SWITCH'
8
+ },
9
+ build() {
10
+ const slide_switch = createWidget(widget.SLIDE_SWITCH, {
11
+ x: px(200),
12
+ y: px(200),
13
+ w: px(96),
14
+ h: px(64),
15
+ select_bg: 'switch_on.png',
16
+ un_select_bg: 'switch_off.png',
17
+ slide_src: 'radio_select.png',
18
+ slide_select_x: px(40),
19
+ slide_un_select_x: px(8),
20
+ checked: true,
21
+ checked_change_func: (slideSwitch, checked) => {
22
+ this.state.logger.log('checked', checked)
23
+ }
24
+ })
25
+
26
+ this.state.logger.log('slide checked', slide_switch.getProperty(prop.CHECKED))
27
+ }
28
+ })
@@ -0,0 +1,28 @@
1
+ import { createWidget, widget, event, prop } from '@zos/ui'
2
+ import { px } from '@zos/utils'
3
+ import { DEFAULT_COLOR } from '../../../config/constants'
4
+ import PageAdvanced from '../../../utils/template/PageAdvanced'
5
+
6
+ PageAdvanced({
7
+ state: {
8
+ pageName: 'STROKE_RECT'
9
+ },
10
+ build() {
11
+ const strokeRect = createWidget(widget.STROKE_RECT, {
12
+ x: px(125),
13
+ y: px(125),
14
+ w: px(230),
15
+ h: px(150),
16
+ radius: px(20),
17
+ line_width: px(4),
18
+ color: DEFAULT_COLOR
19
+ })
20
+
21
+ strokeRect.addEventListener(event.CLICK_DOWN, (info) => {
22
+ this.state.logger.log('click down info', info)
23
+ strokeRect.setProperty(prop.MORE, {
24
+ y: px(200)
25
+ })
26
+ })
27
+ }
28
+ })
@@ -0,0 +1,51 @@
1
+ import { createWidget, widget, event, align, text_style, prop } from '@zos/ui'
2
+ import { px } from '@zos/utils'
3
+ import PageAdvanced from '../../../utils/template/PageAdvanced'
4
+
5
+ PageAdvanced({
6
+ state: {
7
+ pageName: 'TEXT'
8
+ },
9
+ build() {
10
+ try {
11
+ const text = createWidget(widget.TEXT, {
12
+ x: px(96),
13
+ y: px(120),
14
+ w: px(288),
15
+ h: px(46),
16
+ color: 0xffffff,
17
+ text_size: px(36),
18
+ align_h: align.CENTER_H,
19
+ align_v: align.CENTER_V,
20
+ text_style: text_style.NONE,
21
+ text: 'HELLO ZEPPOS'
22
+ })
23
+
24
+ text.addEventListener(event.CLICK_DOWN, (info) => {
25
+ text.setProperty(prop.MORE, {
26
+ y: px(200)
27
+ })
28
+ })
29
+
30
+ const textI18n = createWidget(widget.TEXT, {
31
+ x: px(96),
32
+ y: px(300),
33
+ w: px(288),
34
+ h: px(46),
35
+ color: 0xffffff,
36
+ text_size: px(36),
37
+ align_h: align.CENTER_H,
38
+ align_v: align.CENTER_V,
39
+ text_style: text_style.NONE,
40
+ text_i18n: {
41
+ 'zh-CN': '你好 Zepp OS',
42
+ 'en-US': 'HELLO ZEPPOS'
43
+ },
44
+ font: 'raw/custom.ttf'
45
+ })
46
+ } catch (e) {
47
+ console.log('Build LifeCycle Error', e)
48
+ e && e.stack && e.stack.split(/\n/).forEach((i) => console.log('error stack', i))
49
+ }
50
+ }
51
+ })
@@ -0,0 +1,81 @@
1
+ import { createWidget, widget, align, text_style } from '@zos/ui'
2
+ import { px } from '@zos/utils'
3
+ import { getRandomColor } from '../../../utils/utils'
4
+ import { DEFAULT_COLOR, DEFAULT_COLOR_TRANSPARENT } from '../../../config/constants'
5
+
6
+ Page({
7
+ build() {
8
+ createWidget(widget.TEXT, {
9
+ x: px(96),
10
+ y: px(40),
11
+ w: px(288),
12
+ h: px(46),
13
+ color: 0xffffff,
14
+ text_size: px(36),
15
+ align_h: align.CENTER_H,
16
+ align_v: align.CENTER_V,
17
+ text_style: text_style.NONE,
18
+ text: 'VIEW_CONTAINER'
19
+ })
20
+
21
+ const viewContainer = createWidget(widget.VIEW_CONTAINER, {
22
+ x: px(0),
23
+ y: px(86),
24
+ w: px(480),
25
+ h: px(400),
26
+ scroll_frame_func(info) {
27
+ console.log('scroll frame')
28
+ console.log(JSON.stringify(info))
29
+ },
30
+ scroll_complete_func(info) {
31
+ console.log('scroll complete')
32
+ console.log(JSON.stringify(info))
33
+ }
34
+ })
35
+
36
+ Array.from({ length: 5 }).forEach((_, index) => {
37
+ viewContainer.createWidget(widget.FILL_RECT, {
38
+ x: 0,
39
+ y: px(index * 400),
40
+ w: px(480),
41
+ h: px(400),
42
+ color: getRandomColor()
43
+ })
44
+
45
+ viewContainer.createWidget(widget.TEXT, {
46
+ x: px(96),
47
+ y: px(170) + px(index * 400),
48
+ w: px(288),
49
+ h: px(46),
50
+ text_size: px(36),
51
+ color: 0xffffff,
52
+ align_h: align.CENTER_H,
53
+ align_v: align.CENTER_V,
54
+ text: `INDEX: ${index}`
55
+ })
56
+ })
57
+
58
+ const viewContainerButton = createWidget(widget.VIEW_CONTAINER, {
59
+ x: px(0),
60
+ y: px(86),
61
+ w: px(480),
62
+ h: px(400),
63
+ z_index: 1,
64
+ scroll_enable: false
65
+ })
66
+
67
+ viewContainerButton.createWidget(widget.BUTTON, {
68
+ x: 0,
69
+ y: px(50),
70
+ w: px(200),
71
+ h: px(100),
72
+ text: 'Click',
73
+ radius: px(12),
74
+ normal_color: DEFAULT_COLOR,
75
+ press_color: DEFAULT_COLOR_TRANSPARENT,
76
+ click_func: () => {
77
+ console.log('123')
78
+ }
79
+ })
80
+ }
81
+ })
@@ -2,22 +2,29 @@ import { createWidget, widget, align, text_style } from "@zos/ui";
2
2
  import { px } from "@zos/utils";
3
3
 
4
4
  export default class TextByLine {
5
- constructor(params) {
6
- const { text = "", y = undefined, line = 0 } = params;
5
+ constructor(params = {}) {
6
+ const { text = '', line = 0 } = params
7
7
 
8
- this.text = text;
9
- this.y = y;
10
- this.line = line;
11
- this.y_computed = Number.isInteger(this.y)
12
- ? this.y
13
- : px(this.line * 60 + 120);
8
+ this.text = text
9
+ this.line = line
14
10
  }
15
11
 
16
- render() {
12
+ render(params = {}) {
13
+ let { text = this.text, line = 0 } = params
14
+
15
+ if (!line) {
16
+ line = this.line
17
+ }
18
+
19
+ const y = px(line * 60 + 120)
20
+ this.y = y
21
+
22
+ this.line = line + 1
23
+
17
24
  return createWidget(widget.TEXT, {
18
- x: px(40),
19
- y: this.y_computed,
20
- w: px(400),
25
+ x: px(0),
26
+ y,
27
+ w: px(480),
21
28
  h: px(46),
22
29
  color: 0xffffff,
23
30
  text_size: px(20),
@@ -1,4 +1,5 @@
1
- import { createWidget, widget, text_style, align } from "@zos/ui";
1
+ import { createWidget, widget, text_style, align } from '@zos/ui'
2
+ import { px } from '@zos/utils'
2
3
 
3
4
  export default class Title {
4
5
  constructor(params) {
@@ -1,3 +1,5 @@
1
+ import { px } from '@zos/utils'
2
+
1
3
  export const MENU_SCROLL_LIST = {
2
4
  item_height: 80,
3
5
  item_space: 24,
@@ -1,5 +1,6 @@
1
- import logger from "./log";
2
- import { createWidget, widget } from "@zos/ui";
1
+ import logger from './log'
2
+ import { px } from '@zos/utils'
3
+ import { createWidget, widget } from '@zos/ui'
3
4
 
4
5
  export default class Test {
5
6
  constructor() {
@@ -1 +1 @@
1
- /// <reference path="node_modules/@zeppos/device-types/index.d.ts" />
1
+ /// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
@@ -5,5 +5,5 @@
5
5
  "checkJs": true
6
6
  },
7
7
  "exclude": ["node_modules", "**/node_modules/*"],
8
- "files": ["node_modules/@zeppos/device-types/index.d.ts"]
8
+ "files": ["node_modules/@zeppos/device-types/dist/index.d.ts"]
9
9
  }
@@ -1 +1 @@
1
- /// <reference path="node_modules/@zeppos/device-types/index.d.ts" />
1
+ /// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
@@ -5,5 +5,5 @@
5
5
  "checkJs": true
6
6
  },
7
7
  "exclude": ["node_modules", "**/node_modules/*"],
8
- "files": ["node_modules/@zeppos/device-types/index.d.ts"]
8
+ "files": ["node_modules/@zeppos/device-types/dist/index.d.ts"]
9
9
  }
@@ -1 +1 @@
1
- /// <reference path="node_modules/@zeppos/device-types/index.d.ts" />
1
+ /// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
@@ -5,5 +5,5 @@
5
5
  "checkJs": true
6
6
  },
7
7
  "exclude": ["node_modules", "**/node_modules/*"],
8
- "files": ["node_modules/@zeppos/device-types/index.d.ts"]
8
+ "files": ["node_modules/@zeppos/device-types/dist/index.d.ts"]
9
9
  }
@@ -1 +1 @@
1
- /// <reference path="node_modules/@zeppos/device-types/index.d.ts" />
1
+ /// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
@@ -5,5 +5,5 @@
5
5
  "checkJs": true
6
6
  },
7
7
  "exclude": ["node_modules", "**/node_modules/*"],
8
- "files": ["node_modules/@zeppos/device-types/index.d.ts"]
8
+ "files": ["node_modules/@zeppos/device-types/dist/index.d.ts"]
9
9
  }
@@ -1 +1 @@
1
- /// <reference path="node_modules/@zeppos/device-types/index.d.ts" />
1
+ /// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
@@ -5,5 +5,5 @@
5
5
  "checkJs": true
6
6
  },
7
7
  "exclude": ["node_modules", "**/node_modules/*"],
8
- "files": ["node_modules/@zeppos/device-types/index.d.ts"]
8
+ "files": ["node_modules/@zeppos/device-types/dist/index.d.ts"]
9
9
  }
@@ -1 +1 @@
1
- /// <reference path="node_modules/@zeppos/device-types/index.d.ts" />
1
+ /// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
@@ -5,5 +5,5 @@
5
5
  "checkJs": true
6
6
  },
7
7
  "exclude": ["node_modules", "**/node_modules/*"],
8
- "files": ["node_modules/@zeppos/device-types/index.d.ts"]
8
+ "files": ["node_modules/@zeppos/device-types/dist/index.d.ts"]
9
9
  }
@@ -1 +1 @@
1
- /// <reference path="node_modules/@zeppos/device-types/index.d.ts" />
1
+ /// <reference path="node_modules/@zeppos/device-types/dist/index.d.ts" />
@@ -5,5 +5,5 @@
5
5
  "checkJs": true
6
6
  },
7
7
  "exclude": ["node_modules", "**/node_modules/*"],
8
- "files": ["node_modules/@zeppos/device-types/index.d.ts"]
8
+ "files": ["node_modules/@zeppos/device-types/dist/index.d.ts"]
9
9
  }
@@ -13,7 +13,7 @@
13
13
  "dev": "nodemon -e ts,tsx --exec \"rm -rf dist && tsc && ts-node build.ts\" --ignore types/ --ignore dist/"
14
14
  },
15
15
  "dependencies": {
16
- "@zeppos/zpm": "^3.0.0",
16
+ "@zeppos/zpm": "^3.0.1",
17
17
  "axios": "^0.27.2",
18
18
  "chalk": "^4.1.2",
19
19
  "chokidar": "^3.5.3",
@@ -1,14 +0,0 @@
1
- {
2
- "name": "calories",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "app.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "",
10
- "license": "ISC",
11
- "devDependencies": {
12
- "@zeppos/device-types": "^2.0.0"
13
- }
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es6",
5
- "checkJs": true
6
- },
7
- "exclude": [
8
- "node_modules",
9
- "**/node_modules/*"
10
- ],
11
- "files": [
12
- "node_modules/@zeppos/device-types/index.d.ts"
13
- ]
14
- }
@@ -1,40 +0,0 @@
1
- import { statSync, writeFileSync, readFileSync } from "@zos/fs";
2
-
3
- export default class LocalStorage {
4
- constructor(fileName = "") {
5
- this.fileName = fileName;
6
- this.contentObj = {};
7
- }
8
-
9
- set(obj) {
10
- writeFileSync({
11
- path: this.fileName,
12
- data: JSON.stringify(obj),
13
- options: {
14
- encoding: "utf8",
15
- },
16
- });
17
- }
18
-
19
- get() {
20
- const fStat = statSync({
21
- path: this.fileName,
22
- });
23
- if (fStat) {
24
- try {
25
- this.contentObj = JSON.parse(
26
- readFileSync({
27
- path: this.fileName,
28
- options: {
29
- encoding: "utf8",
30
- },
31
- })
32
- );
33
- } catch (error) {
34
- this.contentObj = {};
35
- }
36
- }
37
-
38
- return this.contentObj;
39
- }
40
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "fetch-api",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "app.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "",
10
- "license": "ISC",
11
- "devDependencies": {
12
- "@zeppos/device-types": "^2.0.0"
13
- }
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es6",
5
- "checkJs": true
6
- },
7
- "exclude": [
8
- "node_modules",
9
- "**/node_modules/*"
10
- ],
11
- "files": [
12
- "node_modules/@zeppos/device-types/index.d.ts"
13
- ]
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "hello-word",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "app.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "",
10
- "license": "ISC",
11
- "devDependencies": {
12
- "@zeppos/device-types": "^2.0.0"
13
- }
14
- }