@nutui/nutui-react 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 (189) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/esm/ActionSheet/style/style.css +1 -1
  3. package/dist/esm/ActionSheet.js +28 -37
  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 +22 -26
  7. package/dist/esm/Calendar/style/style.css +1 -1
  8. package/dist/esm/Cascader/style/style.css +1 -1
  9. package/dist/esm/CountDown/style/style.css +1 -1
  10. package/dist/esm/CountDown.js +20 -15
  11. package/dist/esm/DatePicker/style/style.css +1 -1
  12. package/dist/esm/Ellipsis/style/style.css +1 -1
  13. package/dist/esm/ImagePreview/style/style.css +1 -1
  14. package/dist/esm/NumberKeyboard/style/style.css +1 -1
  15. package/dist/esm/Picker/style/style.css +1 -1
  16. package/dist/esm/Popup/style/style.css +1 -1
  17. package/dist/esm/SearchBar/style/style.css +1 -1
  18. package/dist/esm/SearchBar.js +33 -87
  19. package/dist/esm/ShortPassword/style/style.css +1 -1
  20. package/dist/esm/ShortPassword.js +65 -133
  21. package/dist/esm/SideNavBar/style/style.css +1 -1
  22. package/dist/esm/TimeSelect/style/style.css +1 -1
  23. package/dist/esm/Toast/style/style.css +1 -1
  24. package/dist/esm/Toast.js +86 -102
  25. package/dist/esm/TrendArrow/style/style.css +1 -1
  26. package/dist/esm/TrendArrow.js +30 -35
  27. package/dist/esm/Video.js +8 -12
  28. package/dist/esm/VirtualList/style/style.css +1 -1
  29. package/dist/esm/VirtualList.js +29 -25
  30. package/dist/esm/WaterMark.js +8 -11
  31. package/dist/esm/types/src/packages/actionsheet/actionsheet.d.ts +11 -15
  32. package/dist/esm/types/src/packages/actionsheet/actionsheet.taro.d.ts +11 -15
  33. package/dist/esm/types/src/packages/actionsheet/index.d.ts +1 -0
  34. package/dist/esm/types/src/packages/actionsheet/index.taro.d.ts +1 -0
  35. package/dist/esm/types/src/packages/animatingnumbers/countup.d.ts +7 -8
  36. package/dist/esm/types/src/packages/animatingnumbers/countup.taro.d.ts +7 -8
  37. package/dist/esm/types/src/packages/animatingnumbers/demo.d.ts +1 -0
  38. package/dist/esm/types/src/packages/animatingnumbers/demo.taro.d.ts +1 -0
  39. package/dist/esm/types/src/packages/animatingnumbers/index.d.ts +1 -0
  40. package/dist/esm/types/src/packages/animatingnumbers/index.taro.d.ts +1 -0
  41. package/dist/esm/types/src/packages/avatargroup/avatargroup.taro.d.ts +13 -0
  42. package/dist/esm/types/src/packages/avatargroup/index.taro.d.ts +1 -1
  43. package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -1
  44. package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -1
  45. package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -0
  46. package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +1 -0
  47. package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -0
  48. package/dist/esm/types/src/packages/countdown/countdown.d.ts +5 -4
  49. package/dist/esm/types/src/packages/countdown/countdown.taro.d.ts +5 -4
  50. package/dist/esm/types/src/packages/countdown/index.d.ts +1 -0
  51. package/dist/esm/types/src/packages/countdown/index.taro.d.ts +1 -0
  52. package/dist/esm/types/src/packages/ellipsis/ellipsis.taro.d.ts +1 -0
  53. package/dist/esm/types/src/packages/searchbar/index.d.ts +1 -0
  54. package/dist/esm/types/src/packages/searchbar/index.taro.d.ts +1 -0
  55. package/dist/esm/types/src/packages/searchbar/searchbar.d.ts +4 -31
  56. package/dist/esm/types/src/packages/searchbar/searchbar.taro.d.ts +4 -31
  57. package/dist/esm/types/src/packages/shortpassword/index.d.ts +1 -0
  58. package/dist/esm/types/src/packages/shortpassword/index.taro.d.ts +1 -0
  59. package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +17 -20
  60. package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +17 -20
  61. package/dist/esm/types/src/packages/toast/Notification.d.ts +9 -13
  62. package/dist/esm/types/src/packages/toast/index.d.ts +1 -0
  63. package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -0
  64. package/dist/esm/types/src/packages/toast/toast.d.ts +19 -26
  65. package/dist/esm/types/src/packages/toast/toast.taro.d.ts +9 -11
  66. package/dist/esm/types/src/packages/trendarrow/trendarrow.d.ts +8 -10
  67. package/dist/esm/types/src/packages/trendarrow/trendarrow.taro.d.ts +8 -10
  68. package/dist/esm/types/src/packages/video/index.d.ts +1 -0
  69. package/dist/esm/types/src/packages/video/index.taro.d.ts +2 -1
  70. package/dist/esm/types/src/packages/video/video.d.ts +5 -9
  71. package/dist/esm/types/src/packages/video/video.taro.d.ts +6 -9
  72. package/dist/esm/types/src/packages/virtuallist/index.d.ts +1 -0
  73. package/dist/esm/types/src/packages/virtuallist/index.taro.d.ts +1 -0
  74. package/dist/esm/types/src/packages/virtuallist/type.d.ts +0 -18
  75. package/dist/esm/types/src/packages/virtuallist/utils.d.ts +3 -3
  76. package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +15 -4
  77. package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +13 -14
  78. package/dist/esm/types/src/packages/watermark/demo.d.ts +0 -1
  79. package/dist/esm/types/src/packages/watermark/demo.taro.d.ts +0 -1
  80. package/dist/esm/types/src/packages/watermark/index.d.ts +1 -0
  81. package/dist/esm/types/src/packages/watermark/index.taro.d.ts +1 -0
  82. package/dist/esm/types/src/packages/watermark/watermark.d.ts +3 -4
  83. package/dist/esm/types/src/packages/watermark/watermark.taro.d.ts +3 -4
  84. package/dist/locales/base.js +1 -1
  85. package/dist/locales/en-US.js +1 -1
  86. package/dist/locales/id-ID.js +1 -1
  87. package/dist/locales/tr-TR.js +10 -2
  88. package/dist/locales/zh-CN.js +1 -1
  89. package/dist/locales/zh-TW.js +1 -1
  90. package/dist/locales/zh-UG.js +1 -1
  91. package/dist/nutui.react.es.js +525 -590
  92. package/dist/nutui.react.umd.js +525 -590
  93. package/dist/packages/actionsheet/actionsheet.scss +26 -73
  94. package/dist/packages/animatingnumbers/countup.scss +0 -21
  95. package/dist/packages/countdown/countdown.scss +2 -0
  96. package/dist/packages/ellipsis/ellipsis.scss +4 -0
  97. package/dist/packages/popup/popup.scss +98 -47
  98. package/dist/packages/searchbar/searchbar.scss +13 -71
  99. package/dist/packages/shortpassword/shortpassword.scss +1 -88
  100. package/dist/packages/toast/toast.scss +20 -7
  101. package/dist/packages/trendarrow/trendarrow.scss +4 -3
  102. package/dist/packages/virtuallist/virtuallist.scss +0 -12
  103. package/dist/style.css +1 -1
  104. package/dist/style.mjs +1 -1
  105. package/dist/styles/variables-jmapp.scss +58 -68
  106. package/dist/styles/variables.scss +32 -61
  107. package/dist/types/packages/actionsheet/actionsheet.d.ts +44 -16
  108. package/dist/types/packages/actionsheet/index.d.ts +1 -0
  109. package/dist/types/packages/animate/animate.d.ts +20 -4
  110. package/dist/types/packages/animatingnumbers/countup.d.ts +7 -8
  111. package/dist/types/packages/animatingnumbers/index.d.ts +1 -0
  112. package/dist/types/packages/audio/audio.d.ts +60 -12
  113. package/dist/types/packages/avatar/avatar.d.ts +50 -10
  114. package/dist/types/packages/avatargroup/avatargroup.d.ts +40 -8
  115. package/dist/types/packages/backtop/backtop.d.ts +25 -5
  116. package/dist/types/packages/badge/badge.d.ts +30 -6
  117. package/dist/types/packages/button/button.d.ts +50 -10
  118. package/dist/types/packages/cascader/cascader.d.ts +85 -17
  119. package/dist/types/packages/cell/cell.d.ts +30 -6
  120. package/dist/types/packages/cellgroup/cellgroup.d.ts +15 -3
  121. package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +40 -8
  122. package/dist/types/packages/circleprogress/circleprogress.d.ts +35 -7
  123. package/dist/types/packages/col/col.d.ts +15 -3
  124. package/dist/types/packages/collapse/collapse.d.ts +25 -5
  125. package/dist/types/packages/collapseitem/collapseitem.d.ts +20 -4
  126. package/dist/types/packages/configprovider/configprovider.d.ts +11 -2
  127. package/dist/types/packages/configprovider/index.d.ts +1 -0
  128. package/dist/types/packages/configprovider/types.d.ts +1 -0
  129. package/dist/types/packages/countdown/countdown.d.ts +68 -15
  130. package/dist/types/packages/countdown/index.d.ts +1 -0
  131. package/dist/types/packages/divider/divider.d.ts +10 -2
  132. package/dist/types/packages/drag/drag.d.ts +15 -3
  133. package/dist/types/packages/elevator/elevator.d.ts +45 -9
  134. package/dist/types/packages/ellipsis/ellipsis.d.ts +45 -9
  135. package/dist/types/packages/empty/empty.d.ts +20 -4
  136. package/dist/types/packages/fixednav/fixednav.d.ts +50 -10
  137. package/dist/types/packages/grid/grid.d.ts +35 -7
  138. package/dist/types/packages/griditem/griditem.d.ts +5 -1
  139. package/dist/types/packages/image/image.d.ts +65 -13
  140. package/dist/types/packages/imagepreview/imagepreview.d.ts +50 -10
  141. package/dist/types/packages/indicator/indicator.d.ts +15 -3
  142. package/dist/types/packages/input/input.d.ts +100 -20
  143. package/dist/types/packages/inputnumber/inputnumber.d.ts +85 -17
  144. package/dist/types/packages/menu/menu.d.ts +25 -5
  145. package/dist/types/packages/menuitem/menuitem.d.ts +35 -7
  146. package/dist/types/packages/noticebar/noticebar.d.ts +60 -12
  147. package/dist/types/packages/notify/notify.d.ts +25 -5
  148. package/dist/types/packages/numberkeyboard/numberkeyboard.d.ts +50 -10
  149. package/dist/types/packages/overlay/overlay.d.ts +40 -8
  150. package/dist/types/packages/pagination/pagination.d.ts +55 -11
  151. package/dist/types/packages/picker/picker.d.ts +55 -11
  152. package/dist/types/packages/popup/popup.d.ts +75 -15
  153. package/dist/types/packages/price/price.d.ts +35 -7
  154. package/dist/types/packages/progress/progress.d.ts +40 -8
  155. package/dist/types/packages/pulltorefresh/pulltorefresh.d.ts +50 -10
  156. package/dist/types/packages/radio/radio.d.ts +45 -9
  157. package/dist/types/packages/radiogroup/radiogroup.d.ts +30 -6
  158. package/dist/types/packages/range/range.d.ts +80 -16
  159. package/dist/types/packages/rate/rate.d.ts +50 -10
  160. package/dist/types/packages/searchbar/index.d.ts +1 -0
  161. package/dist/types/packages/searchbar/searchbar.d.ts +76 -45
  162. package/dist/types/packages/shortpassword/index.d.ts +1 -0
  163. package/dist/types/packages/shortpassword/shortpassword.d.ts +89 -24
  164. package/dist/types/packages/skeleton/skeleton.d.ts +35 -7
  165. package/dist/types/packages/step/step.d.ts +20 -4
  166. package/dist/types/packages/steps/steps.d.ts +15 -3
  167. package/dist/types/packages/sticky/sticky.d.ts +25 -5
  168. package/dist/types/packages/swipe/swipe.d.ts +47 -11
  169. package/dist/types/packages/swiper/swiper.d.ts +65 -13
  170. package/dist/types/packages/switch/switch.d.ts +30 -6
  171. package/dist/types/packages/tabbar/tabbar.d.ts +35 -7
  172. package/dist/types/packages/tabbaritem/tabbaritem.d.ts +10 -2
  173. package/dist/types/packages/tabpane/tabpane.d.ts +15 -3
  174. package/dist/types/packages/tabs/tabs.d.ts +60 -12
  175. package/dist/types/packages/textarea/textarea.d.ts +60 -12
  176. package/dist/types/packages/toast/Notification.d.ts +9 -13
  177. package/dist/types/packages/toast/index.d.ts +1 -0
  178. package/dist/types/packages/toast/toast.d.ts +19 -26
  179. package/dist/types/packages/trendarrow/trendarrow.d.ts +57 -15
  180. package/dist/types/packages/uploader/uploader.d.ts +180 -36
  181. package/dist/types/packages/video/index.d.ts +1 -0
  182. package/dist/types/packages/video/video.d.ts +27 -11
  183. package/dist/types/packages/virtuallist/index.d.ts +1 -0
  184. package/dist/types/packages/virtuallist/type.d.ts +0 -18
  185. package/dist/types/packages/virtuallist/utils.d.ts +3 -3
  186. package/dist/types/packages/virtuallist/virtuallist.d.ts +51 -4
  187. package/dist/types/packages/watermark/index.d.ts +1 -0
  188. package/dist/types/packages/watermark/watermark.d.ts +72 -17
  189. package/package.json +1 -1
