@tarojs/components 3.4.6 → 3.4.9
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-47a1959e.js +34 -0
- package/dist/{esm/index-3c78bcaf.js → cjs/index-dffbd352.js} +12 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-button-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-canvas-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-icon-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-image-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-input-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-navigator-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-picker-view-column-core.cjs.entry.js +79 -3
- package/dist/cjs/taro-picker-view-core.cjs.entry.js +71 -2
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +9 -8
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +5 -13
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +5 -13
- package/dist/cjs/taro-tabbar.cjs.entry.js +24 -24
- package/dist/cjs/taro-text-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-textarea-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-video-control_3.cjs.entry.js +27859 -221
- package/dist/cjs/taro-view-core.cjs.entry.js +4 -4
- package/dist/cjs/taro-web-view-core.cjs.entry.js +1 -1
- package/dist/collection/components/button/style/index.css +49 -49
- package/dist/collection/components/canvas/canvas.js +1 -1
- package/dist/collection/components/canvas/style/index.css +6 -6
- package/dist/collection/components/checkbox/style/index.css +21 -22
- package/dist/collection/components/image/style/index.css +4 -4
- package/dist/collection/components/input/index.css +2 -2
- package/dist/collection/components/navigator/navigator.js +2 -2
- package/dist/collection/components/navigator/{navigator.css → style/index.css} +3 -3
- package/dist/collection/components/picker/style/index.css +2 -1
- package/dist/collection/components/picker-view/picker-view-column.js +218 -4
- package/dist/collection/components/picker-view/picker-view.js +217 -3
- package/dist/collection/components/picker-view/style/column.css +12 -0
- package/dist/collection/components/picker-view/style/index.css +28 -0
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +8 -7
- package/dist/collection/components/pull-to-refresh/style/index.css +53 -50
- package/dist/collection/components/scroll-view/scroll-view.js +3 -11
- package/dist/collection/components/swiper/swiper.js +2 -10
- package/dist/collection/components/tabbar/style/index.css +7 -6
- package/dist/collection/components/text/style/index.css +0 -6
- package/dist/collection/components/textarea/style/index.css +5 -5
- package/dist/collection/components/video/style/index.css +89 -109
- package/dist/collection/components/video/utils.js +96 -109
- package/dist/collection/components/video/video-control.js +6 -6
- package/dist/collection/components/video/video.js +48 -7
- package/dist/collection/components/view/style/index.css +3 -5
- package/dist/collection/components/view/view.js +2 -2
- package/dist/collection/components/web-view/style/index.css +1 -1
- package/dist/collection/utils/index.js +23 -83
- package/dist/collection/utils/style.js +10 -0
- package/dist/collection/utils/url.js +67 -0
- package/dist/esm/index-cad8203e.js +31 -0
- package/dist/{cjs/index-b9715722.js → esm/index-cd1a2d33.js} +6 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-button-core.entry.js +2 -2
- package/dist/esm/taro-canvas-core.entry.js +1 -1
- package/dist/esm/taro-checkbox-core_2.entry.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-cover-view-core.entry.js +1 -1
- package/dist/esm/taro-icon-core.entry.js +1 -1
- package/dist/esm/taro-image-core.entry.js +2 -2
- package/dist/esm/taro-input-core.entry.js +1 -1
- package/dist/esm/taro-navigator-core.entry.js +3 -3
- package/dist/esm/taro-picker-core_2.entry.js +1 -1
- package/dist/esm/taro-picker-view-column-core.entry.js +80 -4
- package/dist/esm/taro-picker-view-core.entry.js +72 -3
- package/dist/esm/taro-pull-to-refresh.entry.js +9 -8
- package/dist/esm/taro-scroll-view-core.entry.js +4 -12
- package/dist/esm/taro-swiper-core_2.entry.js +2 -10
- package/dist/esm/taro-tabbar.entry.js +24 -24
- package/dist/esm/taro-text-core.entry.js +2 -2
- package/dist/esm/taro-textarea-core.entry.js +1 -1
- package/dist/esm/taro-video-control_3.entry.js +27858 -220
- package/dist/esm/taro-view-core.entry.js +4 -4
- package/dist/esm/taro-web-view-core.entry.js +1 -1
- package/dist/esm-es5/index-cad8203e.js +1 -0
- package/dist/esm-es5/index-cd1a2d33.js +7 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-button-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-view-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-navigator-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-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.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 +365 -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-00089605.entry.js +365 -0
- package/dist/taro-components/{p-293531af.system.entry.js → p-03eb37e5.system.entry.js} +1 -1
- package/dist/taro-components/{p-4dbed323.entry.js → p-07062966.entry.js} +1 -1
- package/dist/taro-components/{p-9fc88fc1.system.entry.js → p-0c18bd18.system.entry.js} +1 -1
- package/dist/taro-components/p-16bf117a.system.entry.js +1 -0
- package/dist/taro-components/{p-fc4939c6.system.entry.js → p-288b38f9.system.entry.js} +1 -1
- package/dist/taro-components/p-2d066d28.entry.js +1 -0
- package/dist/taro-components/{p-2d2f8064.entry.js → p-33c5efb5.entry.js} +1 -1
- package/dist/taro-components/p-33ee636a.system.js +1 -1
- package/dist/taro-components/p-3593c5f1.system.entry.js +1 -0
- package/dist/taro-components/{p-74540410.entry.js → p-42eb4f16.entry.js} +1 -1
- package/dist/taro-components/{p-d567b95e.entry.js → p-431080b8.entry.js} +1 -1
- package/dist/taro-components/{p-17039974.system.entry.js → p-50be38a1.system.entry.js} +1 -1
- package/dist/taro-components/p-51401bdc.entry.js +1 -0
- package/dist/taro-components/p-5746d7ce.js +1 -0
- package/dist/taro-components/{p-2b0d5c90.system.entry.js → p-58623cdd.system.entry.js} +1 -1
- package/dist/taro-components/{p-d041b413.entry.js → p-5c6aeb55.entry.js} +1 -1
- package/dist/taro-components/p-5f4d0d5b.system.js +7 -0
- package/dist/taro-components/p-61c0caae.entry.js +1 -0
- package/dist/taro-components/p-663d1bb9.system.js +1 -0
- package/dist/taro-components/{p-865c21b5.entry.js → p-668a6262.entry.js} +1 -1
- package/dist/taro-components/p-6c211370.system.entry.js +1 -0
- package/dist/taro-components/p-7e5d2d7a.js +7 -0
- package/dist/taro-components/p-7fdd59f0.entry.js +1 -0
- package/dist/taro-components/{p-99ed3ed2.system.entry.js → p-8bea1c4d.system.entry.js} +1 -1
- package/dist/taro-components/{p-fd8312e5.system.entry.js → p-8e0150eb.system.entry.js} +1 -1
- package/dist/taro-components/p-92a31933.system.entry.js +1 -0
- package/dist/taro-components/p-a05d66d1.system.entry.js +1 -0
- package/dist/taro-components/p-aae3e479.entry.js +1 -0
- package/dist/taro-components/p-b0bd2cf1.system.entry.js +1 -0
- package/dist/taro-components/p-b4f94eb0.entry.js +1 -0
- package/dist/taro-components/{p-5ae86835.system.entry.js → p-bc97b854.system.entry.js} +1 -1
- package/dist/taro-components/p-c06f1610.system.entry.js +1 -0
- package/dist/taro-components/{p-fe156231.system.entry.js → p-c792a826.system.entry.js} +1 -1
- package/dist/taro-components/p-cd2af8b4.entry.js +1 -0
- package/dist/taro-components/{p-8bc82aaa.entry.js → p-d0c608a8.entry.js} +1 -1
- package/dist/taro-components/p-d19aeb27.entry.js +1 -0
- package/dist/taro-components/p-e38a81c9.entry.js +1 -0
- package/dist/taro-components/p-e3c9421d.entry.js +1 -0
- package/dist/taro-components/p-e61d2113.system.entry.js +1 -0
- package/dist/taro-components/{p-98b47fc9.system.entry.js → p-ed3bf934.system.entry.js} +1 -1
- package/dist/taro-components/{p-1c1336f5.entry.js → p-edcb9726.entry.js} +1 -1
- package/dist/taro-components/{p-4e54216b.entry.js → p-f5fe8711.entry.js} +1 -1
- package/dist/taro-components/p-fbd45c24.system.entry.js +1 -0
- package/dist/taro-components/p-ff032a23.system.entry.js +365 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/picker-view/picker-view-column.d.ts +15 -1
- package/dist/types/components/picker-view/picker-view.d.ts +24 -0
- package/dist/types/components/scroll-view/scroll-view.d.ts +1 -1
- package/dist/types/components/swiper/swiper.d.ts +2 -2
- package/dist/types/components/video/utils.d.ts +8 -0
- package/dist/types/components/video/video-control.d.ts +1 -1
- package/dist/types/components.d.ts +22 -0
- package/dist/types/utils/index.d.ts +4 -8
- package/dist/types/utils/style.d.ts +1 -0
- package/dist/types/utils/url.d.ts +6 -0
- package/package.json +6 -4
- package/types/Input.d.ts +5 -4
- package/types/PickerViewColumn.d.ts +2 -2
- package/types/Video.d.ts +1 -1
- package/types/index.vue3.d.ts +159 -0
- package/vue3.d.ts +3 -0
- package/dist/esm-es5/index-3c78bcaf.js +0 -7
- package/dist/taro-components/p-11932905.entry.js +0 -1
- package/dist/taro-components/p-17cf8b5b.entry.js +0 -1
- package/dist/taro-components/p-32937866.entry.js +0 -1
- package/dist/taro-components/p-37cfdd8f.js +0 -7
- package/dist/taro-components/p-431197bc.entry.js +0 -1
- package/dist/taro-components/p-43de2f12.system.entry.js +0 -1
- package/dist/taro-components/p-50066d5e.system.entry.js +0 -1
- package/dist/taro-components/p-5c420456.entry.js +0 -1
- package/dist/taro-components/p-6de12779.entry.js +0 -1
- package/dist/taro-components/p-71e14298.entry.js +0 -1
- package/dist/taro-components/p-83dedaa2.entry.js +0 -1
- package/dist/taro-components/p-8486c251.system.entry.js +0 -1
- package/dist/taro-components/p-94c20f60.system.js +0 -7
- package/dist/taro-components/p-95529dc0.entry.js +0 -1
- package/dist/taro-components/p-b15d0302.system.entry.js +0 -1
- package/dist/taro-components/p-b32442fc.system.entry.js +0 -1
- package/dist/taro-components/p-cc818a13.entry.js +0 -1
- package/dist/taro-components/p-d394a61f.system.entry.js +0 -1
- package/dist/taro-components/p-d5971476.entry.js +0 -1
- package/dist/taro-components/p-e0af1d0d.system.entry.js +0 -1
- package/dist/taro-components/p-fb2252b7.system.entry.js +0 -1
- package/dist/taro-components/p-fd0d1168.system.entry.js +0 -1
- package/dist/taro-components/p-fde3a009.system.entry.js +0 -1
|
@@ -1,11 +1,225 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
-
import { Component, h, Host } from '@stencil/core';
|
|
2
|
+
import { Component, h, Host, Element, Prop, Event, Listen } from '@stencil/core';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { convertStyle } from '../../utils';
|
|
3
5
|
export class PickerView {
|
|
6
|
+
onSelect(e) {
|
|
7
|
+
e.stopPropagation();
|
|
8
|
+
if (e.target.tagName !== 'TARO-PICKER-VIEW-COLUMN-CORE')
|
|
9
|
+
return;
|
|
10
|
+
let _curIndex = +e.detail.curIndex;
|
|
11
|
+
let _selectedIndex = +e.detail.selectedIndex;
|
|
12
|
+
this.value[_curIndex] = _selectedIndex;
|
|
13
|
+
this.onChange.emit({ value: this.value });
|
|
14
|
+
}
|
|
15
|
+
onSelectStart(e) {
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
if (e.target.tagName !== 'TARO-PICKER-VIEW-COLUMN-CORE')
|
|
18
|
+
return;
|
|
19
|
+
this.onPickStart.emit();
|
|
20
|
+
}
|
|
21
|
+
onPickerColEnd(e) {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
if (e.target.tagName !== 'TARO-PICKER-VIEW-COLUMN-CORE')
|
|
24
|
+
return;
|
|
25
|
+
this.onPickEnd.emit();
|
|
26
|
+
}
|
|
4
27
|
componentDidLoad() {
|
|
5
|
-
|
|
28
|
+
const childList = this.el.querySelectorAll('taro-picker-view-column-core');
|
|
29
|
+
childList.forEach((element, index) => {
|
|
30
|
+
var _a;
|
|
31
|
+
element.setAttribute('col', `${index}`);
|
|
32
|
+
let selectIndex = '0';
|
|
33
|
+
if (!!this.value && this.value.length > index) {
|
|
34
|
+
selectIndex = `${this.value[index]}`;
|
|
35
|
+
}
|
|
36
|
+
const pickerHeight = this.el.getBoundingClientRect().height;
|
|
37
|
+
const indicatorHeight = ((_a = this.indicator) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0;
|
|
38
|
+
const paddingVertical = (pickerHeight - indicatorHeight) / 2.0;
|
|
39
|
+
element.setAttribute('initial-position', `${selectIndex}`);
|
|
40
|
+
element.setAttribute('padding-vertical', `${paddingVertical}`);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// 过滤非 PickerViewColumn 组件
|
|
44
|
+
componentDidRender() {
|
|
45
|
+
this.el.childNodes.forEach(item => {
|
|
46
|
+
const childEle = item;
|
|
47
|
+
if ('TARO-PICKER-VIEW-COLUMN-CORE' !== childEle.tagName &&
|
|
48
|
+
childEle.className !== 'taro-picker-view-mask-container') {
|
|
49
|
+
this.el.removeChild(item);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
6
52
|
}
|
|
7
53
|
render() {
|
|
8
|
-
|
|
54
|
+
const indicatorCls = classNames('taro-picker-view-mask-indicator', this.indicatorClass);
|
|
55
|
+
const maskTopCls = classNames('taro-picker-view-mask-top', this.maskClass);
|
|
56
|
+
const maskBtmCls = classNames('taro-picker-view-mask-bottom', this.maskClass);
|
|
57
|
+
const indicatorStyle = convertStyle(this.indicatorStyle);
|
|
58
|
+
const maskTopStyle = convertStyle(this.maskStyle);
|
|
59
|
+
const maskBottomStyle = convertStyle(this.maskStyle);
|
|
60
|
+
return (h(Host, { class: "taro-picker-view-container" },
|
|
61
|
+
h("slot", null),
|
|
62
|
+
h("div", { class: "taro-picker-view-mask-container" },
|
|
63
|
+
h("div", { class: maskTopCls, style: maskTopStyle }),
|
|
64
|
+
h("div", { class: indicatorCls, style: indicatorStyle, ref: indicator => (this.indicator = indicator) }),
|
|
65
|
+
h("div", { class: maskBtmCls, style: maskBottomStyle }))));
|
|
9
66
|
}
|
|
10
67
|
static get is() { return "taro-picker-view-core"; }
|
|
68
|
+
static get originalStyleUrls() { return {
|
|
69
|
+
"$": ["./style/index.scss"]
|
|
70
|
+
}; }
|
|
71
|
+
static get styleUrls() { return {
|
|
72
|
+
"$": ["./style/index.css"]
|
|
73
|
+
}; }
|
|
74
|
+
static get properties() { return {
|
|
75
|
+
"indicatorStyle": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"mutable": false,
|
|
78
|
+
"complexType": {
|
|
79
|
+
"original": "string",
|
|
80
|
+
"resolved": "string",
|
|
81
|
+
"references": {}
|
|
82
|
+
},
|
|
83
|
+
"required": false,
|
|
84
|
+
"optional": false,
|
|
85
|
+
"docs": {
|
|
86
|
+
"tags": [],
|
|
87
|
+
"text": ""
|
|
88
|
+
},
|
|
89
|
+
"attribute": "indicator-style",
|
|
90
|
+
"reflect": false
|
|
91
|
+
},
|
|
92
|
+
"indicatorClass": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "string",
|
|
97
|
+
"resolved": "string",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
105
|
+
},
|
|
106
|
+
"attribute": "indicator-class",
|
|
107
|
+
"reflect": false
|
|
108
|
+
},
|
|
109
|
+
"value": {
|
|
110
|
+
"type": "unknown",
|
|
111
|
+
"mutable": false,
|
|
112
|
+
"complexType": {
|
|
113
|
+
"original": "number[]",
|
|
114
|
+
"resolved": "number[]",
|
|
115
|
+
"references": {}
|
|
116
|
+
},
|
|
117
|
+
"required": false,
|
|
118
|
+
"optional": false,
|
|
119
|
+
"docs": {
|
|
120
|
+
"tags": [],
|
|
121
|
+
"text": ""
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"maskStyle": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "string",
|
|
129
|
+
"resolved": "string",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": ""
|
|
137
|
+
},
|
|
138
|
+
"attribute": "mask-style",
|
|
139
|
+
"reflect": false
|
|
140
|
+
},
|
|
141
|
+
"maskClass": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "string",
|
|
146
|
+
"resolved": "string",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": ""
|
|
154
|
+
},
|
|
155
|
+
"attribute": "mask-class",
|
|
156
|
+
"reflect": false
|
|
157
|
+
}
|
|
158
|
+
}; }
|
|
159
|
+
static get events() { return [{
|
|
160
|
+
"method": "onChange",
|
|
161
|
+
"name": "change",
|
|
162
|
+
"bubbles": true,
|
|
163
|
+
"cancelable": true,
|
|
164
|
+
"composed": true,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": ""
|
|
168
|
+
},
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "any",
|
|
171
|
+
"resolved": "any",
|
|
172
|
+
"references": {}
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
"method": "onPickStart",
|
|
176
|
+
"name": "pickstart",
|
|
177
|
+
"bubbles": true,
|
|
178
|
+
"cancelable": true,
|
|
179
|
+
"composed": true,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": ""
|
|
183
|
+
},
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "any",
|
|
186
|
+
"resolved": "any",
|
|
187
|
+
"references": {}
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
"method": "onPickEnd",
|
|
191
|
+
"name": "pickend",
|
|
192
|
+
"bubbles": true,
|
|
193
|
+
"cancelable": true,
|
|
194
|
+
"composed": true,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": ""
|
|
198
|
+
},
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "any",
|
|
201
|
+
"resolved": "any",
|
|
202
|
+
"references": {}
|
|
203
|
+
}
|
|
204
|
+
}]; }
|
|
205
|
+
static get elementRef() { return "el"; }
|
|
206
|
+
static get listeners() { return [{
|
|
207
|
+
"name": "onselect",
|
|
208
|
+
"method": "onSelect",
|
|
209
|
+
"target": undefined,
|
|
210
|
+
"capture": false,
|
|
211
|
+
"passive": false
|
|
212
|
+
}, {
|
|
213
|
+
"name": "onselectstart",
|
|
214
|
+
"method": "onSelectStart",
|
|
215
|
+
"target": undefined,
|
|
216
|
+
"capture": false,
|
|
217
|
+
"passive": false
|
|
218
|
+
}, {
|
|
219
|
+
"name": "onselectend",
|
|
220
|
+
"method": "onPickerColEnd",
|
|
221
|
+
"target": undefined,
|
|
222
|
+
"capture": false,
|
|
223
|
+
"passive": false
|
|
224
|
+
}]; }
|
|
11
225
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.taro-picker-view-column-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
overflow: scroll;
|
|
4
|
+
overflow-x: hidden;
|
|
5
|
+
position: relative;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
flex: 1;
|
|
8
|
+
text-align: center;
|
|
9
|
+
}
|
|
10
|
+
.taro-picker-view-column-container::-webkit-scrollbar {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.taro-picker-view-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
.taro-picker-view-mask-container {
|
|
6
|
+
display: flex;
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
top: 0;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
}
|
|
15
|
+
.taro-picker-view-mask-indicator {
|
|
16
|
+
display: flex;
|
|
17
|
+
border-top: 1px solid #ddd;
|
|
18
|
+
border-bottom: 1px solid #ddd;
|
|
19
|
+
height: 50px;
|
|
20
|
+
}
|
|
21
|
+
.taro-picker-view-mask-top {
|
|
22
|
+
flex: 1;
|
|
23
|
+
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
|
|
24
|
+
}
|
|
25
|
+
.taro-picker-view-mask-bottom {
|
|
26
|
+
flex: 1;
|
|
27
|
+
background: linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
|
|
28
|
+
}
|
|
@@ -55,11 +55,11 @@ export class PullToRefresh {
|
|
|
55
55
|
};
|
|
56
56
|
this.init = () => {
|
|
57
57
|
const ele = this.scrollContainer;
|
|
58
|
-
const child = this.el.
|
|
59
|
-
this.el.appendChild = child.appendChild.bind(child);
|
|
60
|
-
this.el.insertBefore = child.insertBefore.bind(child);
|
|
61
|
-
this.el.replaceChild = child.replaceChild.bind(child);
|
|
62
|
-
this.el.removeChild = child.removeChild.bind(child);
|
|
58
|
+
const child = this.el.querySelector('rmc-pull-to-refresh-content');
|
|
59
|
+
this.el.appendChild = child === null || child === void 0 ? void 0 : child.appendChild.bind(child);
|
|
60
|
+
this.el.insertBefore = child === null || child === void 0 ? void 0 : child.insertBefore.bind(child);
|
|
61
|
+
this.el.replaceChild = child === null || child === void 0 ? void 0 : child.replaceChild.bind(child);
|
|
62
|
+
this.el.removeChild = child === null || child === void 0 ? void 0 : child.removeChild.bind(child);
|
|
63
63
|
this._to = {
|
|
64
64
|
touchstart: this.onTouchStart.bind(this, ele),
|
|
65
65
|
touchmove: this.onTouchMove.bind(this, ele),
|
|
@@ -177,7 +177,8 @@ export class PullToRefresh {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
get scrollContainer() {
|
|
180
|
-
return
|
|
180
|
+
return this.el.parentElement ||
|
|
181
|
+
document.querySelector('.taro_page_stationed') ||
|
|
181
182
|
document.querySelector('.taro_page') ||
|
|
182
183
|
document.querySelector('.taro_router') ||
|
|
183
184
|
document.querySelector('.taro-tabbar__panel') ||
|
|
@@ -246,7 +247,7 @@ export class PullToRefresh {
|
|
|
246
247
|
}
|
|
247
248
|
static get is() { return "taro-pull-to-refresh"; }
|
|
248
249
|
static get originalStyleUrls() { return {
|
|
249
|
-
"$": ["./style/index.
|
|
250
|
+
"$": ["./style/index.scss"]
|
|
250
251
|
}; }
|
|
251
252
|
static get styleUrls() { return {
|
|
252
253
|
"$": ["./style/index.css"]
|
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
.rmc-pull-to-refresh-content {
|
|
2
|
-
transform-origin: left top
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@keyframes rmc-pull-to-refresh-indicator {
|
|
15
|
-
50% {
|
|
16
|
-
opacity: 0.2;
|
|
17
|
-
}
|
|
18
|
-
100% {
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
animation-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
.rmc-pull-to-refresh-indicator > div:nth-child(0) {
|
|
40
|
-
animation-delay: -0.1s !important;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
.rmc-pull-to-refresh-content {
|
|
2
|
+
transform-origin: left top 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rmc-pull-to-refresh-content-wrapper {
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rmc-pull-to-refresh-transition {
|
|
11
|
+
transition: transform 0.3s;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@keyframes rmc-pull-to-refresh-indicator {
|
|
15
|
+
50% {
|
|
16
|
+
opacity: 0.2;
|
|
17
|
+
}
|
|
18
|
+
100% {
|
|
19
|
+
opacity: 1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
.rmc-pull-to-refresh-indicator {
|
|
23
|
+
height: 30px;
|
|
24
|
+
line-height: 10px;
|
|
25
|
+
text-align: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.rmc-pull-to-refresh-indicator > div {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
margin: 3px;
|
|
31
|
+
border-radius: 100%;
|
|
32
|
+
width: 6px;
|
|
33
|
+
height: 6px;
|
|
34
|
+
background-color: grey;
|
|
35
|
+
animation: rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;
|
|
36
|
+
animation-fill-mode: both;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.rmc-pull-to-refresh-indicator > div:nth-child(0) {
|
|
40
|
+
animation-delay: -0.1s !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rmc-pull-to-refresh-indicator > div:nth-child(1) {
|
|
44
|
+
animation-delay: -0.2s !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.rmc-pull-to-refresh-indicator > div:nth-child(2) {
|
|
48
|
+
animation-delay: -0.3s !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator {
|
|
52
|
+
margin-top: -25px;
|
|
53
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
2
|
import { Component, h, Prop, Event, Watch, Element, Host } from '@stencil/core';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
+
import { debounce } from '../../utils';
|
|
4
5
|
function easeOutScroll(from, to, callback) {
|
|
5
6
|
if (from === to || typeof from !== 'number') {
|
|
6
7
|
return;
|
|
@@ -23,15 +24,6 @@ function easeOutScroll(from, to, callback) {
|
|
|
23
24
|
}
|
|
24
25
|
step();
|
|
25
26
|
}
|
|
26
|
-
function debounce(fn, delay) {
|
|
27
|
-
let timer;
|
|
28
|
-
return function (...arrs) {
|
|
29
|
-
clearTimeout(timer);
|
|
30
|
-
timer = setTimeout(function () {
|
|
31
|
-
fn(...arrs);
|
|
32
|
-
}, delay);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
27
|
export class ScrollView {
|
|
36
28
|
constructor() {
|
|
37
29
|
this.scrollX = false;
|
|
@@ -45,7 +37,7 @@ export class ScrollView {
|
|
|
45
37
|
const { scrollLeft, scrollTop, scrollHeight, scrollWidth } = this.el;
|
|
46
38
|
this._scrollLeft = scrollLeft;
|
|
47
39
|
this._scrollTop = scrollTop;
|
|
48
|
-
this.
|
|
40
|
+
this.upperAndLower();
|
|
49
41
|
this.onScroll.emit({
|
|
50
42
|
scrollLeft,
|
|
51
43
|
scrollTop,
|
|
@@ -53,7 +45,7 @@ export class ScrollView {
|
|
|
53
45
|
scrollWidth
|
|
54
46
|
});
|
|
55
47
|
};
|
|
56
|
-
this.
|
|
48
|
+
this.upperAndLower = debounce(() => {
|
|
57
49
|
const { offsetWidth, offsetHeight, scrollLeft, scrollTop, scrollHeight, scrollWidth } = this.el;
|
|
58
50
|
const lowerThreshold = Number(this.lowerThreshold);
|
|
59
51
|
const upperThreshold = Number(this.upperThreshold);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
2
|
import { Component, h, Prop, Event, Watch, Host, Element, State } from '@stencil/core';
|
|
3
|
-
import SwiperJS from 'swiper/swiper-bundle.esm.js';
|
|
4
3
|
import classNames from 'classnames';
|
|
4
|
+
import SwiperJS from 'swiper/swiper-bundle.esm.js';
|
|
5
|
+
import { debounce } from '../../utils';
|
|
5
6
|
let INSTANCE_ID = 0;
|
|
6
7
|
export class Swiper {
|
|
7
8
|
constructor() {
|
|
@@ -588,12 +589,3 @@ export class Swiper {
|
|
|
588
589
|
"methodName": "watchCircular"
|
|
589
590
|
}]; }
|
|
590
591
|
}
|
|
591
|
-
function debounce(fn, delay) {
|
|
592
|
-
let timer;
|
|
593
|
-
return function (...arrs) {
|
|
594
|
-
clearTimeout(timer);
|
|
595
|
-
timer = setTimeout(function () {
|
|
596
|
-
fn(...arrs);
|
|
597
|
-
}, delay);
|
|
598
|
-
};
|
|
599
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
html,
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
2
3
|
height: 100%;
|
|
3
4
|
}
|
|
4
5
|
|
|
@@ -11,20 +12,20 @@ html, body {
|
|
|
11
12
|
}
|
|
12
13
|
.taro-tabbar__container {
|
|
13
14
|
display: flex;
|
|
14
|
-
height: 100%;
|
|
15
|
-
flex-direction: column;
|
|
16
15
|
overflow: hidden;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
height: 100%;
|
|
17
18
|
}
|
|
18
19
|
.taro-tabbar__panel {
|
|
19
|
-
flex: 1;
|
|
20
|
-
position: relative;
|
|
21
20
|
overflow: auto;
|
|
21
|
+
position: relative;
|
|
22
|
+
flex: 1;
|
|
22
23
|
-webkit-overflow-scrolling: auto;
|
|
23
24
|
}
|
|
24
25
|
.taro-tabbar__tabbar {
|
|
25
26
|
position: relative;
|
|
26
|
-
height: 50px;
|
|
27
27
|
width: 100%;
|
|
28
|
+
height: 50px;
|
|
28
29
|
transition: bottom 0.2s, top 0.2s;
|
|
29
30
|
}
|
|
30
31
|
.taro-tabbar__tabbar-top {
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
taro-text-core {
|
|
2
2
|
display: inline;
|
|
3
|
-
-moz-user-select: none;
|
|
4
|
-
-webkit-user-select: none;
|
|
5
|
-
-ms-user-select: none;
|
|
6
3
|
user-select: none;
|
|
7
4
|
white-space: pre-wrap;
|
|
8
5
|
}
|
|
9
6
|
|
|
10
7
|
.taro-text__selectable {
|
|
11
|
-
-moz-user-select: text;
|
|
12
|
-
-webkit-user-select: text;
|
|
13
|
-
-ms-user-select: text;
|
|
14
8
|
user-select: text;
|
|
15
9
|
}
|
|
@@ -8,13 +8,13 @@ taro-textarea-core .auto-height {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.taro-textarea {
|
|
11
|
-
-webkit-appearance: none;
|
|
12
|
-
cursor: auto;
|
|
13
|
-
width: 100%;
|
|
14
|
-
height: 150px;
|
|
15
|
-
border: 0;
|
|
16
11
|
display: block;
|
|
17
12
|
position: relative;
|
|
13
|
+
border: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 150px;
|
|
16
|
+
appearance: none;
|
|
17
|
+
cursor: auto;
|
|
18
18
|
line-height: 1.5;
|
|
19
19
|
}
|
|
20
20
|
.taro-textarea:focus {
|