@tuya-miniapp/smart-ui 1.3.1-beta-3 → 1.3.1-beta-4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. package/dist/action-sheet/demo/index.d.ts +1 -0
  2. package/dist/action-sheet/demo/index.js +101 -0
  3. package/dist/action-sheet/index.js +1 -1
  4. package/dist/area/demo/index.d.ts +1 -0
  5. package/dist/area/demo/index.js +41 -0
  6. package/dist/area/index.js +4 -5
  7. package/dist/battery/demo/index.d.ts +1 -0
  8. package/dist/battery/demo/index.js +2 -0
  9. package/dist/battery/index.js +1 -3
  10. package/dist/bottom-sheet/demo/index.d.ts +1 -0
  11. package/dist/bottom-sheet/demo/index.js +24 -0
  12. package/dist/bottom-sheet/index.css +1 -1
  13. package/dist/bottom-sheet/index.js +3 -2
  14. package/dist/bottom-sheet/index.wxml +3 -1
  15. package/dist/bottom-sheet/index.wxss +1 -1
  16. package/dist/button/demo/index.d.ts +1 -0
  17. package/dist/button/demo/index.js +9 -0
  18. package/dist/button/index.js +1 -1
  19. package/dist/calendar/components/header/index.css +1 -1
  20. package/dist/calendar/components/header/index.js +1 -1
  21. package/dist/calendar/components/header/index.wxml +3 -3
  22. package/dist/calendar/components/header/index.wxss +1 -1
  23. package/dist/calendar/components/month/index.css +1 -1
  24. package/dist/calendar/components/month/index.js +3 -5
  25. package/dist/calendar/components/month/index.wxs +1 -4
  26. package/dist/calendar/components/month/index.wxss +1 -1
  27. package/dist/calendar/components/month-list/index.css +1 -1
  28. package/dist/calendar/components/month-list/index.js +4 -17
  29. package/dist/calendar/components/month-list/index.wxml +15 -13
  30. package/dist/calendar/components/month-list/index.wxss +1 -1
  31. package/dist/calendar/components/year-list/index.css +1 -1
  32. package/dist/calendar/components/year-list/index.js +3 -3
  33. package/dist/calendar/components/year-list/index.wxml +1 -1
  34. package/dist/calendar/components/year-list/index.wxss +1 -1
  35. package/dist/calendar/demo/index.d.ts +1 -0
  36. package/dist/calendar/demo/index.js +103 -0
  37. package/dist/calendar/index.js +9 -14
  38. package/dist/calendar/index.wxs +4 -7
  39. package/dist/calendar/utils.js +2 -4
  40. package/dist/cascader/demo/index.d.ts +1 -0
  41. package/dist/cascader/demo/index.js +191 -0
  42. package/dist/cascader/index.js +3 -3
  43. package/dist/cell/demo/index.d.ts +1 -0
  44. package/dist/cell/demo/index.js +14 -0
  45. package/dist/cell/index.js +1 -7
  46. package/dist/checkbox/demo/index.d.ts +1 -0
  47. package/dist/checkbox/demo/index.js +34 -0
  48. package/dist/checkbox-group/index.js +1 -1
  49. package/dist/circle/demo/index.d.ts +1 -0
  50. package/dist/circle/demo/index.js +19 -0
  51. package/dist/col/demo/index.d.ts +1 -0
  52. package/dist/col/demo/index.js +4 -0
  53. package/dist/collapse/demo/index.d.ts +1 -0
  54. package/dist/collapse/demo/index.js +36 -0
  55. package/dist/collapse/index.js +1 -1
  56. package/dist/collapse-item/animate.js +1 -1
  57. package/dist/common/component.js +1 -1
  58. package/dist/common/utils.js +3 -3
  59. package/dist/config-provider/demo/index.d.ts +1 -0
  60. package/dist/config-provider/demo/index.js +22 -0
  61. package/dist/count-down/demo/index.d.ts +1 -0
  62. package/dist/count-down/demo/index.js +33 -0
  63. package/dist/custom-keyboard/demo/index.d.ts +1 -0
  64. package/dist/custom-keyboard/demo/index.js +17 -0
  65. package/dist/custom-keyboard/index.js +1 -3
  66. package/dist/datetime-picker/demo/index.d.ts +1 -0
  67. package/dist/datetime-picker/demo/index.js +63 -0
  68. package/dist/datetime-picker/index.js +4 -5
  69. package/dist/dialog/demo/index.d.ts +1 -0
  70. package/dist/dialog/demo/index.js +134 -0
  71. package/dist/dialog/dialog.js +3 -5
  72. package/dist/dialog/index.js +1 -1
  73. package/dist/divider/demo/index.d.ts +1 -0
  74. package/dist/divider/demo/index.js +4 -0
  75. package/dist/dropdown-item/index.js +3 -3
  76. package/dist/dropdown-item/index.wxml +1 -7
  77. package/dist/dropdown-menu/demo/index.d.ts +1 -0
  78. package/dist/dropdown-menu/demo/index.js +47 -0
  79. package/dist/dropdown-menu/index.js +8 -10
  80. package/dist/empty/demo/index.d.ts +1 -0
  81. package/dist/empty/demo/index.js +13 -0
  82. package/dist/empty/index.css +1 -1
  83. package/dist/empty/index.wxs +1 -1
  84. package/dist/empty/index.wxss +1 -1
  85. package/dist/field/demo/index.d.ts +1 -0
  86. package/dist/field/demo/index.js +21 -0
  87. package/dist/goods-action/demo/index.d.ts +1 -0
  88. package/dist/goods-action/demo/index.js +12 -0
  89. package/dist/goods-action/index.js +1 -1
  90. package/dist/grid/demo/index.d.ts +1 -0
  91. package/dist/grid/demo/index.js +9 -0
  92. package/dist/grid/index.js +1 -1
  93. package/dist/grid-item/index.js +1 -1
  94. package/dist/icon/demo/index.d.ts +1 -0
  95. package/dist/icon/demo/index.js +26 -0
  96. package/dist/image/demo/index.d.ts +1 -0
  97. package/dist/image/demo/index.js +15 -0
  98. package/dist/index-anchor/index.js +1 -1
  99. package/dist/index-bar/demo/index.d.ts +1 -0
  100. package/dist/index-bar/demo/index.js +21 -0
  101. package/dist/index-bar/index.js +9 -16
  102. package/dist/loading/demo/index.d.ts +1 -0
  103. package/dist/loading/demo/index.js +4 -0
  104. package/dist/loading/index.js +25 -1
  105. package/dist/loading/index.wxml +2 -2
  106. package/dist/loading/index.wxs +6 -21
  107. package/dist/mixins/basic.js +2 -2
  108. package/dist/mixins/link.js +1 -2
  109. package/dist/mixins/page-scroll.js +1 -1
  110. package/dist/mixins/touch.js +1 -2
  111. package/dist/mixins/transition.js +1 -1
  112. package/dist/nav-bar/demo/index.d.ts +1 -0
  113. package/dist/nav-bar/demo/index.js +26 -0
  114. package/dist/nav-bar/index.css +1 -1
  115. package/dist/nav-bar/index.js +1 -1
  116. package/dist/nav-bar/index.wxml +1 -1
  117. package/dist/nav-bar/index.wxss +1 -1
  118. package/dist/normal-slider/demo/index.d.ts +1 -0
  119. package/dist/normal-slider/demo/index.js +19 -0
  120. package/dist/notice-bar/demo/index.d.ts +1 -0
  121. package/dist/notice-bar/demo/index.js +11 -0
  122. package/dist/notice-bar/index.js +3 -6
  123. package/dist/notice-bar/index.wxml +1 -5
  124. package/dist/notify/demo/index.d.ts +1 -0
  125. package/dist/notify/demo/index.js +45 -0
  126. package/dist/overlay/demo/index.d.ts +1 -0
  127. package/dist/overlay/demo/index.js +22 -0
  128. package/dist/picker/demo/index.d.ts +1 -0
  129. package/dist/picker/demo/index.js +76 -0
  130. package/dist/picker/index.css +1 -1
  131. package/dist/picker/index.js +2 -2
  132. package/dist/picker/index.wxml +1 -0
  133. package/dist/picker/index.wxss +1 -1
  134. package/dist/picker-column/index.js +3 -8
  135. package/dist/popup/demo/index.d.ts +1 -0
  136. package/dist/popup/demo/index.js +79 -0
  137. package/dist/progress/demo/index.d.ts +1 -0
  138. package/dist/progress/demo/index.js +4 -0
  139. package/dist/progress/index.js +1 -4
  140. package/dist/radio/demo/index.d.ts +1 -0
  141. package/dist/radio/demo/index.js +31 -0
  142. package/dist/radio-group/index.js +1 -1
  143. package/dist/rate/demo/index.d.ts +1 -0
  144. package/dist/rate/demo/index.js +25 -0
  145. package/dist/rate/index.js +2 -2
  146. package/dist/row/index.js +1 -1
  147. package/dist/search/demo/index.d.ts +1 -0
  148. package/dist/search/demo/index.js +43 -0
  149. package/dist/sidebar/demo/index.d.ts +1 -0
  150. package/dist/sidebar/demo/index.js +9 -0
  151. package/dist/skeleton/demo/index.d.ts +1 -0
  152. package/dist/skeleton/demo/index.js +11 -0
  153. package/dist/slider/demo/index.d.ts +1 -0
  154. package/dist/slider/demo/index.js +19 -0
  155. package/dist/slider/index.js +5 -7
  156. package/dist/stepper/demo/index.d.ts +1 -0
  157. package/dist/stepper/demo/index.js +19 -0
  158. package/dist/steps/demo/index.d.ts +1 -0
  159. package/dist/steps/demo/index.js +42 -0
  160. package/dist/sticky/demo/index.d.ts +1 -0
  161. package/dist/sticky/demo/index.js +26 -0
  162. package/dist/sticky/index.js +2 -2
  163. package/dist/swipe-cell/demo/index.d.ts +1 -0
  164. package/dist/swipe-cell/demo/index.js +45 -0
  165. package/dist/swipe-cell/index.js +3 -5
  166. package/dist/switch/demo/index.d.ts +1 -0
  167. package/dist/switch/demo/index.js +29 -0
  168. package/dist/switch/index.css +1 -1
  169. package/dist/switch/index.wxss +1 -1
  170. package/dist/tab/demo/index.d.ts +1 -0
  171. package/dist/tab/demo/index.js +55 -0
  172. package/dist/tabbar/demo/index.d.ts +1 -0
  173. package/dist/tabbar/demo/index.js +34 -0
  174. package/dist/tabbar/index.js +1 -1
  175. package/dist/tabs/index.js +7 -25
  176. package/dist/tag/demo/index.d.ts +1 -0
  177. package/dist/tag/demo/index.js +16 -0
  178. package/dist/tag/index.css +1 -1
  179. package/dist/tag/index.wxss +1 -1
  180. package/dist/toast/demo/index.d.ts +1 -0
  181. package/dist/toast/demo/index.js +67 -0
  182. package/dist/toast/toast.js +3 -5
  183. package/dist/transition/demo/index.d.ts +1 -0
  184. package/dist/transition/demo/index.js +67 -0
  185. package/dist/tree-select/demo/index.d.ts +1 -0
  186. package/dist/tree-select/demo/index.js +113 -0
  187. package/lib/action-sheet/demo/index.d.ts +1 -0
  188. package/lib/action-sheet/demo/index.js +115 -0
  189. package/lib/area/demo/index.d.ts +1 -0
  190. package/lib/area/demo/index.js +47 -0
  191. package/lib/area/index.js +1 -2
  192. package/lib/battery/demo/index.d.ts +1 -0
  193. package/lib/battery/demo/index.js +4 -0
  194. package/lib/battery/index.js +1 -3
  195. package/lib/bottom-sheet/demo/index.d.ts +1 -0
  196. package/lib/bottom-sheet/demo/index.js +27 -0
  197. package/lib/bottom-sheet/index.css +1 -1
  198. package/lib/bottom-sheet/index.js +3 -2
  199. package/lib/bottom-sheet/index.wxml +3 -1
  200. package/lib/bottom-sheet/index.wxss +1 -1
  201. package/lib/button/demo/index.d.ts +1 -0
  202. package/lib/button/demo/index.js +14 -0
  203. package/lib/calendar/components/header/index.css +1 -1
  204. package/lib/calendar/components/header/index.wxml +3 -3
  205. package/lib/calendar/components/header/index.wxss +1 -1
  206. package/lib/calendar/components/month/index.css +1 -1
  207. package/lib/calendar/components/month/index.js +2 -6
  208. package/lib/calendar/components/month/index.wxs +1 -4
  209. package/lib/calendar/components/month/index.wxss +1 -1
  210. package/lib/calendar/components/month-list/index.css +1 -1
  211. package/lib/calendar/components/month-list/index.js +3 -16
  212. package/lib/calendar/components/month-list/index.wxml +15 -13
  213. package/lib/calendar/components/month-list/index.wxss +1 -1
  214. package/lib/calendar/components/year-list/index.css +1 -1
  215. package/lib/calendar/components/year-list/index.js +1 -1
  216. package/lib/calendar/components/year-list/index.wxml +1 -1
  217. package/lib/calendar/components/year-list/index.wxss +1 -1
  218. package/lib/calendar/demo/index.d.ts +1 -0
  219. package/lib/calendar/demo/index.js +105 -0
  220. package/lib/calendar/index.js +7 -14
  221. package/lib/calendar/index.wxs +4 -7
  222. package/lib/calendar/utils.js +1 -3
  223. package/lib/cascader/demo/index.d.ts +1 -0
  224. package/lib/cascader/demo/index.js +197 -0
  225. package/lib/cell/demo/index.d.ts +1 -0
  226. package/lib/cell/demo/index.js +39 -0
  227. package/lib/cell/index.js +1 -7
  228. package/lib/checkbox/demo/index.d.ts +1 -0
  229. package/lib/checkbox/demo/index.js +38 -0
  230. package/lib/circle/demo/index.d.ts +1 -0
  231. package/lib/circle/demo/index.js +21 -0
  232. package/lib/col/demo/index.d.ts +1 -0
  233. package/lib/col/demo/index.js +6 -0
  234. package/lib/collapse/demo/index.d.ts +1 -0
  235. package/lib/collapse/demo/index.js +42 -0
  236. package/lib/config-provider/demo/index.d.ts +1 -0
  237. package/lib/config-provider/demo/index.js +24 -0
  238. package/lib/count-down/demo/index.d.ts +1 -0
  239. package/lib/count-down/demo/index.js +38 -0
  240. package/lib/custom-keyboard/demo/index.d.ts +1 -0
  241. package/lib/custom-keyboard/demo/index.js +19 -0
  242. package/lib/custom-keyboard/index.js +1 -3
  243. package/lib/datetime-picker/demo/index.d.ts +1 -0
  244. package/lib/datetime-picker/demo/index.js +68 -0
  245. package/lib/datetime-picker/index.js +4 -3
  246. package/lib/dialog/demo/index.d.ts +1 -0
  247. package/lib/dialog/demo/index.js +144 -0
  248. package/lib/dialog/dialog.js +1 -3
  249. package/lib/divider/demo/index.d.ts +1 -0
  250. package/lib/divider/demo/index.js +6 -0
  251. package/lib/dropdown-item/index.wxml +1 -7
  252. package/lib/dropdown-menu/demo/index.d.ts +1 -0
  253. package/lib/dropdown-menu/demo/index.js +52 -0
  254. package/lib/dropdown-menu/index.js +2 -4
  255. package/lib/empty/demo/index.d.ts +1 -0
  256. package/lib/empty/demo/index.js +15 -0
  257. package/lib/empty/index.css +1 -1
  258. package/lib/empty/index.wxs +1 -1
  259. package/lib/empty/index.wxss +1 -1
  260. package/lib/field/demo/index.d.ts +1 -0
  261. package/lib/field/demo/index.js +23 -0
  262. package/lib/goods-action/demo/index.d.ts +1 -0
  263. package/lib/goods-action/demo/index.js +17 -0
  264. package/lib/grid/demo/index.d.ts +1 -0
  265. package/lib/grid/demo/index.js +11 -0
  266. package/lib/icon/demo/index.d.ts +1 -0
  267. package/lib/icon/demo/index.js +54 -0
  268. package/lib/image/demo/index.d.ts +1 -0
  269. package/lib/image/demo/index.js +17 -0
  270. package/lib/index-bar/demo/index.d.ts +1 -0
  271. package/lib/index-bar/demo/index.js +23 -0
  272. package/lib/index-bar/index.js +3 -10
  273. package/lib/loading/demo/index.d.ts +1 -0
  274. package/lib/loading/demo/index.js +6 -0
  275. package/lib/loading/index.js +27 -1
  276. package/lib/loading/index.wxml +2 -2
  277. package/lib/loading/index.wxs +6 -21
  278. package/lib/mixins/link.js +1 -2
  279. package/lib/mixins/touch.js +1 -2
  280. package/lib/nav-bar/demo/index.d.ts +1 -0
  281. package/lib/nav-bar/demo/index.js +31 -0
  282. package/lib/nav-bar/index.css +1 -1
  283. package/lib/nav-bar/index.wxml +1 -1
  284. package/lib/nav-bar/index.wxss +1 -1
  285. package/lib/normal-slider/demo/index.d.ts +1 -0
  286. package/lib/normal-slider/demo/index.js +21 -0
  287. package/lib/notice-bar/demo/index.d.ts +1 -0
  288. package/lib/notice-bar/demo/index.js +16 -0
  289. package/lib/notice-bar/index.js +2 -5
  290. package/lib/notice-bar/index.wxml +1 -5
  291. package/lib/notify/demo/index.d.ts +1 -0
  292. package/lib/notify/demo/index.js +50 -0
  293. package/lib/overlay/demo/index.d.ts +1 -0
  294. package/lib/overlay/demo/index.js +24 -0
  295. package/lib/picker/demo/index.d.ts +1 -0
  296. package/lib/picker/demo/index.js +82 -0
  297. package/lib/picker/index.css +1 -1
  298. package/lib/picker/index.js +1 -3
  299. package/lib/picker/index.wxml +1 -0
  300. package/lib/picker/index.wxss +1 -1
  301. package/lib/picker-column/index.js +2 -7
  302. package/lib/popup/demo/index.d.ts +1 -0
  303. package/lib/popup/demo/index.js +85 -0
  304. package/lib/progress/demo/index.d.ts +1 -0
  305. package/lib/progress/demo/index.js +6 -0
  306. package/lib/progress/index.js +1 -4
  307. package/lib/radio/demo/index.d.ts +1 -0
  308. package/lib/radio/demo/index.js +34 -0
  309. package/lib/rate/demo/index.d.ts +1 -0
  310. package/lib/rate/demo/index.js +30 -0
  311. package/lib/search/demo/index.d.ts +1 -0
  312. package/lib/search/demo/index.js +48 -0
  313. package/lib/sidebar/demo/index.d.ts +1 -0
  314. package/lib/sidebar/demo/index.js +14 -0
  315. package/lib/skeleton/demo/index.d.ts +1 -0
  316. package/lib/skeleton/demo/index.js +14 -0
  317. package/lib/slider/demo/index.d.ts +1 -0
  318. package/lib/slider/demo/index.js +21 -0
  319. package/lib/slider/index.js +1 -3
  320. package/lib/stepper/demo/index.d.ts +1 -0
  321. package/lib/stepper/demo/index.js +25 -0
  322. package/lib/steps/demo/index.d.ts +1 -0
  323. package/lib/steps/demo/index.js +47 -0
  324. package/lib/sticky/demo/index.d.ts +1 -0
  325. package/lib/sticky/demo/index.js +30 -0
  326. package/lib/sticky/index.js +3 -1
  327. package/lib/swipe-cell/demo/index.d.ts +1 -0
  328. package/lib/swipe-cell/demo/index.js +50 -0
  329. package/lib/swipe-cell/index.js +1 -3
  330. package/lib/switch/demo/index.d.ts +1 -0
  331. package/lib/switch/demo/index.js +37 -0
  332. package/lib/switch/index.css +1 -1
  333. package/lib/switch/index.wxss +1 -1
  334. package/lib/tab/demo/index.d.ts +1 -0
  335. package/lib/tab/demo/index.js +57 -0
  336. package/lib/tabbar/demo/index.d.ts +1 -0
  337. package/lib/tabbar/demo/index.js +41 -0
  338. package/lib/tabs/index.js +6 -24
  339. package/lib/tag/demo/index.d.ts +1 -0
  340. package/lib/tag/demo/index.js +19 -0
  341. package/lib/tag/index.css +1 -1
  342. package/lib/tag/index.wxss +1 -1
  343. package/lib/toast/demo/index.d.ts +1 -0
  344. package/lib/toast/demo/index.js +74 -0
  345. package/lib/toast/toast.js +1 -3
  346. package/lib/transition/demo/index.d.ts +1 -0
  347. package/lib/transition/demo/index.js +71 -0
  348. package/lib/tree-select/demo/index.d.ts +1 -0
  349. package/lib/tree-select/demo/index.js +130 -0
  350. package/package.json +1 -1
