@tarojs/components 3.5.5 → 3.5.6
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/dist/cjs/taro-input-core.cjs.entry.js +24 -3
- package/dist/cjs/taro-video-control_3.cjs.entry.js +21 -3
- package/dist/collection/components/input/input.js +24 -3
- package/dist/collection/components/video/video.js +23 -3
- package/dist/collection/utils/json-schema-to-types.js +224 -0
- package/dist/esm/taro-input-core.entry.js +24 -3
- package/dist/esm/taro-video-control_3.entry.js +21 -3
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
- package/dist/taro-components/p-0380841f.system.js +1 -1
- package/dist/taro-components/p-232ebfae.system.entry.js +1 -0
- package/dist/taro-components/{p-7e8943d8.entry.js → p-3744e978.entry.js} +1 -1
- package/dist/taro-components/p-56c86512.entry.js +1 -0
- package/dist/taro-components/{p-ed8c1bb8.system.entry.js → p-f81a74bb.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +1 -0
- package/dist/types/utils/json-schema-to-types.d.ts +25 -0
- package/dist-h5/react/components/index.js +5 -5
- package/package.json +9 -5
- package/types/Ad.d.ts +99 -9
- package/types/AdCustom.d.ts +1 -3
- package/types/Audio.d.ts +16 -16
- package/types/Block.d.ts +0 -2
- package/types/Button.d.ts +187 -47
- package/types/Camera.d.ts +20 -18
- package/types/Canvas.d.ts +52 -13
- package/types/Checkbox.d.ts +13 -10
- package/types/CheckboxGroup.d.ts +5 -7
- package/types/CoverImage.d.ts +44 -5
- package/types/CoverView.d.ts +34 -10
- package/types/Editor.d.ts +4 -6
- package/types/Form.d.ts +23 -7
- package/types/FunctionalPageNavigator.d.ts +5 -3
- package/types/Icon.d.ts +19 -7
- package/types/Image.d.ts +71 -14
- package/types/Input.d.ts +44 -33
- package/types/Label.d.ts +0 -3
- package/types/LivePlayer.d.ts +80 -24
- package/types/LivePusher.d.ts +78 -37
- package/types/Map.d.ts +208 -66
- package/types/MatchMedia.d.ts +8 -10
- package/types/MovableArea.d.ts +1 -3
- package/types/MovableView.d.ts +88 -30
- package/types/NavigationBar.d.ts +0 -2
- package/types/Navigator.d.ts +35 -18
- package/types/OfficialAccount.d.ts +10 -3
- package/types/OpenData.d.ts +35 -6
- package/types/PageContainer.d.ts +13 -10
- package/types/PageMeta.d.ts +27 -13
- package/types/Picker.d.ts +50 -14
- package/types/PickerView.d.ts +31 -13
- package/types/PickerViewColumn.d.ts +0 -2
- package/types/Progress.d.ts +17 -14
- package/types/Radio.d.ts +16 -6
- package/types/RadioGroup.d.ts +6 -4
- package/types/RichText.d.ts +53 -5
- package/types/RootPortal.d.ts +2 -1
- package/types/ScrollView.d.ts +82 -19
- package/types/ShareElement.d.ts +5 -7
- package/types/Slider.d.ts +41 -17
- package/types/Swiper.d.ts +100 -22
- package/types/SwiperItem.d.ts +6 -3
- package/types/Switch.d.ts +22 -8
- package/types/Text.d.ts +10 -6
- package/types/Textarea.d.ts +61 -28
- package/types/Video.d.ts +331 -50
- package/types/View.d.ts +122 -9
- package/types/VoipRoom.d.ts +6 -9
- package/types/WebView.d.ts +9 -7
- package/types/common.d.ts +1 -1
- package/types/index.vue3.d.ts +261 -138
- package/dist/taro-components/p-1b356f4d.entry.js +0 -1
- package/dist/taro-components/p-a39276ff.system.entry.js +0 -1
package/types/Swiper.d.ts
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps, CommonEventFunction } from './common'
|
|
3
|
-
|
|
4
3
|
interface SwiperProps extends StandardProps {
|
|
5
4
|
/** 是否显示面板指示点
|
|
6
5
|
* @default false
|
|
7
|
-
* @supported weapp,
|
|
6
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
8
7
|
*/
|
|
9
8
|
indicatorDots?: boolean
|
|
10
9
|
|
|
11
10
|
/** 指示点颜色
|
|
12
11
|
* @default "rgba(0, 0, 0, .3)"
|
|
13
|
-
* @supported weapp,
|
|
12
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
14
13
|
*/
|
|
15
14
|
indicatorColor?: string
|
|
16
15
|
|
|
17
16
|
/** 当前选中的指示点颜色
|
|
18
17
|
* @default "#000000"
|
|
19
|
-
* @supported weapp,
|
|
18
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
20
19
|
*/
|
|
21
20
|
indicatorActiveColor?: string
|
|
22
21
|
|
|
23
22
|
/** 是否自动切换
|
|
24
23
|
* @default false
|
|
25
|
-
* @supported weapp,
|
|
24
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
26
25
|
*/
|
|
27
26
|
autoplay?: boolean
|
|
28
27
|
|
|
29
28
|
/** 当前所在滑块的 index
|
|
30
29
|
* @default 0
|
|
31
|
-
* @supported weapp,
|
|
30
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
32
31
|
*/
|
|
33
32
|
current?: number
|
|
34
33
|
|
|
@@ -39,77 +38,77 @@ interface SwiperProps extends StandardProps {
|
|
|
39
38
|
|
|
40
39
|
/** 自动切换时间间隔
|
|
41
40
|
* @default 5000
|
|
42
|
-
* @supported weapp,
|
|
41
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
43
42
|
*/
|
|
44
43
|
interval?: number
|
|
45
44
|
|
|
46
45
|
/** 滑动动画时长
|
|
47
46
|
* @default 500
|
|
48
|
-
* @supported weapp,
|
|
47
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5
|
|
49
48
|
*/
|
|
50
49
|
duration?: number
|
|
51
50
|
|
|
52
51
|
/** 是否采用衔接滑动
|
|
53
52
|
* @default false
|
|
54
|
-
* @supported weapp,
|
|
53
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
55
54
|
*/
|
|
56
55
|
circular?: boolean
|
|
57
56
|
|
|
58
57
|
/** 滑动方向是否为纵向
|
|
59
58
|
* @default false
|
|
60
|
-
* @supported weapp,
|
|
59
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
61
60
|
*/
|
|
62
61
|
vertical?: boolean
|
|
63
62
|
|
|
64
63
|
/** 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值
|
|
65
64
|
* @default "0px"
|
|
66
|
-
* @supported weapp,
|
|
65
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5
|
|
67
66
|
*/
|
|
68
67
|
previousMargin?: string
|
|
69
68
|
|
|
70
69
|
/** 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值
|
|
71
70
|
* @default "0px"
|
|
72
|
-
* @supported weapp,
|
|
71
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5
|
|
73
72
|
*/
|
|
74
73
|
nextMargin?: string
|
|
75
74
|
|
|
76
75
|
/**
|
|
77
76
|
* 当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素
|
|
78
77
|
* @default false
|
|
79
|
-
* @supported weapp
|
|
78
|
+
* @supported weapp, alipay, jd
|
|
80
79
|
*/
|
|
81
80
|
snapToEdge?: boolean
|
|
82
81
|
|
|
83
82
|
/** 同时显示的滑块数量
|
|
84
83
|
* @default 1
|
|
85
|
-
* @supported weapp, swan, tt, h5
|
|
84
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5
|
|
86
85
|
*/
|
|
87
86
|
displayMultipleItems?: number
|
|
88
87
|
|
|
89
88
|
/** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息
|
|
90
89
|
* @default false
|
|
91
|
-
* @supported
|
|
90
|
+
* @supported qq, jd
|
|
92
91
|
*/
|
|
93
92
|
skipHiddenItemLayout?: boolean
|
|
94
93
|
|
|
95
94
|
/** 指定 swiper 切换缓动动画类型
|
|
96
95
|
* @default "default"
|
|
97
|
-
* @supported weapp, tt
|
|
96
|
+
* @supported weapp, alipay, tt, jd
|
|
98
97
|
*/
|
|
99
98
|
easingFunction?: keyof SwiperProps.TEasingFunction
|
|
100
99
|
|
|
101
100
|
/** current 改变时会触发 change 事件
|
|
102
|
-
* @supported weapp,
|
|
101
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
103
102
|
*/
|
|
104
103
|
onChange?: CommonEventFunction<SwiperProps.onChangeEventDetail>
|
|
105
104
|
|
|
106
105
|
/** swiper-item 的位置发生改变时会触发 transition 事件
|
|
107
|
-
* @supported weapp, tt
|
|
106
|
+
* @supported weapp, alipay, tt, qq, jd
|
|
108
107
|
*/
|
|
109
108
|
onTransition?: CommonEventFunction<SwiperProps.onTransitionEventDetail>
|
|
110
109
|
|
|
111
110
|
/** 动画结束时会触发 animationfinish 事件
|
|
112
|
-
* @supported weapp, swan, h5, rn
|
|
111
|
+
* @supported weapp, swan, tt, qq, jd, h5, rn
|
|
113
112
|
*/
|
|
114
113
|
onAnimationFinish?: SwiperProps['onChange']
|
|
115
114
|
|
|
@@ -118,15 +117,83 @@ interface SwiperProps extends StandardProps {
|
|
|
118
117
|
* @supported alipay
|
|
119
118
|
*/
|
|
120
119
|
disableTouch?: boolean
|
|
121
|
-
}
|
|
122
120
|
|
|
121
|
+
/** swiper-item 可见时的 class。
|
|
122
|
+
* 版本要求: 基础库 1.13.7 以及上。
|
|
123
|
+
* @supported alipay
|
|
124
|
+
*/
|
|
125
|
+
activeClass?: string
|
|
126
|
+
|
|
127
|
+
/** acceleration 设置为 {{true}} 时且处于滑动过程中,中间若干屏处于可见时的 class。
|
|
128
|
+
* 版本要求: 基础库 1.13.7 以及上。
|
|
129
|
+
* @supported alipay
|
|
130
|
+
*/
|
|
131
|
+
changingClass?: string
|
|
132
|
+
|
|
133
|
+
/** 当开启时,会根据滑动速度,连续滑动多屏。
|
|
134
|
+
* 版本要求: 基础库 1.13.7 及以上
|
|
135
|
+
* @default false
|
|
136
|
+
* @supported alipay
|
|
137
|
+
*/
|
|
138
|
+
acceleration?: string
|
|
139
|
+
|
|
140
|
+
/** 是否禁用代码变动触发 swiper 切换时使用动画。
|
|
141
|
+
* 版本要求: 基础库 1.13.7 及以上
|
|
142
|
+
* @default false
|
|
143
|
+
* @supported alipay
|
|
144
|
+
*/
|
|
145
|
+
disableProgrammaticAnimation?: string
|
|
146
|
+
|
|
147
|
+
/** 动画结束时会触发 animationEnd 事件
|
|
148
|
+
* @supported alipay
|
|
149
|
+
*/
|
|
150
|
+
onAnimationEnd?: CommonEventFunction<SwiperProps.onCommonEventDetail>
|
|
151
|
+
|
|
152
|
+
/** 滑动距离阈值,当滑动距离超过阈值时进行 swiper-item 切换。
|
|
153
|
+
* 版本要求:基础库 1.24.11 及以上
|
|
154
|
+
* @supported alipay
|
|
155
|
+
*/
|
|
156
|
+
swipeRatio?: string
|
|
157
|
+
|
|
158
|
+
/** 滑动综合速度阈值,当超过阈值时进行 swiper-item 切换,数值越小越敏感。
|
|
159
|
+
* 版本要求:基础库 1.24.11 及以上
|
|
160
|
+
* @supported alipay
|
|
161
|
+
*/
|
|
162
|
+
swipeSpeed?: string
|
|
163
|
+
|
|
164
|
+
/** 计算用户手势时所依赖的滑动角度。角度根据 touchstart 事件和首次 touchmove 事件的坐标计算得出。数值越小越对用户的滑动方向准确度要求越高。
|
|
165
|
+
* 版本要求:基础库 1.24.11 及以上
|
|
166
|
+
* @supported alipay
|
|
167
|
+
*/
|
|
168
|
+
touchAngle?: string
|
|
169
|
+
|
|
170
|
+
/** 自动以指定滑块的高度为整个容器的高度。当 vertical 为 true 时,默认不调整。可选值为:
|
|
171
|
+
* 版本要求:基础库 2.6.4 及以上
|
|
172
|
+
* @supported alipay
|
|
173
|
+
*/
|
|
174
|
+
adjustHeight?: 'first' | 'current' | 'highest' | 'none'
|
|
175
|
+
|
|
176
|
+
/** vertical 为 true 时强制使 adjust-height 生效。
|
|
177
|
+
* 版本要求:基础库 2.6.4 及以上
|
|
178
|
+
* @supported alipay
|
|
179
|
+
*/
|
|
180
|
+
adjustVerticalHeight?: string
|
|
181
|
+
|
|
182
|
+
/** 是否停止响应用户 touchmove 操作
|
|
183
|
+
* @default false
|
|
184
|
+
* @supported swan
|
|
185
|
+
*/
|
|
186
|
+
disableTouchmove?: string
|
|
187
|
+
}
|
|
123
188
|
declare namespace SwiperProps {
|
|
124
189
|
/** 导致变更的原因 */
|
|
125
190
|
interface TChangeSource {
|
|
126
191
|
/** 自动播放 */
|
|
127
192
|
autoplay
|
|
193
|
+
|
|
128
194
|
/** 用户划动 */
|
|
129
195
|
touch
|
|
196
|
+
|
|
130
197
|
/** 其它原因 */
|
|
131
198
|
''
|
|
132
199
|
}
|
|
@@ -135,28 +202,40 @@ declare namespace SwiperProps {
|
|
|
135
202
|
interface TEasingFunction {
|
|
136
203
|
/** 默认缓动函数 */
|
|
137
204
|
default
|
|
205
|
+
|
|
138
206
|
/** 线性动画 */
|
|
139
207
|
linear
|
|
208
|
+
|
|
140
209
|
/** 缓入动画 */
|
|
141
210
|
easeInCubic
|
|
211
|
+
|
|
142
212
|
/** 缓出动画 */
|
|
143
213
|
easeOutCubic
|
|
214
|
+
|
|
144
215
|
/** 缓入缓出动画 */
|
|
145
216
|
easeInOutCubic
|
|
146
217
|
}
|
|
218
|
+
interface onCommonEventDetail {
|
|
219
|
+
/** 当前所在滑块的索引 */
|
|
220
|
+
current: number
|
|
147
221
|
|
|
222
|
+
/** 导致变更的原因 */
|
|
223
|
+
source: keyof SwiperProps.TChangeSource
|
|
224
|
+
}
|
|
148
225
|
interface onChangeEventDetail {
|
|
149
226
|
/** 当前所在滑块的索引 */
|
|
150
227
|
current: number
|
|
228
|
+
|
|
151
229
|
/** 导致变更的原因 */
|
|
152
230
|
source: keyof SwiperProps.TChangeSource
|
|
231
|
+
|
|
153
232
|
/** SwiperItem的itemId参数值 */
|
|
154
233
|
currentItemId?: string
|
|
155
234
|
}
|
|
156
|
-
|
|
157
235
|
interface onTransitionEventDetail {
|
|
158
236
|
/** X 坐标 */
|
|
159
237
|
dx: number
|
|
238
|
+
|
|
160
239
|
/** Y 坐标 */
|
|
161
240
|
dy: number
|
|
162
241
|
}
|
|
@@ -220,5 +299,4 @@ declare namespace SwiperProps {
|
|
|
220
299
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html
|
|
221
300
|
*/
|
|
222
301
|
declare const Swiper: ComponentType<SwiperProps>
|
|
223
|
-
|
|
224
302
|
export { Swiper, SwiperProps }
|
package/types/SwiperItem.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps } from './common'
|
|
3
|
-
|
|
4
3
|
interface SwiperItemProps extends StandardProps {
|
|
5
4
|
/** 该 swiper-item 的标识符
|
|
6
|
-
* @supported weapp, swan,
|
|
5
|
+
* @supported weapp, swan, tt, jd, h5, rn
|
|
7
6
|
*/
|
|
8
7
|
itemId?: string
|
|
8
|
+
|
|
9
|
+
/** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息
|
|
10
|
+
* @supported weapp
|
|
11
|
+
*/
|
|
12
|
+
skipHiddenItemLayout?: string
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
/** 仅可放置在 swiper 组件中,宽高自动设置为100%
|
|
@@ -66,5 +70,4 @@ interface SwiperItemProps extends StandardProps {
|
|
|
66
70
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/swiper-item.html
|
|
67
71
|
*/
|
|
68
72
|
declare const SwiperItem: ComponentType<SwiperItemProps>
|
|
69
|
-
|
|
70
73
|
export { SwiperItem, SwiperItemProps }
|
package/types/Switch.d.ts
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps, CommonEventFunction, FormItemProps } from './common'
|
|
3
|
-
|
|
4
3
|
interface SwitchProps extends StandardProps, FormItemProps {
|
|
5
4
|
/** 是否选中
|
|
6
5
|
* @default false
|
|
7
|
-
* @supported weapp,
|
|
6
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
8
7
|
*/
|
|
9
8
|
checked?: boolean
|
|
10
9
|
|
|
11
10
|
/** 是否禁用
|
|
12
11
|
* @default false
|
|
13
|
-
* @supported weapp,
|
|
12
|
+
* @supported weapp, alipay, swan, tt, qq, rn
|
|
14
13
|
*/
|
|
15
14
|
disabled?: boolean
|
|
16
15
|
|
|
17
16
|
/** 样式,有效值:switch, checkbox
|
|
18
17
|
* @default "switch"
|
|
19
|
-
* @supported weapp,
|
|
18
|
+
* @supported weapp, swan, tt, qq, jd, h5, rn
|
|
20
19
|
*/
|
|
21
20
|
type?: 'switch' | 'checkbox'
|
|
22
21
|
|
|
23
22
|
/** switch 的颜色,同 css 的 color
|
|
24
23
|
* @default "#04BE02"
|
|
25
|
-
* @supported weapp,
|
|
24
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
26
25
|
*/
|
|
27
26
|
color?: string
|
|
28
27
|
|
|
29
28
|
/** checked 改变时触发 change 事件
|
|
30
|
-
* @supported weapp,
|
|
29
|
+
* @supported weapp, alipay, swan, tt, qq, jd, rn
|
|
31
30
|
*/
|
|
32
31
|
onChange?: CommonEventFunction<SwitchProps.onChangeEventDetail>
|
|
33
32
|
|
|
@@ -35,8 +34,24 @@ interface SwitchProps extends StandardProps, FormItemProps {
|
|
|
35
34
|
* @supported h5
|
|
36
35
|
*/
|
|
37
36
|
nativeProps?: Record<string, unknown>
|
|
38
|
-
}
|
|
39
37
|
|
|
38
|
+
/** 组件名字,用于表单提交获取数据。
|
|
39
|
+
* @supported alipay
|
|
40
|
+
*/
|
|
41
|
+
name?: string
|
|
42
|
+
|
|
43
|
+
/** 是否为受控组件,为 true 时,checked 会完全受 setData 控制。
|
|
44
|
+
* 版本要求: 基础库 1.8.0 及以上
|
|
45
|
+
* @default false
|
|
46
|
+
* @supported alipay
|
|
47
|
+
*/
|
|
48
|
+
controlled?: string
|
|
49
|
+
|
|
50
|
+
/** 无障碍访问,(属性)元素的额外描述
|
|
51
|
+
* @supported qq
|
|
52
|
+
*/
|
|
53
|
+
ariaLabel?: string
|
|
54
|
+
}
|
|
40
55
|
declare namespace SwitchProps {
|
|
41
56
|
interface onChangeEventDetail {
|
|
42
57
|
value: boolean
|
|
@@ -83,5 +98,4 @@ declare namespace SwitchProps {
|
|
|
83
98
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/switch.html
|
|
84
99
|
*/
|
|
85
100
|
declare const Switch: ComponentType<SwitchProps>
|
|
86
|
-
|
|
87
101
|
export { Switch, SwitchProps }
|
package/types/Text.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps } from './common'
|
|
3
|
-
|
|
4
3
|
interface TextProps extends StandardProps {
|
|
5
4
|
/** 文本是否可选
|
|
6
5
|
* @default false
|
|
7
|
-
* @supported weapp,
|
|
6
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
8
7
|
*/
|
|
9
8
|
selectable?: boolean
|
|
10
9
|
|
|
@@ -15,24 +14,30 @@ interface TextProps extends StandardProps {
|
|
|
15
14
|
userSelect?: boolean
|
|
16
15
|
|
|
17
16
|
/** 显示连续空格
|
|
18
|
-
* @supported weapp, swan, tt
|
|
17
|
+
* @supported weapp, alipay, swan, tt, qq, jd
|
|
19
18
|
*/
|
|
20
19
|
space?: keyof TextProps.TSpace
|
|
21
20
|
|
|
22
21
|
/** 是否解码
|
|
23
22
|
* @default false
|
|
24
|
-
* @supported weapp, tt
|
|
23
|
+
* @supported weapp, alipay, tt, qq, jd
|
|
25
24
|
*/
|
|
26
25
|
decode?: boolean
|
|
27
|
-
}
|
|
28
26
|
|
|
27
|
+
/** 多行省略,值须大于等于 1,表现同 css 的 -webkit-line-clamp 属性一致。
|
|
28
|
+
* @supported alipay
|
|
29
|
+
*/
|
|
30
|
+
numberOfLines?: string
|
|
31
|
+
}
|
|
29
32
|
declare namespace TextProps {
|
|
30
33
|
/** space 的合法值 */
|
|
31
34
|
interface TSpace {
|
|
32
35
|
/** 中文字符空格一半大小 */
|
|
33
36
|
ensp
|
|
37
|
+
|
|
34
38
|
/** 中文字符空格大小 */
|
|
35
39
|
emsp
|
|
40
|
+
|
|
36
41
|
/** 根据字体设置的空格大小 */
|
|
37
42
|
nbsp
|
|
38
43
|
}
|
|
@@ -124,5 +129,4 @@ declare namespace TextProps {
|
|
|
124
129
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/text.html
|
|
125
130
|
*/
|
|
126
131
|
declare const Text: ComponentType<TextProps>
|
|
127
|
-
|
|
128
132
|
export { Text, TextProps }
|
package/types/Textarea.d.ts
CHANGED
|
@@ -1,97 +1,96 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps, CommonEventFunction, FormItemProps } from './common'
|
|
3
|
-
|
|
4
3
|
interface TextareaProps extends StandardProps, FormItemProps {
|
|
5
4
|
/** 输入框的内容
|
|
6
|
-
* @supported weapp,
|
|
5
|
+
* @supported weapp, alipay, swan, tt, qq, h5, rn
|
|
7
6
|
*/
|
|
8
7
|
value?: string
|
|
9
8
|
|
|
10
9
|
/** 输入框为空时占位符
|
|
11
|
-
* @supported weapp,
|
|
10
|
+
* @supported weapp, alipay, swan, tt, qq, h5, rn
|
|
12
11
|
*/
|
|
13
12
|
placeholder?: string
|
|
14
13
|
|
|
15
14
|
/** 指定 placeholder 的样式
|
|
16
|
-
* @supported weapp, tt
|
|
15
|
+
* @supported weapp, alipay, swan, tt, qq
|
|
17
16
|
*/
|
|
18
17
|
placeholderStyle?: string
|
|
19
18
|
|
|
20
19
|
/** 指定 placeholder 的样式类
|
|
21
20
|
* @default "textarea-placeholder"
|
|
22
|
-
* @supported weapp, tt
|
|
21
|
+
* @supported weapp, alipay, swan, tt, qq
|
|
23
22
|
*/
|
|
24
23
|
placeholderClass?: string
|
|
25
24
|
|
|
26
25
|
/** 是否禁用
|
|
27
26
|
* @default false
|
|
28
|
-
* @supported weapp,
|
|
27
|
+
* @supported weapp, alipay, swan, tt, qq, h5, rn
|
|
29
28
|
*/
|
|
30
29
|
disabled?: boolean
|
|
31
30
|
|
|
32
31
|
/** 最大输入长度,设置为 -1 的时候不限制最大长度
|
|
33
32
|
* @default 140
|
|
34
|
-
* @supported weapp,
|
|
33
|
+
* @supported weapp, alipay, swan, tt, qq, h5, rn
|
|
35
34
|
*/
|
|
36
35
|
maxlength?: number
|
|
37
36
|
|
|
38
37
|
/** 自动聚焦,拉起键盘
|
|
39
38
|
* @default false
|
|
40
|
-
* @supported weapp, h5
|
|
39
|
+
* @supported weapp, swan, qq, h5
|
|
41
40
|
*/
|
|
42
41
|
autoFocus?: boolean
|
|
43
42
|
|
|
44
43
|
/** 获取焦点
|
|
45
44
|
* @default false
|
|
46
|
-
* @supported weapp,
|
|
45
|
+
* @supported weapp, alipay, swan, tt, qq, rn
|
|
47
46
|
*/
|
|
48
47
|
focus?: boolean
|
|
49
48
|
|
|
50
49
|
/** 是否自动增高,设置 autoHeight 时,style.height不生效
|
|
51
50
|
* @default false
|
|
52
|
-
* @supported weapp,
|
|
51
|
+
* @supported weapp, alipay, swan, tt, qq, rn
|
|
53
52
|
*/
|
|
54
53
|
autoHeight?: boolean
|
|
55
54
|
|
|
56
55
|
/** 如果 Textarea 是在一个 `position:fixed` 的区域,需要显示指定属性 fixed 为 true
|
|
57
56
|
* @default false
|
|
58
|
-
* @supported weapp
|
|
57
|
+
* @supported weapp, swan, qq
|
|
59
58
|
*/
|
|
60
59
|
fixed?: boolean
|
|
61
60
|
|
|
62
61
|
/** 指定光标与键盘的距离,单位 px 。取 Textarea 距离底部的距离和 cursorSpacing 指定的距离的最小值作为光标与键盘的距离
|
|
63
62
|
* @default 0
|
|
64
|
-
* @supported weapp, tt
|
|
63
|
+
* @supported weapp, swan, tt, qq
|
|
65
64
|
*/
|
|
66
65
|
cursorSpacing?: number
|
|
67
66
|
|
|
68
67
|
/** 指定 focus 时的光标位置
|
|
69
68
|
* @default -1
|
|
70
|
-
* @supported weapp, tt
|
|
69
|
+
* @supported weapp, swan, tt, qq
|
|
71
70
|
*/
|
|
72
71
|
cursor?: number
|
|
73
72
|
|
|
74
73
|
/** 是否显示键盘上方带有”完成“按钮那一栏
|
|
75
74
|
* @default true
|
|
76
|
-
* @supported weapp, tt
|
|
75
|
+
* @supported weapp, swan, tt, qq
|
|
77
76
|
*/
|
|
78
77
|
showConfirmBar?: boolean
|
|
79
78
|
|
|
80
79
|
/** 光标起始位置,自动聚集时有效,需与 selectionEnd 搭配使用
|
|
81
80
|
* @default -1
|
|
82
|
-
* @supported weapp,
|
|
81
|
+
* @supported weapp, swan, tt, qq, rn
|
|
83
82
|
*/
|
|
84
83
|
selectionStart?: number
|
|
85
84
|
|
|
86
85
|
/** 光标结束位置,自动聚集时有效,需与 selectionStart 搭配使用
|
|
87
86
|
* @default -1
|
|
88
|
-
* @supported weapp,
|
|
87
|
+
* @supported weapp, swan, tt, qq, rn
|
|
89
88
|
*/
|
|
90
89
|
selectionEnd?: number
|
|
91
90
|
|
|
92
91
|
/** 键盘弹起时,是否自动上推页面
|
|
93
92
|
* @default true
|
|
94
|
-
* @supported weapp, tt
|
|
93
|
+
* @supported weapp, swan, tt, qq
|
|
95
94
|
*/
|
|
96
95
|
adjustPosition?: boolean
|
|
97
96
|
|
|
@@ -108,29 +107,29 @@ interface TextareaProps extends StandardProps, FormItemProps {
|
|
|
108
107
|
disableDefaultPadding?: boolean
|
|
109
108
|
|
|
110
109
|
/** 输入框聚焦时触发
|
|
111
|
-
* @supported weapp,
|
|
110
|
+
* @supported weapp, alipay, swan, tt, qq, h5, rn
|
|
112
111
|
*/
|
|
113
112
|
onFocus?: CommonEventFunction<TextareaProps.onFocusEventDetail>
|
|
114
113
|
|
|
115
114
|
/** 输入框失去焦点时触发
|
|
116
|
-
* @supported weapp,
|
|
115
|
+
* @supported weapp, alipay, swan, tt, qq, h5, rn
|
|
117
116
|
*/
|
|
118
117
|
onBlur?: CommonEventFunction<TextareaProps.onBlurEventDetail>
|
|
119
118
|
|
|
120
|
-
/**
|
|
121
|
-
* @supported weapp,
|
|
119
|
+
/** 输入框行数变化时调用
|
|
120
|
+
* @supported weapp, swan, tt, qq, rn
|
|
122
121
|
*/
|
|
123
122
|
onLineChange?: CommonEventFunction<TextareaProps.onLineChangeEventDetail>
|
|
124
123
|
|
|
125
|
-
/** 当键盘输入时,触发 input
|
|
124
|
+
/** 当键盘输入时,触发 input 事件
|
|
126
125
|
*
|
|
127
126
|
* **onInput 处理函数的返回值并不会反映到 textarea 上**
|
|
128
|
-
* @supported weapp,
|
|
127
|
+
* @supported weapp, alipay, swan, tt, qq, h5, rn
|
|
129
128
|
*/
|
|
130
129
|
onInput?: CommonEventFunction<TextareaProps.onInputEventDetail>
|
|
131
130
|
|
|
132
|
-
/** 点击完成时, 触发 confirm
|
|
133
|
-
* @supported weapp,
|
|
131
|
+
/** 点击完成时, 触发 confirm 事件
|
|
132
|
+
* @supported weapp, alipay, swan, tt, qq, rn
|
|
134
133
|
*/
|
|
135
134
|
onConfirm?: CommonEventFunction<TextareaProps.onConfirmEventDetail>
|
|
136
135
|
|
|
@@ -143,18 +142,51 @@ interface TextareaProps extends StandardProps, FormItemProps {
|
|
|
143
142
|
* @supported h5
|
|
144
143
|
*/
|
|
145
144
|
nativeProps?: Record<string, unknown>
|
|
146
|
-
}
|
|
147
145
|
|
|
146
|
+
/** 设置键盘右下角按钮的文字
|
|
147
|
+
* @supported weapp, alipay, swan, tt
|
|
148
|
+
*/
|
|
149
|
+
confirmType?: 'send' | 'search' | 'next' | 'go' | 'done' | 'return'
|
|
150
|
+
|
|
151
|
+
/** 点击键盘右下角按钮时是否保持键盘不收起
|
|
152
|
+
* @supported weapp, swan, tt
|
|
153
|
+
*/
|
|
154
|
+
confirmHold?: string
|
|
155
|
+
|
|
156
|
+
/** 组件名字,用于表单提交获取数据。
|
|
157
|
+
* @supported alipay
|
|
158
|
+
*/
|
|
159
|
+
name?: string
|
|
160
|
+
|
|
161
|
+
/** 是否渲染字数统计功能(是否删除默认计数器/是否显示字数统计)。
|
|
162
|
+
* 版本要求: 基础库 1.8.0 及以上
|
|
163
|
+
* @supported alipay
|
|
164
|
+
*/
|
|
165
|
+
showCount?: string
|
|
166
|
+
|
|
167
|
+
/** 是否为受控组件。为 true 时,value 内容会完全受 setData 控制。
|
|
168
|
+
* 版本要求: 基础库 1.8.0 及以上
|
|
169
|
+
* @supported alipay
|
|
170
|
+
*/
|
|
171
|
+
controlled?: string
|
|
172
|
+
|
|
173
|
+
/** 无障碍访问,(属性)元素的额外描述
|
|
174
|
+
* @supported qq
|
|
175
|
+
*/
|
|
176
|
+
ariaLabel?: string
|
|
177
|
+
}
|
|
148
178
|
declare namespace TextareaProps {
|
|
149
179
|
interface onFocusEventDetail {
|
|
150
180
|
/** 输入值 */
|
|
151
181
|
value: string
|
|
182
|
+
|
|
152
183
|
/** 键盘高度 */
|
|
153
184
|
height: number
|
|
154
185
|
}
|
|
155
186
|
interface onBlurEventDetail {
|
|
156
187
|
/** 输入值 */
|
|
157
188
|
value: string
|
|
189
|
+
|
|
158
190
|
/** 光标位置 */
|
|
159
191
|
cursor: number
|
|
160
192
|
}
|
|
@@ -166,8 +198,10 @@ declare namespace TextareaProps {
|
|
|
166
198
|
interface onInputEventDetail {
|
|
167
199
|
/** 输入值 */
|
|
168
200
|
value: string
|
|
201
|
+
|
|
169
202
|
/** 光标位置 */
|
|
170
203
|
cursor: number
|
|
204
|
+
|
|
171
205
|
/** 键值 */
|
|
172
206
|
keyCode: number
|
|
173
207
|
}
|
|
@@ -178,6 +212,7 @@ declare namespace TextareaProps {
|
|
|
178
212
|
interface onKeyboardHeightChangeEventDetail {
|
|
179
213
|
/** 键盘高度 */
|
|
180
214
|
height: number
|
|
215
|
+
|
|
181
216
|
/** 持续时间 */
|
|
182
217
|
duration: number
|
|
183
218
|
}
|
|
@@ -219,6 +254,4 @@ declare namespace TextareaProps {
|
|
|
219
254
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/textarea.html
|
|
220
255
|
*/
|
|
221
256
|
declare const Textarea: ComponentType<TextareaProps>
|
|
222
|
-
|
|
223
257
|
export { Textarea, TextareaProps }
|
|
224
|
-
|