@tarojs/components 3.5.8 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/components",
3
- "version": "3.5.8",
3
+ "version": "3.5.9",
4
4
  "description": "Taro 组件库",
5
5
  "browser": "dist/index.js",
6
6
  "main:h5": "dist/index.js",
@@ -36,8 +36,8 @@
36
36
  "resolve-pathname": "^3.0.0",
37
37
  "swiper": "6.8.0",
38
38
  "weui": "^1.1.2",
39
- "@tarojs/router": "3.5.8",
40
- "@tarojs/taro": "3.5.8"
39
+ "@tarojs/router": "3.5.9",
40
+ "@tarojs/taro": "3.5.9"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/generator": "^7.14.5",
@@ -53,7 +53,7 @@
53
53
  "jquery": "^3.4.1",
54
54
  "karmatic": "^2.1.0",
55
55
  "lodash": "^4.17.21",
56
- "miniapp-types": "1.1.20",
56
+ "miniapp-types": "1.1.21",
57
57
  "simulant": "^0.2.2",
58
58
  "style-loader": "1.3.0",
59
59
  "ts-node": "^10.9.1",
package/types/Ad.d.ts CHANGED
@@ -199,7 +199,7 @@ declare namespace AdProps {
199
199
 
200
200
  /** Banner 广告
201
201
  * @classification open
202
- * @supported weapp, tt
202
+ * @supported weapp, swan, tt, qq
203
203
  * @example_react
204
204
  * ```tsx
205
205
  * class App extends Component {
package/types/Audio.d.ts CHANGED
@@ -107,7 +107,7 @@ declare namespace AudioProps {
107
107
  /** 音频。1.6.0版本开始,该组件不再维护。建议使用能力更强的 Taro.createInnerAudioContext 接口
108
108
  * @classification media
109
109
  * @deprecated
110
- * @supported weapp, h5, swan
110
+ * @supported weapp, swan, qq, h5
111
111
  * @example_react
112
112
  * ```tsx
113
113
  * export default class PageView extends Component {
package/types/Button.d.ts CHANGED
@@ -526,7 +526,7 @@ declare namespace ButtonProps {
526
526
 
527
527
  /** 按钮
528
528
  * @classification forms
529
- * @supported weapp, h5, rn, tt
529
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
530
530
  * @example_react
531
531
  * ```tsx
532
532
  * export default class PageButton extends Component {
package/types/Camera.d.ts CHANGED
@@ -149,7 +149,7 @@ declare namespace CameraProps {
149
149
 
150
150
  /** 系统相机
151
151
  * @classification media
152
- * @supported weapp, rn, tt
152
+ * @supported weapp, alipay, swan, tt, qq, jd, rn
153
153
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/camera.html
154
154
  */
155
155
  declare const Camera: ComponentType<CameraProps>
package/types/Canvas.d.ts CHANGED
@@ -88,7 +88,7 @@ declare namespace CanvasProps {
88
88
  *
89
89
  * `<Canvas />` 组件的 RN 版本尚未实现。
90
90
  * @classification canvas
91
- * @supported weapp, tt
91
+ * @supported weapp, alipay, swan, tt, qq, jd, h5
92
92
  * @example_react
93
93
  * ```tsx
94
94
  * class App extends Components {
@@ -43,7 +43,7 @@ interface CheckboxProps extends StandardProps {
43
43
 
44
44
  /** 多选项目
45
45
  * @classification forms
46
- * @supported weapp, h5, rn
46
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
47
47
  * @example_react
48
48
  * ```tsx
49
49
  * export default class PageCheckbox extends Component {
@@ -16,7 +16,7 @@ interface CheckboxGroupProps extends StandardProps, FormItemProps {
16
16
 
17
17
  /** 多项选择器,内部由多个checkbox组成
18
18
  * @classification forms
19
- * @supported weapp, h5, rn, tt
19
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
20
20
  * @example
21
21
  * ```tsx
22
22
  * export default class PageCheckbox extends Component {
@@ -59,7 +59,7 @@ interface CoverImageProps extends StandardProps {
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,7 +3,7 @@ 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
 
@@ -37,15 +37,113 @@ interface CoverViewProps extends ViewProps {
37
37
  */
38
38
  ariaLabel?: string
39
39
 
40
- /** 点击事件回调。
40
+ /** 允许横向滚动。
41
41
  * @supported alipay
42
+ * @default false
42
43
  */
43
- onTap?: CommonEventFunction
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'
package/types/Form.d.ts CHANGED
@@ -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
@@ -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 {
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
@@ -69,11 +70,12 @@ interface InputProps extends StandardProps, FormItemProps {
69
70
  */
70
71
  focus?: boolean
71
72
 
72
- /** 设置键盘右下角按钮的文字
73
+ /** 设置键盘右下角按钮的文字,仅在type='text'时生效
74
+ * @alipay confirm-type 与 enableNative 属性冲突,若希望 confirm-type 生效,enableNative 不能设定为 false,而且不能设定 always-system
73
75
  * @default done
74
76
  * @supported weapp, alipay, swan, tt, qq, jd, rn
75
77
  */
76
- confirmType?: 'send' | 'search' | 'next' | 'go' | 'done'
78
+ confirmType?: keyof InputProps.ConfirmType
77
79
 
78
80
  /** 点击键盘右下角按钮时是否保持键盘不收起
79
81
  * @default false
@@ -99,7 +101,7 @@ interface InputProps extends StandardProps, FormItemProps {
99
101
  selectionEnd?: number
100
102
 
101
103
  /** 键盘弹起时,是否自动上推页面
102
- * @default false
104
+ * @default true
103
105
  * @supported weapp, swan, tt, qq, jd
104
106
  */
105
107
  adjustPosition?: boolean
@@ -161,7 +163,9 @@ interface InputProps extends StandardProps, FormItemProps {
161
163
  randomNumber?: boolean
162
164
 
163
165
  /**
164
- * 是否为受控组件
166
+ * 是否为受控组件。为 true 时,value 内容会完全受 setData 控制。
167
+ *
168
+ * 建议当 type 值为 text 时不要将 controlled 设置为 true,详见 [Bugs & Tips](https://opendocs.alipay.com/mini/component/input#Bug%20%26%20Tip)
165
169
  * @default false
166
170
  * @supported alipay
167
171
  */
@@ -178,9 +182,16 @@ interface InputProps extends StandardProps, FormItemProps {
178
182
  name?: string
179
183
 
180
184
  /** 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效。
185
+ * @default false
181
186
  * @supported alipay
182
187
  */
183
- alwaysSystem?: string
188
+ alwaysSystem?: boolean
189
+
190
+ /** 使用原生键盘
191
+ * @default true
192
+ * @supported alipay
193
+ */
194
+ enableNative?: boolean
184
195
 
185
196
  /** 无障碍访问,(属性)元素的额外描述
186
197
  * @supported qq
@@ -214,6 +225,58 @@ interface InputProps extends StandardProps, FormItemProps {
214
225
  onKeyboardHeightChange?: CommonEventFunction<InputProps.onKeyboardHeightChangeEventDetail>
215
226
  }
216
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
+ }
217
280
  /** > 注意:React-Native 端 `inputEventDetail` 仅实现参数 `value`,若需实时获取光标位置则可通过 [`onSelectionChange`](https://reactnative.dev/docs/textinput#onselectionchange) 实现。 */
218
281
  interface inputEventDetail {
219
282
  /** 输入值 */
@@ -247,7 +310,7 @@ declare namespace InputProps {
247
310
 
248
311
  /** 输入框。该组件是原生组件,使用时请注意相关限制
249
312
  * @classification forms
250
- * @supported weapp, h5, rn
313
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
251
314
  * @example_react
252
315
  * ```tsx
253
316
  * class App extends Component {
@@ -271,7 +271,7 @@ declare namespace LivePlayerProps {
271
271
  *
272
272
  * 需要先通过类目审核,再在小程序管理后台,“设置”-“接口设置”中自助开通该组件权限。
273
273
  * @classification media
274
- * @supported weapp, tt
274
+ * @supported weapp, swan, tt, qq, jd
275
275
  * @example_react
276
276
  * ```tsx
277
277
  * class App extends Components {
@@ -365,7 +365,7 @@ declare namespace LivePusherProps {
365
365
  /** 实时音视频录制。需要用户授权 scope.camera、scope.record
366
366
  * 需要先通过类目审核,再在小程序管理后台,「开发」-「接口设置」中自助开通该组件权限。
367
367
  * @classification media
368
- * @supported weapp
368
+ * @supported weapp, qq
369
369
  * @example_react
370
370
  * ```tsx
371
371
  * class App extends Components {
package/types/Map.d.ts CHANGED
@@ -661,7 +661,7 @@ declare namespace MapProps {
661
661
 
662
662
  /** 地图。相关api Taro.createMapContext。
663
663
  * @classification maps
664
- * @supported weapp, alipay, swan
664
+ * @supported weapp, alipay, swan, tt, qq, jd
665
665
  * @example_react
666
666
  * ```tsx
667
667
  * class App extends Component {
@@ -39,7 +39,7 @@ interface MatchMediaProps extends StandardProps {
39
39
 
40
40
  /** media query 匹配检测节点。可以指定一组 media query 规则,满足时,这个节点才会被展示。
41
41
  * 通过这个节点可以实现“页面宽高在某个范围时才展示某个区域”这样的效果。
42
- * @supported weapp
42
+ * @supported weapp, alipay
43
43
  * @classification viewContainer
44
44
  * @example_react
45
45
  * ```tsx
@@ -3,14 +3,14 @@ import { StandardProps } from './common'
3
3
  interface MovableAreaProps extends StandardProps {
4
4
  /** 当里面的 movable-view 设置为支持双指缩放时,设置此值可将缩放手势生效区域修改为整个 movable-area
5
5
  * @default false
6
- * @supported weapp, alipay, swan, tt, qq
6
+ * @supported weapp, alipay, swan, tt, qq, h5
7
7
  */
8
8
  scaleArea?: boolean
9
9
  }
10
10
 
11
11
  /** movable-view 的可移动区域
12
12
  * @classification viewContainer
13
- * @supported weapp, rn
13
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
14
14
  * @example_react
15
15
  * ```tsx
16
16
  * class App extends Components {
@@ -3,77 +3,77 @@ import { StandardProps, CommonEventFunction, TouchEventFunction } from './common
3
3
  interface MovableViewProps extends Omit<StandardProps, 'animation'> {
4
4
  /** movable-view 的移动方向,属性值有`all`、`vertical`、`horizontal`、`none`
5
5
  * @default none
6
- * @supported weapp, alipay, swan, tt, qq, rn
6
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
7
7
  */
8
8
  direction?: 'all' | 'vertical' | 'horizontal' | 'none'
9
9
 
10
10
  /** movable-view 是否带有惯性
11
11
  * @default false
12
- * @supported weapp, alipay, swan, tt, qq
12
+ * @supported weapp, alipay, swan, tt, qq, h5
13
13
  */
14
14
  inertia?: boolean
15
15
 
16
16
  /** 超过可移动区域后,movable-view 是否还可以移动
17
17
  * @default false
18
- * @supported weapp, alipay, swan, tt, qq
18
+ * @supported weapp, alipay, swan, tt, qq, h5
19
19
  */
20
20
  outOfBounds?: boolean
21
21
 
22
22
  /** 定义 x 轴方向的偏移,如果 x 的值不在可移动范围内,会自动移动到可移动范围;改变 x 的值会触发动画
23
- * @supported weapp, alipay, swan, tt, qq, rn
23
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
24
24
  */
25
25
  x?: number | string
26
26
 
27
27
  /** 定义 y 轴方向的偏移,如果 y 的值不在可移动范围内,会自动移动到可移动范围;改变 y 的值会触发动画
28
- * @supported weapp, alipay, swan, tt, qq, rn
28
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
29
29
  */
30
30
  y?: number | string
31
31
 
32
32
  /** 阻尼系数,用于控制x或y改变时的动画和过界回弹的动画,值越大移动越快
33
33
  * @default 20
34
- * @supported weapp, alipay, swan, tt, qq
34
+ * @supported weapp, alipay, swan, tt, qq, h5
35
35
  */
36
36
  damping?: number
37
37
 
38
38
  /** 摩擦系数,用于控制惯性滑动的动画,值越大摩擦力越大,滑动越快停止;必须大于 0,否则会被设置成默认值
39
39
  * @default 2
40
- * @supported weapp, alipay, swan, tt, qq
40
+ * @supported weapp, alipay, swan, tt, qq, h5
41
41
  */
42
42
  friction?: number
43
43
 
44
44
  /** 是否禁用
45
45
  * @default false
46
- * @supported weapp, alipay, swan, tt, qq, rn
46
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
47
47
  */
48
48
  disabled?: boolean
49
49
 
50
50
  /** 是否支持双指缩放,默认缩放手势生效区域是在 movable-view 内
51
51
  * @default false
52
- * @supported weapp, alipay, swan, tt, qq
52
+ * @supported weapp, alipay, swan, tt, qq, h5
53
53
  */
54
54
  scale?: boolean
55
55
 
56
56
  /** 定义缩放倍数最小值
57
57
  * @default 0.5
58
- * @supported weapp, alipay, swan, tt, qq
58
+ * @supported weapp, alipay, swan, tt, qq, h5
59
59
  */
60
60
  scaleMin?: number
61
61
 
62
62
  /** 定义缩放倍数最大值
63
63
  * @default 10
64
- * @supported weapp, alipay, swan, tt, qq
64
+ * @supported weapp, alipay, swan, tt, qq, h5
65
65
  */
66
66
  scaleMax?: number
67
67
 
68
68
  /** 定义缩放倍数,取值范围为 0.5 - 10
69
69
  * @default 1
70
- * @supported weapp, alipay, swan, tt, qq
70
+ * @supported weapp, alipay, swan, tt, qq, h5
71
71
  */
72
72
  scaleValue?: number
73
73
 
74
74
  /** 是否使用动画
75
75
  * @default true
76
- * @supported weapp, alipay, swan, tt, qq
76
+ * @supported weapp, alipay, swan, tt, qq, h5
77
77
  */
78
78
  animation?: boolean
79
79
 
@@ -98,7 +98,7 @@ interface MovableViewProps extends Omit<StandardProps, 'animation'> {
98
98
  onDragEnd?: CommonEventFunction
99
99
 
100
100
  /** 缩放过程中触发的事件
101
- * @supported weapp, alipay, swan, tt, qq
101
+ * @supported weapp, alipay, swan, tt, qq, h5
102
102
  */
103
103
  onScale?: CommonEventFunction<MovableViewProps.onScaleEventDetail>
104
104
 
@@ -124,12 +124,12 @@ interface MovableViewProps extends Omit<StandardProps, 'animation'> {
124
124
  onTouchCancel?: CommonEventFunction
125
125
 
126
126
  /** 初次手指触摸后移动为横向的移动,如果 catch 此事件,则意味着 touchmove 事件也被 catch
127
- * @supported weapp, swan, tt
127
+ * @supported weapp, swan, tt, h5
128
128
  */
129
129
  onHTouchMove?: TouchEventFunction
130
130
 
131
131
  /** 初次手指触摸后移动为纵向的移动,如果 catch 此事件,则意味着 touchmove 事件也被 catch
132
- * @supported weapp, swan, tt
132
+ * @supported weapp, swan, tt, h5
133
133
  */
134
134
  onVTouchMove?: TouchEventFunction
135
135
 
@@ -190,7 +190,7 @@ declare namespace MovableViewProps {
190
190
 
191
191
  /** 可移动的视图容器,在页面中可以拖拽滑动。movable-view 必须在 movable-area 组件中,并且必须是直接子节点,否则不能移动。
192
192
  * @classification viewContainer
193
- * @supported weapp, swan, alipay, rn, tt
193
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
194
194
  * @example_react
195
195
  * ```tsx
196
196
  * class App extends Components {
@@ -138,7 +138,7 @@ declare namespace NavigatorProps {
138
138
 
139
139
  /** 页面链接
140
140
  * @classification navig
141
- * @supported weapp, swan, alipay, tt
141
+ * @supported weapp, alipay, swan, tt, qq, jd
142
142
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html
143
143
  */
144
144
  declare const Navigator: ComponentType<NavigatorProps>
@@ -95,7 +95,7 @@ declare namespace OpenDataProps {
95
95
 
96
96
  /** 用于展示平台开放的数据
97
97
  * @classification open
98
- * @supported weapp, tt
98
+ * @supported weapp, swan, tt, qq
99
99
  * @example_react
100
100
  * ```tsx
101
101
  * class App extends Component {
@@ -3,90 +3,100 @@ import { StandardProps, CommonEventFunction } from './common'
3
3
  interface PageContainerProps extends StandardProps {
4
4
  /** 是否显示容器组件
5
5
  * @default false
6
- * @supported weapp, rn
6
+ * @supported weapp, alipay, rn
7
7
  */
8
8
  show?: boolean
9
9
 
10
10
  /** 动画时长,单位毫秒
11
11
  * @default 300
12
- * @supported weapp, rn
12
+ * @supported weapp, alipay, rn
13
13
  */
14
14
  duration?: number
15
15
 
16
16
  /** z-index 层级
17
17
  * @default 100
18
- * @supported weapp
18
+ * @supported weapp, alipay
19
19
  */
20
20
  zIndex?: number
21
21
 
22
22
  /** 是否显示遮罩层
23
23
  * @default true
24
- * @supported weapp, rn
24
+ * @supported weapp, alipay, rn
25
25
  */
26
26
  overlay?: boolean
27
27
 
28
28
  /** 弹出位置,可选值为 top bottom right center
29
29
  * @default bottom
30
- * @supported weapp, rn
30
+ * @supported weapp, alipay, rn
31
31
  */
32
32
  position?: keyof PageContainerProps.Position
33
33
 
34
34
  /** 是否显示圆角
35
35
  * @default false
36
- * @supported weapp, rn
36
+ * @supported weapp, alipay, rn
37
37
  */
38
38
  round?: boolean
39
39
 
40
40
  /** 自定义遮罩层样式
41
- * @supported weapp, rn
41
+ * @supported weapp, alipay, rn
42
42
  */
43
43
  overlayStyle?: string
44
44
 
45
45
  /** 自定义弹出层样式
46
- * @supported weapp, rn
46
+ * @supported weapp, alipay, rn
47
47
  */
48
48
  customStyle?: string
49
49
 
50
50
  /** 是否在下滑一段距离后关闭
51
- * @supported weapp
51
+ * @supported weapp, alipay
52
52
  * @default false
53
53
  */
54
- closeOnSlideDown?: string
54
+ closeOnSlideDown?: boolean
55
55
 
56
56
  /** 进入前触发
57
- * @supported weapp, rn
57
+ * @supported weapp, alipay, rn
58
58
  */
59
59
  onBeforeEnter?: CommonEventFunction
60
60
 
61
61
  /** 进入中触发
62
- * @supported weapp, rn
62
+ * @supported weapp, alipay, rn
63
63
  */
64
64
  onEnter?: CommonEventFunction
65
65
 
66
66
  /** 进入后触发
67
- * @supported weapp, rn
67
+ * @supported weapp, alipay, rn
68
68
  */
69
69
  onAfterEnter?: CommonEventFunction
70
70
 
71
71
  /** 离开前触发
72
- * @supported weapp, rn
72
+ * @supported weapp, alipay, rn
73
73
  */
74
74
  onBeforeLeave?: CommonEventFunction
75
75
 
76
76
  /** 离开中触发
77
- * @supported weapp, rn
77
+ * @supported weapp, alipay, rn
78
78
  */
79
79
  onLeave?: CommonEventFunction
80
80
 
81
81
  /** 离开后触发
82
- * @supported weapp, rn
82
+ * @supported weapp, alipay, rn
83
83
  */
84
84
  onAfterLeave?: CommonEventFunction
85
85
 
86
86
  /** 点击遮罩层时触发
87
- * @supported weapp
87
+ * @supported weapp, alipay
88
88
  */
89
89
  onClickOverlay?: CommonEventFunction
90
+
91
+ /** 进入被打断时触发(通过 a: if 打断时不会触发)。
92
+ * @supported alipay
93
+ */
94
+ onEnterCancelled?: CommonEventFunction
95
+
96
+ /** 离开被打断时触发(通过 a: if 打断时不会触发)。
97
+ * @supported alipay
98
+ */
99
+ onLeaveCancelled?: CommonEventFunction
90
100
  }
91
101
  declare namespace PageContainerProps {
92
102
  /** 弹出位置 */
@@ -114,7 +124,7 @@ declare namespace PageContainerProps {
114
124
  * 1. tip: 当前页面最多只有 1 个容器,若已存在容器的情况下,无法增加新的容器
115
125
  * 2. tip: wx.navigateBack 无法在页面栈顶调用,此时没有上一级页面
116
126
  * @classification viewContainer
117
- * @supported weapp, rn
127
+ * @supported weapp, alipay, rn
118
128
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html
119
129
  */
120
130
  declare const PageContainer: ComponentType<PageContainerProps>
@@ -96,7 +96,7 @@ declare namespace PageMetaProps {
96
96
 
97
97
  /** 页面属性配置节点,用于指定页面的一些属性、监听页面事件。只能是页面内的第一个节点。可以配合 navigation-bar 组件一同使用。
98
98
  * 通过这个节点可以获得类似于调用 Taro.setBackgroundTextStyle Taro.setBackgroundColor 等接口调用的效果。
99
- * @supported weapp
99
+ * @supported weapp, alipay
100
100
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/page-meta.html
101
101
  */
102
102
  declare const PageMeta: ComponentType<PageMetaProps>
package/types/Picker.d.ts CHANGED
@@ -302,7 +302,7 @@ declare namespace PickerRegionProps {
302
302
  /**
303
303
  * 从底部弹起的滚动选择器
304
304
  * @classification forms
305
- * @supported weapp, h5, rn, swan, alipay, tt
305
+ * @supported weapp, swan, alipay, tt, h5, rn
306
306
  * @example_react
307
307
  * ```tsx
308
308
  * export default class PagePicker extends Component {
@@ -66,7 +66,7 @@ declare namespace PickerViewProps {
66
66
  /** 嵌入页面的滚动选择器
67
67
  * 其中只可放置 picker-view-column 组件,其它节点不会显示
68
68
  * @classification forms
69
- * @supported weapp, swan, alipay, tt, h5, rn
69
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
70
70
  * @example_react
71
71
  * ```tsx
72
72
  * export default class Picks extends Component {
@@ -81,7 +81,7 @@ interface ProgressProps extends StandardProps {
81
81
 
82
82
  /** 进度条。组件属性的长度单位默认为 px
83
83
  * @classification base
84
- * @supported weapp, swan, alipay, tt, h5, rn
84
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
85
85
  * @example_react
86
86
  * ```tsx
87
87
  * export default class PageView extends Component {
package/types/Radio.d.ts CHANGED
@@ -44,7 +44,7 @@ interface RadioProps extends StandardProps {
44
44
 
45
45
  /** 单选项目
46
46
  * @classification forms
47
- * @supported weapp, h5, rn, tt
47
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
48
48
  * @example_react
49
49
  * ```tsx
50
50
  * export default class PageRadio extends Component {
@@ -19,7 +19,7 @@ declare namespace RadioGroupProps {
19
19
 
20
20
  /** 单项选择器,内部由多个 Radio 组成。
21
21
  * @classification forms
22
- * @supported weapp, h5, rn, tt
22
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
23
23
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/radio-group.html
24
24
  */
25
25
  declare const RadioGroup: ComponentType<RadioGroupProps>
@@ -1,4 +1,13 @@
1
1
  import { ComponentType } from 'react'
2
+ import { StandardProps } from './common'
3
+ interface RootPortalProps extends StandardProps {
4
+ /**
5
+ * 是否从页面中脱离出来
6
+ * @supported weapp
7
+ * @default true
8
+ */
9
+ enable?: boolean
10
+ }
2
11
 
3
12
  /** root-portal
4
13
  * 使整个子树从页面中脱离出来,类似于在 CSS 中使用 fixed position 的效果。主要用于制作弹窗、弹出层等。
@@ -28,6 +37,6 @@ import { ComponentType } from 'react'
28
37
  * }
29
38
  * ```
30
39
  */
31
- declare const RootPortal: ComponentType
40
+ declare const RootPortal: ComponentType<RootPortalProps>
32
41
 
33
- export { RootPortal }
42
+ export { RootPortal, RootPortalProps }
@@ -262,7 +262,7 @@ declare namespace ScrollViewProps {
262
262
  * H5 中 ScrollView 组件是通过一个高度(或宽度)固定的容器内部滚动来实现的,因此务必正确的设置容器的高度。例如: 如果 ScrollView 的高度将 body 撑开,就会同时存在两个滚动条(body 下的滚动条,以及 ScrollView 的滚动条)。
263
263
  * 微信小程序 中 ScrollView 组件如果设置 scrollX 横向滚动时,并且子元素为多个时(单个子元素时设置固定宽度则可以正常横向滚动),需要通过 WXSS 设置 `white-space: nowrap` 来保证元素不换行,并对 ScrollView 内部元素设置 `display: inline-block` 来使其能够横向滚动。
264
264
  * @classification viewContainer
265
- * @supported weapp, swan, alipay, tt, h5, rn
265
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
266
266
  * @example_react
267
267
  * ```tsx
268
268
  * export default class PageView extends Component {
@@ -1,28 +1,38 @@
1
1
  import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction } from './common'
3
3
  interface ShareElementProps extends StandardProps {
4
+ /** 映射标记
5
+ * @supported weapp
6
+ */
7
+ key?: string
8
+
9
+ /** 映射标记
10
+ * @supported weapp
11
+ */
12
+ mapkey?: string
13
+
14
+ /** 映射标记
15
+ * @supported alipay
16
+ */
17
+ name?: string
18
+
4
19
  /** 是否进行动画
5
20
  * @default false
6
- * @supported weapp
21
+ * @supported weapp, alipay
7
22
  */
8
23
  transform?: boolean
9
24
 
10
25
  /** 动画时长,单位毫秒
11
26
  * @default 300
12
- * @supported weapp
27
+ * @supported weapp, alipay
13
28
  */
14
29
  duration?: number
15
30
 
16
31
  /** css缓动函数
17
32
  * @default ease-out
18
- * @supported weapp
33
+ * @supported weapp, alipay
19
34
  */
20
- easingFunction?: number
21
-
22
- /** 映射标记
23
- * @supported weapp
24
- */
25
- key?: string
35
+ easingFunction?: string
26
36
  }
27
37
 
28
38
  /** 共享元素
@@ -30,7 +40,7 @@ interface ShareElementProps extends StandardProps {
30
40
  * 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`PageContainer`](/docs/components/viewContainer/page-container) 组件结合使用。
31
41
  * 使用时需在当前页放置 `ShareElement` 组件,同时在 `PageContainer` 容器中放置对应的 `ShareElement` 组件,对应关系通过属性值 key 映射。当设置 `PageContainer` `显示时,transform` 属性为 `true` 的共享元素会产生动画。当前页面容器退出时,会产生返回动画。
32
42
  * @classification viewContainer
33
- * @supported weapp
43
+ * @supported weapp, alipay
34
44
  * @example_react
35
45
  * ```tsx
36
46
  * // index.js
package/types/Slider.d.ts CHANGED
@@ -118,7 +118,7 @@ declare namespace SliderProps {
118
118
 
119
119
  /** 滑动选择器
120
120
  * @classification forms
121
- * @supported weapp, h5, rn, swan, alipay, tt
121
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
122
122
  * @example_react
123
123
  * ```tsx
124
124
  * export default class PageView extends Component {
package/types/Swiper.d.ts CHANGED
@@ -247,7 +247,7 @@ declare namespace SwiperProps {
247
247
  /** 滑块视图容器。其中只可放置 swiper-item 组件,否则会导致未定义的行为。
248
248
  * > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
249
249
  * @classification viewContainer
250
- * @supported weapp, swan, alipay, tt, h5, rn
250
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
251
251
  * @example_react
252
252
  * ```tsx
253
253
  * class App extends Component {
@@ -7,15 +7,16 @@ interface SwiperItemProps extends StandardProps {
7
7
  itemId?: string
8
8
 
9
9
  /** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息
10
+ * @default false
10
11
  * @supported weapp
11
12
  */
12
- skipHiddenItemLayout?: string
13
+ skipHiddenItemLayout?: boolean
13
14
  }
14
15
 
15
16
  /** 仅可放置在 swiper 组件中,宽高自动设置为100%
16
17
  * > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
17
18
  * @classification viewContainer
18
- * @supported weapp, swan, alipay, tt, h5, rn
19
+ * @supported weapp, alipay, swan, tt, jd, h5, rn
19
20
  * @example_react
20
21
  * ```tsx
21
22
  * class App extends Component {
package/types/Switch.d.ts CHANGED
@@ -93,7 +93,7 @@ declare namespace SwitchProps {
93
93
  * </view>
94
94
  * </template>
95
95
  * ```
96
- * @supported weapp, h5, rn, swan, alipay, tt
96
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
97
97
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/switch.html
98
98
  */
99
99
  declare const Switch: ComponentType<SwitchProps>
package/types/Text.d.ts CHANGED
@@ -45,7 +45,7 @@ declare namespace TextProps {
45
45
 
46
46
  /** 文本
47
47
  * @classification base
48
- * @supported weapp, swan, alipay, tt, h5, rn
48
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
49
49
  * @example_react
50
50
  * ```tsx
51
51
  * export default class PageView extends Component {
@@ -136,6 +136,12 @@ interface TextareaProps extends StandardProps, FormItemProps {
136
136
  */
137
137
  controlled?: string
138
138
 
139
+ /** 使用原生键盘
140
+ * @default false
141
+ * @supported alipay
142
+ */
143
+ enableNative?: boolean
144
+
139
145
  /** 无障碍访问,(属性)元素的额外描述
140
146
  * @supported qq
141
147
  */
@@ -218,7 +224,7 @@ declare namespace TextareaProps {
218
224
 
219
225
  /** 多行输入框。该组件是原生组件,使用时请注意相关限制
220
226
  * @classification forms
221
- * @supported weapp, h5, rn
227
+ * @supported weapp, alipay, swan, tt, qq, h5, rn
222
228
  * @example_react
223
229
  * ```tsx
224
230
  * export default class PageView extends Component {
package/types/Video.d.ts CHANGED
@@ -282,6 +282,12 @@ interface VideoProps extends StandardProps {
282
282
  */
283
283
  mobilenetHintType?: string
284
284
 
285
+ /** 使用原生
286
+ * @default true
287
+ * @supported alipay
288
+ */
289
+ enableNative?: boolean
290
+
285
291
  /** 浮窗设置。暂时不支持全局浮窗。
286
292
  * 可选值:
287
293
  *
@@ -637,7 +643,7 @@ declare namespace VideoProps {
637
643
 
638
644
  /** 视频。相关api:Taro.createVideoContext
639
645
  * @classification media
640
- * @supported weapp, swan, alipay, tt, h5, rn
646
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
641
647
  * @example_react
642
648
  * ```tsx
643
649
  * export default class PageView extends Component {
package/types/View.d.ts CHANGED
@@ -142,7 +142,7 @@ interface ViewProps extends StandardProps {
142
142
 
143
143
  /** 视图容器
144
144
  * @classification viewContainer
145
- * @supported weapp, swan, alipay, tt, h5, rn
145
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
146
146
  * @example_react
147
147
  * ```tsx
148
148
  * export default class PageView extends Component {
@@ -49,7 +49,7 @@ declare namespace WebViewProps {
49
49
 
50
50
  /** web-view 组件是一个可以用来承载网页的容器,会自动铺满整个小程序页面。个人类型与海外类型的小程序暂不支持使用。
51
51
  * @classification open
52
- * @supported weapp, h5, rn, tt
52
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
53
53
  * @example_react
54
54
  * ```tsx
55
55
  * class App extends Component {
@@ -282,7 +282,8 @@ declare global {
282
282
 
283
283
  'custom-wrapper': ElementAttrs<TransformReact2VueType<CustomWrapperProps>>
284
284
  'taro-custom-wrapper-core': ElementAttrs<TransformReact2VueType<CustomWrapperProps>>
285
- 'slot': ElementAttrs<TransformReact2VueType<SlotProps>>
285
+ /** 为了不与vue3模板默认的slot冲突,增加 Record<string, any> */
286
+ 'slot': ElementAttrs<TransformReact2VueType<SlotProps>> & Record<string, any>
286
287
  'taro-slot-core': ElementAttrs<TransformReact2VueType<SlotProps>>
287
288
  }
288
289
  }