@tarojs/components 3.4.1 → 3.4.4
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 +3 -2
- 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/style/index.css +2 -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 +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-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-e1040131.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/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +0 -3
- package/package.json +4 -4
- package/types/Ad.d.ts +9 -9
- package/types/Audio.d.ts +3 -3
- package/types/Button.d.ts +31 -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 +10 -10
- 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 +8 -8
- package/types/Picker.d.ts +2 -2
- package/types/ShareElement.d.ts +3 -3
- 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-abe415b4.system.entry.js +0 -1
- package/dist/taro-components/p-b55fedc1.entry.js +0 -1
package/types/Map.d.ts
CHANGED
|
@@ -499,14 +499,14 @@ declare namespace MapProps {
|
|
|
499
499
|
end
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
-
interface
|
|
502
|
+
interface CausedByBegin {
|
|
503
503
|
/** 手势触发 */
|
|
504
504
|
gesture
|
|
505
505
|
/** 接口触发 */
|
|
506
506
|
update
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
interface
|
|
509
|
+
interface CausedByEnd {
|
|
510
510
|
/** 拖动导致 */
|
|
511
511
|
drag
|
|
512
512
|
/** 缩放导致 */
|
|
@@ -523,7 +523,7 @@ declare namespace MapProps {
|
|
|
523
523
|
/** 导致视野变化的原因
|
|
524
524
|
* @remarks 有效值为 gesture(手势触发)、update(接口触发或调用更新接口导致)、drag(拖动导致)、scale(缩放导致)
|
|
525
525
|
*/
|
|
526
|
-
causedBy: keyof (T extends 'begin' ? RegionChangeDetail.
|
|
526
|
+
causedBy: keyof (T extends 'begin' ? RegionChangeDetail.CausedByBegin : RegionChangeDetail.CausedByEnd)
|
|
527
527
|
/** 视野改变详情 */
|
|
528
528
|
detail: regionChangeDetail<RegionChangeDetail.type>
|
|
529
529
|
}
|
|
@@ -532,7 +532,7 @@ declare namespace MapProps {
|
|
|
532
532
|
rotate: number
|
|
533
533
|
/** 倾斜角度 */
|
|
534
534
|
skew: number
|
|
535
|
-
causedBy: keyof (T extends 'begin' ? RegionChangeDetail.
|
|
535
|
+
causedBy: keyof (T extends 'begin' ? RegionChangeDetail.CausedByBegin : RegionChangeDetail.CausedByEnd)
|
|
536
536
|
type: T | string
|
|
537
537
|
scale: number
|
|
538
538
|
centerLocation: point
|
|
@@ -578,7 +578,7 @@ declare namespace MapProps {
|
|
|
578
578
|
* `@markertap="markertap"
|
|
579
579
|
* />
|
|
580
580
|
* </template>
|
|
581
|
-
*
|
|
581
|
+
*
|
|
582
582
|
* <script>
|
|
583
583
|
* export default {
|
|
584
584
|
* data() {
|
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
|
|
@@ -38,21 +38,21 @@ interface PageContainerProps extends StandardProps {
|
|
|
38
38
|
*/
|
|
39
39
|
round?: boolean
|
|
40
40
|
|
|
41
|
-
/**
|
|
41
|
+
/** 是否在下滑一段距离后关闭
|
|
42
42
|
* @default false
|
|
43
43
|
* @supported weapp
|
|
44
44
|
*/
|
|
45
45
|
closeOnSlideDown?: boolean
|
|
46
46
|
|
|
47
|
-
/**
|
|
47
|
+
/** 自定义遮罩层样式
|
|
48
48
|
* @supported weapp
|
|
49
49
|
*/
|
|
50
|
-
overlayStyle?:
|
|
50
|
+
overlayStyle?: string
|
|
51
51
|
|
|
52
52
|
/** 自定义弹出层样式
|
|
53
53
|
* @supported weapp
|
|
54
54
|
*/
|
|
55
|
-
customStyle?:
|
|
55
|
+
customStyle?: string
|
|
56
56
|
|
|
57
57
|
/** 进入前触发
|
|
58
58
|
* @supported weapp
|
|
@@ -92,15 +92,15 @@ 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
|
/** 下方弹出 */
|
|
99
99
|
bottom
|
|
100
|
-
/** 左边弹出 */
|
|
101
|
-
left
|
|
102
100
|
/** 右边弹出 */
|
|
103
101
|
right
|
|
102
|
+
/** 中央弹出 */
|
|
103
|
+
center
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
package/types/Picker.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ interface PickerMultiSelectorProps extends PickerStandardProps {
|
|
|
103
103
|
* 列改变时触发
|
|
104
104
|
* @supported weapp, h5, rn
|
|
105
105
|
*/
|
|
106
|
-
onColumnChange?: CommonEventFunction<PickerMultiSelectorProps.
|
|
106
|
+
onColumnChange?: CommonEventFunction<PickerMultiSelectorProps.ColumnChangeEventDetail>
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
declare namespace PickerMultiSelectorProps {
|
|
@@ -111,7 +111,7 @@ declare namespace PickerMultiSelectorProps {
|
|
|
111
111
|
/** 表示变更值的下标 */
|
|
112
112
|
value: number[]
|
|
113
113
|
}
|
|
114
|
-
interface
|
|
114
|
+
interface ColumnChangeEventDetail {
|
|
115
115
|
/** 表示改变了第几列(下标从0开始) */
|
|
116
116
|
column: number
|
|
117
117
|
/** 表示变更值的下标 */
|
package/types/ShareElement.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface ShareElementProps extends StandardProps {
|
|
|
5
5
|
/** 映射标记
|
|
6
6
|
* @supported weapp
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
mapkey: string
|
|
9
9
|
|
|
10
10
|
/** 是否进行动画
|
|
11
11
|
* @default false
|
|
@@ -28,8 +28,8 @@ interface ShareElementProps extends StandardProps {
|
|
|
28
28
|
|
|
29
29
|
/** 共享元素
|
|
30
30
|
*
|
|
31
|
-
* 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`
|
|
32
|
-
* 使用时需在当前页放置 `
|
|
31
|
+
* 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`PageContainer`](/docs/components/viewContainer/page-container) 组件结合使用。
|
|
32
|
+
* 使用时需在当前页放置 `ShareElement` 组件,同时在 `PageContainer` 容器中放置对应的 `ShareElement` 组件,对应关系通过属性值 key 映射。当设置 `PageContainer` `显示时,transform` 属性为 `true` 的共享元素会产生动画。当前页面容器退出时,会产生返回动画。
|
|
33
33
|
* @classification viewContainer
|
|
34
34
|
* @supported weapp
|
|
35
35
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/share-element.html
|
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
|
-
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:auto}.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 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}
|