@tarojs/components 3.6.2-canary.1 → 3.6.2-canary.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/taro-input-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +28 -18
- package/dist/cjs/taro-textarea-core.cjs.entry.js +2 -2
- package/dist/collection/components/input/input.js +1 -1
- package/dist/collection/components/picker/picker.js +1 -1
- package/dist/collection/components/swiper/swiper-item.js +16 -9
- package/dist/collection/components/swiper/swiper.js +12 -9
- package/dist/collection/components/textarea/textarea.js +7 -3
- package/dist/components/taro-input-core.js +1 -1
- package/dist/components/taro-picker-core.js +1 -1
- package/dist/components/taro-swiper-core.js +12 -9
- package/dist/components/taro-swiper-item-core.js +16 -9
- package/dist/components/taro-textarea-core.js +2 -2
- package/dist/esm/taro-input-core.entry.js +1 -1
- package/dist/esm/taro-picker-core_2.entry.js +1 -1
- package/dist/esm/taro-swiper-core_2.entry.js +28 -18
- package/dist/esm/taro-textarea-core.entry.js +2 -2
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
- package/dist/taro-components/{p-4d390d17.entry.js → p-0b8b3af5.entry.js} +1 -1
- package/dist/taro-components/p-1c446c65.system.js +1 -1
- package/dist/taro-components/p-1eac7c75.system.entry.js +1 -0
- package/dist/taro-components/{p-3e23fa46.system.entry.js → p-39685396.system.entry.js} +1 -1
- package/dist/taro-components/{p-e53feb03.system.entry.js → p-58f9a827.system.entry.js} +1 -1
- package/dist/taro-components/{p-ab84c88e.entry.js → p-7704e165.entry.js} +1 -1
- package/dist/taro-components/{p-10046f1a.system.entry.js → p-a5afdc47.system.entry.js} +1 -1
- package/dist/taro-components/p-affb28de.entry.js +1 -0
- package/dist/taro-components/{p-7db63e92.entry.js → p-c30d1b2d.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/lib/vue2/components.d.ts +361 -589
- package/lib/vue2/components.js +248 -246
- package/lib/vue2/components.js.map +1 -1
- package/package.json +5 -5
- package/types/Ad.d.ts +2 -31
- package/types/AdCustom.d.ts +0 -4
- package/types/AnimationVideo.d.ts +0 -9
- package/types/AnimationView.d.ts +0 -6
- package/types/ArCamera.d.ts +0 -7
- package/types/Audio.d.ts +0 -18
- package/types/AwemeData.d.ts +0 -6
- package/types/Button.d.ts +3 -106
- package/types/Camera.d.ts +0 -28
- package/types/Canvas.d.ts +2 -17
- package/types/ChannelLive.d.ts +0 -2
- package/types/ChannelVideo.d.ts +0 -6
- package/types/Checkbox.d.ts +1 -8
- package/types/CheckboxGroup.d.ts +0 -2
- package/types/CommentDetail.d.ts +4 -10
- package/types/CommentList.d.ts +4 -20
- package/types/ContactButton.d.ts +0 -7
- package/types/CoverImage.d.ts +0 -11
- package/types/CoverView.d.ts +0 -26
- package/types/Editor.d.ts +0 -10
- package/types/FollowSwan.d.ts +0 -3
- package/types/Form.d.ts +1 -9
- package/types/FunctionalPageNavigator.d.ts +0 -11
- package/types/GridView.d.ts +5 -10
- package/types/Icon.d.ts +0 -14
- package/types/Image.d.ts +0 -31
- package/types/InlinePaymentPanel.d.ts +0 -9
- package/types/Input.d.ts +0 -62
- package/types/Label.d.ts +3 -2
- package/types/Lifestyle.d.ts +0 -3
- package/types/Like.d.ts +0 -17
- package/types/LivePlayer.d.ts +1 -58
- package/types/LivePusher.d.ts +0 -77
- package/types/Login.d.ts +0 -5
- package/types/Lottie.d.ts +0 -16
- package/types/Map.d.ts +19 -136
- package/types/MatchMedia.d.ts +0 -7
- package/types/MovableArea.d.ts +0 -1
- package/types/MovableView.d.ts +0 -35
- package/types/NavigationBar.d.ts +0 -6
- package/types/Navigator.d.ts +0 -27
- package/types/OfficialAccount.d.ts +0 -12
- package/types/OpenData.d.ts +0 -20
- package/types/PageContainer.d.ts +0 -21
- package/types/PageMeta.d.ts +0 -16
- package/types/Picker.d.ts +17 -45
- package/types/PickerView.d.ts +1 -12
- package/types/Progress.d.ts +0 -13
- package/types/Radio.d.ts +1 -8
- package/types/RadioGroup.d.ts +0 -2
- package/types/RichText.d.ts +1 -22
- package/types/RootPortal.d.ts +1 -2
- package/types/RtcRoom.d.ts +0 -16
- package/types/RtcRoomItem.d.ts +0 -3
- package/types/ScrollView.d.ts +2 -57
- package/types/ShareElement.d.ts +2 -7
- package/types/Slider.d.ts +0 -19
- package/types/Swiper.d.ts +0 -44
- package/types/SwiperItem.d.ts +0 -2
- package/types/Switch.d.ts +2 -11
- package/types/TabItem.d.ts +0 -4
- package/types/Tabs.d.ts +0 -8
- package/types/Text.d.ts +0 -7
- package/types/Textarea.d.ts +0 -36
- package/types/Video.d.ts +1 -112
- package/types/View.d.ts +0 -25
- package/types/VoipRoom.d.ts +0 -6
- package/types/WebView.d.ts +0 -6
- package/dist/taro-components/p-0aaf66d2.entry.js +0 -1
- package/dist/taro-components/p-da1f3d54.system.entry.js +0 -1
package/types/View.d.ts
CHANGED
|
@@ -8,130 +8,106 @@ interface ViewProps extends StandardProps {
|
|
|
8
8
|
* @rn 由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
|
|
9
9
|
*/
|
|
10
10
|
hoverClass?: string
|
|
11
|
-
|
|
12
11
|
/** 由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
|
|
13
12
|
* @default none
|
|
14
13
|
* @supported rn
|
|
15
14
|
*/
|
|
16
15
|
hoverStyle?: StyleProp<ViewStyle>
|
|
17
|
-
|
|
18
16
|
/** 指定是否阻止本节点的祖先节点出现点击态
|
|
19
17
|
* @default false
|
|
20
18
|
* @supported weapp, alipay, swan, tt, qq, jd
|
|
21
19
|
*/
|
|
22
20
|
hoverStopPropagation?: boolean
|
|
23
|
-
|
|
24
21
|
/** 按住后多久出现点击态,单位毫秒
|
|
25
22
|
* @default 50
|
|
26
23
|
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
27
24
|
*/
|
|
28
25
|
hoverStartTime?: number
|
|
29
|
-
|
|
30
26
|
/** 手指松开后点击态保留时间,单位毫秒
|
|
31
27
|
* @default 400
|
|
32
28
|
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
33
29
|
*/
|
|
34
30
|
hoverStayTime?: number
|
|
35
|
-
|
|
36
31
|
/** 是否阻止区域内滚动页面。
|
|
37
32
|
* 说明: 如果 view 中嵌套 view,外层 view 设置 disable-scroll 为 true 时禁止内部的滚动。
|
|
38
33
|
* @supported alipay
|
|
39
34
|
* @default false
|
|
40
35
|
*/
|
|
41
36
|
disableScroll?: string
|
|
42
|
-
|
|
43
37
|
/** 是否隐藏。
|
|
44
38
|
* @supported alipay
|
|
45
39
|
* @default false
|
|
46
40
|
*/
|
|
47
41
|
hidden?: boolean
|
|
48
|
-
|
|
49
42
|
/** 用于动画,详见 my.createAnimation 。使用 my.createAnimation 生成的动画是通过过渡(Transition)实现的,只会触发 onTransitionEnd,不会触发 onAnimationStart, onAnimationIteration, onAnimationEnd。
|
|
50
43
|
* @supported alipay
|
|
51
44
|
* @default {}
|
|
52
45
|
*/
|
|
53
46
|
animation?: TaroGeneral.IAnyObject
|
|
54
|
-
|
|
55
47
|
/** 表示组件的语义角色。设置为 img 时,组件聚焦后读屏软件会朗读出 图像 ;设置为 button 时,聚焦后读屏软件会朗读出 按钮 。详情请参见 aria-component。
|
|
56
48
|
* @supported alipay
|
|
57
49
|
*/
|
|
58
50
|
role?: string
|
|
59
|
-
|
|
60
51
|
/** 无障碍访问,(角色)标识元素的作用
|
|
61
52
|
* @supported qq
|
|
62
53
|
*/
|
|
63
54
|
ariaRole?: string
|
|
64
|
-
|
|
65
55
|
/** 无障碍访问,(属性)元素的额外描述
|
|
66
56
|
* @supported qq
|
|
67
57
|
*/
|
|
68
58
|
ariaLabel?: string
|
|
69
|
-
|
|
70
59
|
/** 点击。
|
|
71
60
|
* @supported alipay
|
|
72
61
|
*/
|
|
73
62
|
onTap?: CommonEventFunction
|
|
74
|
-
|
|
75
63
|
/** 触摸动作开始。
|
|
76
64
|
* @supported alipay
|
|
77
65
|
*/
|
|
78
66
|
onTouchStart?: CommonEventFunction
|
|
79
|
-
|
|
80
67
|
/** 触摸后移动。
|
|
81
68
|
* @supported alipay
|
|
82
69
|
*/
|
|
83
70
|
onTouchMove?: CommonEventFunction
|
|
84
|
-
|
|
85
71
|
/** 触摸动作结束。
|
|
86
72
|
* @supported alipay
|
|
87
73
|
*/
|
|
88
74
|
onTouchEnd?: CommonEventFunction
|
|
89
|
-
|
|
90
75
|
/** 触摸动作被打断,如来电提醒,弹窗。
|
|
91
76
|
* @supported alipay
|
|
92
77
|
*/
|
|
93
78
|
onTouchCancel?: CommonEventFunction
|
|
94
|
-
|
|
95
79
|
/** 长按 500ms 之后触发,触发了长按事件后进行移动将不会触发屏幕的滚动。
|
|
96
80
|
* @supported alipay
|
|
97
81
|
*/
|
|
98
82
|
onLongTap?: CommonEventFunction
|
|
99
|
-
|
|
100
83
|
/** 过渡(Transition)结束时触发。
|
|
101
84
|
* @supported alipay
|
|
102
85
|
*/
|
|
103
86
|
onTransitionEnd?: CommonEventFunction
|
|
104
|
-
|
|
105
87
|
/** 每开启一次新的动画过程时触发。(第一次不触发)
|
|
106
88
|
* @supported alipay
|
|
107
89
|
*/
|
|
108
90
|
onAnimationIteration?: CommonEventFunction
|
|
109
|
-
|
|
110
91
|
/** 动画开始时触发。
|
|
111
92
|
* @supported alipay
|
|
112
93
|
*/
|
|
113
94
|
onAnimationStart?: CommonEventFunction
|
|
114
|
-
|
|
115
95
|
/** 动画结束时触发。
|
|
116
96
|
* @supported alipay
|
|
117
97
|
*/
|
|
118
98
|
onAnimationEnd?: CommonEventFunction
|
|
119
|
-
|
|
120
99
|
/** 当前元素可见面积超过50%时触发。
|
|
121
100
|
* @supported alipay
|
|
122
101
|
*/
|
|
123
102
|
onAppear?: CommonEventFunction
|
|
124
|
-
|
|
125
103
|
/** 当前元素不可见面积超过50%时触发。
|
|
126
104
|
* @supported alipay
|
|
127
105
|
*/
|
|
128
106
|
onDisappear?: CommonEventFunction
|
|
129
|
-
|
|
130
107
|
/** 当前元素首次可见面积达到50%时触发。
|
|
131
108
|
* @supported alipay
|
|
132
109
|
*/
|
|
133
110
|
onFirstAppear?: CommonEventFunction
|
|
134
|
-
|
|
135
111
|
/** 是否以 catch 的形式绑定 touchmove 事件
|
|
136
112
|
* @supported weapp, alipay, swan, tt, qq, jd
|
|
137
113
|
* @version 3.1.0+
|
|
@@ -139,7 +115,6 @@ interface ViewProps extends StandardProps {
|
|
|
139
115
|
*/
|
|
140
116
|
catchMove?: boolean
|
|
141
117
|
}
|
|
142
|
-
|
|
143
118
|
/** 视图容器
|
|
144
119
|
* @classification viewContainer
|
|
145
120
|
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
|
package/types/VoipRoom.d.ts
CHANGED
|
@@ -6,25 +6,21 @@ interface VoipRoomProps extends StandardProps {
|
|
|
6
6
|
* @supported weapp
|
|
7
7
|
*/
|
|
8
8
|
mode?: keyof VoipRoomProps.Mode
|
|
9
|
-
|
|
10
9
|
/** 仅在 mode 为 camera 时有效,前置或后置,值为front, back
|
|
11
10
|
* @default front
|
|
12
11
|
* @supported weapp
|
|
13
12
|
*/
|
|
14
13
|
devicePosition?: keyof VoipRoomProps.DevicePosition
|
|
15
|
-
|
|
16
14
|
/** 进入房间用户的 openid
|
|
17
15
|
* @default "none"
|
|
18
16
|
* @supported weapp
|
|
19
17
|
*/
|
|
20
18
|
openId?: string
|
|
21
|
-
|
|
22
19
|
/** 画面与容器比例不一致时,画面的表现形式
|
|
23
20
|
* @supported weapp
|
|
24
21
|
* @default "fill"
|
|
25
22
|
*/
|
|
26
23
|
objectFit?: 'fill' | 'contain' | 'cover'
|
|
27
|
-
|
|
28
24
|
/** 创建对话窗口失败时触发
|
|
29
25
|
* @supported weapp
|
|
30
26
|
*/
|
|
@@ -36,14 +32,12 @@ declare namespace VoipRoomProps {
|
|
|
36
32
|
camera
|
|
37
33
|
video
|
|
38
34
|
}
|
|
39
|
-
|
|
40
35
|
/** 摄像头类型 */
|
|
41
36
|
interface DevicePosition {
|
|
42
37
|
front
|
|
43
38
|
back
|
|
44
39
|
}
|
|
45
40
|
}
|
|
46
|
-
|
|
47
41
|
/** 多人音视频对话
|
|
48
42
|
*
|
|
49
43
|
* 需用户授权 `scope.camera`、`scope.record`。相关接口: [Taro.joinVoIPChat](/docs/apis/media/voip/joinVoIPChat)
|
package/types/WebView.d.ts
CHANGED
|
@@ -5,28 +5,23 @@ interface WebViewProps extends StandardProps {
|
|
|
5
5
|
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
6
6
|
*/
|
|
7
7
|
src: string
|
|
8
|
-
|
|
9
8
|
/** webview 的进度条颜色
|
|
10
9
|
* @supported tt
|
|
11
10
|
*/
|
|
12
11
|
progressbarColor?: string
|
|
13
|
-
|
|
14
12
|
/** 若使用web-view组件引入第三方客服,必须填写type="im"
|
|
15
13
|
* @supported tt
|
|
16
14
|
* @default default
|
|
17
15
|
*/
|
|
18
16
|
type?: string
|
|
19
|
-
|
|
20
17
|
/** 网页向小程序 postMessage 时,会在特定时机(小程序后退、组件销毁、分享)触发并收到消息。e.detail = { data }
|
|
21
18
|
* @supported weapp, alipay, swan, tt, qq, jd
|
|
22
19
|
*/
|
|
23
20
|
onMessage?: CommonEventFunction<WebViewProps.onMessageEventDetail>
|
|
24
|
-
|
|
25
21
|
/** 网页加载成功时候触发此事件。e.detail = { src }
|
|
26
22
|
* @supported weapp, alipay, tt, qq, h5, rn
|
|
27
23
|
*/
|
|
28
24
|
onLoad?: CommonEventFunction<WebViewProps.onLoadEventDetail>
|
|
29
|
-
|
|
30
25
|
/** 网页加载失败的时候触发此事件。e.detail = { src }
|
|
31
26
|
* @supported weapp, alipay, tt, qq, h5, rn
|
|
32
27
|
*/
|
|
@@ -46,7 +41,6 @@ declare namespace WebViewProps {
|
|
|
46
41
|
src: string
|
|
47
42
|
}
|
|
48
43
|
}
|
|
49
|
-
|
|
50
44
|
/** web-view 组件是一个可以用来承载网页的容器,会自动铺满整个小程序页面。个人类型与海外类型的小程序暂不支持使用。
|
|
51
45
|
* @classification open
|
|
52
46
|
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as h}from"./p-78e3ebb9.js";import{c as n}from"./p-76724e58.js";function o(t,i){const s=[];for(let e=t;e<=i;e++)s.push(`${e<10?"0":""}${e}`);return s}const r=["20","21","22","23",...o(0,23),"00","01","02","03"],a=["56","57","58","59",...o(0,59),"00","01","02","03"];function c(t,i){return!isNaN(+t)&&t>=0&&t<i.length}function u(t){if(!/^\d{1,2}:\d{1,2}$/.test(t))return!1;const i=t.split(":").map((t=>+t));return!(i[0]<0||i[0]>23||i[1]<0||i[1]>59)}function d(t,i){const s=t.split(":").map((t=>+t)),e=i.split(":").map((t=>+t));return s[0]<e[0]||s[0]===e[0]&&s[1]<=e[1]}function l(t){if(!t)return!1;const i=new Date(t.replace(/-/g,"/"));return!isNaN(i.getMonth())&&i}function p(t){let i;return i=Array.isArray(t)?t.map((t=>String(t))):t,i}function m(t,i){const s=[];for(let e=t;e<=i;e++)s.push(e);return s}function g(t,i){return m(t,i)}function f(t,i,s){let e=1,h=12;return t.getFullYear()===s&&(e=t.getMonth()+1),i.getFullYear()===s&&(h=i.getMonth()+1),m(e,h)}function v(t,i,s,e){let h=1,n=function(t,i){return 4===i||6===i||9===i||11===i?30:2===i?t%4==0&&t%100!=0||t%400==0?29:28:31}(s,e);return t.getFullYear()===s&&t.getMonth()+1===e&&(h=t.getDate()),i.getFullYear()===s&&i.getMonth()+1===e&&(n=i.getDate()),m(h,n)}const _=102,k=34,w=class{constructor(e){t(this,e),this.onChange=i(this,"change",7),this.onColumnChange=i(this,"columnchange",7),this.onCancel=i(this,"cancel",7),this.index=[],this.showPicker=()=>{this.disabled||(this.height=this.getHeightByIndex(),this.hidden=!1)},this.getHeightByIndex=()=>this.index.map((t=>{let i=0;return"time"===this.mode&&(i=136),_-k*t-i})),this.hidePicker=()=>{this.fadeOut=!0,setTimeout((()=>{this.hidden=!0,this.fadeOut=!1}),350)},this.handleChange=()=>{this.hidePicker(),this.index=this.height.map((t=>(_-t)/k));let t=this.index.length&&"selector"!==this.mode?this.index:this.index[0];if("time"===this.mode){const i=[r.slice(),a.slice()],s=this.index.map(((t,s)=>i[s][t]));this.index=s.map((t=>parseInt(t))),t=s.join(":")}if("date"===this.mode){const{_start:i,_end:s,_updateValue:e}=this.pickerDate,h=e[0],n=e[1],o=g(i.getFullYear(),s.getFullYear()),r=f(i,s,h),a=v(i,s,h,n),c=o[this.index[0]],u=r[this.index[1]];t="year"===this.fields?[c]:"month"===this.fields?[c,u]:[c,u,a[this.index[2]]],t=t.map((t=>t<10?`0${t}`:t)).join("-")}this.pickerValue=t,this.onChange.emit({value:t})},this.handleCancel=()=>{this.hidePicker(),this.onCancel.emit()},this.updateHeight=(t,i,s=!1)=>{const e=[...this.height];if(e[i]=t,this.height=e,s){let{start:t,end:i}=this;if(u(t)||(t="00:00"),u(i)||(i="23:59"),!d(t,i))return;const s=[r.slice(),a.slice()],e=this.height.map((t=>(_-t)/k)),h=e.map(((t,i)=>s[i][t])).join(":");if(d(t,h)){if(!d(h,i)){const t=i.split(":").map((t=>_-k*(+t+4)));requestAnimationFrame((()=>this.height=t))}}else{const i=t.split(":").map((t=>_-k*(+t+4)));requestAnimationFrame((()=>this.height=i))}}},this.handleColumnChange=(t,i)=>{this.onColumnChange.emit({column:Number(i),value:(_-t)/k})},this.updateDay=(t,i)=>{const{_start:s,_end:e,_updateValue:h}=this.pickerDate;h[i]=t;const n=h[0],o=h[1],r=h[2];if(0===i){const t=f(s,e,n),i=t[t.length-1],r=t[0];o>i&&(h[1]=i),o<r&&(h[1]=r);const a=t.indexOf(h[1]),c=_-k*a;this.updateDay(h[1],1),this.updateHeight(c,"1")}else if(1===i){const t=v(s,e,n,o),i=t[t.length-1],a=t[0];r>i&&(h[2]=i),r<a&&(h[2]=a);const c=t.indexOf(h[2]),u=_-k*c;this.updateDay(h[2],2),this.updateHeight(u,"2")}},this.getSelector=()=>s("taro-picker-group",{range:this.range,rangeKey:this.rangeKey,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),this.getMultiSelector=()=>this.range.map(((t,i)=>s("taro-picker-group",{range:t,rangeKey:this.rangeKey,height:this.height[i],updateHeight:this.updateHeight,onColumnChange:this.handleColumnChange,columnId:String(i)}))),this.getTimeSelector=()=>{const t=r.slice(),i=a.slice();return[s("taro-picker-group",{mode:"time",range:t,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),s("taro-picker-group",{mode:"time",range:i,height:this.height[1],updateHeight:this.updateHeight,columnId:"1"})]},this.getDateSelector=()=>{const{fields:t,height:i}=this,{_start:e,_end:h,_updateValue:n}=this.pickerDate,o=n[0],r=n[1],a=g(e.getFullYear(),h.getFullYear()).map((t=>`${t}年`)),c=f(e,h,o).map((t=>`${t<10?`0${t}`:t}月`)),u=v(e,h,o,r).map((t=>`${t<10?`0${t}`:t}日`)),d=[s("taro-picker-group",{mode:"date",range:a,height:i[0],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"0"})];return"month"!==t&&"day"!==t||d.push(s("taro-picker-group",{mode:"date",range:c,height:i[1],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"1"})),"day"===t&&d.push(s("taro-picker-group",{mode:"date",range:u,height:i[2],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"2"})),d},this.mode="selector",this.disabled=!1,this.range=[],this.rangeKey=void 0,this.value=void 0,this.start="",this.end="",this.fields="day",this.name="",this.pickerValue=[],this.height=[],this.hidden=!0,this.fadeOut=!1,this.isWillLoadCalled=!1}componentWillLoad(){this.isWillLoadCalled=!0,this.handleProps()}componentDidLoad(){Object.defineProperty(this.el,"value",{get:()=>this.pickerValue,set:t=>this.value=t,configurable:!0}),this.overlay&&document.body.appendChild(this.overlay)}disconnectedCallback(){var t;this.overlay&&(null===(t=this.overlay.parentNode)||void 0===t||t.removeChild(this.overlay))}onPropsChange(){this.isWillLoadCalled&&this.handleProps()}handleProps(){const{mode:t,start:i,end:s}=this;if("selector"===t){const t=this.value;this.index=[c(t,this.range)?Math.floor(t):0]}else if("multiSelector"===t){const t=this.value;this.index=[],this.range.forEach(((i,s)=>{const e=null==t?void 0:t[s],h=c(e,i)?Math.floor(e):0;this.index.push(h)}))}else if("time"===t){let t=this.value;u(t)||(console.warn("time picker value illegal"),t="0:0");const i=t.split(":").map((t=>+t));this.index=i}else if("date"===t){const t=l(this.value)||new Date((new Date).setHours(0,0,0,0)),e=l(i)||new Date("1970/01/01"),h=l(s)||new Date("2999/01/01");if(!(t>=e&&t<=h))throw new Error("Date Interval Error");{const i=t.getFullYear(),s=t.getMonth()+1,n=t.getDate(),o=g(e.getFullYear(),h.getFullYear()),r=f(e,h,i),a=v(e,h,i,s);this.index=[o.indexOf(i),r.indexOf(s),a.indexOf(n)],this.pickerDate&&this.pickerDate._value.getTime()===t.getTime()&&this.pickerDate._start.getTime()===e.getTime()&&this.pickerDate._end.getTime()===h.getTime()||(this.pickerDate={_value:t,_start:e,_end:h,_updateValue:[i,s,n]})}}if(this.height=this.getHeightByIndex(),this.pickerValue=this.value,"date"===t){const t=this.pickerValue;"month"===this.fields?this.pickerValue=t.split("-").slice(0,2).join("-"):"year"===this.fields&&(this.pickerValue=t.split("-")[0])}}render(){const{name:t,mode:i,fadeOut:h,hidden:o}=this;let r;switch(i){case"multiSelector":r=this.getMultiSelector();break;case"time":r=this.getTimeSelector();break;case"date":r=this.getDateSelector();break;default:r=this.getSelector()}const a=n("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":h}),c=n("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":h}),u=o?{display:"none"}:{};return s(e,null,s("div",{onClick:this.showPicker},s("slot",null),s("input",{type:"hidden",name:t,value:p(this.pickerValue)})),s("div",{class:"weui-picker__overlay",style:u,ref:t=>{this.overlay=t}},s("div",{class:a,onClick:this.handleCancel}),s("div",{class:c},s("div",{class:"weui-picker__hd"},s("div",{class:"weui-picker__action",onClick:this.handleCancel},"取消"),s("div",{class:"weui-picker__action",onClick:this.handleChange},"确定")),s("div",{class:"weui-picker__bd"},r),s("input",{type:"hidden",name:t,value:p(this.pickerValue)}))))}get el(){return h(this)}static get watchers(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}}};w.style=".weui-picker,.weui-picker__hd{font-size:12px}";const y=class{constructor(i){t(this,i),this.mode=void 0,this.range=[],this.rangeKey=void 0,this.height=void 0,this.columnId=void 0,this.updateHeight=void 0,this.onColumnChange=void 0,this.updateDay=void 0,this.startY=void 0,this.preY=void 0,this.hadMove=void 0,this.touchEnd=void 0,this.isMove=void 0}getPosition(){const t=`translate3d(0, ${this.height}px, 0)`,i=`transform ${this.touchEnd?.3:0}s`;return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}}formulaUnlimitedScroll(t,i,s){const{height:e,updateHeight:h,columnId:n}=this,o="up"===s?1:-1;this.touchEnd=!1,h(-t*o*k+e,n),requestAnimationFrame((()=>{this.touchEnd=!0;const s=Math.round(i/-34)+t*o;h(_-k*s,n,!0)}))}async handleMoveStart(t){this.startY=t,this.preY=t,this.hadMove=!1}async handleMoving(t){const i=t,s=i-this.preY;this.preY=i,this.touchEnd=!1,Math.abs(i-this.startY)>10&&(this.hadMove=!0);let e=this.height+s;"time"===this.mode&&("0"===this.columnId?(e>0&&(e=-816+s),e<-850&&(e=-34+s)):"1"===this.columnId&&(e>0&&(e=-2040+s),e<-2074&&(e=-34+s))),this.updateHeight(e,this.columnId)}async handleMoveEnd(t){const{mode:i,range:s,height:e,updateHeight:h,onColumnChange:n,columnId:o}=this,r=-34*(s.length-1),a=t;let c;if(this.touchEnd=!0,this.hadMove)c=e-_;else{const t=window.innerHeight;if(c=e-_-(a-(t-119)),"time"===i)if("0"===o){if(c>-85)return this.formulaUnlimitedScroll(24,c,"up");if(c<-969)return this.formulaUnlimitedScroll(24,c,"down")}else if("1"===o){if(c>-85)return this.formulaUnlimitedScroll(60,c,"up");if(c<-2193)return this.formulaUnlimitedScroll(60,c,"down")}}c>0&&(c=0),c<r&&(c=r);const u=Math.round(c/-34),d=_-k*u;"date"===this.mode&&("0"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),0),"1"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),1),"2"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),2)),h(d,o,"time"===i),n&&n(d,o)}onMouseDown(t){this.isMove=!0,this.handleMoveStart(t.clientY)}onMouseMove(t){t.preventDefault(),this.isMove&&this.handleMoving(t.clientY)}onMouseMoveEnd(t){this.isMove&&(this.isMove=!1,this.handleMoveEnd(t.clientY))}onTouchStart(t){this.handleMoveStart(t.changedTouches[0].clientY)}onTouchMove(t){t.preventDefault(),this.handleMoving(t.changedTouches[0].clientY)}onTouchEnd(t){this.handleMoveEnd(t.changedTouches[0].clientY)}render(){const{range:t,rangeKey:i}=this,h=t.map((t=>s("div",{class:"weui-picker__item"},i?t[i]:t)));return s(e,{class:"weui-picker__group"},s("div",{class:"weui-picker__mask"}),s("div",{class:"weui-picker__indicator"}),s("div",{class:"weui-picker__content",style:this.getPosition()},h))}};export{w as taro_picker_core,y as taro_picker_group}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-1a0e1932.system.js"],(function(e){"use strict";var t,n,i,a;return{setters:[function(e){t=e.r;n=e.c;i=e.h;a=e.g}],execute:function(){var o="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";function r(e){return e!==null&&e!==void 0?e:""}var u=e("taro_textarea_core",function(){function e(e){var i=this;t(this,e);this.onInput=n(this,"input",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onChange=n(this,"change",7);this.onLineChange=n(this,"linechange",7);this.handleInput=function(e){e.stopPropagation();i.handleLineChange();var t=e.target.value||"";i.onInput.emit({value:t,cursor:t.length})};this.handleFocus=function(e){e.stopPropagation();i.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();i.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();i.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=i.getNumberOfLines();if(e!==i.line){i.line=e;i.onLineChange.emit({height:i.textareaRef.clientHeight,lineCount:i.line})}};this.calculateContentHeight=function(e,t){var n=e.style.height,i=e.offsetHeight,a=e.scrollHeight,o=e.style.overflow,r=e.style.minHeight||null;if(i>=a){e.style.minHeight=0;e.style.height=i+t+"px";e.style.overflow="hidden";if(a<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(i-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=i+++"px"}e.style.height=n;e.style.overflow=o;e.style.minHeight=r;return i}}else{return a}};this.getNumberOfLines=function(){var e=i.textareaRef,t=window.getComputedStyle?window.getComputedStyle(e):e.style,n=parseInt(t.lineHeight,10),a=i.calculateContentHeight(e,n),o=Math.floor(a/n);return o};this.value=undefined;this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.name=undefined;this.nativeProps={};this.line=1}e.prototype.watchAutoFocus=function(e,t){var n;if(!t&&e){(n=this.textareaRef)===null||n===void 0?void 0:n.focus()}};e.prototype.focus=function(){this.textareaRef.focus()};e.prototype.componentDidLoad=function(){var e=this;Object.defineProperty(this.el,"value",{get:function(){return e.textareaRef.value},set:function(t){return e.value=t},configurable:true})};e.prototype.render=function(){var e=this;var t=this,n=t.value,a=t.placeholder,o=t.disabled,u=t.maxlength,h=t.autoFocus,l=t.autoHeight,s=t.name,c=t.nativeProps,f=t.handleInput,g=t.handleFocus,p=t.handleBlur,d=t.handleChange;var v={};if(l){v.rows=this.line}return i("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t;if(h&&t)t.focus()}},class:"taro-textarea ".concat(l?"auto-height":""),value:r(n),placeholder:a,name:s,disabled:o,maxlength:u,autofocus:h,onInput:f,onFocus:g,onBlur:p,onChange:d},c,v))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"]}},enumerable:false,configurable:true});return e}());u.style=o}}}));
|