@tarojs/components 3.4.0-beta.3 → 3.5.0-canary.1
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 +13 -1
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
- package/dist/collection/components/input/input.js +27 -1
- package/dist/collection/components/scroll-view/scroll-view.js +3 -3
- package/dist/collection/components/tabbar/style/index.css +1 -1
- package/dist/esm/taro-input-core.entry.js +13 -1
- package/dist/esm/taro-scroll-view-core.entry.js +3 -3
- package/dist/esm/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/taro-components/p-33ee636a.system.js +1 -1
- package/dist/taro-components/p-9dc9c615.system.entry.js +1 -0
- package/dist/taro-components/p-abe415b4.system.entry.js +1 -0
- package/dist/taro-components/p-b55fedc1.entry.js +1 -0
- package/dist/taro-components/{p-6965567d.entry.js → p-cc818a13.entry.js} +1 -1
- package/dist/taro-components/{p-dd34408a.entry.js → p-e1040131.entry.js} +1 -1
- package/dist/taro-components/{p-13c1404f.system.entry.js → p-fd0d1168.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +3 -0
- package/dist/types/components.d.ts +1 -0
- package/dist-h5/vue/components/picker.js +2 -1
- package/package.json +3 -3
- package/types/Ad.d.ts +13 -1
- package/types/Audio.d.ts +22 -2
- package/types/Button.d.ts +84 -11
- package/types/Camera.d.ts +1 -1
- package/types/Canvas.d.ts +14 -1
- package/types/Checkbox.d.ts +65 -1
- package/types/CoverImage.d.ts +48 -6
- package/types/CoverView.d.ts +51 -8
- package/types/Editor.d.ts +57 -0
- package/types/Form.d.ts +33 -2
- package/types/Icon.d.ts +17 -1
- package/types/Image.d.ts +22 -2
- package/types/Input.d.ts +66 -5
- package/types/Label.d.ts +18 -4
- package/types/LivePlayer.d.ts +7 -1
- package/types/LivePusher.d.ts +7 -1
- package/types/Map.d.ts +55 -1
- package/types/MatchMedia.d.ts +24 -5
- package/types/MovableArea.d.ts +9 -3
- package/types/MovableView.d.ts +20 -6
- package/types/OfficialAccount.d.ts +0 -6
- package/types/OpenData.d.ts +7 -1
- package/types/PageContainer.d.ts +6 -0
- package/types/Picker.d.ts +64 -1
- package/types/PickerView.d.ts +66 -2
- package/types/PickerViewColumn.d.ts +1 -1
- package/types/Progress.d.ts +12 -1
- package/types/Radio.d.ts +77 -1
- package/types/RichText.d.ts +33 -1
- package/types/ScrollView.d.ts +91 -9
- package/types/Slider.d.ts +14 -1
- package/types/Swiper.d.ts +26 -1
- package/types/SwiperItem.d.ts +28 -3
- package/types/Switch.d.ts +21 -3
- package/types/Text.d.ts +38 -1
- package/types/Textarea.d.ts +17 -1
- package/types/Video.d.ts +41 -21
- package/types/View.d.ts +33 -1
- package/types/VoipRoom.d.ts +5 -6
- package/types/WebView.d.ts +7 -1
- package/dist/taro-components/p-665e8461.system.entry.js +0 -1
- package/dist/taro-components/p-6fcaadc7.entry.js +0 -1
- package/dist/taro-components/p-bb0d4567.system.entry.js +0 -1
|
@@ -3,6 +3,7 @@ import { TaroEvent } from '../../../types';
|
|
|
3
3
|
export declare class Input implements ComponentInterface {
|
|
4
4
|
private inputRef;
|
|
5
5
|
private isOnComposition;
|
|
6
|
+
private isOnPaste;
|
|
6
7
|
private onInputExcuted;
|
|
7
8
|
private fileListener;
|
|
8
9
|
value: string;
|
|
@@ -20,6 +21,7 @@ export declare class Input implements ComponentInterface {
|
|
|
20
21
|
watchHandler(newValue: string, oldValue: string): void;
|
|
21
22
|
watchFocus(newValue: boolean, oldValue: boolean): void;
|
|
22
23
|
onInput: EventEmitter;
|
|
24
|
+
onPaste: EventEmitter;
|
|
23
25
|
onFocus: EventEmitter;
|
|
24
26
|
onBlur: EventEmitter;
|
|
25
27
|
onConfirm: EventEmitter;
|
|
@@ -29,6 +31,7 @@ export declare class Input implements ComponentInterface {
|
|
|
29
31
|
componentDidLoad(): void;
|
|
30
32
|
disconnectedCallback(): void;
|
|
31
33
|
handleInput: (e: TaroEvent<HTMLInputElement>) => void;
|
|
34
|
+
handlePaste: (e: TaroEvent<HTMLInputElement> & ClipboardEvent) => void;
|
|
32
35
|
handleFocus: (e: TaroEvent<HTMLInputElement> & FocusEvent) => void;
|
|
33
36
|
handleBlur: (e: TaroEvent<HTMLInputElement> & FocusEvent) => void;
|
|
34
37
|
handleChange: (e: TaroEvent<HTMLInputElement>) => void;
|
|
@@ -941,6 +941,7 @@ declare namespace LocalJSX {
|
|
|
941
941
|
"onFocus"?: (event: CustomEvent<any>) => void;
|
|
942
942
|
"onInput"?: (event: CustomEvent<any>) => void;
|
|
943
943
|
"onKeydown"?: (event: CustomEvent<any>) => void;
|
|
944
|
+
"onPaste"?: (event: CustomEvent<any>) => void;
|
|
944
945
|
"password"?: boolean;
|
|
945
946
|
"placeholder"?: string;
|
|
946
947
|
"type"?: string;
|
|
@@ -31,7 +31,8 @@ export default {
|
|
|
31
31
|
return createElement('taro-picker-core', {
|
|
32
32
|
class: 'hydrated',
|
|
33
33
|
domProps: {
|
|
34
|
-
range: self.range
|
|
34
|
+
range: self.range,
|
|
35
|
+
rangeKey: self.rangeKey
|
|
35
36
|
},
|
|
36
37
|
on: _objectSpread(_objectSpread({}, self.listeners), {}, {
|
|
37
38
|
change: function change(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-canary.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main:h5": "src/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@stencil/core": "2.9.0",
|
|
41
|
-
"@tarojs/taro": "3.
|
|
41
|
+
"@tarojs/taro": "3.5.0-canary.1",
|
|
42
42
|
"better-scroll": "^1.14.1",
|
|
43
43
|
"classnames": "^2.2.5",
|
|
44
44
|
"intersection-observer": "^0.7.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"simulant": "^0.2.2",
|
|
56
56
|
"workbox-build": "4.3.1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "c61624d2f763e6d31e67d6cf9c564efc8b0d0887"
|
|
59
59
|
}
|
package/types/Ad.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ declare namespace AdProps {
|
|
|
110
110
|
/** Banner 广告
|
|
111
111
|
* @classification open
|
|
112
112
|
* @supported weapp
|
|
113
|
-
* @
|
|
113
|
+
* @example_react
|
|
114
114
|
* ```tsx
|
|
115
115
|
* class App extends Component {
|
|
116
116
|
* render () {
|
|
@@ -126,6 +126,18 @@ declare namespace AdProps {
|
|
|
126
126
|
* }
|
|
127
127
|
* }
|
|
128
128
|
* ```
|
|
129
|
+
* @example_vue
|
|
130
|
+
* ```html
|
|
131
|
+
* <template>
|
|
132
|
+
* <ad
|
|
133
|
+
* unit-id=""
|
|
134
|
+
* ad-intervals="60"
|
|
135
|
+
* `@load="onLoad"
|
|
136
|
+
* `@error="onError"
|
|
137
|
+
* `@close="onClose"
|
|
138
|
+
* />
|
|
139
|
+
* </template>
|
|
140
|
+
* ```
|
|
129
141
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/ad.html
|
|
130
142
|
*/
|
|
131
143
|
declare const Ad: ComponentType<AdProps>
|
package/types/Audio.d.ts
CHANGED
|
@@ -72,6 +72,11 @@ interface AudioProps extends StandardProps {
|
|
|
72
72
|
* @supported weapp, h5, swan
|
|
73
73
|
*/
|
|
74
74
|
onEnded?: CommonEventFunction
|
|
75
|
+
|
|
76
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
77
|
+
* @supported h5
|
|
78
|
+
*/
|
|
79
|
+
nativeProps?: Record<string, unknown>
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
declare namespace AudioProps {
|
|
@@ -102,7 +107,7 @@ declare namespace AudioProps {
|
|
|
102
107
|
* @classification media
|
|
103
108
|
* @deprecated
|
|
104
109
|
* @supported weapp, h5, swan
|
|
105
|
-
* @
|
|
110
|
+
* @example_react
|
|
106
111
|
* ```tsx
|
|
107
112
|
* export default class PageView extends Component {
|
|
108
113
|
* constructor() {
|
|
@@ -113,7 +118,7 @@ declare namespace AudioProps {
|
|
|
113
118
|
* return (
|
|
114
119
|
* <View className='components-page'>
|
|
115
120
|
* <Audio
|
|
116
|
-
* src='
|
|
121
|
+
* src='https://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46'
|
|
117
122
|
* controls={true}
|
|
118
123
|
* autoplay={false}
|
|
119
124
|
* loop={false}
|
|
@@ -126,6 +131,21 @@ declare namespace AudioProps {
|
|
|
126
131
|
* }
|
|
127
132
|
* }
|
|
128
133
|
* ```
|
|
134
|
+
* @example_vue
|
|
135
|
+
* ```html
|
|
136
|
+
* <template>
|
|
137
|
+
* <view class="components-page">
|
|
138
|
+
* <audio
|
|
139
|
+
* id="video"
|
|
140
|
+
* src="https://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46"
|
|
141
|
+
* :controls="true"
|
|
142
|
+
* :autoplay="false"
|
|
143
|
+
* :loop="false"
|
|
144
|
+
* :muted="true"
|
|
145
|
+
* />
|
|
146
|
+
* </view>
|
|
147
|
+
* </template>
|
|
148
|
+
* ```
|
|
129
149
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/audio.html
|
|
130
150
|
*/
|
|
131
151
|
declare const Audio: ComponentType<AudioProps>
|
package/types/Button.d.ts
CHANGED
|
@@ -4,37 +4,37 @@ import { StyleProp, ViewStyle } from 'react-native'
|
|
|
4
4
|
|
|
5
5
|
interface ButtonProps extends StandardProps {
|
|
6
6
|
/** 按钮的大小
|
|
7
|
-
* @supported weapp, h5, rn
|
|
7
|
+
* @supported weapp, h5, rn, alipay
|
|
8
8
|
* @default default
|
|
9
9
|
*/
|
|
10
10
|
size?: keyof ButtonProps.size
|
|
11
11
|
|
|
12
12
|
/** 按钮的样式类型
|
|
13
|
-
* @supported weapp, h5, rn
|
|
13
|
+
* @supported weapp, h5, rn, alipay
|
|
14
14
|
* @default default
|
|
15
15
|
*/
|
|
16
16
|
type?: keyof ButtonProps.type
|
|
17
17
|
|
|
18
18
|
/** 按钮是否镂空,背景色透明
|
|
19
|
-
* @supported weapp, h5, rn
|
|
19
|
+
* @supported weapp, h5, rn, alipay
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
plain?: boolean
|
|
23
23
|
|
|
24
24
|
/** 是否禁用
|
|
25
|
-
* @supported weapp, h5, rn
|
|
25
|
+
* @supported weapp, h5, rn, alipay
|
|
26
26
|
* @default false
|
|
27
27
|
*/
|
|
28
28
|
disabled?: boolean
|
|
29
29
|
|
|
30
30
|
/** 名称前是否带 loading 图标
|
|
31
|
-
* @supported weapp, h5, rn
|
|
31
|
+
* @supported weapp, h5, rn, alipay
|
|
32
32
|
* @default false
|
|
33
33
|
*/
|
|
34
34
|
loading?: boolean
|
|
35
35
|
|
|
36
36
|
/** 用于 `<form/>` 组件,点击分别会触发 `<form/>` 组件的 submit/reset 事件
|
|
37
|
-
* @supported weapp
|
|
37
|
+
* @supported weapp, alipay
|
|
38
38
|
*/
|
|
39
39
|
formType?: keyof ButtonProps.formType
|
|
40
40
|
|
|
@@ -45,7 +45,7 @@ interface ButtonProps extends StandardProps {
|
|
|
45
45
|
|
|
46
46
|
/** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
|
|
47
47
|
* @default button-hover
|
|
48
|
-
* @supported weapp, h5
|
|
48
|
+
* @supported weapp, alipay, h5
|
|
49
49
|
* @rn 支持 hoverStyle 属性,但框架未支持 hoverClass
|
|
50
50
|
*/
|
|
51
51
|
hoverClass?: string
|
|
@@ -58,19 +58,19 @@ interface ButtonProps extends StandardProps {
|
|
|
58
58
|
|
|
59
59
|
/** 指定是否阻止本节点的祖先节点出现点击态
|
|
60
60
|
* @default false
|
|
61
|
-
* @supported weapp
|
|
61
|
+
* @supported weapp, alipay
|
|
62
62
|
*/
|
|
63
63
|
hoverStopPropagation?: boolean
|
|
64
64
|
|
|
65
65
|
/** 按住后多久出现点击态,单位毫秒
|
|
66
66
|
* @default 20
|
|
67
|
-
* @supported weapp, h5, rn
|
|
67
|
+
* @supported weapp, alipay, h5, rn
|
|
68
68
|
*/
|
|
69
69
|
hoverStartTime?: number
|
|
70
70
|
|
|
71
71
|
/** 手指松开后点击态保留时间,单位毫秒
|
|
72
72
|
* @default 70
|
|
73
|
-
* @supported weapp, h5, rn
|
|
73
|
+
* @supported weapp, alipay, h5, rn
|
|
74
74
|
*/
|
|
75
75
|
hoverStayTime?: number
|
|
76
76
|
|
|
@@ -374,7 +374,7 @@ declare namespace ButtonProps {
|
|
|
374
374
|
/** 按钮
|
|
375
375
|
* @classification forms
|
|
376
376
|
* @supported weapp, h5, rn
|
|
377
|
-
* @
|
|
377
|
+
* @example_react
|
|
378
378
|
* ```tsx
|
|
379
379
|
* export default class PageButton extends Component {
|
|
380
380
|
* state = {
|
|
@@ -447,6 +447,79 @@ declare namespace ButtonProps {
|
|
|
447
447
|
* }
|
|
448
448
|
* }
|
|
449
449
|
* ```
|
|
450
|
+
* @example_vue
|
|
451
|
+
* ```html
|
|
452
|
+
* <template>
|
|
453
|
+
* <view class="container">
|
|
454
|
+
* <button
|
|
455
|
+
* v-for="item in btn"
|
|
456
|
+
* :size="item.size ? item.size : ''"
|
|
457
|
+
* :type="item.type ? item.type : ''"
|
|
458
|
+
* :loading="item.loading ? item.loading : false"
|
|
459
|
+
* :disabled="item.disabled ? item.disabled : false"
|
|
460
|
+
* >
|
|
461
|
+
* {{ item.text }}
|
|
462
|
+
* </button>
|
|
463
|
+
* <button class="btn-max-w" :plain="true" type="primary">按钮</button>
|
|
464
|
+
* <button class="btn-max-w" :plain="true" type="primary" :disabled="true">不可点击的按钮</button>
|
|
465
|
+
* <button class="btn-max-w" :plain="true">按钮</button>
|
|
466
|
+
* <button class="btn-max-w" :plain="true" :disabled="true">按钮</button>
|
|
467
|
+
* <button size="mini" type="primary">按钮</button>
|
|
468
|
+
* <button size="mini" >按钮</button>
|
|
469
|
+
* <button size="mini" type="warn">按钮</button>
|
|
470
|
+
* </view>
|
|
471
|
+
* </template>
|
|
472
|
+
*
|
|
473
|
+
* <script>
|
|
474
|
+
* export default {
|
|
475
|
+
* data() {
|
|
476
|
+
* return {
|
|
477
|
+
* btn: [
|
|
478
|
+
* {
|
|
479
|
+
* text: '页面主操作 Normal',
|
|
480
|
+
* size: 'default',
|
|
481
|
+
* type: 'primary'
|
|
482
|
+
* },
|
|
483
|
+
* {
|
|
484
|
+
* text: '页面主操作 Loading',
|
|
485
|
+
* size: 'default',
|
|
486
|
+
* type: 'primary',
|
|
487
|
+
* loading: true,
|
|
488
|
+
* },
|
|
489
|
+
* {
|
|
490
|
+
* text: '页面主操作 Disabled',
|
|
491
|
+
* size: 'default',
|
|
492
|
+
* type: 'primary',
|
|
493
|
+
* disabled: true,
|
|
494
|
+
* },
|
|
495
|
+
* {
|
|
496
|
+
* text: '页面次要操作 Normal',
|
|
497
|
+
* size: 'default',
|
|
498
|
+
* type: 'default'
|
|
499
|
+
* },
|
|
500
|
+
* {
|
|
501
|
+
* text: '页面次要操作 Disabled',
|
|
502
|
+
* size: 'default',
|
|
503
|
+
* type: 'default',
|
|
504
|
+
* disabled: true,
|
|
505
|
+
* },
|
|
506
|
+
* {
|
|
507
|
+
* text: '警告类操作 Normal',
|
|
508
|
+
* size: 'default',
|
|
509
|
+
* type: 'warn'
|
|
510
|
+
* },
|
|
511
|
+
* {
|
|
512
|
+
* text: '警告类操作 Disabled',
|
|
513
|
+
* size: 'default',
|
|
514
|
+
* type: 'warn',
|
|
515
|
+
* disabled: true,
|
|
516
|
+
* }
|
|
517
|
+
* ]
|
|
518
|
+
* }
|
|
519
|
+
* }
|
|
520
|
+
* }
|
|
521
|
+
* </script>
|
|
522
|
+
* ```
|
|
450
523
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/button.html
|
|
451
524
|
*/
|
|
452
525
|
declare const Button: ComponentType<ButtonProps>
|
package/types/Camera.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ declare namespace CameraProps {
|
|
|
115
115
|
|
|
116
116
|
/** 系统相机
|
|
117
117
|
* @classification media
|
|
118
|
-
* @supported weapp
|
|
118
|
+
* @supported weapp, rn
|
|
119
119
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/camera.html
|
|
120
120
|
*/
|
|
121
121
|
declare const Camera: ComponentType<CameraProps>
|
package/types/Canvas.d.ts
CHANGED
|
@@ -47,6 +47,11 @@ interface CanvasProps extends StandardProps<any, CanvasTouchEvent> {
|
|
|
47
47
|
* @supported weapp
|
|
48
48
|
*/
|
|
49
49
|
onError?: CommonEventFunction<CanvasProps.onErrorEventDetail>
|
|
50
|
+
|
|
51
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
52
|
+
* @supported h5
|
|
53
|
+
*/
|
|
54
|
+
nativeProps?: Record<string, unknown>
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
declare namespace CanvasProps {
|
|
@@ -60,16 +65,24 @@ declare namespace CanvasProps {
|
|
|
60
65
|
* `<Canvas />` 组件的 RN 版本尚未实现。
|
|
61
66
|
* @classification canvas
|
|
62
67
|
* @supported weapp
|
|
63
|
-
* @
|
|
68
|
+
* @example_react
|
|
64
69
|
* ```tsx
|
|
65
70
|
* class App extends Components {
|
|
66
71
|
* render () {
|
|
72
|
+
* // 如果是支付宝小程序,则要加上 id 属性,值和canvasId一致
|
|
67
73
|
* return (
|
|
68
74
|
* <Canvas style='width: 300px; height: 200px;' canvasId='canvas' />
|
|
69
75
|
* )
|
|
70
76
|
* }
|
|
71
77
|
* }
|
|
72
78
|
* ```
|
|
79
|
+
* @example_vue
|
|
80
|
+
* ```html
|
|
81
|
+
* <template>
|
|
82
|
+
* <!-- 如果是支付宝小程序,则要加上 id 属性,值和canvasId一致 -->
|
|
83
|
+
* <canvas style="width: 300px; height: 200px;" canvas-id="canvas" />
|
|
84
|
+
* </template>
|
|
85
|
+
* ```
|
|
73
86
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html
|
|
74
87
|
*/
|
|
75
88
|
declare const Canvas: ComponentType<CanvasProps>
|
package/types/Checkbox.d.ts
CHANGED
|
@@ -29,12 +29,17 @@ interface CheckboxProps extends StandardProps {
|
|
|
29
29
|
* @supported h5, rn
|
|
30
30
|
*/
|
|
31
31
|
onChange?: CommonEventFunction<{ value: string[] }>
|
|
32
|
+
|
|
33
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
34
|
+
* @supported h5
|
|
35
|
+
*/
|
|
36
|
+
nativeProps?: Record<string, unknown>
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
/** 多选项目
|
|
35
40
|
* @classification forms
|
|
36
41
|
* @supported weapp, h5, rn
|
|
37
|
-
* @
|
|
42
|
+
* @example_react
|
|
38
43
|
* ```tsx
|
|
39
44
|
* export default class PageCheckbox extends Component {
|
|
40
45
|
* state = {
|
|
@@ -94,6 +99,65 @@ interface CheckboxProps extends StandardProps {
|
|
|
94
99
|
* }
|
|
95
100
|
* }
|
|
96
101
|
* ```
|
|
102
|
+
* @example_vue
|
|
103
|
+
* ```html
|
|
104
|
+
* <template>
|
|
105
|
+
* <view class="container">
|
|
106
|
+
* <view class="page-section">
|
|
107
|
+
* <text>默认样式</text>
|
|
108
|
+
* <checkbox value="选中" :checked="true">选中</checkbox>
|
|
109
|
+
* <checkbox style="margin-left: 20rpx;" value="未选中">未选中</checkbox>
|
|
110
|
+
* </view>
|
|
111
|
+
* <view class="page-section">
|
|
112
|
+
* <text>推荐展示样式(Taro 团队成员):</text>
|
|
113
|
+
* <label v-for="item in list" class="checkbox-list__label">
|
|
114
|
+
* <checkbox class="checkbox-list__checkbox" :value="item.value" :checked="item.checked">{{ item.text }}</checkbox>
|
|
115
|
+
* </label>
|
|
116
|
+
* </view>
|
|
117
|
+
* </view>
|
|
118
|
+
* </template>
|
|
119
|
+
*
|
|
120
|
+
* <script>
|
|
121
|
+
* export default {
|
|
122
|
+
* data() {
|
|
123
|
+
* return {
|
|
124
|
+
* list: [
|
|
125
|
+
* {
|
|
126
|
+
* value: '美国',
|
|
127
|
+
* text: '美国',
|
|
128
|
+
* checked: false
|
|
129
|
+
* },
|
|
130
|
+
* {
|
|
131
|
+
* value: '中国',
|
|
132
|
+
* text: '中国',
|
|
133
|
+
* checked: true
|
|
134
|
+
* },
|
|
135
|
+
* {
|
|
136
|
+
* value: '巴西',
|
|
137
|
+
* text: '巴西',
|
|
138
|
+
* checked: false
|
|
139
|
+
* },
|
|
140
|
+
* {
|
|
141
|
+
* value: '日本',
|
|
142
|
+
* text: '日本',
|
|
143
|
+
* checked: false
|
|
144
|
+
* },
|
|
145
|
+
* {
|
|
146
|
+
* value: '英国',
|
|
147
|
+
* text: '英国',
|
|
148
|
+
* checked: false
|
|
149
|
+
* },
|
|
150
|
+
* {
|
|
151
|
+
* value: '法国',
|
|
152
|
+
* text: '法国',
|
|
153
|
+
* checked: false
|
|
154
|
+
* }
|
|
155
|
+
* ]
|
|
156
|
+
* }
|
|
157
|
+
* }
|
|
158
|
+
* }
|
|
159
|
+
* </script>
|
|
160
|
+
* ```
|
|
97
161
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/checkbox.html
|
|
98
162
|
*/
|
|
99
163
|
declare const Checkbox: ComponentType<CheckboxProps>
|
package/types/CoverImage.d.ts
CHANGED
|
@@ -3,32 +3,34 @@ import { StandardProps, CommonEventFunction } from './common'
|
|
|
3
3
|
|
|
4
4
|
interface CoverImageProps extends StandardProps {
|
|
5
5
|
/** 图标路径,支持临时路径、网络地址、云文件ID。暂不支持base64格式。
|
|
6
|
-
* @supported weapp
|
|
6
|
+
* @supported weapp, h5
|
|
7
7
|
*/
|
|
8
8
|
src: string
|
|
9
9
|
|
|
10
10
|
/** 图片加载成功时触发
|
|
11
|
-
* @supported weapp
|
|
11
|
+
* @supported weapp, h5
|
|
12
12
|
*/
|
|
13
13
|
onLoad?: CommonEventFunction
|
|
14
14
|
|
|
15
15
|
/** 图片加载失败时触发
|
|
16
|
-
* @supported weapp
|
|
16
|
+
* @supported weapp, h5
|
|
17
17
|
*/
|
|
18
18
|
onError?: CommonEventFunction
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/** 覆盖在原生组件之上的图片视图。可覆盖的原生组件同cover-view,支持嵌套在cover-view里。
|
|
22
22
|
* @classification viewContainer
|
|
23
|
-
* @supported weapp, swan, alipay
|
|
24
|
-
* @
|
|
23
|
+
* @supported weapp, swan, alipay, h5
|
|
24
|
+
* @example_react
|
|
25
25
|
* ```tsx
|
|
26
|
+
* // js
|
|
26
27
|
* class App extends Components {
|
|
27
28
|
* render () {
|
|
28
29
|
* return (
|
|
30
|
+
* <View className='container'>
|
|
29
31
|
* <Video id='myVideo' src='src'>
|
|
30
32
|
* <CoverView className='controls'>
|
|
31
|
-
* <CoverView className='play' onClick=
|
|
33
|
+
* <CoverView className='play' onClick='play'>
|
|
32
34
|
* <CoverImage className='img' src='src' />
|
|
33
35
|
* </CoverView>
|
|
34
36
|
* </CoverView>
|
|
@@ -36,6 +38,46 @@ interface CoverImageProps extends StandardProps {
|
|
|
36
38
|
* )
|
|
37
39
|
* }
|
|
38
40
|
* }
|
|
41
|
+
* // css
|
|
42
|
+
* .container {
|
|
43
|
+
* position: relative;
|
|
44
|
+
* }
|
|
45
|
+
* .controls {
|
|
46
|
+
* position: absolute;
|
|
47
|
+
* top: 50%;
|
|
48
|
+
* left: 50%;
|
|
49
|
+
* width: 300px;
|
|
50
|
+
* height: 225px;
|
|
51
|
+
* transform: translate(-50%, -50%);
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
* @example_vue
|
|
55
|
+
* ```html
|
|
56
|
+
* <template>
|
|
57
|
+
* <view class="container">
|
|
58
|
+
* <video id='myvideo' src='https://ugccsy.qq.com/uwMROfz2r5zBIaQXGdGnC2dfDma3J1MItM3912IN4IRQvkRM/o31507f7lcd.mp4?sdtfrom=v1010&guid=aa18cf106b7fdb7e40f2d20b206f2b4f&vkey=63B0FCCC7FC3ADC342C166D86571AE02772258CD9B515B065DC68DF3919D8C288AE831D570ED5E8FE0FF3E81E170D04FF11F874BFDDACF7AAA2C0CFF2ACB39FB1A94DAD1AB859BDA53E4DD6DBCDC1217CEF789A9AC079924E2BBC599EED7A1FFDD60A727F2EB7E7B6472CE63DD4B683C9199DFC78A6A6C4D9891E05467C4B64E'>
|
|
59
|
+
* </video>
|
|
60
|
+
* <cover-view class='controls'>
|
|
61
|
+
* <cover-view class='play' `@tap='play'>
|
|
62
|
+
* <cover-image class='img' src='https://img10.360buyimg.com/ling/s345x208_jfs/t1/133501/7/9865/382161/5f5ee31fEbdd6a418/0cdc0156ffff3c23.png' />
|
|
63
|
+
* </cover-view>
|
|
64
|
+
* </cover-view>
|
|
65
|
+
* </view>
|
|
66
|
+
* </template>
|
|
67
|
+
*
|
|
68
|
+
* <style>
|
|
69
|
+
* .container {
|
|
70
|
+
* position: relative;
|
|
71
|
+
* }
|
|
72
|
+
* .controls {
|
|
73
|
+
* position: absolute;
|
|
74
|
+
* top: 50%;
|
|
75
|
+
* left: 50%;
|
|
76
|
+
* width: 300px;
|
|
77
|
+
* height: 225px;
|
|
78
|
+
* transform: translate(-50%, -50%);
|
|
79
|
+
* }
|
|
80
|
+
* </style>
|
|
39
81
|
* ```
|
|
40
82
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/cover-image.html
|
|
41
83
|
*/
|
package/types/CoverView.d.ts
CHANGED
|
@@ -21,22 +21,65 @@ interface CoverViewProps extends ViewProps {
|
|
|
21
21
|
|
|
22
22
|
/** 覆盖在原生组件之上的文本视图。可覆盖的原生组件包括 map、video、canvas、camera、live-player、live-pusher 只支持嵌套 cover-view、cover-image,可在 cover-view 中使用 button。
|
|
23
23
|
* @classification viewContainer
|
|
24
|
-
* @supported weapp, swan, alipay
|
|
25
|
-
* @
|
|
24
|
+
* @supported weapp, swan, alipay, h5
|
|
25
|
+
* @example_react
|
|
26
26
|
* ```tsx
|
|
27
|
+
* // js
|
|
27
28
|
* class App extends Components {
|
|
28
29
|
* render () {
|
|
29
30
|
* return (
|
|
30
|
-
* <
|
|
31
|
-
* <
|
|
32
|
-
* <CoverView className='
|
|
33
|
-
* <
|
|
31
|
+
* <View className='container'>
|
|
32
|
+
* <Video id='myVideo' src='src'>
|
|
33
|
+
* <CoverView className='controls'>
|
|
34
|
+
* <CoverView className='play' onClick='play'>
|
|
35
|
+
* <CoverImage className='img' src='src' />
|
|
36
|
+
* </CoverView>
|
|
34
37
|
* </CoverView>
|
|
35
|
-
* </
|
|
36
|
-
* </
|
|
38
|
+
* </Video>
|
|
39
|
+
* </View>
|
|
37
40
|
* )
|
|
38
41
|
* }
|
|
39
42
|
* }
|
|
43
|
+
* // css
|
|
44
|
+
* .container {
|
|
45
|
+
* position: relative;
|
|
46
|
+
* }
|
|
47
|
+
* .controls {
|
|
48
|
+
* position: absolute;
|
|
49
|
+
* top: 50%;
|
|
50
|
+
* left: 50%;
|
|
51
|
+
* width: 300px;
|
|
52
|
+
* height: 225px;
|
|
53
|
+
* transform: translate(-50%, -50%);
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
* @example_vue
|
|
57
|
+
* ```html
|
|
58
|
+
* <template>
|
|
59
|
+
* <view class="container">
|
|
60
|
+
* <video id='myvideo' src='https://ugccsy.qq.com/uwMROfz2r5zBIaQXGdGnC2dfDma3J1MItM3912IN4IRQvkRM/o31507f7lcd.mp4?sdtfrom=v1010&guid=aa18cf106b7fdb7e40f2d20b206f2b4f&vkey=63B0FCCC7FC3ADC342C166D86571AE02772258CD9B515B065DC68DF3919D8C288AE831D570ED5E8FE0FF3E81E170D04FF11F874BFDDACF7AAA2C0CFF2ACB39FB1A94DAD1AB859BDA53E4DD6DBCDC1217CEF789A9AC079924E2BBC599EED7A1FFDD60A727F2EB7E7B6472CE63DD4B683C9199DFC78A6A6C4D9891E05467C4B64E'>
|
|
61
|
+
* </video>
|
|
62
|
+
* <cover-view class='controls'>
|
|
63
|
+
* <cover-view class='play' `@tap='play'>
|
|
64
|
+
* <cover-image class='img' src='https://img10.360buyimg.com/ling/s345x208_jfs/t1/133501/7/9865/382161/5f5ee31fEbdd6a418/0cdc0156ffff3c23.png' />
|
|
65
|
+
* </cover-view>
|
|
66
|
+
* </cover-view>
|
|
67
|
+
* </view>
|
|
68
|
+
* </template>
|
|
69
|
+
*
|
|
70
|
+
* <style>
|
|
71
|
+
* .container {
|
|
72
|
+
* position: relative;
|
|
73
|
+
* }
|
|
74
|
+
* .controls {
|
|
75
|
+
* position: absolute;
|
|
76
|
+
* top: 50%;
|
|
77
|
+
* left: 50%;
|
|
78
|
+
* width: 300px;
|
|
79
|
+
* height: 225px;
|
|
80
|
+
* transform: translate(-50%, -50%);
|
|
81
|
+
* }
|
|
82
|
+
* </style>
|
|
40
83
|
* ```
|
|
41
84
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html
|
|
42
85
|
*/
|
package/types/Editor.d.ts
CHANGED
|
@@ -79,6 +79,63 @@ declare namespace EditorProps {
|
|
|
79
79
|
* *编辑器内支持部分 HTML 标签和内联样式,不支持 **class** 和 **id***
|
|
80
80
|
* @classification forms
|
|
81
81
|
* @supported weapp
|
|
82
|
+
* @example_react
|
|
83
|
+
* ```tsx
|
|
84
|
+
* class App extends Components {
|
|
85
|
+
* state = {
|
|
86
|
+
* placeholder: '来,输入隔壁的名字试试...'
|
|
87
|
+
* }
|
|
88
|
+
*
|
|
89
|
+
* editorReady = e => {
|
|
90
|
+
* Taro.createSelectorQuery().select('#editor').context((res) => {
|
|
91
|
+
* this.editorCtx = res.context
|
|
92
|
+
* }).exec()
|
|
93
|
+
* }
|
|
94
|
+
*
|
|
95
|
+
* undo = e => {
|
|
96
|
+
* this.editorCtx.undo()
|
|
97
|
+
* }
|
|
98
|
+
*
|
|
99
|
+
* render () {
|
|
100
|
+
* return (
|
|
101
|
+
* <View>
|
|
102
|
+
* <Editor id='editor' className='editor' placeholder={this.state.placeholder} onReady={this.editorReady}></Editor>
|
|
103
|
+
* <Button type='warn' onClick={this.undo}>撤销</Button>
|
|
104
|
+
* </View>
|
|
105
|
+
* )
|
|
106
|
+
* }
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
* @example_vue
|
|
110
|
+
* ```html
|
|
111
|
+
* <template>
|
|
112
|
+
* <view class="container">
|
|
113
|
+
* <editor id="editor" class="editor" :placeholder="placeholder" `@ready="editorReady"></editor>
|
|
114
|
+
* <button type="warn" `@tap="undo">撤销</button>
|
|
115
|
+
* </view>
|
|
116
|
+
* </template>
|
|
117
|
+
*
|
|
118
|
+
* <script>
|
|
119
|
+
* import Taro from '@tarojs/taro'
|
|
120
|
+
* export default {
|
|
121
|
+
* data() {
|
|
122
|
+
* return {
|
|
123
|
+
* placeholder: '来,输入隔壁的名字试试...'
|
|
124
|
+
* }
|
|
125
|
+
* },
|
|
126
|
+
* methods: {
|
|
127
|
+
* editorReady() {
|
|
128
|
+
* Taro.createSelectorQuery().select('#editor').context((res) => {
|
|
129
|
+
* this.editorCtx = res.context
|
|
130
|
+
* }).exec()
|
|
131
|
+
* },
|
|
132
|
+
* undo() {
|
|
133
|
+
* this.editorCtx.undo()
|
|
134
|
+
* }
|
|
135
|
+
* }
|
|
136
|
+
* }
|
|
137
|
+
* </script>
|
|
138
|
+
* ```
|
|
82
139
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/editor.html
|
|
83
140
|
*/
|
|
84
141
|
declare const Editor: ComponentType<EditorProps>
|