@tarojs/components 3.5.5 → 3.5.6-alpha.1

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 (73) hide show
  1. package/dist/cjs/taro-input-core.cjs.entry.js +24 -3
  2. package/dist/cjs/taro-video-control_3.cjs.entry.js +21 -3
  3. package/dist/collection/components/input/input.js +24 -3
  4. package/dist/collection/components/video/video.js +23 -3
  5. package/dist/collection/utils/json-schema-to-types.js +224 -0
  6. package/dist/esm/taro-input-core.entry.js +24 -3
  7. package/dist/esm/taro-video-control_3.entry.js +21 -3
  8. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  9. package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
  10. package/dist/taro-components/p-0380841f.system.js +1 -1
  11. package/dist/taro-components/p-232ebfae.system.entry.js +1 -0
  12. package/dist/taro-components/{p-7e8943d8.entry.js → p-3744e978.entry.js} +1 -1
  13. package/dist/taro-components/p-56c86512.entry.js +1 -0
  14. package/dist/taro-components/{p-ed8c1bb8.system.entry.js → p-f81a74bb.system.entry.js} +1 -1
  15. package/dist/taro-components/taro-components.esm.js +1 -1
  16. package/dist/types/components/input/input.d.ts +1 -0
  17. package/dist/types/utils/json-schema-to-types.d.ts +25 -0
  18. package/dist-h5/react/components/index.js +5 -5
  19. package/package.json +9 -5
  20. package/types/Ad.d.ts +99 -9
  21. package/types/AdCustom.d.ts +1 -3
  22. package/types/Audio.d.ts +16 -16
  23. package/types/Block.d.ts +0 -2
  24. package/types/Button.d.ts +187 -47
  25. package/types/Camera.d.ts +20 -18
  26. package/types/Canvas.d.ts +52 -13
  27. package/types/Checkbox.d.ts +13 -10
  28. package/types/CheckboxGroup.d.ts +5 -7
  29. package/types/CoverImage.d.ts +44 -5
  30. package/types/CoverView.d.ts +34 -10
  31. package/types/Editor.d.ts +4 -6
  32. package/types/Form.d.ts +23 -7
  33. package/types/FunctionalPageNavigator.d.ts +5 -3
  34. package/types/Icon.d.ts +19 -7
  35. package/types/Image.d.ts +71 -14
  36. package/types/Input.d.ts +44 -33
  37. package/types/Label.d.ts +0 -3
  38. package/types/LivePlayer.d.ts +80 -24
  39. package/types/LivePusher.d.ts +78 -37
  40. package/types/Map.d.ts +208 -66
  41. package/types/MatchMedia.d.ts +8 -10
  42. package/types/MovableArea.d.ts +1 -3
  43. package/types/MovableView.d.ts +88 -30
  44. package/types/NavigationBar.d.ts +0 -2
  45. package/types/Navigator.d.ts +35 -18
  46. package/types/OfficialAccount.d.ts +10 -3
  47. package/types/OpenData.d.ts +35 -6
  48. package/types/PageContainer.d.ts +13 -10
  49. package/types/PageMeta.d.ts +27 -13
  50. package/types/Picker.d.ts +50 -14
  51. package/types/PickerView.d.ts +31 -13
  52. package/types/PickerViewColumn.d.ts +0 -2
  53. package/types/Progress.d.ts +17 -14
  54. package/types/Radio.d.ts +16 -6
  55. package/types/RadioGroup.d.ts +6 -4
  56. package/types/RichText.d.ts +53 -5
  57. package/types/RootPortal.d.ts +2 -1
  58. package/types/ScrollView.d.ts +82 -19
  59. package/types/ShareElement.d.ts +5 -7
  60. package/types/Slider.d.ts +41 -17
  61. package/types/Swiper.d.ts +100 -22
  62. package/types/SwiperItem.d.ts +6 -3
  63. package/types/Switch.d.ts +22 -8
  64. package/types/Text.d.ts +10 -6
  65. package/types/Textarea.d.ts +61 -28
  66. package/types/Video.d.ts +331 -50
  67. package/types/View.d.ts +122 -9
  68. package/types/VoipRoom.d.ts +6 -9
  69. package/types/WebView.d.ts +9 -7
  70. package/types/common.d.ts +1 -1
  71. package/types/index.vue3.d.ts +261 -138
  72. package/dist/taro-components/p-1b356f4d.entry.js +0 -1
  73. package/dist/taro-components/p-a39276ff.system.entry.js +0 -1