@@ -47,7 +47,7 @@ SmartComponent({
47
47
  },
48
48
  methods: {
49
49
  updateChildren() {
50
- this.children.forEach((child) => {
50
+ this.children.forEach(child => {
51
51
  child.updateStyle();
52
52
  });
53
53
  },
@@ -30,7 +30,7 @@ SmartComponent({
30
30
  return;
31
31
  }
32
32
  const { data, children } = this.parent;
33
- const { columnNum, border, square, gutter, clickable, center, direction, reverse, iconSize, } = data;
33
+ const { columnNum, border, square, gutter, clickable, center, direction, reverse, iconSize } = data;
34
34
  this.setData({
35
35
  center,
36
36
  border,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ import * as icons from '@tuya-miniapp/icons';
2
+ import iconsConfig from '@tuya-miniapp/icons/dist/config';
3
+ import { SmartComponent } from '../../common/component';
4
+ function kebabCase(name) {
5
+ const currName = name.replace(/[A-Z]/g, (word) => '-' + word.toLocaleLowerCase());
6
+ return currName.slice(1);
7
+ }
8
+ const iconsArr = iconsConfig.map((name) => ({
9
+ name: kebabCase(name),
10
+ value: icons[name],
11
+ }));
12
+ SmartComponent({
13
+ data: {
14
+ active: 0,
15
+ icons: iconsArr,
16
+ iconWarning: icons.Warning,
17
+ iconAlarm: icons.Alarm,
18
+ },
19
+ methods: {
20
+ onSwitch(event) {
21
+ this.setData({
22
+ active: event.detail.index,
23
+ });
24
+ },
25
+ },
26
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ fits: [
5
+ 'contain',
6
+ 'cover',
7
+ 'fill',
8
+ 'none',
9
+ 'scale-down',
10
+ 'widthFix',
11
+ 'heightFix',
12
+ ],
13
+ src: 'https://images.tuyacn.com/rms-static/f350c8a0-0eb2-11ef-8f06-49ae7b2fadcf-1715334722090.jpeg?tyName=cat.jpeg',
14
+ },
15
+ });
@@ -14,7 +14,7 @@ SmartComponent({
14
14
  },
15
15
  methods: {
16
16
  scrollIntoView(scrollTop) {
17
- getRect(this, '.smart-index-anchor-wrapper').then((rect) => {
17
+ getRect(this, '.smart-index-anchor-wrapper').then(rect => {
18
18
  wx.pageScrollTo({
19
19
  duration: 0,
20
20
  scrollTop: scrollTop + rect.top - this.parent.data.stickyOffsetTop,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ const indexList = [];
3
+ const charCodeOfA = 'A'.charCodeAt(0);
4
+ for (let i = 0; i < 26; i++) {
5
+ indexList.push(String.fromCharCode(charCodeOfA + i));
6
+ }
7
+ SmartComponent({
8
+ data: {
9
+ activeTab: 0,
10
+ indexList,
11
+ customIndexList: [1, 2, 3, 4, 5, 6, 8, 9, 10],
12
+ scrollTop: 0,
13
+ },
14
+ methods: {
15
+ onChange(event) {
16
+ this.setData({
17
+ activeTab: event.detail.name,
18
+ });
19
+ },
20
+ },
21
+ });
@@ -67,14 +67,10 @@ SmartComponent({
67
67
  });
68
68
  },
69
69
  setRect() {
70
- return Promise.all([
71
- this.setAnchorsRect(),
72
- this.setListRect(),
73
- this.setSiderbarRect(),
74
- ]);
70
+ return Promise.all([this.setAnchorsRect(), this.setListRect(), this.setSiderbarRect()]);
75
71
  },
76
72
  setAnchorsRect() {
77
- return Promise.all(this.children.map((anchor) => getRect(anchor, '.smart-index-anchor-wrapper').then((rect) => {
73
+ return Promise.all(this.children.map(anchor => getRect(anchor, '.smart-index-anchor-wrapper').then(rect => {
78
74
  Object.assign(anchor, {
79
75
  height: rect.height,
80
76
  top: rect.top + this.scrollTop,
@@ -82,7 +78,7 @@ SmartComponent({
82
78
  })));
83
79
  },
84
80
  setListRect() {
85
- return getRect(this, '.smart-index-bar').then((rect) => {
81
+ return getRect(this, '.smart-index-bar').then(rect => {
86
82
  if (!isDef(rect)) {
87
83
  return;
88
84
  }
@@ -93,7 +89,7 @@ SmartComponent({
93
89
  });
94
90
  },
95
91
  setSiderbarRect() {
96
- return getRect(this, '.smart-index-bar__sidebar').then((res) => {
92
+ return getRect(this, '.smart-index-bar__sidebar').then(res => {
97
93
  if (!isDef(res)) {
98
94
  return;
99
95
  }
@@ -105,7 +101,7 @@ SmartComponent({
105
101
  },
106
102
  setDiffData({ target, data }) {
107
103
  const diffData = {};
108
- Object.keys(data).forEach((key) => {
104
+ Object.keys(data).forEach(key => {
109
105
  if (target.data[key] !== data[key]) {
110
106
  diffData[key] = data[key];
111
107
  }
@@ -115,7 +111,7 @@ SmartComponent({
115
111
  }
116
112
  },
117
113
  getAnchorRect(anchor) {
118
- return getRect(anchor, '.smart-index-anchor-wrapper').then((rect) => ({
114
+ return getRect(anchor, '.smart-index-anchor-wrapper').then(rect => ({
119
115
  height: rect.height,
120
116
  top: rect.top,
121
117
  }));
@@ -148,8 +144,7 @@ SmartComponent({
148
144
  if (sticky) {
149
145
  let isActiveAnchorSticky = false;
150
146
  if (active !== -1) {
151
- isActiveAnchorSticky =
152
- children[active].top <= stickyOffsetTop + scrollTop;
147
+ isActiveAnchorSticky = children[active].top <= stickyOffsetTop + scrollTop;
153
148
  }
154
149
  children.forEach((item, index) => {
155
150
  if (index === active) {
@@ -180,9 +175,7 @@ SmartComponent({
180
175
  else if (index === active - 1) {
181
176
  const currentAnchor = children[index];
182
177
  const currentOffsetTop = currentAnchor.top;
183
- const targetOffsetTop = index === children.length - 1
184
- ? this.top
185
- : children[index + 1].top;
178
+ const targetOffsetTop = index === children.length - 1 ? this.top : children[index + 1].top;
186
179
  const parentOffsetHeight = targetOffsetTop - currentOffsetTop;
187
180
  const translateY = parentOffsetHeight - currentAnchor.height;
188
181
  const anchorStyle = `
@@ -236,7 +229,7 @@ SmartComponent({
236
229
  return;
237
230
  }
238
231
  this.scrollToAnchorIndex = index;
239
- const anchor = this.children.find((item) => item.data.index === this.data.indexList[index]);
232
+ const anchor = this.children.find(item => item.data.index === this.data.indexList[index]);
240
233
  if (anchor) {
241
234
  anchor.scrollIntoView(this.scrollTop);
242
235
  this.$emit('select', anchor.data.index);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {},
4
+ });
@@ -1,7 +1,10 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  SmartComponent({
3
3
  props: {
4
- color: String,
4
+ color: {
5
+ type: String,
6
+ value: '#1989FA'
7
+ },
5
8
  vertical: Boolean,
6
9
  type: {
7
10
  type: String,
@@ -13,4 +16,25 @@ SmartComponent({
13
16
  },
14
17
  textSize: String,
15
18
  },
19
+ data: {
20
+ spinner: '',
21
+ circular: ''
22
+ },
23
+ created() {
24
+ this.setData({
25
+ spinner: this.SpinnerLoading({ color: this.data.color }),
26
+ circular: this.CircularLoading({ color: this.data.color })
27
+ });
28
+ },
29
+ methods: {
30
+ createSvgIcon(svg) {
31
+ return `data:image/svg+xml,${encodeURIComponent(`<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">${svg}`)}`;
32
+ },
33
+ CircularLoading({ color = '#1989FA' }) {
34
+ return this.createSvgIcon(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_452_31565"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath><linearGradient x1="0.5" y1="0.5" x2="0.5" y2="0.8999999761581421" id="master_svg1_452_31641"><stop offset="0%" stop-color="${color}" stop-opacity="1"/><stop offset="100%" stop-color="${color}" stop-opacity="0"/></linearGradient></defs><g clip-path="url(#master_svg0_452_31565)"><g style="opacity:0.20000000298023224;"><path d="M12,18.4C15.5346,18.4,18.4,15.5346,18.4,12C18.4,8.46538,15.5346,5.6,12,5.6C8.46538,5.6,5.6,8.46538,5.6,12C5.6,15.5346,8.46538,18.4,12,18.4ZM12,20C16.418300000000002,20,20,16.418300000000002,20,12C20,7.58172,16.418300000000002,4,12,4C7.58172,4,4,7.58172,4,12C4,16.418300000000002,7.58172,20,12,20Z" fill-rule="evenodd" fill="${color}" fill-opacity="1"/></g><g><path d="M12,5.6C8.46538,5.6,5.6,8.46538,5.6,12C5.6,15.5346,8.46538,18.4,12,18.4C12.44183,18.4,12.8,18.758200000000002,12.8,19.2C12.8,19.6418,12.44183,20,12,20C7.58172,20,4,16.418300000000002,4,12C4,7.58172,7.58172,4,12,4C16.418300000000002,4,20,7.58172,20,12C20,12.44183,19.6418,12.8,19.2,12.8C18.758200000000002,12.8,18.4,12.44183,18.4,12C18.4,8.46538,15.5346,5.6,12,5.6Z" fill-rule="evenodd" fill="url(#master_svg1_452_31641)" fill-opacity="1"/></g></g></svg>`);
35
+ },
36
+ SpinnerLoading({ color = '#3678E3' }) {
37
+ return this.createSvgIcon(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="8px" height="8px" viewBox="0 0 20.333251953125 21.333251953125"><g><g><path d="M17.5413973046875,16.023418836669922L15.6560673046875,14.138091836669922C15.1360673046875,13.618087836669922,14.2933963046875,13.618087836669922,13.7707393046875,14.138091836669922C13.2507363046875,14.658095836669922,13.2507363046875,15.503418836669923,13.7707393046875,16.023418836669922L15.6560673046875,17.908748836669922C16.1760673046875,18.42875883666992,17.0213873046875,18.42875883666992,17.5413973046875,17.908748836669922C18.0613973046875,17.388748836669922,18.0613973046875,16.54342883666992,17.5413973046875,16.023418836669922Z" fill-rule="evenodd" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.699999988079071;"><path d="M9,3.99994C9,4.7359,9.597301,5.33326,10.33332,5.33326C11.06927,5.33326,11.666640000000001,4.73596,11.666640000000001,3.99994L11.666640000000001,1.33332C11.666640000000001,0.597364,11.06927,0,10.33332,0C9.597363,0,9,0.597301,9,1.33332L9,3.99994Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.6000000238418579;"><path d="M2.390002,3.389983926513672C1.869999,3.909987926513672,1.869999,4.755310926513672,2.390002,5.275310926513672L4.27533,7.160640926513672C4.79533,7.680650926513672,5.638,7.680650926513672,6.16066,7.160640926513672C6.68066,6.640640926513672,6.68066,5.795320926513671,6.16066,5.275310926513672L4.27533,3.389983926513672C3.75533,2.869979926513672,2.910006,2.869979926513672,2.390002,3.389983926513672Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(-1,0,0,1,37.101318359375,0)" style="opacity:0.800000011920929;"><path d="M18.9406611796875,3.389983926513672C18.4206581796875,3.909987926513672,18.4206581796875,4.755310926513672,18.9406611796875,5.275310926513672L20.8259891796875,7.160640926513672C21.3459891796875,7.680650926513672,22.188659179687498,7.680650926513672,22.7113191796875,7.160640926513672C23.2313191796875,6.640640926513672,23.2313191796875,5.795320926513671,22.7113191796875,5.275310926513672L20.8259891796875,3.389983926513672C20.3059891796875,2.869979926513672,19.4606651796875,2.869979926513672,18.9406611796875,3.389983926513672Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.5;"><path d="M0,10.666644432373047C0,11.402604432373046,0.5973,11.999964432373048,1.33332,11.999964432373048L3.99994,11.999964432373048C4.73589,11.999964432373048,5.33325,11.402664432373047,5.33325,10.666644432373047C5.33325,9.930688432373048,4.73595,9.333324432373047,3.99994,9.333324432373047L1.33332,9.333324432373047C0.597364,9.333324432373047,0,9.930688432373048,0,10.666644432373047Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.8999999761581421;"><path d="M15,10.666644432373047C15,11.402604432373046,15.5973,11.999964432373048,16.33332,11.999964432373048L18.99994,11.999964432373048C19.73589,11.999964432373048,20.33325,11.402664432373047,20.33325,10.666644432373047C20.33325,9.930688432373048,19.73595,9.333324432373047,18.99994,9.333324432373047L16.33332,9.333324432373047C15.597364,9.333324432373047,15,9.930688432373048,15,10.666644432373047Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.4000000059604645;"><path d="M2.45866655078125,16.023418836669922C1.93866355078125,16.54342883666992,1.93866355078125,17.388748836669922,2.45866655078125,17.908748836669922C2.97867055078125,18.42875883666992,3.82399455078125,18.42875883666992,4.34399455078125,17.908748836669922L6.22932455078125,16.023418836669922C6.74932455078125,15.503418836669923,6.74932455078125,14.658095836669922,6.22932455078125,14.138091836669922C5.70931455078125,13.618087836669922,4.86399455078125,13.618087836669922,4.34399455078125,14.138091836669922L2.45866655078125,16.023418836669922Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.20000000298023224;"><path d="M9,17.33332L9,19.99994C9,20.7359,9.597301,21.33326,10.33332,21.33326C11.06927,21.33326,11.666640000000001,20.73596,11.666640000000001,19.99994L11.666640000000001,17.33332C11.666640000000001,16.597364,11.06927,16,10.33332,16C9.597363,16,9,16.597301,9,17.33332Z" fill="${color}" fill-opacity="1"/></g></g></svg>`);
38
+ }
39
+ }
16
40
  });
@@ -4,11 +4,11 @@
4
4
  <view class="custom-class {{ utils.bem('loading', { vertical }) }}">
5
5
  <view
6
6
  class="smart-loading__spinner smart-loading__spinner--{{ type }}"
7
- style="{{ computed.loadingStyle({ size, type, color }) }}"
7
+ style="{{ computed.loadingStyle({ size, type, color, spinner, circular }) }}"
8
8
  >
9
9
  <view
10
10
  class="smart-switch__loading"
11
- style="{{ computed.loadingStyle({ size, type, color }) }}"
11
+ style="{{ computed.loadingStyle({ size, type, color, spinner, circular }) }}"
12
12
  />
13
13
  </view>
14
14
  <view class="smart-loading__text" style="{{ computed.textStyle({ textSize, color }) }}">
@@ -11,37 +11,22 @@ function textStyle(data) {
11
11
  return ret;
12
12
  }
13
13
 
14
- const createSvgIcon = (svg) =>
15
- `data:image/svg+xml,${encodeURIComponent(
16
- `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">${svg}`
17
- )}`;
18
-
19
- const CircularLoading = ({ color }) =>
20
- createSvgIcon(
21
- `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_452_31565"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath><linearGradient x1="0.5" y1="0.5" x2="0.5" y2="0.8999999761581421" id="master_svg1_452_31641"><stop offset="0%" stop-color="${color}" stop-opacity="1"/><stop offset="100%" stop-color="${color}" stop-opacity="0"/></linearGradient></defs><g clip-path="url(#master_svg0_452_31565)"><g style="opacity:0.20000000298023224;"><path d="M12,18.4C15.5346,18.4,18.4,15.5346,18.4,12C18.4,8.46538,15.5346,5.6,12,5.6C8.46538,5.6,5.6,8.46538,5.6,12C5.6,15.5346,8.46538,18.4,12,18.4ZM12,20C16.418300000000002,20,20,16.418300000000002,20,12C20,7.58172,16.418300000000002,4,12,4C7.58172,4,4,7.58172,4,12C4,16.418300000000002,7.58172,20,12,20Z" fill-rule="evenodd" fill="${color}" fill-opacity="1"/></g><g><path d="M12,5.6C8.46538,5.6,5.6,8.46538,5.6,12C5.6,15.5346,8.46538,18.4,12,18.4C12.44183,18.4,12.8,18.758200000000002,12.8,19.2C12.8,19.6418,12.44183,20,12,20C7.58172,20,4,16.418300000000002,4,12C4,7.58172,7.58172,4,12,4C16.418300000000002,4,20,7.58172,20,12C20,12.44183,19.6418,12.8,19.2,12.8C18.758200000000002,12.8,18.4,12.44183,18.4,12C18.4,8.46538,15.5346,5.6,12,5.6Z" fill-rule="evenodd" fill="url(#master_svg1_452_31641)" fill-opacity="1"/></g></g></svg>`
22
- );
23
-
24
- const SpinnerLoading = ({ color }) =>
25
- createSvgIcon(
26
- `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="32" height="32" viewBox="0 0 32 32"><g><g><g></g><g><g><path d="M23.5413973046875,21.023418836669922L21.6560673046875,19.138091836669922C21.1360673046875,18.618087836669922,20.2933963046875,18.618087836669922,19.7707393046875,19.138091836669922C19.2507363046875,19.658095836669922,19.2507363046875,20.503418836669923,19.7707393046875,21.023418836669922L21.6560673046875,22.908748836669922C22.1760673046875,23.42875883666992,23.0213873046875,23.42875883666992,23.5413973046875,22.908748836669922C24.0613973046875,22.388748836669922,24.0613973046875,21.54342883666992,23.5413973046875,21.023418836669922Z" fill-rule="evenodd" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.699999988079071;"><path d="M15,6.3333200000000005L15,8.99994C15,9.7359,15.597301,10.33326,16.33332,10.33326C17.06927,10.33326,17.66664,9.73596,17.66664,8.99994L17.66664,6.3333200000000005C17.66664,5.597364,17.06927,5,16.33332,5C15.597363,5,15,5.597301,15,6.3333200000000005Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.6000000238418579;"><path d="M8.390002,8.389983926513672C7.869999,8.909987926513672,7.869999,9.755310926513673,8.390002,10.275310926513672L10.27533,12.160640926513672C10.79533,12.680650926513671,11.638,12.680650926513671,12.16066,12.160640926513672C12.68066,11.640640926513672,12.68066,10.795320926513671,12.16066,10.275310926513672L10.27533,8.389983926513672C9.75533,7.869979926513672,8.910006,7.869979926513672,8.390002,8.389983926513672Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(-1,0,0,1,49.101318359375,0)" style="opacity:0.800000011920929;"><path d="M24.9406611796875,8.389983926513672C24.4206581796875,8.909987926513672,24.4206581796875,9.755310926513673,24.9406611796875,10.275310926513672L26.8259891796875,12.160640926513672C27.3459891796875,12.680650926513671,28.188659179687498,12.680650926513671,28.7113191796875,12.160640926513672C29.2313191796875,11.640640926513672,29.2313191796875,10.795320926513671,28.7113191796875,10.275310926513672L26.8259891796875,8.389983926513672C26.3059891796875,7.869979926513672,25.4606651796875,7.869979926513672,24.9406611796875,8.389983926513672Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.5;"><path d="M6,15.666644432373047C6,16.402604432373046,6.5973,16.999964432373048,7.3333200000000005,16.999964432373048L9.99994,16.999964432373048C10.735890000000001,16.999964432373048,11.33325,16.402664432373047,11.33325,15.666644432373047C11.33325,14.930688432373048,10.735949999999999,14.333324432373047,9.99994,14.333324432373047L7.3333200000000005,14.333324432373047C6.597364,14.333324432373047,6,14.930688432373048,6,15.666644432373047Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.8999999761581421;"><path d="M21,15.666644432373047C21,16.402604432373046,21.5973,16.999964432373048,22.33332,16.999964432373048L24.99994,16.999964432373048C25.73589,16.999964432373048,26.33325,16.402664432373047,26.33325,15.666644432373047C26.33325,14.930688432373048,25.73595,14.333324432373047,24.99994,14.333324432373047L22.33332,14.333324432373047C21.597364,14.333324432373047,21,14.930688432373048,21,15.666644432373047Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.4000000059604645;"><path d="M8.45866655078125,21.023418836669922C7.93866355078125,21.54342883666992,7.93866355078125,22.388748836669922,8.45866655078125,22.908748836669922C8.97867055078125,23.42875883666992,9.82399455078125,23.42875883666992,10.34399455078125,22.908748836669922L12.22932455078125,21.023418836669922C12.74932455078125,20.503418836669923,12.74932455078125,19.658095836669922,12.22932455078125,19.138091836669922C11.70931455078125,18.618087836669922,10.86399455078125,18.618087836669922,10.34399455078125,19.138091836669922L8.45866655078125,21.023418836669922Z" fill="${color}" fill-opacity="1"/></g><g style="opacity:0.20000000298023224;"><path d="M15,22.33332L15,24.99994C15,25.7359,15.597301,26.33326,16.33332,26.33326C17.06927,26.33326,17.66664,25.73596,17.66664,24.99994L17.66664,22.33332C17.66664,21.597364,17.06927,21,16.33332,21C15.597363,21,15,21.597301,15,22.33332Z" fill="${color}" fill-opacity="1"/></g></g></g></g></svg>`
27
- );
28
-
29
14
  function loadingStyle(data) {
30
- let iconSrc = '';
15
+ let iconSrc = ''
31
16
 
32
17
  if (data.type === 'spinner') {
33
- iconSrc = SpinnerLoading({ color: data.color || '#1989FA' });
18
+ iconSrc = data.spinner
34
19
  }
35
20
 
36
21
  if (data.type === 'circular') {
37
- iconSrc = CircularLoading({ color: data.color || '#3678E3' });
22
+ iconSrc = data.circular
38
23
  }
39
24
 
40
- const ret = style({
41
- 'background-image': `url('${iconSrc}')`,
25
+ var ret = style({
26
+ 'background-image': "url('".concat(iconSrc, "')"),
42
27
  width: addUnit(data.size),
43
28
  height: addUnit(data.size),
44
- 'background-size': addUnit(data.size),
29
+ 'background-size': addUnit(data.size)
45
30
  });
46
31
 
47
32
  return ret;
@@ -5,13 +5,13 @@ export const basic = Behavior({
5
5
  },
6
6
  set(data) {
7
7
  this.setData(data);
8
- return new Promise((resolve) => wx.nextTick(resolve));
8
+ return new Promise(resolve => wx.nextTick(resolve));
9
9
  },
10
10
  // high performance setData
11
11
  setView(data, callback) {
12
12
  const target = {};
13
13
  let hasChange = false;
14
- Object.keys(data).forEach((key) => {
14
+ Object.keys(data).forEach(key => {
15
15
  if (data[key] !== this.data[key]) {
16
16
  target[key] = data[key];
17
17
  hasChange = true;
@@ -10,8 +10,7 @@ export const link = Behavior({
10
10
  jumpLink(urlKey = 'url') {
11
11
  const url = this.data[urlKey];
12
12
  if (url) {
13
- if (this.data.linkType === 'navigateTo' &&
14
- getCurrentPages().length > 9) {
13
+ if (this.data.linkType === 'navigateTo' && getCurrentPages().length > 9) {
15
14
  wx.redirectTo({ url });
16
15
  }
17
16
  else {
@@ -32,7 +32,7 @@ export function pageScrollMixin(scroller) {
32
32
  return;
33
33
  }
34
34
  const { smartPageScroller } = page;
35
- const index = smartPageScroller.findIndex((v) => v === this._scroller);
35
+ const index = smartPageScroller.findIndex(v => v === this._scroller);
36
36
  if (index > -1) {
37
37
  page.smartPageScroller.splice(index, 1);
38
38
  }
@@ -30,8 +30,7 @@ export const touch = Behavior({
30
30
  this.deltaY = touch.clientY - this.startY;
31
31
  this.offsetX = Math.abs(this.deltaX);
32
32
  this.offsetY = Math.abs(this.deltaY);
33
- this.direction =
34
- this.direction || getDirection(this.offsetX, this.offsetY);
33
+ this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
35
34
  },
36
35
  },
37
36
  });
@@ -47,7 +47,7 @@ export function transition(showDefaultValue) {
47
47
  enter() {
48
48
  if (this.enterFinishedPromise)
49
49
  return;
50
- this.enterFinishedPromise = new Promise((resolve) => {
50
+ this.enterFinishedPromise = new Promise(resolve => {
51
51
  const { duration, name } = this.data;
52
52
  const classNames = getClassNames(name);
53
53
  const currentDuration = isObj(duration) ? duration.enter : duration;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ import iconPlus from '@tuya-miniapp/icons/dist/svg/Plus';
2
+ import iconHouse from '@tuya-miniapp/icons/dist/svg/House';
3
+ import { SmartComponent } from '../../common/component';
4
+ SmartComponent({
5
+ data: {
6
+ iconPlus,
7
+ iconHouse,
8
+ },
9
+ methods: {
10
+ onClickLeft() {
11
+ wx.showToast({ title: I18n.t('clickToReturn'), icon: 'none' });
12
+ },
13
+ onClickLeftIcon() {
14
+ wx.showToast({ title: I18n.t('clickToLeftIcon'), icon: 'none' });
15
+ },
16
+ onClickLeftText() {
17
+ wx.showToast({ title: I18n.t('clickToLeftText'), icon: 'none' });
18
+ },
19
+ onClickTitle() {
20
+ wx.showToast({ title: I18n.t('clickToTitle'), icon: 'none' });
21
+ },
22
+ onClickRight() {
23
+ wx.showToast({ title: I18n.t('clickToRight'), icon: 'none' });
24
+ },
25
+ },
26
+ });
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{background-color:#f2f3f5}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__arrow+.smart-nav-bar__text{margin-left:-20px;padding-left:25px}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon-wrap>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;font-size:var(--font-size-md,14px);position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
1
+ @import '../common/index.css';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{background-color:#f2f3f5}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;font-size:var(--font-size-md,14px);position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
@@ -74,7 +74,7 @@ SmartComponent({
74
74
  return;
75
75
  }
76
76
  wx.nextTick(() => {
77
- getRect(this, '.smart-nav-bar').then((res) => {
77
+ getRect(this, '.smart-nav-bar').then(res => {
78
78
  if (res && 'height' in res) {
79
79
  this.setData({ height: res.height });
80
80
  }
@@ -23,7 +23,7 @@
23
23
  class="smart-nav-bar__icon-wrap"
24
24
  catch:tap="onClickLeftIcon"
25
25
  >
26
- <smart-icon class="left-icon-class" size="{{ leftIconSize }}" name="{{ leftIcon }}" />
26
+ <smart-icon class="left-icon-class" custom-class="smart-nav-bar__icon" size="{{ leftIconSize }}" name="{{ leftIcon }}" />
27
27
  </view>
28
28
  <view
29
29
  wx:if="{{ leftText }}"
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{background-color:#f2f3f5}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__arrow+.smart-nav-bar__text{margin-left:-20px;padding-left:25px}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon-wrap>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;font-size:var(--font-size-md,14px);position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
1
+ @import '../common/index.wxss';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{background-color:#f2f3f5}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;font-size:var(--font-size-md,14px);position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ currentValue: 50,
5
+ range: [10, 40],
6
+ },
7
+ methods: {
8
+ onChange(event) {
9
+ this.setData({
10
+ currentValue: event.detail.value,
11
+ });
12
+ },
13
+ onRangeChange(event) {
14
+ this.setData({
15
+ range: event.detail,
16
+ });
17
+ },
18
+ },
19
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ import Warning from '@tuya-miniapp/icons/dist/svg/Warning';
3
+ import SpeakerWaveLoud from '@tuya-miniapp/icons/dist/svg/SpeakerWaveLoud';
4
+ SmartComponent({
5
+ data: {
6
+ Warning,
7
+ SpeakerWaveLoud,
8
+ text: I18n.t('noticebartip'),
9
+ shortText: I18n.t('noticebartip2'),
10
+ },
11
+ });
@@ -25,7 +25,7 @@ SmartComponent({
25
25
  },
26
26
  type: {
27
27
  type: String,
28
- value: 'info'
28
+ value: 'info',
29
29
  },
30
30
  url: {
31
31
  type: String,
@@ -100,7 +100,7 @@ SmartComponent({
100
100
  Promise.all([
101
101
  getRect(this, '.smart-notice-bar__content'),
102
102
  getRect(this, '.smart-notice-bar__wrap'),
103
- ]).then((rects) => {
103
+ ]).then(rects => {
104
104
  const [contentRect, wrapRect] = rects;
105
105
  const { speed, scrollable, delay } = this.data;
106
106
  if (contentRect == null ||
@@ -136,10 +136,7 @@ SmartComponent({
136
136
  });
137
137
  requestAnimationFrame(() => {
138
138
  this.setData({
139
- animationData: this.animation
140
- .translateX(-this.contentWidth)
141
- .step()
142
- .export(),
139
+ animationData: this.animation.translateX(-this.contentWidth).step().export(),
143
140
  });
144
141
  });
145
142
  this.timer = setTimeout(() => {
@@ -3,11 +3,7 @@
3
3
 
4
4
  <view
5
5
  wx:if="{{ show }}"
6
- class="custom-class {{ utils.bem('notice-bar', {
7
- wrapable,
8
- warning: type === 'warning',
9
- error: type === 'error'
10
- }) }}"
6
+ class="custom-class {{ utils.bem('notice-bar', { wrapable, warning: type === 'warning', error: type === 'error' }) }}"
11
7
  hover-class="{{ mode === 'link' ? 'smart-notice-bar--hover' : ''}} {{ customHoverClass }}"
12
8
  style="{{ computed.rootStyle([{ color, background }, customStyle]) }}"
13
9
  bind:tap="onClick"
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ import Notify from '../../notify/notify';
3
+ SmartComponent({
4
+ methods: {
5
+ showNotify() {
6
+ Notify({
7
+ context: this,
8
+ message: I18n.t('notificationContent'),
9
+ duration: 0,
10
+ transition: 'fade',
11
+ });
12
+ },
13
+ showCustomColor() {
14
+ Notify({
15
+ context: this,
16
+ message: I18n.t('customColor'),
17
+ color: '#ad0000',
18
+ background: '#ffe1e1',
19
+ });
20
+ Notify.clear();
21
+ },
22
+ showCustomDuration() {
23
+ Notify({
24
+ context: this,
25
+ duration: 1000,
26
+ message: I18n.t('customDuration'),
27
+ });
28
+ },
29
+ showNotifyByType(event) {
30
+ const { type } = event.currentTarget.dataset;
31
+ Notify({
32
+ type,
33
+ context: this,
34
+ message: I18n.t('notificationContent'),
35
+ });
36
+ },
37
+ showSafe() {
38
+ Notify({
39
+ context: this,
40
+ message: I18n.t('notificationContent'),
41
+ safeAreaInsetTop: true,
42
+ });
43
+ },
44
+ },
45
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ show: false,
5
+ showEmbedded: false,
6
+ },
7
+ methods: {
8
+ onClickShow() {
9
+ this.setData({ show: true });
10
+ },
11
+ onClickHide() {
12
+ this.setData({ show: false });
13
+ },
14
+ onClickShowEmbedded() {
15
+ this.setData({ showEmbedded: true });
16
+ },
17
+ onClickHideEmbedded() {
18
+ this.setData({ showEmbedded: false });
19
+ },
20
+ noop() { },
21
+ },
22
+ });
@@ -0,0 +1 @@
1
+ export {};