@tarojs/components 3.6.22-nightly.5 → 3.6.22-nightly.7

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.
Files changed (47) hide show
  1. package/dist/cjs/taro-tabbar.cjs.entry.js +8 -8
  2. package/dist/collection/components/tabbar/tabbar.js +1 -1
  3. package/dist/components/taro-tabbar.js +1 -1
  4. package/dist/esm/taro-tabbar.entry.js +1 -1
  5. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  6. package/dist/taro-components/p-0589fade.system.entry.js +1 -0
  7. package/dist/taro-components/p-8fa55dc6.entry.js +1 -0
  8. package/dist/taro-components/p-a972aa1d.system.js +1 -1
  9. package/dist/taro-components/taro-components.esm.js +1 -1
  10. package/package.json +4 -4
  11. package/types/Audio.d.ts +11 -11
  12. package/types/Button.d.ts +9 -9
  13. package/types/Canvas.d.ts +11 -11
  14. package/types/Checkbox.d.ts +8 -8
  15. package/types/CheckboxGroup.d.ts +3 -3
  16. package/types/CoverImage.d.ts +4 -4
  17. package/types/CoverView.d.ts +1 -1
  18. package/types/CustomWrapper.d.ts +1 -1
  19. package/types/Form.d.ts +4 -4
  20. package/types/Icon.d.ts +4 -4
  21. package/types/Image.d.ts +8 -8
  22. package/types/Input.d.ts +17 -17
  23. package/types/Label.d.ts +2 -2
  24. package/types/MovableArea.d.ts +2 -2
  25. package/types/MovableView.d.ts +18 -18
  26. package/types/NativeSlot.d.ts +1 -1
  27. package/types/Navigator.d.ts +8 -8
  28. package/types/Picker.d.ts +26 -26
  29. package/types/PickerView.d.ts +1 -1
  30. package/types/PickerViewColumn.d.ts +1 -1
  31. package/types/Progress.d.ts +13 -13
  32. package/types/Radio.d.ts +7 -7
  33. package/types/RadioGroup.d.ts +2 -2
  34. package/types/RichText.d.ts +5 -5
  35. package/types/ScrollView.d.ts +13 -13
  36. package/types/Slider.d.ts +13 -13
  37. package/types/Slot.d.ts +1 -1
  38. package/types/Swiper.d.ts +17 -17
  39. package/types/SwiperItem.d.ts +2 -2
  40. package/types/Switch.d.ts +7 -7
  41. package/types/Text.d.ts +4 -4
  42. package/types/Textarea.d.ts +13 -13
  43. package/types/Video.d.ts +30 -30
  44. package/types/View.d.ts +4 -4
  45. package/types/WebView.d.ts +4 -4
  46. package/dist/taro-components/p-07f2362b.entry.js +0 -1
  47. package/dist/taro-components/p-658b0091.system.entry.js +0 -1
