@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,18 +1,71 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
2
- export interface CountDownProps {
3
- className?: string;
4
- style?: CSSProperties;
5
- paused: boolean;
6
- startTime: number;
7
- endTime: number;
8
- millisecond: boolean;
9
- format: string;
10
- autoStart: boolean;
11
- time: number;
12
- onEnd: () => void;
13
- onPaused: (restTime: number) => void;
14
- onRestart: (restTime: number) => void;
15
- onUpdate: (restTime: any) => void;
1
+ import React, { ReactNode } from 'react';
2
+ import { BasicComponent } from '../../utils/typings';
3
+ export interface CountDownProps extends BasicComponent {
4
+ /**
5
+ * 是否暂停
6
+ * @default false
7
+ */
8
+ paused: boolean
9
+ /**
10
+ * 开始时间
11
+ * @default Date.now()
12
+ */
13
+ startTime: number
14
+ /**
15
+ * 结束时间
16
+ * @default Date.now()
17
+ */
18
+ endTime: number
19
+ /**
20
+ * 剩余时间,单位是毫秒
21
+ * @default 0
22
+ */
23
+ remainingTime: number
24
+ /**
25
+ * 是否开启毫秒级渲染
26
+ * @default false
27
+ */
28
+ millisecond: boolean
29
+ /**
30
+ * 时间格式
31
+ * @default HH:mm:ss
32
+ */
33
+ format: string
34
+ /**
35
+ * 是否自动开始倒计时
36
+ * @default true
37
+ */
38
+ autoStart: boolean
39
+ /**
40
+ * 倒计时显示时间,单位是毫秒。autoStart 为 false 时生效
41
+ * @default 0
42
+ */
43
+ time: number
44
+ /**
45
+ * 销毁实例
46
+ * @default false
47
+ */
48
+ destroy: boolean
49
+ /**
50
+ * 倒计时结束时回调函数
51
+ * @default -
52
+ */
53
+ onEnd: () => void
54
+ /**
55
+ * 暂停倒计时回调函数
56
+ * @default -
57
+ */
58
+ onPaused: (restTime: number) => void
59
+ /**
60
+ * 重新开始倒计时回调函数
61
+ * @default -
62
+ */
63
+ onRestart: (restTime: number) => void
64
+ /**
65
+ * 自定义展示内容时,实时更新倒计时数据回调函数
66
+ * @default -
67
+ */
68
+ onUpdate: (restTime: any) => void
16
69
  children: ReactNode;
17
70
  }
18
71
  export declare const CountDown: React.ForwardRefExoticComponent<Partial<CountDownProps> & React.RefAttributes<unknown>>;
@@ -1,2 +1,3 @@
1
1
  import { CountDown } from './countdown.taro';
2
+ export type { CountDownProps } from './countdown.taro';
2
3
  export default CountDown;
@@ -3,7 +3,15 @@ import { BasicComponent } from '../../utils/typings';
3
3
  export type ContentPositionType = 'left' | 'center' | 'right';
4
4
  export type DirectionType = 'horizontal' | 'vertical';
5
5
  export interface DividerProps extends BasicComponent {
6
- contentPosition: ContentPositionType;
7
- direction?: DirectionType;
6
+ /**
7
+ * 内容位置,可选值为 left right center
8
+ * @default center
9
+ */
10
+ contentPosition: ContentPositionType
11
+ /**
12
+ * 水平还是垂直类型,可选值为 horizontal vertical
13
+ * @default horizontal
14
+ */
15
+ direction?: DirectionType
8
16
  }
9
17
  export declare const Divider: FunctionComponent<Partial<DividerProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -1,13 +1,25 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface DragProps extends BasicComponent {
4
- attract: boolean;
5
- direction: 'x' | 'y' | 'lock' | undefined;
4
+ /**
5
+ * 是否开启自动吸边
6
+ * @default false
7
+ */
8
+ attract: boolean
9
+ /**
10
+ * 拖拽元素的拖拽方向限制,x、y、all三选一
11
+ * @default all
12
+ */
13
+ direction: 'x' | 'y' | 'lock' | undefined
14
+ /**
15
+ * 拖拽元素的拖拽边界
16
+ * @default {top: 0, left: 0, right: 0, bottom: 0}
17
+ */
6
18
  boundary: {
7
19
  top: number;
8
20
  left: number;
9
21
  right: number;
10
22
  bottom: number;
11
- };
23
+ }
12
24
  }
