@nutui/nutui-react-taro 2.0.0-alpha.11 → 2.0.0-alpha.13

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 (213) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/esm/ActionSheet/style/style.css +1 -1
  3. package/dist/esm/ActionSheet.js +1 -3
  4. package/dist/esm/Address/style/style.css +1 -1
  5. package/dist/esm/AnimatingNumbers/style/style.css +1 -1
  6. package/dist/esm/AnimatingNumbers.js +99 -5
  7. package/dist/esm/AvatarGroup.js +1 -1
  8. package/dist/esm/Calendar/style/style.css +1 -1
  9. package/dist/esm/Cascader/style/style.css +1 -1
  10. package/dist/esm/CountDown/style/style.css +1 -1
  11. package/dist/esm/CountDown.js +2 -3
  12. package/dist/esm/DatePicker/style/style.css +1 -1
  13. package/dist/esm/Ellipsis/style/style.css +1 -1
  14. package/dist/esm/Ellipsis.js +1 -1
  15. package/dist/esm/ImagePreview/style/style.css +1 -1
  16. package/dist/esm/NumberKeyboard/style/style.css +1 -1
  17. package/dist/esm/Picker/style/style.css +1 -1
  18. package/dist/esm/Popup/style/style.css +1 -1
  19. package/dist/esm/SearchBar/style/style.css +1 -1
  20. package/dist/esm/SearchBar.js +1 -4
  21. package/dist/esm/ShortPassword/style/style.css +1 -1
  22. package/dist/esm/ShortPassword.js +3 -4
  23. package/dist/esm/SideNavBar/style/style.css +1 -1
  24. package/dist/esm/TimeSelect/style/style.css +1 -1
  25. package/dist/esm/Toast/style/style.css +1 -1
  26. package/dist/esm/Toast.js +2 -3
  27. package/dist/esm/TrendArrow/style/style.css +1 -1
  28. package/dist/esm/TrendArrow.js +2 -3
  29. package/dist/esm/Video.js +3 -3
  30. package/dist/esm/VirtualList/style/style.css +1 -1
  31. package/dist/esm/VirtualList.js +2 -2
  32. package/dist/esm/WaterMark.js +2 -3
  33. package/dist/esm/actionsheet.taro-697a594b.js +54 -0
  34. package/dist/esm/{countdown.taro-22200811.js → countdown.taro-c399cc08.js} +17 -10
  35. package/dist/esm/{ellipsis.taro-02765890.js → ellipsis.taro-f423affa.js} +13 -6
  36. package/dist/esm/nutui-react.es.js +18 -18
  37. package/dist/esm/searchbar.taro-09468fff.js +122 -0
  38. package/dist/esm/shortpassword.taro-eabbde1b.js +90 -0
  39. package/dist/esm/toast.taro-b2937e7c.js +171 -0
  40. package/dist/esm/trendarrow.taro-253025d2.js +70 -0
  41. package/dist/esm/types/src/packages/actionsheet/actionsheet.d.ts +11 -15
  42. package/dist/esm/types/src/packages/actionsheet/actionsheet.taro.d.ts +11 -15
  43. package/dist/esm/types/src/packages/actionsheet/index.d.ts +1 -0
  44. package/dist/esm/types/src/packages/actionsheet/index.taro.d.ts +1 -0
  45. package/dist/esm/types/src/packages/animatingnumbers/countup.d.ts +7 -8
  46. package/dist/esm/types/src/packages/animatingnumbers/countup.taro.d.ts +7 -8
  47. package/dist/esm/types/src/packages/animatingnumbers/demo.d.ts +1 -0
  48. package/dist/esm/types/src/packages/animatingnumbers/demo.taro.d.ts +1 -0
  49. package/dist/esm/types/src/packages/animatingnumbers/index.d.ts +1 -0
  50. package/dist/esm/types/src/packages/animatingnumbers/index.taro.d.ts +1 -0
  51. package/dist/{types/packages/avatargroup/avatargroup.d.ts → esm/types/src/packages/avatargroup/avatargroup.taro.d.ts} +1 -1
  52. package/dist/esm/types/src/packages/avatargroup/index.taro.d.ts +1 -1
  53. package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -1
  54. package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -1
  55. package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -0
  56. package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +1 -0
  57. package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -0
  58. package/dist/esm/types/src/packages/countdown/countdown.d.ts +5 -4
  59. package/dist/esm/types/src/packages/countdown/countdown.taro.d.ts +5 -4
  60. package/dist/esm/types/src/packages/countdown/index.d.ts +1 -0
  61. package/dist/esm/types/src/packages/countdown/index.taro.d.ts +1 -0
  62. package/dist/esm/types/src/packages/ellipsis/ellipsis.taro.d.ts +1 -0
  63. package/dist/esm/types/src/packages/searchbar/index.d.ts +1 -0
  64. package/dist/esm/types/src/packages/searchbar/index.taro.d.ts +1 -0
  65. package/dist/esm/types/src/packages/searchbar/searchbar.d.ts +4 -31
  66. package/dist/esm/types/src/packages/searchbar/searchbar.taro.d.ts +4 -31
  67. package/dist/esm/types/src/packages/shortpassword/index.d.ts +1 -0
  68. package/dist/esm/types/src/packages/shortpassword/index.taro.d.ts +1 -0
  69. package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +17 -20
  70. package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +17 -20
  71. package/dist/esm/types/src/packages/toast/Notification.d.ts +9 -13
  72. package/dist/esm/types/src/packages/toast/index.d.ts +1 -0
  73. package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -0
  74. package/dist/esm/types/src/packages/toast/toast.d.ts +19 -26
  75. package/dist/esm/types/src/packages/toast/toast.taro.d.ts +9 -11
  76. package/dist/esm/types/src/packages/trendarrow/trendarrow.d.ts +8 -10
  77. package/dist/esm/types/src/packages/trendarrow/trendarrow.taro.d.ts +8 -10
  78. package/dist/esm/types/src/packages/video/index.d.ts +1 -0
  79. package/dist/esm/types/src/packages/video/index.taro.d.ts +2 -1
  80. package/dist/esm/types/src/packages/video/video.d.ts +5 -9
  81. package/dist/esm/types/src/packages/video/video.taro.d.ts +6 -9
  82. package/dist/esm/types/src/packages/virtuallist/index.d.ts +1 -0
  83. package/dist/esm/types/src/packages/virtuallist/index.taro.d.ts +1 -0
  84. package/dist/esm/types/src/packages/virtuallist/type.d.ts +0 -18
  85. package/dist/esm/types/src/packages/virtuallist/utils.d.ts +3 -3
  86. package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +15 -4
  87. package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +13 -14
  88. package/dist/esm/types/src/packages/watermark/demo.d.ts +0 -1
  89. package/dist/esm/types/src/packages/watermark/demo.taro.d.ts +0 -1
  90. package/dist/esm/types/src/packages/watermark/index.d.ts +1 -0
  91. package/dist/esm/types/src/packages/watermark/index.taro.d.ts +1 -0
  92. package/dist/esm/types/src/packages/watermark/watermark.d.ts +3 -4
  93. package/dist/esm/types/src/packages/watermark/watermark.taro.d.ts +3 -4
  94. package/dist/esm/video.taro-2a26d7da.js +37 -0
  95. package/dist/esm/{virtuallist.taro-99f03769.js → virtuallist.taro-97d3403a.js} +27 -30
  96. package/dist/esm/{watermark.taro-cef29c03.js → watermark.taro-e2245bb1.js} +12 -13
  97. package/dist/locales/base.js +1 -1
  98. package/dist/locales/en-US.js +1 -1
  99. package/dist/locales/id-ID.js +1 -1
  100. package/dist/locales/tr-TR.js +10 -2
  101. package/dist/locales/zh-CN.js +1 -1
  102. package/dist/locales/zh-TW.js +1 -1
  103. package/dist/locales/zh-UG.js +1 -1
  104. package/dist/nutui.react.es.js +495 -548
  105. package/dist/nutui.react.umd.js +495 -548
  106. package/dist/packages/actionsheet/actionsheet.scss +26 -73
  107. package/dist/packages/animatingnumbers/countup.scss +0 -21
  108. package/dist/packages/countdown/countdown.scss +2 -0
  109. package/dist/packages/ellipsis/ellipsis.scss +4 -0
  110. package/dist/packages/popup/popup.scss +98 -47
  111. package/dist/packages/searchbar/searchbar.scss +13 -71
  112. package/dist/packages/shortpassword/shortpassword.scss +1 -88
  113. package/dist/packages/toast/toast.scss +20 -7
  114. package/dist/packages/trendarrow/trendarrow.scss +4 -3
  115. package/dist/packages/virtuallist/virtuallist.scss +0 -12
  116. package/dist/style.css +1 -1
  117. package/dist/style.mjs +1 -1
  118. package/dist/styles/variables-jmapp.scss +58 -68
  119. package/dist/styles/variables.scss +32 -61
  120. package/dist/types/packages/actionsheet/actionsheet.taro.d.ts +44 -16
  121. package/dist/types/packages/actionsheet/index.taro.d.ts +1 -0
  122. package/dist/types/packages/animate/animate.taro.d.ts +20 -4
  123. package/dist/types/packages/animatingnumbers/countup.taro.d.ts +7 -8
  124. package/dist/types/packages/animatingnumbers/index.taro.d.ts +1 -0
  125. package/dist/types/packages/audio/audio.taro.d.ts +25 -5
  126. package/dist/types/packages/avatar/avatar.taro.d.ts +45 -9
  127. package/dist/types/packages/avatargroup/avatargroup.taro.d.ts +45 -0
  128. package/dist/types/packages/avatargroup/index.taro.d.ts +1 -1
  129. package/dist/types/packages/backtop/backtop.taro.d.ts +20 -4
  130. package/dist/types/packages/badge/badge.taro.d.ts +30 -6
  131. package/dist/types/packages/button/button.taro.d.ts +50 -10
  132. package/dist/types/packages/cascader/cascader.taro.d.ts +80 -16
  133. package/dist/types/packages/cell/cell.taro.d.ts +30 -6
  134. package/dist/types/packages/cellgroup/cellgroup.taro.d.ts +15 -3
  135. package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +40 -8
  136. package/dist/types/packages/circleprogress/circleprogress.taro.d.ts +35 -7
  137. package/dist/types/packages/col/col.taro.d.ts +15 -3
  138. package/dist/types/packages/collapse/collapse.taro.d.ts +25 -5
  139. package/dist/types/packages/collapseitem/collapseitem.taro.d.ts +20 -4
  140. package/dist/types/packages/configprovider/configprovider.d.ts +2 -1
  141. package/dist/types/packages/configprovider/configprovider.taro.d.ts +11 -2
  142. package/dist/types/packages/configprovider/index.d.ts +1 -0
  143. package/dist/types/packages/configprovider/index.taro.d.ts +1 -0
  144. package/dist/types/packages/configprovider/types.d.ts +1 -0
  145. package/dist/types/packages/countdown/countdown.taro.d.ts +68 -15
  146. package/dist/types/packages/countdown/index.taro.d.ts +1 -0
  147. package/dist/types/packages/divider/divider.taro.d.ts +10 -2
  148. package/dist/types/packages/drag/drag.taro.d.ts +15 -3
  149. package/dist/types/packages/elevator/elevator.taro.d.ts +45 -9
  150. package/dist/types/packages/ellipsis/ellipsis.taro.d.ts +46 -9
  151. package/dist/types/packages/empty/empty.taro.d.ts +20 -4
  152. package/dist/types/packages/fixednav/fixednav.taro.d.ts +50 -10
  153. package/dist/types/packages/grid/grid.taro.d.ts +35 -7
  154. package/dist/types/packages/griditem/griditem.taro.d.ts +5 -1
  155. package/dist/types/packages/imagepreview/imagepreview.taro.d.ts +50 -10
  156. package/dist/types/packages/indicator/indicator.taro.d.ts +15 -3
  157. package/dist/types/packages/input/input.taro.d.ts +100 -20
  158. package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +85 -17
  159. package/dist/types/packages/menu/menu.taro.d.ts +20 -4
  160. package/dist/types/packages/menuitem/menuitem.taro.d.ts +35 -7
  161. package/dist/types/packages/noticebar/noticebar.taro.d.ts +60 -12
  162. package/dist/types/packages/notify/notify.taro.d.ts +30 -6
  163. package/dist/types/packages/numberkeyboard/numberkeyboard.taro.d.ts +50 -10
  164. package/dist/types/packages/overlay/index.d.ts +3 -0
  165. package/dist/types/packages/overlay/overlay.d.ts +14 -0
  166. package/dist/types/packages/overlay/overlay.taro.d.ts +40 -8
  167. package/dist/types/packages/pagination/pagination.taro.d.ts +55 -11
  168. package/dist/types/packages/picker/picker.taro.d.ts +55 -11
  169. package/dist/types/packages/popup/popup.taro.d.ts +75 -15
  170. package/dist/types/packages/price/price.taro.d.ts +35 -7
  171. package/dist/types/packages/progress/progress.taro.d.ts +35 -7
  172. package/dist/types/packages/pulltorefresh/pulltorefresh.taro.d.ts +55 -11
  173. package/dist/types/packages/radio/radio.taro.d.ts +45 -9
  174. package/dist/types/packages/radiogroup/radiogroup.taro.d.ts +30 -6
  175. package/dist/types/packages/range/range.taro.d.ts +80 -16
  176. package/dist/types/packages/searchbar/index.taro.d.ts +1 -0
  177. package/dist/types/packages/searchbar/searchbar.taro.d.ts +72 -44
  178. package/dist/types/packages/shortpassword/index.taro.d.ts +1 -0
  179. package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +89 -24
  180. package/dist/types/packages/skeleton/skeleton.taro.d.ts +35 -7
  181. package/dist/types/packages/step/step.taro.d.ts +20 -4
  182. package/dist/types/packages/steps/steps.taro.d.ts +15 -3
  183. package/dist/types/packages/sticky/sticky.taro.d.ts +25 -5
  184. package/dist/types/packages/swipe/swipe.taro.d.ts +47 -11
  185. package/dist/types/packages/swiper/swiper.taro.d.ts +35 -7
  186. package/dist/types/packages/switch/switch.taro.d.ts +30 -6
  187. package/dist/types/packages/tabbar/tabbar.taro.d.ts +35 -7
  188. package/dist/types/packages/tabbaritem/tabbaritem.taro.d.ts +10 -2
  189. package/dist/types/packages/tabpane/tabpane.taro.d.ts +15 -3
  190. package/dist/types/packages/tabs/tabs.taro.d.ts +60 -12
  191. package/dist/types/packages/textarea/textarea.taro.d.ts +60 -12
  192. package/dist/types/packages/toast/index.taro.d.ts +1 -0
  193. package/dist/types/packages/toast/toast.taro.d.ts +9 -11
  194. package/dist/types/packages/trendarrow/trendarrow.taro.d.ts +57 -15
  195. package/dist/types/packages/uploader/uploader.taro.d.ts +165 -33
  196. package/dist/types/packages/video/index.taro.d.ts +2 -1
  197. package/dist/types/packages/video/video.taro.d.ts +41 -0
  198. package/dist/types/packages/virtuallist/index.taro.d.ts +1 -0
  199. package/dist/types/packages/virtuallist/type.d.ts +0 -17
  200. package/dist/types/packages/virtuallist/utils.d.ts +3 -3
  201. package/dist/types/packages/virtuallist/virtuallist.taro.d.ts +45 -14
  202. package/dist/types/packages/watermark/index.taro.d.ts +1 -0
  203. package/dist/types/packages/watermark/watermark.taro.d.ts +72 -17
  204. package/package.json +1 -1
  205. package/dist/esm/actionsheet.taro-d2217152.js +0 -61
  206. package/dist/esm/animatingnumbers.taro-c2a52dbd.js +0 -103
  207. package/dist/esm/searchbar.taro-37ade36e.js +0 -159
  208. package/dist/esm/shortpassword.taro-f7292032.js +0 -146
  209. package/dist/esm/toast.taro-92c10e1d.js +0 -114
  210. package/dist/esm/trendarrow.taro-0cf43935.js +0 -72
  211. package/dist/esm/video-5d106e33.js +0 -73
  212. package/dist/types/packages/video/video.d.ts +0 -24
  213. /package/dist/esm/{avatargroup-ad5ffb46.js → avatargroup.taro-ad5ffb46.js} +0 -0
