@nutui/nutui-react-taro 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/hooks/use-client-rect.js +1 -0
  3. package/dist/cjs/packages/actionsheet/style/style.css +12 -0
  4. package/dist/cjs/packages/address/style/style.css +12 -0
  5. package/dist/cjs/packages/calendar/style/style.css +12 -0
  6. package/dist/cjs/packages/cascader/style/style.css +12 -0
  7. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  8. package/dist/cjs/packages/datepicker/datepicker.js +8 -6
  9. package/dist/cjs/packages/datepicker/style/style.css +82 -0
  10. package/dist/cjs/packages/datepickerview/datepickerview.d.ts +3 -0
  11. package/dist/cjs/packages/datepickerview/datepickerview.js +119 -0
  12. package/dist/cjs/packages/datepickerview/index.d.ts +3 -0
  13. package/dist/cjs/packages/{subsidenavbar → datepickerview}/index.js +2 -2
  14. package/dist/cjs/packages/datepickerview/style/datepickerview.scss +4 -0
  15. package/dist/cjs/packages/datepickerview/style/index.js +2 -0
  16. package/dist/cjs/packages/datepickerview/style/style.css +78 -0
  17. package/dist/cjs/packages/datepickerview/style/style.harmony.css +8 -0
  18. package/dist/cjs/packages/datepickerview/types.d.ts +15 -0
  19. package/dist/cjs/packages/datepickerview/types.js +4 -0
  20. package/dist/cjs/packages/dialog/dialog.js +8 -3
  21. package/dist/cjs/packages/dialog/style/dialog.scss +0 -1
  22. package/dist/cjs/packages/dialog/style/style.css +0 -1
  23. package/dist/cjs/packages/dialog/style/style.harmony.css +0 -1
  24. package/dist/cjs/packages/drag/drag.js +33 -39
  25. package/dist/cjs/packages/drag/style/drag.scss +1 -0
  26. package/dist/cjs/packages/drag/style/style.css +1 -0
  27. package/dist/cjs/packages/drag/style/style.harmony.css +1 -0
  28. package/dist/cjs/packages/fixednav/fixednav.js +20 -14
  29. package/dist/cjs/packages/fixednav/style/fixednav.scss +0 -15
  30. package/dist/cjs/packages/fixednav/style/style.css +0 -14
  31. package/dist/cjs/packages/fixednav/style/style.harmony.css +0 -14
  32. package/dist/cjs/packages/form/form.d.ts +2 -0
  33. package/dist/cjs/packages/form/form.js +11 -2
  34. package/dist/cjs/packages/form/index.d.ts +2 -1
  35. package/dist/cjs/packages/form/index.js +1 -0
  36. package/dist/cjs/packages/form/style/form.scss +0 -66
  37. package/dist/cjs/packages/form/style/style.css +31 -21
  38. package/dist/cjs/packages/form/style/style.harmony.css +1 -67
  39. package/dist/cjs/packages/form/types.d.ts +2 -1
  40. package/dist/cjs/packages/form/useform.d.ts +2 -1
  41. package/dist/cjs/packages/form/useform.js +338 -247
  42. package/dist/cjs/packages/formitem/formitem.d.ts +1 -0
  43. package/dist/cjs/packages/formitem/formitem.js +57 -45
  44. package/dist/cjs/packages/formitem/style/formitem.scss +101 -21
  45. package/dist/cjs/packages/formitem/style/style.css +89 -12
  46. package/dist/cjs/packages/formitem/style/style.harmony.css +89 -12
  47. package/dist/cjs/packages/imagepreview/style/style.css +12 -0
  48. package/dist/cjs/packages/input/input.js +5 -2
  49. package/dist/cjs/packages/input/style/input.scss +6 -4
  50. package/dist/cjs/packages/input/style/style.css +4 -0
  51. package/dist/cjs/packages/input/style/style.harmony.css +8 -0
  52. package/dist/cjs/packages/numberkeyboard/style/style.css +12 -0
  53. package/dist/cjs/packages/nutui.react.build.d.ts +11 -15
  54. package/dist/cjs/packages/nutui.react.build.js +172 -180
  55. package/dist/cjs/packages/nutui.react.d.ts +16 -22
  56. package/dist/cjs/packages/nutui.react.js +177 -187
  57. package/dist/cjs/packages/nutui.react.scss.d.ts +5 -7
  58. package/dist/cjs/packages/nutui.react.scss.js +5 -7
  59. package/dist/cjs/packages/overlay/overlay.js +4 -5
  60. package/dist/cjs/packages/overlay/style/overlay.scss +0 -4
  61. package/dist/cjs/packages/picker/style/index.js +1 -0
  62. package/dist/cjs/packages/picker/style/style.css +82 -0
  63. package/dist/cjs/packages/popover/style/style.css +12 -0
  64. package/dist/cjs/packages/popup/popup.js +17 -11
  65. package/dist/cjs/packages/popup/style/popup.scss +12 -4
  66. package/dist/cjs/packages/popup/style/style.css +12 -0
  67. package/dist/cjs/packages/popup/style/style.harmony.css +12 -0
  68. package/dist/cjs/packages/shortpassword/shortpassword.js +5 -7
  69. package/dist/cjs/packages/shortpassword/style/shortpassword.scss +10 -0
  70. package/dist/cjs/packages/shortpassword/style/style.css +21 -0
  71. package/dist/cjs/packages/shortpassword/style/style.harmony.css +9 -0
  72. package/dist/cjs/packages/signature/signature.js +1 -1
  73. package/dist/cjs/packages/swipe/style/style.css +3 -3
  74. package/dist/cjs/packages/swipe/style/style.harmony.css +3 -3
  75. package/dist/cjs/packages/swipe/style/swipe.scss +7 -3
  76. package/dist/cjs/packages/swipe/swipe.js +14 -15
  77. package/dist/cjs/packages/tabbar/style/style.css +6 -0
  78. package/dist/cjs/packages/tabbaritem/style/style.css +6 -0
  79. package/dist/cjs/packages/tabbaritem/style/style.harmony.css +6 -0
  80. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +6 -0
  81. package/dist/cjs/packages/tabs/tabs.js +6 -13
  82. package/dist/cjs/packages/textarea/textarea.js +1 -1
  83. package/dist/cjs/packages/timeselect/style/style.css +12 -0
  84. package/dist/cjs/packages/tour/style/style.css +12 -0
  85. package/dist/cjs/utils/get-rect-by-taro.d.ts +1 -1
  86. package/dist/cjs/utils/get-rect-by-taro.js +4 -1
  87. package/dist/cjs/utils/get-system-info.js +4 -5
  88. package/dist/cjs/utils/merge.d.ts +14 -0
  89. package/dist/cjs/utils/merge.js +98 -0
  90. package/dist/cjs/utils/platform-taro.js +4 -5
  91. package/dist/cjs/utils/to-array.d.ts +1 -0
  92. package/dist/cjs/utils/to-array.js +18 -0
  93. package/dist/es/hooks/use-client-rect.js +1 -0
  94. package/dist/es/packages/actionsheet/style/style.css +12 -0
  95. package/dist/es/packages/address/style/style.css +12 -0
  96. package/dist/es/packages/calendar/style/style.css +12 -0
  97. package/dist/es/packages/cascader/style/style.css +12 -0
  98. package/dist/es/packages/configprovider/types.d.ts +1 -1
  99. package/dist/es/packages/datepicker/datepicker.js +8 -6
  100. package/dist/es/packages/datepicker/style/style.css +82 -0
  101. package/dist/es/packages/datepickerview/datepickerview.d.ts +3 -0
  102. package/dist/es/packages/datepickerview/datepickerview.js +107 -0
  103. package/dist/es/packages/datepickerview/index.d.ts +3 -0
  104. package/dist/es/packages/datepickerview/index.js +2 -0
  105. package/dist/es/packages/datepickerview/style/datepickerview.scss +4 -0
  106. package/dist/es/packages/datepickerview/style/index.js +2 -0
  107. package/dist/es/packages/datepickerview/style/style.css +78 -0
  108. package/dist/es/packages/datepickerview/style/style.harmony.css +8 -0
  109. package/dist/es/packages/datepickerview/types.d.ts +15 -0
  110. package/dist/es/packages/datepickerview/types.js +1 -0
  111. package/dist/es/packages/dialog/dialog.js +8 -3
  112. package/dist/es/packages/dialog/style/dialog.scss +0 -1
  113. package/dist/es/packages/dialog/style/style.css +0 -1
  114. package/dist/es/packages/dialog/style/style.harmony.css +0 -1
  115. package/dist/es/packages/drag/drag.js +33 -39
  116. package/dist/es/packages/drag/style/drag.scss +1 -0
  117. package/dist/es/packages/drag/style/style.css +1 -0
  118. package/dist/es/packages/drag/style/style.harmony.css +1 -0
  119. package/dist/es/packages/fixednav/fixednav.js +20 -14
  120. package/dist/es/packages/fixednav/style/fixednav.scss +0 -15
  121. package/dist/es/packages/fixednav/style/style.css +0 -14
  122. package/dist/es/packages/fixednav/style/style.harmony.css +0 -14
  123. package/dist/es/packages/form/form.d.ts +10 -0
  124. package/dist/es/packages/form/form.js +11 -2
  125. package/dist/es/packages/form/index.d.ts +2 -1
  126. package/dist/es/packages/form/index.js +2 -1
  127. package/dist/es/packages/form/style/form.scss +0 -66
  128. package/dist/es/packages/form/style/style.css +31 -21
  129. package/dist/es/packages/form/style/style.harmony.css +1 -67
  130. package/dist/es/packages/form/types.d.ts +2 -1
  131. package/dist/es/packages/form/useform.d.ts +2 -1
  132. package/dist/es/packages/form/useform.js +336 -248
  133. package/dist/es/packages/formitem/formitem.d.ts +1 -0
  134. package/dist/es/packages/formitem/formitem.js +58 -46
  135. package/dist/es/packages/formitem/style/formitem.scss +101 -21
  136. package/dist/es/packages/formitem/style/style.css +89 -12
  137. package/dist/es/packages/formitem/style/style.harmony.css +89 -12
  138. package/dist/es/packages/imagepreview/style/style.css +12 -0
  139. package/dist/es/packages/input/input.js +5 -2
  140. package/dist/es/packages/input/style/input.scss +6 -4
  141. package/dist/es/packages/input/style/style.css +4 -0
  142. package/dist/es/packages/input/style/style.harmony.css +8 -0
  143. package/dist/es/packages/numberkeyboard/style/style.css +12 -0
  144. package/dist/es/packages/nutui.react.build.d.ts +11 -15
  145. package/dist/es/packages/nutui.react.build.js +11 -15
  146. package/dist/es/packages/overlay/overlay.js +4 -5
  147. package/dist/es/packages/overlay/style/overlay.scss +0 -4
  148. package/dist/es/packages/picker/style/index.js +1 -0
  149. package/dist/es/packages/picker/style/style.css +82 -0
  150. package/dist/es/packages/popover/style/style.css +12 -0
  151. package/dist/es/packages/popup/popup.js +17 -11
  152. package/dist/es/packages/popup/style/popup.scss +12 -4
  153. package/dist/es/packages/popup/style/style.css +12 -0
  154. package/dist/es/packages/popup/style/style.harmony.css +12 -0
  155. package/dist/es/packages/shortpassword/shortpassword.js +5 -7
  156. package/dist/es/packages/shortpassword/style/shortpassword.scss +10 -0
  157. package/dist/es/packages/shortpassword/style/style.css +21 -0
  158. package/dist/es/packages/shortpassword/style/style.harmony.css +9 -0
  159. package/dist/es/packages/signature/signature.js +2 -2
  160. package/dist/es/packages/swipe/style/style.css +3 -3
  161. package/dist/es/packages/swipe/style/style.harmony.css +3 -3
  162. package/dist/es/packages/swipe/style/swipe.scss +7 -3
  163. package/dist/es/packages/swipe/swipe.js +14 -15
  164. package/dist/es/packages/tabbar/style/style.css +6 -0
  165. package/dist/es/packages/tabbaritem/style/style.css +6 -0
  166. package/dist/es/packages/tabbaritem/style/style.harmony.css +6 -0
  167. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +6 -0
  168. package/dist/es/packages/tabs/tabs.js +6 -13
  169. package/dist/es/packages/textarea/textarea.js +2 -2
  170. package/dist/es/packages/timeselect/style/style.css +12 -0
  171. package/dist/es/packages/tour/style/style.css +12 -0
  172. package/dist/es/utils/get-rect-by-taro.d.ts +1 -1
  173. package/dist/es/utils/get-rect-by-taro.js +4 -1
  174. package/dist/es/utils/get-system-info.js +4 -4
  175. package/dist/es/utils/merge.d.ts +14 -0
  176. package/dist/es/utils/merge.js +68 -0
  177. package/dist/es/utils/platform-taro.js +4 -4
  178. package/dist/es/utils/to-array.d.ts +1 -0
  179. package/dist/es/utils/to-array.js +8 -0
  180. package/dist/nutui.react.umd.js +5593 -5442
  181. package/dist/style.css +1 -1
  182. package/dist/style.scss +34 -36
  183. package/dist/styles/variables-jmapp.scss +0 -50
  184. package/dist/styles/variables-jrkf.scss +0 -50
  185. package/dist/styles/variables.scss +0 -49
  186. package/package.json +1 -1
  187. package/dist/cjs/packages/sidenavbar/context.d.ts +0 -1
  188. package/dist/cjs/packages/sidenavbar/context.js +0 -12
  189. package/dist/cjs/packages/sidenavbar/index.d.ts +0 -3
  190. package/dist/cjs/packages/sidenavbar/index.js +0 -12
  191. package/dist/cjs/packages/sidenavbar/sidenavbar.d.ts +0 -14
  192. package/dist/cjs/packages/sidenavbar/sidenavbar.js +0 -75
  193. package/dist/cjs/packages/sidenavbar/style/index.js +0 -2
  194. package/dist/cjs/packages/sidenavbar/style/sidenavbar.scss +0 -89
  195. package/dist/cjs/packages/sidenavbar/style/style.css +0 -443
  196. package/dist/cjs/packages/sidenavbar/style/style.harmony.css +0 -74
  197. package/dist/cjs/packages/sidenavbar/utils.d.ts +0 -3
  198. package/dist/cjs/packages/sidenavbar/utils.js +0 -23
  199. package/dist/cjs/packages/sidenavbaritem/index.d.ts +0 -3
  200. package/dist/cjs/packages/sidenavbaritem/index.js +0 -12
  201. package/dist/cjs/packages/sidenavbaritem/sidenavbaritem.d.ts +0 -11
  202. package/dist/cjs/packages/sidenavbaritem/sidenavbaritem.js +0 -34
  203. package/dist/cjs/packages/sidenavbaritem/style/index.js +0 -1
  204. package/dist/cjs/packages/sidenavbaritem/style/sidenavbaritem.scss +0 -13
  205. package/dist/cjs/packages/sidenavbaritem/style/style.css +0 -14
  206. package/dist/cjs/packages/sidenavbaritem/style/style.harmony.css +0 -14
  207. package/dist/cjs/packages/subsidenavbar/index.d.ts +0 -3
  208. package/dist/cjs/packages/subsidenavbar/style/css.js +0 -1
  209. package/dist/cjs/packages/subsidenavbar/style/index.js +0 -1
  210. package/dist/cjs/packages/subsidenavbar/style/style.css +0 -20
  211. package/dist/cjs/packages/subsidenavbar/style/style.harmony.css +0 -20
  212. package/dist/cjs/packages/subsidenavbar/style/subsidenavbar.scss +0 -26
  213. package/dist/cjs/packages/subsidenavbar/subsidenavbar.d.ts +0 -13
  214. package/dist/cjs/packages/subsidenavbar/subsidenavbar.js +0 -90
  215. package/dist/es/packages/sidenavbar/context.d.ts +0 -1
  216. package/dist/es/packages/sidenavbar/context.js +0 -2
  217. package/dist/es/packages/sidenavbar/index.d.ts +0 -3
  218. package/dist/es/packages/sidenavbar/index.js +0 -2
  219. package/dist/es/packages/sidenavbar/sidenavbar.d.ts +0 -38
  220. package/dist/es/packages/sidenavbar/sidenavbar.js +0 -63
  221. package/dist/es/packages/sidenavbar/style/css.js +0 -1
  222. package/dist/es/packages/sidenavbar/style/index.js +0 -2
  223. package/dist/es/packages/sidenavbar/style/sidenavbar.scss +0 -89
  224. package/dist/es/packages/sidenavbar/style/style.css +0 -443
  225. package/dist/es/packages/sidenavbar/style/style.harmony.css +0 -74
  226. package/dist/es/packages/sidenavbar/utils.d.ts +0 -3
  227. package/dist/es/packages/sidenavbar/utils.js +0 -14
  228. package/dist/es/packages/sidenavbaritem/index.d.ts +0 -3
  229. package/dist/es/packages/sidenavbaritem/index.js +0 -2
  230. package/dist/es/packages/sidenavbaritem/sidenavbaritem.d.ts +0 -11
  231. package/dist/es/packages/sidenavbaritem/sidenavbaritem.js +0 -23
  232. package/dist/es/packages/sidenavbaritem/style/css.js +0 -1
  233. package/dist/es/packages/sidenavbaritem/style/index.js +0 -1
  234. package/dist/es/packages/sidenavbaritem/style/sidenavbaritem.scss +0 -13
  235. package/dist/es/packages/sidenavbaritem/style/style.css +0 -14
  236. package/dist/es/packages/sidenavbaritem/style/style.harmony.css +0 -14
  237. package/dist/es/packages/subsidenavbar/index.d.ts +0 -3
  238. package/dist/es/packages/subsidenavbar/index.js +0 -2
  239. package/dist/es/packages/subsidenavbar/style/css.js +0 -1
  240. package/dist/es/packages/subsidenavbar/style/index.js +0 -1
  241. package/dist/es/packages/subsidenavbar/style/style.css +0 -20
  242. package/dist/es/packages/subsidenavbar/style/style.harmony.css +0 -20
  243. package/dist/es/packages/subsidenavbar/style/subsidenavbar.scss +0 -26
  244. package/dist/es/packages/subsidenavbar/subsidenavbar.d.ts +0 -13
  245. package/dist/es/packages/subsidenavbar/subsidenavbar.js +0 -79
  246. /package/dist/cjs/packages/{sidenavbar → datepickerview}/style/css.js +0 -0
  247. /package/dist/{cjs/packages/sidenavbaritem → es/packages/datepickerview}/style/css.js +0 -0
