@tarojs/components 3.5.7 → 3.5.9

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 (110) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/taro-button-core.cjs.entry.js +5 -0
  3. package/dist/cjs/taro-components.cjs.js +1 -1
  4. package/dist/cjs/taro-movable-area-core.cjs.entry.js +1 -1
  5. package/dist/cjs/taro-movable-view-core.cjs.entry.js +18 -43
  6. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +5 -0
  7. package/dist/cjs/taro-video-control_3.cjs.entry.js +98 -181
  8. package/dist/collection/components/button/button.js +11 -0
  9. package/dist/collection/components/movable-area/area.css +2 -2
  10. package/dist/collection/components/movable-area/movable-view.js +18 -33
  11. package/dist/collection/components/swiper/swiper.js +23 -0
  12. package/dist/collection/components/video/video-control.js +22 -39
  13. package/dist/collection/components/video/video-danmu.js +39 -52
  14. package/dist/collection/components/video/video.js +37 -60
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/taro-button-core.entry.js +5 -0
  17. package/dist/esm/taro-components.js +1 -1
  18. package/dist/esm/taro-movable-area-core.entry.js +1 -1
  19. package/dist/esm/taro-movable-view-core.entry.js +18 -43
  20. package/dist/esm/taro-swiper-core_2.entry.js +5 -0
  21. package/dist/esm/taro-video-control_3.entry.js +98 -181
  22. package/dist/esm-es5/loader.js +1 -1
  23. package/dist/esm-es5/taro-button-core.entry.js +1 -1
  24. package/dist/esm-es5/taro-components.js +1 -1
  25. package/dist/esm-es5/taro-movable-area-core.entry.js +1 -1
  26. package/dist/esm-es5/taro-movable-view-core.entry.js +1 -1
  27. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  28. package/dist/esm-es5/taro-video-control_3.entry.js +55 -55
  29. package/dist/taro-components/p-0380841f.system.js +1 -1
  30. package/dist/taro-components/{p-a94524c9.system.entry.js → p-06b9d39c.system.entry.js} +1 -1
  31. package/dist/taro-components/{p-63a0c6b0.entry.js → p-34178401.entry.js} +1 -1
  32. package/dist/taro-components/p-3549b6d2.entry.js +1 -0
  33. package/dist/taro-components/p-4262d1b6.entry.js +1 -0
  34. package/dist/taro-components/{p-f8b9c4b0.entry.js → p-42630f45.entry.js} +1 -1
  35. package/dist/taro-components/{p-f81a74bb.system.entry.js → p-4c1a7cae.system.entry.js} +81 -81
  36. package/dist/taro-components/{p-3744e978.entry.js → p-99d17a1a.entry.js} +52 -52
  37. package/dist/taro-components/{p-13f0b11f.system.entry.js → p-a5496bf5.system.entry.js} +1 -1
  38. package/dist/taro-components/p-f40e1218.system.entry.js +1 -0
  39. package/dist/taro-components/{p-1c775a11.system.entry.js → p-f5f1c3b7.system.entry.js} +1 -1
  40. package/dist/taro-components/taro-components.esm.js +1 -1
  41. package/dist/types/components/button/button.d.ts +1 -0
  42. package/dist/types/components/swiper/swiper.d.ts +4 -0
  43. package/dist/types/components.d.ts +8 -0
  44. package/package.json +15 -12
  45. package/types/Ad.d.ts +21 -22
  46. package/types/AnimationVideo.d.ts +62 -0
  47. package/types/AnimationView.d.ts +45 -0
  48. package/types/ArCamera.d.ts +50 -0
  49. package/types/Audio.d.ts +6 -6
  50. package/types/AwemeData.d.ts +43 -0
  51. package/types/Button.d.ts +68 -71
  52. package/types/Camera.d.ts +16 -17
  53. package/types/Canvas.d.ts +23 -28
  54. package/types/Checkbox.d.ts +8 -8
  55. package/types/CheckboxGroup.d.ts +1 -1
  56. package/types/CommentDetail.d.ts +72 -0
  57. package/types/CommentList.d.ts +128 -0
  58. package/types/ContactButton.d.ts +53 -0
  59. package/types/CoverImage.d.ts +16 -16
  60. package/types/CoverView.d.ts +105 -7
  61. package/types/CustomWrapper.d.ts +1 -1
  62. package/types/FollowSwan.d.ts +28 -0
  63. package/types/Form.d.ts +11 -11
  64. package/types/Icon.d.ts +1 -1
  65. package/types/Image.d.ts +21 -21
  66. package/types/InlinePaymentPanel.d.ts +58 -0
  67. package/types/Input.d.ts +93 -28
  68. package/types/Lifestyle.d.ts +26 -0
  69. package/types/Like.d.ts +107 -0
  70. package/types/LivePlayer.d.ts +32 -26
  71. package/types/LivePusher.d.ts +6 -6
  72. package/types/Login.d.ts +45 -0
  73. package/types/Lottie.d.ts +113 -0
  74. package/types/Map.d.ts +67 -72
  75. package/types/MatchMedia.d.ts +1 -1
  76. package/types/MovableArea.d.ts +2 -2
  77. package/types/MovableView.d.ts +20 -29
  78. package/types/NativeSlot.d.ts +32 -0
  79. package/types/Navigator.d.ts +11 -11
  80. package/types/OpenData.d.ts +6 -6
  81. package/types/PageContainer.d.ts +31 -24
  82. package/types/PageMeta.d.ts +15 -15
  83. package/types/Picker.d.ts +2 -6
  84. package/types/PickerView.d.ts +12 -22
  85. package/types/Progress.d.ts +6 -6
  86. package/types/Radio.d.ts +1 -1
  87. package/types/RadioGroup.d.ts +6 -6
  88. package/types/RichText.d.ts +17 -17
  89. package/types/RootPortal.d.ts +11 -2
  90. package/types/RtcRoom.d.ts +104 -0
  91. package/types/RtcRoomItem.d.ts +26 -0
  92. package/types/ScrollView.d.ts +47 -31
  93. package/types/ShareElement.d.ts +20 -10
  94. package/types/Slider.d.ts +11 -11
  95. package/types/Slot.d.ts +1 -1
  96. package/types/Swiper.d.ts +32 -20
  97. package/types/SwiperItem.d.ts +3 -2
  98. package/types/Switch.d.ts +6 -6
  99. package/types/TabItem.d.ts +35 -0
  100. package/types/Tabs.d.ts +58 -0
  101. package/types/Text.d.ts +1 -1
  102. package/types/Textarea.d.ts +39 -33
  103. package/types/Video.d.ts +123 -108
  104. package/types/View.d.ts +21 -14
  105. package/types/VoipRoom.d.ts +5 -5
  106. package/types/WebView.d.ts +12 -6
  107. package/types/index.vue3.d.ts +268 -259
  108. package/dist/taro-components/p-6800ac6f.entry.js +0 -1
  109. package/dist/taro-components/p-7f93fa08.entry.js +0 -1
  110. package/dist/taro-components/p-9e1572c5.system.entry.js +0 -1