@@ -1,25 +1,90 @@
1
- import React, { CSSProperties, FunctionComponent } from 'react';
2
- import { BasicComponent } from '../../utils/typings';
3
- export interface ShortPasswordProps extends BasicComponent {
4
- title: string;
5
- description: string;
6
- tips: string;
7
- tipsIcon: React.ReactNode;
8
- iconSize: string | number;
9
- visible: boolean;
10
- modelValue: string | number;
11
- errorMsg: string;
12
- noButton: boolean;
13
- closeOnClickOverlay: boolean;
14
- length: string | number;
15
- className: string;
16
- style?: CSSProperties;
17
- autoFocus?: boolean;
18
- onChange: (value: string | number) => void;
19
- onOk: (value: string | number) => void;
20
- onCancel: () => void;
21
- onClose: () => void;
22
- onTips: () => void;
23
- onComplete: (value: string | number) => void;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { PopupProps } from '../../packages/popup/popup.taro';
3
+ export interface ShortPasswordProps extends PopupProps {
4
+ /**
5
+ * 密码字符串
6
+ * @default -
7
+ */
8
+ value: string
9
+ /**
10
+ * 是否展示短密码框
11
+ * @default false
12
+ */
13
+ visible: boolean
14
+ /**
15
+ * 是否展示明文
16
+ * @default false
17
+ */
18
+ plain: boolean
19
+ /**
20
+ * 标题
21
+ * @default 请输入密码
22
+ */
23
+ title: ReactNode
24
+ /**
25
+ * 密码框描述
26
+ * @default 您使用了虚拟资产,请进行验证
27
+ */
28
+ description: ReactNode
29
+ /**
30
+ * 提示语
31
+ * @default 忘记密码
32
+ */
33
+ tips: ReactNode
34
+ /**
35
+ * 是否隐藏底部按钮
36
+ * @default true
37
+ */
38
+ hideFooter: boolean
39
+ /**
40
+ * 密码长度,取值为4~6
41
+ * @default 6
42
+ */
43
+ length: number
44
+ /**
45
+ * 错误信息提示
46
+ * @default -
47
+ */
48
+ error: ReactNode
49
+ /**
50
+ * 自动聚焦
51
+ * @default false
52
+ */
53
+ autoFocus: boolean
54
+ /**
55
+ * 输入框聚焦
56
+ * @default -
57
+ */
58
+ onFocus: () => void
59
+ /**
60
+ * 输入密码时触发事件
61
+ * @default -
62
+ */
63
+ onChange: (value: string) => void
64
+ /**
65
+ * 点击确认时触发事件
66
+ * @default -
67
+ */
68
+ onConfirm: (value: string) => void
69
+ /**
70
+ * 点击取消时触发事件
71
+ * @default -
72
+ */
73
+ onCancel: () => void
74
+ /**
75
+ * 点击关闭图标和遮罩时触发事件
76
+ * @default -
77
+ */
78
+ onClose: () => void
79
+ /**
80
+ * 点击忘记密码时触发事件
81
+ * @default -
82
+ */
83
+ onTips: () => void
84
+ /**
85
+ * 输入完成的回调
86
+ * @default -
87
+ */
88
+ onComplete: (value: string) => void
24
89
  }
25
- export declare const ShortPassword: FunctionComponent<Partial<ShortPasswordProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
90
+ export declare const ShortPassword: FunctionComponent<Partial<ShortPasswordProps>>;
@@ -2,13 +2,41 @@ import { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  type avatarShape = 'round' | 'square';
4
4
  export interface SkeletonProps extends BasicComponent {
5
- animated: boolean;
6
- rows: number;
7
- title: boolean;
8
- avatar: boolean;
9
- avatarSize: string;
10
- visible: boolean;
11
- avatarShape: avatarShape;
5
+ /**
6
+ * 是否开启骨架屏动画
7
+ * @default false
8
+ */
9
+ animated: boolean
10
+ /**
11
+ * 设置段落行数
12
+ * @default 1
13
+ */
14
+ rows: number
15
+ /**
16
+ * 是否显示段落标题
17
+ * @default true
18
+ */
19
+ title: boolean
20
+ /**
21
+ * 是否显示头像
22
+ * @default false
23
+ */
24
+ avatar: boolean
25
+ /**
26
+ * 头像大小
27
+ * @default 50px
28
+ */
29
+ avatarSize: string
30
+ /**
31
+ * 是否显示骨架屏(true不显示骨架屏,false显示骨架屏)
32
+ * @default true
33
+ */
34
+ visible: boolean
35
+ /**
36
+ * 头像形状:正方形/圆形
37
+ * @default round
38
+ */
39
+ avatarShape: avatarShape
12
40
  }
13
41
  export declare const Skeleton: FunctionComponent<Partial<SkeletonProps>>;
14
42
  export {};
@@ -1,9 +1,25 @@
1
1
  import React, { FunctionComponent, ReactNode } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface StepProps extends BasicComponent {
4
- title: ReactNode;
5
- description: ReactNode;
6
- value: number;
7
- icon: ReactNode;
4
+ /**
5
+ * 流程步骤的标题
6
+ * @default ''
7
+ */
8
+ title: ReactNode
9
+ /**
10
+ * 流程步骤的描述性文字
11
+ * @default ''
12
+ */
13
+ description: ReactNode
14
+ /**
15
+ * 流程步骤的索引
16
+ * @default 0
17
+ */
18
+ value: number
19
+ /**
20
+ * 图标(来自Icon组件的name属性)
21
+ * @default ''
22
+ */
23
+ icon: ReactNode
8
24
  }
9
25
  export declare const Step: FunctionComponent<Partial<StepProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>>;
@@ -1,9 +1,21 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface StepsProps extends BasicComponent {
4
- value: number;
5
- direction: string;
6
- dot: boolean;
4
+ /**
5
+ * 当前所在的步骤
6
+ * @default 0
7
+ */
8
+ value: number
9
+ /**
10
+ * 显示方向,horizontal,vertical
11
+ * @default horizontal
12
+ */
13
+ direction: string
14
+ /**
15
+ * 点状步骤条
16
+ * @default false
17
+ */
18
+ dot: boolean
7
19
  onStepClick: (index: number) => void;
8
20
  }
9
21
  export declare const Steps: FunctionComponent<Partial<StepsProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -1,10 +1,30 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface StickyProps extends BasicComponent {
4
- container: React.RefObject<HTMLElement>;
5
- position: 'top' | 'bottom';
6
- threshold: number;
7
- zIndex: number;
8
- onChange: (val: boolean) => void;
4
+ /**
5
+ * 容器的 ref
6
+ * @default -
7
+ */
8
+ container: React.RefObject<HTMLElement>
9
+ /**
10
+ * 吸附位置(top、bottom)
11
+ * @default top
12
+ */
13
+ position: 'top' | 'bottom'
14
+ /**
15
+ * 距离,当 position 为 top 时,设置的是 top
16
+ * @default 0
17
+ */
18
+ threshold: number
19
+ /**
20
+ * 吸附时的层级
21
+ * @default 2000
22
+ */
23
+ zIndex: number
24
+ /**
25
+ * 吸附状态改变时触发
26
+ * @default -
27
+ */
28
+ onChange: (val: boolean) => void
9
29
  }
10
30
  export declare const Sticky: FunctionComponent<Partial<StickyProps>>;
@@ -9,31 +9,67 @@ export interface SwipeProps {
9
9
  className: string;
10
10
  /** 自定义样式 */
11
11
  style: React.CSSProperties;
12
- /** 标识符,可以在事件参数中获取到 */
12
+ /**
13
+ * 标识符,可以在事件参数中获取到
14
+ * @default -
15
+ */
13
16
  name?: string | number;
14
- /** 左侧滑动区域的内容 */
17
+ /**
18
+ * 左侧滑动区域的内容
19
+ * @default -
20
+ */
15
21
  leftAction?: React.ReactNode;
16
- /** 右侧滑动区域的内容 */
22
+ /**
23
+ * 右侧滑动区域的内容
24
+ * @default -
25
+ */
17
26
  rightAction?: React.ReactNode;
18
- /** 关闭前的回调函数,返回 false 可阻止关闭,支持返回 Promise */
27
+ /**
28
+ * 关闭前的回调函数,返回滑动区域所在方向 position
29
+ * @default -
30
+ */
19
31
  beforeClose?: (position: string) => void;
20
- /** 是否禁用 */
32
+ /**
33
+ * 是否禁用滑动
34
+ * @default false
35
+ */
21
36
  disabled?: boolean;
22
- /** 打开时触发 */
37
+ /**
38
+ * 打开单元格侧边栏
39
+ * @default -
40
+ */
23
41
  onOpen?: ({ name, position, }: {
24
42
  name: string | number;
25
43
  position: SwipeSide;
26
44
  }) => void;
27
- /** 关闭时触发 */
45
+ /**
46
+ * 收起单元格侧边栏
47
+ * @default -
48
+ */
28
49
  onClose?: ({ name, position, }: {
29
50
  name: string | number;
30
51
  position: SwipeSide;
31
52
  }) => void;
32
- /** 点击时触发 */
53
+ /**
54
+ * 点击左侧或者右侧时触发
55
+ * @default -
56
+ */
33
57
  onActionClick?: (event: Event, position: SwipeSide) => void;
34
- onTouchStart?: (event: Event) => void;
35
- onTouchEnd?: (event: Event) => void;
36
- onTouchMove?: (event: Event) => void;
58
+ /**
59
+ * onTouchStart
60
+ * @default -
61
+ */
62
+ onTouchStart?: (event: Event) => void
63
+ /**
64
+ * onTouchEnd
65
+ * @default -
66
+ */
67
+ onTouchEnd?: (event: Event) => void
68
+ /**
69
+ * onTouchMove
70
+ * @default -
71
+ */
72
+ onTouchMove?: (event: Event) => void
37
73
  children?: React.ReactNode;
38
74
  }
39
75
  export declare const Swipe: React.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchStart" | "onTouchMove" | "onTouchEnd"> & React.RefAttributes<SwipeInstance>>;
@@ -1,12 +1,40 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { SwiperProps as TaroSwiperProps } from '@tarojs/components';
3
3
  export interface SwiperProps extends Omit<TaroSwiperProps, 'ref'> {
4
- width: number;
5
- height: number | string;
6
- direction: 'horizontal' | 'vertical';
7
- indicator: ReactNode;
8
- autoPlay: boolean;
9
- loop: boolean;
10
- defaultValue: number;
4
+ /**
5
+ * 轮播卡片的宽度
6
+ * @default -
7
+ */
8
+ width: number
9
+ /**
10
+ * 轮播卡片的高度
11
+ * @default -
12
+ */
13
+ height: number | string
14
+ /**
15
+ * 轮播方向,可选值horizontal,vertical
16
+ * @default horizontal
17
+ */
18
+ direction: 'horizontal' | 'vertical'
19
+ /**
20
+ * 分页指示器是否展示
21
+ * @default false
22
+ */
23
+ indicator: ReactNode
24
+ /**
25
+ * 自动轮播时长,0表示不会自动轮播
26
+ * @default false
27
+ */
28
+ autoPlay: boolean
29
+ /**
30
+ * 是否循环轮播
31
+ * @default true
32
+ */
33
+ loop: boolean
34
+ /**
35
+ * 初始化索引值
36
+ * @default 0
37
+ */
38
+ defaultValue: number
11
39
  }
12
40
  export declare const Swiper: React.ForwardRefExoticComponent<Partial<SwiperProps> & React.RefAttributes<unknown>>;
@@ -1,11 +1,35 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface SwitchProps extends BasicComponent {
4
- checked: boolean;
5
- defaultChecked: boolean;
6
- disabled: boolean;
7
- activeText: string;
8
- inactiveText: string;
9
- onChange: (val: boolean, event: React.MouseEvent) => void;
4
+ /**
5
+ * 开关状态,受控
6
+ * @default false
7
+ */
8
+ checked: boolean
9
+ /**
10
+ * 开关状态,非受控
11
+ * @default false
12
+ */
13
+ defaultChecked: boolean
14
+ /**
15
+ * 禁用状态
16
+ * @default false
17
+ */
18
+ disabled: boolean
19
+ /**
20
+ * 打开时文字描述
21
+ * @default -
22
+ */
23
+ activeText: string
24
+ /**
25
+ * 关闭时文字描述
26
+ * @default -
27
+ */
28
+ inactiveText: string
29
+ /**
30
+ * 切换开关时触发
31
+ * @default -
32
+ */
33
+ onChange: (val: boolean, event: React.MouseEvent) => void
10
34
  }
11
35
  export declare const Switch: FunctionComponent<Partial<SwitchProps>>;
@@ -2,13 +2,41 @@ import { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  import TabbarItem from '../tabbaritem/index.taro';
4
4
  export interface TabbarProps extends BasicComponent {
5
- defaultValue: number;
6
- value?: number;
7
- fixed: boolean;
8
- inactiveColor: string;
9
- activeColor: string;
10
- safeArea: boolean;
11
- onSwitch: (value: number) => void;
5
+ /**
6
+ * 默认选中的标签的索引值
7
+ * @default 0
8
+ */
9
+ defaultValue: number
10
+ /**
11
+ * 选中的标签的索引值
12
+ * @default -
13
+ */
14
+ value?: number
15
+ /**
16
+ * 是否固定在页面底部,为 true 时默认开启 safeArea
17
+ * @default false
18
+ */
19
+ fixed: boolean
20
+ /**
21
+ * icon未激活的颜色
22
+ * @default #7d7e80
23
+ */
24
+ inactiveColor: string
25
+ /**
26
+ * icon激活的颜色
27
+ * @default #1989fa
28
+ */
29
+ activeColor: string
30
+ /**
31
+ * 是否开启iphone系列全面屏底部安全区适配
32
+ * @default false
33
+ */
34
+ safeArea: boolean
35
+ /**
36
+ * 切换页签时触发事件
37
+ * @default -
38
+ */
39
+ onSwitch: (value: number) => void
12
40
  }
13
41
  export declare const Tabbar: FunctionComponent<Partial<TabbarProps>> & {
14
42
  Item: typeof TabbarItem;
@@ -1,8 +1,16 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
2
  import { BadgeProps } from '../badge/badge.taro';
3
3
  export interface TabbarItemProps extends BadgeProps {
4
- title: ReactNode;
5
- icon: ReactNode;
4
+ /**
5
+ * 标签页的标题
6
+ * @default -
7
+ */
8
+ title: ReactNode
9
+ /**
10
+ * 自定义图标
11
+ * @default -
12
+ */
13
+ icon: ReactNode
6
14
  active: boolean;
7
15
  activeColor: string;
8
16
  inactiveColor: string;
@@ -3,9 +3,21 @@ interface TabPanelInnerProps {
3
3
  autoHeightClassName: string;
4
4
  }
5
5
  export interface TabPaneProps {
6
- title: string | number;
7
- value: string | number;
8
- disabled: boolean;
6
+ /**
7
+ * 标题
8
+ * @default -
9
+ */
10
+ title: string | number
11
+ /**
12
+ * 标签 Key , 匹配的标识符, 默认为索引值
13
+ * @default -
14
+ */
15
+ value: string | number
16
+ /**
17
+ * 是否禁用标签
18
+ * @default false
19
+ */
20
+ disabled: boolean
9
21
  className: string;
10
22
  children?: React.ReactNode;
11
23
  }
@@ -8,18 +8,66 @@ export type TabsTitle = {
8
8
  value: string | number;
9
9
  };
10
10
  export interface TabsProps extends BasicComponent {
11
- tabStyle: React.CSSProperties;
12
- value: string | number;
13
- defaultValue: string | number;
14
- activeColor: string;
15
- direction: 'horizontal' | 'vertical';
16
- activeType: 'line' | 'smile';
17
- duration: number | string;
18
- align: 'left' | 'right';
19
- title: () => JSX.Element[];
20
- onChange: (index: string | number) => void;
21
- onClick: (index: string | number) => void;
22
- autoHeight: boolean;
11
+ /**
12
+ * 标签栏样式
13
+ * @default {}
14
+ */
15
+ tabStyle: React.CSSProperties
16
+ /**
17
+ * 当前激活 tab 面板的值
18
+ * @default 0
19
+ */
20
+ value: string | number
21
+ /**
22
+ * 初始化激活 tab 的值
23
+ * @default 0
24
+ */
25
+ defaultValue: string | number
26
+ /**
27
+ * 标签选中色
28
+ * @default #1a1a1a
29
+ */
30
+ activeColor: string
31
+ /**
32
+ * 使用横纵方向 可选值 horizontal、vertical
33
+ * @default horizontal
34
+ */
35
+ direction: 'horizontal' | 'vertical'
36
+ /**
37
+ * 选中底部展示样式 可选值 line、smile
38
+ * @default line
39
+ */
40
+ activeType: 'line' | 'smile'
41
+ /**
42
+ * 切换动画时长,单位 ms 0 代表无动画
43
+ * @default 300
44
+ */
45
+ duration: number | string
46
+ /**
47
+ * 标题左对齐
48
+ * @default -
49
+ */
50
+ align: 'left' | 'right'
51
+ /**
52
+ * 自定义导航区域
53
+ * @default -
54
+ */
55
+ title: () => JSX.Element[]
56
+ /**
57
+ * 当前激活的标签改变时触发
58
+ * @default -
59
+ */
60
+ onChange: (index: string | number) => void
61
+ /**
62
+ * 点击标签时触发
63
+ * @default -
64
+ */
65
+ onClick: (index: string | number) => void
66
+ /**
67
+ * 自动高度。设置为 true 时,nut-tabs 和 nut-tabs\_\_content 会随着当前 nut-tabpane 的高度而发生变化。
68
+ * @default false
69
+ */
70
+ autoHeight: boolean
23
71
  children?: React.ReactNode;
24
72
  }
25
73
  export declare const Tabs: FunctionComponent<Partial<TabsProps>> & {
@@ -2,17 +2,65 @@ import { FunctionComponent } from 'react';
2
2
  import { TextareaProps } from '@tarojs/components';
3
3
  import { BasicComponent } from '../../utils/typings';
4
4
  export interface TextAreaProps extends Omit<TextareaProps, 'showCount' | 'onFocus' | 'onBlur'>, Omit<BasicComponent, 'style'> {
5
- value: string;
6
- defaultValue: string;
7
- showCount: boolean;
8
- maxLength: number;
9
- rows: number;
10
- placeholder: string;
11
- readOnly: boolean;
12
- disabled: boolean;
13
- autoSize: boolean;
14
- onChange: (value: string) => void;
15
- onBlur: (event: Event) => void;
16
- onFocus: (event: Event) => void;
5
+ /**
6
+ * 输入框内容,受控
7
+ * @default -
8
+ */
9
+ value: string
10
+ /**
11
+ * 初始默认值,非受控
12
+ * @default -
13
+ */
14
+ defaultValue: string
15
+ /**
16
+ * textarea 是否展示输入字符。须配合maxLength使用
17
+ * @default false
18
+ */
19
+ showCount: boolean
20
+ /**
21
+ * 限制最长输入字符,-1 表示无限制
22
+ * @default 140
23
+ */
24
+ maxLength: number
25
+ /**
26
+ * textarea 的行数(仅支持H5)
27
+ * @default 2
28
+ */
29
+ rows: number
30
+ /**
31
+ * 设置占位提示文字
32
+ * @default 请输入内容
33
+ */
34
+ placeholder: string
35
+ /**
36
+ * 只读属性
37
+ * @default false
38
+ */
39
+ readOnly: boolean
40
+ /**
41
+ * 禁用属性
42
+ * @default false
43
+ */
44
+ disabled: boolean
45
+ /**
46
+ * 高度是否可拉伸
47
+ * @default false
48
+ */
49
+ autoSize: boolean
50
+ /**
51
+ * 输入内容时触发
52
+ * @default -
53
+ */
54
+ onChange: (value: string) => void
55
+ /**
56
+ * 失焦时触发
57
+ * @default -
58
+ */
59
+ onBlur: (event: Event) => void
60
+ /**
61
+ * 聚焦时触发
62
+ * @default -
63
+ */
64
+ onFocus: (event: Event) => void
17
65
  }
18
66
  export declare const TextArea: FunctionComponent<Partial<TextAreaProps>>;
@@ -1,2 +1,3 @@
1
1
  import { Toast } from './toast.taro';
2
+ export type { ToastProps, ToastPositionType } from './toast.taro';
2
3
  export default Toast;