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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. package/dist/bottom-sheet/index.css +1 -0
  2. package/dist/bottom-sheet/index.d.ts +1 -0
  3. package/dist/bottom-sheet/index.js +70 -0
  4. package/dist/bottom-sheet/index.json +8 -0
  5. package/dist/bottom-sheet/index.wxml +26 -0
  6. package/dist/bottom-sheet/index.wxss +1 -0
  7. package/dist/button/index.js +1 -0
  8. package/dist/button/index.wxml +1 -1
  9. package/dist/calendar/calendar.wxml +53 -52
  10. package/dist/calendar/components/header/index.css +1 -1
  11. package/dist/calendar/components/header/index.js +18 -0
  12. package/dist/calendar/components/header/index.json +4 -1
  13. package/dist/calendar/components/header/index.wxml +15 -4
  14. package/dist/calendar/components/header/index.wxss +1 -1
  15. package/dist/calendar/components/month/index.css +1 -1
  16. package/dist/calendar/components/month/index.js +7 -2
  17. package/dist/calendar/components/month/index.wxml +0 -13
  18. package/dist/calendar/components/month/index.wxs +13 -7
  19. package/dist/calendar/components/month/index.wxss +1 -1
  20. package/dist/calendar/components/month-list/index.css +1 -0
  21. package/dist/calendar/components/month-list/index.d.ts +1 -0
  22. package/dist/calendar/components/month-list/index.js +112 -0
  23. package/dist/calendar/components/month-list/index.json +7 -0
  24. package/dist/calendar/components/month-list/index.wxml +9 -0
  25. package/dist/calendar/components/month-list/index.wxss +1 -0
  26. package/dist/calendar/components/year-list/index.css +1 -0
  27. package/dist/calendar/components/year-list/index.d.ts +1 -0
  28. package/dist/calendar/components/year-list/index.js +100 -0
  29. package/dist/calendar/components/year-list/index.json +7 -0
  30. package/dist/calendar/components/year-list/index.wxml +9 -0
  31. package/dist/calendar/components/year-list/index.wxss +1 -0
  32. package/dist/calendar/index.css +1 -1
  33. package/dist/calendar/index.js +101 -42
  34. package/dist/calendar/index.json +3 -1
  35. package/dist/calendar/index.wxml +1 -1
  36. package/dist/calendar/index.wxs +20 -2
  37. package/dist/calendar/index.wxss +1 -1
  38. package/dist/calendar/utils.d.ts +7 -1
  39. package/dist/calendar/utils.js +48 -2
  40. package/dist/checkbox/index.css +1 -1
  41. package/dist/checkbox/index.js +1 -1
  42. package/dist/checkbox/index.wxml +2 -2
  43. package/dist/checkbox/index.wxss +1 -1
  44. package/dist/config-provider/index.wxs +2 -7
  45. package/dist/dropdown-item/index.css +1 -1
  46. package/dist/dropdown-item/index.js +10 -0
  47. package/dist/dropdown-item/index.wxml +9 -4
  48. package/dist/dropdown-item/index.wxss +1 -1
  49. package/dist/dropdown-menu/index.css +1 -1
  50. package/dist/dropdown-menu/index.js +15 -0
  51. package/dist/dropdown-menu/index.json +4 -1
  52. package/dist/dropdown-menu/index.wxml +2 -1
  53. package/dist/dropdown-menu/index.wxss +1 -1
  54. package/dist/empty/index.css +1 -1
  55. package/dist/empty/index.js +20 -1
  56. package/dist/empty/index.wxml +7 -7
  57. package/dist/empty/index.wxs +3 -16
  58. package/dist/empty/index.wxss +1 -1
  59. package/dist/field/index.css +1 -1
  60. package/dist/field/index.wxss +1 -1
  61. package/dist/loading/index.css +1 -1
  62. package/dist/loading/index.js +4 -4
  63. package/dist/loading/index.wxml +4 -6
  64. package/dist/loading/index.wxs +39 -8
  65. package/dist/loading/index.wxss +1 -1
  66. package/dist/nav-bar/index.css +1 -1
  67. package/dist/nav-bar/index.js +19 -1
  68. package/dist/nav-bar/index.wxml +16 -6
  69. package/dist/nav-bar/index.wxss +1 -1
  70. package/dist/normal-slider/index.css +1 -1
  71. package/dist/normal-slider/index.wxss +1 -1
  72. package/dist/notice-bar/index.css +1 -1
  73. package/dist/notice-bar/index.js +55 -2
  74. package/dist/notice-bar/index.wxml +28 -10
  75. package/dist/notice-bar/index.wxs +1 -5
  76. package/dist/notice-bar/index.wxss +1 -1
  77. package/dist/picker-column/index.js +8 -1
  78. package/dist/radio/index.css +1 -1
  79. package/dist/radio/index.js +1 -1
  80. package/dist/radio/index.wxml +2 -1
  81. package/dist/radio/index.wxss +1 -1
  82. package/dist/search/index.css +1 -1
  83. package/dist/search/index.js +14 -9
  84. package/dist/search/index.json +2 -1
  85. package/dist/search/index.wxml +7 -4
  86. package/dist/search/index.wxss +1 -1
  87. package/dist/switch/index.css +1 -1
  88. package/dist/switch/index.wxml +1 -0
  89. package/dist/switch/index.wxss +1 -1
  90. package/dist/tabs/index.css +1 -1
  91. package/dist/tabs/index.js +10 -7
  92. package/dist/tabs/index.wxml +1 -0
  93. package/dist/tabs/index.wxs +17 -0
  94. package/dist/tabs/index.wxss +1 -1
  95. package/dist/tag/index.css +1 -1
  96. package/dist/tag/index.wxss +1 -1
  97. package/dist/toast/icons.d.ts +3 -0
  98. package/dist/toast/icons.js +6 -0
  99. package/dist/toast/index.js +8 -4
  100. package/dist/toast/index.wxml +3 -7
  101. package/dist/toast/toast.d.ts +2 -0
  102. package/dist/toast/toast.js +2 -0
  103. package/dist/wxs/style.wxs +11 -5
  104. package/dist/wxs/utils.wxs +1 -3
  105. package/lib/bottom-sheet/index.css +1 -0
  106. package/lib/bottom-sheet/index.d.ts +1 -0
  107. package/lib/bottom-sheet/index.js +75 -0
  108. package/lib/bottom-sheet/index.json +8 -0
  109. package/lib/bottom-sheet/index.wxml +26 -0
  110. package/lib/bottom-sheet/index.wxss +1 -0
  111. package/lib/button/index.js +1 -0
  112. package/lib/button/index.wxml +1 -1
  113. package/lib/calendar/calendar.wxml +53 -52
  114. package/lib/calendar/components/header/index.css +1 -1
  115. package/lib/calendar/components/header/index.js +21 -0
  116. package/lib/calendar/components/header/index.json +4 -1
  117. package/lib/calendar/components/header/index.wxml +15 -4
  118. package/lib/calendar/components/header/index.wxss +1 -1
  119. package/lib/calendar/components/month/index.css +1 -1
  120. package/lib/calendar/components/month/index.js +7 -2
  121. package/lib/calendar/components/month/index.wxml +0 -13
  122. package/lib/calendar/components/month/index.wxs +13 -7
  123. package/lib/calendar/components/month/index.wxss +1 -1
  124. package/lib/calendar/components/month-list/index.css +1 -0
  125. package/lib/calendar/components/month-list/index.d.ts +1 -0
  126. package/lib/calendar/components/month-list/index.js +114 -0
  127. package/lib/calendar/components/month-list/index.json +7 -0
  128. package/lib/calendar/components/month-list/index.wxml +9 -0
  129. package/lib/calendar/components/month-list/index.wxss +1 -0
  130. package/lib/calendar/components/year-list/index.css +1 -0
  131. package/lib/calendar/components/year-list/index.d.ts +1 -0
  132. package/lib/calendar/components/year-list/index.js +102 -0
  133. package/lib/calendar/components/year-list/index.json +7 -0
  134. package/lib/calendar/components/year-list/index.wxml +9 -0
  135. package/lib/calendar/components/year-list/index.wxss +1 -0
  136. package/lib/calendar/index.css +1 -1
  137. package/lib/calendar/index.js +100 -43
  138. package/lib/calendar/index.json +3 -1
  139. package/lib/calendar/index.wxml +1 -1
  140. package/lib/calendar/index.wxs +20 -2
  141. package/lib/calendar/index.wxss +1 -1
  142. package/lib/calendar/utils.d.ts +7 -1
  143. package/lib/calendar/utils.js +52 -3
  144. package/lib/checkbox/index.css +1 -1
  145. package/lib/checkbox/index.js +1 -1
  146. package/lib/checkbox/index.wxml +2 -2
  147. package/lib/checkbox/index.wxss +1 -1
  148. package/lib/config-provider/index.wxs +2 -7
  149. package/lib/dropdown-item/index.css +1 -1
  150. package/lib/dropdown-item/index.js +13 -0
  151. package/lib/dropdown-item/index.wxml +9 -4
  152. package/lib/dropdown-item/index.wxss +1 -1
  153. package/lib/dropdown-menu/index.css +1 -1
  154. package/lib/dropdown-menu/index.js +18 -0
  155. package/lib/dropdown-menu/index.json +4 -1
  156. package/lib/dropdown-menu/index.wxml +2 -1
  157. package/lib/dropdown-menu/index.wxss +1 -1
  158. package/lib/empty/index.css +1 -1
  159. package/lib/empty/index.js +20 -1
  160. package/lib/empty/index.wxml +7 -7
  161. package/lib/empty/index.wxs +3 -16
  162. package/lib/empty/index.wxss +1 -1
  163. package/lib/field/index.css +1 -1
  164. package/lib/field/index.wxss +1 -1
  165. package/lib/loading/index.css +1 -1
  166. package/lib/loading/index.js +4 -4
  167. package/lib/loading/index.wxml +4 -6
  168. package/lib/loading/index.wxs +39 -8
  169. package/lib/loading/index.wxss +1 -1
  170. package/lib/nav-bar/index.css +1 -1
  171. package/lib/nav-bar/index.js +19 -1
  172. package/lib/nav-bar/index.wxml +16 -6
  173. package/lib/nav-bar/index.wxss +1 -1
  174. package/lib/normal-slider/index.css +1 -1
  175. package/lib/normal-slider/index.wxss +1 -1
  176. package/lib/notice-bar/index.css +1 -1
  177. package/lib/notice-bar/index.js +58 -2
  178. package/lib/notice-bar/index.wxml +28 -10
  179. package/lib/notice-bar/index.wxs +1 -5
  180. package/lib/notice-bar/index.wxss +1 -1
  181. package/lib/picker-column/index.js +8 -1
  182. package/lib/radio/index.css +1 -1
  183. package/lib/radio/index.js +1 -1
  184. package/lib/radio/index.wxml +2 -1
  185. package/lib/radio/index.wxss +1 -1
  186. package/lib/search/index.css +1 -1
  187. package/lib/search/index.js +17 -9
  188. package/lib/search/index.json +2 -1
  189. package/lib/search/index.wxml +7 -4
  190. package/lib/search/index.wxss +1 -1
  191. package/lib/switch/index.css +1 -1
  192. package/lib/switch/index.wxml +1 -0
  193. package/lib/switch/index.wxss +1 -1
  194. package/lib/tabs/index.css +1 -1
  195. package/lib/tabs/index.js +10 -7
  196. package/lib/tabs/index.wxml +1 -0
  197. package/lib/tabs/index.wxs +17 -0
  198. package/lib/tabs/index.wxss +1 -1
  199. package/lib/tag/index.css +1 -1
  200. package/lib/tag/index.wxss +1 -1
  201. package/lib/toast/icons.d.ts +3 -0
  202. package/lib/toast/icons.js +12 -0
  203. package/lib/toast/index.js +8 -7
  204. package/lib/toast/index.wxml +3 -7
  205. package/lib/toast/toast.d.ts +2 -0
  206. package/lib/toast/toast.js +2 -0
  207. package/lib/wxs/style.wxs +11 -5
  208. package/lib/wxs/utils.wxs +1 -3
  209. package/package.json +4 -8
  210. package/dist/common/theme/dark.d.ts +0 -344
  211. package/dist/common/theme/dark.js +0 -343
  212. package/dist/common/theme/light.d.ts +0 -344
  213. package/dist/common/theme/light.js +0 -343
  214. package/dist/wxs/is-app-theme-var.wxs +0 -8
  215. package/lib/common/theme/dark.d.ts +0 -344
  216. package/lib/common/theme/dark.js +0 -345
  217. package/lib/common/theme/light.d.ts +0 -344
  218. package/lib/common/theme/light.js +0 -345
  219. package/lib/wxs/is-app-theme-var.wxs +0 -8