13
25
  export declare const Drag: FunctionComponent<Partial<DragProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -2,16 +2,52 @@ import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export declare const elevatorContext: React.Context<ElevatorData>;
4
4
  export interface ElevatorProps extends BasicComponent {
5
- height: number | string;
6
- floorKey: string;
7
- list: any[];
8
- sticky: boolean;
9
- spaceHeight: number;
10
- titleHeight: number;
11
- showKeys: boolean;
5
+ /**
6
+ * 电梯区域的高度
7
+ * @default 200px
8
+ */
9
+ height: number | string
10
+ /**
11
+ * 索引 key 值
12
+ * @default title
13
+ */
14
+ floorKey: string
15
+ /**
16
+ * 索引列表
17
+ * @default [{id: 0, name: ''}]
18
+ */
19
+ list: any[]
20
+ /**
21
+ * 索引是否吸顶
22
+ * @default false
23
+ */
24
+ sticky: boolean
25
+ /**
26
+ * 右侧锚点的上下间距
27
+ * @default 23
28
+ */
29
+ spaceHeight: number
30
+ /**
31
+ * 左侧索引的高度
32
+ * @default 35
33
+ */
34
+ titleHeight: number
35
+ /**
36
+ * 展示右侧导航
37
+ * @default true
38
+ */
39
+ showKeys: boolean
12
40
  children: React.ReactNode;
13
- onClickItem: (key: string, item: ElevatorData) => void;
14
- onClickIndex: (key: string) => void;
41
+ /**
42
+ * 点击内容
43
+ * @default false
44
+ */
45
+ onClickItem: (key: string, item: ElevatorData) => void
46
+ /**
47
+ * 点击索引
48
+ * @default false
49
+ */
50
+ onClickIndex: (key: string) => void
15
51
  }