@@ -6,26 +6,11 @@ interface CoverImageProps extends StandardProps {
6
6
  */
7
7
  src: string
8
8
 
9
- /** 图片加载成功时触发
10
- * @supported weapp, swan, qq, h5
11
- */
12
- onLoad?: CommonEventFunction
13
-
14
- /** 图片加载失败时触发
15
- * @supported weapp, swan, qq, h5
16
- */
17
- onError?: CommonEventFunction
18
-
19
9
  /** 格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;
20
10
  * @supported weapp
21
11
  */
22
12
  referrerPolicy?: 'origin' | 'no-referrer'
23
13
 
24
- /** 点击事件回调。
25
- * @supported alipay
26
- */
27
- onTap?: CommonEventFunction
28
-
29
14
  /** 设置与容器顶部的固定距离,效果相当于在 CSS 中设置 position: fixed 和 top 值,该属性优先级高于 fixed-bottom,CSS 设置的 position、top、bottom 值
30
15
  * @supported swan
31
16
  */
@@ -55,11 +40,26 @@ interface CoverImageProps extends StandardProps {
55
40
  * @supported qq
56
41
  */
57
42
  ariaLabel?: string
43
+
44
+ /** 图片加载成功时触发
45
+ * @supported weapp, swan, qq, h5
46
+ */
47
+ onLoad?: CommonEventFunction
48
+
49
+ /** 图片加载失败时触发
50
+ * @supported weapp, swan, qq, h5
51
+ */
52
+ onError?: CommonEventFunction
53
+
54
+ /** 点击事件回调。
55
+ * @supported alipay
56
+ */
57
+ onTap?: CommonEventFunction
58
58
  }
59
59
 
60
60
  /** 覆盖在原生组件之上的图片视图。可覆盖的原生组件同cover-view,支持嵌套在cover-view里。
61
61
  * @classification viewContainer
62
- * @supported weapp, swan, alipay, h5
62
+ * @supported weapp, alipay, swan, qq, h5
63
63
  * @example_react
64
64
  * ```tsx
65
65
  * // js
@@ -3,15 +3,10 @@ import { CommonEventFunction } from './common'
3
3
  import { ViewProps } from './View'
4
4
  interface CoverViewProps extends ViewProps {
5
5
  /** 设置顶部滚动偏移量,仅在设置了 overflow-y: scroll 成为滚动元素后生效
6
- * @supported weapp, swan, qq
6
+ * @supported weapp, alipay, swan, qq
7
7
  */
8
8
  scrollTop?: number
9
9
 
10
- /** 点击事件回调。
11
- * @supported alipay
12
- */
13
- onTap?: CommonEventFunction
14
-
15
10
  /** 设置与容器顶部的固定距离,效果相当于在 CSS 中设置 position: fixed 和 top 值,该属性优先级高于 fixed-bottom,CSS 设置的 position、top、bottom 值
16
11
  * @supported swan
17
12
  */
@@ -41,11 +36,114 @@ interface CoverViewProps extends ViewProps {
41
36
  * @supported qq
42
37
  */
43
38
  ariaLabel?: string
39
+
40
+ /** 允许横向滚动。
41
+ * @supported alipay
42
+ * @default false
43
+ */
44
+ scrollX?: boolean
45
+
46
+ /** 允许纵向滚动。
47
+ * @supported alipay
48
+ * @default false
49
+ */
50
+ scrollY?: boolean
51
+
52
+ /** 距顶部/左边多远时(单位px),触发 scrolltoupper 事件。
53
+ * @supported alipay
54
+ * @default 50
55
+ */
56
+ upperThreshold?: number
57
+
58
+ /** 距底部/右边多远时(单位px),触发 scrolltolower 事件。
59
+ * @supported alipay
60
+ * @default 50
61
+ */
62
+ lowerThreshold?: number
63
+
64
+ /** 设置横向滚动条位置。
65
+ * @supported alipay
66
+ */
67
+ scrollLeft?: number
68
+
69
+ /** 滚动到子元素,值应为某子元素的 id。当滚动到该元素时,元素顶部对齐滚动区域顶部。
70
+ * 说明:scroll-into-view 的优先级高于 scroll-top。
71
+ * @supported alipay
72
+ */
73
+ scrollIntoView?: string
74
+
75
+ /** 在设置滚动条位置时使用动画过渡。
76
+ * @supported alipay
77
+ * @default false
78
+ */
79
+ scrollWithAnimation?: boolean
80
+
81
+ /** 当 scroll-with-animation设置为 true 时,可以设置 scroll-animation-duration 来控制动画的执行时间,单位 ms。
82
+ * @supported alipay
83
+ */
84
+ scrollAnimationDuration?: number
85
+
86
+ /** 当点击 iOS 顶部状态栏或者双击 Android 标题栏时,滚动条返回顶部,只支持竖向。
87
+ * @supported alipay
88
+ * @default false
89
+ */
90
+ enableBackToTop?: boolean
91
+
92
+ /** 纵向滚动时,当滚动到顶部或底部时,强制禁止触发页面滚动,仍然只触发 scroll-view 自身的滚动。
93
+ * @supported alipay
94
+ * @default false
95
+ */
96
+ trapScroll?: boolean
97
+
98
+ /** 发生滚动前,对滚动方向进行判断,当方向是顶部/左边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到顶部/左边,禁止滚动。
99
+ * @supported alipay
100
+ */
101
+ disableLowerScroll?: string
102
+
103
+ /** 发生滚动前,对滚动方向进行判断,当方向是底部/右边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到底部/右边,禁止滚动。
104
+ * @supported alipay
105
+ */
106
+ disableUpperScroll?: string
107
+
108
+ /** 滚动到顶部/左边,会触发 scrolltoupper 事件。
109
+ * @supported alipay
110
+ */
111
+ onScrollToUpper?: CommonEventFunction
112
+
113
+ /** 滚动到底部/右边,会触发 scrolltolower事件。
114
+ * @supported alipay
115
+ */
116
+ onScrollToLower?: CommonEventFunction
117
+
118
+ /** 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth}。
119
+ * @supported alipay
120
+ */
121
+ onScroll?: CommonEventFunction
122
+
123
+ /** 触摸动作开始。
124
+ * @supported alipay
125
+ */
126
+ onTouchStart?: CommonEventFunction
127
+
128
+ /** 触摸后移动。
129
+ * @supported alipay
130
+ */
131
+ onTouchMove?: CommonEventFunction
132
+
133
+ /** 触摸动作结束。
134
+ * @supported alipay
135
+ */
136
+ onTouchEnd?: CommonEventFunction
137
+
138
+ /** 触摸动作被打断,如来电提醒、弹窗。
139
+ * @supported alipay
140
+ */
141
+ onTouchCancel?: CommonEventFunction
44
142
  }
45
143
 
46
144
  /** 覆盖在原生组件之上的文本视图。可覆盖的原生组件包括 map、video、canvas、camera、live-player、live-pusher 只支持嵌套 cover-view、cover-image,可在 cover-view 中使用 button。
47
145
  * @classification viewContainer
48
- * @supported weapp, swan, alipay, h5
146
+ * @supported weapp, alipay, swan, qq, h5
49
147
  * @example_react
50
148
  * ```tsx
51
149
  * // js
@@ -6,7 +6,7 @@ interface CustomWrapperProps extends StandardProps {
6
6
 
7
7
  /** custom-wrapper 自定义组件包裹器
8
8
  * 当数据更新层级较深时,可用此组件将需要更新的区域包裹起来,这样更新层级将大大减少
9
- * @supported weapp, swan, alipay, tt, jd, qq
9
+ * @supported weapp, swan, alipay, tt, jd, qq, h5
10
10
  * @example
11
11
  * ```tsx
12
12
  * import { Component } from 'react'
@@ -0,0 +1,28 @@
1
+ import { ComponentType } from 'react'
2
+ import { StandardProps } from './common'
3
+ interface FollowSwanProps extends StandardProps {
4
+ /** 组件大小
5
+ * @supported swan
6
+ * @default "default"
7
+ */
8
+ size?: string
9
+
10
+ /** 组件样式
11
+ * @supported swan
12
+ * @default "primary"
13
+ */
14
+ type?: string
15
+
16
+ /** 关注和取消关注成功的回调,返回关注状态 {isFavor: true|false}
17
+ * @supported swan
18
+ */
19
+ onFavorStatusChange?: CommonEventFunction
20
+ }
21
+
22
+ /** 关注小程序
23
+ * @classification open
24
+ * @supported swan
25
+ * @see https://smartprogram.baidu.com/docs/develop/extended/component-content/follow-swan/
26
+ */
27
+ declare const FollowSwan: ComponentType<FollowSwanProps>
28
+ export { FollowSwan, FollowSwanProps }
package/types/Form.d.ts CHANGED
@@ -17,16 +17,6 @@ interface FormProps extends StandardProps {
17
17
  */
18
18
  reportSubmitTimeout?: number
19
19
 
20
- /** 携带 form 中的数据触发 submit 事件
21
- * @supported weapp, alipay, swan, tt, qq, jd, rn
22
- */
23
- onSubmit?: CommonEventFunction<FormProps.onSubmitEventDetail>
24
-
25
- /** 表单重置时会触发 reset 事件
26
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
27
- */
28
- onReset?: CommonEventFunction
29
-
30
20
  /** 模板消息的类型,report-submit 为 true 时填写有效
31
21
  * 取值:default / subscribe
32
22
  * @default 'default'
@@ -45,6 +35,16 @@ interface FormProps extends StandardProps {
45
35
  * @supported swan
46
36
  */
47
37
  subscribeId?: string
38
+
39
+ /** 携带 form 中的数据触发 submit 事件
40
+ * @supported weapp, alipay, swan, tt, qq, jd, rn
41
+ */
42
+ onSubmit?: CommonEventFunction<FormProps.onSubmitEventDetail>
43
+
44
+ /** 表单重置时会触发 reset 事件
45
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
46
+ */
47
+ onReset?: CommonEventFunction
48
48
  }
