@tarojs/components 3.3.13 → 3.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-ad-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-ad-custom-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-cover-image-core.cjs.entry.js +17 -3
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +49 -3
- package/dist/cjs/taro-editor-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-functional-page-navigator-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-input-core.cjs.entry.js +4 -4
- package/dist/cjs/taro-keyboard-accessory-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-live-player-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-live-pusher-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-map-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-match-media-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-navigation-bar-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-navigator-core.cjs.entry.js +10 -6
- package/dist/cjs/taro-official-account-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-page-container-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-page-meta-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +7 -3
- package/dist/cjs/taro-share-element-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-slot-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-tabbar.cjs.entry.js +100 -46
- package/dist/cjs/taro-textarea-core.cjs.entry.js +63 -3
- package/dist/cjs/taro-voip-room-core.cjs.entry.js +19 -0
- package/dist/collection/collection-manifest.json +21 -5
- package/dist/collection/components/ad/ad.js +11 -0
- package/dist/collection/components/{cover-view/cover-image.js → ad-custom/ad-custom.js} +3 -3
- package/dist/collection/components/cover-image/cover-image.js +94 -0
- package/dist/collection/components/cover-image/style/index.css +5 -0
- package/dist/collection/components/cover-view/cover-view.js +166 -4
- package/dist/collection/components/cover-view/style/cover-view.css +3 -0
- package/dist/collection/components/editor/editor.js +11 -0
- package/dist/collection/components/functional-page-navigator/functional-page-navigator.js +11 -0
- package/dist/collection/components/input/input.js +4 -4
- package/dist/collection/components/keyboard-accessory/keyboard-accessory.js +11 -0
- package/dist/collection/components/live-player/live-player.js +11 -0
- package/dist/collection/components/live-pusher/live-pusher.js +11 -0
- package/dist/collection/components/map/map.js +11 -0
- package/dist/collection/components/match-media/match-media.js +11 -0
- package/dist/collection/components/{movable-view → movable-area}/movable-area.js +0 -0
- package/dist/collection/components/{movable-view → movable-area}/movable-view.js +0 -0
- package/dist/collection/components/navigation-bar/navigation-bar.js +11 -0
- package/dist/collection/components/navigator/navigator.js +1 -1
- package/dist/collection/components/official-account/official-account.js +11 -0
- package/dist/collection/components/page-container/page-container.js +11 -0
- package/dist/collection/components/page-meta/page-meta.js +11 -0
- package/dist/collection/components/{picker-view-column → picker-view}/picker-view-column.js +0 -0
- package/dist/collection/components/{pull-down-refresh → pull-to-refresh}/pull-to-refresh.js +1 -1
- package/dist/collection/components/{pull-down-refresh → pull-to-refresh}/style/index.css +0 -0
- package/dist/collection/components/share-element/share-element.js +11 -0
- package/dist/collection/components/slot/slot.js +11 -0
- package/dist/collection/components/tabbar/tabbar.js +82 -24
- package/dist/collection/components/textarea/style/index.css +6 -2
- package/dist/collection/components/textarea/textarea.js +98 -3
- package/dist/collection/components/voip-room/voip-room.js +11 -0
- package/dist/collection/utils/index.js +50 -64
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-ad-core.entry.js +15 -0
- package/dist/esm/taro-ad-custom-core.entry.js +15 -0
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-cover-image-core.entry.js +18 -4
- package/dist/esm/taro-cover-view-core.entry.js +50 -4
- package/dist/esm/taro-editor-core.entry.js +15 -0
- package/dist/esm/taro-functional-page-navigator-core.entry.js +15 -0
- package/dist/esm/taro-input-core.entry.js +4 -4
- package/dist/esm/taro-keyboard-accessory-core.entry.js +15 -0
- package/dist/esm/taro-live-player-core.entry.js +15 -0
- package/dist/esm/taro-live-pusher-core.entry.js +15 -0
- package/dist/esm/taro-map-core.entry.js +15 -0
- package/dist/esm/taro-match-media-core.entry.js +15 -0
- package/dist/esm/taro-navigation-bar-core.entry.js +15 -0
- package/dist/esm/taro-navigator-core.entry.js +1 -1
- package/dist/esm/taro-official-account-core.entry.js +15 -0
- package/dist/esm/taro-page-container-core.entry.js +15 -0
- package/dist/esm/taro-page-meta-core.entry.js +15 -0
- package/dist/esm/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm/taro-share-element-core.entry.js +15 -0
- package/dist/esm/taro-slot-core.entry.js +15 -0
- package/dist/esm/taro-tabbar.entry.js +79 -29
- package/dist/esm/taro-textarea-core.entry.js +63 -3
- package/dist/esm/taro-voip-room-core.entry.js +15 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-ad-core.entry.js +1 -0
- package/dist/esm-es5/taro-ad-custom-core.entry.js +1 -0
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-cover-image-core.entry.js +1 -1
- package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-editor-core.entry.js +1 -0
- package/dist/esm-es5/taro-functional-page-navigator-core.entry.js +1 -0
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-keyboard-accessory-core.entry.js +1 -0
- package/dist/esm-es5/taro-live-player-core.entry.js +1 -0
- package/dist/esm-es5/taro-live-pusher-core.entry.js +1 -0
- package/dist/esm-es5/taro-map-core.entry.js +1 -0
- package/dist/esm-es5/taro-match-media-core.entry.js +1 -0
- package/dist/esm-es5/taro-navigation-bar-core.entry.js +1 -0
- package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
- package/dist/esm-es5/taro-official-account-core.entry.js +1 -0
- package/dist/esm-es5/taro-page-container-core.entry.js +1 -0
- package/dist/esm-es5/taro-page-meta-core.entry.js +1 -0
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-share-element-core.entry.js +1 -0
- package/dist/esm-es5/taro-slot-core.entry.js +1 -0
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
- package/dist/esm-es5/taro-voip-room-core.entry.js +1 -0
- package/dist/taro-components/{p-70f40e3a.entry.js → p-02b84386.entry.js} +1 -1
- package/dist/taro-components/{p-af9ec312.system.entry.js → p-0a0377f6.system.entry.js} +1 -1
- package/dist/taro-components/p-14095f6b.system.entry.js +1 -0
- package/dist/taro-components/p-16d9e6b9.system.entry.js +1 -0
- package/dist/taro-components/p-1cc97957.entry.js +1 -0
- package/dist/taro-components/p-30bfacb9.system.js +1 -1
- package/dist/taro-components/p-33bcdee9.entry.js +1 -0
- package/dist/taro-components/p-37594e84.entry.js +1 -0
- package/dist/taro-components/p-39bee235.entry.js +1 -0
- package/dist/taro-components/p-3ed0783c.system.entry.js +1 -0
- package/dist/taro-components/p-4288566a.system.entry.js +1 -0
- package/dist/taro-components/p-432f803f.entry.js +1 -0
- package/dist/taro-components/p-4d643967.entry.js +1 -0
- package/dist/taro-components/p-52ef77b2.entry.js +1 -0
- package/dist/taro-components/p-53297f27.entry.js +1 -0
- package/dist/taro-components/p-5e20dff4.system.entry.js +1 -0
- package/dist/taro-components/p-60a15326.system.entry.js +1 -0
- package/dist/taro-components/p-6422a968.system.entry.js +1 -0
- package/dist/taro-components/p-79b3c05a.entry.js +1 -0
- package/dist/taro-components/p-81e1d9a3.system.entry.js +1 -0
- package/dist/taro-components/p-8235b7b7.system.entry.js +1 -0
- package/dist/taro-components/p-82741605.entry.js +1 -0
- package/dist/taro-components/p-8415cd92.entry.js +1 -0
- package/dist/taro-components/p-8f0e3f13.entry.js +1 -0
- package/dist/taro-components/p-9b9727c7.entry.js +1 -0
- package/dist/taro-components/p-9bd65170.system.entry.js +1 -0
- package/dist/taro-components/p-9e7a85ae.entry.js +1 -0
- package/dist/taro-components/p-a4fdb95b.system.entry.js +1 -0
- package/dist/taro-components/p-a5c0a7e3.entry.js +1 -0
- package/dist/taro-components/p-ab55aacd.system.entry.js +1 -0
- package/dist/taro-components/p-b3abedf8.entry.js +1 -0
- package/dist/taro-components/p-bc08a702.system.entry.js +1 -0
- package/dist/taro-components/p-becfab60.system.entry.js +1 -0
- package/dist/taro-components/p-c7cfcb8e.entry.js +1 -0
- package/dist/taro-components/p-cb8099dd.entry.js +1 -0
- package/dist/taro-components/p-cdf144cb.system.entry.js +1 -0
- package/dist/taro-components/p-d8363f59.system.entry.js +1 -0
- package/dist/taro-components/{p-2ef4681b.system.entry.js → p-d9494012.system.entry.js} +1 -1
- package/dist/taro-components/p-dfe76645.entry.js +1 -0
- package/dist/taro-components/p-e1e289bb.entry.js +1 -0
- package/dist/taro-components/p-e42b782e.system.entry.js +1 -0
- package/dist/taro-components/p-ed3ff1e4.entry.js +1 -0
- package/dist/taro-components/p-effd64d5.system.entry.js +1 -0
- package/dist/taro-components/p-f05422a6.entry.js +1 -0
- package/dist/taro-components/p-f70b6a12.system.entry.js +1 -0
- package/dist/taro-components/p-f928a72e.system.entry.js +1 -0
- package/dist/taro-components/p-fac09a5c.system.entry.js +1 -0
- package/dist/taro-components/taro-components.css +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/ad/ad.d.ts +4 -0
- package/dist/types/components/{cover-view/cover-image.d.ts → ad-custom/ad-custom.d.ts} +1 -1
- package/dist/types/components/cover-image/cover-image.d.ts +11 -0
- package/dist/types/components/cover-view/cover-view.d.ts +14 -2
- package/dist/types/components/editor/editor.d.ts +4 -0
- package/dist/types/components/functional-page-navigator/functional-page-navigator.d.ts +4 -0
- package/dist/types/components/keyboard-accessory/keyboard-accessory.d.ts +4 -0
- package/dist/types/components/live-player/live-player.d.ts +4 -0
- package/dist/types/components/live-pusher/live-pusher.d.ts +4 -0
- package/dist/types/components/map/map.d.ts +4 -0
- package/dist/types/components/match-media/match-media.d.ts +4 -0
- package/dist/types/components/{movable-view → movable-area}/movable-area.d.ts +0 -0
- package/dist/types/components/{movable-view → movable-area}/movable-view.d.ts +0 -0
- package/dist/types/components/navigation-bar/navigation-bar.d.ts +4 -0
- package/dist/types/components/official-account/official-account.d.ts +4 -0
- package/dist/types/components/page-container/page-container.d.ts +4 -0
- package/dist/types/components/page-meta/page-meta.d.ts +4 -0
- package/dist/types/components/{picker-view-column → picker-view}/picker-view-column.d.ts +0 -0
- package/dist/types/components/{pull-down-refresh → pull-to-refresh}/pull-to-refresh.d.ts +0 -0
- package/dist/types/components/share-element/share-element.d.ts +4 -0
- package/dist/types/components/slot/slot.d.ts +4 -0
- package/dist/types/components/tabbar/tabbar.d.ts +21 -2
- package/dist/types/components/textarea/textarea.d.ts +6 -0
- package/dist/types/components/voip-room/voip-room.d.ts +4 -0
- package/dist/types/components.d.ts +226 -0
- package/dist/types/utils/index.d.ts +8 -0
- package/dist-h5/react/index.js +2 -1
- package/dist-h5/vue/createComponent.js +4 -0
- package/dist-h5/vue/createFormsComponent.js +8 -1
- package/dist-h5/vue/simpleComponents.js +1 -1
- package/package.json +4 -4
- package/types/Ad.d.ts +6 -6
- package/types/AdCustom.d.ts +50 -0
- package/types/Button.d.ts +2 -2
- package/types/CoverImage.d.ts +3 -3
- package/types/CoverView.d.ts +3 -3
- package/types/Image.d.ts +8 -2
- package/types/KeyboardAccessory.d.ts +29 -0
- package/types/PageContainer.d.ts +115 -0
- package/types/ShareElement.d.ts +39 -0
- package/types/VoipRoom.d.ts +71 -0
- package/types/index.d.ts +72 -46
- package/virtual-list/react/createListComponent.js +4 -3
- package/dist/taro-components/p-2c5d57af.entry.js +0 -1
- package/dist/taro-components/p-382cabbc.system.entry.js +0 -1
- package/dist/taro-components/p-4ff67760.entry.js +0 -1
- package/dist/taro-components/p-5d84eaf0.entry.js +0 -1
- package/dist/taro-components/p-69be8189.system.entry.js +0 -1
- package/dist/taro-components/p-b685a487.system.entry.js +0 -1
- package/dist/taro-components/p-b6e0dca6.entry.js +0 -1
- package/dist/taro-components/p-c221cebb.system.entry.js +0 -1
- package/dist/taro-components/p-c5722042.entry.js +0 -1
- package/dist/taro-components/p-f8d0dabb.entry.js +0 -1
- package/dist/taro-components/p-f9013b36.system.entry.js +0 -1
|
@@ -1,11 +1,173 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
-
import { Component, h, Host } from '@stencil/core';
|
|
2
|
+
import { Component, Prop, h, Host, Listen, State, Event } from '@stencil/core';
|
|
3
|
+
import classNames from 'classnames';
|
|
3
4
|
export class CoverView {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
constructor() {
|
|
6
|
+
this.hoverStartTime = 50;
|
|
7
|
+
this.hoverStayTime = 400;
|
|
8
|
+
this.hover = false;
|
|
9
|
+
this.touch = false;
|
|
10
|
+
this.startTime = 0;
|
|
11
|
+
}
|
|
12
|
+
onTouchStart() {
|
|
13
|
+
if (this.hoverClass) {
|
|
14
|
+
this.touch = true;
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
if (this.touch) {
|
|
17
|
+
this.hover = true;
|
|
18
|
+
}
|
|
19
|
+
}, this.hoverStartTime);
|
|
20
|
+
}
|
|
21
|
+
this.timeoutEvent = setTimeout(() => {
|
|
22
|
+
this.onLongPress.emit();
|
|
23
|
+
}, 350);
|
|
24
|
+
this.startTime = Date.now();
|
|
25
|
+
}
|
|
26
|
+
onTouchMove() {
|
|
27
|
+
clearTimeout(this.timeoutEvent);
|
|
28
|
+
}
|
|
29
|
+
onTouchEnd() {
|
|
30
|
+
const spanTime = Date.now() - this.startTime;
|
|
31
|
+
if (spanTime < 350) {
|
|
32
|
+
clearTimeout(this.timeoutEvent);
|
|
33
|
+
}
|
|
34
|
+
if (this.hoverClass) {
|
|
35
|
+
this.touch = false;
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
if (!this.touch) {
|
|
38
|
+
this.hover = false;
|
|
39
|
+
}
|
|
40
|
+
}, this.hoverStayTime);
|
|
41
|
+
}
|
|
6
42
|
}
|
|
7
43
|
render() {
|
|
8
|
-
|
|
44
|
+
const cls = classNames({
|
|
45
|
+
[`${this.hoverClass}`]: this.hover
|
|
46
|
+
});
|
|
47
|
+
let attr = {};
|
|
48
|
+
if (!!this.animation) {
|
|
49
|
+
attr['animation'] = this.animation;
|
|
50
|
+
attr['data-animation'] = this.animation;
|
|
51
|
+
}
|
|
52
|
+
return (h(Host, Object.assign({ class: cls }, attr),
|
|
53
|
+
h("slot", null)));
|
|
9
54
|
}
|
|
10
55
|
static get is() { return "taro-cover-view-core"; }
|
|
56
|
+
static get originalStyleUrls() { return {
|
|
57
|
+
"$": ["./style/cover-view.scss"]
|
|
58
|
+
}; }
|
|
59
|
+
static get styleUrls() { return {
|
|
60
|
+
"$": ["./style/cover-view.css"]
|
|
61
|
+
}; }
|
|
62
|
+
static get properties() { return {
|
|
63
|
+
"animation": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"mutable": false,
|
|
66
|
+
"complexType": {
|
|
67
|
+
"original": "string",
|
|
68
|
+
"resolved": "string",
|
|
69
|
+
"references": {}
|
|
70
|
+
},
|
|
71
|
+
"required": false,
|
|
72
|
+
"optional": false,
|
|
73
|
+
"docs": {
|
|
74
|
+
"tags": [],
|
|
75
|
+
"text": ""
|
|
76
|
+
},
|
|
77
|
+
"attribute": "animation",
|
|
78
|
+
"reflect": false
|
|
79
|
+
},
|
|
80
|
+
"hoverClass": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "string",
|
|
85
|
+
"resolved": "string",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": ""
|
|
93
|
+
},
|
|
94
|
+
"attribute": "hover-class",
|
|
95
|
+
"reflect": false
|
|
96
|
+
},
|
|
97
|
+
"hoverStartTime": {
|
|
98
|
+
"type": "number",
|
|
99
|
+
"mutable": false,
|
|
100
|
+
"complexType": {
|
|
101
|
+
"original": "number",
|
|
102
|
+
"resolved": "number",
|
|
103
|
+
"references": {}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": ""
|
|
110
|
+
},
|
|
111
|
+
"attribute": "hover-start-time",
|
|
112
|
+
"reflect": false,
|
|
113
|
+
"defaultValue": "50"
|
|
114
|
+
},
|
|
115
|
+
"hoverStayTime": {
|
|
116
|
+
"type": "number",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "number",
|
|
120
|
+
"resolved": "number",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": ""
|
|
128
|
+
},
|
|
129
|
+
"attribute": "hover-stay-time",
|
|
130
|
+
"reflect": false,
|
|
131
|
+
"defaultValue": "400"
|
|
132
|
+
}
|
|
133
|
+
}; }
|
|
134
|
+
static get states() { return {
|
|
135
|
+
"hover": {},
|
|
136
|
+
"touch": {}
|
|
137
|
+
}; }
|
|
138
|
+
static get events() { return [{
|
|
139
|
+
"method": "onLongPress",
|
|
140
|
+
"name": "longpress",
|
|
141
|
+
"bubbles": true,
|
|
142
|
+
"cancelable": true,
|
|
143
|
+
"composed": true,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": ""
|
|
147
|
+
},
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "any",
|
|
150
|
+
"resolved": "any",
|
|
151
|
+
"references": {}
|
|
152
|
+
}
|
|
153
|
+
}]; }
|
|
154
|
+
static get listeners() { return [{
|
|
155
|
+
"name": "touchstart",
|
|
156
|
+
"method": "onTouchStart",
|
|
157
|
+
"target": undefined,
|
|
158
|
+
"capture": false,
|
|
159
|
+
"passive": true
|
|
160
|
+
}, {
|
|
161
|
+
"name": "touchmove",
|
|
162
|
+
"method": "onTouchMove",
|
|
163
|
+
"target": undefined,
|
|
164
|
+
"capture": false,
|
|
165
|
+
"passive": true
|
|
166
|
+
}, {
|
|
167
|
+
"name": "touchend",
|
|
168
|
+
"method": "onTouchEnd",
|
|
169
|
+
"target": undefined,
|
|
170
|
+
"capture": false,
|
|
171
|
+
"passive": true
|
|
172
|
+
}]; }
|
|
11
173
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class Editor {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 Editor 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-editor-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class FunctionalPageNavigator {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 FunctionalPageNavigator 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-functional-page-navigator-core"; }
|
|
11
|
+
}
|
|
@@ -112,7 +112,7 @@ export class Input {
|
|
|
112
112
|
this._value = this.value;
|
|
113
113
|
}
|
|
114
114
|
componentDidLoad() {
|
|
115
|
-
var _a, _b, _c;
|
|
115
|
+
var _a, _b, _c, _d;
|
|
116
116
|
if (this.type === 'file') {
|
|
117
117
|
this.fileListener = () => {
|
|
118
118
|
this.onInput.emit();
|
|
@@ -130,6 +130,7 @@ export class Input {
|
|
|
130
130
|
},
|
|
131
131
|
configurable: true
|
|
132
132
|
});
|
|
133
|
+
this.autoFocus && ((_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.focus());
|
|
133
134
|
}
|
|
134
135
|
disconnectedCallback() {
|
|
135
136
|
var _a;
|
|
@@ -138,11 +139,10 @@ export class Input {
|
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
render() {
|
|
141
|
-
const { _value, type, password, placeholder, disabled, maxlength,
|
|
142
|
+
const { _value, type, password, placeholder, disabled, maxlength, confirmType, name, nativeProps } = this;
|
|
142
143
|
return (h("input", Object.assign({ ref: input => {
|
|
143
144
|
this.inputRef = input;
|
|
144
|
-
|
|
145
|
-
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, disabled: disabled, maxlength: maxlength, autofocus: autoFocus, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
|
|
145
|
+
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
|
|
146
146
|
}
|
|
147
147
|
static get is() { return "taro-input-core"; }
|
|
148
148
|
static get originalStyleUrls() { return {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class KeyboardAccessory {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 KeyboardAccessory 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-keyboard-accessory-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class LivePlayer {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 LivePlayer 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-live-player-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class LivePusher {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 LivePusher 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-live-pusher-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class Map {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 Map 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-map-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class MatchMedia {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 MatchMedia 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-match-media-core"; }
|
|
11
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class NavigationBar {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 NavigationBar 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-navigation-bar-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class OfficialAccount {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 OfficialAccount 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-official-account-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class PageContainer {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 PageContainer 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-page-container-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class PageMeta {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 PageMeta 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-page-meta-core"; }
|
|
11
|
+
}
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, Prop, h, Host, State, Event, Watch, Element } from '@stencil/core';
|
|
2
|
+
import Taro from '@tarojs/taro';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
|
-
const Taro = require('@tarojs/taro');
|
|
4
4
|
function setTransform(nodeStyle, value) {
|
|
5
5
|
nodeStyle.transform = value;
|
|
6
6
|
nodeStyle.webkitTransform = value;
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class ShareElement {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 ShareElement 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-share-element-core"; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Component, h, Host } from '@stencil/core';
|
|
3
|
+
export class Slot {
|
|
4
|
+
componentDidLoad() {
|
|
5
|
+
console.error('H5 暂不支持 Slot 组件!');
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "taro-slot-core"; }
|
|
11
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Component, Prop, h, Host, State, Event, Element } from '@stencil/core';
|
|
2
|
+
import Taro from '@tarojs/taro';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import resolvePathname from 'resolve-pathname';
|
|
4
5
|
import { splitUrl } from '../../utils';
|
|
5
6
|
import { TabbarItem } from './tabbar-item';
|
|
6
|
-
// IGNORE: 由于 @tarojs/taro 与 @tarojs/components 中存在循环依赖,暂时使用 commonjs 引用
|
|
7
|
-
const Taro = require('@tarojs/taro');
|
|
8
7
|
// const removeLeadingSlash = str => str.replace(/^\.?\//, '')
|
|
9
8
|
// const removeTrailingSearch = str => str.replace(/\?[\s\S]*$/, '')
|
|
10
9
|
const addLeadingSlash = str => str[0] === '/' ? str : `/${str}`;
|
|
@@ -25,18 +24,18 @@ export class Tabbar {
|
|
|
25
24
|
this.status = STATUS_SHOW;
|
|
26
25
|
this.getOriginUrl = (url) => {
|
|
27
26
|
const customRoute = this.customRoutes.filter(([, customUrl]) => {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
return
|
|
27
|
+
const pathA = splitUrl(customUrl).path;
|
|
28
|
+
const pathB = splitUrl(url).path;
|
|
29
|
+
return pathA === pathB;
|
|
31
30
|
});
|
|
32
31
|
return customRoute.length ? customRoute[0][0] : url;
|
|
33
32
|
};
|
|
34
33
|
this.getSelectedIndex = (url) => {
|
|
35
34
|
let foundIndex = -1;
|
|
36
35
|
this.list.forEach(({ pagePath }, idx) => {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
36
|
+
const pathA = splitUrl(url).path;
|
|
37
|
+
const pathB = splitUrl(pagePath).path;
|
|
38
|
+
if (pathA === pathB) {
|
|
40
39
|
foundIndex = idx;
|
|
41
40
|
}
|
|
42
41
|
});
|
|
@@ -79,23 +78,27 @@ export class Tabbar {
|
|
|
79
78
|
}
|
|
80
79
|
this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage));
|
|
81
80
|
};
|
|
82
|
-
this.setTabBarBadgeHandler = ({ index, text, errorHandler }) => {
|
|
83
|
-
const list = this.list;
|
|
81
|
+
this.setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }) => {
|
|
82
|
+
const list = [...this.list];
|
|
84
83
|
if (index in list) {
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
list[index].showRedDot = false;
|
|
85
|
+
list[index].badgeText = text;
|
|
86
|
+
successHandler({
|
|
87
|
+
errMsg: 'setTabBarBadge:ok'
|
|
88
|
+
});
|
|
87
89
|
}
|
|
88
90
|
else {
|
|
89
91
|
errorHandler({
|
|
90
92
|
errMsg: 'setTabBarBadge:fail tabbar item not found'
|
|
91
93
|
});
|
|
92
94
|
}
|
|
95
|
+
this.list = list;
|
|
93
96
|
};
|
|
94
97
|
this.removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }) => {
|
|
95
|
-
const list = this.list;
|
|
98
|
+
const list = [...this.list];
|
|
96
99
|
if (index in list) {
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
list[index].badgeText = null;
|
|
101
|
+
list[index].badgeText = null;
|
|
99
102
|
successHandler({
|
|
100
103
|
errMsg: 'removeTabBarBadge:ok'
|
|
101
104
|
});
|
|
@@ -105,9 +108,10 @@ export class Tabbar {
|
|
|
105
108
|
errMsg: 'removeTabBarBadge:fail tabbar item not found'
|
|
106
109
|
});
|
|
107
110
|
}
|
|
111
|
+
this.list = list;
|
|
108
112
|
};
|
|
109
113
|
this.showTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
|
|
110
|
-
const list = this.list;
|
|
114
|
+
const list = [...this.list];
|
|
111
115
|
if (index in list) {
|
|
112
116
|
list[index].badgeText = null;
|
|
113
117
|
list[index].showRedDot = true;
|
|
@@ -120,9 +124,10 @@ export class Tabbar {
|
|
|
120
124
|
errMsg: 'showTabBarRedDot:fail tabbar item not found'
|
|
121
125
|
});
|
|
122
126
|
}
|
|
127
|
+
this.list = list;
|
|
123
128
|
};
|
|
124
129
|
this.hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
|
|
125
|
-
const list = this.list;
|
|
130
|
+
const list = [...this.list];
|
|
126
131
|
if (index in list) {
|
|
127
132
|
list[index].showRedDot = false;
|
|
128
133
|
successHandler({
|
|
@@ -134,6 +139,7 @@ export class Tabbar {
|
|
|
134
139
|
errMsg: 'hideTabBarRedDot:fail tabbar item not found'
|
|
135
140
|
});
|
|
136
141
|
}
|
|
142
|
+
this.list = list;
|
|
137
143
|
};
|
|
138
144
|
this.showTabBarHandler = ({ successHandler }) => {
|
|
139
145
|
this.status = STATUS_SHOW;
|
|
@@ -147,6 +153,39 @@ export class Tabbar {
|
|
|
147
153
|
errMsg: 'hideTabBar:ok'
|
|
148
154
|
});
|
|
149
155
|
};
|
|
156
|
+
this.setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {
|
|
157
|
+
if (backgroundColor)
|
|
158
|
+
this.backgroundColor = backgroundColor;
|
|
159
|
+
if (borderStyle)
|
|
160
|
+
this.borderStyle = borderStyle;
|
|
161
|
+
if (color)
|
|
162
|
+
this.color = color;
|
|
163
|
+
if (selectedColor)
|
|
164
|
+
this.selectedColor = selectedColor;
|
|
165
|
+
successHandler({
|
|
166
|
+
errMsg: 'setTabBarStyle:ok'
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
this.setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {
|
|
170
|
+
const list = [...this.list];
|
|
171
|
+
if (index in list) {
|
|
172
|
+
if (iconPath)
|
|
173
|
+
list[index].iconPath = iconPath;
|
|
174
|
+
if (selectedIconPath)
|
|
175
|
+
list[index].selectedIconPath = selectedIconPath;
|
|
176
|
+
if (text)
|
|
177
|
+
list[index].text = text;
|
|
178
|
+
successHandler({
|
|
179
|
+
errMsg: 'setTabBarItem:ok'
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
errorHandler({
|
|
184
|
+
errMsg: 'setTabBarItem:fail tabbar item not found'
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
this.list = list;
|
|
188
|
+
};
|
|
150
189
|
const list = this.conf.list;
|
|
151
190
|
const customRoutes = this.conf.customRoutes;
|
|
152
191
|
if (Object.prototype.toString.call(list) !== '[object Array]' ||
|
|
@@ -155,8 +194,15 @@ export class Tabbar {
|
|
|
155
194
|
throw new Error('tabBar 配置错误');
|
|
156
195
|
}
|
|
157
196
|
this.homePage = addLeadingSlash(this.conf.homePage);
|
|
158
|
-
for (
|
|
159
|
-
|
|
197
|
+
for (let key in customRoutes) {
|
|
198
|
+
const path = customRoutes[key];
|
|
199
|
+
key = addLeadingSlash(key);
|
|
200
|
+
if (typeof path === 'string') {
|
|
201
|
+
this.customRoutes.push([key, addLeadingSlash(path)]);
|
|
202
|
+
}
|
|
203
|
+
else if ((path === null || path === void 0 ? void 0 : path.length) > 0) {
|
|
204
|
+
this.customRoutes.push(...path.map(p => [key, addLeadingSlash(p)]));
|
|
205
|
+
}
|
|
160
206
|
}
|
|
161
207
|
list.forEach(item => {
|
|
162
208
|
if (item.pagePath.indexOf('/') !== 0) {
|
|
@@ -164,6 +210,10 @@ export class Tabbar {
|
|
|
164
210
|
}
|
|
165
211
|
});
|
|
166
212
|
this.list = list;
|
|
213
|
+
this.borderStyle = this.conf.borderStyle;
|
|
214
|
+
this.backgroundColor = this.conf.backgroundColor;
|
|
215
|
+
this.color = this.conf.color;
|
|
216
|
+
this.selectedColor = this.conf.selectedColor;
|
|
167
217
|
}
|
|
168
218
|
getCurrentUrl() {
|
|
169
219
|
const routerMode = this.conf.mode;
|
|
@@ -191,6 +241,8 @@ export class Tabbar {
|
|
|
191
241
|
Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
|
|
192
242
|
Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler);
|
|
193
243
|
Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler);
|
|
244
|
+
Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler);
|
|
245
|
+
Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler);
|
|
194
246
|
}
|
|
195
247
|
removeEvent() {
|
|
196
248
|
Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler);
|
|
@@ -201,6 +253,8 @@ export class Tabbar {
|
|
|
201
253
|
Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
|
|
202
254
|
Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler);
|
|
203
255
|
Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler);
|
|
256
|
+
Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler);
|
|
257
|
+
Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler);
|
|
204
258
|
}
|
|
205
259
|
componentDidLoad() {
|
|
206
260
|
this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom';
|
|
@@ -211,10 +265,10 @@ export class Tabbar {
|
|
|
211
265
|
this.removeEvent();
|
|
212
266
|
}
|
|
213
267
|
render() {
|
|
214
|
-
const {
|
|
268
|
+
const { tabbarPos = 'bottom' } = this;
|
|
215
269
|
const status = this.status;
|
|
216
270
|
const containerCls = classNames('weui-tabbar', {
|
|
217
|
-
[`taro-tabbar__border-${
|
|
271
|
+
[`taro-tabbar__border-${this.borderStyle || 'black'}`]: true
|
|
218
272
|
});
|
|
219
273
|
const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE;
|
|
220
274
|
const shouldSlideout = status === STATUS_SLIDEOUT;
|
|
@@ -223,17 +277,17 @@ export class Tabbar {
|
|
|
223
277
|
[hideTabBarWithAnimationClassName]: shouldSlideout
|
|
224
278
|
}) },
|
|
225
279
|
h("div", { class: containerCls, style: {
|
|
226
|
-
backgroundColor:
|
|
280
|
+
backgroundColor: this.backgroundColor || ''
|
|
227
281
|
} }, this.list.map((item, index) => {
|
|
228
282
|
const isSelected = this.selectedIndex === index;
|
|
229
283
|
let textColor;
|
|
230
284
|
let iconPath;
|
|
231
285
|
if (isSelected) {
|
|
232
|
-
textColor =
|
|
286
|
+
textColor = this.selectedColor || '';
|
|
233
287
|
iconPath = item.selectedIconPath;
|
|
234
288
|
}
|
|
235
289
|
else {
|
|
236
|
-
textColor =
|
|
290
|
+
textColor = this.color || '';
|
|
237
291
|
iconPath = item.iconPath;
|
|
238
292
|
}
|
|
239
293
|
return (h(TabbarItem, { index: index, onSelect: this.switchTab.bind(this), isSelected: isSelected, textColor: textColor, iconPath: iconPath, text: item.text, badgeText: item.badgeText, showRedDot: item.showRedDot }));
|
|
@@ -269,6 +323,10 @@ export class Tabbar {
|
|
|
269
323
|
}; }
|
|
270
324
|
static get states() { return {
|
|
271
325
|
"list": {},
|
|
326
|
+
"borderStyle": {},
|
|
327
|
+
"backgroundColor": {},
|
|
328
|
+
"color": {},
|
|
329
|
+
"selectedColor": {},
|
|
272
330
|
"selectedIndex": {},
|
|
273
331
|
"status": {}
|
|
274
332
|
}; }
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
taro-textarea-core {
|
|
2
2
|
display: block;
|
|
3
3
|
width: 300px;
|
|
4
|
-
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
taro-textarea-core .auto-height {
|
|
7
|
+
height: auto;
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
.taro-textarea {
|
|
8
11
|
-webkit-appearance: none;
|
|
9
12
|
cursor: auto;
|
|
10
13
|
width: 100%;
|
|
11
|
-
height:
|
|
14
|
+
height: 150px;
|
|
12
15
|
border: 0;
|
|
13
16
|
display: block;
|
|
14
17
|
position: relative;
|
|
18
|
+
line-height: 1.5;
|
|
15
19
|
}
|
|
16
20
|
.taro-textarea:focus {
|
|
17
21
|
outline: none;
|