16
52
  interface ElevatorData {
17
53
  name: string;
@@ -2,14 +2,51 @@ import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export type EllipsisDirection = 'start' | 'end' | 'middle';
4
4
  export interface EllipsisProps extends BasicComponent {
5
- content: string;
6
- direction: EllipsisDirection;
7
- rows: number | string;
8
- expandText: string;
9
- collapseText: string;
10
- symbol: string;
11
- lineHeight: number | string;
12
- onClick: () => void;
13
- onChange: (type: string) => void;
5
+ /**
6
+ * 文本内容
7
+ * @default -
8
+ */
9
+ content: string
10
+ /**
11
+ * 省略位置
12
+ * @default end
13
+ */
14
+ direction: EllipsisDirection
15
+ /**
16
+ * 展示几行
17
+ * @default 1
18
+ */
19
+ rows: number | string
20
+ /**
21
+ * 展开操作的文案
22
+ * @default -
23
+ */
24
+ expandText: string
25
+ /**
26
+ * 收起操作的文案
27
+ * @default -
28
+ */
29
+ collapseText: string
30
+ /**
31
+ * 省略的符号
32
+ * @default ...
33
+ */
34
+ symbol: string
35
+ /**
36
+ * 容器的行高
37
+ * @default 20
38
+ */
39
+ lineHeight: number | string
40
+ width: number | string;
41
+ /**
42
+ * 文本点击是触发
43
+ * @default -
44
+ */
45
+ onClick: () => void
46
+ /**
47
+ * 点击展开收起时触发
48
+ * @default -
49
+ */
50
+ onChange: (type: string) => void
14
51
  }
15
52
  export declare const Ellipsis: FunctionComponent<Partial<EllipsisProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange'>>;
@@ -1,9 +1,25 @@
1
1
  import React, { FunctionComponent, ReactNode } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface EmptyProps extends BasicComponent {
4
- image?: ReactNode;
5
- imageSize: number | string;
6
- description: ReactNode;
7
- status: 'empty' | 'error' | 'network';
4
+ /**
5
+ * 图片,支持传入图片 URL
6
+ * @default -
7
+ */
8
+ image?: ReactNode
9
+ /**
10
+ * 图片大小,number 类型单位为 px
11
+ * @default ''
12
+ */
13
+ imageSize: number | string
14
+ /**
15
+ * 图片下方的描述文字
16
+ * @default ''
17
+ */
18
+ description: ReactNode
19
+ /**
20
+ * 默认图片错误类型
21
+ * @default 'empty'
22
+ */
23
+ status: 'empty' | 'error' | 'network'
8
24
  }
9
25
  export declare const Empty: FunctionComponent<Partial<EmptyProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -6,15 +6,55 @@ export type FixedNavPosition = {
6
6
  bottom?: string;
7
7
  };
8
8
  export interface FixedNavProps extends BasicComponent {
9
- visible: boolean;
10
- overlay: boolean;
11
- list: Array<any>;
12
- activeText: string;
13
- inactiveText: string;
14
- position: FixedNavPosition;
15
- type: FixedNavDirection;
16
- onChange: (item: any) => void;
17
- onSelect: (item: any, event: MouseEvent) => void;
18
- content: React.ReactNode;
9
+ /**
10
+ * 是否打开
11
+ * @default false
12
+ */
13
+ visible: boolean
14
+ /**
15
+ * 展开时是否显示遮罩
16
+ * @default true
17
+ */
18
+ overlay: boolean
19
+ /**
20
+ * 悬浮列表内容数据
21
+ * @default []
22
+ */
23
+ list: Array<any>
24
+ /**
25
+ * 收起列表按钮文案
26
+ * @default 收起导航
27
+ */
28
+ activeText: string
29
+ /**
30
+ * 展开列表按钮文案
31
+ * @default 快速导航
32
+ */
33
+ inactiveText: string
34
+ /**
35
+ * fixed 垂直位置
36
+ * @default {top: 'auto', bottom: 'auto'}
37
+ */
38
+ position: FixedNavPosition
39
+ /**
40
+ * 导航方向,可选值 left right
41
+ * @default right
42
+ */
43
+ type: FixedNavDirection
44
+ /**
45
+ * 展开收起按钮回调
46
+ * @default
47
+ */
48
+ onChange: (item: any) => void
49
+ /**
50
+ * 选择之后触发
51
+ * @default
52
+ */
53
+ onSelect: (item: any, event: MouseEvent) => void
54
+ /**
55
+ * 自定义按钮
56
+ * @default -
57
+ */
58
+ content: React.ReactNode
19
59
  }
20
60
  export declare const FixedNav: FunctionComponent<Partial<FixedNavProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onSelect' | 'content'>>;
@@ -2,15 +2,43 @@ import React, { CSSProperties, FunctionComponent } from 'react';
2
2
  import { GridItem, GridItemProps } from '../griditem/griditem.taro';
3
3
  export type GridDirection = 'horizontal' | 'vertical';
4
4
  export interface GridProps {
5
- columns: string | number;
6
- gap: string | number;
7
- center: boolean;
8
- square: boolean;
9
- reverse: boolean;
10
- direction: GridDirection;
5
+ /**
6
+ * 列数
7
+ * @default 4
8
+ */
9
+ columns: string | number
10
+ /**
11
+ * 格子之间的间距,默认单位为px
12
+ * @default 0
13
+ */
14
+ gap: string | number
15
+ /**
16
+ * 是否将格子内容居中显示
17
+ * @default true
18
+ */
19
+ center: boolean
20
+ /**
21
+ * 是否将格子固定为正方形
22
+ * @default false
23
+ */
24
+ square: boolean
25
+ /**
26
+ * 内容翻转
27
+ * @default false
28
+ */
29
+ reverse: boolean
30
+ /**
31
+ * 格子内容排列的方向,可选值为 horizontal
32
+ * @default vertical
33
+ */
34
+ direction: GridDirection
11
35
  className?: string;
12
36
  style?: CSSProperties;
13
- onClick: (item: GridItemProps, index: number) => void;
37
+ /**
38
+ * 宫格子项点击事件
39
+ * @default -
40
+ */
41
+ onClick: (item: GridItemProps, index: number) => void
14
42
  }
15
43
  export declare const Grid: FunctionComponent<Partial<GridProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>> & {
16
44
  Item: typeof GridItem;
@@ -2,7 +2,11 @@ import React, { FunctionComponent, ReactNode } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  type GridDirection = 'horizontal' | 'vertical';
4
4
  export interface GridItemProps extends BasicComponent {
5
- text: string | ReactNode;
5
+ /**
6
+ * 文字
7
+ * @default -
8
+ */
9
+ text: string | ReactNode
6
10
  index: number;
7
11
  columns: string | number;
8
12
  gap: string | number;
@@ -1,9 +1,17 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface ImagePreviewProps extends BasicComponent {
4
+ /**
5
+ * 预览图片数组
6
+ * @default []
7
+ */
4
8
  images: Array<{
5
9
  src: string;
6
- }>;
10
+ }>
11
+ /**
12
+ * 预览的视频数组(视频自动放到图片之前)
13
+ * @default []
14
+ */
7
15
  videos: Array<{
8
16
  source: {
9
17
  src: string;
@@ -13,15 +21,47 @@ export interface ImagePreviewProps extends BasicComponent {
13
21
  muted: boolean;
14
22
  controls: boolean;
15
23
  };
16
- }>;
17
- visible: boolean;
18
- autoPlay: boolean;
19
- value?: number;
20
- defaultValue: number;
21
- closeOnContentClick: boolean;
22
- indicator: boolean;
23
- indicatorColor: string;
24
+ }>
25
+ /**
26
+ * 是否展示预览图片
27
+ * @default false
28
+ */
29
+ visible: boolean
30
+ /**
31
+ * 自动轮播时长,0表示不会自动轮播
32
+ * @default 3000
33
+ */
34
+ autoPlay: boolean
35
+ /**
36
+ * 页码,受控
37
+ * @default 1
38
+ */
39
+ value?: number
40
+ /**
41
+ * 初始页码
42
+ * @default 1
43
+ */
44
+ defaultValue: number
45
+ /**
46
+ * 点击图片可以退出预览
47
+ * @default false
48
+ */
49
+ closeOnContentClick: boolean
50
+ /**
51
+ * 分页指示器是否展示
52
+ * @default false
53
+ */
54
+ indicator: boolean
55
+ /**
56
+ * 分页指示器选中的颜色
57
+ * @default #fff
58
+ */
59
+ indicatorColor: string
24
60
  onChange: (value: number) => void;
25
- onClose: () => void;
61
+ /**
62
+ * 点击遮罩关闭图片预览时触发
63
+ * @default -
64
+ */
65
+ onClose: () => void
26
66
  }
27
67
  export declare const ImagePreview: FunctionComponent<Partial<ImagePreviewProps>>;
@@ -1,7 +1,19 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  export interface IndicatorProps {
3
- total: number;
4
- current: number;
5
- direction: string;
3
+ /**
4
+ * 步骤长度
5
+ * @default 3
6
+ */
7
+ total: number
8
+ /**
9
+ * 当前步骤
10
+ * @default 0
11
+ */
12
+ current: number
13
+ /**
14
+ * 展示方向,默认为水平方向
15
+ * @default horizontal
16
+ */
17
+ direction: string
6
18
  }
7
19
  export declare const Indicator: FunctionComponent<Partial<IndicatorProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -5,25 +5,105 @@ export type InputAlignType = 'left' | 'center' | 'right';
5
5
  export type InputFormatTrigger = 'onChange' | 'onBlur';
6
6
  export type ConfirmTextType = 'send' | 'search' | 'next' | 'go' | 'done';
7
7
  export interface InputProps extends BasicComponent {
8
- type: keyof TaroInputProps.Type | HTMLInputTypeAttribute;
9
- name: string;
10
- defaultValue?: string;
11
- value?: string;
12
- placeholder: string;
13
- align: InputAlignType;
14
- disabled: boolean;
15
- readOnly: boolean;
16
- maxLength: number;
17
- clearable: boolean;
18
- clearIcon: React.ReactNode;
19
- formatTrigger: InputFormatTrigger;
20
- autoFocus: boolean;
21
- confirmType: ConfirmTextType;
22
- formatter?: (value: string) => void;
23
- onChange?: (value: string) => void;
24
- onBlur?: (value: string) => void;
25
- onFocus?: (value: string) => void;
26
- onClear?: (value: string) => void;
27
- onClick?: (e: ITouchEvent) => void;
8
+ /**
9
+ * 输入框类型,支持原生 input 标签的所有 type 属性,另外还支持 number digit
10
+ * @default text
11
+ */
12
+ type: keyof TaroInputProps.Type | HTMLInputTypeAttribute
13
+ /**
14
+ * 组件名字,用于表单提交获取数据
15
+ * @default -
16
+ */
17
+ name: string
18
+ /**
19
+ * 初始默认值
20
+ * @default -
21
+ */
22
+ defaultValue?: string
23
+ /**
24
+ * 初始默认值
25
+ * @default -
26
+ */
27
+ value?: string
28
+ /**
29
+ * 输入框为空时占位符
30
+ * @default -
31
+ */
32
+ placeholder: string
33
+ /**
34
+ * 输入框内容对齐方式,可选值 left、center、right
35
+ * @default left
36
+ */
37
+ align: InputAlignType
38
+ /**
39
+ * 是否禁用
40
+ * @default false
41
+ */
42
+ disabled: boolean
43
+ /**
44
+ * 是否只读
45
+ * @default false
46
+ */
47
+ readOnly: boolean
48
+ /**
49
+ * 限制最长输入字符
50
+ * @default -
51
+ */
52
+ maxLength: number
53
+ /**
54
+ * 展示清除 Icon
55
+ * @default false
56
+ */
57
+ clearable: boolean
58
+ /**
59
+ * 清除图标 Icon <a href="#/icon">可参考 Icon </a>
60
+ * @default MaskClose
61
+ */
62
+ clearIcon: React.ReactNode
63
+ /**
64
+ * 格式化函数触发的时机,可选值为 onChange、onBlur
65
+ * @default -
66
+ */
67
+ formatTrigger: InputFormatTrigger
68
+ /**
69
+ * 是否自动获得焦点,iOS 系统不支持该属性
70
+ * @default false
71
+ */
72
+ autoFocus: boolean
73
+ /**
74
+ * 键盘右下角按钮的文字,仅在type='text'时生效,可选值 send:发送、search:搜索、next:下一个、go:前往、done:完成
75
+ * @default done
76
+ */
77
+ confirmType: ConfirmTextType
78
+ /**
79
+ * 输入内容格式化函数
80
+ * @default -
81
+ */
82
+ formatter?: (value: string) => void
83
+ /**
84
+ * 输入框内容变化时触发
85
+ * @default -
86
+ */
87
+ onChange?: (value: string) => void
88
+ /**
89
+ * 失去焦点后触发
90
+ * @default -
91
+ */
92
+ onBlur?: (value: string) => void
93
+ /**
94
+ * 获得焦点后触发
95
+ * @default -
96
+ */
97
+ onFocus?: (value: string) => void
98
+ /**
99
+ * 点击清空按钮时触发
100
+ * @default -
101
+ */
102
+ onClear?: (value: string) => void
103
+ /**
104
+ * 点击 input 容器触发
105
+ * @default -
106
+ */
107
+ onClick?: (e: ITouchEvent) => void
28
108
  }
29
109
  export declare const Input: React.ForwardRefExoticComponent<Partial<InputProps> & Partial<Omit<TaroInputProps, "type" | "ref" | "onFocus" | "onBlur">> & React.RefAttributes<unknown>>;