@tarojs/components 4.2.1-beta.1 → 4.2.1-beta.2
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/{image-32205a1d.js → image-315b9040.js} +4 -8
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-image-core.cjs.entry.js +1 -1
- package/dist/collection/components/image/image.js +3 -8
- package/dist/collection/components/image/style/index.css +1 -1
- package/dist/components/taro-image-core.js +4 -9
- package/dist/esm/{image-9c1a61f3.js → image-a2d81773.js} +4 -8
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-image-core.entry.js +1 -1
- package/dist/hydrate/index.js +4 -9
- package/dist/taro-components/index.esm.js +1 -1
- package/dist/taro-components/p-3e521c50.entry.js +1 -0
- package/dist/taro-components/p-b28231cc.js +1 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/image/image.d.ts +0 -1
- package/package.json +5 -5
- package/types/Audio.d.ts +13 -13
- package/types/Button.d.ts +50 -16
- package/types/Camera.d.ts +7 -7
- package/types/Canvas.d.ts +10 -10
- package/types/Checkbox.d.ts +5 -5
- package/types/CheckboxGroup.d.ts +2 -2
- package/types/CoverImage.d.ts +42 -4
- package/types/CoverView.d.ts +21 -1
- package/types/CustomWrapper.d.ts +1 -1
- package/types/Editor.d.ts +20 -8
- package/types/Form.d.ts +3 -3
- package/types/Icon.d.ts +4 -4
- package/types/Image.d.ts +6 -6
- package/types/Input.d.ts +16 -16
- package/types/Label.d.ts +2 -2
- package/types/Map.d.ts +21 -17
- package/types/MovableArea.d.ts +2 -2
- package/types/MovableView.d.ts +16 -16
- package/types/Navigator.d.ts +8 -8
- package/types/Picker.d.ts +26 -26
- package/types/PickerView.d.ts +7 -7
- package/types/PickerViewColumn.d.ts +1 -1
- package/types/Progress.d.ts +13 -13
- package/types/Radio.d.ts +5 -5
- package/types/RadioGroup.d.ts +2 -2
- package/types/RichText.d.ts +4 -4
- package/types/ScrollView.d.ts +16 -16
- package/types/Slider.d.ts +14 -14
- package/types/Swiper.d.ts +14 -14
- package/types/SwiperItem.d.ts +2 -2
- package/types/Switch.d.ts +7 -7
- package/types/Text.d.ts +4 -4
- package/types/Textarea.d.ts +13 -13
- package/types/Video.d.ts +37 -37
- package/types/View.d.ts +5 -5
- package/types/WebView.d.ts +4 -4
- package/dist/taro-components/p-acf31ef0.js +0 -1
- package/dist/taro-components/p-eeec4f43.entry.js +0 -1
package/types/Video.d.ts
CHANGED
|
@@ -2,16 +2,16 @@ import { ComponentType } from 'react'
|
|
|
2
2
|
import { StandardProps, CommonEventFunction } from './common'
|
|
3
3
|
interface VideoProps extends StandardProps {
|
|
4
4
|
/** 要播放视频的资源地址
|
|
5
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
5
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
6
6
|
*/
|
|
7
7
|
src: string
|
|
8
8
|
/** 指定视频时长
|
|
9
|
-
* @supported weapp, alipay, qq, h5, rn, harmony, harmony_hybrid
|
|
9
|
+
* @supported weapp, alipay, qq, h5, rn, harmony, harmony_hybrid, ascf
|
|
10
10
|
*/
|
|
11
11
|
duration?: number
|
|
12
12
|
/** 是否显示默认播放控件(播放/暂停按钮、播放进度、时间)
|
|
13
13
|
* @default true
|
|
14
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
14
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
15
15
|
*/
|
|
16
16
|
controls?: boolean
|
|
17
17
|
/** 弹幕列表
|
|
@@ -30,21 +30,21 @@ interface VideoProps extends StandardProps {
|
|
|
30
30
|
enableDanmu?: boolean
|
|
31
31
|
/** 是否自动播放
|
|
32
32
|
* @default false
|
|
33
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
33
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
34
34
|
*/
|
|
35
35
|
autoplay?: boolean
|
|
36
36
|
/** 是否循环播放
|
|
37
37
|
* @default false
|
|
38
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
38
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
39
39
|
*/
|
|
40
40
|
loop?: boolean
|
|
41
41
|
/** 是否静音播放
|
|
42
42
|
* @default false
|
|
43
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
43
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
44
44
|
*/
|
|
45
45
|
muted?: boolean
|
|
46
46
|
/** 指定视频初始播放位置
|
|
47
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
|
|
47
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
|
|
48
48
|
*/
|
|
49
49
|
initialTime?: number
|
|
50
50
|
/** 在非全屏模式下,是否开启亮度与音量调节手势
|
|
@@ -53,7 +53,7 @@ interface VideoProps extends StandardProps {
|
|
|
53
53
|
*/
|
|
54
54
|
pageGesture?: boolean
|
|
55
55
|
/** 设置全屏时视频的方向,不指定则根据宽高比自动判断。有效值为 0(正常竖向), 90(屏幕逆时针90度), -90(屏幕顺时针90度)
|
|
56
|
-
* @supported weapp, alipay, swan, tt, qq
|
|
56
|
+
* @supported weapp, alipay, swan, tt, qq, ascf
|
|
57
57
|
*/
|
|
58
58
|
direction?: number
|
|
59
59
|
/** 若不设置,宽度大于240时才会显示
|
|
@@ -63,12 +63,12 @@ interface VideoProps extends StandardProps {
|
|
|
63
63
|
showProgress?: boolean
|
|
64
64
|
/** 是否显示全屏按钮
|
|
65
65
|
* @default true
|
|
66
|
-
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
|
|
66
|
+
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid, ascf
|
|
67
67
|
*/
|
|
68
68
|
showFullscreenBtn?: boolean
|
|
69
69
|
/** 是否显示视频底部控制栏的播放按钮
|
|
70
70
|
* @default true
|
|
71
|
-
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
|
|
71
|
+
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid, ascf
|
|
72
72
|
*/
|
|
73
73
|
showPlayBtn?: boolean
|
|
74
74
|
/** 是否显示视频中间的播放按钮
|
|
@@ -78,25 +78,25 @@ interface VideoProps extends StandardProps {
|
|
|
78
78
|
showCenterPlayBtn?: boolean
|
|
79
79
|
/** 是否开启控制进度的手势
|
|
80
80
|
* @default true
|
|
81
|
-
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
|
|
81
|
+
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid, ascf
|
|
82
82
|
*/
|
|
83
83
|
enableProgressGesture?: boolean
|
|
84
84
|
/** 当视频大小与 video 容器大小不一致时,视频的表现形式
|
|
85
85
|
* @default "contain"
|
|
86
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid
|
|
86
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid, ascf
|
|
87
87
|
*/
|
|
88
88
|
objectFit?: keyof VideoProps.ObjectFit
|
|
89
89
|
/** 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效
|
|
90
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
|
|
90
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
|
|
91
91
|
*/
|
|
92
92
|
poster?: string
|
|
93
93
|
/** 是否显示静音按钮
|
|
94
94
|
* @default false
|
|
95
|
-
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
|
|
95
|
+
* @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid, ascf
|
|
96
96
|
*/
|
|
97
97
|
showMuteBtn?: boolean
|
|
98
98
|
/** 视频的标题,全屏时在顶部展示
|
|
99
|
-
* @supported weapp, swan, qq
|
|
99
|
+
* @supported weapp, swan, qq, ascf
|
|
100
100
|
*/
|
|
101
101
|
title?: string
|
|
102
102
|
/** 播放按钮的位置
|
|
@@ -104,12 +104,12 @@ interface VideoProps extends StandardProps {
|
|
|
104
104
|
* - `center`: 视频中间
|
|
105
105
|
*
|
|
106
106
|
* @default 'bottom'
|
|
107
|
-
* @supported weapp, tt, qq
|
|
107
|
+
* @supported weapp, tt, qq, ascf
|
|
108
108
|
*/
|
|
109
109
|
playBtnPosition?: keyof VideoProps.PlayBtnPosition
|
|
110
110
|
/** 是否开启播放手势,即双击切换播放/暂停
|
|
111
111
|
* @default false
|
|
112
|
-
* @supported weapp, swan, tt, qq, h5, harmony_hybrid
|
|
112
|
+
* @supported weapp, swan, tt, qq, h5, harmony_hybrid, ascf
|
|
113
113
|
*/
|
|
114
114
|
enablePlayGesture?: boolean
|
|
115
115
|
/** 当跳转到其它小程序页面时,是否自动暂停本页面的视频
|
|
@@ -124,12 +124,12 @@ interface VideoProps extends StandardProps {
|
|
|
124
124
|
autoPauseIfOpenNative?: boolean
|
|
125
125
|
/** 在非全屏模式下,是否开启亮度与音量调节手势(同 `page-gesture`)
|
|
126
126
|
* @default false
|
|
127
|
-
* @supported weapp, swan, tt, h5, harmony_hybrid
|
|
127
|
+
* @supported weapp, swan, tt, h5, harmony_hybrid, ascf
|
|
128
128
|
*/
|
|
129
129
|
vslideGesture?: boolean
|
|
130
130
|
/** 在全屏模式下,是否开启亮度与音量调节手势
|
|
131
131
|
* @default true
|
|
132
|
-
* @supported weapp, swan, tt, h5, harmony_hybrid
|
|
132
|
+
* @supported weapp, swan, tt, h5, harmony_hybrid, ascf
|
|
133
133
|
*/
|
|
134
134
|
vslideGestureInFullscreen?: boolean
|
|
135
135
|
/** 视频前贴广告单元ID,更多详情可参考开放能力[视频前贴广告](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/ad/video-patch-ad.html)
|
|
@@ -141,7 +141,7 @@ interface VideoProps extends StandardProps {
|
|
|
141
141
|
*/
|
|
142
142
|
posterForCrawler?: string
|
|
143
143
|
/** 显示投屏按钮。只安卓且同层渲染下生效,支持 DLNA 协议
|
|
144
|
-
* @supported weapp
|
|
144
|
+
* @supported weapp, ascf
|
|
145
145
|
*/
|
|
146
146
|
showCastingButton?: boolean
|
|
147
147
|
/**
|
|
@@ -163,12 +163,12 @@ interface VideoProps extends StandardProps {
|
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* 是否开启手机横屏时自动全屏,当系统设置开启自动旋转时生效
|
|
166
|
-
* @supported weapp
|
|
166
|
+
* @supported weapp, ascf
|
|
167
167
|
*/
|
|
168
168
|
enableAutoRotation?: boolean
|
|
169
169
|
/**
|
|
170
170
|
* 是否显示锁屏按钮,仅在全屏时显示,锁屏后控制栏的操作
|
|
171
|
-
* @supported weapp, tt
|
|
171
|
+
* @supported weapp, tt, ascf
|
|
172
172
|
*/
|
|
173
173
|
showScreenLockButton?: boolean
|
|
174
174
|
/**
|
|
@@ -298,41 +298,41 @@ interface VideoProps extends StandardProps {
|
|
|
298
298
|
*/
|
|
299
299
|
definition?: string
|
|
300
300
|
/** 当开始/继续播放时触发 play 事件
|
|
301
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
301
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
302
302
|
*/
|
|
303
303
|
onPlay?: CommonEventFunction
|
|
304
304
|
/** 当暂停播放时触发 pause 事件
|
|
305
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
305
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
306
306
|
*/
|
|
307
307
|
onPause?: CommonEventFunction
|
|
308
308
|
/** 当播放到末尾时触发 ended 事件
|
|
309
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
309
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
310
310
|
*/
|
|
311
311
|
onEnded?: CommonEventFunction
|
|
312
312
|
/** 播放进度变化时触发, 触发频率 250ms 一次
|
|
313
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
313
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
314
314
|
*/
|
|
315
315
|
onTimeUpdate?: CommonEventFunction<VideoProps.onTimeUpdateEventDetail>
|
|
316
316
|
/** 当视频进入和退出全屏时触发
|
|
317
317
|
*
|
|
318
|
-
* @supported alipay, h5, rn, harmony, harmony_hybrid
|
|
318
|
+
* @supported alipay, h5, rn, harmony, harmony_hybrid, ascf
|
|
319
319
|
*/
|
|
320
320
|
onFullscreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
|
|
321
321
|
/** 视频出现缓冲时触发
|
|
322
322
|
*
|
|
323
|
-
* @supported weapp, swan, tt, qq, jd
|
|
323
|
+
* @supported weapp, swan, tt, qq, jd, ascf
|
|
324
324
|
*/
|
|
325
325
|
onWaiting?: CommonEventFunction<VideoProps.onWaitingEventDetail>
|
|
326
326
|
/** 视频播放出错时触发
|
|
327
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
|
|
327
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
|
|
328
328
|
*/
|
|
329
329
|
onError?: CommonEventFunction
|
|
330
330
|
/** 加载进度变化时触发,只支持一段加载
|
|
331
|
-
* @supported weapp, tt, qq, h5, harmony, harmony_hybrid
|
|
331
|
+
* @supported weapp, tt, qq, h5, harmony, harmony_hybrid, ascf
|
|
332
332
|
*/
|
|
333
333
|
onProgress?: CommonEventFunction<VideoProps.onProgressEventDetail>
|
|
334
334
|
/** 视频元数据加载完成时触发
|
|
335
|
-
* @supported weapp, swan, tt, jd, rn, harmony
|
|
335
|
+
* @supported weapp, swan, tt, jd, rn, harmony, ascf
|
|
336
336
|
*/
|
|
337
337
|
onLoadedMetaData?: CommonEventFunction<VideoProps.onLoadedMetaDataEventDetail>
|
|
338
338
|
/**
|
|
@@ -347,7 +347,7 @@ interface VideoProps extends StandardProps {
|
|
|
347
347
|
onLeavePictureInPicture?: CommonEventFunction
|
|
348
348
|
/**
|
|
349
349
|
* seek 完成时触发
|
|
350
|
-
* @supported weapp, tt
|
|
350
|
+
* @supported weapp, tt, ascf
|
|
351
351
|
*/
|
|
352
352
|
onSeekComplete?: CommonEventFunction
|
|
353
353
|
/** 视频进入和退出全屏时触发
|
|
@@ -355,7 +355,7 @@ interface VideoProps extends StandardProps {
|
|
|
355
355
|
*/
|
|
356
356
|
onFullScreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
|
|
357
357
|
/** 切换 controls 显示隐藏时触发。
|
|
358
|
-
* @supported weapp, swan
|
|
358
|
+
* @supported weapp, swan, ascf
|
|
359
359
|
*/
|
|
360
360
|
onControlsToggle?: CommonEventFunction<VideoProps.onControlsToggleEventDetail>
|
|
361
361
|
/** 视频出现缓冲时触发。
|
|
@@ -445,15 +445,15 @@ interface VideoProps extends StandardProps {
|
|
|
445
445
|
*/
|
|
446
446
|
onAdLoad?: CommonEventFunction
|
|
447
447
|
/** 用户选择投屏设备时触发 detail = { state: "success"/"fail" }
|
|
448
|
-
* @supported weapp
|
|
448
|
+
* @supported weapp, ascf
|
|
449
449
|
*/
|
|
450
450
|
onCastingUserSelect?: CommonEventFunction
|
|
451
451
|
/** 投屏成功/失败时触发 detail = { type, state: "success"/"fail" }
|
|
452
|
-
* @supported weapp
|
|
452
|
+
* @supported weapp, ascf
|
|
453
453
|
*/
|
|
454
454
|
onCastingStateChange?: CommonEventFunction
|
|
455
455
|
/** 投屏被中断时触发
|
|
456
|
-
* @supported weapp
|
|
456
|
+
* @supported weapp, ascf
|
|
457
457
|
*/
|
|
458
458
|
onCastingInterrupt?: CommonEventFunction
|
|
459
459
|
}
|
|
@@ -557,7 +557,7 @@ declare namespace VideoProps {
|
|
|
557
557
|
}
|
|
558
558
|
/** 视频。相关api:Taro.createVideoContext
|
|
559
559
|
* @classification media
|
|
560
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
560
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
561
561
|
* @example_react
|
|
562
562
|
* ```tsx
|
|
563
563
|
* export default class PageView extends Component {
|
package/types/View.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { CommonEventFunction, StandardProps } from './common'
|
|
|
4
4
|
interface ViewProps extends StandardProps {
|
|
5
5
|
/** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
|
|
6
6
|
* @default none
|
|
7
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
|
|
7
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
|
|
8
8
|
* @rn 由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
|
|
9
9
|
*/
|
|
10
10
|
hoverClass?: string
|
|
@@ -15,17 +15,17 @@ interface ViewProps extends StandardProps {
|
|
|
15
15
|
hoverStyle?: StyleProp<ViewStyle>
|
|
16
16
|
/** 指定是否阻止本节点的祖先节点出现点击态
|
|
17
17
|
* @default false
|
|
18
|
-
* @supported weapp, alipay, swan, tt, qq, jd
|
|
18
|
+
* @supported weapp, alipay, swan, tt, qq, jd, ascf
|
|
19
19
|
*/
|
|
20
20
|
hoverStopPropagation?: boolean
|
|
21
21
|
/** 按住后多久出现点击态,单位毫秒
|
|
22
22
|
* @default 50
|
|
23
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
|
|
23
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
|
|
24
24
|
*/
|
|
25
25
|
hoverStartTime?: number
|
|
26
26
|
/** 手指松开后点击态保留时间,单位毫秒
|
|
27
27
|
* @default 400
|
|
28
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
|
|
28
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
|
|
29
29
|
*/
|
|
30
30
|
hoverStayTime?: number
|
|
31
31
|
/** 是否阻止区域内滚动页面。
|
|
@@ -117,7 +117,7 @@ interface ViewProps extends StandardProps {
|
|
|
117
117
|
}
|
|
118
118
|
/** 视图容器
|
|
119
119
|
* @classification viewContainer
|
|
120
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
120
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
121
121
|
* @example_react
|
|
122
122
|
* ```tsx
|
|
123
123
|
* export default class PageView extends Component {
|
package/types/WebView.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ComponentType } from 'react'
|
|
|
2
2
|
import { StandardProps, CommonEventFunction } from './common'
|
|
3
3
|
interface WebViewProps extends StandardProps {
|
|
4
4
|
/** webview 指向网页的链接。可打开关联的公众号的文章,其它网页需登录小程序管理后台配置业务域名。
|
|
5
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
|
|
5
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
|
|
6
6
|
*/
|
|
7
7
|
src: string
|
|
8
8
|
/** webview 的进度条颜色
|
|
@@ -15,11 +15,11 @@ interface WebViewProps extends StandardProps {
|
|
|
15
15
|
*/
|
|
16
16
|
type?: string
|
|
17
17
|
/** 网页向小程序 postMessage 时,会在特定时机(小程序后退、组件销毁、分享)触发并收到消息。e.detail = { data }
|
|
18
|
-
* @supported weapp, alipay, swan, tt, qq, jd
|
|
18
|
+
* @supported weapp, alipay, swan, tt, qq, jd, ascf
|
|
19
19
|
*/
|
|
20
20
|
onMessage?: CommonEventFunction<WebViewProps.onMessageEventDetail>
|
|
21
21
|
/** 网页加载成功时候触发此事件。e.detail = { src }
|
|
22
|
-
* @supported weapp, alipay, tt, qq, h5, rn, harmony_hybrid
|
|
22
|
+
* @supported weapp, alipay, tt, qq, h5, rn, harmony_hybrid, ascf
|
|
23
23
|
*/
|
|
24
24
|
onLoad?: CommonEventFunction<WebViewProps.onLoadEventDetail>
|
|
25
25
|
/** 网页加载失败的时候触发此事件。e.detail = { src }
|
|
@@ -43,7 +43,7 @@ declare namespace WebViewProps {
|
|
|
43
43
|
}
|
|
44
44
|
/** web-view 组件是一个可以用来承载网页的容器,会自动铺满整个小程序页面。个人类型与海外类型的小程序暂不支持使用。
|
|
45
45
|
* @classification open
|
|
46
|
-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
|
|
46
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
|
|
47
47
|
* @example_react
|
|
48
48
|
* ```tsx
|
|
49
49
|
* class App extends Component {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e}from"./p-f72fcd8c.js";import{c as a}from"./p-160d710a.js";const s=class{constructor(o){t(this,o),this.onLoad=i(this,"load",7),this.onError=i(this,"error",7),this.src=void 0,this.mode="scaleToFill",this.lazyLoad=!1,this.nativeProps={},this.disableDefaultSize=!1,this.aspectFillMode="width",this.didLoad=!1}componentDidLoad(){if(!this.lazyLoad||!this.imgRef)return;const t=new IntersectionObserver((i=>{i[i.length-1].isIntersecting&&(this.imgRef&&t.unobserve(this.imgRef),this.didLoad=!0)}),{rootMargin:"300px 0px"});t.observe(this.imgRef)}imageOnLoad(){if(!this.imgRef)return;const{width:t,height:i,naturalWidth:o,naturalHeight:e}=this.imgRef;this.onLoad.emit({width:t,height:i}),this.aspectFillMode=o>e?"width":"height"}imageOnError(t){this.onError.emit(t)}render(){const{src:t,lazyLoad:i=!1,aspectFillMode:s="width",imageOnLoad:r,imageOnError:h,nativeProps:m,didLoad:l}=this,d=this.mode||"scaleToFill",n=a({"taro-img__widthfix":"widthFix"===d,"taro-img__disable-default-size":this.disableDefaultSize}),g=a(`taro-img__mode-${d.toLowerCase().replace(/\s/g,"")}`,{[`taro-img__mode-aspectfill--${s}`]:"aspectFill"===d});return o(e,{class:n},t?o("img",Object.assign({ref:t=>this.imgRef=t,class:g,src:i&&!l?void 0:t,onLoad:r.bind(this),onError:h.bind(this)},m)):"")}};s.style='img[src=""]{opacity:0}:where(taro-image-core){width:320px;height:240px;font-size:0;display:inline-block;position:relative;overflow:hidden}:where(taro-image-core.taro-img__disable-default-size){width:auto;height:auto}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-scaletofill{width:100%;height:100%}.taro-img__mode-aspectfit{max-width:100%;max-height:100%;position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-aspectfill{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.taro-img__mode-aspectfill--width{min-width:100%;height:100%}.taro-img__mode-aspectfill--height{width:100%;min-height:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-heightfix{height:100%}.taro-img__mode-top{position:absolute;left:50%;transform:translate(-50%)}.taro-img__mode-bottom{position:absolute;bottom:0;left:50%;transform:translate(-50%)}.taro-img__mode-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.taro-img__mode-left{position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-right{position:absolute;top:50%;right:0;transform:translateY(-50%)}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{position:absolute;bottom:0}.taro-img__mode-bottomright{position:absolute;bottom:0;right:0}';export{s as I}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{I as taro_image_core}from"./p-acf31ef0.js";import"./p-f72fcd8c.js";import"./p-160d710a.js";
|