@tarojs/components 3.4.1 → 3.4.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/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-input-core.cjs.entry.js +14 -17
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +12 -3
- package/dist/cjs/taro-tabbar.cjs.entry.js +2 -1
- package/dist/collection/components/input/input.js +15 -23
- 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/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 +14 -17
- package/dist/esm/taro-pull-to-refresh.entry.js +12 -3
- package/dist/esm/taro-tabbar.entry.js +2 -1
- 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-tabbar.entry.js +1 -1
- package/dist/taro-components/{p-abe415b4.system.entry.js → p-19c46f62.system.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-71e14298.entry.js +1 -0
- package/dist/taro-components/p-8486c251.system.entry.js +1 -0
- package/dist/taro-components/{p-e1040131.entry.js → p-a345ba40.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +0 -3
- package/package.json +3 -3
- package/types/Ad.d.ts +9 -9
- package/types/Audio.d.ts +3 -3
- package/types/Button.d.ts +13 -13
- package/types/Camera.d.ts +10 -10
- package/types/FunctionalPageNavigator.d.ts +4 -4
- package/types/Image.d.ts +2 -2
- package/types/KeyboardAccessory.d.ts +2 -1
- package/types/LivePlayer.d.ts +8 -8
- package/types/LivePusher.d.ts +14 -14
- package/types/Map.d.ts +5 -5
- package/types/Navigator.d.ts +7 -7
- package/types/OfficialAccount.d.ts +4 -4
- package/types/OpenData.d.ts +4 -4
- package/types/PageContainer.d.ts +2 -2
- package/types/ShareElement.d.ts +1 -1
- package/types/Video.d.ts +9 -9
- package/types/VoipRoom.d.ts +5 -5
- 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-9dc9c615.system.entry.js +0 -1
- package/dist/taro-components/p-b55fedc1.entry.js +0 -1
package/types/Navigator.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ interface NavigatorProps extends StandardProps {
|
|
|
6
6
|
* @default "self"
|
|
7
7
|
* @supported weapp, swan
|
|
8
8
|
*/
|
|
9
|
-
target?: keyof NavigatorProps.
|
|
9
|
+
target?: keyof NavigatorProps.Target
|
|
10
10
|
|
|
11
11
|
/** 当前小程序内的跳转链接
|
|
12
12
|
* @supported weapp, swan, alipay, tt
|
|
@@ -17,7 +17,7 @@ interface NavigatorProps extends StandardProps {
|
|
|
17
17
|
* @default "navigate"
|
|
18
18
|
* @supported weapp, swan, alipay, tt
|
|
19
19
|
*/
|
|
20
|
-
openType?: keyof NavigatorProps.
|
|
20
|
+
openType?: keyof NavigatorProps.OpenType
|
|
21
21
|
|
|
22
22
|
/** 当 open-type 为 'navigateBack' 时有效,表示回退的层数
|
|
23
23
|
* @supported weapp, swan, tt
|
|
@@ -42,7 +42,7 @@ interface NavigatorProps extends StandardProps {
|
|
|
42
42
|
/** 当 `target="miniProgram"` 时有效,要打开的小程序版本
|
|
43
43
|
* @supported weapp, swan
|
|
44
44
|
*/
|
|
45
|
-
version?: keyof NavigatorProps.
|
|
45
|
+
version?: keyof NavigatorProps.Version
|
|
46
46
|
|
|
47
47
|
/** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
|
|
48
48
|
* @default "navigator-hover"
|
|
@@ -86,17 +86,17 @@ interface NavigatorProps extends StandardProps {
|
|
|
86
86
|
|
|
87
87
|
declare namespace NavigatorProps {
|
|
88
88
|
/** target 的合法值 */
|
|
89
|
-
interface
|
|
89
|
+
interface Target {
|
|
90
90
|
/** 当前小程序 */
|
|
91
91
|
self
|
|
92
92
|
/** 其它小程序 */
|
|
93
93
|
miniProgram
|
|
94
94
|
}
|
|
95
95
|
/** open-type 的合法值 */
|
|
96
|
-
interface
|
|
96
|
+
interface OpenType {
|
|
97
97
|
/** 对应 Taro.navigateTo 或 Taro.navigateToMiniProgram 的功能 */
|
|
98
98
|
navigate
|
|
99
|
-
/** 对应 Taro.redirectTo 的功能 */
|
|
99
|
+
/** 对应 Taro.redirectTo 的功能 */
|
|
100
100
|
redirect
|
|
101
101
|
/** 对应 Taro.switchTab 的功能 */
|
|
102
102
|
switchTab
|
|
@@ -108,7 +108,7 @@ declare namespace NavigatorProps {
|
|
|
108
108
|
exit
|
|
109
109
|
}
|
|
110
110
|
/** version 的合法值 */
|
|
111
|
-
interface
|
|
111
|
+
interface Version {
|
|
112
112
|
/** 开发版 */
|
|
113
113
|
develop
|
|
114
114
|
/** 体验版 */
|
|
@@ -5,24 +5,24 @@ interface OfficialAccountProps extends StandardProps {
|
|
|
5
5
|
/** 组件加载成功时触发
|
|
6
6
|
* @supported weapp
|
|
7
7
|
*/
|
|
8
|
-
onLoad?: CommonEventFunction<OfficialAccountProps.
|
|
8
|
+
onLoad?: CommonEventFunction<OfficialAccountProps.Detail>
|
|
9
9
|
|
|
10
10
|
/** 组件加载失败时触发
|
|
11
11
|
* @supported weapp
|
|
12
12
|
*/
|
|
13
|
-
onError?: CommonEventFunction<OfficialAccountProps.
|
|
13
|
+
onError?: CommonEventFunction<OfficialAccountProps.Detail>
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
declare namespace OfficialAccountProps {
|
|
17
17
|
/** detail 对象 */
|
|
18
|
-
interface
|
|
18
|
+
interface Detail {
|
|
19
19
|
/** 状态码 */
|
|
20
20
|
status: number
|
|
21
21
|
/** 错误信息 */
|
|
22
22
|
errMsg: string
|
|
23
23
|
}
|
|
24
24
|
/** status 有效值 */
|
|
25
|
-
interface
|
|
25
|
+
interface Status {
|
|
26
26
|
/** 网络错误 */
|
|
27
27
|
'-2'
|
|
28
28
|
/** 数据解析错误 */
|
package/types/OpenData.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface OpenDataProps extends StandardProps {
|
|
|
5
5
|
/** 开放数据类型
|
|
6
6
|
* @supported weapp
|
|
7
7
|
*/
|
|
8
|
-
type: keyof OpenDataProps.
|
|
8
|
+
type: keyof OpenDataProps.Type
|
|
9
9
|
/** 当 type="groupName" 时生效, 群id
|
|
10
10
|
* @supported weapp
|
|
11
11
|
*/
|
|
@@ -14,7 +14,7 @@ interface OpenDataProps extends StandardProps {
|
|
|
14
14
|
* @default "en"
|
|
15
15
|
* @supported weapp
|
|
16
16
|
*/
|
|
17
|
-
lang?: keyof OpenDataProps.
|
|
17
|
+
lang?: keyof OpenDataProps.Lang
|
|
18
18
|
|
|
19
19
|
/** 数据为空时的默认文案
|
|
20
20
|
* @supported weapp
|
|
@@ -34,7 +34,7 @@ interface OpenDataProps extends StandardProps {
|
|
|
34
34
|
|
|
35
35
|
declare namespace OpenDataProps {
|
|
36
36
|
/** type 的合法值 */
|
|
37
|
-
interface
|
|
37
|
+
interface Type {
|
|
38
38
|
/** 拉取群名称 */
|
|
39
39
|
groupName
|
|
40
40
|
/** 用户昵称 */
|
|
@@ -53,7 +53,7 @@ declare namespace OpenDataProps {
|
|
|
53
53
|
userLanguage
|
|
54
54
|
}
|
|
55
55
|
/** lang 的合法值 */
|
|
56
|
-
interface
|
|
56
|
+
interface Lang {
|
|
57
57
|
/** 英文 */
|
|
58
58
|
en
|
|
59
59
|
/** 简体中文 */
|
package/types/PageContainer.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ interface PageContainerProps extends StandardProps {
|
|
|
30
30
|
* @default bottom
|
|
31
31
|
* @supported weapp
|
|
32
32
|
*/
|
|
33
|
-
position?: keyof PageContainerProps.
|
|
33
|
+
position?: keyof PageContainerProps.Position
|
|
34
34
|
|
|
35
35
|
/** 是否显示圆角
|
|
36
36
|
* @default false
|
|
@@ -92,7 +92,7 @@ interface PageContainerProps extends StandardProps {
|
|
|
92
92
|
|
|
93
93
|
declare namespace PageContainerProps {
|
|
94
94
|
/** 弹出位置 */
|
|
95
|
-
interface
|
|
95
|
+
interface Position {
|
|
96
96
|
/** 上方弹出 */
|
|
97
97
|
top
|
|
98
98
|
/** 下方弹出 */
|
package/types/ShareElement.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ interface ShareElementProps extends StandardProps {
|
|
|
28
28
|
|
|
29
29
|
/** 共享元素
|
|
30
30
|
*
|
|
31
|
-
* 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`page-container`](
|
|
31
|
+
* 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`page-container`](/docs/components/viewContainer/page-container) 组件结合使用。
|
|
32
32
|
* 使用时需在当前页放置 `share-element` 组件,同时在 `page-container` 容器中放置对应的 `share-element` 组件,对应关系通过属性值 key 映射。当设置 `page-container` `显示时,transform` 属性为 `true` 的共享元素会产生动画。当前页面容器退出时,会产生返回动画。
|
|
33
33
|
* @classification viewContainer
|
|
34
34
|
* @supported weapp
|
package/types/Video.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ 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
120
|
* @supported weapp, h5, swan, alipay, tt, rn
|
|
@@ -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
|
|
@@ -318,7 +318,7 @@ declare namespace VideoProps {
|
|
|
318
318
|
'-90'
|
|
319
319
|
}
|
|
320
320
|
/** objectFit 的合法值 */
|
|
321
|
-
interface
|
|
321
|
+
interface ObjectFit {
|
|
322
322
|
/** 包含 */
|
|
323
323
|
contain
|
|
324
324
|
/** 填充 */
|
|
@@ -327,7 +327,7 @@ declare namespace VideoProps {
|
|
|
327
327
|
cover
|
|
328
328
|
}
|
|
329
329
|
/** playBtnPosition 的合法值 */
|
|
330
|
-
interface
|
|
330
|
+
interface PlayBtnPosition {
|
|
331
331
|
/** controls bar上 */
|
|
332
332
|
bottom
|
|
333
333
|
/** 视频中间 */
|
|
@@ -364,7 +364,7 @@ declare namespace VideoProps {
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
/** 视频。相关api:Taro.createVideoContext
|
|
367
|
-
*
|
|
367
|
+
*
|
|
368
368
|
* 备注:h5上因为没有测试,所以暂时写了“待定”,需要`Video`来确认。
|
|
369
369
|
* @classification media
|
|
370
370
|
* @supported weapp, h5, swan, alipay, tt
|
|
@@ -374,7 +374,7 @@ declare namespace VideoProps {
|
|
|
374
374
|
* constructor() {
|
|
375
375
|
* super(...arguments)
|
|
376
376
|
* }
|
|
377
|
-
*
|
|
377
|
+
*
|
|
378
378
|
* render() {
|
|
379
379
|
* return (
|
|
380
380
|
* <View className='components-page'>
|
package/types/VoipRoom.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ interface VoipRoomProps extends StandardProps {
|
|
|
12
12
|
* @default camera
|
|
13
13
|
* @supported weapp
|
|
14
14
|
*/
|
|
15
|
-
mode?: keyof VoipRoomProps.
|
|
15
|
+
mode?: keyof VoipRoomProps.Mode
|
|
16
16
|
|
|
17
17
|
/** 仅在 mode 为 camera 时有效,前置或后置,值为front, back
|
|
18
18
|
* @default front
|
|
19
19
|
* @supported weapp
|
|
20
20
|
*/
|
|
21
|
-
devicePosition?: keyof VoipRoomProps.
|
|
21
|
+
devicePosition?: keyof VoipRoomProps.DevicePosition
|
|
22
22
|
|
|
23
23
|
/** 创建对话窗口失败时触发
|
|
24
24
|
* @supported weapp
|
|
@@ -28,13 +28,13 @@ interface VoipRoomProps extends StandardProps {
|
|
|
28
28
|
|
|
29
29
|
declare namespace VoipRoomProps {
|
|
30
30
|
/** 对话窗口类型 */
|
|
31
|
-
interface
|
|
31
|
+
interface Mode {
|
|
32
32
|
camera
|
|
33
33
|
video
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/** 摄像头类型 */
|
|
37
|
-
interface
|
|
37
|
+
interface DevicePosition {
|
|
38
38
|
front
|
|
39
39
|
back
|
|
40
40
|
}
|
|
@@ -42,7 +42,7 @@ declare namespace VoipRoomProps {
|
|
|
42
42
|
|
|
43
43
|
/** 多人音视频对话
|
|
44
44
|
*
|
|
45
|
-
* 需用户授权 `scope.camera`、`scope.record`。相关接口: [Taro.joinVoIPChat](
|
|
45
|
+
* 需用户授权 `scope.camera`、`scope.record`。相关接口: [Taro.joinVoIPChat](/docs/apis/media/voip/joinVoIPChat)
|
|
46
46
|
* 开通该组件权限后,开发者可在 joinVoIPChat 成功后,获取房间成员的 openid,传递给 voip-room 组件,以显示成员画面。
|
|
47
47
|
* @classification media
|
|
48
48
|
* @supported weapp
|
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
|
-
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 a(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 u(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.onPaste=n(this,"paste",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.isOnPaste=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,u=e.password;if(!i.isOnComposition&&!i.onInputExcuted){var r=t.target.value;var l=a(n,s,u);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.handlePaste=function(t){i.isOnPaste=true;i.onPaste.emit({value:t.target.value})};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});if(i.isOnPaste){i.isOnPaste=false;i.onInput.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,p=e.maxlength,c=e.confirmType,f=e.name,d=e.nativeProps;return i("input",Object.assign({ref:function(e){t.inputRef=e},class:"weui-input",value:u(n),type:a(o,c,s),placeholder:r,autoFocus:l,disabled:h,maxlength:p,name:f,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},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}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as h}from"./p-f05e1558.js";function e(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.onPaste=i(this,"paste",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.isOnPaste=!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:h,password:o}=this;if(!this.isOnComposition&&!this.onInputExcuted){let n=t.target.value;const a=e(i,h,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.handlePaste=t=>{this.isOnPaste=!0,this.onPaste.emit({value:t.target.value})},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.isOnPaste&&(this.isOnPaste=!1,this.onInput.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:h,placeholder:o,autoFocus:n,disabled:a,maxlength:r,confirmType:l,name:u,nativeProps:c}=this;return s("input",Object.assign({ref:t=>{this.inputRef=t},class:"weui-input",value:(d=t,null!=d?d:""),type:e(i,l,h),placeholder:o,autoFocus:n,disabled:a,maxlength:r,name:u,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},c));var d}get el(){return h(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}
|