package/types/Swiper.d.ts CHANGED
@@ -3,27 +3,27 @@ import { StandardProps, CommonEventFunction } from './common'
3
3
  interface SwiperProps extends StandardProps {
4
4
  /** 是否显示面板指示点
5
5
  * @default false
6
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
6
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
7
7
  */
8
8
  indicatorDots?: boolean
9
9
  /** 指示点颜色
10
10
  * @default "rgba(0, 0, 0, .3)"
11
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
11
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
12
12
  */
13
13
  indicatorColor?: string
14
14
  /** 当前选中的指示点颜色
15
15
  * @default "#000000"
16
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
16
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
17
17
  */
18
18
  indicatorActiveColor?: string
19
19
  /** 是否自动切换
20
20
  * @default false
21
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
21
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
22
22
  */
23
23
  autoplay?: boolean
24
24
  /** 当前所在滑块的 index
25
25
  * @default 0
26
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
26
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
27
27
  */
28
28
  current?: number
29
29
  /** 当前所在滑块的 item-id ,不能与 current 被同时指定
@@ -34,32 +34,32 @@ interface SwiperProps extends StandardProps {
34
34
  currentItemId?: string
35
35
  /** 自动切换时间间隔
36
36
  * @default 5000
37
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
37
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
38
38
  */
39
39
  interval?: number
40
40
  /** 滑动动画时长
41
41
  * @default 500
42
- * @supported weapp, alipay, swan, tt, qq, jd, h5
42
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid
43
43
  */
44
44
  duration?: number
45
45
  /** 是否采用衔接滑动
46
46
  * @default false
47
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
47
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
48
48
  */
49
49
  circular?: boolean
50
50
  /** 滑动方向是否为纵向
51
51
  * @default false
52
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
52
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
53
53
  */
54
54
  vertical?: boolean
55
55
  /** 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值
56
56
  * @default "0px"
57
- * @supported weapp, alipay, swan, tt, qq, jd, h5
57
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid
58
58
  */
59
59
  previousMargin?: string
60
60
  /** 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值
61
61
  * @default "0px"
62
- * @supported weapp, alipay, swan, tt, qq, jd, h5
62
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid
63
63
  */
64
64
  nextMargin?: string
65
65
  /**
@@ -70,7 +70,7 @@ interface SwiperProps extends StandardProps {
70
70
  snapToEdge?: boolean
71
71
  /** 同时显示的滑块数量
72
72
  * @default 1
73
- * @supported weapp, alipay, swan, tt, qq, jd, h5
73
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid
74
74
  */
75
75
  displayMultipleItems?: number
76
76
  /** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息
@@ -90,12 +90,12 @@ interface SwiperProps extends StandardProps {
90
90
  disableTouch?: boolean
91
91
  /** 是否启用缩放
92
92
  * @default false
93
- * @supported h5
93
+ * @supported h5, harmony_hybrid
94
94
  */
95
95
  zoom?: boolean
96
96
  /** 是否开启全屏
97
97
  * @default false
98
- * @supported h5
98
+ * @supported h5, harmony_hybrid
99
99
  */
100
100
  full?: boolean
101
101
  /** swiper-item 可见时的 class。
@@ -152,7 +152,7 @@ interface SwiperProps extends StandardProps {
152
152
  */
153
153
  cacheExtent?: number
154
154
  /** current 改变时会触发 change 事件
155
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
155
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
156
156
  */
157
157
  onChange?: CommonEventFunction<SwiperProps.onChangeEventDetail>
158
158
  /** swiper-item 的位置发生改变时会触发 transition 事件
@@ -160,7 +160,7 @@ interface SwiperProps extends StandardProps {
160
160
  */
161
161
  onTransition?: CommonEventFunction<SwiperProps.onTransitionEventDetail>
162
162
  /** 动画结束时会触发 animationfinish 事件
163
- * @supported weapp, swan, tt, qq, jd, h5, rn
163
+ * @supported weapp, swan, tt, qq, jd, h5, rn, harmony_hybrid
164
164
  */
165
165
  onAnimationFinish?: SwiperProps['onChange']
166
166
  /** 动画结束时会触发 animationEnd 事件
@@ -215,7 +215,7 @@ declare namespace SwiperProps {
215
215
  /** 滑块视图容器。其中只可放置 swiper-item 组件,否则会导致未定义的行为。
216
216
  * > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
217
217
  * @classification viewContainer
218
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
218
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
219
219
  * @example_react
220
220
  * ```tsx
221
221
  * class App extends Component {
@@ -2,7 +2,7 @@ import { ComponentType } from 'react'
2
2
  import { StandardProps } from './common'
3
3
  interface SwiperItemProps extends StandardProps {
4
4
  /** 该 swiper-item 的标识符
5
- * @supported weapp, swan, tt, jd, h5, rn
5
+ * @supported weapp, swan, tt, jd, h5, rn, harmony_hybrid
6
6
  */
7
7
  itemId?: string
8
8
  /** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息
@@ -19,7 +19,7 @@ interface SwiperItemProps extends StandardProps {
19
19
  /** 仅可放置在 swiper 组件中,宽高自动设置为100%
20
20
  * > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
21
21
  * @classification viewContainer
22
- * @supported weapp, alipay, swan, tt, jd, h5, rn, harmony
22
+ * @supported weapp, alipay, swan, tt, jd, h5, rn, harmony, harmony_hybrid
23
23
  * @example_react
24
24
  * ```tsx
25
25
  * class App extends Component {
package/types/Switch.d.ts CHANGED
@@ -3,7 +3,7 @@ import { StandardProps, CommonEventFunction, FormItemProps } from './common'
3
3
  interface SwitchProps extends StandardProps, FormItemProps {
4
4
  /** 是否选中
5
5
  * @default false
6
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
6
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
7
7
  */
8
8
  checked?: boolean
9
9
  /** 设置在 React 非受控状态下,当前是否选中
@@ -12,21 +12,21 @@ interface SwitchProps extends StandardProps, FormItemProps {
12
12
  defaultChecked?: boolean
13
13
  /** 是否禁用
14
14
  * @default false
15
- * @supported weapp, alipay, swan, tt, qq, h5, rn
15
+ * @supported weapp, alipay, swan, tt, qq, h5, rn, harmony_hybrid
16
16
  */
17
17
  disabled?: boolean
18
18
  /** 样式,有效值:switch, checkbox
19
19
  * @default "switch"
20
- * @supported weapp, swan, tt, qq, jd, h5, rn
20
+ * @supported weapp, swan, tt, qq, jd, h5, rn, harmony_hybrid
21
21
  */
22
22
  type?: 'switch' | 'checkbox'
23
23
  /** switch 的颜色,同 css 的 color
24
24
  * @default "#04BE02"
25
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
25
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
26
26
  */
27
27
  color?: string
28
28
  /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
29
- * @supported h5
29
+ * @supported h5, harmony_hybrid
30
30
  */
31
31
  nativeProps?: Record<string, unknown>
32
32
  /** 组件名字,用于表单提交获取数据。
@@ -43,7 +43,7 @@ interface SwitchProps extends StandardProps, FormItemProps {
43
43
  */
44
44
  ariaLabel?: string
45
45
  /** checked 改变时触发 change 事件
46
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
46
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
47
47
  */
48
48
  onChange?: CommonEventFunction<SwitchProps.onChangeEventDetail>
49
49
  }