@@ -1,32 +1,81 @@
1
1
  import { ComponentType } from 'react'
2
- import { StandardProps } from './common'
3
-
2
+ import { CommonEventFunction, StandardProps } from './common'
4
3
  interface RichTextProps extends StandardProps {
5
4
  /** 文本是否可选,该属性会使节点显示为 block
6
5
  * @default false
7
6
  * @supported weapp
8
7
  */
9
8
  userSelect?: boolean
9
+
10
10
  /** 节点列表/ HTML String */
11
11
  nodes?: Nodes
12
+
12
13
  /** 显示连续空格
13
- * @supported weapp, rn
14
+ * @supported weapp, qq, rn
14
15
  */
15
16
  space?: keyof RichTextProps.TSpace
17
+
18
+ /** 触摸。
19
+ * @supported alipay
20
+ */
21
+ onTap?: CommonEventFunction
22
+
23
+ /** 触摸动作开始。
24
+ * @supported alipay
25
+ */
26
+ onTouchstart?: CommonEventFunction
27
+
28
+ /** 触摸移动事件。
29
+ * @supported alipay
30
+ */
31
+ onTouchmove?: CommonEventFunction
32
+
33
+ /** 触摸动作被打断。
34
+ * @supported alipay
35
+ */
36
+ onTouchcancel?: CommonEventFunction
37
+
38
+ /** 触摸动作结束。
39
+ * @supported alipay
40
+ */
41
+ onTouchend?: CommonEventFunction
42
+
43
+ /** 触摸后,超过 500ms 再离开。
44
+ * @supported alipay
45
+ */
46
+ onLongtap?: CommonEventFunction
47
+
48
+ /** 富文本是否可以长按选中,可用于复制,粘贴,长按搜索等场景
49
+ * @default false(基础库 3.150.1 以前版本)true(基础库 3.150.1 及以后版本)
50
+ * @supported swan
51
+ */
52
+ selectable?: string
53
+
54
+ /** 阻止长按图片时弹起默认菜单(将该属性设置为image-menu-prevent或image-menu-prevent="true"),只在初始化时有效,不能动态变更;若不想阻止弹起默认菜单,则不需要设置此属性
55
+ * @default false
56
+ * @supported swan
57
+ */
58
+ imageMenuPrevent?: string
59
+
60
+ /** 富文本中的图片是否可点击预览。在不设置的情况下,若 rich-text 未监听点击事件,则默认开启。未显示设置 preview 时会进行点击默认预览判断,建议显示设置 preview
61
+ * @supported swan
62
+ */
63
+ preview?: string
16
64
  }
17
65
 
18
66
  /** 节点类型
19
67
  * > 现支持两种节点,通过type来区分,分别是元素节点和文本节点,默认是元素节点,在富文本区域里显示的HTML节点 元素节点:type = node*
20
68
  */
21
69
  type Nodes = Array<RichTextProps.Text | RichTextProps.HTMLElement> | string