@@ -1,64 +1,95 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
3
  export interface SearchBarProps extends BasicComponent {
4
- /** 文本值 */
4
+ /**
5
+ * 当前输入的值
6
+ * @default -
7
+ */
5
8
  value?: number | string;
6
- /** 输入框占位提示文字 */
9
+ /**
10
+ * 输入框默认暗纹
11
+ * @default 请输入
12
+ */
7
13
  placeholder?: string;
8
- /** 搜索框形状,可选值为 round */
14
+ /**
15
+ * 搜索框形状,可选值为 round
16
+ * @default square
17
+ */
9
18
  shape?: 'square' | 'round';
10
- /** 自定义class名 */
11
- className?: string;
12
- /** 是否禁用输入框 */
19
+ /**
20
+ * 是否禁用输入框
21
+ * @default false
22
+ */
13
23
  disabled?: boolean;
14
- /** 最大输入长度 */
24
+ /**
25
+ * 最大输入长度
26
+ * @default 9999
27
+ */
15
28
  maxLength?: number;
16
- /** 是否启用清除图标,点击清除图标后会清空输入框 */
29
+ /**
30
+ * 是否展示清除按钮
31
+ * @default true
32
+ */
17
33
  clearable?: boolean;
18
- clearSize?: string | number;
19
- /** 搜索框外部背景色 */
20
- background?: string;
21
- /** 搜索框背景色 */
22
- inputBackground?: string;
23
- /** 输入框内容对齐方式 */
24
- align?: string;
25
- /** 是否将输入框设为只读状态,只读状态下无法输入内容 */
34
+ /**
35
+ * 输入框只读
36
+ * @default false
37
+ */
26
38
  readOnly?: boolean;
27
- /** 是否自动聚焦,iOS 系统不支持该属性 */
39
+ /**
40
+ * 是否自动聚焦
41
+ * @default false
42
+ */
28
43
  autoFocus?: boolean;
29
- /** 搜索框左侧文本 */
30
- label?: React.ReactNode;
31
- /** 输入框内 左icon */
32
- leftinIcon?: React.ReactNode;
33
- /** 输入框内 右icon */
34
- rightinIcon?: React.ReactNode;
35
- /** 输入框外 左icon */
36
- leftoutIcon?: React.ReactNode;
37
- /** 输入框外 右icon */
38
- rightoutIcon?: React.ReactNode;
39
- /** 取消按钮文字 */
40
- actionText?: React.ReactNode;
41
- /** 确定搜索时触发 */
44
+ /**
45
+ * 搜索框左侧区域
46
+ * @default -
47
+ */
48
+ left: React.ReactNode
49
+ /**
50
+ * 搜搜框右侧区域
51
+ * @default -
52
+ */
53
+ right: React.ReactNode
54
+ /**
55
+ * 输入框内左侧区域
56
+ * @default <Search size="12" />
57
+ */
58
+ leftIn: React.ReactNode
59
+ /**
60
+ * 输入框内右侧区域
61
+ * @default -
62
+ */
63
+ rightIn: React.ReactNode
64
+ /**
65
+ * 确定搜索时触发
66
+ * @default
67
+ */
42
68
  onSearch?: (val: string) => void;
43
- /** 输入框内容变化时触发 */
69
+ /**
70
+ * 输入内容时触发
71
+ * @default
72
+ */
44
73
  onChange?: (value: string, event: Event) => void;
45
- /** 输入框获得焦点时触发 */
74
+ /**
75
+ * 聚焦时触发
76
+ * @default
77
+ */
46
78
  onFocus?: (value: string, event: Event) => void;
47
- /** 输入框失去焦点时触发 */
79
+ /**
80
+ * 失焦时触发
81
+ * @default
82
+ */
48
83
  onBlur?: (value: string, event: Event) => void;
49
- /** 点击清除按钮后触发 */
84
+ /**
85
+ * 点击清空时触发
86
+ * @default
87
+ */
50
88
  onClear?: (event: Event) => void;
51
- /** 点击取消按钮后触发 */
52
- onCancel?: () => void;
53
- /** 点击输入区域时触发 */
89
+ /**
90
+ * 点击输入区域时触发
91
+ * @default
92
+ */
54
93
  onClickInput?: (event: Event) => void;
55
- /** 点击输入框内左侧图标时触发 */
56
- onClickLeftinIcon?: (value: string, event: Event) => void;
57
- /** 点击输入框外左侧图标时触发 */
58
- onClickLeftoutIcon?: (value: string, event: Event) => void;
59
- /** 点击输入框内右侧图标时触发 */
60
- onClickRightinIcon?: (value: string, event: Event) => void;
61
- /** 点击输入框外右侧图标时触发 */
62
- onClickRightoutIcon?: (value: string, event: Event) => void;
63
94
  }
