@tarojs/components 3.4.0 → 3.4.3
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/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-input-core.cjs.entry.js +25 -16
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +12 -3
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-tabbar.cjs.entry.js +3 -2
- package/dist/collection/components/input/input.js +40 -22
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +11 -2
- package/dist/collection/components/pull-to-refresh/style/index.css +1 -0
- package/dist/collection/components/scroll-view/scroll-view.js +3 -3
- package/dist/collection/components/tabbar/style/index.css +3 -1
- package/dist/collection/components/tabbar/tabbar.js +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-input-core.entry.js +25 -16
- package/dist/esm/taro-pull-to-refresh.entry.js +12 -3
- package/dist/esm/taro-scroll-view-core.entry.js +3 -3
- package/dist/esm/taro-tabbar.entry.js +3 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/taro-components/p-2b0d5c90.system.entry.js +1 -0
- package/dist/taro-components/p-33ee636a.system.js +1 -1
- package/dist/taro-components/p-4e54216b.entry.js +1 -0
- package/dist/taro-components/p-5ae86835.system.entry.js +1 -0
- package/dist/taro-components/{p-dd34408a.entry.js → p-6de12779.entry.js} +1 -1
- package/dist/taro-components/p-71e14298.entry.js +1 -0
- package/dist/taro-components/p-8486c251.system.entry.js +1 -0
- package/dist/taro-components/{p-6965567d.entry.js → p-cc818a13.entry.js} +1 -1
- package/dist/taro-components/{p-13c1404f.system.entry.js → p-fd0d1168.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +3 -3
- package/dist/types/components.d.ts +1 -0
- package/dist-h5/vue/components/picker.js +2 -1
- package/package.json +4 -4
- package/types/Ad.d.ts +22 -10
- package/types/Audio.d.ts +25 -5
- package/types/Button.d.ts +112 -23
- package/types/Camera.d.ts +11 -11
- package/types/Canvas.d.ts +14 -1
- package/types/Checkbox.d.ts +65 -1
- package/types/CoverImage.d.ts +48 -6
- package/types/CoverView.d.ts +51 -8
- package/types/Editor.d.ts +57 -0
- package/types/Form.d.ts +33 -2
- package/types/FunctionalPageNavigator.d.ts +4 -4
- package/types/Icon.d.ts +17 -1
- package/types/Image.d.ts +24 -4
- package/types/Input.d.ts +66 -5
- package/types/KeyboardAccessory.d.ts +2 -1
- package/types/Label.d.ts +18 -4
- package/types/LivePlayer.d.ts +17 -11
- package/types/LivePusher.d.ts +21 -15
- package/types/Map.d.ts +59 -5
- package/types/MatchMedia.d.ts +24 -5
- package/types/MovableArea.d.ts +9 -3
- package/types/MovableView.d.ts +20 -6
- package/types/Navigator.d.ts +7 -7
- package/types/OfficialAccount.d.ts +4 -10
- package/types/OpenData.d.ts +11 -5
- package/types/PageContainer.d.ts +12 -6
- package/types/Picker.d.ts +66 -3
- package/types/PickerView.d.ts +66 -2
- package/types/PickerViewColumn.d.ts +1 -1
- package/types/Progress.d.ts +12 -1
- package/types/Radio.d.ts +77 -1
- package/types/RichText.d.ts +33 -1
- package/types/ScrollView.d.ts +91 -9
- package/types/ShareElement.d.ts +1 -1
- package/types/Slider.d.ts +14 -1
- package/types/Swiper.d.ts +26 -1
- package/types/SwiperItem.d.ts +28 -3
- package/types/Switch.d.ts +21 -3
- package/types/Text.d.ts +38 -1
- package/types/Textarea.d.ts +17 -1
- package/types/Video.d.ts +50 -30
- package/types/View.d.ts +33 -1
- package/types/VoipRoom.d.ts +10 -11
- package/types/WebView.d.ts +7 -1
- package/types/common.d.ts +1 -1
- package/dist/taro-components/p-04818461.system.entry.js +0 -1
- package/dist/taro-components/p-56618f09.entry.js +0 -1
- package/dist/taro-components/p-665e8461.system.entry.js +0 -1
- package/dist/taro-components/p-6fcaadc7.entry.js +0 -1
- package/dist/taro-components/p-bb0d4567.system.entry.js +0 -1
package/types/Video.d.ts
CHANGED
|
@@ -3,19 +3,19 @@ import { StandardProps, CommonEventFunction } from './common'
|
|
|
3
3
|
|
|
4
4
|
interface VideoProps extends StandardProps {
|
|
5
5
|
/** 要播放视频的资源地址
|
|
6
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
6
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
7
7
|
*/
|
|
8
8
|
src: string
|
|
9
9
|
|
|
10
10
|
/** 指定视频时长
|
|
11
|
-
* @supported weapp, swan, alipay
|
|
11
|
+
* @supported weapp, swan, alipay, rn
|
|
12
12
|
* @h5 待定
|
|
13
13
|
*/
|
|
14
14
|
duration?: number
|
|
15
15
|
|
|
16
16
|
/** 是否显示默认播放控件(播放/暂停按钮、播放进度、时间)
|
|
17
17
|
* @default true
|
|
18
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
18
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
19
19
|
*/
|
|
20
20
|
controls?: boolean
|
|
21
21
|
|
|
@@ -41,24 +41,24 @@ interface VideoProps extends StandardProps {
|
|
|
41
41
|
|
|
42
42
|
/** 是否自动播放
|
|
43
43
|
* @default false
|
|
44
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
44
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
45
45
|
*/
|
|
46
46
|
autoplay?: boolean
|
|
47
47
|
|
|
48
48
|
/** 是否循环播放
|
|
49
49
|
* @default false
|
|
50
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
50
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
51
51
|
*/
|
|
52
52
|
loop?: boolean
|
|
53
53
|
|
|
54
54
|
/** 是否静音播放
|
|
55
55
|
* @default false
|
|
56
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
56
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
57
57
|
*/
|
|
58
58
|
muted?: boolean
|
|
59
59
|
|
|
60
60
|
/** 指定视频初始播放位置
|
|
61
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
61
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
62
62
|
*/
|
|
63
63
|
initialTime?: number
|
|
64
64
|
|
|
@@ -97,7 +97,7 @@ interface VideoProps extends StandardProps {
|
|
|
97
97
|
|
|
98
98
|
/** 是否显示视频中间的播放按钮
|
|
99
99
|
* @default true
|
|
100
|
-
* @supported weapp, swan, alipay
|
|
100
|
+
* @supported weapp, swan, alipay, rn
|
|
101
101
|
* @h5 待定
|
|
102
102
|
*/
|
|
103
103
|
showCenterPlayBtn?: boolean
|
|
@@ -114,10 +114,10 @@ interface VideoProps extends StandardProps {
|
|
|
114
114
|
* @supported weapp, swan, alipay
|
|
115
115
|
* @h5 待定
|
|
116
116
|
*/
|
|
117
|
-
objectFit?: keyof VideoProps.
|
|
117
|
+
objectFit?: keyof VideoProps.ObjectFit
|
|
118
118
|
|
|
119
119
|
/** 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效
|
|
120
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
120
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
121
121
|
*/
|
|
122
122
|
poster?: string
|
|
123
123
|
|
|
@@ -142,7 +142,7 @@ interface VideoProps extends StandardProps {
|
|
|
142
142
|
* @supported weapp
|
|
143
143
|
* @h5 待定
|
|
144
144
|
*/
|
|
145
|
-
playBtnPosition?: keyof VideoProps.
|
|
145
|
+
playBtnPosition?: keyof VideoProps.PlayBtnPosition
|
|
146
146
|
|
|
147
147
|
/** 是否开启播放手势,即双击切换播放/暂停
|
|
148
148
|
* @default false
|
|
@@ -203,12 +203,12 @@ interface VideoProps extends StandardProps {
|
|
|
203
203
|
/**
|
|
204
204
|
* 是否在小窗模式下显示播放进度(目前有bug,先注释掉)
|
|
205
205
|
* @supported weapp
|
|
206
|
-
*
|
|
206
|
+
*
|
|
207
207
|
* 先注释掉,原因如下:
|
|
208
208
|
* 该属性超过了 wxml 属性的长度限制,实际无法使用且导致编译报错。可等微信官方修复后再放开。
|
|
209
209
|
* 参考1:https://developers.weixin.qq.com/community/develop/doc/000a429beb87f0eac07acc0fc5b400
|
|
210
210
|
* 参考2: https://developers.weixin.qq.com/community/develop/doc/0006883619c48054286a4308258c00?_at=vyxqpllafi
|
|
211
|
-
*
|
|
211
|
+
*
|
|
212
212
|
*/
|
|
213
213
|
// pictureInPictureShowProgress?: boolean
|
|
214
214
|
|
|
@@ -217,7 +217,7 @@ interface VideoProps extends StandardProps {
|
|
|
217
217
|
* @supported weapp
|
|
218
218
|
*/
|
|
219
219
|
enableAutoRotation?: boolean
|
|
220
|
-
|
|
220
|
+
|
|
221
221
|
/**
|
|
222
222
|
* 是否显示锁屏按钮,仅在全屏时显示,锁屏后控制栏的操作
|
|
223
223
|
* @supported weapp
|
|
@@ -225,31 +225,31 @@ interface VideoProps extends StandardProps {
|
|
|
225
225
|
showScreenLockButton?: boolean
|
|
226
226
|
|
|
227
227
|
/** 当开始/继续播放时触发 play 事件
|
|
228
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
228
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
229
229
|
*/
|
|
230
230
|
onPlay?: CommonEventFunction
|
|
231
231
|
|
|
232
232
|
/** 当暂停播放时触发 pause 事件
|
|
233
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
233
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
234
234
|
*/
|
|
235
235
|
onPause?: CommonEventFunction
|
|
236
236
|
|
|
237
237
|
/** 当播放到末尾时触发 ended 事件
|
|
238
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
238
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
239
239
|
*/
|
|
240
240
|
onEnded?: CommonEventFunction
|
|
241
241
|
|
|
242
242
|
/** 播放进度变化时触发, 触发频率 250ms 一次
|
|
243
243
|
*
|
|
244
244
|
* event.detail = {currentTime, duration}
|
|
245
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
245
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
246
246
|
*/
|
|
247
247
|
onTimeUpdate?: CommonEventFunction<VideoProps.onTimeUpdateEventDetail>
|
|
248
248
|
|
|
249
249
|
/** 当视频进入和退出全屏时触发
|
|
250
250
|
*
|
|
251
251
|
* event.detail = {fullScreen, direction},direction取为 vertical 或 horizontal
|
|
252
|
-
* @supported weapp, swan, alipay
|
|
252
|
+
* @supported weapp, swan, alipay, rn
|
|
253
253
|
* @h5 待定
|
|
254
254
|
*/
|
|
255
255
|
onFullscreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
|
|
@@ -263,7 +263,7 @@ interface VideoProps extends StandardProps {
|
|
|
263
263
|
onWaiting?: CommonEventFunction<VideoProps.onWaitingEventDetail>
|
|
264
264
|
|
|
265
265
|
/** 视频播放出错时触发
|
|
266
|
-
* @supported weapp, h5, swan, alipay, tt
|
|
266
|
+
* @supported weapp, h5, swan, alipay, tt, rn
|
|
267
267
|
*/
|
|
268
268
|
onError?: CommonEventFunction
|
|
269
269
|
/** 加载进度变化时触发,只支持一段加载
|
|
@@ -273,7 +273,7 @@ interface VideoProps extends StandardProps {
|
|
|
273
273
|
onProgress?: CommonEventFunction<VideoProps.onProgressEventDetail>
|
|
274
274
|
|
|
275
275
|
/** 视频元数据加载完成时触发。event.detail = {width, height, duration}
|
|
276
|
-
* @supported weapp
|
|
276
|
+
* @supported weapp, rn
|
|
277
277
|
*/
|
|
278
278
|
onLoadedMetaData?: CommonEventFunction
|
|
279
279
|
|
|
@@ -300,6 +300,11 @@ interface VideoProps extends StandardProps {
|
|
|
300
300
|
* @supported weapp
|
|
301
301
|
*/
|
|
302
302
|
onSeekComplete?: CommonEventFunction
|
|
303
|
+
|
|
304
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
305
|
+
* @supported h5
|
|
306
|
+
*/
|
|
307
|
+
nativeProps?: Record<string, unknown>
|
|
303
308
|
}
|
|
304
309
|
|
|
305
310
|
declare namespace VideoProps {
|
|
@@ -313,7 +318,7 @@ declare namespace VideoProps {
|
|
|
313
318
|
'-90'
|
|
314
319
|
}
|
|
315
320
|
/** objectFit 的合法值 */
|
|
316
|
-
interface
|
|
321
|
+
interface ObjectFit {
|
|
317
322
|
/** 包含 */
|
|
318
323
|
contain
|
|
319
324
|
/** 填充 */
|
|
@@ -322,7 +327,7 @@ declare namespace VideoProps {
|
|
|
322
327
|
cover
|
|
323
328
|
}
|
|
324
329
|
/** playBtnPosition 的合法值 */
|
|
325
|
-
interface
|
|
330
|
+
interface PlayBtnPosition {
|
|
326
331
|
/** controls bar上 */
|
|
327
332
|
bottom
|
|
328
333
|
/** 视频中间 */
|
|
@@ -359,27 +364,27 @@ declare namespace VideoProps {
|
|
|
359
364
|
}
|
|
360
365
|
|
|
361
366
|
/** 视频。相关api:Taro.createVideoContext
|
|
362
|
-
*
|
|
367
|
+
*
|
|
363
368
|
* 备注:h5上因为没有测试,所以暂时写了“待定”,需要`Video`来确认。
|
|
364
369
|
* @classification media
|
|
365
370
|
* @supported weapp, h5, swan, alipay, tt
|
|
366
|
-
* @
|
|
371
|
+
* @example_react
|
|
367
372
|
* ```tsx
|
|
368
373
|
* export default class PageView extends Component {
|
|
369
374
|
* constructor() {
|
|
370
375
|
* super(...arguments)
|
|
371
376
|
* }
|
|
372
|
-
*
|
|
377
|
+
*
|
|
373
378
|
* render() {
|
|
374
379
|
* return (
|
|
375
380
|
* <View className='components-page'>
|
|
376
381
|
* <Video
|
|
377
|
-
*
|
|
382
|
+
* id='video'
|
|
383
|
+
* src='https://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
|
|
384
|
+
* poster='https://misc.aotu.io/booxood/mobile-video/cover_900x500.jpg'
|
|
385
|
+
* initialTime='0'
|
|
378
386
|
* controls={true}
|
|
379
387
|
* autoplay={false}
|
|
380
|
-
* poster='http://misc.aotu.io/booxood/mobile-video/cover_900x500.jpg'
|
|
381
|
-
* initialTime='0'
|
|
382
|
-
* id='video'
|
|
383
388
|
* loop={false}
|
|
384
389
|
* muted={false}
|
|
385
390
|
* />
|
|
@@ -388,6 +393,21 @@ declare namespace VideoProps {
|
|
|
388
393
|
* }
|
|
389
394
|
* }
|
|
390
395
|
* ```
|
|
396
|
+
* @example_vue
|
|
397
|
+
* ```html
|
|
398
|
+
* <template>
|
|
399
|
+
* <video
|
|
400
|
+
* id="video"
|
|
401
|
+
* src="https://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400"
|
|
402
|
+
* poster="https://misc.aotu.io/booxood/mobile-video/cover_900x500.jpg"
|
|
403
|
+
* initial-time="0"
|
|
404
|
+
* :controls="true"
|
|
405
|
+
* :autoplay="false"
|
|
406
|
+
* :loop="false"
|
|
407
|
+
* :muted="false"
|
|
408
|
+
* />
|
|
409
|
+
* </template>
|
|
410
|
+
* ```
|
|
391
411
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/video.html
|
|
392
412
|
*/
|
|
393
413
|
declare const Video: ComponentType<VideoProps>
|
package/types/View.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ interface ViewProps extends StandardProps {
|
|
|
41
41
|
/** 视图容器
|
|
42
42
|
* @classification viewContainer
|
|
43
43
|
* @supported weapp, swan, alipay, tt, h5, rn
|
|
44
|
-
* @
|
|
44
|
+
* @example_react
|
|
45
45
|
* ```tsx
|
|
46
46
|
* export default class PageView extends Component {
|
|
47
47
|
* constructor() {
|
|
@@ -68,6 +68,38 @@ interface ViewProps extends StandardProps {
|
|
|
68
68
|
* }
|
|
69
69
|
* }
|
|
70
70
|
* ```
|
|
71
|
+
* @example_vue
|
|
72
|
+
* ```html
|
|
73
|
+
* <template>
|
|
74
|
+
* <view class="components-page">
|
|
75
|
+
* <text>flex-direction: row 横向布局</text>
|
|
76
|
+
* <view class="flex-wrp flex-wrp-row" hover-class="hover" >
|
|
77
|
+
* <view class="flex-item demo-text-1" :hover-stop-propagation="true" />
|
|
78
|
+
* <view class="flex-item demo-text-2" hover-start-time="1000" hover-class="hover" />
|
|
79
|
+
* <view class="flex-item demo-text-3" hover-stayTime="1000" hover-class="hover" />
|
|
80
|
+
* </view>
|
|
81
|
+
* <text>flex-direction: column 纵向布局</text>
|
|
82
|
+
* <view class="flex-wrp flex-wrp-column">
|
|
83
|
+
* <view class="flex-item flex-item-V demo-text-1" />
|
|
84
|
+
* <view class="flex-item flex-item-V demo-text-2" />
|
|
85
|
+
* <view class="flex-item flex-item-V demo-text-3" />
|
|
86
|
+
* </view>
|
|
87
|
+
* </view>
|
|
88
|
+
* </template>
|
|
89
|
+
*
|
|
90
|
+
* <style>
|
|
91
|
+
* .flex-wrp { display: flex; }
|
|
92
|
+
* .flex-wrp-column{ flex-direction: column; }
|
|
93
|
+
* .flex-wrp-row { flex-direction:row; padding: 20px; background: #f1f1f1; }
|
|
94
|
+
* .flex-item { width: 180px; height: 90px; }
|
|
95
|
+
* .demo-text-1 { background: #ccc; }
|
|
96
|
+
* .demo-text-2 { background: #999; }
|
|
97
|
+
* .demo-text-3 { background: #666; }
|
|
98
|
+
* .hover {
|
|
99
|
+
* background: #000;
|
|
100
|
+
* }
|
|
101
|
+
* </style>
|
|
102
|
+
* ```
|
|
71
103
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/view.html
|
|
72
104
|
*/
|
|
73
105
|
declare const View: ComponentType<ViewProps>
|
package/types/VoipRoom.d.ts
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
|
-
import { StandardProps } from './common'
|
|
3
|
-
import { StyleProp, ViewStyle } from 'react-native'
|
|
2
|
+
import { CommonEventFunction, StandardProps } from './common'
|
|
4
3
|
|
|
5
4
|
interface VoipRoomProps extends StandardProps {
|
|
6
5
|
/** 进入房间用户的 openid
|
|
7
6
|
* @default none
|
|
8
|
-
* @supported weapp
|
|
7
|
+
* @supported weapp
|
|
9
8
|
*/
|
|
10
9
|
openId?: string
|
|
11
10
|
|
|
12
11
|
/** 对话窗口类型,自身传入 camera,其它用户传入 video
|
|
13
12
|
* @default camera
|
|
14
|
-
* @supported weapp
|
|
13
|
+
* @supported weapp
|
|
15
14
|
*/
|
|
16
|
-
mode?: keyof VoipRoomProps.
|
|
15
|
+
mode?: keyof VoipRoomProps.Mode
|
|
17
16
|
|
|
18
17
|
/** 仅在 mode 为 camera 时有效,前置或后置,值为front, back
|
|
19
18
|
* @default front
|
|
20
|
-
* @supported weapp
|
|
19
|
+
* @supported weapp
|
|
21
20
|
*/
|
|
22
|
-
devicePosition?: keyof VoipRoomProps.
|
|
21
|
+
devicePosition?: keyof VoipRoomProps.DevicePosition
|
|
23
22
|
|
|
24
23
|
/** 创建对话窗口失败时触发
|
|
25
24
|
* @supported weapp
|
|
@@ -27,15 +26,15 @@ interface VoipRoomProps extends StandardProps {
|
|
|
27
26
|
onError?: CommonEventFunction
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
namespace VoipRoomProps {
|
|
29
|
+
declare namespace VoipRoomProps {
|
|
31
30
|
/** 对话窗口类型 */
|
|
32
|
-
interface
|
|
31
|
+
interface Mode {
|
|
33
32
|
camera
|
|
34
33
|
video
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
/** 摄像头类型 */
|
|
38
|
-
interface
|
|
37
|
+
interface DevicePosition {
|
|
39
38
|
front
|
|
40
39
|
back
|
|
41
40
|
}
|
|
@@ -43,7 +42,7 @@ namespace VoipRoomProps {
|
|
|
43
42
|
|
|
44
43
|
/** 多人音视频对话
|
|
45
44
|
*
|
|
46
|
-
* 需用户授权 `scope.camera`、`scope.record`。相关接口: [Taro.joinVoIPChat](
|
|
45
|
+
* 需用户授权 `scope.camera`、`scope.record`。相关接口: [Taro.joinVoIPChat](/docs/apis/media/voip/joinVoIPChat)
|
|
47
46
|
* 开通该组件权限后,开发者可在 joinVoIPChat 成功后,获取房间成员的 openid,传递给 voip-room 组件,以显示成员画面。
|
|
48
47
|
* @classification media
|
|
49
48
|
* @supported weapp
|
package/types/WebView.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare namespace WebViewProps {
|
|
|
41
41
|
/** web-view 组件是一个可以用来承载网页的容器,会自动铺满整个小程序页面。个人类型与海外类型的小程序暂不支持使用。
|
|
42
42
|
* @classification open
|
|
43
43
|
* @supported weapp, h5, rn
|
|
44
|
-
* @
|
|
44
|
+
* @example_react
|
|
45
45
|
* ```tsx
|
|
46
46
|
* class App extends Component {
|
|
47
47
|
* handleMessage () {}
|
|
@@ -53,6 +53,12 @@ declare namespace WebViewProps {
|
|
|
53
53
|
* }
|
|
54
54
|
* }
|
|
55
55
|
* ```
|
|
56
|
+
* @example_vue
|
|
57
|
+
* ```html
|
|
58
|
+
* <template>
|
|
59
|
+
* <web-view src='https://mp.weixin.qq.com/' `@message="handleMessage" />
|
|
60
|
+
* </template>
|
|
61
|
+
* ```
|
|
56
62
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html
|
|
57
63
|
*/
|
|
58
64
|
declare const WebView: ComponentType<WebViewProps>
|
package/types/common.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-b2d01686.system.js","@tarojs/taro","./p-94c20f60.system.js"],(function(e){"use strict";var t,r,n,i,o,s,a;return{setters:[function(e){t=e.r;r=e.c;n=e.h;i=e.H;o=e.g},function(e){s=e.default},function(e){a=e.c}],execute:function(){var c=".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0px;transform-origin:left top 0px}.rmc-pull-to-refresh-content-wrapper{overflow:hidden}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{text-align:center;height:30px;line-height:10px}.rmc-pull-to-refresh-indicator>div{background-color:grey;width:6px;height:6px;border-radius:100%;margin:3px;-webkit-animation-fill-mode:both;animation-fill-mode:both;display:inline-block;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";function l(e,t){e.transform=t;e.webkitTransform=t;e.MozTransform=t}var f=typeof navigator!=="undefined"&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);var u={activate:"release",deactivate:"pull",release:"loading",finish:"finish"};var d=false;try{var h=Object.defineProperty({},"passive",{get:function(){d=true}});window.addEventListener("cancel",(function(){return{}}),h)}catch(e){}var p=d?{passive:false}:false;var m=e("taro_pull_to_refresh",function(){function e(e){var n=this;t(this,e);this.onRefresh=r(this,"refresh",7);this.prefixCls="rmc-pull-to-refresh";this.distanceToRefresh=50;this.damping=100;this.indicator=u;this.currSt="deactivate";this.dragOnEdge=false;this._ScreenY=0;this._startScreenY=0;this._lastScreenY=0;this._isMounted=false;this.triggerPullDownRefresh=function(e){if(!n.dragOnEdge&&n._isMounted){if(e){n._lastScreenY=n.distanceToRefresh+1;n.currSt="release";n.setContentStyle(n._lastScreenY)}else{n.currSt="finish";n.reset()}}};this.init=function(){var e=n.scrollContainer;n._to={touchstart:n.onTouchStart.bind(n,e),touchmove:n.onTouchMove.bind(n,e),touchend:n.onTouchEnd.bind(n,e),touchcancel:n.onTouchEnd.bind(n,e)};Object.keys(n._to).forEach((function(t){e.addEventListener(t,n._to[t],p)}))};this.destroy=function(){var e=n.scrollContainer;Object.keys(n._to).forEach((function(t){e.removeEventListener(t,n._to[t])}))};this.onTouchStart=function(e,t){n._ScreenY=n._startScreenY=t.touches[0].screenY;n._lastScreenY=n._lastScreenY||0};this.isEdge=function(e){var t=n.scrollContainer;if(t&&t===document.body){var r=document.scrollingElement?document.scrollingElement:document.body;return r.scrollTop<=0}return e.scrollTop<=0};this.damp=function(e){if(Math.abs(n._lastScreenY)>n.damping){return 0}var t=Math.abs(n._ScreenY-n._startScreenY)/window.screen.height;e*=(1-t)*.6;return e};this.onTouchMove=function(e,t){var r=t.touches[0].screenY;if(n._startScreenY>r){return}if(n.isEdge(e)){if(!n.dragOnEdge){n._ScreenY=n._startScreenY=t.touches[0].screenY;n.dragOnEdge=true}if(t.cancelable){t.preventDefault()}var i=Math.round(r-n._ScreenY);n._ScreenY=r;n._lastScreenY+=n.damp(i);n.setContentStyle(n._lastScreenY);if(Math.abs(n._lastScreenY)<n.distanceToRefresh){if(n.currSt!=="deactivate"){n.currSt="deactivate"}}else{if(n.currSt==="deactivate"){n.currSt="activate"}}if(f&&t.changedTouches[0].clientY<0){n.onTouchEnd()}}};this.onTouchEnd=function(){if(n.dragOnEdge){n.dragOnEdge=false}if(n.currSt==="activate"){n.currSt="release";n.onRefresh.emit(n);n._lastScreenY=n.distanceToRefresh+1;n.setContentStyle(n._lastScreenY)}else if(n.currSt==="release"){n._lastScreenY=n.distanceToRefresh+1;n.setContentStyle(n._lastScreenY)}else{n.reset()}};this.reset=function(){n._lastScreenY=0;n.setContentStyle(0)};this.setContentStyle=function(e){if(n.contentRef){if(e){l(n.contentRef.style,"translate3d(0px,"+e+"px,0)")}else{l(n.contentRef.style,"")}}}}Object.defineProperty(e.prototype,"scrollContainer",{get:function(){return document.querySelector(".taro-tabbar__panel")||document.body},enumerable:false,configurable:true});e.prototype.statusChange=function(){if(this.currSt==="release"){var e=this.el.closest(".taro_page");if(e&&e.__page){e.__page.onPullDownRefresh()}}};e.prototype.disconnectedCallback=function(){this.destroy()};e.prototype.componentDidLoad=function(){var e=this;this.init();this._isMounted=true;s.eventCenter.on("__taroStartPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(true);r({errMsg:"startPullDownRefresh: ok"})}catch(e){n({errMsg:"startPullDownRefresh: fail"})}}));s.eventCenter.on("__taroStopPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(false);r({errMsg:"stopPullDownRefresh: ok"})}catch(e){n({errMsg:"stopPullDownRefresh: fail"})}}))};e.prototype.render=function(){var e=this;var t=function(t){var r=e,i=r.currSt,o=r.dragOnEdge,s=r.prefixCls;var c=a(t,!o&&s+"-transition");var l=i==="activate"||i==="release";return n("div",{class:s+"-content-wrapper"},n("div",{class:c,ref:function(t){e.contentRef=t}},l&&n("div",{class:s+"-indicator"},n("div",null),n("div",null),n("div",null)),n("slot",null)))};if(this.scrollContainer){return t(this.prefixCls+"-content "+this.prefixCls+"-down")}return n(i,{class:a(this.prefixCls,this.prefixCls+"-down")},t(this.prefixCls+"-content"))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{currSt:["statusChange"]}},enumerable:false,configurable:true});return e}());m.style=c}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as r}from"./p-f05e1558.js";import h from"@tarojs/taro";import{c as a}from"./p-37cfdd8f.js";const n="undefined"!=typeof navigator&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),o={activate:"release",deactivate:"pull",release:"loading",finish:"finish"};let l=!1;try{const t=Object.defineProperty({},"passive",{get(){l=!0}});window.addEventListener("cancel",(()=>({})),t)}catch(t){}const c=!!l&&{passive:!1};let d=class{constructor(s){t(this,s),this.onRefresh=i(this,"refresh",7),this.prefixCls="rmc-pull-to-refresh",this.distanceToRefresh=50,this.damping=100,this.indicator=o,this.currSt="deactivate",this.dragOnEdge=!1,this._ScreenY=0,this._startScreenY=0,this._lastScreenY=0,this._isMounted=!1,this.triggerPullDownRefresh=t=>{!this.dragOnEdge&&this._isMounted&&(t?(this._lastScreenY=this.distanceToRefresh+1,this.currSt="release",this.setContentStyle(this._lastScreenY)):(this.currSt="finish",this.reset()))},this.init=()=>{const t=this.scrollContainer;this._to={touchstart:this.onTouchStart.bind(this,t),touchmove:this.onTouchMove.bind(this,t),touchend:this.onTouchEnd.bind(this,t),touchcancel:this.onTouchEnd.bind(this,t)},Object.keys(this._to).forEach((i=>{t.addEventListener(i,this._to[i],c)}))},this.destroy=()=>{const t=this.scrollContainer;Object.keys(this._to).forEach((i=>{t.removeEventListener(i,this._to[i])}))},this.onTouchStart=(t,i)=>{this._ScreenY=this._startScreenY=i.touches[0].screenY,this._lastScreenY=this._lastScreenY||0},this.isEdge=t=>{const i=this.scrollContainer;return i&&i===document.body?(document.scrollingElement?document.scrollingElement:document.body).scrollTop<=0:t.scrollTop<=0},this.damp=t=>Math.abs(this._lastScreenY)>this.damping?0:t*(.6*(1-Math.abs(this._ScreenY-this._startScreenY)/window.screen.height)),this.onTouchMove=(t,i)=>{const s=i.touches[0].screenY;if(!(this._startScreenY>s)&&this.isEdge(t)){this.dragOnEdge||(this._ScreenY=this._startScreenY=i.touches[0].screenY,this.dragOnEdge=!0),i.cancelable&&i.preventDefault();const t=Math.round(s-this._ScreenY);this._ScreenY=s,this._lastScreenY+=this.damp(t),this.setContentStyle(this._lastScreenY),Math.abs(this._lastScreenY)<this.distanceToRefresh?"deactivate"!==this.currSt&&(this.currSt="deactivate"):"deactivate"===this.currSt&&(this.currSt="activate"),n&&i.changedTouches[0].clientY<0&&this.onTouchEnd()}},this.onTouchEnd=()=>{this.dragOnEdge&&(this.dragOnEdge=!1),"activate"===this.currSt?(this.currSt="release",this.onRefresh.emit(this),this._lastScreenY=this.distanceToRefresh+1,this.setContentStyle(this._lastScreenY)):"release"===this.currSt?(this._lastScreenY=this.distanceToRefresh+1,this.setContentStyle(this._lastScreenY)):this.reset()},this.reset=()=>{this._lastScreenY=0,this.setContentStyle(0)},this.setContentStyle=t=>{var i,s;this.contentRef&&((i=this.contentRef.style).transform=s=t?`translate3d(0px,${t}px,0)`:"",i.webkitTransform=s,i.MozTransform=s)}}get scrollContainer(){return document.querySelector(".taro-tabbar__panel")||document.body}statusChange(){if("release"===this.currSt){const t=this.el.closest(".taro_page");t&&t.__page&&t.__page.onPullDownRefresh()}}disconnectedCallback(){this.destroy()}componentDidLoad(){this.init(),this._isMounted=!0,h.eventCenter.on("__taroStartPullDownRefresh",(({successHandler:t,errorHandler:i})=>{try{this.triggerPullDownRefresh(!0),t({errMsg:"startPullDownRefresh: ok"})}catch(t){i({errMsg:"startPullDownRefresh: fail"})}})),h.eventCenter.on("__taroStopPullDownRefresh",(({successHandler:t,errorHandler:i})=>{try{this.triggerPullDownRefresh(!1),t({errMsg:"stopPullDownRefresh: ok"})}catch(t){i({errMsg:"stopPullDownRefresh: fail"})}}))}render(){const t=t=>{const{currSt:i,dragOnEdge:e,prefixCls:r}=this,h=a(t,!e&&`${r}-transition`);return s("div",{class:`${r}-content-wrapper`},s("div",{class:h,ref:t=>{this.contentRef=t}},("activate"===i||"release"===i)&&s("div",{class:`${r}-indicator`},s("div",null),s("div",null),s("div",null)),s("slot",null)))};return this.scrollContainer?t(`${this.prefixCls}-content ${this.prefixCls}-down`):s(e,{class:a(this.prefixCls,`${this.prefixCls}-down`)},t(`${this.prefixCls}-content`))}get el(){return r(this)}static get watchers(){return{currSt:["statusChange"]}}};d.style=".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0px;transform-origin:left top 0px}.rmc-pull-to-refresh-content-wrapper{overflow:hidden}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{text-align:center;height:30px;line-height:10px}.rmc-pull-to-refresh-indicator>div{background-color:grey;width:6px;height:6px;border-radius:100%;margin:3px;-webkit-animation-fill-mode:both;animation-fill-mode:both;display:inline-block;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";export{d as taro_pull_to_refresh}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __spreadArray=this&&this.__spreadArray||function(e,t){for(var r=0,a=t.length,o=e.length;r<a;r++,o++)e[o]=t[r];return e};System.register(["./p-b2d01686.system.js","@tarojs/taro","./p-94c20f60.system.js"],(function(e){"use strict";var t,r,a,o,n,i,s;return{setters:[function(e){t=e.h;r=e.r;a=e.c;o=e.H;n=e.g},function(e){i=e.default},function(e){s=e.c}],execute:function(){function l(e){return e.charAt(0)==="/"}function d(e,t){for(var r=t,a=r+1,o=e.length;a<o;r+=1,a+=1){e[r]=e[a]}e.pop()}function b(e,t){if(t===undefined)t="";var r=e&&e.split("/")||[];var a=t&&t.split("/")||[];var o=e&&l(e);var n=t&&l(t);var i=o||n;if(e&&l(e)){a=r}else if(r.length){a.pop();a=a.concat(r)}if(!a.length)return"/";var s;if(a.length){var b=a[a.length-1];s=b==="."||b===".."||b===""}else{s=false}var h=0;for(var c=a.length;c>=0;c--){var f=a[c];if(f==="."){d(a,c)}else if(f===".."){d(a,c);h++}else if(h){d(a,c);h--}}if(!i)for(;h--;h)a.unshift("..");if(i&&a[0]!==""&&(!a[0]||!l(a[0])))a.unshift("");var u=a.join("/");if(s&&u.substr(-1)!=="/")u+="/";return u}var h=function(e){var t=e||"";var r;var a={path:null,query:null,fragment:null};r=t.indexOf("#");if(r>-1){a.fragment=t.substring(r+1);t=t.substring(0,r)}r=t.indexOf("?");if(r>-1){a.query=t.substring(r+1);t=t.substring(0,r)}a.path=t;return a};var c=function(e){var r=e.index,a=e.isSelected,o=a===void 0?false:a,n=e.textColor,i=e.iconPath,l=e.badgeText,d=e.showRedDot,b=d===void 0?false:d,h=e.text,c=e.onSelect;var f=s("weui-tabbar__item",{"weui-bar__item_on":o});var u={position:"absolute",top:"-2px",right:"-13px"};var v={position:"absolute",top:"0",right:"-6px"};function g(){c(r)}return t("a",{key:r,href:"javascript:;",class:f,onClick:g},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:i,alt:"",class:"weui-tabbar__icon"}),!!l&&t("span",{class:"weui-badge taro-tabbar-badge",style:u},l),b&&t("span",{class:"weui-badge weui-badge_dot",style:v})),t("p",{class:"weui-tabbar__label",style:{color:n}},h))};var f="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";var u=function(e){return e[0]==="/"?e:"/"+e};var v=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var g=function(e,t){return v(e,t)?e.substr(t.length):e};var _=0;var p=1;var T=2;var B="taro-tabbar__tabbar";var m="taro-tabbar__tabbar-hide";var H="taro-tabbar__tabbar-slideout";var x=e("taro_tabbar",function(){function e(e){var t=this;r(this,e);this.onLongPress=a(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=_;this.getOriginUrl=function(e){var r=t.customRoutes.filter((function(t){var r=t[1];var a=h(r).path;var o=h(e).path;return a===o}));return r.length?r[0][0]:e};this.getSelectedIndex=function(e){var r=-1;t.list.forEach((function(t,a){var o=t.pagePath;var n=h(e).path;var i=h(o).path;if(n===i){r=a}}));return r};this.switchTab=function(e){t.selectedIndex=e;i.switchTab({url:t.list[e].pagePath})};this.switchTabHandler=function(e){var r=e.url,a=e.successHandler,o=e.errorHandler;var n=t.getOriginUrl(t.getCurrentUrl()||t.homePage);var i=b(r,n);var s=t.getSelectedIndex(i);if(s>-1){t.switchTab(s);a({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+i+'" is not found'})}};this.routerChangeHandler=function(e){var r;var a;if(e){r=e.toLocation}if(r&&r.path){var o=u(r.path);a=g(o==="/"?t.homePage:o,t.conf.basename||"/")}else{a=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(a))};this.setTabBarBadgeHandler=function(e){var r=e.index,a=e.text,o=e.successHandler,n=e.errorHandler;var i=__spreadArray([],t.list);if(r in i){i[r].showRedDot=false;i[r].badgeText=a;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}t.list=i};this.removeTabBarBadgeHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].badgeText=null;a({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}t.list=n};this.showTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].showRedDot=true;a({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}t.list=n};this.hideTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].showRedDot=false;a({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}t.list=n};this.showTabBarHandler=function(e){var r=e.successHandler;t.status=_;r({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var r=e.animation,a=e.successHandler;t.status=r?T:p;a({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var r=e.color,a=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,i=e.successHandler;if(o)t.backgroundColor=o;if(n)t.borderStyle=n;if(r)t.color=r;if(a)t.selectedColor=a;i({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var r=e.index,a=e.iconPath,o=e.selectedIconPath,n=e.text,i=e.successHandler,s=e.errorHandler;var l=__spreadArray([],t.list);if(r in l){if(a)l[r].iconPath=a;if(o)l[r].selectedIconPath=o;if(n)l[r].text=n;i({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}t.list=l};var o=this.conf.list;var n=this.conf.customRoutes;if(Object.prototype.toString.call(o)!=="[object Array]"||o.length<2||o.length>5){throw new Error("tabBar 配置错误")}this.homePage=u(this.conf.homePage);var s=function(e){var t;var r=n[e];e=u(e);if(typeof r==="string"){l.customRoutes.push([e,u(r)])}else if((r===null||r===void 0?void 0:r.length)>0){(t=l.customRoutes).push.apply(t,r.map((function(t){return[e,u(t)]})))}};var l=this;for(var d in n){s(d)}o.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=o;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var t=this.conf.basename||"/";var r;if(e==="hash"){var a=window.location.href;var o=a.indexOf("#");r=o===-1?"":a.substring(o+1)}else{r=location.pathname}var n=u(g(r,t));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){i.eventCenter.on("__taroRouterChange",this.routerChangeHandler);i.eventCenter.on("__taroSwitchTab",this.switchTabHandler);i.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);i.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);i.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);i.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);i.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);i.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);i.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);i.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){i.eventCenter.off("__taroRouterChange",this.routerChangeHandler);i.eventCenter.off("__taroSwitchTab",this.switchTabHandler);i.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);i.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);i.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);i.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);i.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);i.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);i.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);i.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,r;var a=this;var n=this.tabbarPos,i=n===void 0?"bottom":n;var l=this.status;var d=s("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var b=this.selectedIndex===-1||l===p;var h=l===T;return t(o,{class:s(B,B+"-"+i,(r={},r[m]=b,r[H]=h,r))},t("div",{class:d,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,r){var o=a.selectedIndex===r;var n;var i;if(o){n=a.selectedColor||"";i=e.selectedIconPath}else{n=a.color||"";i=e.iconPath}return t(c,{index:r,onSelect:a.switchTab.bind(a),isSelected:o,textColor:n,iconPath:i,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());x.style=f}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-f05e1558.js";function h(t,i,s){if("search"===i&&(t="search"),s&&(t="password"),void 0===t)return"text";if(!t)throw new Error("unexpected type");return"digit"===t&&(t="number"),t}let o=class{constructor(s){t(this,s),this.onInput=i(this,"input",7),this.onFocus=i(this,"focus",7),this.onBlur=i(this,"blur",7),this.onConfirm=i(this,"confirm",7),this.onChange=i(this,"change",7),this.onKeyDown=i(this,"keydown",7),this.isOnComposition=!1,this.onInputExcuted=!1,this.password=!1,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.confirmType="done",this.nativeProps={},this.handleInput=t=>{t.stopPropagation();const{type:i,maxlength:s,confirmType:e,password:o}=this;if(!this.isOnComposition&&!this.onInputExcuted){let n=t.target.value;const a=h(i,e,o);this.onInputExcuted=!0,"number"===a&&n&&s<=n.length&&(n=n.substring(0,s),t.target.value=n),this._value=n,this.onInput.emit({value:n,cursor:n.length})}},this.handleFocus=t=>{this.onInputExcuted=!1,this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value})},this.handleKeyDown=t=>{const{value:i}=t.target,s=t.keyCode||t.code;this.onInputExcuted=!1,t.stopPropagation(),this.onKeyDown.emit({value:i,cursor:i.length,keyCode:s}),13===s&&this.onConfirm.emit({value:i})},this.handleComposition=t=>{t.target instanceof HTMLInputElement&&("compositionend"===t.type?(this.isOnComposition=!1,this.onInput.emit({value:t.target.value})):this.isOnComposition=!0)}}watchHandler(t,i){t!==i&&(this._value=t)}watchFocus(t,i){var s;!i&&t&&(null===(s=this.inputRef)||void 0===s||s.focus())}componentWillLoad(){this._value=this.value}componentDidLoad(){var t,i,s;"file"===this.type?(this.fileListener=()=>{this.onInput.emit()},null===(t=this.inputRef)||void 0===t||t.addEventListener("change",this.fileListener)):(null===(i=this.inputRef)||void 0===i||i.addEventListener("compositionstart",this.handleComposition),null===(s=this.inputRef)||void 0===s||s.addEventListener("compositionend",this.handleComposition)),Object.defineProperty(this.el,"value",{get:()=>{var t;return null===(t=this.inputRef)||void 0===t?void 0:t.value},set:t=>{this._value=t},configurable:!0})}disconnectedCallback(){var t;"file"===this.type&&(null===(t=this.inputRef)||void 0===t||t.removeEventListener("change",this.fileListener))}render(){const{_value:t,type:i,password:e,placeholder:o,autoFocus:n,disabled:a,maxlength:r,confirmType:l,name:c,nativeProps:u}=this;return s("input",Object.assign({ref:t=>{this.inputRef=t},class:"weui-input",value:(d=t,null!=d?d:""),type:h(i,l,e),placeholder:o,autoFocus:n,disabled:a,maxlength:r,name:c,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown},u));var d}get el(){return e(this)}static get watchers(){return{value:["watchHandler"],autoFocus:["watchFocus"]}}};o.style="taro-input-core{display:block}input{display:block;height:1.4rem;text-align:inherit;text-overflow:clip;overflow:hidden;white-space:nowrap}";export{o as taro_input_core}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-b2d01686.system.js"],(function(t){"use strict";var e,n,i,o;return{setters:[function(t){e=t.r;n=t.c;i=t.h;o=t.g}],execute:function(){var s="taro-input-core{display:block}input{display:block;height:1.4rem;text-align:inherit;text-overflow:clip;overflow:hidden;white-space:nowrap}";function u(t,e,n){if(e==="search")t="search";if(n)t="password";if(typeof t==="undefined"){return"text"}if(!t){throw new Error("unexpected type")}if(t==="digit")t="number";return t}function a(t){return t!==null&&t!==void 0?t:""}var r=t("taro_input_core",function(){function t(t){var i=this;e(this,t);this.onInput=n(this,"input",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onKeyDown=n(this,"keydown",7);this.isOnComposition=false;this.onInputExcuted=false;this.password=false;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.confirmType="done";this.nativeProps={};this.handleInput=function(t){t.stopPropagation();var e=i,n=e.type,o=e.maxlength,s=e.confirmType,a=e.password;if(!i.isOnComposition&&!i.onInputExcuted){var r=t.target.value;var l=u(n,s,a);i.onInputExcuted=true;if(l==="number"&&r&&o<=r.length){r=r.substring(0,o);t.target.value=r}i._value=r;i.onInput.emit({value:r,cursor:r.length})}};this.handleFocus=function(t){i.onInputExcuted=false;i.onFocus.emit({value:t.target.value})};this.handleBlur=function(t){i.onBlur.emit({value:t.target.value})};this.handleChange=function(t){t.stopPropagation();i.onChange.emit({value:t.target.value})};this.handleKeyDown=function(t){var e=t.target.value;var n=t.keyCode||t.code;i.onInputExcuted=false;t.stopPropagation();i.onKeyDown.emit({value:e,cursor:e.length,keyCode:n});n===13&&i.onConfirm.emit({value:e})};this.handleComposition=function(t){if(!(t.target instanceof HTMLInputElement))return;if(t.type==="compositionend"){i.isOnComposition=false;i.onInput.emit({value:t.target.value})}else{i.isOnComposition=true}}}t.prototype.watchHandler=function(t,e){if(t!==e){this._value=t}};t.prototype.watchFocus=function(t,e){var n;if(!e&&t){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};t.prototype.componentWillLoad=function(){this._value=this.value};t.prototype.componentDidLoad=function(){var t=this;var e,n,i;if(this.type==="file"){this.fileListener=function(){t.onInput.emit()};(e=this.inputRef)===null||e===void 0?void 0:e.addEventListener("change",this.fileListener)}else{(n=this.inputRef)===null||n===void 0?void 0:n.addEventListener("compositionstart",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.addEventListener("compositionend",this.handleComposition)}Object.defineProperty(this.el,"value",{get:function(){var e;return(e=t.inputRef)===null||e===void 0?void 0:e.value},set:function(e){t._value=e},configurable:true})};t.prototype.disconnectedCallback=function(){var t;if(this.type==="file"){(t=this.inputRef)===null||t===void 0?void 0:t.removeEventListener("change",this.fileListener)}};t.prototype.render=function(){var t=this;var e=this,n=e._value,o=e.type,s=e.password,r=e.placeholder,l=e.autoFocus,h=e.disabled,c=e.maxlength,p=e.confirmType,f=e.name,d=e.nativeProps;return i("input",Object.assign({ref:function(e){t.inputRef=e},class:"weui-input",value:a(n),type:u(o,p,s),placeholder:r,autoFocus:l,disabled:h,maxlength:c,name:f,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown},d))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["watchHandler"],autoFocus:["watchFocus"]}},enumerable:false,configurable:true});return t}());r.style=s}}}));
|