22
-
23
70
  declare namespace RichTextProps {
24
71
  /** space 的合法值 */
25
72
  interface TSpace {
26
73
  /** 中文字符空格一半大小 */
27
74
  ensp
75
+
28
76
  /** 中文字符空格大小 */
29
77
  emsp
78
+
30
79
  /** 根据字体设置的空格大小 */
31
80
  nbsp
32
81
  }
@@ -128,5 +177,4 @@ declare namespace RichTextProps {
128
177
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html
129
178
  */
130
179
  declare const RichText: ComponentType<RichTextProps>
131
-
132
180
  export { RichText, RichTextProps }
@@ -3,8 +3,9 @@ import { ComponentType } from 'react'
3
3
  /** root-portal
4
4
  * 使整个子树从页面中脱离出来,类似于在 CSS 中使用 fixed position 的效果。主要用于制作弹窗、弹出层等。
5
5
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/root-portal.html
6
+ * @classification viewContainer
6
7
  * @supported weapp
7
- * @example
8
+ * @example_react
8
9
  * ```tsx
9
10
  * import { useState } from 'react'
10
11
  * import { RootPortal, View, Button } from '@tarojs/components'
@@ -1,62 +1,61 @@
1
1
  import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction, BaseEventOrigFunction } from './common'
3
-
4
3
  interface ScrollViewProps extends StandardProps {
5
4
  /** 允许横向滚动
6
5
  * @default false
7
- * @supported weapp, swan, alipay, tt, h5, rn
6
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
8
7
  * @rn 二选一
9
8
  */
10
9
  scrollX?: boolean
11
10
 
12
11
  /** 允许纵向滚动
13
12
  * @default false
14
- * @supported weapp, swan, alipay, tt, h5, rn
13
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
15
14
  * @rn 二选一
16
15
  */
17
16
  scrollY?: boolean
18
17
 
19
18
  /** 距顶部/左边多远时(单位px),触发 scrolltoupper 事件
20
19
  * @default 50
21
- * @supported weapp, swan, alipay, tt, h5, rn
20
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
22
21
  */
23
22
  upperThreshold?: number
24
23
 
25
24
  /** 距底部/右边多远时(单位px),触发 scrolltolower 事件
26
25
  * @default 50
27
- * @supported weapp, swan, alipay, tt, h5, rn
26
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
28
27
  */
29
28
  lowerThreshold?: number
30
29
 
31
30
  /** 设置竖向滚动条位置
32
- * @supported weapp, swan, alipay, tt, h5, rn
31
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
33
32
  */
34
33
  scrollTop?: number
35
34
 
36
35
  /** 设置横向滚动条位置
37
- * @supported weapp, swan, alipay, tt, h5, rn
36
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
38
37
  */
39
38
  scrollLeft?: number
40
39
 
41
40
  /** 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素
42
- * @supported weapp, swan, alipay, tt, h5
41
+ * @supported weapp, alipay, swan, tt, qq, jd, h5
43
42
  */
44
43
  scrollIntoView?: string
45
44
 
46
45
  /** 在设置滚动条位置时使用动画过渡
47
- * @supported weapp, swan, alipay, tt, h5, rn
46
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
48
47
  * @default false
49
48
  */
50
49
  scrollWithAnimation?: boolean
51
50
 
52
51
  /** iOS 点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向
53
- * @supported weapp, alipay, rn
52
+ * @supported weapp, alipay, swan, qq, jd, rn
54
53
  * @default false
55
54
  */
56
55
  enableBackToTop?: boolean
57
56
 
58
57
  /** 启用 flexbox 布局。开启后,当前节点声明了 `display: flex` 就会成为 flex container,并作用于其孩子节点。
59
- * @supported weapp
58
+ * @supported weapp, jd
60
59
  * @default false
61
60
  */
62
61
  enableFlex?: boolean
@@ -128,18 +127,17 @@ interface ScrollViewProps extends StandardProps {
128
127
  fastDeceleration?: boolean
129
128
 
130
129
  /** 滚动到顶部/左边,会触发 scrolltoupper 事件
131
- * @supported weapp, swan, alipay, tt, h5, rn
130
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
132
131
  */
133
132
  onScrollToUpper?: CommonEventFunction
134
133
 
135
134
  /** 滚动到底部/右边,会触发 scrolltolower 事件
136
- * @supported weapp, swan, alipay, tt, h5, rn
135
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
137
136
  */
138
137
  onScrollToLower?: CommonEventFunction
139
138
 
140
139
  /** 滚动时触发
141
- * `event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY}`
142
- * @supported weapp, swan, alipay, tt, h5, rn
140
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
143
141
  */
144
142
  onScroll?: BaseEventOrigFunction<ScrollViewProps.onScrollDetail>
145
143
 
@@ -173,20 +171,86 @@ interface ScrollViewProps extends StandardProps {
173
171
  */
174
172
  onDragging?: CommonEventFunction
175
173
 
176
- /** 滑动结束事件 (同时开启 enhanced 属性后生效)
174
+ /** 滑动结束事件 (同时开启 enhanced 属性后生效) detail { scrollTop, scrollLeft, velocity }
177
175
  * @supported weapp
178
176
  */
179
- onDragEnd?: CommonEventFunction
180
- }
177
+ onDragend?: CommonEventFunction
178
+
179
+ /** 外部样式名。
180
+ * @supported alipay
181
+ */
182
+ class?: string
183
+
184
+ /** 内联样式名。
185
+ * @supported alipay
186
+ */
187
+ style?: string
188
+
189
+ /** 当 scroll-with-animation设置为 true 时,可以设置 scroll-animation-duration 来控制动画的执行时间,单位 ms。
190
+ * 版本要求: 基础库 1.9.0 及以上
191
+ * @supported alipay
192
+ */
193
+ scrollAnimationDuration?: string
194
+
195
+ /** 纵向滚动时,当滚动到顶部或底部时,强制禁止触发页面滚动,仍然只触发 scroll-view 自身的滚动。
196
+ * 默认值: false
197
+ * 版本要求: 基础库 1.11.2 及以上
198
+ * @supported alipay
199
+ */
200
+ trapScroll?: string
201
+
202
+ /** 触摸动作开始。
203
+ * 版本要求: 基础库 1.15.0 及以上
204
+ * @supported alipay
205
+ */
206
+ onTouchStart?: CommonEventFunction
207
+
208
+ /** 触摸后移动。
209
+ * 版本要求: 基础库 1.15.0 及以上
210
+ * @supported alipay
211
+ */
212
+ onTouchMove?: CommonEventFunction
181
213
 
214
+ /** 触摸动作结束。
215
+ * 版本要求: 基础库 1.15.0 及以上
216
+ * @supported alipay
217
+ */
218
+ onTouchEnd?: CommonEventFunction
219
+
220
+ /** 触摸动作被打断,如来电提醒、弹窗。
221
+ * 版本要求: 基础库 1.15.0 及以上
222
+ * @supported alipay
223
+ */
224
+ onTouchCancel?: CommonEventFunction
225
+
226
+ /** 发生滚动前,对滚动方向进行判断,当方向是顶部/左边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到顶部/左边,禁止滚动。
227
+ * 版本要求:基础库 2.6.2 及以上
228
+ * @supported alipay
229
+ */
230
+ disableLowerScroll?: string
231
+
232
+ /** 发生滚动前,对滚动方向进行判断,当方向是底部/右边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到底部/右边,禁止滚动。
233
+ * 版本要求:基础库 2.6.2 及以上
234
+ * @supported alipay
235
+ */
236
+ disableUpperScroll?: string
237
+
238
+ /** 无障碍访问,(属性)元素的额外描述
239
+ * @supported qq
240
+ */
241
+ ariaLabel?: string
242
+ }
182
243
  declare namespace ScrollViewProps {
183
244
  interface onScrollDetail {
184
245
  /** 横向滚动条位置 */
185
246
  scrollLeft: number
247
+
186
248
  /** 竖向滚动条位置 */
187
249
  scrollTop: number
250
+
188
251
  /** 滚动条高度 */
189
252
  scrollHeight: number
253
+
190
254
  /** 滚动条宽度 */
191
255
  scrollWidth: number
192
256
  deltaX: number
@@ -340,5 +404,4 @@ declare namespace ScrollViewProps {
340
404
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html
341
405
  */
342
406
  declare const ScrollView: ComponentType<ScrollViewProps>
343
-
344
407
  export { ScrollView, ScrollViewProps }
@@ -1,12 +1,6 @@
1
1
  import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction } from './common'
3
-
4
3
  interface ShareElementProps extends StandardProps {
5
- /** 映射标记
6
- * @supported weapp
7
- */
8
- mapkey: string
9
-
10
4
  /** 是否进行动画
11
5
  * @default false
12
6
  * @supported weapp
@@ -24,6 +18,11 @@ interface ShareElementProps extends StandardProps {
24
18
  * @supported weapp
25
19
  */
26
20
  easingFunction?: number
21
+
22
+ /** 映射标记
23
+ * @supported weapp
24
+ */
25
+ key?: string
27
26
  }
28
27
 
29
28
  /** 共享元素
@@ -228,5 +227,4 @@ interface ShareElementProps extends StandardProps {
228
227
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/share-element.html
229
228
  */
230
229
  declare const ShareElement: ComponentType<ShareElementProps>
231
-
232
230
  export { ShareElement, ShareElementProps }
package/types/Slider.d.ts CHANGED
@@ -1,90 +1,115 @@
1
1
  import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction, FormItemProps } from './common'
3
-
4
3
  interface SliderProps extends StandardProps, FormItemProps {
5
4
  /** 最小值
6
5
  * @default 0
7
- * @supported weapp, h5, rn, swan, alipay, tt
6
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
8
7
  */
9
8
  min?: number
10
9
 
11
10
  /** 最大值
12
11
  * @default 100
13
- * @supported weapp, h5, rn, swan, alipay, tt
12
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
14
13
  */
15
14
  max?: number
16
15
 
17
16
  /** 步长,取值必须大于 0,并且可被(max - min)整除
18
17
  * @default 1
19
- * @supported weapp, h5, rn, swan, alipay, tt
18
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
20
19
  */
21
20
  step?: number
22
21
 
23
22
  /** 是否禁用
24
23
  * @default false
25
- * @supported weapp, h5, rn, swan, alipay, tt
24
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
26
25
  */
27
26
  disabled?: boolean
28
27
 
29
28
  /** 当前取值
30
29
  * @default 0
31
- * @supported weapp, h5, rn, swan, alipay, tt
30
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
32
31
  */
33
32
  value?: number
34
33
 
35
34
  /** 背景条的颜色(请使用 backgroundColor)
36
35
  * @default "#e9e9e9"
37
- * @supported weapp, tt
36
+ * @supported weapp, tt, qq, jd
38
37
  */
39
38
  color?: string
40
39
 
41
40
  /** 已选择的颜色(请使用 activeColor)
42
41
  * @default "#1aad19"
43
- * @supported weapp, tt
42
+ * @supported weapp, tt, qq, jd
44
43
  */
45
44
  selectedColor?: string
46
45
 
47
46
  /** 已选择的颜色
48
47
  * @default "#1aad19"
49
- * @supported weapp, h5, rn, swan, alipay, tt
48
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
50
49
  */
51
50
  activeColor?: string
52
51
 
53
52
  /** 背景条的颜色
54
53
  * @default "#e9e9e9"
55
- * @supported weapp, h5, rn, swan, alipay, tt
54
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
56
55
  */
57
56
  backgroundColor?: string
58
57
 
59
58
  /** 滑块的大小,取值范围为 12 - 28
60
59
  * @default 28
61
- * @supported weapp, h5, swan, alipay, tt
60
+ * @supported weapp, swan, tt, qq, jd, h5
62
61
  */
63
62
  blockSize?: number
64
63
 
65
64
  /** 滑块的颜色
66
65
  * @default "#ffffff"
67
- * @supported weapp, h5, rn, swan, alipay, tt
66
+ * @supported weapp, swan, tt, qq, jd, h5, rn
68
67
  */
69
68
  blockColor?: string
70
69
 
71
70
  /** 是否显示当前 value
72
71
  * @default false
73
- * @supported weapp, h5, rn, swan, alipay, tt
72
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
74
73
  */
75
74
  showValue?: boolean
76
75
 
77
76
  /** 完成一次拖动后触发的事件
78
- * @supported weapp, h5, rn, swan, alipay, tt
77
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
79
78
  */
80
79
  onChange?: CommonEventFunction<SliderProps.onChangeEventDetail>
81
80
 
82
81
  /** 拖动过程中触发的事件
83
- * @supported weapp, h5, rn, swan, alipay, tt
82
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
84
83
  */
85
84
  onChanging?: CommonEventFunction<SliderProps.onChangeEventDetail>
86
- }
87
85
 
86
+ /** 组件名字,用于表单提交获取数据。
87
+ * @supported alipay
88
+ */
89
+ name?: string
90
+
91
+ /** 轨道线条高度。
92
+ * @default 4
93
+ * @supported alipay
94
+ */
95
+ trackSize?: string
96
+
97
+ /** 滑块大小。
98
+ * @default 22
99
+ * @supported alipay
100
+ */
101
+ handleSize?: string
102
+
103
+ /** 滑块填充色,同 CSS 色值。
104
+ * @supported alipay
105
+ */
106
+ handleColor?: string
107
+
108
+ /** 无障碍访问,(属性)元素的额外描述
109
+ * @supported qq
110
+ */
111
+ ariaLabel?: string
112
+ }
88
113
  declare namespace SliderProps {
89
114
  interface onChangeEventDetail {
90
115
  value
@@ -131,5 +156,4 @@ declare namespace SliderProps {
131
156
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/slider.html
132
157
  */
133
158
  declare const Slider: ComponentType<SliderProps>
134
-
135
159
  export { Slider, SliderProps }