64
95
  export declare const SearchBar: FunctionComponent<Partial<SearchBarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onFocus' | 'onBlur'>>;
@@ -1,2 +1,3 @@
1
1
  import { ShortPassword } from './shortpassword';
2
+ export type { ShortPasswordProps } from './shortpassword';
2
3
  export default ShortPassword;
@@ -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 '../popup/popup';
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,11 +1,31 @@
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;
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
8
24
  children: React.ReactNode;
9
- onChange: (val: boolean) => void;
25
+ /**
26
+ * 吸附状态改变时触发
27
+ * @default -
28
+ */
29
+ onChange: (val: boolean) => void
10
30
  }
11
31
  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>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeInstance>>;
@@ -6,18 +6,70 @@ export type SwiperRef = {
6
6
  prev: () => void;
7
7
  };
8
8
  export interface SwiperProps extends BasicComponent {
9
- width: number | string;
10
- height: number | string;
11
- duration: number | string;
12
- defaultValue: number | string;
13
- autoPlay: number | string;
14
- direction: 'horizontal' | 'vertical';
15
- indicator: ReactNode;
16
- loop: boolean;
17
- touchable: boolean;
18
- preventDefault: boolean;
19
- stopPropagation: boolean;
20
- center: boolean;
21
- onChange?: (current: number) => void;
9
+ /**
10
+ * 轮播卡片的宽度
11
+ * @default window.innerWidth
12
+ */
13
+ width: number | string
14
+ /**
15
+ * 轮播卡片的高度
16
+ * @default 0
17
+ */
18
+ height: number | string
19
+ /**
20
+ * 动画时长(单位是ms)
21
+ * @default 500
22
+ */
23
+ duration: number | string
24
+ /**
25
+ * 初始化索引值
26
+ * @default 0
27
+ */
28
+ defaultValue: number | string
29
+ /**
30
+ * 自动轮播时长,0表示不会自动轮播
31
+ * @default 0
32
+ */
33
+ autoPlay: number | string
34
+ /**
35
+ * 轮播方向,可选值horizontal,vertical
36
+ * @default horizontal
37
+ */
38
+ direction: 'horizontal' | 'vertical'
39
+ /**
40
+ * 分页指示器是否展示,可传入自定义的 HTML 结构
41
+ * @default false
42
+ */
43
+ indicator: ReactNode
44
+ /**
45
+ * 是否循环轮播
46
+ * @default true
47
+ */
48
+ loop: boolean
49
+ /**
50
+ * 是否可触摸滑动
51
+ * @default true
52
+ */
53
+ touchable: boolean
54
+ /**
55
+ * 滑动过程中是否禁用默认事件
56
+ * @default true
57
+ */
58
+ preventDefault: boolean
59
+ /**
60
+ * 滑动过程中是否禁止冒泡
61
+ * @default true
62
+ */
63
+ stopPropagation: boolean
64
+ /**
65
+ * 是否居中展示,必须传对应的width 和 height
66
+ * @default false
67
+ */
68
+ center: boolean
69
+ /**
70
+ * 卡片切换后的回调
71
+ * @default -
72
+ */
73
+ onChange?: (current: number) => void
22
74
  }
23
75
  export declare const Swiper: React.ForwardRefExoticComponent<Partial<SwiperProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<SwiperRef>>;
@@ -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';
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';
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;