@tarojs/components 3.3.11 → 3.3.15
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/{index-eefce54e.js → index-7464647f.js} +156 -101
- package/dist/cjs/{index-cf56824f.js → index-cde74e58.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/taro-audio-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-block-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-button-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-camera-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-canvas-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +6 -5
- package/dist/cjs/taro-components.cjs.js +5 -5
- package/dist/cjs/taro-cover-image-core.cjs.entry.js +19 -5
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +51 -5
- package/dist/cjs/taro-custom-wrapper-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-form-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-icon-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-image-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-input-core.cjs.entry.js +21 -13
- package/dist/cjs/taro-label-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-movable-area-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-movable-view-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-navigator-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-open-data-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +37 -12
- package/dist/cjs/taro-picker-view-column-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-picker-view-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-progress-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +3 -3
- package/dist/cjs/taro-radio-core_2.cjs.entry.js +3 -3
- package/dist/cjs/taro-rich-text-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-slider-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +112 -106
- package/dist/cjs/taro-switch-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-tabbar.cjs.entry.js +71 -27
- package/dist/cjs/taro-text-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-textarea-core.cjs.entry.js +65 -5
- package/dist/cjs/taro-video-control_3.cjs.entry.js +5 -5
- package/dist/cjs/taro-view-core.cjs.entry.js +11 -3
- package/dist/cjs/taro-web-view-core.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/checkbox/checkbox.js +21 -2
- 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/input/input.js +19 -11
- package/dist/collection/components/picker/picker-group.js +59 -9
- package/dist/collection/components/swiper/swiper.js +7 -1
- package/dist/collection/components/tabbar/tabbar.js +72 -24
- package/dist/collection/components/textarea/style/index.css +6 -2
- package/dist/collection/components/textarea/textarea.js +98 -3
- package/dist/collection/components/view/view.js +9 -1
- package/dist/esm/{index-310de3d5.js → index-165a6222.js} +156 -101
- package/dist/esm/{index-ff1b322a.js → index-85e10859.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/taro-audio-core.entry.js +2 -2
- package/dist/esm/taro-block-core.entry.js +2 -2
- package/dist/esm/taro-button-core.entry.js +3 -3
- package/dist/esm/taro-camera-core.entry.js +2 -2
- package/dist/esm/taro-canvas-core.entry.js +2 -2
- package/dist/esm/taro-checkbox-core_2.entry.js +6 -5
- package/dist/esm/taro-components.js +5 -5
- package/dist/esm/taro-cover-image-core.entry.js +19 -5
- package/dist/esm/taro-cover-view-core.entry.js +51 -5
- package/dist/esm/taro-custom-wrapper-core.entry.js +2 -2
- package/dist/esm/taro-form-core.entry.js +2 -2
- package/dist/esm/taro-icon-core.entry.js +3 -3
- package/dist/esm/taro-image-core.entry.js +3 -3
- package/dist/esm/taro-input-core.entry.js +21 -13
- package/dist/esm/taro-label-core.entry.js +2 -2
- package/dist/esm/taro-movable-area-core.entry.js +2 -2
- package/dist/esm/taro-movable-view-core.entry.js +2 -2
- package/dist/esm/taro-navigator-core.entry.js +3 -3
- package/dist/esm/taro-open-data-core.entry.js +2 -2
- package/dist/esm/taro-picker-core_2.entry.js +37 -12
- package/dist/esm/taro-picker-view-column-core.entry.js +2 -2
- package/dist/esm/taro-picker-view-core.entry.js +2 -2
- package/dist/esm/taro-progress-core.entry.js +2 -2
- package/dist/esm/taro-pull-to-refresh.entry.js +3 -3
- package/dist/esm/taro-radio-core_2.entry.js +3 -3
- package/dist/esm/taro-rich-text-core.entry.js +2 -2
- package/dist/esm/taro-scroll-view-core.entry.js +3 -3
- package/dist/esm/taro-slider-core.entry.js +2 -2
- package/dist/esm/taro-swiper-core_2.entry.js +112 -106
- package/dist/esm/taro-switch-core.entry.js +2 -2
- package/dist/esm/taro-tabbar.entry.js +71 -27
- package/dist/esm/taro-text-core.entry.js +3 -3
- package/dist/esm/taro-textarea-core.entry.js +65 -5
- package/dist/esm/taro-video-control_3.entry.js +5 -5
- package/dist/esm/taro-view-core.entry.js +11 -3
- package/dist/esm/taro-web-view-core.entry.js +2 -2
- package/dist/esm-es5/index-165a6222.js +1 -0
- package/dist/esm-es5/{index-ff1b322a.js → index-85e10859.js} +0 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-audio-core.entry.js +1 -1
- package/dist/esm-es5/taro-block-core.entry.js +1 -1
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-camera-core.entry.js +1 -1
- package/dist/esm-es5/taro-canvas-core.entry.js +1 -1
- package/dist/esm-es5/taro-checkbox-core_2.entry.js +1 -1
- 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-custom-wrapper-core.entry.js +1 -1
- package/dist/esm-es5/taro-form-core.entry.js +1 -1
- package/dist/esm-es5/taro-icon-core.entry.js +1 -1
- package/dist/esm-es5/taro-image-core.entry.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-label-core.entry.js +1 -1
- package/dist/esm-es5/taro-movable-area-core.entry.js +1 -1
- package/dist/esm-es5/taro-movable-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
- package/dist/esm-es5/taro-open-data-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-picker-view-column-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-progress-core.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-radio-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-slider-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-switch-core.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
- package/dist/esm-es5/taro-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-web-view-core.entry.js +1 -1
- package/dist/taro-components/{p-8eb84de2.system.entry.js → p-00328ebf.system.entry.js} +1 -1
- package/dist/taro-components/p-016f56cc.system.entry.js +1 -0
- package/dist/taro-components/{p-15121391.system.entry.js → p-098f4931.system.entry.js} +1 -1
- package/dist/taro-components/p-0da88b1b.entry.js +1 -0
- package/dist/taro-components/p-0fb7f599.entry.js +1 -0
- package/dist/taro-components/p-139d4d14.entry.js +1 -0
- package/dist/taro-components/p-1507bcbf.entry.js +1 -0
- package/dist/taro-components/p-17c0731f.entry.js +1 -0
- package/dist/taro-components/{p-9a4123eb.system.entry.js → p-1ed219a6.system.entry.js} +1 -1
- package/dist/taro-components/p-26c08f44.entry.js +1 -0
- package/dist/taro-components/{p-502841e0.system.entry.js → p-26d8c60a.system.entry.js} +1 -1
- package/dist/taro-components/{p-970ed6da.system.entry.js → p-2b6a2449.system.entry.js} +1 -1
- package/dist/taro-components/{p-239bf0ca.system.entry.js → p-2ce9bc65.system.entry.js} +1 -1
- package/dist/taro-components/{p-1f2dfaef.system.entry.js → p-2de1a146.system.entry.js} +1 -1
- package/dist/taro-components/{p-a079321f.system.entry.js → p-2eda9121.system.entry.js} +1 -1
- package/dist/taro-components/p-30bfacb9.system.js +1 -0
- package/dist/taro-components/{p-921a765a.system.entry.js → p-321aeeec.system.entry.js} +1 -1
- package/dist/taro-components/p-33bcdee9.entry.js +1 -0
- package/dist/taro-components/p-3554df41.entry.js +1 -0
- package/dist/taro-components/p-37cfef64.entry.js +1 -0
- package/dist/taro-components/p-39bee235.entry.js +1 -0
- package/dist/taro-components/p-3e2d4793.entry.js +1 -0
- package/dist/taro-components/{p-e15654c4.system.entry.js → p-4168e24d.system.entry.js} +1 -1
- package/dist/taro-components/{p-236774f0.system.entry.js → p-4462dca4.system.entry.js} +1 -1
- package/dist/taro-components/{p-30c0639e.js → p-49ae5efb.js} +1 -1
- package/dist/taro-components/p-4a2ffc1c.entry.js +1 -0
- package/dist/taro-components/p-4ff67760.entry.js +1 -0
- package/dist/taro-components/p-5412a1d2.system.entry.js +1 -0
- package/dist/taro-components/{p-9242dcf7.system.entry.js → p-5a13bd63.system.entry.js} +1 -1
- package/dist/taro-components/{p-aed3d0e9.system.entry.js → p-5c8ba192.system.entry.js} +1 -1
- package/dist/taro-components/p-5d84eaf0.entry.js +1 -0
- package/dist/taro-components/{p-318795b9.system.entry.js → p-5e6feca6.system.entry.js} +1 -1
- package/dist/taro-components/{p-625158f0.js → p-6967e577.js} +0 -0
- package/dist/taro-components/{p-bd00f506.system.js → p-696f0d1c.system.js} +0 -0
- package/dist/taro-components/{p-d402dc94.system.entry.js → p-69be8189.system.entry.js} +1 -1
- package/dist/taro-components/p-6daacf48.entry.js +1 -0
- package/dist/taro-components/p-72f2b6f5.entry.js +1 -0
- package/dist/taro-components/p-76c00960.entry.js +1 -0
- package/dist/taro-components/p-79b3c05a.entry.js +1 -0
- package/dist/taro-components/p-7a5be745.entry.js +1 -0
- package/dist/taro-components/p-7b021c48.entry.js +1 -0
- package/dist/taro-components/p-7f3e5f09.entry.js +1 -0
- package/dist/taro-components/{p-c1d6c0ba.system.entry.js → p-7ffcfb05.system.entry.js} +1 -1
- package/dist/taro-components/p-81588c19.entry.js +1 -0
- package/dist/taro-components/p-8235b7b7.system.entry.js +1 -0
- package/dist/taro-components/{p-89fc30f0.entry.js → p-8cf16235.entry.js} +1 -1
- package/dist/taro-components/{p-4f139925.system.entry.js → p-8d905ff5.system.entry.js} +1 -1
- package/dist/taro-components/p-923c6e08.entry.js +1 -0
- package/dist/taro-components/p-93748645.system.js +1 -0
- package/dist/taro-components/p-9767491b.entry.js +1 -0
- package/dist/taro-components/p-9bd65170.system.entry.js +1 -0
- package/dist/taro-components/{p-3eb31172.system.entry.js → p-9d6a7a70.system.entry.js} +1 -1
- package/dist/taro-components/{p-e3e40b03.system.entry.js → p-9e807bd6.system.entry.js} +1 -1
- package/dist/taro-components/p-9e912454.system.entry.js +1 -0
- package/dist/taro-components/{p-9c9178cd.system.entry.js → p-a34988ff.system.entry.js} +1 -1
- package/dist/taro-components/p-a895db87.entry.js +1 -0
- package/dist/taro-components/{p-0f393c6d.system.entry.js → p-b685a487.system.entry.js} +1 -1
- package/dist/taro-components/{p-129341f2.system.entry.js → p-bd922592.system.entry.js} +1 -1
- package/dist/taro-components/p-be2d1c4a.system.entry.js +1 -0
- package/dist/taro-components/p-ca67c759.entry.js +1 -0
- package/dist/taro-components/p-cb8099dd.entry.js +1 -0
- package/dist/taro-components/p-ce093936.entry.js +1 -0
- package/dist/taro-components/{p-4d11f3ad.system.entry.js → p-ce49e2f4.system.entry.js} +1 -1
- package/dist/taro-components/p-d12592f1.entry.js +1 -0
- package/dist/taro-components/{p-a74d5aa5.system.entry.js → p-d52009d1.system.entry.js} +1 -1
- package/dist/taro-components/{p-2e9e9ca7.system.entry.js → p-d52bf5f5.system.entry.js} +1 -1
- package/dist/taro-components/{p-81f5977d.system.entry.js → p-d6269b5e.system.entry.js} +1 -1
- package/dist/taro-components/p-d6a37b93.entry.js +1 -0
- package/dist/taro-components/p-d8363f59.system.entry.js +1 -0
- package/dist/taro-components/p-d9494012.system.entry.js +1 -0
- package/dist/taro-components/p-de3a4828.entry.js +1 -0
- package/dist/taro-components/p-f4158e42.entry.js +1 -0
- package/dist/taro-components/p-f6c7f07c.system.entry.js +1 -0
- package/dist/taro-components/p-f7b6c1a6.entry.js +1 -0
- package/dist/taro-components/p-f991bc7b.entry.js +1 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/taro-components/taro-components.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -0
- 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/picker/picker-group.d.ts +7 -0
- package/dist/types/components/tabbar/tabbar.d.ts +20 -1
- package/dist/types/components/textarea/textarea.d.ts +6 -0
- package/dist/types/components/view/view.d.ts +2 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/stencil-public-runtime.d.ts +190 -182
- package/dist-h5/vue/createComponent.js +4 -0
- package/dist-h5/vue/createFormsComponent.js +8 -1
- package/loader/index.d.ts +0 -1
- package/package.json +5 -5
- package/dist/collection/components/cover-view/cover-image.js +0 -11
- package/dist/esm-es5/index-310de3d5.js +0 -1
- package/dist/taro-components/p-153b839d.system.entry.js +0 -1
- package/dist/taro-components/p-180fd001.entry.js +0 -1
- package/dist/taro-components/p-1925bbdb.entry.js +0 -1
- package/dist/taro-components/p-1f44e8ef.system.entry.js +0 -1
- package/dist/taro-components/p-28348261.entry.js +0 -1
- package/dist/taro-components/p-31b89eb3.entry.js +0 -1
- package/dist/taro-components/p-31f0f881.entry.js +0 -1
- package/dist/taro-components/p-3bda72b4.entry.js +0 -1
- package/dist/taro-components/p-4591dff5.entry.js +0 -1
- package/dist/taro-components/p-4afe24d7.entry.js +0 -1
- package/dist/taro-components/p-4b632069.entry.js +0 -1
- package/dist/taro-components/p-4f1d45ff.entry.js +0 -1
- package/dist/taro-components/p-5032d822.entry.js +0 -1
- package/dist/taro-components/p-6287057a.entry.js +0 -1
- package/dist/taro-components/p-66120099.entry.js +0 -1
- package/dist/taro-components/p-6730fa44.entry.js +0 -1
- package/dist/taro-components/p-6f331ed3.entry.js +0 -1
- package/dist/taro-components/p-73c389e7.system.entry.js +0 -1
- package/dist/taro-components/p-7911ccd6.system.entry.js +0 -1
- package/dist/taro-components/p-8031d6b5.system.entry.js +0 -1
- package/dist/taro-components/p-82185d54.system.entry.js +0 -1
- package/dist/taro-components/p-8676c058.entry.js +0 -1
- package/dist/taro-components/p-906c3a0a.entry.js +0 -1
- package/dist/taro-components/p-9205470e.entry.js +0 -1
- package/dist/taro-components/p-945fa1a0.entry.js +0 -1
- package/dist/taro-components/p-95f5261c.entry.js +0 -1
- package/dist/taro-components/p-96771939.entry.js +0 -1
- package/dist/taro-components/p-96f1e9e7.entry.js +0 -1
- package/dist/taro-components/p-9c47f99e.entry.js +0 -1
- package/dist/taro-components/p-9fe2309f.entry.js +0 -1
- package/dist/taro-components/p-9ffb69e5.system.entry.js +0 -1
- package/dist/taro-components/p-a208926a.entry.js +0 -1
- package/dist/taro-components/p-a3e783c3.entry.js +0 -1
- package/dist/taro-components/p-af393b0b.entry.js +0 -1
- package/dist/taro-components/p-b2ed71a7.entry.js +0 -1
- package/dist/taro-components/p-b5d2597b.system.js +0 -1
- package/dist/taro-components/p-b7c29d05.entry.js +0 -1
- package/dist/taro-components/p-c2810ece.entry.js +0 -1
- package/dist/taro-components/p-c37d9a5d.system.entry.js +0 -1
- package/dist/taro-components/p-c9380fa6.entry.js +0 -1
- package/dist/taro-components/p-ca74a018.entry.js +0 -1
- package/dist/taro-components/p-cf496b3b.system.js +0 -1
- package/dist/taro-components/p-e256974b.system.entry.js +0 -1
- package/dist/taro-components/p-e28625a2.entry.js +0 -1
- package/dist/taro-components/p-e302b8d7.entry.js +0 -1
- package/dist/types/components/cover-view/cover-image.d.ts +0 -4
|
@@ -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
|
}
|
|
@@ -75,10 +75,15 @@ export class Input {
|
|
|
75
75
|
};
|
|
76
76
|
this.handleKeyDown = (e) => {
|
|
77
77
|
const { value } = e.target;
|
|
78
|
+
const keyCode = e.keyCode || e.code;
|
|
78
79
|
this.onInputExcuted = false;
|
|
79
80
|
e.stopPropagation();
|
|
80
|
-
this.onKeyDown.emit({
|
|
81
|
-
|
|
81
|
+
this.onKeyDown.emit({
|
|
82
|
+
value,
|
|
83
|
+
cursor: value.length,
|
|
84
|
+
keyCode
|
|
85
|
+
});
|
|
86
|
+
keyCode === 13 && this.onConfirm.emit({ value });
|
|
82
87
|
};
|
|
83
88
|
this.handleComposition = (e) => {
|
|
84
89
|
if (!(e.target instanceof HTMLInputElement))
|
|
@@ -98,43 +103,46 @@ export class Input {
|
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
watchFocus(newValue, oldValue) {
|
|
106
|
+
var _a;
|
|
101
107
|
if (!oldValue && newValue) {
|
|
102
|
-
this.inputRef.focus();
|
|
108
|
+
(_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.focus();
|
|
103
109
|
}
|
|
104
110
|
}
|
|
105
111
|
componentWillLoad() {
|
|
106
112
|
this._value = this.value;
|
|
107
113
|
}
|
|
108
114
|
componentDidLoad() {
|
|
115
|
+
var _a, _b, _c, _d;
|
|
109
116
|
if (this.type === 'file') {
|
|
110
117
|
this.fileListener = () => {
|
|
111
118
|
this.onInput.emit();
|
|
112
119
|
};
|
|
113
|
-
this.inputRef.addEventListener('change', this.fileListener);
|
|
120
|
+
(_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.addEventListener('change', this.fileListener);
|
|
114
121
|
}
|
|
115
122
|
else {
|
|
116
|
-
this.inputRef.addEventListener('compositionstart', this.handleComposition);
|
|
117
|
-
this.inputRef.addEventListener('compositionend', this.handleComposition);
|
|
123
|
+
(_b = this.inputRef) === null || _b === void 0 ? void 0 : _b.addEventListener('compositionstart', this.handleComposition);
|
|
124
|
+
(_c = this.inputRef) === null || _c === void 0 ? void 0 : _c.addEventListener('compositionend', this.handleComposition);
|
|
118
125
|
}
|
|
119
126
|
Object.defineProperty(this.el, 'value', {
|
|
120
|
-
get: () => this.inputRef.value,
|
|
127
|
+
get: () => { var _a; return (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.value; },
|
|
121
128
|
set: value => {
|
|
122
129
|
this._value = value;
|
|
123
130
|
},
|
|
124
131
|
configurable: true
|
|
125
132
|
});
|
|
133
|
+
this.autoFocus && ((_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.focus());
|
|
126
134
|
}
|
|
127
135
|
disconnectedCallback() {
|
|
136
|
+
var _a;
|
|
128
137
|
if (this.type === 'file') {
|
|
129
|
-
this.inputRef.removeEventListener('change', this.fileListener);
|
|
138
|
+
(_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this.fileListener);
|
|
130
139
|
}
|
|
131
140
|
}
|
|
132
141
|
render() {
|
|
133
|
-
const { _value, type, password, placeholder, disabled, maxlength,
|
|
142
|
+
const { _value, type, password, placeholder, disabled, maxlength, confirmType, name, nativeProps } = this;
|
|
134
143
|
return (h("input", Object.assign({ ref: input => {
|
|
135
144
|
this.inputRef = input;
|
|
136
|
-
|
|
137
|
-
}, 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)));
|
|
138
146
|
}
|
|
139
147
|
static get is() { return "taro-input-core"; }
|
|
140
148
|
static get originalStyleUrls() { return {
|
|
@@ -30,15 +30,14 @@ export class TaroPickerGroup {
|
|
|
30
30
|
updateHeight(relativeHeight, columnId, true);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
handleMoveStart(clientY) {
|
|
34
34
|
// 记录第一次的点击位置
|
|
35
|
-
this.startY =
|
|
36
|
-
this.preY =
|
|
35
|
+
this.startY = clientY;
|
|
36
|
+
this.preY = clientY;
|
|
37
37
|
this.hadMove = false;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const y = e.changedTouches[0].clientY;
|
|
39
|
+
handleMoving(clientY) {
|
|
40
|
+
const y = clientY;
|
|
42
41
|
const deltaY = y - this.preY;
|
|
43
42
|
this.preY = y;
|
|
44
43
|
this.touchEnd = false;
|
|
@@ -67,11 +66,11 @@ export class TaroPickerGroup {
|
|
|
67
66
|
}
|
|
68
67
|
this.updateHeight(newPos, this.columnId);
|
|
69
68
|
}
|
|
70
|
-
|
|
69
|
+
handleMoveEnd(clientY) {
|
|
71
70
|
const { mode, range, height, updateHeight, onColumnChange, columnId } = this;
|
|
72
71
|
const max = 0;
|
|
73
72
|
const min = -LINE_HEIGHT * (range.length - 1);
|
|
74
|
-
const endY =
|
|
73
|
+
const endY = clientY;
|
|
75
74
|
this.touchEnd = true;
|
|
76
75
|
// touchEnd 时的高度,可能带小数点,需要再处理
|
|
77
76
|
let absoluteHeight;
|
|
@@ -133,6 +132,32 @@ export class TaroPickerGroup {
|
|
|
133
132
|
updateHeight(relativeHeight, columnId, mode === 'time');
|
|
134
133
|
onColumnChange && onColumnChange(relativeHeight, columnId);
|
|
135
134
|
}
|
|
135
|
+
onMouseDown(e) {
|
|
136
|
+
this.isMove = true;
|
|
137
|
+
this.handleMoveStart(e.clientY);
|
|
138
|
+
}
|
|
139
|
+
onMouseMove(e) {
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
if (!this.isMove)
|
|
142
|
+
return;
|
|
143
|
+
this.handleMoving(e.clientY);
|
|
144
|
+
}
|
|
145
|
+
onMouseMoveEnd(e) {
|
|
146
|
+
if (!this.isMove)
|
|
147
|
+
return;
|
|
148
|
+
this.isMove = false;
|
|
149
|
+
this.handleMoveEnd(e.clientY);
|
|
150
|
+
}
|
|
151
|
+
onTouchStart(e) {
|
|
152
|
+
this.handleMoveStart(e.changedTouches[0].clientY);
|
|
153
|
+
}
|
|
154
|
+
onTouchMove(e) {
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
this.handleMoving(e.changedTouches[0].clientY);
|
|
157
|
+
}
|
|
158
|
+
onTouchEnd(e) {
|
|
159
|
+
this.handleMoveEnd(e.changedTouches[0].clientY);
|
|
160
|
+
}
|
|
136
161
|
render() {
|
|
137
162
|
const { range, rangeKey } = this;
|
|
138
163
|
const pickerItem = range.map(item => {
|
|
@@ -280,9 +305,34 @@ export class TaroPickerGroup {
|
|
|
280
305
|
"startY": {},
|
|
281
306
|
"preY": {},
|
|
282
307
|
"hadMove": {},
|
|
283
|
-
"touchEnd": {}
|
|
308
|
+
"touchEnd": {},
|
|
309
|
+
"isMove": {}
|
|
284
310
|
}; }
|
|
285
311
|
static get listeners() { return [{
|
|
312
|
+
"name": "mousedown",
|
|
313
|
+
"method": "onMouseDown",
|
|
314
|
+
"target": undefined,
|
|
315
|
+
"capture": false,
|
|
316
|
+
"passive": true
|
|
317
|
+
}, {
|
|
318
|
+
"name": "mousemove",
|
|
319
|
+
"method": "onMouseMove",
|
|
320
|
+
"target": undefined,
|
|
321
|
+
"capture": false,
|
|
322
|
+
"passive": true
|
|
323
|
+
}, {
|
|
324
|
+
"name": "mouseup",
|
|
325
|
+
"method": "onMouseMoveEnd",
|
|
326
|
+
"target": undefined,
|
|
327
|
+
"capture": false,
|
|
328
|
+
"passive": true
|
|
329
|
+
}, {
|
|
330
|
+
"name": "mouseleave",
|
|
331
|
+
"method": "onMouseMoveEnd",
|
|
332
|
+
"target": undefined,
|
|
333
|
+
"capture": false,
|
|
334
|
+
"passive": true
|
|
335
|
+
}, {
|
|
286
336
|
"name": "touchstart",
|
|
287
337
|
"method": "onTouchStart",
|
|
288
338
|
"target": undefined,
|
|
@@ -204,7 +204,13 @@ export class Swiper {
|
|
|
204
204
|
that.current = this.realIndex;
|
|
205
205
|
},
|
|
206
206
|
// slideChange 事件在 swiper.slideTo 改写 current 时不触发,因此用 slideChangeTransitionEnd 事件代替
|
|
207
|
-
slideChangeTransitionEnd() {
|
|
207
|
+
slideChangeTransitionEnd(_swiper) {
|
|
208
|
+
if (circular) {
|
|
209
|
+
if (_swiper.isBeginning || _swiper.isEnd) {
|
|
210
|
+
_swiper.slideToLoop(this.realIndex, 0); // 更新下标
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
208
214
|
that.onChange.emit({
|
|
209
215
|
current: this.realIndex,
|
|
210
216
|
source: ''
|
|
@@ -25,18 +25,18 @@ export class Tabbar {
|
|
|
25
25
|
this.status = STATUS_SHOW;
|
|
26
26
|
this.getOriginUrl = (url) => {
|
|
27
27
|
const customRoute = this.customRoutes.filter(([, customUrl]) => {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
return
|
|
28
|
+
const pathA = splitUrl(customUrl).path;
|
|
29
|
+
const pathB = splitUrl(url).path;
|
|
30
|
+
return pathA === pathB;
|
|
31
31
|
});
|
|
32
32
|
return customRoute.length ? customRoute[0][0] : url;
|
|
33
33
|
};
|
|
34
34
|
this.getSelectedIndex = (url) => {
|
|
35
35
|
let foundIndex = -1;
|
|
36
36
|
this.list.forEach(({ pagePath }, idx) => {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
37
|
+
const pathA = splitUrl(url).path;
|
|
38
|
+
const pathB = splitUrl(pagePath).path;
|
|
39
|
+
if (pathA === pathB) {
|
|
40
40
|
foundIndex = idx;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -44,7 +44,7 @@ export class Tabbar {
|
|
|
44
44
|
};
|
|
45
45
|
this.switchTab = (index) => {
|
|
46
46
|
this.selectedIndex = index;
|
|
47
|
-
Taro.
|
|
47
|
+
Taro.switchTab({
|
|
48
48
|
url: this.list[index].pagePath
|
|
49
49
|
});
|
|
50
50
|
};
|
|
@@ -72,32 +72,34 @@ export class Tabbar {
|
|
|
72
72
|
}
|
|
73
73
|
if (toLocation && toLocation.path) {
|
|
74
74
|
const tmpPath = addLeadingSlash(toLocation.path);
|
|
75
|
-
currentPage = tmpPath === '/'
|
|
76
|
-
? this.homePage
|
|
77
|
-
: tmpPath;
|
|
75
|
+
currentPage = stripBasename(tmpPath === '/' ? this.homePage : tmpPath, this.conf.basename || '/');
|
|
78
76
|
}
|
|
79
77
|
else {
|
|
80
78
|
currentPage = this.getCurrentUrl();
|
|
81
79
|
}
|
|
82
80
|
this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage));
|
|
83
81
|
};
|
|
84
|
-
this.setTabBarBadgeHandler = ({ index, text, errorHandler }) => {
|
|
85
|
-
const list = this.list;
|
|
82
|
+
this.setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }) => {
|
|
83
|
+
const list = [...this.list];
|
|
86
84
|
if (index in list) {
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
list[index].showRedDot = false;
|
|
86
|
+
list[index].badgeText = text;
|
|
87
|
+
successHandler({
|
|
88
|
+
errMsg: 'setTabBarBadge:ok'
|
|
89
|
+
});
|
|
89
90
|
}
|
|
90
91
|
else {
|
|
91
92
|
errorHandler({
|
|
92
93
|
errMsg: 'setTabBarBadge:fail tabbar item not found'
|
|
93
94
|
});
|
|
94
95
|
}
|
|
96
|
+
this.list = list;
|
|
95
97
|
};
|
|
96
98
|
this.removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }) => {
|
|
97
|
-
const list = this.list;
|
|
99
|
+
const list = [...this.list];
|
|
98
100
|
if (index in list) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
list[index].badgeText = null;
|
|
102
|
+
list[index].badgeText = null;
|
|
101
103
|
successHandler({
|
|
102
104
|
errMsg: 'removeTabBarBadge:ok'
|
|
103
105
|
});
|
|
@@ -107,9 +109,10 @@ export class Tabbar {
|
|
|
107
109
|
errMsg: 'removeTabBarBadge:fail tabbar item not found'
|
|
108
110
|
});
|
|
109
111
|
}
|
|
112
|
+
this.list = list;
|
|
110
113
|
};
|
|
111
114
|
this.showTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
|
|
112
|
-
const list = this.list;
|
|
115
|
+
const list = [...this.list];
|
|
113
116
|
if (index in list) {
|
|
114
117
|
list[index].badgeText = null;
|
|
115
118
|
list[index].showRedDot = true;
|
|
@@ -122,9 +125,10 @@ export class Tabbar {
|
|
|
122
125
|
errMsg: 'showTabBarRedDot:fail tabbar item not found'
|
|
123
126
|
});
|
|
124
127
|
}
|
|
128
|
+
this.list = list;
|
|
125
129
|
};
|
|
126
130
|
this.hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
|
|
127
|
-
const list = this.list;
|
|
131
|
+
const list = [...this.list];
|
|
128
132
|
if (index in list) {
|
|
129
133
|
list[index].showRedDot = false;
|
|
130
134
|
successHandler({
|
|
@@ -136,6 +140,7 @@ export class Tabbar {
|
|
|
136
140
|
errMsg: 'hideTabBarRedDot:fail tabbar item not found'
|
|
137
141
|
});
|
|
138
142
|
}
|
|
143
|
+
this.list = list;
|
|
139
144
|
};
|
|
140
145
|
this.showTabBarHandler = ({ successHandler }) => {
|
|
141
146
|
this.status = STATUS_SHOW;
|
|
@@ -149,6 +154,39 @@ export class Tabbar {
|
|
|
149
154
|
errMsg: 'hideTabBar:ok'
|
|
150
155
|
});
|
|
151
156
|
};
|
|
157
|
+
this.setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {
|
|
158
|
+
if (backgroundColor)
|
|
159
|
+
this.backgroundColor = backgroundColor;
|
|
160
|
+
if (borderStyle)
|
|
161
|
+
this.borderStyle = borderStyle;
|
|
162
|
+
if (color)
|
|
163
|
+
this.color = color;
|
|
164
|
+
if (selectedColor)
|
|
165
|
+
this.selectedColor = selectedColor;
|
|
166
|
+
successHandler({
|
|
167
|
+
errMsg: 'setTabBarStyle:ok'
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
this.setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {
|
|
171
|
+
const list = [...this.list];
|
|
172
|
+
if (index in list) {
|
|
173
|
+
if (iconPath)
|
|
174
|
+
list[index].iconPath = iconPath;
|
|
175
|
+
if (selectedIconPath)
|
|
176
|
+
list[index].selectedIconPath = selectedIconPath;
|
|
177
|
+
if (text)
|
|
178
|
+
list[index].text = text;
|
|
179
|
+
successHandler({
|
|
180
|
+
errMsg: 'setTabBarItem:ok'
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
errorHandler({
|
|
185
|
+
errMsg: 'setTabBarItem:fail tabbar item not found'
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
this.list = list;
|
|
189
|
+
};
|
|
152
190
|
const list = this.conf.list;
|
|
153
191
|
const customRoutes = this.conf.customRoutes;
|
|
154
192
|
if (Object.prototype.toString.call(list) !== '[object Array]' ||
|
|
@@ -166,6 +204,7 @@ export class Tabbar {
|
|
|
166
204
|
}
|
|
167
205
|
});
|
|
168
206
|
this.list = list;
|
|
207
|
+
this.borderStyle = this.conf.borderStyle;
|
|
169
208
|
}
|
|
170
209
|
getCurrentUrl() {
|
|
171
210
|
const routerMode = this.conf.mode;
|
|
@@ -193,6 +232,8 @@ export class Tabbar {
|
|
|
193
232
|
Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
|
|
194
233
|
Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler);
|
|
195
234
|
Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler);
|
|
235
|
+
Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler);
|
|
236
|
+
Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler);
|
|
196
237
|
}
|
|
197
238
|
removeEvent() {
|
|
198
239
|
Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler);
|
|
@@ -203,6 +244,8 @@ export class Tabbar {
|
|
|
203
244
|
Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
|
|
204
245
|
Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler);
|
|
205
246
|
Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler);
|
|
247
|
+
Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler);
|
|
248
|
+
Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler);
|
|
206
249
|
}
|
|
207
250
|
componentDidLoad() {
|
|
208
251
|
this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom';
|
|
@@ -213,10 +256,10 @@ export class Tabbar {
|
|
|
213
256
|
this.removeEvent();
|
|
214
257
|
}
|
|
215
258
|
render() {
|
|
216
|
-
const {
|
|
259
|
+
const { tabbarPos = 'bottom' } = this;
|
|
217
260
|
const status = this.status;
|
|
218
261
|
const containerCls = classNames('weui-tabbar', {
|
|
219
|
-
[`taro-tabbar__border-${
|
|
262
|
+
[`taro-tabbar__border-${this.borderStyle || 'black'}`]: true
|
|
220
263
|
});
|
|
221
264
|
const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE;
|
|
222
265
|
const shouldSlideout = status === STATUS_SLIDEOUT;
|
|
@@ -225,19 +268,20 @@ export class Tabbar {
|
|
|
225
268
|
[hideTabBarWithAnimationClassName]: shouldSlideout
|
|
226
269
|
}) },
|
|
227
270
|
h("div", { class: containerCls, style: {
|
|
228
|
-
backgroundColor:
|
|
271
|
+
backgroundColor: this.backgroundColor || ''
|
|
229
272
|
} }, this.list.map((item, index) => {
|
|
230
273
|
const isSelected = this.selectedIndex === index;
|
|
231
274
|
let textColor;
|
|
232
275
|
let iconPath;
|
|
233
276
|
if (isSelected) {
|
|
234
|
-
textColor =
|
|
277
|
+
textColor = this.selectedColor;
|
|
235
278
|
iconPath = item.selectedIconPath;
|
|
236
279
|
}
|
|
237
280
|
else {
|
|
238
|
-
textColor =
|
|
281
|
+
textColor = this.color || '';
|
|
239
282
|
iconPath = item.iconPath;
|
|
240
283
|
}
|
|
284
|
+
console.log('TabbarItem', item);
|
|
241
285
|
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 }));
|
|
242
286
|
}))));
|
|
243
287
|
}
|
|
@@ -271,6 +315,10 @@ export class Tabbar {
|
|
|
271
315
|
}; }
|
|
272
316
|
static get states() { return {
|
|
273
317
|
"list": {},
|
|
318
|
+
"borderStyle": {},
|
|
319
|
+
"backgroundColor": {},
|
|
320
|
+
"color": {},
|
|
321
|
+
"selectedColor": {},
|
|
274
322
|
"selectedIndex": {},
|
|
275
323
|
"status": {}
|
|
276
324
|
}; }
|
|
@@ -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;
|