@tuya-miniapp/smart-ui 1.3.0-beta-2 → 1.3.1-beta-2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. package/dist/action-sheet/index.js +3 -7
  2. package/dist/battery/index.js +3 -5
  3. package/dist/bottom-sheet/index.css +1 -0
  4. package/dist/bottom-sheet/index.d.ts +1 -0
  5. package/dist/bottom-sheet/index.js +70 -0
  6. package/dist/bottom-sheet/index.json +8 -0
  7. package/dist/bottom-sheet/index.wxml +26 -0
  8. package/dist/bottom-sheet/index.wxss +1 -0
  9. package/dist/button/index.js +1 -0
  10. package/dist/button/index.wxml +1 -1
  11. package/dist/calendar/calendar.wxml +53 -53
  12. package/dist/calendar/components/header/index.css +1 -1
  13. package/dist/calendar/components/header/index.js +18 -0
  14. package/dist/calendar/components/header/index.json +4 -1
  15. package/dist/calendar/components/header/index.wxml +15 -4
  16. package/dist/calendar/components/header/index.wxss +1 -1
  17. package/dist/calendar/components/month/index.css +1 -1
  18. package/dist/calendar/components/month/index.d.ts +0 -1
  19. package/dist/calendar/components/month/index.js +4 -7
  20. package/dist/calendar/components/month/index.wxml +0 -13
  21. package/dist/calendar/components/month/index.wxs +13 -7
  22. package/dist/calendar/components/month/index.wxss +1 -1
  23. package/dist/calendar/components/month-list/index.css +1 -0
  24. package/dist/calendar/components/month-list/index.d.ts +1 -0
  25. package/dist/calendar/components/month-list/index.js +112 -0
  26. package/dist/calendar/components/month-list/index.json +7 -0
  27. package/dist/calendar/components/month-list/index.wxml +9 -0
  28. package/dist/calendar/components/month-list/index.wxss +1 -0
  29. package/dist/calendar/components/year-list/index.css +1 -0
  30. package/dist/calendar/components/year-list/index.d.ts +1 -0
  31. package/dist/calendar/components/year-list/index.js +100 -0
  32. package/dist/calendar/components/year-list/index.json +7 -0
  33. package/dist/calendar/components/year-list/index.wxml +9 -0
  34. package/dist/calendar/components/year-list/index.wxss +1 -0
  35. package/dist/calendar/index.css +1 -1
  36. package/dist/calendar/index.js +100 -51
  37. package/dist/calendar/index.json +3 -1
  38. package/dist/calendar/index.wxml +1 -1
  39. package/dist/calendar/index.wxs +21 -3
  40. package/dist/calendar/index.wxss +1 -1
  41. package/dist/calendar/utils.d.ts +7 -2
  42. package/dist/calendar/utils.js +44 -8
  43. package/dist/checkbox/index.css +1 -1
  44. package/dist/checkbox/index.js +1 -1
  45. package/dist/checkbox/index.wxml +2 -2
  46. package/dist/checkbox/index.wxss +1 -1
  47. package/dist/config-provider/index.wxs +2 -7
  48. package/dist/dropdown-item/index.css +1 -1
  49. package/dist/dropdown-item/index.js +10 -0
  50. package/dist/dropdown-item/index.wxml +9 -4
  51. package/dist/dropdown-item/index.wxss +1 -1
  52. package/dist/dropdown-menu/index.css +1 -1
  53. package/dist/dropdown-menu/index.js +15 -0
  54. package/dist/dropdown-menu/index.json +4 -1
  55. package/dist/dropdown-menu/index.wxml +2 -1
  56. package/dist/dropdown-menu/index.wxss +1 -1
  57. package/dist/empty/index.css +1 -1
  58. package/dist/empty/index.js +20 -1
  59. package/dist/empty/index.wxml +7 -7
  60. package/dist/empty/index.wxs +3 -16
  61. package/dist/empty/index.wxss +1 -1
  62. package/dist/field/index.css +1 -1
  63. package/dist/field/index.wxss +1 -1
  64. package/dist/loading/index.css +1 -1
  65. package/dist/loading/index.js +4 -4
  66. package/dist/loading/index.wxml +4 -6
  67. package/dist/loading/index.wxs +39 -8
  68. package/dist/loading/index.wxss +1 -1
  69. package/dist/nav-bar/index.css +1 -1
  70. package/dist/nav-bar/index.js +19 -1
  71. package/dist/nav-bar/index.wxml +16 -6
  72. package/dist/nav-bar/index.wxss +1 -1
  73. package/dist/normal-slider/index.css +1 -1
  74. package/dist/normal-slider/index.wxss +1 -1
  75. package/dist/notice-bar/index.css +1 -1
  76. package/dist/notice-bar/index.js +55 -2
  77. package/dist/notice-bar/index.wxml +28 -10
  78. package/dist/notice-bar/index.wxs +1 -5
  79. package/dist/notice-bar/index.wxss +1 -1
  80. package/dist/picker-column/index.js +8 -1
  81. package/dist/radio/index.css +1 -1
  82. package/dist/radio/index.js +1 -1
  83. package/dist/radio/index.wxml +2 -1
  84. package/dist/radio/index.wxss +1 -1
  85. package/dist/search/index.css +1 -1
  86. package/dist/search/index.js +14 -9
  87. package/dist/search/index.json +2 -1
  88. package/dist/search/index.wxml +7 -4
  89. package/dist/search/index.wxss +1 -1
  90. package/dist/switch/index.css +1 -1
  91. package/dist/switch/index.wxml +1 -0
  92. package/dist/switch/index.wxss +1 -1
  93. package/dist/tabs/index.css +1 -1
  94. package/dist/tabs/index.js +10 -7
  95. package/dist/tabs/index.wxml +1 -0
  96. package/dist/tabs/index.wxs +17 -0
  97. package/dist/tabs/index.wxss +1 -1
  98. package/dist/tag/index.css +1 -1
  99. package/dist/tag/index.wxss +1 -1
  100. package/dist/toast/icons.d.ts +3 -0
  101. package/dist/toast/icons.js +6 -0
  102. package/dist/toast/index.js +8 -4
  103. package/dist/toast/index.wxml +3 -7
  104. package/dist/toast/toast.d.ts +2 -0
  105. package/dist/toast/toast.js +2 -0
  106. package/dist/wxs/style.wxs +11 -5
  107. package/dist/wxs/utils.wxs +1 -3
  108. package/lib/action-sheet/index.js +3 -7
  109. package/lib/battery/index.js +3 -5
  110. package/lib/bottom-sheet/index.css +1 -0
  111. package/lib/bottom-sheet/index.d.ts +1 -0
  112. package/lib/bottom-sheet/index.js +75 -0
  113. package/lib/bottom-sheet/index.json +8 -0
  114. package/lib/bottom-sheet/index.wxml +26 -0
  115. package/lib/bottom-sheet/index.wxss +1 -0
  116. package/lib/button/index.js +1 -0
  117. package/lib/button/index.wxml +1 -1
  118. package/lib/calendar/calendar.wxml +53 -53
  119. package/lib/calendar/components/header/index.css +1 -1
  120. package/lib/calendar/components/header/index.js +21 -0
  121. package/lib/calendar/components/header/index.json +4 -1
  122. package/lib/calendar/components/header/index.wxml +15 -4
  123. package/lib/calendar/components/header/index.wxss +1 -1
  124. package/lib/calendar/components/month/index.css +1 -1
  125. package/lib/calendar/components/month/index.d.ts +0 -1
  126. package/lib/calendar/components/month/index.js +3 -6
  127. package/lib/calendar/components/month/index.wxml +0 -13
  128. package/lib/calendar/components/month/index.wxs +13 -7
  129. package/lib/calendar/components/month/index.wxss +1 -1
  130. package/lib/calendar/components/month-list/index.css +1 -0
  131. package/lib/calendar/components/month-list/index.d.ts +1 -0
  132. package/lib/calendar/components/month-list/index.js +114 -0
  133. package/lib/calendar/components/month-list/index.json +7 -0
  134. package/lib/calendar/components/month-list/index.wxml +9 -0
  135. package/lib/calendar/components/month-list/index.wxss +1 -0
  136. package/lib/calendar/components/year-list/index.css +1 -0
  137. package/lib/calendar/components/year-list/index.d.ts +1 -0
  138. package/lib/calendar/components/year-list/index.js +102 -0
  139. package/lib/calendar/components/year-list/index.json +7 -0
  140. package/lib/calendar/components/year-list/index.wxml +9 -0
  141. package/lib/calendar/components/year-list/index.wxss +1 -0
  142. package/lib/calendar/index.css +1 -1
  143. package/lib/calendar/index.js +99 -52
  144. package/lib/calendar/index.json +3 -1
  145. package/lib/calendar/index.wxml +1 -1
  146. package/lib/calendar/index.wxs +21 -3
  147. package/lib/calendar/index.wxss +1 -1
  148. package/lib/calendar/utils.d.ts +7 -2
  149. package/lib/calendar/utils.js +48 -10
  150. package/lib/checkbox/index.css +1 -1
  151. package/lib/checkbox/index.js +1 -1
  152. package/lib/checkbox/index.wxml +2 -2
  153. package/lib/checkbox/index.wxss +1 -1
  154. package/lib/config-provider/index.wxs +2 -7
  155. package/lib/dropdown-item/index.css +1 -1
  156. package/lib/dropdown-item/index.js +13 -0
  157. package/lib/dropdown-item/index.wxml +9 -4
  158. package/lib/dropdown-item/index.wxss +1 -1
  159. package/lib/dropdown-menu/index.css +1 -1
  160. package/lib/dropdown-menu/index.js +18 -0
  161. package/lib/dropdown-menu/index.json +4 -1
  162. package/lib/dropdown-menu/index.wxml +2 -1
  163. package/lib/dropdown-menu/index.wxss +1 -1
  164. package/lib/empty/index.css +1 -1
  165. package/lib/empty/index.js +20 -1
  166. package/lib/empty/index.wxml +7 -7
  167. package/lib/empty/index.wxs +3 -16
  168. package/lib/empty/index.wxss +1 -1
  169. package/lib/field/index.css +1 -1
  170. package/lib/field/index.wxss +1 -1
  171. package/lib/loading/index.css +1 -1
  172. package/lib/loading/index.js +4 -4
  173. package/lib/loading/index.wxml +4 -6
  174. package/lib/loading/index.wxs +39 -8
  175. package/lib/loading/index.wxss +1 -1
  176. package/lib/nav-bar/index.css +1 -1
  177. package/lib/nav-bar/index.js +19 -1
  178. package/lib/nav-bar/index.wxml +16 -6
  179. package/lib/nav-bar/index.wxss +1 -1
  180. package/lib/normal-slider/index.css +1 -1
  181. package/lib/normal-slider/index.wxss +1 -1
  182. package/lib/notice-bar/index.css +1 -1
  183. package/lib/notice-bar/index.js +58 -2
  184. package/lib/notice-bar/index.wxml +28 -10
  185. package/lib/notice-bar/index.wxs +1 -5
  186. package/lib/notice-bar/index.wxss +1 -1
  187. package/lib/picker-column/index.js +8 -1
  188. package/lib/radio/index.css +1 -1
  189. package/lib/radio/index.js +1 -1
  190. package/lib/radio/index.wxml +2 -1
  191. package/lib/radio/index.wxss +1 -1
  192. package/lib/search/index.css +1 -1
  193. package/lib/search/index.js +17 -9
  194. package/lib/search/index.json +2 -1
  195. package/lib/search/index.wxml +7 -4
  196. package/lib/search/index.wxss +1 -1
  197. package/lib/switch/index.css +1 -1
  198. package/lib/switch/index.wxml +1 -0
  199. package/lib/switch/index.wxss +1 -1
  200. package/lib/tabs/index.css +1 -1
  201. package/lib/tabs/index.js +10 -7
  202. package/lib/tabs/index.wxml +1 -0
  203. package/lib/tabs/index.wxs +17 -0
  204. package/lib/tabs/index.wxss +1 -1
  205. package/lib/tag/index.css +1 -1
  206. package/lib/tag/index.wxss +1 -1
  207. package/lib/toast/icons.d.ts +3 -0
  208. package/lib/toast/icons.js +12 -0
  209. package/lib/toast/index.js +8 -7
  210. package/lib/toast/index.wxml +3 -7
  211. package/lib/toast/toast.d.ts +2 -0
  212. package/lib/toast/toast.js +2 -0
  213. package/lib/wxs/style.wxs +11 -5
  214. package/lib/wxs/utils.wxs +1 -3
  215. package/package.json +6 -9
  216. package/dist/common/theme/dark.d.ts +0 -344
  217. package/dist/common/theme/dark.js +0 -343
  218. package/dist/common/theme/light.d.ts +0 -344
  219. package/dist/common/theme/light.js +0 -343
  220. package/dist/wxs/is-app-theme-var.wxs +0 -8
  221. package/lib/common/theme/dark.d.ts +0 -344
  222. package/lib/common/theme/dark.js +0 -345
  223. package/lib/common/theme/light.d.ts +0 -344
  224. package/lib/common/theme/light.js +0 -345
  225. package/lib/wxs/is-app-theme-var.wxs +0 -8
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,2px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,16px);padding:var(--tag-padding,0 4px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color,#fff)}.smart-tag--plain:before{border:1px solid;border-radius:inherit;bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.smart-tag--medium{padding:var(--tag-medium-padding,2px 6px)}.smart-tag--large{border-radius:var(--tag-large-border-radius,4px);font-size:var(--tag-large-font-size,14px);padding:var(--tag-large-padding,4px 8px)}.smart-tag--mark{border-radius:0 var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) 0}.smart-tag--mark:after{content:"";display:block;width:2px}.smart-tag--round{border-radius:var(--tag-round-border-radius,999px)}.smart-tag__close{margin-left:2px;min-width:1em}
1
+ @import '../common/index.css';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,4px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,17px);padding:var(--tag-padding,2px 8px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color,#fff)}.smart-tag--plain:before{border:1px solid;border-radius:inherit;bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.smart-tag--medium{font-size:var(--tag-medium-font-size,14px);line-height:var(--tag-medium-line-height,20px)}.smart-tag--large{font-size:var(--tag-large-font-size,16px);line-height:var(--tag-large-line-height,22px)}.smart-tag--mark{border-radius:0 var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) 0}.smart-tag--mark:after{content:"";display:block;width:2px}.smart-tag--round{border-radius:var(--tag-round-border-radius,999px)}.smart-tag__close{margin-left:2px;min-width:1em}
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,2px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,16px);padding:var(--tag-padding,0 4px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color,#fff)}.smart-tag--plain:before{border:1px solid;border-radius:inherit;bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.smart-tag--medium{padding:var(--tag-medium-padding,2px 6px)}.smart-tag--large{border-radius:var(--tag-large-border-radius,4px);font-size:var(--tag-large-font-size,14px);padding:var(--tag-large-padding,4px 8px)}.smart-tag--mark{border-radius:0 var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) 0}.smart-tag--mark:after{content:"";display:block;width:2px}.smart-tag--round{border-radius:var(--tag-round-border-radius,999px)}.smart-tag__close{margin-left:2px;min-width:1em}
1
+ @import '../common/index.wxss';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,4px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,17px);padding:var(--tag-padding,2px 8px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color,#fff)}.smart-tag--plain:before{border:1px solid;border-radius:inherit;bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.smart-tag--medium{font-size:var(--tag-medium-font-size,14px);line-height:var(--tag-medium-line-height,20px)}.smart-tag--large{font-size:var(--tag-large-font-size,16px);line-height:var(--tag-large-line-height,22px)}.smart-tag--mark{border-radius:0 var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) 0}.smart-tag--mark:after{content:"";display:block;width:2px}.smart-tag--round{border-radius:var(--tag-round-border-radius,999px)}.smart-tag__close{margin-left:2px;min-width:1em}
@@ -0,0 +1,3 @@
1
+ export declare const Success: "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20class%3D%22icon%22%20width%3D%22200px%22%20height%3D%22200.00px%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22currentColor%22%20d%3D%22M639.232%20815.232a315.306667%20315.306667%200%200%201-127.061333%2025.898667%20314.922667%20314.922667%200%200%201-127.232-25.898667%20337.92%20337.92%200%200%201-104.832-71.338667%20337.834667%20337.834667%200%200%201-71.338667-104.832%20314.88%20314.88%200%200%201-25.898667-127.232%20317.013333%20317.013333%200%200%201%2025.728-127.061333%20335.445333%20335.445333%200%200%201%2071.338667-105.173333%20333.653333%20333.653333%200%200%201%20105.002667-71.168c39.68-17.066667%2081.92-25.6%20126.890666-25.6%2044.928%200%2087.296%208.533333%20127.061334%2025.6%2039.722667%2017.066667%2074.752%2040.789333%20105.002666%2071.168a339.2%20339.2%200%200%201%2071.338667%20105.173333c17.28%2039.765333%2025.898667%2082.133333%2025.898667%20127.061333a316.714667%20316.714667%200%200%201-25.728%20127.232%20337.322667%20337.322667%200%200%201-176.213334%20176.213334z%20m-178.901333-149.930667a32.128%2032.128%200%200%200%2016.256%204.053334c11.733333%200%2021.12-5.546667%2028.16-16.597334l150.058666-235.434666c2.261333-3.413333%204.266667-6.954667%205.930667-10.666667a26.453333%2026.453333%200%200%200%202.56-11.050667%2023.466667%2023.466667%200%200%200-8.96-19.114666%2031.146667%2031.146667%200%200%200-20.181333-7.296c-9.728%200-17.877333%205.290667-24.405334%2015.914666l-134.485333%20215.808-63.701333-81.28a35.413333%2035.413333%200%200%200-11.690667-10.88%2028.16%2028.16%200%200%200-13.056-3.029333%2026.325333%2026.325333%200%200%200-19.84%208.32%2028.032%2028.032%200%200%200-7.936%2020.138667c0%207.466667%202.816%2014.677333%208.448%2021.674666l79.274667%2097.28c4.309333%205.376%208.832%209.472%2013.568%2012.16z%22%2F%3E%3C%2Fsvg%3E";
2
+ export declare const Alarm: "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20class%3D%22icon%22%20width%3D%22200px%22%20height%3D%22200.00px%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22currentColor%22%20d%3D%22M512%2053.248c129.707%203.413%20237.739%2048.299%20324.096%20134.656S967.339%20382.293%20970.752%20512c-3.413%20129.707-48.299%20237.739-134.656%20324.096S641.707%20967.339%20512%20970.752c-129.707-3.413-237.739-48.299-324.096-134.656S56.661%20641.707%2053.248%20512c3.413-129.707%2048.299-237.739%20134.656-324.096S382.293%2056.661%20512%2053.248z%20m0%20196.608c-17.749%200-32.427%206.485-44.032%2019.456-11.605%2012.971-16.725%2028.331-15.36%2046.08l23.552%20262.144c1.365%209.557%205.291%2017.237%2011.776%2023.04%206.485%205.803%2014.507%208.704%2024.064%208.704s17.579-2.901%2024.064-8.704c6.485-5.803%2010.411-13.483%2011.776-23.04l23.552-262.144c1.365-17.749-3.755-33.109-15.36-46.08-11.605-12.971-26.283-19.456-44.032-19.456z%20m0%20524.288c15.019-0.683%2027.477-5.803%2037.376-15.36%209.899-9.557%2014.848-21.845%2014.848-36.864%200-15.019-4.949-27.477-14.848-37.376-9.899-9.899-22.357-14.848-37.376-14.848-15.019%200-27.477%204.949-37.376%2014.848-9.899%209.899-14.848%2022.357-14.848%2037.376%200%2015.019%204.949%2027.307%2014.848%2036.864%209.899%209.557%2022.357%2014.677%2037.376%2015.36z%22%2F%3E%3C%2Fsvg%3E";
3
+ export declare const Error: "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20class%3D%22icon%22%20width%3D%22200px%22%20height%3D%22200.00px%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22currentColor%22%20d%3D%22M134.997333%20512a377.002667%20377.002667%200%201%201%20754.005334%200%20377.002667%20377.002667%200%200%201-754.005334%200zM512%2051.2C257.493333%2051.2%2051.2%20257.493333%2051.2%20512c0%20254.464%20206.293333%20460.8%20460.8%20460.8%20254.506667%200%20460.8-206.336%20460.8-460.8%200-254.506667-206.293333-460.8-460.8-460.8z%20m177.749333%20638.506667a41.898667%2041.898667%200%200%201-59.264%200L512%20571.221333l-118.485333%20118.485334a41.898667%2041.898667%200%200%201-59.221334-59.221334L452.778667%20512%20334.293333%20393.514667a41.898667%2041.898667%200%200%201%2059.221334-59.264L512%20452.736l118.485333-118.485333a41.898667%2041.898667%200%201%201%2059.264%2059.264L571.264%20512l118.485333%20118.485333a41.898667%2041.898667%200%200%201%200%2059.221334z%22%2F%3E%3C%2Fsvg%3E";
@@ -0,0 +1,6 @@
1
+ import Warning from '@tuya-miniapp/icons/dist/svg/Warning';
2
+ import CheckmarkCircle from '@tuya-miniapp/icons/dist/svg/CheckmarkCircle';
3
+ import Cancel from '@tuya-miniapp/icons/dist/svg/Cancel';
4
+ export const Success = CheckmarkCircle;
5
+ export const Alarm = Warning;
6
+ export const Error = Cancel;
@@ -1,5 +1,4 @@
1
- import Checkmark from '@tuya-miniapp/icons/dist/svg/Checkmark';
2
- import Smark from '@tuya-miniapp/icons/dist/svg/Xmark';
1
+ import { Success, Alarm, Error } from './icons';
3
2
  import { SmartComponent } from '../common/component';
4
3
  SmartComponent({
5
4
  props: {
@@ -11,6 +10,7 @@ SmartComponent({
11
10
  type: Number,
12
11
  value: 1000,
13
12
  },
13
+ //
14
14
  type: {
15
15
  type: String,
16
16
  value: 'text',
@@ -23,10 +23,14 @@ SmartComponent({
23
23
  type: String,
24
24
  value: 'middle',
25
25
  },
26
+ width: {
27
+ type: Number,
28
+ },
26
29
  },
27
30
  data: {
28
- success: Checkmark,
29
- error: Smark,
31
+ success: Success,
32
+ error: Error,
33
+ warn: Alarm,
30
34
  },
31
35
  methods: {
32
36
  // for prevent touchmove
@@ -12,6 +12,7 @@
12
12
  <view
13
13
  class="smart-toast smart-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }} smart-toast--{{ position }}"
14
14
  catch:touchmove="noop"
15
+ style="width: {{ width !== '100%' ? (width + 'px') : '100%' }}"
15
16
  >
16
17
  <!-- text only -->
17
18
  <text wx:if="{{ type === 'text' }}">{{ message }}</text>
@@ -21,13 +22,8 @@
21
22
 
22
23
  <!-- with icon -->
23
24
  <block wx:else>
24
- <smart-loading
25
- wx:if="{{ type === 'loading' }}"
26
- color="white"
27
- type="{{ loadingType }}"
28
- custom-class="smart-toast__loading"
29
- />
30
- <smart-icon color="white" wx:else class="smart-toast__icon" name="{{ type === 'success' ? success : error }}" />
25
+ <smart-loading wx:if="{{ type === 'loading' }}" size="60" color="white" type="{{loadingType}}" />
26
+ <smart-icon wx:else color="white" class="smart-toast__icon" name="{{ type === 'success' ? success : type === 'fail' ? error : type === 'warn' ? warn : success }}" />
31
27
  <text wx:if="{{ message }}" class="smart-toast__text">{{ message }}</text>
32
28
  </block>
33
29
 
@@ -15,12 +15,14 @@ interface ToastOptions {
15
15
  loadingType?: string;
16
16
  message?: ToastMessage;
17
17
  onClose?: () => void;
18
+ width?: number;
18
19
  }
19
20
  declare function Toast(toastOptions: ToastOptions | ToastMessage): WechatMiniprogram.Component.TrivialInstance | undefined;
20
21
  declare namespace Toast {
21
22
  var loading: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
22
23
  var success: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
23
24
  var fail: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
25
+ var warn: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
24
26
  var clear: () => void;
25
27
  var setDefaultOptions: (options: ToastOptions) => void;
26
28
  var resetDefaultOptions: () => void;
@@ -10,6 +10,7 @@ const defaultOptions = {
10
10
  forbidClick: false,
11
11
  loadingType: 'circular',
12
12
  selector: '#smart-toast',
13
+ width: '100%',
13
14
  };
14
15
  let queue = [];
15
16
  let currentOptions = Object.assign({}, defaultOptions);
@@ -53,6 +54,7 @@ const createMethod = (type) => (options) => Toast(Object.assign({ type }, parseO
53
54
  Toast.loading = createMethod('loading');
54
55
  Toast.success = createMethod('success');
55
56
  Toast.fail = createMethod('fail');
57
+ Toast.warn = createMethod('warn');
56
58
  Toast.clear = () => {
57
59
  queue.forEach((toast) => {
58
60
  toast.clear();
@@ -1,5 +1,11 @@
1
+ /*
2
+ * @Author: mjh
3
+ * @Date: 2024-08-02 11:38:15
4
+ * @LastEditors: mjh
5
+ * @LastEditTime: 2024-10-31 15:52:59
6
+ * @Description:
7
+ */
1
8
  /* eslint-disable */
2
- var utils = require('./utils.wxs');
3
9
  var object = require('./object.wxs');
4
10
  var array = require('./array.wxs');
5
11
 
@@ -32,15 +38,15 @@ function style(styles) {
32
38
  return styles[key] != null && styles[key] !== '';
33
39
  })
34
40
  .map(function (key) {
35
- if (utils.isAppThemeVar(key)) {
36
- return [key, styles[key]].join(':');
37
- }
38
41
  return [kebabCase(key), [styles[key]]].join(':');
39
42
  })
40
43
  .join(';');
41
44
  }
45
+ if (typeof styles === 'string') {
46
+ return styles
47
+ }
42
48
 
43
- return styles;
49
+ return styles || '';
44
50
  }
45
51
 
46
52
  module.exports = style;
@@ -2,11 +2,9 @@
2
2
  var bem = require('./bem.wxs');
3
3
  var memoize = require('./memoize.wxs');
4
4
  var addUnit = require('./add-unit.wxs');
5
- var isAppThemeVar = require('./is-app-theme-var.wxs');
6
5
 
7
6
  module.exports = {
8
7
  bem: memoize(bem),
9
8
  memoize: memoize,
10
- addUnit: addUnit,
11
- isAppThemeVar: isAppThemeVar,
9
+ addUnit: addUnit
12
10
  };
@@ -59,14 +59,10 @@ var button_1 = require("../mixins/button");
59
59
  },
60
60
  mounted: function () {
61
61
  var _a;
62
- var ty = wx;
63
62
  // @ts-ignore
64
- if (ty && typeof ty.getThemeInfo === 'function') {
65
- // @ts-ignore
66
- var themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
67
- var checkMarkIconColor = this.data.activeColor || themeInfo['--app-M1'] || '#3678E3';
68
- this.setData({ checkMarkIconColor: checkMarkIconColor });
69
- }
63
+ var themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
64
+ var checkMarkIconColor = this.data.activeColor || themeInfo['--app-M1'] || '#3678E3';
65
+ this.setData({ checkMarkIconColor: checkMarkIconColor });
70
66
  },
71
67
  methods: {
72
68
  onSelect: function (event) {
@@ -59,11 +59,9 @@ var wrapBatteryD = 'M6.5,0 C6.77614237,-5.07265313e-17 7,0.223857625 7,0.5 L7,1
59
59
  },
60
60
  getBgColor: function () {
61
61
  var WX = wx;
62
- if (WX && typeof WX.getThemeInfo === 'function') {
63
- var bgColor = WX === null || WX === void 0 ? void 0 : WX.getThemeInfo();
64
- if (bgColor && bgColor['--app-B1-N3']) {
65
- return bgColor['--app-B1-N3'];
66
- }
62
+ var bgColor = WX.getThemeInfo();
63
+ if (bgColor && bgColor['--app-B1-N3']) {
64
+ return bgColor['--app-B1-N3'];
67
65
  }
68
66
  var d = wx.getSystemInfoSync();
69
67
  if (d && d.theme === 'light') {
@@ -0,0 +1 @@
1
+ @import '../common/index.css';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding:var(--bottom-sheet-padding,0 16px);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);text-align:center}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var Xmark_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Xmark"));
7
+ var component_1 = require("../common/component");
8
+ (0, component_1.SmartComponent)({
9
+ props: {
10
+ show: Boolean,
11
+ title: String,
12
+ iconSize: {
13
+ type: null,
14
+ value: 24,
15
+ },
16
+ round: {
17
+ type: Boolean,
18
+ value: true,
19
+ },
20
+ zIndex: {
21
+ type: Number,
22
+ value: 100,
23
+ },
24
+ overlay: {
25
+ type: Boolean,
26
+ value: true,
27
+ },
28
+ closeOnClickOverlay: {
29
+ type: Boolean,
30
+ value: true,
31
+ },
32
+ rootPortal: {
33
+ type: Boolean,
34
+ value: false,
35
+ },
36
+ },
37
+ data: {
38
+ xmarkIcon: Xmark_1.default,
39
+ xmarkIconColor: '#3678E3',
40
+ },
41
+ mounted: function () {
42
+ var _a;
43
+ // @ts-ignore
44
+ var themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
45
+ var xmarkIconColor = this.data.activeColor || themeInfo['--app-B4-N3'] || 'rgba(0, 0, 0, 0.5)';
46
+ this.setData({ xmarkIconColor: xmarkIconColor });
47
+ },
48
+ methods: {
49
+ onClose: function () {
50
+ this.$emit('close');
51
+ },
52
+ onClickOverlay: function () {
53
+ this.$emit('click-overlay');
54
+ this.onClose();
55
+ },
56
+ onBeforeEnter: function () {
57
+ this.$emit('before-enter');
58
+ },
59
+ onEnter: function () {
60
+ this.$emit('enter');
61
+ },
62
+ onAfterEnter: function () {
63
+ this.$emit('after-enter');
64
+ },
65
+ onBeforeLeave: function () {
66
+ this.$emit('before-leave');
67
+ },
68
+ onLeave: function () {
69
+ this.$emit('leave');
70
+ },
71
+ onAfterLeave: function () {
72
+ this.$emit('after-leave');
73
+ },
74
+ },
75
+ });
@@ -0,0 +1,8 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "smart-icon": "../icon/index",
5
+ "smart-popup": "../popup/index",
6
+ "smart-loading": "../loading/index"
7
+ }
8
+ }
@@ -0,0 +1,26 @@
1
+ <wxs src="../wxs/utils.wxs" module="utils" />
2
+
3
+ <smart-popup
4
+ show="{{ show }}"
5
+ position="bottom"
6
+ round="{{ round }}"
7
+ z-index="{{ zIndex }}"
8
+ overlay="{{ overlay }}"
9
+ custom-class="smart-bottom-sheet custom-class"
10
+ safe-area-inset-bottom="{{false}}"
11
+ close-on-click-overlay="{{ closeOnClickOverlay }}"
12
+ root-portal="{{ rootPortal }}"
13
+ bind:close="onClickOverlay"
14
+ bind:before-enter="onBeforeEnter"
15
+ bind:enter="onEnter"
16
+ bind:after-enter="onAfterEnter"
17
+ bind:before-leave="onBeforeLeave"
18
+ bind:leave="onLeave"
19
+ bind:after-leave="onAfterLeave"
20
+ >
21
+ <view wx:if="{{ title }}" class="smart-bottom-sheet__header">
22
+ {{ title }}
23
+ <smart-icon bind:click="onClose" name="{{ xmarkIcon }}" class="smart-bottom-sheet__icon" size="{{ iconSize }}" color="{{ xmarkIconColor }}" />
24
+ </view>
25
+ <slot />
26
+ </smart-popup>
@@ -0,0 +1 @@
1
+ @import '../common/index.wxss';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding:var(--bottom-sheet-padding,0 16px);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);text-align:center}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
@@ -30,6 +30,7 @@ var mixins = [button_1.button];
30
30
  disabled: Boolean,
31
31
  loadingText: String,
32
32
  customStyle: String,
33
+ textStyle: String,
33
34
  loadingType: {
34
35
  type: String,
35
36
  value: 'circular',
@@ -49,7 +49,7 @@
49
49
  class="smart-button__icon"
50
50
  custom-style="line-height: inherit;"
51
51
  />
52
- <view class="smart-button__text">
52
+ <view class="smart-button__text" style="{{textStyle}}">
53
53
  <slot />
54
54
  </view>
55
55
  <smart-icon
@@ -4,74 +4,74 @@
4
4
  <header
5
5
  title="{{ title }}"
6
6
  showTitle="{{ showTitle }}"
7
- subtitle="{{ subtitle }}"
7
+ subtitle="{{ mode === 'year' ? '' : mode === 'month' ? computed.formatYearTitle(currentDate, visibleIndex, locale.yearFormatter) : computed.formatMonthTitle(months[visibleIndex], subFormatter) }}"
8
+ subFormatter="{{locale.subFormatter || 'YYYY-MM'}}"
8
9
  showSubtitle="{{ showSubtitle }}"
9
10
  firstDayOfWeek="{{ firstDayOfWeek }}"
10
11
  bind:click-subtitle="onClickSubtitle"
11
12
  defaultWeeks="{{locale.shortWeekDays || ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']}}"
13
+ bind:click-prev="onPrev"
14
+ bind:click-next="onNext"
15
+ bind:click-save="onConfirm"
16
+ hideWeek="{{ mode !== 'day' }}"
12
17
  >
13
18
  <slot name="title" slot="title"></slot>
14
19
  </header>
15
20
 
16
- <scroll-view
17
- class="smart-calendar__body"
18
- scroll-y
19
- scroll-into-view="{{ scrollIntoView }}"
20
- >
21
- <month
22
- wx:for="{{ computed.getMonths(minDate, maxDate) }}"
23
- wx:key="index"
24
- id="month{{ index }}"
25
- class="month"
26
- visible="{{ computed.getVisible(visibleIndex, index) }}"
27
- subFormatter="{{locale.subFormatter || 'YYYY-MM'}}"
28
- rangeStart="{{locale.rangeStart || 'Start'}}"
29
- rangeEnd="{{locale.rangeEnd || 'End'}}"
30
- data-date="{{ item }}"
31
- data-index="{{index}}"
32
- date="{{ item }}"
33
- type="{{ type }}"
34
- color="{{ color }}"
21
+ <block wx:if="{{mode === 'day'}}">
22
+ <view class="smart-calendar-month_wrap" wx:for="{{ months }}" wx:key="index">
23
+ <month
24
+ id="month{{ index }}"
25
+ class="smart-calendar-month month"
26
+ wx:if="{{ computed.getVisible(visibleIndex, index) }}"
27
+ subFormatter="{{locale.subFormatter || 'YYYY-MM'}}"
28
+ rangeStart="{{locale.rangeStart || 'Start'}}"
29
+ rangeEnd="{{locale.rangeEnd || 'End'}}"
30
+ data-date="{{ item }}"
31
+ data-index="{{index}}"
32
+ date="{{ item }}"
33
+ type="{{ type }}"
34
+ color="{{ color }}"
35
+ minDate="{{ minDate }}"
36
+ maxDate="{{ maxDate }}"
37
+ showMark="{{ showMark }}"
38
+ formatter="{{ formatter }}"
39
+ rowHeight="{{ rowHeight }}"
40
+ currentDate="{{ currentDate }}"
41
+ showSubtitle="{{ showSubtitle }}"
42
+ allowSameDay="{{ allowSameDay }}"
43
+ showMonthTitle="{{ index !== 0 || !showSubtitle }}"
44
+ firstDayOfWeek="{{ firstDayOfWeek }}"
45
+ bind:click="onClickDay"
46
+ />
47
+ </view>
48
+ </block>
49
+
50
+ <block wx:if="{{mode === 'month'}}">
51
+ <month-list
35
52
  minDate="{{ minDate }}"
36
53
  maxDate="{{ maxDate }}"
37
- showMark="{{ showMark }}"
38
- formatter="{{ formatter }}"
39
- rowHeight="{{ rowHeight }}"
40
- currentDate="{{ currentDate }}"
41
- showSubtitle="{{ showSubtitle }}"
42
- allowSameDay="{{ allowSameDay }}"
43
- showMonthTitle="{{ index !== 0 || !showSubtitle }}"
44
- firstDayOfWeek="{{ firstDayOfWeek }}"
45
- dayClassMap="{{ dayClassMap }}"
46
- bind:click="onClickDay"
54
+ monthsFormatter="{{ locale.monthsFormatter }}"
55
+ bind:click="onClickDate"
56
+ date="{{defaultDate}}"
57
+ visibleIndex="{{visibleIndex}}"
47
58
  />
48
- </scroll-view>
59
+ </block>
49
60
 
50
- <view
51
- class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
52
- >
53
- <slot name="footer"></slot>
54
- </view>
61
+ <block wx:if="{{mode === 'year'}}">
62
+ <year-list
63
+ minDate="{{ minDate }}"
64
+ maxDate="{{ maxDate }}"
65
+ yearFormatter="{{ locale.yearFormatter }}"
66
+ bind:click="onClickDate"
67
+ date="{{defaultDate}}"
68
+ visibleIndex="{{visibleIndex}}"
69
+ />
70
+ </block>
55
71
 
56
72
  <view
57
73
  class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
58
74
  >
59
- <smart-button
60
- wx:if="{{ showConfirm }}"
61
- round
62
- block
63
- type="danger"
64
- color="{{ color }}"
65
- custom-class="smart-calendar__confirm"
66
- disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}"
67
- nativeType="text"
68
- bind:click="onConfirm"
69
- >
70
- {{
71
- computed.getButtonDisabled(type, currentDate, minRange)
72
- ? confirmDisabledText
73
- : confirmText
74
- }}
75
- </smart-button>
75
+ <slot name="footer"></slot>
76
76
  </view>
77
77
  </view>
@@ -1 +1 @@
1
- @import '../../../common/index.css';.smart-calendar__header{box-shadow:var(--calendar-header-box-shadow,0 2px 10px hsla(220,1%,50%,.16));flex-shrink:0}.smart-calendar__header-subtitle,.smart-calendar__header-title{font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex}.smart-calendar__weekday{flex:1;font-size:var(--calendar-weekdays-font-size,12px);line-height:var(--calendar-weekdays-height,30px);text-align:center}
1
+ @import '../../../common/index.css';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{font-size:16px;font-weight:var(--font-weight-bold,500);font-weight:500;height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{left:52rpx}.smart-calendar__header-subtitle_left,.smart-calendar__header-subtitle_right{align-items:center;background:rgba(0,0,0,.05);border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right{right:52rpx}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -8,18 +8,28 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
8
8
  }
9
9
  return to.concat(ar || Array.prototype.slice.call(from));
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  var component_1 = require("../../../common/component");
16
+ var Left_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Left"));
17
+ var Right_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Right"));
13
18
  (0, component_1.SmartComponent)({
14
19
  props: {
15
20
  title: {
16
21
  type: String,
17
22
  value: '日期选择',
18
23
  },
24
+ rightText: {
25
+ type: String,
26
+ value: '保存',
27
+ },
19
28
  subtitle: String,
20
29
  showTitle: Boolean,
21
30
  showSubtitle: Boolean,
22
31
  defaultWeeks: Array,
32
+ hideWeek: Boolean,
23
33
  firstDayOfWeek: {
24
34
  type: Number,
25
35
  observer: 'initWeekDay',
@@ -27,6 +37,8 @@ var component_1 = require("../../../common/component");
27
37
  },
28
38
  data: {
29
39
  weekdays: [],
40
+ LeftIcon: Left_1.default,
41
+ RightIcon: Right_1.default,
30
42
  },
31
43
  created: function () {
32
44
  this.initWeekDay();
@@ -42,5 +54,14 @@ var component_1 = require("../../../common/component");
42
54
  onClickSubtitle: function (event) {
43
55
  this.$emit('click-subtitle', event);
44
56
  },
57
+ onPrev: function () {
58
+ this.$emit('click-prev');
59
+ },
60
+ onNext: function () {
61
+ this.$emit('click-next');
62
+ },
63
+ onSave: function () {
64
+ this.$emit('click-save');
65
+ },
45
66
  },
46
67
  });
@@ -1,3 +1,6 @@
1
1
  {
2
- "component": true
2
+ "component": true,
3
+ "usingComponents": {
4
+ "smart-icon": "../../../icon/index"
5
+ }
3
6
  }
@@ -1,14 +1,25 @@
1
1
  <view class="smart-calendar__header">
2
2
  <block wx:if="{{ showTitle }}">
3
3
  <view class="smart-calendar__header-title"><slot name="title"></slot></view>
4
- <view class="smart-calendar__header-title">{{ title }}</view>
4
+ <view class="smart-calendar__header-title">
5
+ {{ title }}
6
+ <view class="smart-calendar__header-title-save" bind:tap=="onSave">{{ rightText }}</view>
7
+ </view>
5
8
  </block>
6
9
 
7
- <view wx:if="{{ showSubtitle }}" class="smart-calendar__header-subtitle" bind:tap="onClickSubtitle">
8
- {{ subtitle }}
10
+ <view class="smart-calendar__header-subtitle_wrap">
11
+ <view class="smart-calendar__header-subtitle_left" bind:tap="onPrev">
12
+ <smart-icon name="{{LeftIcon}}" />
13
+ </view>
14
+ <view wx:if="{{ showSubtitle }}" class="smart-calendar__header-subtitle" bind:tap="onClickSubtitle">
15
+ {{ subtitle }}
16
+ </view>
17
+ <view class="smart-calendar__header-subtitle_right" bind:tap="onNext">
18
+ <smart-icon name="{{RightIcon}}" />
19
+ </view>
9
20
  </view>
10
21
 
11
- <view class="smart-calendar__weekdays">
22
+ <view class="smart-calendar__weekdays" wx:if="{{!hideWeek}}">
12
23
  <view wx:for="{{ weekdays }}" wx:key="index" class="smart-calendar__weekday">
13
24
  {{ item }}
14
25
  </view>
@@ -1 +1 @@
1
- @import '../../../common/index.wxss';.smart-calendar__header{box-shadow:var(--calendar-header-box-shadow,0 2px 10px hsla(220,1%,50%,.16));flex-shrink:0}.smart-calendar__header-subtitle,.smart-calendar__header-title{font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex}.smart-calendar__weekday{flex:1;font-size:var(--calendar-weekdays-font-size,12px);line-height:var(--calendar-weekdays-height,30px);text-align:center}
1
+ @import '../../../common/index.wxss';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{font-size:16px;font-weight:var(--font-weight-bold,500);font-weight:500;height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{left:52rpx}.smart-calendar__header-subtitle_left,.smart-calendar__header-subtitle_right{align-items:center;background:rgba(0,0,0,.05);border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right{right:52rpx}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -1 +1 @@
1
- @import '../../../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{font-size:var(--calendar-day-font-size,16px);height:var(--calendar-day-height,64px);position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#ee0a24);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-radius:4px 0 0 4px}.smart-calendar__day--end{border-radius:0 4px 4px 0}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{color:var(--calendar-range-middle-color,#ee0a24)}.smart-calendar__day--middle:after{background-color:currentColor;bottom:0;content:"";left:0;opacity:var(--calendar-range-middle-background-opacity,.1);position:absolute;right:0;top:0}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,54px);width:var(--calendar-selected-day-size,54px)}
1
+ @import '../../../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{font-size:var(--calendar-day-font-size,15px);font-weight:500;height:var(--calendar-day-height,100rpx);position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:34rpx;border-top-left-radius:34rpx}.smart-calendar__day--end{border-bottom-right-radius:34rpx;border-top-right-radius:34rpx}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,var(--app-B3,#fff))}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -3,5 +3,4 @@ export interface Day {
3
3
  type: string;
4
4
  text: number;
5
5
  bottomInfo?: string;
6
- className?: string;
7
6
  }