49
49
  declare namespace FormProps {
50
50
  interface onSubmitEventDetail {
@@ -66,7 +66,7 @@ declare namespace FormProps {
66
66
  *
67
67
  * 当点击 form 表单中 form-type 为 submit 的 button 组件时,会将表单组件中的 value 值进行提交,需要在表单组件中加上 name 来作为 key。
68
68
  * @classification forms
69
- * @supported weapp, h5, rn
69
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
70
70
  * @example_react
71
71
  * ```tsx
72
72
  * class App extends Component {
package/types/Icon.d.ts CHANGED
@@ -62,7 +62,7 @@ declare namespace IconProps {
62
62
 
63
63
  /** 图标。组件属性的长度单位默认为 px
64
64
  * @classification base
65
- * @supported weapp, swan, alipay, tt, h5, rn
65
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
66
66
  * @example_react
67
67
  * ```tsx
68
68
  * export default class PageView extends Component {
package/types/Image.d.ts CHANGED
@@ -37,16 +37,6 @@ interface ImageProps extends StandardProps {
37
37
  */
38
38
  showMenuByLongpress?: boolean
39
39
 
40
- /** 当错误发生时,发布到 AppService 的事件名,事件对象
41
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
42
- */
43
- onError?: CommonEventFunction<ImageProps.onErrorEventDetail>
44
-
45
- /** 当图片载入完毕时,发布到 AppService 的事件名,事件对象
46
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
47
- */
48
- onLoad?: CommonEventFunction<ImageProps.onLoadEventDetail>
49
-
50
40
  /**
51
41
  * 为 img 标签额外增加的属性
52
42
  * @supported h5
@@ -63,16 +53,6 @@ interface ImageProps extends StandardProps {
63
53
  */
64
54
  defaultSource?: string
65
55
 
66
- /** 点击图片时触发。
67
- * @supported alipay
68
- */
69
- onTap?: CommonEventFunction
70
-
71
- /** 点击图片时触发,阻止事件冒泡。
72
- * @supported alipay
73
- */
74
- catchTap?: CommonEventFunction
75
-
76
56
  /** 阻止长按图片时弹起默认菜单(即将该属性设置为image-menu-prevent="true"或image-menu-prevent),只在初始化时有效,不能动态变更;若不想阻止弹起默认菜单,则不需要设置此属性。注:长按菜单后的操作暂不支持 svg 格式
77
57
  * @supported swan
78
58
  */
@@ -92,6 +72,26 @@ interface ImageProps extends StandardProps {
92
72
  * @supported qq
93
73
  */
94
74
  ariaLabel?: string
75
+
76
+ /** 当错误发生时,发布到 AppService 的事件名,事件对象
77
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
78
+ */
79
+ onError?: CommonEventFunction<ImageProps.onErrorEventDetail>
80
+
81
+ /** 当图片载入完毕时,发布到 AppService 的事件名,事件对象
82
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
83
+ */
84
+ onLoad?: CommonEventFunction<ImageProps.onLoadEventDetail>
85
+
86
+ /** 点击图片时触发。
87
+ * @supported alipay
88
+ */
89
+ onTap?: CommonEventFunction
90
+
91
+ /** 点击图片时触发,阻止事件冒泡。
92
+ * @supported alipay
93
+ */
94
+ catchTap?: CommonEventFunction
95
95
  }
96
96
  declare namespace ImageProps {
97
97
  /** mode 的合法值 */
@@ -155,7 +155,7 @@ declare namespace ImageProps {
155
155
  *
156
156
  * **Note:** 为实现小程序的 `mode` 特性,在 H5 组件中使用一个 `div` 容器来对内部的 `img` 进行展示区域的裁剪,因此请勿使用元素选择器来重置 `img` 的样式!
157
157
  * @classification media
158
- * @supported weapp, h5, rn, swan, alipay, tt
158
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
159
159
  * @example_react
160
160
  * ```tsx
161
161
  * export default class PageView extends Component {
@@ -0,0 +1,58 @@
1
+ import { ComponentType } from 'react'
2
+ import { StandardProps } from './common'
3
+ interface InlinePaymentPanelProps extends StandardProps {
4
+ /** 总金额,金额单位分,tip:仅支持整数型字符串
5
+ * @supported swan
6
+ */
7
+ totalAmount?: string
8
+
9
+ /** 百度收银台的财务结算凭证,详见平台术语
10
+ * @supported swan
11
+ */
12
+ dealId?: string
13
+
14
+ /** 支付能力开通后分配的支付 appKey,详见平台术语
15
+ * @supported swan
16
+ */
17
+ appKey?: string
18
+
19
+ /** 平台营销信息,此处传当前订单中可使用平台券的 spuid,同时需在 支付能力中搭配使用传入该参数;注:仅与百度合作平台类目券的开发者需要填写该参数
20
+ * @supported swan
21
+ */
22
+ promotionTag?: string | Array<string>
23
+
24
+ /** 是否设置挽留弹窗
25
+ * @supported swan
26
+ * @default false
27
+ */
28
+ enablePageBackModal?: boolean
29
+
30
+ /** 自定义样式设置
31
+ * @supported swan
32
+ */
33
+ customStyle?: string
34
+
35
+ /** 自定义样式档位配置,各档位配置项包括支付渠道/优惠券条高度、渠道图标大小、支付渠道文案字体大小、营销文案字体大小、选择器图标大小
36
+ * @supported swan
37
+ * @default "default"
38
+ */
39
+ styleType?: 'tiny' | 'small' | 'default' | 'medium' | 'large'
40
+
41
+ /** 获取支付相关信息,具体信息在返回值的 detail 字段中
42
+ * @supported swan
43
+ */
44
+ onGetPaymentInfo?: CommonEventFunction
45
+
46
+ /** 当发生错误时触发 error 事件,具体信息在返回值的 detail 字段中,例如 {detail: {errMsg: "something is wrong"}}
47
+ * @supported swan
48
+ */
49
+ onError?: CommonEventFunction
50
+ }
51
+
52
+ /** 内嵌支付组件
53
+ * @classification open
54
+ * @supported swan
55
+ * @see https://smartprogram.baidu.com/docs/develop/component/inline_payment_panel/
56
+ */
57
+ declare const InlinePaymentPanel: ComponentType<InlinePaymentPanelProps>
58
+ export { InlinePaymentPanel, InlinePaymentPanelProps }
package/types/Input.d.ts CHANGED
@@ -9,11 +9,11 @@ interface InputProps extends StandardProps, FormItemProps {
9
9
  /** input 的类型
10
10
  * @default "text"
11
11
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
12
- * @rn 部分支持
13
12
  */
14
- type?: 'text' | 'number' | 'idcard' | 'digit' | 'safe-password' | 'nickname'
13
+ type?: keyof InputProps.Type
15
14
 
16
15
  /** 是否是密码类型
16
+ * @default false
17
17
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
18
18
  */
19
19
  password?: boolean
@@ -40,6 +40,7 @@ interface InputProps extends StandardProps, FormItemProps {
40
40
  placeholderTextColor?: string
41
41
 
42
42
  /** 是否禁用
43
+ * @default false
43
44
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
44
45
  */
45
46
  disabled?: boolean
@@ -58,20 +59,23 @@ interface InputProps extends StandardProps, FormItemProps {
58
59
 
59
60
  /** (即将废弃,请直接使用 focus )自动聚焦,拉起键盘
60
61
  * @default false
61
- * @supported weapp, qq, jd
62
+ * @deprecated
63
+ * @supported weapp, qq, jd, h5
62
64
  */
63
65
  autoFocus?: boolean
64
66
 
65
67
  /** 获取焦点
68
+ * @default false
66
69
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
67
70
  */
68
71
  focus?: boolean
69
72
 
70
- /** 设置键盘右下角按钮的文字
73
+ /** 设置键盘右下角按钮的文字,仅在type='text'时生效
74
+ * @alipay confirm-type 与 enableNative 属性冲突,若希望 confirm-type 生效,enableNative 不能设定为 false,而且不能设定 always-system
71
75
  * @default done
72
76
  * @supported weapp, alipay, swan, tt, qq, jd, rn
73
77
  */
74
- confirmType?: 'send' | 'search' | 'next' | 'go' | 'done'
78
+ confirmType?: keyof InputProps.ConfirmType
75
79
 
76
80
  /** 点击键盘右下角按钮时是否保持键盘不收起
77
81
  * @default false
@@ -97,7 +101,7 @@ interface InputProps extends StandardProps, FormItemProps {
97
101
  selectionEnd?: number
98
102
 
99
103
  /** 键盘弹起时,是否自动上推页面
100
- * @default false
104
+ * @default true
101
105
  * @supported weapp, swan, tt, qq, jd
102
106
  */
103
107
  adjustPosition?: boolean
@@ -159,12 +163,41 @@ interface InputProps extends StandardProps, FormItemProps {
159
163
  randomNumber?: boolean
160
164
 
161
165
  /**
162
- * 是否为受控组件
166
+ * 是否为受控组件。为 true 时,value 内容会完全受 setData 控制。
167
+ *
168
+ * 建议当 type 值为 text 时不要将 controlled 设置为 true,详见 [Bugs & Tips](https://opendocs.alipay.com/mini/component/input#Bug%20%26%20Tip)
163
169
  * @default false
164
170
  * @supported alipay
165
171
  */
166
172
  controlled?: boolean
167
173
 
174
+ /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
175
+ * @supported h5
176
+ */
177
+ nativeProps?: Record<string, unknown>
178
+
179
+ /** 组件名字,用于表单提交获取数据。
180
+ * @supported alipay
181
+ */
182
+ name?: string
183
+
184
+ /** 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效。
185
+ * @default false
186
+ * @supported alipay
187
+ */
188
+ alwaysSystem?: boolean
189
+
190
+ /** 使用原生键盘
191
+ * @default true
192
+ * @supported alipay
193
+ */
194
+ enableNative?: boolean
195
+
196
+ /** 无障碍访问,(属性)元素的额外描述
197
+ * @supported qq
198
+ */
199
+ ariaLabel?: string
200
+
168
201
  /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。
169
202
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
170
203
  */
@@ -190,28 +223,60 @@ interface InputProps extends StandardProps, FormItemProps {
190
223
  * @supported weapp, qq
191
224
  */
192
225
  onKeyboardHeightChange?: CommonEventFunction<InputProps.onKeyboardHeightChangeEventDetail>
193
-
194
- /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
195
- * @supported h5
196
- */
197
- nativeProps?: Record<string, unknown>
198
-
199
- /** 组件名字,用于表单提交获取数据。
200
- * @supported alipay
201
- */
202
- name?: string
203
-
204
- /** 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效。
205
- * @supported alipay
206
- */
207
- alwaysSystem?: string
208
-
209
- /** 无障碍访问,(属性)元素的额外描述
210
- * @supported qq
211
- */
212
- ariaLabel?: string
213
226
  }
214
227
  declare namespace InputProps {
228
+ /** Input 类型 */
229
+ interface Type {
230
+ /** 文本输入键盘
231
+ * @supported weapp, alipay, h5, rn
232
+ */
233
+ text
234
+ /** 数字输入键盘
235
+ * @supported weapp, alipay, h5, rn
236
+ */
237
+ number
238
+ /** 身份证输入键盘
239
+ *@supported weapp, alipay, rn
240
+ */
241
+ idcard
242
+ /** 带小数点的数字键盘
243
+ * @supported weapp, alipay, h5, rn
244
+ */
245
+ digit
246
+ /** 密码安全输入键盘[指引](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/safe-password.html)
247
+ * @supported weapp, alipay
248
+ */
249
+ 'safe-password'
250
+ /** 昵称输入键盘
251
+ * @supported weapp, alipay
252
+ */
253
+ nickname
254
+ /** 数字输入键盘
255
+ * @supported alipay
256
+ */
257
+ numberpad
258
+ /** 带小数点的数字键盘
259
+ * @supported alipay
260
+ */
261
+ digitpad
262
+ /** 身份证输入键盘
263
+ * @supported alipay
264
+ */
265
+ idcardpad
266
+ }
267
+ /** Confirm 类型 */
268
+ interface ConfirmType {
269
+ /** 右下角按钮为“发送” */
270
+ send
271
+ /** 右下角按钮为“搜索” */
272
+ search
273
+ /** 右下角按钮为“下一个” */
274
+ next
275
+ /** 右下角按钮为“前往” */
276
+ go
277
+ /** 右下角按钮为“完成” */
278
+ done
279
+ }
215
280
  /** > 注意:React-Native 端 `inputEventDetail` 仅实现参数 `value`,若需实时获取光标位置则可通过 [`onSelectionChange`](https://reactnative.dev/docs/textinput#onselectionchange) 实现。 */
216
281
  interface inputEventDetail {
217
282
  /** 输入值 */
@@ -245,7 +310,7 @@ declare namespace InputProps {
245
310
 
246
311
  /** 输入框。该组件是原生组件,使用时请注意相关限制
247
312
  * @classification forms
248
- * @supported weapp, h5, rn
313
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
249
314
  * @example_react
250
315
  * ```tsx
251
316
  * class App extends Component {
@@ -0,0 +1,26 @@
1
+ import { ComponentType } from 'react'
2
+ import { StandardProps } from './common'
3
+ interface LifestyleProps extends StandardProps {
4
+ /** 必填,生活号 ID(即生活号 APPID),必须是当前小程序同账号主体且已关联的生活号。
5
+ * @supported alipay
6
+ */
7
+ publicId?: string
8
+
9
+ /** 文案。支持商家自定义,最多展示一行。
10
+ * @supported alipay
11
+ */
12
+ memo?: string
13
+
14
+ /** 当用户关注生活号成功后执行。
15
+ * @supported alipay
16
+ */
17
+ onFollow?: CommonEventFunction
18
+ }
19
+
20
+ /** 关注生活号
21
+ * @classification open
22
+ * @supported alipay
23
+ * @see https://opendocs.alipay.com/mini/component/lifestyle
24
+ */
25
+ declare const Lifestyle: ComponentType<LifestyleProps>
26
+ export { Lifestyle, LifestyleProps }