@@ -2,12 +2,21 @@
2
2
  /* #endif */
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
+ .nut-shortpassword-popup {
6
+ padding: 32px 24px 28px 24px;
7
+ border-radius: 12px;
8
+ text-align: center;
9
+ }
5
10
  .nut-shortpassword-title {
11
+ display: flex;
12
+ justify-content: center;
6
13
  line-height: 1;
7
14
  font-size: 16px;
8
15
  color: #1a1a1a;
9
16
  }
10
17
  .nut-shortpassword-description {
18
+ display: flex;
19
+ justify-content: center;
11
20
  margin-top: 12px;
12
21
  margin-bottom: 24px;
13
22
  line-height: 1;
@@ -164,7 +164,7 @@ var InternalSignature = function InternalSignature(props, ref) {
164
164
  onTouchStart: startEventHandler,
165
165
  onTouchMove: moveEventHandler,
166
166
  onTouchEnd: endEventHandler
167
- }) : /*#__PURE__*/ _react.default.createElement("canvas", {
167
+ }) : /*#__PURE__*/ _react.default.createElement(_components.Canvas, {
168
168
  id: canvasId,
169
169
  ref: canvasRef,
170
170
  "canvas-id": canvasId,
@@ -22,12 +22,12 @@
22
22
  .nut-swipe-left, .nut-swipe-right {
23
23
  position: absolute;
24
24
  top: 0;
25
- display: flex;
26
- flex-direction: row;
27
25
  }
28
26
  .nut-swipe-left {
29
27
  left: 0;
28
+ transform: translate(-100%, 0px);
30
29
  }
31
30
  .nut-swipe-right {
32
- left: 100%;
31
+ right: 0px;
32
+ transform: translate(100%, 0px);
33
33
  }
@@ -22,12 +22,12 @@
22
22
  .nut-swipe-left, .nut-swipe-right {
23
23
  position: absolute;
24
24
  top: 0;
25
- display: flex;
26
- flex-direction: row;
27
25
  }
28
26
  .nut-swipe-left {
29
27
  left: 0;
28
+ transform: translate(-100%, 0px);
30
29
  }
31
30
  .nut-swipe-right {
32
- left: 100%;
31
+ right: 0px;
32
+ transform: translate(100%, 0px);
33
33
  }
@@ -20,15 +20,19 @@
20
20
  &-right {
21
21
  position: absolute;
22
22
  top: 0;
23
- display: flex;
24
- flex-direction: row;
23
+ //display: flex;
24
+ //flex-direction: row;
25
+ //flex-shrink: 0;
25
26
  }
26
27
 
27
28
  &-left {
28
29
  left: 0;
30
+ transform: translate(-100%, 0px);
29
31
  }
30
32
 
31
33
  &-right {
32
- left: 100%;
34
+ //left: 100%;
35
+ right: 0px;
36
+ transform: translate(100%, 0px);
33
37
  }
34
38
  }
@@ -18,12 +18,13 @@ var _ts_generator = require("@swc/helpers/_/_ts_generator");
18
18
  var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
19
19
  var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
20
20
  var _components = require("@tarojs/components");
21
+ var _taro = require("@tarojs/taro");
21
22
  var _usetouch = require("../../hooks/use-touch");
22
23
  var _getrectbytaro = require("../../utils/get-rect-by-taro");
23
24
  var _typings = require("../../utils/typings");
24
25
  var _platformtaro = require("../../utils/platform-taro");
25
- var _pxtransform = /*#__PURE__*/ _interop_require_default._(require("../../utils/px-transform"));
26
26
  var _userefstate = require("../../hooks/use-ref-state");
27
+ var _useuuid = /*#__PURE__*/ _interop_require_default._(require("../../hooks/use-uuid"));
27
28
  function preventDefault(event, isStopPropagation) {
28
29
  if (typeof event.cancelable !== 'boolean' || event.cancelable) {
29
30
  event.preventDefault();
@@ -38,8 +39,11 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
38
39
  var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
39
40
  var classPrefix = 'nut-swipe';
40
41
  var touch = (0, _usetouch.useTouch)();
42
+ var uid = (0, _useuuid.default)();
43
+ var leftId = "swipe-left-".concat(uid);
44
+ var rightId = "swipe-right-".concat(uid);
41
45
  // 获取元素的时候要在页面 onReady 后,需要参考小程序的事件周期
42
- (0, _react.useEffect)(function() {
46
+ (0, _taro.useReady)(function() {
43
47
  var getWidth = /*#__PURE__*/ function() {
44
48
  var _ref = (0, _async_to_generator._)(function() {
45
49
  var leftRect, rightRect;
@@ -52,7 +56,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
52
56
  ];
53
57
  return [
54
58
  4,
55
- (0, _getrectbytaro.getRectByTaro)(leftWrapper.current)
59
+ (0, _getrectbytaro.getRectByTaro)(leftWrapper.current, leftId)
56
60
  ];
57
61
  case 1:
58
62
  leftRect = _state.sent();
@@ -69,11 +73,10 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
69
73
  ];
70
74
  return [
71
75
  4,
72
- (0, _getrectbytaro.getRectByTaro)(rightWrapper.current)
76
+ (0, _getrectbytaro.getRectByTaro)(rightWrapper.current, rightId)
73
77
  ];
74
78
  case 3:
75
79
  rightRect = _state.sent();
76
- console.log('actionWidth.current.left', rightRect.width);
77
80
  rightRect && setActionWidth(function(v) {
78
81
  return (0, _object_spread_props._)((0, _object_spread._)({}, v), {
79
82
  right: rightRect.width
@@ -94,7 +97,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
94
97
  setTimeout(function() {
95
98
  return getWidth();
96
99
  });
97
- }, []);
100
+ });
98
101
  var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style;
99
102
  var root = (0, _react.useRef)();
100
103
  var opened = (0, _react.useRef)(false);
@@ -122,7 +125,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
122
125
  }
123
126
  };
124
127
  var wrapperStyle = {
125
- transform: "translate(".concat(state.offset, "px, 0)"),
128
+ transform: "translate(".concat(state.offset).concat(!(0, _platformtaro.harmony)() ? 'px' : '', ", 0)"),
126
129
  transitionDuration: state.dragging ? '0s' : '.6s'
127
130
  };
128
131
  var onTouchStart = /*#__PURE__*/ function() {
@@ -131,14 +134,13 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
131
134
  return (0, _ts_generator._)(this, function(_state) {
132
135
  switch(_state.label){
133
136
  case 0:
134
- console.log('ontouchstart');
135
137
  if (!leftWrapper.current) return [
136
138
  3,
137
139
  2
138
140
  ];
139
141
  return [
140
142
  4,
141
- (0, _getrectbytaro.getRectByTaro)(leftWrapper.current)
143
+ (0, _getrectbytaro.getRectByTaro)(leftWrapper.current, leftId)
142
144
  ];
143
145
  case 1:
144
146
  leftRect = _state.sent();
@@ -155,7 +157,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
155
157
  ];
156
158
  return [
157
159
  4,
158
- (0, _getrectbytaro.getRectByTaro)(rightWrapper.current)
160
+ (0, _getrectbytaro.getRectByTaro)(rightWrapper.current, rightId)
159
161
  ];
160
162
  case 3:
161
163
  rightRect = _state.sent();
@@ -198,7 +200,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
198
200
  if (isEdge) {
199
201
  preventDefault(event, true);
200
202
  }
201
- newState.offset = rangeCalculation(((0, _platformtaro.harmony)() ? parseFloat((0, _pxtransform.default)(touch.deltaX.current)) : touch.deltaX.current) + startOffset.current, -actionWidth.current.right || 0, actionWidth.current.left || 0);
203
+ newState.offset = rangeCalculation(touch.deltaX.current + startOffset.current, -actionWidth.current.right || 0, actionWidth.current.left || 0);
202
204
  setState(newState);
203
205
  }
204
206
  };
@@ -265,13 +267,10 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
265
267
  var rightWrapper = (0, _react.useRef)(null);
266
268
  var renderActionContent = function renderActionContent(side) {
267
269
  if (props["".concat(side, "Action")]) {
268
- console.log('actionWidth xxx', actionWidth.current.left);
269
270
  return /*#__PURE__*/ _react.default.createElement(_components.View, {
270
271
  ref: side === 'left' ? leftWrapper : rightWrapper,
271
272
  className: "".concat(classPrefix, "-").concat(side),
272
- style: (0, _object_spread._)({}, side === 'left' ? {
273
- left: Number("".concat(-actionWidth.current.left))
274
- } : {}),
273
+ id: side === 'left' ? leftId : rightId,
275
274
  onClick: function onClick(e) {
276
275
  return handleOperate(e, side);
277
276
  }
@@ -121,6 +121,12 @@
121
121
  width: 22px;
122
122
  height: 22px;
123
123
  font-size: 22px;
124
+ /* #ifdef harmony*/
125
+ color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
126
+ /* #endif*/
127
+ /* #ifndef harmony*/
128
+ color: inherit;
129
+ /* #endif*/
124
130
  }
125
131
  .nut-tabbar-item-icon-box-nav {
126
132
  display: block;
@@ -121,6 +121,12 @@
121
121
  width: 22px;
122
122
  height: 22px;
123
123
  font-size: 22px;
124
+ /* #ifdef harmony*/
125
+ color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
126
+ /* #endif*/
127
+ /* #ifndef harmony*/
128
+ color: inherit;
129
+ /* #endif*/
124
130
  }
125
131
  .nut-tabbar-item-icon-box-nav {
126
132
  display: block;
@@ -24,6 +24,12 @@
24
24
  width: 22px;
25
25
  height: 22px;
26
26
  font-size: 22px;
27
+ /* #ifdef harmony*/
28
+ color: #1a1a1a;
29
+ /* #endif*/
30
+ /* #ifndef harmony*/
31
+ color: inherit;
32
+ /* #endif*/
27
33
  }
28
34
  .nut-tabbar-item-icon-box-nav {
29
35
  display: block;
@@ -20,6 +20,12 @@
20
20
  width: 22px;
21
21
  height: 22px;
22
22
  font-size: 22px;
23
+ /* #ifdef harmony*/
24
+ color: $tabbar-inactive-color;
25
+ /* #endif*/
26
+ /* #ifndef harmony*/
27
+ color: inherit;
28
+ /* #endif*/
23
29
  }
24
30
 
25
31
  &-nav {
@@ -119,14 +119,9 @@ var Tabs = function Tabs(props) {
119
119
  var _useState = (0, _sliced_to_array._)((0, _react.useState)(0), 2), scrollLeft = _useState[0], setScrollLeft = _useState[1];
120
120
  var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(0), 2), scrollTop = _useState1[0], setScrollTop = _useState1[1];
121
121
  var scrollDirection = function scrollDirection(to, direction) {
122
- var count = 0;
123
- var frames = 1;
124
- function animate() {
125
- if (direction === 'horizontal') setScrollLeft(to);
126
- else setScrollTop(to);
127
- if (++count < frames) (0, _raf.default)(animate);
128
- }
129
- animate();
122
+ // 使用ScrollView组件此处不需要手动raf scrollLeft
123
+ if (direction === 'horizontal') setScrollLeft(to);
124
+ else setScrollTop(to);
130
125
  };
131
126
  var scrollIntoView = function scrollIntoView(index) {
132
127
  (0, _raf.default)(function() {
@@ -148,14 +143,11 @@ var Tabs = function Tabs(props) {
148
143
  return prev + curr.width;
149
144
  }, 0);
150
145
  to = left - (navRect.width - titleRect.width) / 2;
151
- // to < 0 说明不需要进行滚动,页面元素已全部显示出来
152
- if (to < 0) return;
153
- to = rtl ? -to : to;
154
146
  }
147
+ scrollDirection(to, direction);
155
148
  (0, _taro.nextTick)(function() {
156
149
  scrollWithAnimation.current = true;
157
150
  });
158
- scrollDirection(to, direction);
159
151
  });
160
152
  });
161
153
  };
@@ -192,6 +184,7 @@ var Tabs = function Tabs(props) {
192
184
  scrollY: direction === 'vertical',
193
185
  scrollLeft: scrollLeft,
194
186
  scrollTop: scrollTop,
187
+ enhanced: true,
195
188
  showScrollbar: false,
196
189
  scrollWithAnimation: rtl && _taro.default.getEnv() !== 'WEB' ? false : scrollWithAnimation.current,
197
190
  id: "nut-tabs-titles-".concat(name || uuid),
@@ -235,7 +228,7 @@ var Tabs = function Tabs(props) {
235
228
  if (!/*#__PURE__*/ _react.default.isValidElement(child)) return null;
236
229
  return /*#__PURE__*/ _react.default.cloneElement(child, (0, _object_spread_props._)((0, _object_spread._)({}, child.props), {
237
230
  active: value === child.props.value,
238
- autoHeightClassName: autoHeight && String(value) !== String(child.props.value || idx) ? 'inactive' : ''
231
+ autoHeightClassName: autoHeight && String(value) !== String(child.props.value || idx) ? 'inactive' : undefined
239
232
  }));
240
233
  }))));
241
234
  };
@@ -115,7 +115,7 @@ var TextArea = function TextArea(props) {
115
115
  autoHeight: autoSize,
116
116
  maxlength: maxLength,
117
117
  placeholder: placeholder !== undefined ? placeholder : locale.placeholder
118
- })), showCount && /*#__PURE__*/ _react.default.createElement(_components.Text, {
118
+ })), showCount && /*#__PURE__*/ _react.default.createElement(_components.View, {
119
119
  className: (0, _classnames.default)("".concat(classPrefix, "-limit"), (0, _define_property._)({}, "".concat(classPrefix, "-limit-disabled"), disabled))
120
120
  }, inputValue.length, "/", maxLength < 0 ? 0 : maxLength)));