@@ -1 +1 @@
1
- @import '../common/index.wxss';:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#c8c9cc);display:inline-flex;justify-content:center}.smart-loading__spinner{animation:smart-rotate var(--loading-spinner-animation-duration,.8s) linear infinite;box-sizing:border-box;height:var(--loading-spinner-size,30px);max-height:100%;max-width:100%;position:relative;width:var(--loading-spinner-size,30px)}.smart-loading__spinner--spinner{animation-timing-function:steps(12)}.smart-loading__spinner--circular{border:1px solid transparent;border-radius:100%;border-top-color:initial}.smart-loading__text{color:var(--loading-text-color,#969799);font-size:var(--loading-text-font-size,14px);line-height:var(--loading-text-line-height,20px);margin-left:var(--padding-xs,8px)}.smart-loading__text:empty{display:none}.smart-loading--vertical{flex-direction:column}.smart-loading--vertical .smart-loading__text{margin:var(--padding-xs,8px) 0 0}.smart-loading__dot{height:100%;left:0;position:absolute;top:0;width:100%}.smart-loading__dot:before{background-color:currentColor;border-radius:40%;content:" ";display:block;height:25%;margin:0 auto;width:2px}.smart-loading__dot:first-of-type{opacity:1;transform:rotate(30deg)}.smart-loading__dot:nth-of-type(2){opacity:.9375;transform:rotate(60deg)}.smart-loading__dot:nth-of-type(3){opacity:.875;transform:rotate(90deg)}.smart-loading__dot:nth-of-type(4){opacity:.8125;transform:rotate(120deg)}.smart-loading__dot:nth-of-type(5){opacity:.75;transform:rotate(150deg)}.smart-loading__dot:nth-of-type(6){opacity:.6875;transform:rotate(180deg)}.smart-loading__dot:nth-of-type(7){opacity:.625;transform:rotate(210deg)}.smart-loading__dot:nth-of-type(8){opacity:.5625;transform:rotate(240deg)}.smart-loading__dot:nth-of-type(9){opacity:.5;transform:rotate(270deg)}.smart-loading__dot:nth-of-type(10){opacity:.4375;transform:rotate(300deg)}.smart-loading__dot:nth-of-type(11){opacity:.375;transform:rotate(330deg)}.smart-loading__dot:nth-of-type(12){opacity:.3125;transform:rotate(1turn)}@keyframes smart-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
1
+ @import '../common/index.wxss';:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#c8c9cc);display:inline-flex;justify-content:center}.smart-loading__spinner{animation:smart-rotate var(--loading-spinner-animation-duration,.8s) linear infinite;box-sizing:border-box;height:var(--loading-spinner-size,30px);max-height:100%;max-width:100%;position:relative;width:var(--loading-spinner-size,30px)}.smart-loading__spinner--spinner{animation-timing-function:steps(12)}.smart-loading__text{color:var(--loading-text-color,#969799);font-size:var(--loading-text-font-size,14px);line-height:var(--loading-text-line-height,20px);margin-left:var(--padding-xs,8px)}.smart-loading__text:empty{display:none}.smart-loading--vertical{flex-direction:column}.smart-loading--vertical .smart-loading__text{margin:var(--padding-xs,8px) 0 0}@keyframes smart-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
@@ -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-B6-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__arrow{color:var(--nav-bar-icon-color,var(--app-B6-N1,#000))!important;font-size:var(--nav-bar-arrow-size,16px)!important;vertical-align:middle}.smart-nav-bar__arrow+.smart-nav-bar__text{margin-left:-20px;padding-left:25px}.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-B6-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--font-weight-bold,500);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__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)}
@@ -7,7 +7,7 @@ var Left_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Left"));
7
7
  var component_1 = require("../common/component");
8
8
  var utils_1 = require("../common/utils");
9
9
  (0, component_1.SmartComponent)({
10
- classes: ['title-class'],
10
+ classes: ['title-class', 'left-icon-class'],
11
11
  props: {
12
12
  title: String,
13
13
  fixed: {
@@ -18,7 +18,16 @@ var utils_1 = require("../common/utils");
18
18
  type: Boolean,
19
19
  observer: 'setHeight',
20
20
  },
21
+ leftTextType: {
22
+ type: String,
23
+ value: 'back',
24
+ },
21
25
  leftText: String,
26
+ leftIcon: String,
27
+ leftIconSize: {
28
+ type: null,
29
+ value: 32,
30
+ },
22
31
  rightText: String,
23
32
  customStyle: String,
24
33
  leftArrow: Boolean,
@@ -56,6 +65,15 @@ var utils_1 = require("../common/utils");
56
65
  onClickRight: function () {
57
66
  this.$emit('click-right');
58
67
  },
68
+ onClickTitle: function () {
69
+ this.$emit('click-title');
70
+ },
71
+ onClickLeftIcon: function () {
72
+ this.$emit('click-left-icon');
73
+ },
74
+ onClickLeftText: function () {
75
+ this.$emit('click-left-text');
76
+ },
59
77
  setHeight: function () {
60
78
  var _this = this;
61
79
  if (!this.data.fixed || !this.data.placeholder) {
@@ -9,23 +9,33 @@
9
9
  >
10
10
  <view class="smart-nav-bar__content">
11
11
  <view class="smart-nav-bar__left" bind:tap="onClickLeft">
12
- <block wx:if="{{ leftArrow || leftText }}">
12
+ <block wx:if="{{ leftArrow || leftText || leftIcon }}">
13
13
  <smart-icon
14
14
  wx:if="{{ leftArrow }}"
15
- size="16px"
16
- name="{{ leftArrowIcon }}"
15
+ size="32px"
16
+ name="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBmaWxsPSJub25lIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48Y2xpcFBhdGggaWQ9Im1hc3Rlcl9zdmcwXzQ1Ml8yODM5NC8wXzgwODgiPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgcng9IjAiLz48L2NsaXBQYXRoPjwvZGVmcz48ZyBjbGlwLXBhdGg9InVybCgjbWFzdGVyX3N2ZzBfNDUyXzI4Mzk0LzBfODA4OCkiPjxnIHN0eWxlPSJvcGFjaXR5OjAuNjk5OTk5OTg4MDc5MDcxOyI+PHBhdGggZD0iTTYuMDkxOTYsMTYuNDk5ODJDNi4wOTE5NiwxNi40OTk4MiwxMy4zMjA4MSwyMy41Mzk3LDEzLjMyMDgxLDIzLjUzOTdDMTMuNDgzOCwyMy43MTU3LDEzLjU2NDgsMjMuOTE5NywxMy41NjQ4LDI0LjE0OTdDMTMuNTY0OCwyNC4zNzk3LDEzLjQ3ODgsMjQuNTc5NiwxMy4zMDY4MSwyNC43NDc2QzEzLjIyNzEyLDI0LjgyODUsMTMuMTMxOTUsMjQuODkyNiwxMy4wMjY5NywyNC45MzU5QzEyLjkyMiwyNC45NzkyLDEyLjgwOTM3LDI1LjAwMDgsMTIuNjk1ODIsMjQuOTk5NkMxMi40NjQ3MywyNS4wMDExLDEyLjI0MTU4LDI0LjkxNTQsMTIuMDcwODMsMjQuNzU5NkMxMi4wNzA4MywyNC43NTk2LDQuMjQ0OTk4LDE3LjEwOTgxLDQuMjQ0OTk4LDE3LjEwOTgxQzQuMDg3MjQ2NCwxNi45NDU5OTAwMDAwMDAwMDIsMy45OTkzODg5MzUsMTYuNzI3MjQwMDAwMDAwMDAyLDQuMDAwMDAzMTk5NDMsMTYuNDk5ODJDNC4wMDAwMDMxOTk0MywxNi4yNjk4Myw0LjA4MjAwMTUsMTYuMDY1ODMsNC4yNDQ5OTgsMTUuODg5ODNDNC4yNDQ5OTgsMTUuODg5ODMsMTIuMDY5ODMsOC4yMzk5OTUsMTIuMDY5ODMsOC4yMzk5OTVDMTIuMjQ5ODMsOC4wNzk5OTgzLDEyLjQ1OTgyLDgsMTIuNjk0ODIsOEMxMi45Mjk4MSw4LDEzLjEzMzgxLDguMDgzOTk4MiwxMy4zMDU4MSw4LjI1MTk5NUMxMy4zODc5NSw4LjMyODMxMywxMy40NTMzMSw4LjQyMDg5MiwxMy40OTc3Miw4LjUyMzg0M0MxMy41NDIxNCw4LjYyNjc5NCwxMy41NjQ2NCw4LjczNzg2MiwxMy41NjM4LDguODQ5OTgyQzEzLjU2MzgsOS4wNzk5Nzk5OTk5OTk5OTksMTMuNDgyOCw5LjI4Mzk3LDEzLjMxOTgxLDkuNDU5OTdDMTMuMzE5ODEsOS40NTk5Nyw2LjA5MTk2LDE2LjQ5OTgyLDYuMDkxOTYsMTYuNDk5ODJaIiBmaWxsPSIjMDAwMDAwIiBmaWxsLW9wYWNpdHk9IjAuODk5OTk5OTc2MTU4MTQyMSIvPjwvZz48L2c+PC9zdmc+"
17
+ data-type="leftArrow"
17
18
  custom-class="smart-nav-bar__arrow"
18
19
  />
20
+ <view
21
+ wx:if="{{ leftIcon }}"
22
+ data-type="leftIcon"
23
+ class="smart-nav-bar__icon-wrap"
24
+ catch:tap="onClickLeftIcon"
25
+ >
26
+ <smart-icon class="left-icon-class" size="{{ leftIconSize }}" name="{{ leftIcon }}" />
27
+ </view>
19
28
  <view
20
29
  wx:if="{{ leftText }}"
21
- class="smart-nav-bar__text"
22
- hover-class="smart-nav-bar__text--hover"
30
+ class="{{ utils.bem('nav-bar__text', { home: leftTextType === 'home', title: leftTextType === 'title' }) }}"
31
+ catch:tap="onClickLeftText"
32
+ hover-class="{{ leftTextType === 'back' ? 'smart-nav-bar__text--hover' : '' }}"
23
33
  hover-stay-time="70"
24
34
  >{{ leftText }}</view>
25
35
  </block>
26
36
  <slot wx:else name="left" />
27
37
  </view>
28
- <view class="smart-nav-bar__title title-class smart-ellipsis">
38
+ <view class="smart-nav-bar__title title-class smart-ellipsis" bind:tap="onClickTitle">
29
39
  <block wx:if="{{ title }}">{{ title }}</block>
30
40
 
31
41
  <slot wx:else name="title" />
@@ -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-B6-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__arrow{color:var(--nav-bar-icon-color,var(--app-B6-N1,#000))!important;font-size:var(--nav-bar-arrow-size,16px)!important;vertical-align:middle}.smart-nav-bar__arrow+.smart-nav-bar__text{margin-left:-20px;padding-left:25px}.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-B6-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--font-weight-bold,500);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__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 +1 @@
1
- @import '../common/index.css';.contain{--thumb-active-color:var(var(--app-B3,#fff),#fff)}
1
+ @import '../common/index.css';.contain{--thumb-active-color:var(--app-B3,#fff)}
@@ -1 +1 @@
1
- @import '../common/index.wxss';.contain{--thumb-active-color:var(var(--app-B3,#fff),#fff)}
1
+ @import '../common/index.wxss';.contain{--thumb-active-color:var(--app-B3,#fff)}
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color,#fffbe8);color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,14px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,24px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--withicon{padding-right:40px;position:relative}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;margin-right:4px;vertical-align:middle}.smart-notice-bar__left-icon,.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);min-width:var(--notice-bar-icon-min-width,22px)}.smart-notice-bar__right-icon{position:absolute;right:15px;top:10px}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,24px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}
1
+ @import '../common/index.css';.smart-notice-bar{--notice-bar-info-color:#1989fa;--notice-bar-warning-color:#ffa000;--notice-bar-error-color:#f04c4c;--notice-bar-right-icon-color:rgba(0,0,0,.2);align-items:center;background-color:var(--notice-bar-background-color,rgba(25,137,250,.1));color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--warning{background-color:var(--notice-bar-background-warning-color,rgba(255,160,0,.1))}.smart-notice-bar--error{background-color:var(--notice-bar-background-error-color,rgba(240,76,76,.1))}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:#1989fa;display:inline-block}
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  var component_1 = require("../common/component");
4
7
  var utils_1 = require("../common/utils");
8
+ var Xmark_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Xmark"));
9
+ var Right_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Right"));
5
10
  (0, component_1.SmartComponent)({
6
11
  props: {
7
12
  text: {
@@ -9,22 +14,60 @@ var utils_1 = require("../common/utils");
9
14
  value: '',
10
15
  observer: 'init',
11
16
  },
17
+ btnText: {
18
+ type: String,
19
+ value: '',
20
+ observer: 'init',
21
+ },
22
+ btnTextColor: {
23
+ type: String,
24
+ value: '',
25
+ observer: 'init',
26
+ },
12
27
  mode: {
13
28
  type: String,
14
29
  value: '',
15
30
  },
31
+ type: {
32
+ type: String,
33
+ value: 'info'
34
+ },
16
35
  url: {
17
36
  type: String,
18
37
  value: '',
19
38
  },
20
39
  openType: {
21
40
  type: String,
22
- value: 'navigate',
41
+ value: 'navigateTo',
42
+ },
43
+ rightIconColor: {
44
+ type: String,
45
+ value: 'var(--notice-bar-right-icon-color)',
46
+ },
47
+ leftIconColor: {
48
+ type: String,
49
+ value: '',
23
50
  },
24
51
  delay: {
25
52
  type: Number,
26
53
  value: 1,
27
54
  },
55
+ customStyle: {
56
+ type: String,
57
+ value: '',
58
+ },
59
+ customHoverClass: {
60
+ type: String,
61
+ value: '',
62
+ },
63
+ rightIconStyle: {
64
+ type: String,
65
+ value: '',
66
+ },
67
+ leftIconStyle: {
68
+ type: String,
69
+ value: '',
70
+ },
28
71
  speed: {
29
72
  type: Number,
30
73
  value: 60,
@@ -36,11 +79,12 @@ var utils_1 = require("../common/utils");
36
79
  value: '',
37
80
  },
38
81
  color: String,
39
- backgroundColor: String,
40
82
  background: String,
41
83
  wrapable: Boolean,
42
84
  },
43
85
  data: {
86
+ Xmark: Xmark_1.default,
87
+ Right: Right_1.default,
44
88
  show: true,
45
89
  },
46
90
  created: function () {
@@ -118,7 +162,19 @@ var utils_1 = require("../common/utils");
118
162
  this.$emit('close', event.detail);
119
163
  }
120
164
  },
165
+ onClickBtnText: function (event) {
166
+ this.$emit('btnClick', event);
167
+ },
121
168
  onClick: function (event) {
169
+ var _a = this.data, url = _a.url, mode = _a.mode, openType = _a.openType;
170
+ if (mode === 'link' && url) {
171
+ if (openType === 'redirectTo') {
172
+ wx.redirectTo({ url: url });
173
+ }
174
+ else if (openType === 'navigateTo') {
175
+ wx.navigateTo({ url: url });
176
+ }
177
+ }
122
178
  this.$emit('click', event);
123
179
  },
124
180
  },
@@ -3,20 +3,36 @@
3
3
 
4
4
  <view
5
5
  wx:if="{{ show }}"
6
- class="custom-class {{ utils.bem('notice-bar', { withicon: mode, wrapable }) }}"
7
- style="{{ computed.rootStyle({ color, backgroundColor, background }) }}"
6
+ class="custom-class {{ utils.bem('notice-bar', {
7
+ wrapable,
8
+ warning: type === 'warning',
9
+ error: type === 'error'
10
+ }) }}"
11
+ hover-class="{{ mode === 'link' ? 'smart-notice-bar--hover' : ''}} {{ customHoverClass }}"
12
+ style="{{ computed.rootStyle([{ color, background }, customStyle]) }}"
8
13
  bind:tap="onClick"
9
14
  >
10
15
  <smart-icon
11
16
  wx:if="{{ leftIcon }}"
12
17
  name="{{ leftIcon }}"
13
18
  class="smart-notice-bar__left-icon"
19
+ style="{{ computed.rootStyle(leftIconStyle) }}"
20
+ color="{{ leftIconColor || (type === 'info' ? 'var(--notice-bar-info-color)' : type === 'warning' ? 'var(--notice-bar-warning-color)' : type === 'error' ? 'var(--notice-bar-error-color)' : '') }}"
14
21
  />
15
22
  <slot wx:else name="left-icon" />
16
23
 
17
24
  <view class="smart-notice-bar__wrap">
18
25
  <view class="smart-notice-bar__content {{ scrollable === false && !wrapable ? 'smart-ellipsis' : '' }}" animation="{{ animationData }}">
19
26
  {{ text }}
27
+ <view
28
+ wx:if="{{ btnText }}"
29
+ class="smart-notice-bar__content__btn"
30
+ hover-class="smart-notice-bar--hover"
31
+ catch:tap="onClickBtnText"
32
+ style="{{ btnTextColor ? 'color: ' + btnTextColor : ''}}"
33
+ >
34
+ {{ btnText }}
35
+ </view>
20
36
  <slot wx:if="{{ !text }}"></slot>
21
37
  </view>
22
38
  </view>
@@ -24,15 +40,17 @@
24
40
  <smart-icon
25
41
  wx:if="{{ mode === 'closeable' }}"
26
42
  class="smart-notice-bar__right-icon"
27
- name="cross"
43
+ name="{{ Xmark }}"
44
+ style="{{ computed.rootStyle(rightIconStyle) }}"
45
+ color=" {{ rightIconColor }} "
28
46
  catch:tap="onClickIcon"
29
47
  />
30
- <navigator
31
- wx:elif="{{ mode === 'link' }}"
32
- url="{{ url }}"
33
- open-type="{{ openType }}"
34
- >
35
- <smart-icon class="smart-notice-bar__right-icon" name="arrow" />
36
- </navigator>
48
+ <smart-icon
49
+ wx:elif="{{ mode === 'link' }}"
50
+ color=" {{ rightIconColor }} "
51
+ class="smart-notice-bar__right-icon"
52
+ name="{{ Right }}"
53
+ style="{{ computed.rootStyle(rightIconStyle) }}"
54
+ />
37
55
  <slot wx:else name="right-icon" />
38
56
  </view>
@@ -3,11 +3,7 @@ var style = require('../wxs/style.wxs');
3
3
  var addUnit = require('../wxs/add-unit.wxs');
4
4
 
5
5
  function rootStyle(data) {
6
- return style({
7
- color: data.color,
8
- 'background-color': data.backgroundColor,
9
- background: data.background,
10
- });
6
+ return style(data);
11
7
  }
12
8
 
13
9
  module.exports = {
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color,#fffbe8);color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,14px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,24px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--withicon{padding-right:40px;position:relative}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;margin-right:4px;vertical-align:middle}.smart-notice-bar__left-icon,.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);min-width:var(--notice-bar-icon-min-width,22px)}.smart-notice-bar__right-icon{position:absolute;right:15px;top:10px}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,24px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}
1
+ @import '../common/index.wxss';.smart-notice-bar{--notice-bar-info-color:#1989fa;--notice-bar-warning-color:#ffa000;--notice-bar-error-color:#f04c4c;--notice-bar-right-icon-color:rgba(0,0,0,.2);align-items:center;background-color:var(--notice-bar-background-color,rgba(25,137,250,.1));color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--warning{background-color:var(--notice-bar-background-warning-color,rgba(255,160,0,.1))}.smart-notice-bar--error{background-color:var(--notice-bar-background-error-color,rgba(240,76,76,.1))}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:#1989fa;display:inline-block}
@@ -177,7 +177,14 @@ var DEFAULT_DURATION = 200;
177
177
  animate: true,
178
178
  duration: DEFAULT_DURATION,
179
179
  }).then(function () {
180
- userAction && (_this.fireChange = true);
180
+ if (!userAction)
181
+ return;
182
+ if ([0, data.optionsV.length - 1].includes(index)) {
183
+ _this.$emit('change', index);
184
+ return;
185
+ }
186
+ ;
187
+ _this.fireChange = true;
181
188
  });
182
189
  });
183
190
  }
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-radio{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-radio__icon-wrap{flex:none}.smart-radio--horizontal{margin-right:var(--padding-sm,12px)}.smart-radio__icon{align-items:center;border:1px solid var(--radio-border-color,#c8c9cc);box-sizing:border-box;color:transparent;display:flex;font-size:var(--radio-size,20px);height:1em;justify-content:center;text-align:center;transition-duration:var(--radio-transition-duration,.2s);transition-property:color,border-color,background-color;width:1em}.smart-radio__icon--round{border-radius:100%}.smart-radio__icon--checked{background-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));border-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));color:#fff}.smart-radio__icon--disabled{background-color:var(--radio-disabled-background-color,var(--app-B6-N6,rgba(0,0,0,.2)));border-color:var(--radio-disabled-icon-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__icon--disabled.smart-radio__icon--checked{color:var(--radio-disabled-icon-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__label{word-wrap:break-word;color:var(--radio-label-color,var(--app-B6-N1,#000));line-height:var(--radio-size,20px);padding-left:var(--radio-label-margin,10px)}.smart-radio__label--left{float:left;margin:0 var(--radio-label-margin,10px) 0 0}.smart-radio__label--disabled{color:var(--radio-disabled-label-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__label:empty{margin:0}
1
+ @import '../common/index.css';.smart-radio{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-radio__icon-wrap{display:flex;flex:none}.smart-radio--horizontal{margin-right:var(--padding-sm,12px)}.smart-radio__icon{align-items:center;border:2px solid var(--radio-border-color,var(--app-B6-N6,rgba(0,0,0,.2)));border-radius:var(--radio-border-radius,4px);box-sizing:border-box;color:transparent;display:flex;font-size:var(--radio-size,24px);height:1em;justify-content:center;text-align:center;transition-duration:var(--radio-transition-duration,.2s);transition-property:color,border,background-color;width:1em}.smart-radio__icon--round{border-radius:100%}.smart-radio__icon--checked{background-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));border-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));color:#fff}.smart-radio__icon--disabled{opacity:.3}.smart-radio__label{word-wrap:break-word;color:var(--radio-label-color,var(--app-B6-N1,#000));font-size:var(--radio-label-size,12px);padding-left:var(--radio-label-margin,10px)}.smart-radio__label--left{float:left;margin:0 var(--radio-label-margin,10px) 0 0}.smart-radio__label--disabled{color:var(--radio-disabled-label-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__label:empty{margin:0}
@@ -30,7 +30,7 @@ var relation_1 = require("../common/relation");
30
30
  },
31
31
  iconSize: {
32
32
  type: null,
33
- value: 20,
33
+ value: 24,
34
34
  },
35
35
  },
36
36
  data: {
@@ -14,7 +14,8 @@
14
14
  <smart-icon
15
15
  wx:else
16
16
  name="{{ icon }}"
17
- color="{{ value ? '#fff' : 'none'}}"
17
+ size="1em"
18
+ color="{{ value === name ? '#fff' : 'none'}}"
18
19
  class="{{ utils.bem('radio__icon', [shape, { disabled: disabled || parentDisabled, checked: value === name }]) }}"
19
20
  style="{{ computed.iconStyle({ iconSize, checkedColor, disabled, parentDisabled, value, name }) }}"
20
21
  custom-class="icon-class"
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-radio{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-radio__icon-wrap{flex:none}.smart-radio--horizontal{margin-right:var(--padding-sm,12px)}.smart-radio__icon{align-items:center;border:1px solid var(--radio-border-color,#c8c9cc);box-sizing:border-box;color:transparent;display:flex;font-size:var(--radio-size,20px);height:1em;justify-content:center;text-align:center;transition-duration:var(--radio-transition-duration,.2s);transition-property:color,border-color,background-color;width:1em}.smart-radio__icon--round{border-radius:100%}.smart-radio__icon--checked{background-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));border-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));color:#fff}.smart-radio__icon--disabled{background-color:var(--radio-disabled-background-color,var(--app-B6-N6,rgba(0,0,0,.2)));border-color:var(--radio-disabled-icon-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__icon--disabled.smart-radio__icon--checked{color:var(--radio-disabled-icon-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__label{word-wrap:break-word;color:var(--radio-label-color,var(--app-B6-N1,#000));line-height:var(--radio-size,20px);padding-left:var(--radio-label-margin,10px)}.smart-radio__label--left{float:left;margin:0 var(--radio-label-margin,10px) 0 0}.smart-radio__label--disabled{color:var(--radio-disabled-label-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__label:empty{margin:0}
1
+ @import '../common/index.wxss';.smart-radio{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-radio__icon-wrap{display:flex;flex:none}.smart-radio--horizontal{margin-right:var(--padding-sm,12px)}.smart-radio__icon{align-items:center;border:2px solid var(--radio-border-color,var(--app-B6-N6,rgba(0,0,0,.2)));border-radius:var(--radio-border-radius,4px);box-sizing:border-box;color:transparent;display:flex;font-size:var(--radio-size,24px);height:1em;justify-content:center;text-align:center;transition-duration:var(--radio-transition-duration,.2s);transition-property:color,border,background-color;width:1em}.smart-radio__icon--round{border-radius:100%}.smart-radio__icon--checked{background-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));border-color:var(--radio-checked-icon-color,var(--app-M4,#1989fa));color:#fff}.smart-radio__icon--disabled{opacity:.3}.smart-radio__label{word-wrap:break-word;color:var(--radio-label-color,var(--app-B6-N1,#000));font-size:var(--radio-label-size,12px);padding-left:var(--radio-label-margin,10px)}.smart-radio__label--left{float:left;margin:0 var(--radio-label-margin,10px) 0 0}.smart-radio__label--disabled{color:var(--radio-disabled-label-color,var(--app-B6-N5,rgba(0,0,0,.3)))}.smart-radio__label:empty{margin:0}
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.smart-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px)}.smart-search__action--hover{background-color:#f2f3f5}.smart-search__action-button{padding:var(--search-action-padding,0 8px)}
1
+ @import '../common/index.css';.smart-search{align-items:center;background-color:var(--search-background-color,var(--app-B3,#fff));box-sizing:border-box;display:flex;padding:var(--search-padding,12px 16px)}.smart-search__content{align-items:center;background-color:var(--search-body-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:flex;flex:1;flex-direction:row;padding:12px 16px}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,var(--app-B4-N1,#000));font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,24px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{--icon-color:var(--search-left-icon-color,var(--app-B4-N4,rgba(0,0,0,.4)));margin-left:2px}.smart-search__input{font-size:var(--search-value-font-size,14px)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,24px)}.smart-search__action--hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__action-button{padding:var(--search-action-padding,0 16px 0 12px)}.smart-search__hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__submit{align-items:center;color:var(--search-submit-color,var(--app-M1,#3678e3));display:flex;flex-direction:row;font-size:var(--search-submit-font-size,14px)}.smart-search__submit:before{background-color:var(--search-submit-color,var(--app-M1,#3678e3));content:"";display:block;height:12px;margin-right:12px;width:1px}
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  var component_1 = require("../common/component");
4
7
  var version_1 = require("../common/version");
8
+ var Search_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Search"));
9
+ var Close_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Close"));
5
10
  (0, component_1.SmartComponent)({
6
11
  field: true,
7
12
  classes: ['field-class', 'input-class', 'cancel-class'],
@@ -22,18 +27,20 @@ var version_1 = require("../common/version");
22
27
  useRightIconSlot: Boolean,
23
28
  leftIcon: {
24
29
  type: String,
25
- value: 'search',
30
+ value: Search_1.default,
26
31
  },
27
32
  rightIcon: String,
28
33
  placeholder: String,
29
34
  placeholderStyle: String,
30
- actionText: {
35
+ searchText: {
31
36
  type: String,
32
- value: '取消',
37
+ value: 'Search',
33
38
  },
34
- background: {
39
+ showSearchButton: Boolean,
40
+ background: String,
41
+ actionText: {
35
42
  type: String,
36
- value: '#ffffff',
43
+ value: 'Cancel',
37
44
  },
38
45
  maxlength: {
39
46
  type: Number,
@@ -53,7 +60,7 @@ var version_1 = require("../common/version");
53
60
  },
54
61
  clearIcon: {
55
62
  type: String,
56
- value: 'clear',
63
+ value: Close_1.default,
57
64
  },
58
65
  cursorSpacing: {
59
66
  type: Number,
@@ -62,9 +69,7 @@ var version_1 = require("../common/version");
62
69
  },
63
70
  methods: {
64
71
  onChange: function (event) {
65
- if ((0, version_1.canIUseModel)()) {
66
- this.setData({ value: event.detail });
67
- }
72
+ this.setData({ value: event.detail });
68
73
  this.$emit('change', event.detail);
69
74
  },
70
75
  onCancel: function () {
@@ -83,6 +88,9 @@ var version_1 = require("../common/version");
83
88
  onSearch: function (event) {
84
89
  this.$emit('search', event.detail);
85
90
  },
91
+ goSearch: function () {
92
+ this.$emit('search', this.data.value);
93
+ },
86
94
  onFocus: function (event) {
87
95
  this.$emit('focus', event.detail);
88
96
  },
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "component": true,
3
3
  "usingComponents": {
4
- "smart-field": "../field/index"
4
+ "smart-field": "../field/index",
5
+ "smart-icon": "../icon/index"
5
6
  }
6
7
  }
@@ -3,14 +3,14 @@
3
3
  <view
4
4
  class="{{ utils.bem('search', { withaction: showAction || useActionSlot }) }} custom-class"
5
5
  style="background: {{ background }}"
6
- >
6
+ >
7
+
7
8
  <view class="{{ utils.bem('search__content', [shape]) }}">
8
9
  <view class="smart-search__label" wx:if="{{ label }}">{{ label }}</view>
9
10
  <slot wx:else name="label" />
10
11
 
11
12
  <smart-field
12
13
  type="search"
13
- left-icon="{{ !useLeftIconSlot ? leftIcon : '' }}"
14
14
  right-icon="{{ !useRightIconSlot ? rightIcon : '' }}"
15
15
  focus="{{ focus }}"
16
16
  error="{{ error }}"
@@ -25,11 +25,11 @@
25
25
  clear-icon="{{ clearIcon }}"
26
26
  maxlength="{{ maxlength }}"
27
27
  input-align="{{ inputAlign }}"
28
- input-class="input-class"
28
+ input-class="smart-search__input input-class"
29
29
  placeholder="{{ placeholder }}"
30
30
  placeholder-style="{{ placeholderStyle }}"
31
31
  cursor-spacing="{{ cursorSpacing }}"
32
- custom-style="padding: 5px 10px 5px 0; background-color: transparent;"
32
+ custom-style="padding: 0; background-color: transparent;"
33
33
  bind:blur="onBlur"
34
34
  bind:focus="onFocus"
35
35
  bind:change="onChange"
@@ -37,8 +37,11 @@
37
37
  bind:clear="onClear"
38
38
  bind:click-input="onClickInput"
39
39
  >
40
+ <smart-icon wx:if="{{ !useLeftIconSlot && leftIcon }}" size="18" name="{{ leftIcon }}" custom-class="smart-search__field__left-icon" slot="left-icon" />
40
41
  <slot wx:if="{{ useLeftIconSlot }}" name="left-icon" slot="left-icon" />
41
42
  <slot wx:if="{{ useRightIconSlot }}" name="right-icon" slot="right-icon" />
43
+ <view wx:if="{{ showSearchButton && searchText }}" hover-class="smart-search__hover" bind:tap="goSearch" class="smart-search__submit" slot="button" >{{ searchText }}</view>
44
+ <slot name="search-button" slot="button" />
42
45
  </smart-field>
43
46
  </view>
44
47
 
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.smart-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px)}.smart-search__action--hover{background-color:#f2f3f5}.smart-search__action-button{padding:var(--search-action-padding,0 8px)}
1
+ @import '../common/index.wxss';.smart-search{align-items:center;background-color:var(--search-background-color,var(--app-B3,#fff));box-sizing:border-box;display:flex;padding:var(--search-padding,12px 16px)}.smart-search__content{align-items:center;background-color:var(--search-body-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:flex;flex:1;flex-direction:row;padding:12px 16px}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,var(--app-B4-N1,#000));font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,24px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{--icon-color:var(--search-left-icon-color,var(--app-B4-N4,rgba(0,0,0,.4)));margin-left:2px}.smart-search__input{font-size:var(--search-value-font-size,14px)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,24px)}.smart-search__action--hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__action-button{padding:var(--search-action-padding,0 16px 0 12px)}.smart-search__hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__submit{align-items:center;color:var(--search-submit-color,var(--app-M1,#3678e3));display:flex;flex-direction:row;font-size:var(--search-submit-font-size,14px)}.smart-search__submit:before{background-color:var(--search-submit-color,var(--app-M1,#3678e3));content:"";display:block;height:12px;margin-right:12px;width:1px}
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{height:50%;left:25%;position:absolute!important;top:25%;width:50%}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
1
+ @import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
@@ -27,6 +27,7 @@
27
27
  wx:if="{{ loading }}"
28
28
  color="{{ computed.loadingColor({ checked, activeColor, inactiveColor, activeValue }) }}"
29
29
  custom-class="smart-switch__loading"
30
+ size="{{size}}"
30
31
  />
31
32
  </view>
32
33
  </view>
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{height:50%;left:25%;position:absolute!important;top:25%;width:50%}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
1
+ @import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
@@ -1 +1 @@
1
- @import '../common/index.css';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,30px);padding:2px}.smart-tabs__nav--card .smart-tab{border-radius:6px;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 30px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,30px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
1
+ @import '../common/index.css';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:6px;left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
package/lib/tabs/index.js CHANGED
@@ -205,10 +205,7 @@ var relation_1 = require("../common/relation");
205
205
  },
206
206
  resize: function () {
207
207
  var _this = this;
208
- if (this.data.type !== 'line') {
209
- return;
210
- }
211
- var _a = this.data, currentIndex = _a.currentIndex, ellipsis = _a.ellipsis, skipTransition = _a.skipTransition;
208
+ var _a = this.data, currentIndex = _a.currentIndex, ellipsis = _a.ellipsis, skipTransition = _a.skipTransition, type = _a.type;
212
209
  Promise.all([
213
210
  (0, utils_1.getAllRect)(this, '.smart-tab'),
214
211
  (0, utils_1.getRect)(this, '.smart-tabs__line'),
@@ -218,12 +215,18 @@ var relation_1 = require("../common/relation");
218
215
  if (rect == null) {
219
216
  return;
220
217
  }
218
+ var _c = rects[currentIndex], cardWidth = _c.width, cardHeight = _c.height;
221
219
  var lineOffsetLeft = rects
222
220
  .slice(0, currentIndex)
223
221
  .reduce(function (prev, curr) { return prev + curr.width; }, 0);
224
- lineOffsetLeft +=
225
- (rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
226
- _this.setData({ lineOffsetLeft: lineOffsetLeft, inited: true });
222
+ if (type === 'line') {
223
+ lineOffsetLeft +=
224
+ (rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
225
+ }
226
+ else if (type === 'card') {
227
+ lineOffsetLeft += 2;
228
+ }
229
+ _this.setData({ lineOffsetLeft: lineOffsetLeft, inited: true, cardWidth: cardWidth, cardHeight: cardHeight });
227
230
  _this.swiping = true;
228
231
  if (skipTransition) {
229
232
  // waiting transition end
@@ -21,6 +21,7 @@
21
21
  >
22
22
  <view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}">
23
23
  <view wx:if="{{ type === 'line' }}" class="smart-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth, inited }) }}" />
24
+ <view wx:if="{{ type === 'card' }}" class="smart-tabs__card" style="{{ computed.cardStyle({ color, lineOffsetLeft, cardHeight, skipTransition, duration, cardWidth, inited }) }}" />
24
25
  <view
25
26
  wx:for="{{ tabs }}"
26
27
  wx:key="index"