@@ -88,7 +88,7 @@ declare namespace SwitchProps {
88
88
  * </view>
89
89
  * </template>
90
90
  * ```
91
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
91
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
92
92
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/switch.html
93
93
  */
94
94
  declare const Switch: ComponentType<SwitchProps>
package/types/Text.d.ts CHANGED
@@ -3,16 +3,16 @@ import { StandardProps } from './common'
3
3
  interface TextProps extends StandardProps {
4
4
  /** 文本是否可选
5
5
  * @default false
6
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
6
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
7
7
  */
8
8
  selectable?: boolean
9
9
  /** 文本是否可选,该属性会使文本节点显示为 inline-block
10
10
  * @default false
11
- * @supported weapp, h5
11
+ * @supported weapp, h5, harmony_hybrid
12
12
  */
13
13
  userSelect?: boolean
14
14
  /** 显示连续空格
15
- * @supported weapp, alipay, swan, tt, qq, jd, h5
15
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid
16
16
  */
17
17
  space?: keyof TextProps.TSpace
18
18
  /** 是否解码
@@ -43,7 +43,7 @@ declare namespace TextProps {
43
43
  }
44
44
  /** 文本
45
45
  * @classification base
46
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
46
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
47
47
  * @example_react
48
48
  * ```tsx
49
49
  * export default class PageView extends Component {
@@ -2,7 +2,7 @@ import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction, FormItemProps } from './common'
3
3
  interface TextareaProps extends StandardProps, FormItemProps {
4
4
  /** 输入框的内容
5
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
5
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
6
6
  */
7
7
  value?: string
8
8
  /** 设置 React 非受控输入框的初始内容
@@ -10,7 +10,7 @@ interface TextareaProps extends StandardProps, FormItemProps {
10
10
  */
11
11
  defaultValue?: string
12
12
  /** 输入框为空时占位符
13
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
13
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
14
14
  */
15
15
  placeholder?: string
16
16
  /** 指定 placeholder 的样式
@@ -24,27 +24,27 @@ interface TextareaProps extends StandardProps, FormItemProps {
24
24
  placeholderClass?: string
25
25
  /** 是否禁用
26
26
  * @default false
27
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
27
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
28
28
  */
29
29
  disabled?: boolean
30
30
  /** 最大输入长度,设置为 -1 的时候不限制最大长度
31
31
  * @default 140
32
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
32
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
33
33
  */
34
34
  maxlength?: number
35
35
  /** 自动聚焦,拉起键盘
36
36
  * @default false
37
- * @supported weapp, swan, qq, jd, h5
37
+ * @supported weapp, swan, qq, jd, h5, harmony_hybrid
38
38
  */
39
39
  autoFocus?: boolean
40
40
  /** 获取焦点
41
41
  * @default false
42
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
42
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
43
43
  */
44
44
  focus?: boolean
45
45
  /** 是否自动增高,设置 autoHeight 时,style.height不生效
46
46
  * @default false
47
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
47
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
48
48
  */
49
49
  autoHeight?: boolean
50
50
  /** 如果 Textarea 是在一个 `position:fixed` 的区域,需要显示指定属性 fixed 为 true
@@ -93,7 +93,7 @@ interface TextareaProps extends StandardProps, FormItemProps {
93
93
  */
94
94
  disableDefaultPadding?: boolean
95
95
  /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
96
- * @supported h5
96
+ * @supported h5, harmony_hybrid
97
97
  */
98
98
  nativeProps?: Record<string, unknown>
99
99
  /** 设置键盘右下角按钮的文字
@@ -128,11 +128,11 @@ interface TextareaProps extends StandardProps, FormItemProps {
128
128
  */
129
129
  adjustKeyboardTo?: boolean
130
130
  /** 输入框聚焦时触发
131
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
131
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
132
132
  */
133
133
  onFocus?: CommonEventFunction<TextareaProps.onFocusEventDetail>
134
134
  /** 输入框失去焦点时触发
135
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
135
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
136
136
  */
137
137
  onBlur?: CommonEventFunction<TextareaProps.onBlurEventDetail>
138
138
  /** 输入框行数变化时调用
@@ -142,11 +142,11 @@ interface TextareaProps extends StandardProps, FormItemProps {
142
142
  /** 当键盘输入时,触发 input 事件
143
143
  *
144
144
  * **onInput 处理函数的返回值并不会反映到 textarea 上**
145
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
145
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
146
146
  */
147
147
  onInput?: CommonEventFunction<TextareaProps.onInputEventDetail>
148
148
  /** 点击完成时, 触发 confirm 事件
149
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
149
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
150
150
  */
151
151
  onConfirm?: CommonEventFunction<TextareaProps.onConfirmEventDetail>
152
152
  /** 键盘高度发生变化的时候触发此事件
@@ -193,7 +193,7 @@ declare namespace TextareaProps {
193
193
  }
194
194
  /** 多行输入框。该组件是原生组件,使用时请注意相关限制
195
195
  * @classification forms
196
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
196
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
197
197
  * @example_react
198
198
  * ```tsx
199
199
  * export default class PageView extends Component {
package/types/Video.d.ts CHANGED
@@ -2,49 +2,49 @@ import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction } from './common'
3
3
  interface VideoProps extends StandardProps {
4
4
  /** 要播放视频的资源地址
5
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
5
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
6
6
  */
7
7
  src: string
8
8
  /** 指定视频时长
9
- * @supported weapp, alipay, qq, h5, rn
9
+ * @supported weapp, alipay, qq, h5, rn, harmony_hybrid
10
10
  */
11
11
  duration?: number
12
12
  /** 是否显示默认播放控件(播放/暂停按钮、播放进度、时间)
13
13
  * @default true
14
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
14
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
15
15
  */
16
16
  controls?: boolean
17
17
  /** 弹幕列表
18
- * @supported weapp, swan, qq, h5
18
+ * @supported weapp, swan, qq, h5, harmony_hybrid
19
19
  */
20
20
  danmuList?: any[]
21
21
  /** 是否显示弹幕按钮,只在初始化时有效,不能动态变更
22
22
  * @default false
23
- * @supported weapp, swan, qq, h5
23
+ * @supported weapp, swan, qq, h5, harmony_hybrid
24
24
  */
25
25
  danmuBtn?: boolean
26
26
  /** 是否展示弹幕,只在初始化时有效,不能动态变更
27
27
  * @default false
28
- * @supported weapp, swan, qq, h5
28
+ * @supported weapp, swan, qq, h5, harmony_hybrid
29
29
  */
30
30
  enableDanmu?: boolean
31
31
  /** 是否自动播放
32
32
  * @default false
33
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
33
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
34
34
  */
35
35
  autoplay?: boolean
36
36
  /** 是否循环播放
37
37
  * @default false
38
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
38
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
39
39
  */
40
40
  loop?: boolean
41
41
  /** 是否静音播放
42
42
  * @default false
43
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
43
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
44
44
  */
45
45
  muted?: boolean
46
46
  /** 指定视频初始播放位置
47
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
47
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
48
48
  */
49
49
  initialTime?: number
50
50
  /** 在非全屏模式下,是否开启亮度与音量调节手势
@@ -58,41 +58,41 @@ interface VideoProps extends StandardProps {
58
58
  direction?: number
59
59
  /** 若不设置,宽度大于240时才会显示
60
60
  * @default true
61
- * @supported weapp, swan, qq, h5
61
+ * @supported weapp, swan, qq, h5, harmony_hybrid
62
62
  */
63
63
  showProgress?: boolean
64
64
  /** 是否显示全屏按钮
65
65
  * @default true
66
- * @supported weapp, alipay, swan, tt, qq, h5
66
+ * @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
67
67
  */
68
68
  showFullscreenBtn?: boolean
69
69
  /** 是否显示视频底部控制栏的播放按钮
70
70
  * @default true
71
- * @supported weapp, alipay, swan, tt, qq, h5
71
+ * @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
72
72
  */
73
73
  showPlayBtn?: boolean
74
74
  /** 是否显示视频中间的播放按钮
75
75
  * @default true
76
- * @supported weapp, alipay, swan, qq, h5, rn
76
+ * @supported weapp, alipay, swan, qq, h5, rn, harmony_hybrid
77
77
  */
78
78
  showCenterPlayBtn?: boolean
79
79
  /** 是否开启控制进度的手势
80
80
  * @default true
81
- * @supported weapp, alipay, swan, tt, qq, h5
81
+ * @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
82
82
  */
83
83
  enableProgressGesture?: boolean
84
84
  /** 当视频大小与 video 容器大小不一致时,视频的表现形式
85
85
  * @default "contain"
86
- * @supported weapp, alipay, swan, tt, qq, jd, h5
86
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid
87
87
  */
88
88
  objectFit?: keyof VideoProps.ObjectFit
89
89
  /** 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效
90
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
90
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
91
91
  */
92
92
  poster?: string
93
93
  /** 是否显示静音按钮
94
94
  * @default false
95
- * @supported weapp, alipay, swan, tt, qq, h5
95
+ * @supported weapp, alipay, swan, tt, qq, h5, harmony_hybrid
96
96
  */
97
97
  showMuteBtn?: boolean
98
98
  /** 视频的标题,全屏时在顶部展示
@@ -109,7 +109,7 @@ interface VideoProps extends StandardProps {
109
109
  playBtnPosition?: keyof VideoProps.PlayBtnPosition
110
110
  /** 是否开启播放手势,即双击切换播放/暂停
111
111
  * @default false
112
- * @supported weapp, swan, tt, qq, h5
112
+ * @supported weapp, swan, tt, qq, h5, harmony_hybrid
113
113
  */
114
114
  enablePlayGesture?: boolean
115
115
  /** 当跳转到其它小程序页面时,是否自动暂停本页面的视频
@@ -124,12 +124,12 @@ interface VideoProps extends StandardProps {
124
124
  autoPauseIfOpenNative?: boolean
125
125
  /** 在非全屏模式下,是否开启亮度与音量调节手势(同 `page-gesture`)
126
126
  * @default false
127
- * @supported weapp, swan, tt, h5
127
+ * @supported weapp, swan, tt, h5, harmony_hybrid
128
128
  */
129
129
  vslideGesture?: boolean
130
130
  /** 在全屏模式下,是否开启亮度与音量调节手势
131
131
  * @default true
132
- * @supported weapp, swan, tt, h5
132
+ * @supported weapp, swan, tt, h5, harmony_hybrid
133
133
  */
134
134
  vslideGestureInFullscreen?: boolean
135
135
  /** 视频前贴广告单元ID,更多详情可参考开放能力[视频前贴广告](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/ad/video-patch-ad.html)
@@ -187,7 +187,7 @@ interface VideoProps extends StandardProps {
187
187
  */
188
188
  backgroundPoster?: string
189
189
  /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
190
- * @supported h5
190
+ * @supported h5, harmony_hybrid
191
191
  */
192
192
  nativeProps?: Record<string, unknown>
193
193
  /** 是否展示底部进度条
@@ -298,24 +298,24 @@ interface VideoProps extends StandardProps {
298
298
  */
299
299
  definition?: string
300
300
  /** 当开始/继续播放时触发 play 事件
301
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
301
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
302
302
  */
303
303
  onPlay?: CommonEventFunction
304
304
  /** 当暂停播放时触发 pause 事件
305
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
305
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
306
306
  */
307
307
  onPause?: CommonEventFunction
308
308
  /** 当播放到末尾时触发 ended 事件
309
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
309
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
310
310
  */
311
311
  onEnded?: CommonEventFunction
312
312
  /** 播放进度变化时触发, 触发频率 250ms 一次
313
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
313
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
314
314
  */
315
315
  onTimeUpdate?: CommonEventFunction<VideoProps.onTimeUpdateEventDetail>
316
316
  /** 当视频进入和退出全屏时触发
317
317
  *
318
- * @supported alipay, h5, rn
318
+ * @supported alipay, h5, rn, harmony_hybrid
319
319
  */
320
320
  onFullscreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
321
321
  /** 视频出现缓冲时触发
@@ -324,11 +324,11 @@ interface VideoProps extends StandardProps {
324
324
  */
325
325
  onWaiting?: CommonEventFunction<VideoProps.onWaitingEventDetail>
326
326
  /** 视频播放出错时触发
327
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
327
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
328
328
  */
329
329
  onError?: CommonEventFunction
330
330
  /** 加载进度变化时触发,只支持一段加载
331
- * @supported weapp, tt, qq, h5
331
+ * @supported weapp, tt, qq, h5, harmony_hybrid
332
332
  */
333
333
  onProgress?: CommonEventFunction<VideoProps.onProgressEventDetail>
334
334
  /** 视频元数据加载完成时触发
@@ -557,7 +557,7 @@ declare namespace VideoProps {
557
557
  }
558
558
  /** 视频。相关api:Taro.createVideoContext
559
559
  * @classification media
560
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
560
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
561
561
  * @example_react
562
562
  * ```tsx
563
563
  * export default class PageView extends Component {
package/types/View.d.ts CHANGED
@@ -4,7 +4,7 @@ import { CommonEventFunction, StandardProps } from './common'
4
4
  interface ViewProps extends StandardProps {
5
5
  /** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
6
6
  * @default none
7
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
7
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
8
8
  * @rn 由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
9
9
  */
10
10
  hoverClass?: string
@@ -20,12 +20,12 @@ interface ViewProps extends StandardProps {
20
20
  hoverStopPropagation?: boolean
21
21
  /** 按住后多久出现点击态,单位毫秒
22
22
  * @default 50
23
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
23
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
24
24
  */
25
25
  hoverStartTime?: number
26
26
  /** 手指松开后点击态保留时间,单位毫秒
27
27
  * @default 400
28
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
28
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
29
29
  */
30
30
  hoverStayTime?: number
31
31
  /** 是否阻止区域内滚动页面。
@@ -117,7 +117,7 @@ interface ViewProps extends StandardProps {
117
117
  }
118
118
  /** 视图容器
119
119
  * @classification viewContainer
120
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
120
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
121
121
  * @example_react
122
122
  * ```tsx
123
123
  * export default class PageView extends Component {
@@ -2,7 +2,7 @@ import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction } from './common'
3
3
  interface WebViewProps extends StandardProps {
4
4
  /** webview 指向网页的链接。可打开关联的公众号的文章,其它网页需登录小程序管理后台配置业务域名。
5
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
5
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
6
6
  */
7
7
  src: string
8
8
  /** webview 的进度条颜色
@@ -19,11 +19,11 @@ interface WebViewProps extends StandardProps {
19
19
  */
20
20
  onMessage?: CommonEventFunction<WebViewProps.onMessageEventDetail>
21
21
  /** 网页加载成功时候触发此事件。e.detail = { src }
22
- * @supported weapp, alipay, tt, qq, h5, rn
22
+ * @supported weapp, alipay, tt, qq, h5, rn, harmony_hybrid
23
23
  */
24
24
  onLoad?: CommonEventFunction<WebViewProps.onLoadEventDetail>
25
25
  /** 网页加载失败的时候触发此事件。e.detail = { src }
26
- * @supported weapp, alipay, tt, qq, h5, rn
26
+ * @supported weapp, alipay, tt, qq, h5, rn, harmony_hybrid
27
27
  */
28
28
  onError?: CommonEventFunction<WebViewProps.onErrorEventDetail>
29
29
  }
@@ -43,7 +43,7 @@ declare namespace WebViewProps {
43
43
  }
44
44
  /** web-view 组件是一个可以用来承载网页的容器,会自动铺满整个小程序页面。个人类型与海外类型的小程序暂不支持使用。
45
45
  * @classification open
46
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
46
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
47
47
  * @example_react
48
48
  * ```tsx
49
49
  * class App extends Component {
@@ -1 +0,0 @@
1
- import{h as t,r as a,c as e,H as i,g as o}from"./p-98b1fc13.js";import r from"@tarojs/taro";import{stripSuffix as s,stripBasename as b,addLeadingSlash as n,getCurrentPage as h}from"@tarojs/router";import l from"classnames";import d from"resolve-pathname";import{i as c}from"./p-d3c7f87d.js";const _=t=>{let a,e=t||"";const i={path:null,query:null,fragment:null};return a=e.indexOf("#"),a>-1&&(i.fragment=e.substring(a+1),e=e.substring(0,a)),a=e.indexOf("?"),a>-1&&(i.query=e.substring(a+1),e=e.substring(0,a)),i.path=e,i},u=({index:a,isSelected:e=!1,textColor:i,iconPath:o,badgeText:s,showRedDot:b=!1,pagePath:n,text:h,onSelect:d})=>{const _=l("weui-tabbar__item",{"weui-bar__item_on":e});return t("a",{key:a,href:"javascript:;",class:_,onClick:function(){const t=r.getCurrentPages().shift();"function"==typeof(null==t?void 0:t.onTabItemTap)&&c(this)&&t.onTabItemTap({index:a,pagePath:n,text:h}),d(a)}},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:o,alt:"",class:"weui-tabbar__icon"}),!!s&&t("span",{class:"weui-badge taro-tabbar-badge",style:{position:"absolute",top:"-2px",right:"-13px"}},s),b&&t("span",{class:"weui-badge weui-badge_dot",style:{position:"absolute",top:"0",right:"-6px"}})),t("p",{class:"weui-tabbar__label",style:{color:i}},h))},g="taro-tabbar__tabbar",m=class{constructor(t){a(this,t),this.onLongPress=e(this,"longpress",7),this.homePage="",this.customRoutes=[],this.tabbarPos="bottom",this.getOriginUrl=t=>{const a=this.customRoutes.filter((([,a])=>_(a).path===_(t).path));return s(a.length?a[0][0]:t,".html")},this.getSelectedIndex=t=>{let a=-1;return this.list.forEach((({pagePath:e},i)=>{_(t).path===_(e).path&&(a=i)})),a},this.switchTab=t=>{this.selectedIndex=t,r.switchTab({url:this.list[t].pagePath})},this.switchTabHandler=({url:t,successHandler:a,errorHandler:e})=>{const i=this.getOriginUrl(this.getCurrentUrl()||this.homePage),o=d(t,i),r=this.getSelectedIndex(o);r>-1?(this.switchTab(r),a({errMsg:"switchTab:ok"})):e({errMsg:`switchTab:fail page "${o}" is not found`})},this.routerChangeHandler=t=>{var a;const e=null===(a=null==t?void 0:t.toLocation)||void 0===a?void 0:a.path;let i;if("string"==typeof e){const t=this.conf.basename||"/";i=b(n(e||this.homePage),t)||"/"}else i=this.getCurrentUrl();this.selectedIndex=this.getSelectedIndex(this.getOriginUrl(i))},this.setTabBarBadgeHandler=({index:t,text:a,successHandler:e,errorHandler:i})=>{const o=[...this.list];t in o?(o[t].showRedDot=!1,o[t].badgeText=a,e({errMsg:"setTabBarBadge:ok"})):i({errMsg:"setTabBarBadge:fail tabbar item not found"}),this.list=o},this.removeTabBarBadgeHandler=({index:t,successHandler:a,errorHandler:e})=>{const i=[...this.list];t in i?(i[t].badgeText=null,i[t].badgeText=null,a({errMsg:"removeTabBarBadge:ok"})):e({errMsg:"removeTabBarBadge:fail tabbar item not found"}),this.list=i},this.showTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:e})=>{const i=[...this.list];t in i?(i[t].badgeText=null,i[t].showRedDot=!0,a({errMsg:"showTabBarRedDot:ok"})):e({errMsg:"showTabBarRedDot:fail tabbar item not found"}),this.list=i},this.hideTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:e})=>{const i=[...this.list];t in i?(i[t].showRedDot=!1,a({errMsg:"hideTabBarRedDot:ok"})):e({errMsg:"hideTabBarRedDot:fail tabbar item not found"}),this.list=i},this.showTabBarHandler=({successHandler:t})=>{this.status=0,t({errMsg:"showTabBar:ok"})},this.hideTabBarHandler=({animation:t,successHandler:a})=>{this.status=t?2:1,a({errMsg:"hideTabBar:ok"})},this.setTabBarStyleHandler=({color:t,selectedColor:a,backgroundColor:e,borderStyle:i,successHandler:o})=>{e&&(this.backgroundColor=e),i&&(this.borderStyle=i),t&&(this.color=t),a&&(this.selectedColor=a),o({errMsg:"setTabBarStyle:ok"})},this.setTabBarItemHandler=({index:t,iconPath:a,selectedIconPath:e,text:i,successHandler:o,errorHandler:r})=>{const s=[...this.list];t in s?(a&&(s[t].iconPath=a),e&&(s[t].selectedIconPath=e),i&&(s[t].text=i),o({errMsg:"setTabBarItem:ok"})):r({errMsg:"setTabBarItem:fail tabbar item not found"}),this.list=s},this.conf=void 0,this.list=void 0,this.borderStyle=void 0,this.backgroundColor=void 0,this.color=void 0,this.selectedColor=void 0,this.selectedIndex=-1,this.status=0}componentWillLoad(){var t,a;const e=(null===(t=this.conf)||void 0===t?void 0:t.list)||[],i=(null===(a=this.conf)||void 0===a?void 0:a.customRoutes)||{};if("[object Array]"!==Object.prototype.toString.call(e)||e.length<2||e.length>5)throw new Error("tabBar 配置错误");this.homePage=n(this.conf.homePage);for(let t in i){const a=i[t];t=n(t),"string"==typeof a?this.customRoutes.push([t,n(a)]):(null==a?void 0:a.length)>0&&this.customRoutes.push(...a.map((a=>[t,n(a)])))}e.forEach((t=>{0!==t.pagePath.indexOf("/")&&(t.pagePath="/"+t.pagePath)})),this.list=e,this.borderStyle=this.conf.borderStyle,this.backgroundColor=this.conf.backgroundColor,this.color=this.conf.color,this.selectedColor=this.conf.selectedColor}getCurrentUrl(){const t=h(this.conf.mode,this.conf.basename);return decodeURI("/"===t?this.homePage:t)}bindEvent(){r.eventCenter.on("__taroRouterChange",this.routerChangeHandler),r.eventCenter.on("__taroSwitchTab",this.switchTabHandler),r.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler),r.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),r.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),r.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),r.eventCenter.on("__taroShowTabBar",this.showTabBarHandler),r.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler),r.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler),r.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)}removeEvent(){r.eventCenter.off("__taroRouterChange",this.routerChangeHandler),r.eventCenter.off("__taroSwitchTab",this.switchTabHandler),r.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler),r.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),r.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),r.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),r.eventCenter.off("__taroShowTabBar",this.showTabBarHandler),r.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler),r.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler),r.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)}componentDidLoad(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom",this.bindEvent(),this.routerChangeHandler()}disconnectedCallback(){this.removeEvent()}render(){const{tabbarPos:a="bottom"}=this,e=this.status,o=l("weui-tabbar",{[`taro-tabbar__border-${this.borderStyle||"black"}`]:!0});return t(i,{class:l(g,`${g}-${a}`,{"taro-tabbar__tabbar-hide":-1===this.selectedIndex||1===e,"taro-tabbar__tabbar-slideout":2===e})},t("div",{class:o,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map(((a,e)=>{const i=this.selectedIndex===e;let o,r;return i?(o=this.selectedColor||"",r=a.selectedIconPath):(o=this.color||"",r=a.iconPath),t(u,{index:e,onSelect:this.switchTab.bind(this),isSelected:i,textColor:o,iconPath:r,pagePath:a.pagePath,text:a.text,badgeText:a.badgeText,showRedDot:a.showRedDot})}))))}get tabbar(){return o(this)}};m.style='.weui-tabbar{z-index:500;background-color:#f7f7fa;width:100%;display:-ms-flexbox;display:flex;position:absolute;bottom:0}.weui-tabbar:before{content:" ";color:#c0bfc4;-webkit-transform-origin:0 0;transform-origin:0 0;border-top:1px solid #c0bfc4;height:1px;position:absolute;top:0;left:0;right:0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-tabbar__item{padding:5px 0;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);color:#999;text-align:center;-webkit-tap-highlight-color:transparent;-ms-flex:1;flex:1;font-size:0;display:block}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#09bb07}.weui-tabbar__icon{width:27px;height:27px;display:inline-block}.weui-tabbar__icon img{width:100%;height:100%}i.weui-tabbar__icon,.weui-tabbar__icon>i{color:#999;font-size:24px}.weui-tabbar__label{text-align:center;color:#999;font-size:10px;line-height:1.8}.weui-badge{color:#fff;text-align:center;vertical-align:middle;background-color:#f43530;border-radius:18px;min-width:8px;padding:.15em .4em;font-size:12px;line-height:1.2;display:inline-block}.weui-badge_dot{min-width:0;padding:.4em}html,body{height:100%}:root{--taro-tabbar-height:$weuiTabBarHeight}#app{height:100%}.taro-tabbar__border-white:before{border-top-color:#fff!important}.taro-tabbar__container{-ms-flex-direction:column;flex-direction:column;height:100%;display:-ms-flexbox;display:flex;overflow:hidden}.taro-tabbar__panel{-webkit-overflow-scrolling:auto;-ms-flex:1;flex:1;position:relative;overflow:auto}.taro-tabbar__tabbar{height:var(--taro-tabbar-height);width:100%;-webkit-transition:bottom .2s,top .2s;transition:bottom .2s,top .2s;position:relative}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{margin-bottom:constant(safe-area-inset-bottom);margin-bottom:env(safe-area-inset-bottom);bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{-ms-flex:0 0;flex:0 0;top:-52px}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}';export{m as taro_tabbar}
@@ -1 +0,0 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,t,a){if(a||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++){if(i||!(r in t)){if(!i)i=Array.prototype.slice.call(t,0,r);i[r]=t[r]}}return e.concat(i||Array.prototype.slice.call(t))};System.register(["./p-6bbb639a.system.js","@tarojs/taro","@tarojs/router","classnames","resolve-pathname","./p-bd5177d3.system.js"],(function(e){"use strict";var t,a,r,o,i,n,s,l,b,d,h,c,u;return{setters:[function(e){t=e.h;a=e.r;r=e.c;o=e.H;i=e.g},function(e){n=e.default},function(e){s=e.stripSuffix;l=e.stripBasename;b=e.addLeadingSlash;d=e.getCurrentPage},function(e){h=e.default},function(e){c=e.default},function(e){u=e.i}],execute:function(){var f=function(e){var t=e||"";var a;var r={path:null,query:null,fragment:null};a=t.indexOf("#");if(a>-1){r.fragment=t.substring(a+1);t=t.substring(0,a)}a=t.indexOf("?");if(a>-1){r.query=t.substring(a+1);t=t.substring(0,a)}r.path=t;return r};var g=function(e){var a=e.index,r=e.isSelected,o=r===void 0?false:r,i=e.textColor,s=e.iconPath,l=e.badgeText,b=e.showRedDot,d=b===void 0?false:b,c=e.pagePath,f=e.text,g=e.onSelect;var v=h("weui-tabbar__item",{"weui-bar__item_on":o});var _={position:"absolute",top:"-2px",right:"-13px"};var p={position:"absolute",top:"0",right:"-6px"};function m(){var e=n.getCurrentPages().shift();if(typeof(e===null||e===void 0?void 0:e.onTabItemTap)==="function"&&u(this)){e.onTabItemTap({index:a,pagePath:c,text:f})}g(a)}return t("a",{key:a,href:"javascript:;",class:v,onClick:m},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:s,alt:"",class:"weui-tabbar__icon"}),!!l&&t("span",{class:"weui-badge taro-tabbar-badge",style:_},l),d&&t("span",{class:"weui-badge weui-badge_dot",style:p})),t("p",{class:"weui-tabbar__label",style:{color:i}},f))};var v='.weui-tabbar{z-index:500;background-color:#f7f7fa;width:100%;display:-ms-flexbox;display:flex;position:absolute;bottom:0}.weui-tabbar:before{content:" ";color:#c0bfc4;-webkit-transform-origin:0 0;transform-origin:0 0;border-top:1px solid #c0bfc4;height:1px;position:absolute;top:0;left:0;right:0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-tabbar__item{padding:5px 0;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);color:#999;text-align:center;-webkit-tap-highlight-color:transparent;-ms-flex:1;flex:1;font-size:0;display:block}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#09bb07}.weui-tabbar__icon{width:27px;height:27px;display:inline-block}.weui-tabbar__icon img{width:100%;height:100%}i.weui-tabbar__icon,.weui-tabbar__icon>i{color:#999;font-size:24px}.weui-tabbar__label{text-align:center;color:#999;font-size:10px;line-height:1.8}.weui-badge{color:#fff;text-align:center;vertical-align:middle;background-color:#f43530;border-radius:18px;min-width:8px;padding:.15em .4em;font-size:12px;line-height:1.2;display:inline-block}.weui-badge_dot{min-width:0;padding:.4em}html,body{height:100%}:root{--taro-tabbar-height:$weuiTabBarHeight}#app{height:100%}.taro-tabbar__border-white:before{border-top-color:#fff!important}.taro-tabbar__container{-ms-flex-direction:column;flex-direction:column;height:100%;display:-ms-flexbox;display:flex;overflow:hidden}.taro-tabbar__panel{-webkit-overflow-scrolling:auto;-ms-flex:1;flex:1;position:relative;overflow:auto}.taro-tabbar__tabbar{height:var(--taro-tabbar-height);width:100%;-webkit-transition:bottom .2s,top .2s;transition:bottom .2s,top .2s;position:relative}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{margin-bottom:constant(safe-area-inset-bottom);margin-bottom:env(safe-area-inset-bottom);bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{-ms-flex:0 0;flex:0 0;top:-52px}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}';var _=0;var p=1;var m=2;var T="taro-tabbar__tabbar";var w="taro-tabbar__tabbar-hide";var x="taro-tabbar__tabbar-slideout";var B=e("taro_tabbar",function(){function e(e){var t=this;a(this,e);this.onLongPress=r(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.getOriginUrl=function(e){var a=t.customRoutes.filter((function(t){var a=t[1];var r=f(a).path;var o=f(e).path;return r===o}));return s(a.length?a[0][0]:e,".html")};this.getSelectedIndex=function(e){var a=-1;t.list.forEach((function(t,r){var o=t.pagePath;var i=f(e).path;var n=f(o).path;if(i===n){a=r}}));return a};this.switchTab=function(e){t.selectedIndex=e;n.switchTab({url:t.list[e].pagePath})};this.switchTabHandler=function(e){var a=e.url,r=e.successHandler,o=e.errorHandler;var i=t.getOriginUrl(t.getCurrentUrl()||t.homePage);var n=c(a,i);var s=t.getSelectedIndex(n);if(s>-1){t.switchTab(s);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'.concat(n,'" is not found')})}};this.routerChangeHandler=function(e){var a;var r=(a=e===null||e===void 0?void 0:e.toLocation)===null||a===void 0?void 0:a.path;var o;if(typeof r==="string"){var i=t.conf.basename||"/";o=l(b(r||t.homePage),i)||"/"}else{o=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(o))};this.setTabBarBadgeHandler=function(e){var a=e.index,r=e.text,o=e.successHandler,i=e.errorHandler;var n=__spreadArray([],t.list,true);if(a in n){n[a].showRedDot=false;n[a].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{i({errMsg:"setTabBarBadge:fail tabbar item not found"})}t.list=n};this.removeTabBarBadgeHandler=function(e){var a=e.index,r=e.successHandler,o=e.errorHandler;var i=__spreadArray([],t.list,true);if(a in i){i[a].badgeText=null;i[a].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}t.list=i};this.showTabBarRedDotHandler=function(e){var a=e.index,r=e.successHandler,o=e.errorHandler;var i=__spreadArray([],t.list,true);if(a in i){i[a].badgeText=null;i[a].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}t.list=i};this.hideTabBarRedDotHandler=function(e){var a=e.index,r=e.successHandler,o=e.errorHandler;var i=__spreadArray([],t.list,true);if(a in i){i[a].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}t.list=i};this.showTabBarHandler=function(e){var a=e.successHandler;t.status=_;a({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var a=e.animation,r=e.successHandler;t.status=a?m:p;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var a=e.color,r=e.selectedColor,o=e.backgroundColor,i=e.borderStyle,n=e.successHandler;if(o)t.backgroundColor=o;if(i)t.borderStyle=i;if(a)t.color=a;if(r)t.selectedColor=r;n({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var a=e.index,r=e.iconPath,o=e.selectedIconPath,i=e.text,n=e.successHandler,s=e.errorHandler;var l=__spreadArray([],t.list,true);if(a in l){if(r)l[a].iconPath=r;if(o)l[a].selectedIconPath=o;if(i)l[a].text=i;n({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}t.list=l};this.conf=undefined;this.list=undefined;this.borderStyle=undefined;this.backgroundColor=undefined;this.color=undefined;this.selectedColor=undefined;this.selectedIndex=-1;this.status=_}e.prototype.componentWillLoad=function(){var e,t;var a=((e=this.conf)===null||e===void 0?void 0:e.list)||[];var r=((t=this.conf)===null||t===void 0?void 0:t.customRoutes)||{};if(Object.prototype.toString.call(a)!=="[object Array]"||a.length<2||a.length>5){throw new Error("tabBar 配置错误")}this.homePage=b(this.conf.homePage);var o=function(e){var t;var a=r[e];e=b(e);if(typeof a==="string"){i.customRoutes.push([e,b(a)])}else if((a===null||a===void 0?void 0:a.length)>0){(t=i.customRoutes).push.apply(t,a.map((function(t){return[e,b(t)]})))}};var i=this;for(var n in r){o(n)}a.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=a;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=d(this.conf.mode,this.conf.basename);return decodeURI(e==="/"?this.homePage:e)};e.prototype.bindEvent=function(){n.eventCenter.on("__taroRouterChange",this.routerChangeHandler);n.eventCenter.on("__taroSwitchTab",this.switchTabHandler);n.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);n.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);n.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);n.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);n.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);n.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);n.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);n.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){n.eventCenter.off("__taroRouterChange",this.routerChangeHandler);n.eventCenter.off("__taroSwitchTab",this.switchTabHandler);n.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);n.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);n.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);n.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);n.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);n.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);n.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);n.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,a;var r=this;var i=this.tabbarPos,n=i===void 0?"bottom":i;var s=this.status;var l=h("weui-tabbar",(e={},e["taro-tabbar__border-".concat(this.borderStyle||"black")]=true,e));var b=this.selectedIndex===-1||s===p;var d=s===m;return t(o,{class:h(T,"".concat(T,"-").concat(n),(a={},a[w]=b,a[x]=d,a))},t("div",{class:l,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map((function(e,a){var o=r.selectedIndex===a;var i;var n;if(o){i=r.selectedColor||"";n=e.selectedIconPath}else{i=r.color||"";n=e.iconPath}return t(g,{index:a,onSelect:r.switchTab.bind(r),isSelected:o,textColor:i,iconPath:n,pagePath:e.pagePath,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());B.style=v}}}));