121
121
  };
@@ -238,6 +238,9 @@
238
238
  from {
239
239
  transform: translate3d(0, -100%, 0);
240
240
  }
241
+ to {
242
+ transform: translate3d(0, 0%, 0);
243
+ }
241
244
  }
242
245
  @keyframes popup-slide-top-exit {
243
246
  to {
@@ -259,6 +262,9 @@
259
262
  from {
260
263
  transform: translate3d(100%, 0, 0);
261
264
  }
265
+ to {
266
+ transform: translate3d(0%, 0, 0);
267
+ }
262
268
  }
263
269
  @keyframes popup-slide-right-exit {
264
270
  to {
@@ -280,6 +286,9 @@
280
286
  from {
281
287
  transform: translate3d(0, 100%, 0);
282
288
  }
289
+ to {
290
+ transform: translate3d(0, 0%, 0);
291
+ }
283
292
  }
284
293
  @keyframes slide-bottom-exit {
285
294
  to {
@@ -301,6 +310,9 @@
301
310
  from {
302
311
  transform: translate3d(-100%, 0, 0);
303
312
  }
313
+ to {
314
+ transform: translate3d(0%, 0, 0);
315
+ }
304
316
  }
305
317
  @keyframes popup-slide-left-exit {
306
318
  to {
@@ -238,6 +238,9 @@
238
238
  from {
239
239
  transform: translate3d(0, -100%, 0);
240
240
  }
241
+ to {
242
+ transform: translate3d(0, 0%, 0);
243
+ }
241
244
  }
242
245
  @keyframes popup-slide-top-exit {
243
246
  to {
@@ -259,6 +262,9 @@
259
262
  from {
260
263
  transform: translate3d(100%, 0, 0);
261
264
  }
265
+ to {
266
+ transform: translate3d(0%, 0, 0);
267
+ }
262
268
  }
263
269
  @keyframes popup-slide-right-exit {
264
270
  to {
@@ -280,6 +286,9 @@
280
286
  from {
281
287
  transform: translate3d(0, 100%, 0);
282
288
  }
289
+ to {
290
+ transform: translate3d(0, 0%, 0);
291
+ }
283
292
  }
284
293
  @keyframes slide-bottom-exit {
285
294
  to {
@@ -301,6 +310,9 @@
301
310
  from {
302
311
  transform: translate3d(-100%, 0, 0);
303
312
  }
313
+ to {
314
+ transform: translate3d(0%, 0, 0);
315
+ }
304
316
  }
305
317
  @keyframes popup-slide-left-exit {
306
318
  to {
@@ -9,4 +9,4 @@ export interface Rect {
9
9
  height: number;
10
10
  }
11
11
  export declare function makeRect(width: number, height: number): Rect;
12
- export declare const getRectByTaro: (element: any) => Promise<Rect>;
12
+ export declare const getRectByTaro: (element: any, harmonyId?: string) => Promise<Rect>;
@@ -33,7 +33,10 @@ function makeRect(width, height) {
33
33
  }
34
34
  var getRectByTaro = /*#__PURE__*/ function() {
35
35
  var _ref = (0, _async_to_generator._)(function(element) {
36
+ var harmonyId;
37
+ var _arguments = arguments;
36
38
  return (0, _ts_generator._)(this, function(_state) {
39
+ harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
37
40
  if (element) {
38
41
  if (_useclientrect.inBrowser) {
39
42
  return [
@@ -45,7 +48,7 @@ var getRectByTaro = /*#__PURE__*/ function() {
45
48
  return [
46
49
  2,
47
50
  new Promise(function(resolve, reject) {
48
- (0, _taro.createSelectorQuery)().select("#".concat(element.uid)).boundingClientRect().exec(function(param) {
51
+ (0, _taro.createSelectorQuery)().select("#".concat(harmonyId || element.uid)).boundingClientRect().exec(function(param) {
49
52
  var _param = (0, _sliced_to_array._)(param, 1), rects = _param[0];
50
53
  resolve(rects);
51
54
  });
@@ -19,14 +19,13 @@ _export(exports, {
19
19
  return getWindowInfo;
20
20
  }
21
21
  });
22
- var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
23
- var _taro = /*#__PURE__*/ _interop_require_default._(require("@tarojs/taro"));
22
+ var _taro = require("@tarojs/taro");
24
23
  var getDeviceInfo = function getDeviceInfo() {
25
- return _taro.default.canIUse('getDeviceInfo') ? _taro.default.getDeviceInfo() : _taro.default.getSystemInfoSync();
24
+ return (0, _taro.canIUse)('getDeviceInfo') ? (0, _taro.getDeviceInfo)() : (0, _taro.getSystemInfoSync)();
26
25
  };
27
26
  var getWindowInfo = function getWindowInfo() {
28
- return _taro.default.canIUse('getWindowInfo') ? _taro.default.getWindowInfo() : _taro.default.getSystemInfoSync();
27
+ return (0, _taro.canIUse)('getWindowInfo') ? (0, _taro.getWindowInfo)() : (0, _taro.getSystemInfoSync)();
29
28
  };
30
29
  var getAppBaseInfo = function getAppBaseInfo() {
31
- return _taro.default.canIUse('getAppBaseInfo') ? _taro.default.getAppBaseInfo() : _taro.default.getSystemInfoSync();
30
+ return (0, _taro.canIUse)('getAppBaseInfo') ? (0, _taro.getAppBaseInfo)() : (0, _taro.getSystemInfoSync)();
32
31
  };
@@ -0,0 +1,14 @@
1
+ export default main;
2
+ export declare function main(clone: boolean, ...items: any[]): any;
3
+ export declare function main(...items: any[]): any;
4
+ export declare namespace main {
5
+ var clone: typeof import("./merge").clone;
6
+ var isPlainObject: typeof import("./merge").isPlainObject;
7
+ var recursive: typeof import("./merge").recursive;
8
+ }
9
+ export declare function merge(clone: boolean, ...items: any[]): any;
10
+ export declare function merge(...items: any[]): any;
11
+ export declare function recursive(clone: boolean, ...items: any[]): any;
12
+ export declare function recursive(...items: any[]): any;
13
+ export declare function clone<T>(input: T): T;
14
+ export declare function isPlainObject(input: unknown): input is NonNullable<any>;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ clone: function() {
13
+ return clone;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ },
18
+ isPlainObject: function() {
19
+ return isPlainObject;
20
+ },
21
+ main: function() {
22
+ return main;
23
+ },
24
+ merge: function() {
25
+ return merge;
26
+ },
27
+ recursive: function() {
28
+ return recursive;
29
+ }
30
+ });
31
+ var _to_consumable_array = require("@swc/helpers/_/_to_consumable_array");
32
+ var _type_of = require("@swc/helpers/_/_type_of");
33
+ var _default = main;
34
+ function main() {
35
+ for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
36
+ items[_key] = arguments[_key];
37
+ }
38
+ return merge.apply(void 0, (0, _to_consumable_array._)(items));
39
+ }
40
+ main.clone = clone;
41
+ main.isPlainObject = isPlainObject;
42
+ main.recursive = recursive;
43
+ function merge() {
44
+ for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
45
+ items[_key] = arguments[_key];
46
+ }
47
+ return _merge(items[0] === true, false, items);
48
+ }
49
+ function recursive() {
50
+ for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
51
+ items[_key] = arguments[_key];
52
+ }
53
+ return _merge(items[0] === true, true, items);
54
+ }
55
+ function clone(input) {
56
+ if (Array.isArray(input)) {
57
+ var output = [];
58
+ for(var index = 0; index < input.length; ++index)output.push(clone(input[index]));
59
+ return output;
60
+ }
61
+ if (isPlainObject(input)) {
62
+ var output1 = {};
63
+ // eslint-disable-next-line guard-for-in
64
+ for(var index1 in input)output1[index1] = clone(input[index1]);
65
+ return output1;
66
+ }
67
+ return input;
68
+ }
69
+ function isPlainObject(input) {
70
+ if (input === null || (typeof input === "undefined" ? "undefined" : (0, _type_of._)(input)) !== 'object') return false;
71
+ if (Object.getPrototypeOf(input) === null) return true;
72
+ var ref = input;
73
+ while(Object.getPrototypeOf(ref) !== null)ref = Object.getPrototypeOf(ref);
74
+ return Object.getPrototypeOf(input) === ref;
75
+ }
76
+ function _recursiveMerge(base, extend) {
77
+ if (!isPlainObject(base) || !isPlainObject(extend)) return extend;
78
+ for(var key in extend){
79
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;
80
+ base[key] = isPlainObject(base[key]) && isPlainObject(extend[key]) ? _recursiveMerge(base[key], extend[key]) : extend[key];
81
+ }
82
+ return base;
83
+ }
84
+ function _merge(isClone, isRecursive, items) {
85
+ var result;
86
+ if (isClone || !isPlainObject(result = items.shift())) result = {};
87
+ for(var index = 0; index < items.length; ++index){
88
+ var item = items[index];
89
+ // eslint-disable-next-line no-continue
90
+ if (!isPlainObject(item)) continue;
91
+ for(var key in item){
92
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;
93
+ var value = isClone ? clone(item[key]) : item[key];
94
+ result[key] = isRecursive ? _recursiveMerge(result[key], value) : value;
95
+ }
96
+ }
97
+ return result;
98
+ }
@@ -19,22 +19,21 @@ _export(exports, {
19
19
  return web;
20
20
  }
21
21
  });
22
- var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
23
- var _taro = /*#__PURE__*/ _interop_require_default._(require("@tarojs/taro"));
22
+ var _taro = require("@tarojs/taro");
24
23
  var harmony = function harmony() {
25
24
  return [
26
25
  'harmony',
27
26
  'harmonyhybrid',
28
27
  'jdharmony'
29
- ].includes(_taro.default.getEnv().toLowerCase());
28
+ ].includes((0, _taro.getEnv)().toLowerCase());
30
29
  };
31
30
  var web = function web() {
32
31
  return [
33
32
  'web'
34
- ].includes(_taro.default.getEnv().toLowerCase());
33
+ ].includes((0, _taro.getEnv)().toLowerCase());
35
34
  };
36
35
  var miniprogram = function miniprogram() {
37
36
  return [
38
37
  'mini'
39
- ].includes(_taro.default.getEnv().toLowerCase());
38
+ ].includes((0, _taro.getEnv)().toLowerCase());
40
39
  };
@@ -0,0 +1 @@
1
+ export declare function toArray<T>(value?: T | T[] | null): T[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "toArray", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return toArray;
9
+ }
10
+ });
11
+ function toArray(value) {
12
+ if (value === undefined || value === null) {
13
+ return [];
14
+ }
15
+ return Array.isArray(value) ? value : [
16
+ value
17
+ ];
18
+ }
@@ -25,6 +25,7 @@ export function isWindow(val) {
25
25
  };
26
26
  }
27
27
  if (element && element.getBoundingClientRect) {
28
+ console.log(element, element.getBoundingClientRect());
28
29
  return element.getBoundingClientRect();
29
30
  }
30
31
  return {
@@ -238,6 +238,9 @@
238
238
  from {
239
239
  transform: translate3d(0, -100%, 0);
240
240
  }
241
+ to {
242
+ transform: translate3d(0, 0%, 0);
243
+ }
241
244
  }
242
245
  @keyframes popup-slide-top-exit {
243
246
  to {
@@ -259,6 +262,9 @@
259
262
  from {
260
263
  transform: translate3d(100%, 0, 0);
261
264
  }
265
+ to {
266
+ transform: translate3d(0%, 0, 0);
267
+ }
262
268
  }
263
269
  @keyframes popup-slide-right-exit {
264
270
  to {
@@ -280,6 +286,9 @@
280
286
  from {
281
287
  transform: translate3d(0, 100%, 0);
282
288
  }
289
+ to {
290
+ transform: translate3d(0, 0%, 0);
291
+ }
283
292
  }
284
293
  @keyframes slide-bottom-exit {
285
294
  to {
@@ -301,6 +310,9 @@
301
310
  from {
302
311
  transform: translate3d(-100%, 0, 0);
303
312
  }
313
+ to {
314
+ transform: translate3d(0%, 0, 0);
315
+ }
304
316
  }
305
317
  @keyframes popup-slide-left-exit {
306
318
  to {