@tarojs/components 3.4.0-beta.3 → 3.5.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/taro-input-core.cjs.entry.js +13 -1
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
- package/dist/collection/components/input/input.js +27 -1
- package/dist/collection/components/scroll-view/scroll-view.js +3 -3
- package/dist/collection/components/tabbar/style/index.css +1 -1
- package/dist/esm/taro-input-core.entry.js +13 -1
- package/dist/esm/taro-scroll-view-core.entry.js +3 -3
- package/dist/esm/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/taro-components/p-33ee636a.system.js +1 -1
- package/dist/taro-components/p-9dc9c615.system.entry.js +1 -0
- package/dist/taro-components/p-abe415b4.system.entry.js +1 -0
- package/dist/taro-components/p-b55fedc1.entry.js +1 -0
- package/dist/taro-components/{p-6965567d.entry.js → p-cc818a13.entry.js} +1 -1
- package/dist/taro-components/{p-dd34408a.entry.js → p-e1040131.entry.js} +1 -1
- package/dist/taro-components/{p-13c1404f.system.entry.js → p-fd0d1168.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +3 -0
- package/dist/types/components.d.ts +1 -0
- package/dist-h5/vue/components/picker.js +2 -1
- package/package.json +3 -3
- package/types/Ad.d.ts +13 -1
- package/types/Audio.d.ts +22 -2
- package/types/Button.d.ts +84 -11
- package/types/Camera.d.ts +1 -1
- package/types/Canvas.d.ts +14 -1
- package/types/Checkbox.d.ts +65 -1
- package/types/CoverImage.d.ts +48 -6
- package/types/CoverView.d.ts +51 -8
- package/types/Editor.d.ts +57 -0
- package/types/Form.d.ts +33 -2
- package/types/Icon.d.ts +17 -1
- package/types/Image.d.ts +22 -2
- package/types/Input.d.ts +66 -5
- package/types/Label.d.ts +18 -4
- package/types/LivePlayer.d.ts +7 -1
- package/types/LivePusher.d.ts +7 -1
- package/types/Map.d.ts +55 -1
- package/types/MatchMedia.d.ts +24 -5
- package/types/MovableArea.d.ts +9 -3
- package/types/MovableView.d.ts +20 -6
- package/types/OfficialAccount.d.ts +0 -6
- package/types/OpenData.d.ts +7 -1
- package/types/PageContainer.d.ts +6 -0
- package/types/Picker.d.ts +64 -1
- package/types/PickerView.d.ts +66 -2
- package/types/PickerViewColumn.d.ts +1 -1
- package/types/Progress.d.ts +12 -1
- package/types/Radio.d.ts +77 -1
- package/types/RichText.d.ts +33 -1
- package/types/ScrollView.d.ts +91 -9
- package/types/Slider.d.ts +14 -1
- package/types/Swiper.d.ts +26 -1
- package/types/SwiperItem.d.ts +28 -3
- package/types/Switch.d.ts +21 -3
- package/types/Text.d.ts +38 -1
- package/types/Textarea.d.ts +17 -1
- package/types/Video.d.ts +41 -21
- package/types/View.d.ts +33 -1
- package/types/VoipRoom.d.ts +5 -6
- package/types/WebView.d.ts +7 -1
- package/dist/taro-components/p-665e8461.system.entry.js +0 -1
- package/dist/taro-components/p-6fcaadc7.entry.js +0 -1
- package/dist/taro-components/p-bb0d4567.system.entry.js +0 -1
|
@@ -28,12 +28,14 @@ let Input = class {
|
|
|
28
28
|
constructor(hostRef) {
|
|
29
29
|
index.registerInstance(this, hostRef);
|
|
30
30
|
this.onInput = index.createEvent(this, "input", 7);
|
|
31
|
+
this.onPaste = index.createEvent(this, "paste", 7);
|
|
31
32
|
this.onFocus = index.createEvent(this, "focus", 7);
|
|
32
33
|
this.onBlur = index.createEvent(this, "blur", 7);
|
|
33
34
|
this.onConfirm = index.createEvent(this, "confirm", 7);
|
|
34
35
|
this.onChange = index.createEvent(this, "change", 7);
|
|
35
36
|
this.onKeyDown = index.createEvent(this, "keydown", 7);
|
|
36
37
|
this.isOnComposition = false;
|
|
38
|
+
this.isOnPaste = false;
|
|
37
39
|
this.onInputExcuted = false;
|
|
38
40
|
this.password = false;
|
|
39
41
|
this.disabled = false;
|
|
@@ -70,6 +72,12 @@ let Input = class {
|
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
};
|
|
75
|
+
this.handlePaste = (e) => {
|
|
76
|
+
this.isOnPaste = true;
|
|
77
|
+
this.onPaste.emit({
|
|
78
|
+
value: e.target.value
|
|
79
|
+
});
|
|
80
|
+
};
|
|
73
81
|
this.handleFocus = (e) => {
|
|
74
82
|
this.onInputExcuted = false;
|
|
75
83
|
this.onFocus.emit({
|
|
@@ -86,6 +94,10 @@ let Input = class {
|
|
|
86
94
|
this.onChange.emit({
|
|
87
95
|
value: e.target.value
|
|
88
96
|
});
|
|
97
|
+
if (this.isOnPaste) {
|
|
98
|
+
this.isOnPaste = false;
|
|
99
|
+
this.onInput.emit({ value: e.target.value });
|
|
100
|
+
}
|
|
89
101
|
};
|
|
90
102
|
this.handleKeyDown = (e) => {
|
|
91
103
|
const { value } = e.target;
|
|
@@ -155,7 +167,7 @@ let Input = class {
|
|
|
155
167
|
const { _value, type, password, placeholder, autoFocus, disabled, maxlength, confirmType, name, nativeProps } = this;
|
|
156
168
|
return (index.h("input", Object.assign({ ref: input => {
|
|
157
169
|
this.inputRef = input;
|
|
158
|
-
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, autoFocus: autoFocus, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
|
|
170
|
+
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, autoFocus: autoFocus, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onPaste: this.handlePaste, onCompositionStart: this.handleComposition, onCompositionEnd: this.handleComposition }, nativeProps)));
|
|
159
171
|
}
|
|
160
172
|
get el() { return index.getElement(this); }
|
|
161
173
|
static get watchers() { return {
|
|
@@ -41,9 +41,9 @@ function debounce(fn, delay) {
|
|
|
41
41
|
let ScrollView = class {
|
|
42
42
|
constructor(hostRef) {
|
|
43
43
|
index.registerInstance(this, hostRef);
|
|
44
|
-
this.onScroll = index.createEvent(this, "scroll",
|
|
45
|
-
this.onScrollToUpper = index.createEvent(this, "scrolltoupper",
|
|
46
|
-
this.onScrollToLower = index.createEvent(this, "scrolltolower",
|
|
44
|
+
this.onScroll = index.createEvent(this, "scroll", 3);
|
|
45
|
+
this.onScrollToUpper = index.createEvent(this, "scrolltoupper", 3);
|
|
46
|
+
this.onScrollToLower = index.createEvent(this, "scrolltolower", 3);
|
|
47
47
|
this.scrollX = false;
|
|
48
48
|
this.scrollY = false;
|
|
49
49
|
this.upperThreshold = 50;
|
|
@@ -131,7 +131,7 @@ const TabbarItem = ({ index: index$2, isSelected = false, textColor, iconPath, b
|
|
|
131
131
|
index$1.h("p", { class: 'weui-tabbar__label', style: { color: textColor } }, text)));
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
-
const indexCss = "html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:
|
|
134
|
+
const indexCss = "html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";
|
|
135
135
|
|
|
136
136
|
// const removeLeadingSlash = str => str.replace(/^\.?\//, '')
|
|
137
137
|
// const removeTrailingSearch = str => str.replace(/\?[\s\S]*$/, '')
|
|
@@ -20,6 +20,7 @@ function fixControlledValue(value) {
|
|
|
20
20
|
export class Input {
|
|
21
21
|
constructor() {
|
|
22
22
|
this.isOnComposition = false;
|
|
23
|
+
this.isOnPaste = false;
|
|
23
24
|
this.onInputExcuted = false;
|
|
24
25
|
this.password = false;
|
|
25
26
|
this.disabled = false;
|
|
@@ -56,6 +57,12 @@ export class Input {
|
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
};
|
|
60
|
+
this.handlePaste = (e) => {
|
|
61
|
+
this.isOnPaste = true;
|
|
62
|
+
this.onPaste.emit({
|
|
63
|
+
value: e.target.value
|
|
64
|
+
});
|
|
65
|
+
};
|
|
59
66
|
this.handleFocus = (e) => {
|
|
60
67
|
this.onInputExcuted = false;
|
|
61
68
|
this.onFocus.emit({
|
|
@@ -72,6 +79,10 @@ export class Input {
|
|
|
72
79
|
this.onChange.emit({
|
|
73
80
|
value: e.target.value
|
|
74
81
|
});
|
|
82
|
+
if (this.isOnPaste) {
|
|
83
|
+
this.isOnPaste = false;
|
|
84
|
+
this.onInput.emit({ value: e.target.value });
|
|
85
|
+
}
|
|
75
86
|
};
|
|
76
87
|
this.handleKeyDown = (e) => {
|
|
77
88
|
const { value } = e.target;
|
|
@@ -141,7 +152,7 @@ export class Input {
|
|
|
141
152
|
const { _value, type, password, placeholder, autoFocus, disabled, maxlength, confirmType, name, nativeProps } = this;
|
|
142
153
|
return (h("input", Object.assign({ ref: input => {
|
|
143
154
|
this.inputRef = input;
|
|
144
|
-
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, autoFocus: autoFocus, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
|
|
155
|
+
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, autoFocus: autoFocus, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onPaste: this.handlePaste, onCompositionStart: this.handleComposition, onCompositionEnd: this.handleComposition }, nativeProps)));
|
|
145
156
|
}
|
|
146
157
|
static get is() { return "taro-input-core"; }
|
|
147
158
|
static get originalStyleUrls() { return {
|
|
@@ -344,6 +355,21 @@ export class Input {
|
|
|
344
355
|
"resolved": "any",
|
|
345
356
|
"references": {}
|
|
346
357
|
}
|
|
358
|
+
}, {
|
|
359
|
+
"method": "onPaste",
|
|
360
|
+
"name": "paste",
|
|
361
|
+
"bubbles": true,
|
|
362
|
+
"cancelable": true,
|
|
363
|
+
"composed": true,
|
|
364
|
+
"docs": {
|
|
365
|
+
"tags": [],
|
|
366
|
+
"text": ""
|
|
367
|
+
},
|
|
368
|
+
"complexType": {
|
|
369
|
+
"original": "any",
|
|
370
|
+
"resolved": "any",
|
|
371
|
+
"references": {}
|
|
372
|
+
}
|
|
347
373
|
}, {
|
|
348
374
|
"method": "onFocus",
|
|
349
375
|
"name": "focus",
|
|
@@ -296,7 +296,7 @@ export class ScrollView {
|
|
|
296
296
|
static get events() { return [{
|
|
297
297
|
"method": "onScroll",
|
|
298
298
|
"name": "scroll",
|
|
299
|
-
"bubbles":
|
|
299
|
+
"bubbles": false,
|
|
300
300
|
"cancelable": true,
|
|
301
301
|
"composed": true,
|
|
302
302
|
"docs": {
|
|
@@ -311,7 +311,7 @@ export class ScrollView {
|
|
|
311
311
|
}, {
|
|
312
312
|
"method": "onScrollToUpper",
|
|
313
313
|
"name": "scrolltoupper",
|
|
314
|
-
"bubbles":
|
|
314
|
+
"bubbles": false,
|
|
315
315
|
"cancelable": true,
|
|
316
316
|
"composed": true,
|
|
317
317
|
"docs": {
|
|
@@ -326,7 +326,7 @@ export class ScrollView {
|
|
|
326
326
|
}, {
|
|
327
327
|
"method": "onScrollToLower",
|
|
328
328
|
"name": "scrolltolower",
|
|
329
|
-
"bubbles":
|
|
329
|
+
"bubbles": false,
|
|
330
330
|
"cancelable": true,
|
|
331
331
|
"composed": true,
|
|
332
332
|
"docs": {
|
|
@@ -24,12 +24,14 @@ let Input = class {
|
|
|
24
24
|
constructor(hostRef) {
|
|
25
25
|
registerInstance(this, hostRef);
|
|
26
26
|
this.onInput = createEvent(this, "input", 7);
|
|
27
|
+
this.onPaste = createEvent(this, "paste", 7);
|
|
27
28
|
this.onFocus = createEvent(this, "focus", 7);
|
|
28
29
|
this.onBlur = createEvent(this, "blur", 7);
|
|
29
30
|
this.onConfirm = createEvent(this, "confirm", 7);
|
|
30
31
|
this.onChange = createEvent(this, "change", 7);
|
|
31
32
|
this.onKeyDown = createEvent(this, "keydown", 7);
|
|
32
33
|
this.isOnComposition = false;
|
|
34
|
+
this.isOnPaste = false;
|
|
33
35
|
this.onInputExcuted = false;
|
|
34
36
|
this.password = false;
|
|
35
37
|
this.disabled = false;
|
|
@@ -66,6 +68,12 @@ let Input = class {
|
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
};
|
|
71
|
+
this.handlePaste = (e) => {
|
|
72
|
+
this.isOnPaste = true;
|
|
73
|
+
this.onPaste.emit({
|
|
74
|
+
value: e.target.value
|
|
75
|
+
});
|
|
76
|
+
};
|
|
69
77
|
this.handleFocus = (e) => {
|
|
70
78
|
this.onInputExcuted = false;
|
|
71
79
|
this.onFocus.emit({
|
|
@@ -82,6 +90,10 @@ let Input = class {
|
|
|
82
90
|
this.onChange.emit({
|
|
83
91
|
value: e.target.value
|
|
84
92
|
});
|
|
93
|
+
if (this.isOnPaste) {
|
|
94
|
+
this.isOnPaste = false;
|
|
95
|
+
this.onInput.emit({ value: e.target.value });
|
|
96
|
+
}
|
|
85
97
|
};
|
|
86
98
|
this.handleKeyDown = (e) => {
|
|
87
99
|
const { value } = e.target;
|
|
@@ -151,7 +163,7 @@ let Input = class {
|
|
|
151
163
|
const { _value, type, password, placeholder, autoFocus, disabled, maxlength, confirmType, name, nativeProps } = this;
|
|
152
164
|
return (h("input", Object.assign({ ref: input => {
|
|
153
165
|
this.inputRef = input;
|
|
154
|
-
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, autoFocus: autoFocus, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
|
|
166
|
+
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, autoFocus: autoFocus, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onPaste: this.handlePaste, onCompositionStart: this.handleComposition, onCompositionEnd: this.handleComposition }, nativeProps)));
|
|
155
167
|
}
|
|
156
168
|
get el() { return getElement(this); }
|
|
157
169
|
static get watchers() { return {
|
|
@@ -37,9 +37,9 @@ function debounce(fn, delay) {
|
|
|
37
37
|
let ScrollView = class {
|
|
38
38
|
constructor(hostRef) {
|
|
39
39
|
registerInstance(this, hostRef);
|
|
40
|
-
this.onScroll = createEvent(this, "scroll",
|
|
41
|
-
this.onScrollToUpper = createEvent(this, "scrolltoupper",
|
|
42
|
-
this.onScrollToLower = createEvent(this, "scrolltolower",
|
|
40
|
+
this.onScroll = createEvent(this, "scroll", 3);
|
|
41
|
+
this.onScrollToUpper = createEvent(this, "scrolltoupper", 3);
|
|
42
|
+
this.onScrollToLower = createEvent(this, "scrolltolower", 3);
|
|
43
43
|
this.scrollX = false;
|
|
44
44
|
this.scrollY = false;
|
|
45
45
|
this.upperThreshold = 50;
|
|
@@ -123,7 +123,7 @@ const TabbarItem = ({ index, isSelected = false, textColor, iconPath, badgeText,
|
|
|
123
123
|
h("p", { class: 'weui-tabbar__label', style: { color: textColor } }, text)));
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
const indexCss = "html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:
|
|
126
|
+
const indexCss = "html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";
|
|
127
127
|
|
|
128
128
|
// const removeLeadingSlash = str => str.replace(/^\.?\//, '')
|
|
129
129
|
// const removeTrailingSearch = str => str.replace(/\?[\s\S]*$/, '')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-5bd7cbab.js";var indexCss="taro-input-core{display:block}input{display:block;height:1.4rem;text-align:inherit;text-overflow:clip;overflow:hidden;white-space:nowrap}";function getTrueType(e,t,n){if(t==="search")e="search";if(n)e="password";if(typeof e==="undefined"){return"text"}if(!e){throw new Error("unexpected type")}if(e==="digit")e="number";return e}function fixControlledValue(e){return e!==null&&e!==void 0?e:""}var Input=function(){function e(e){var t=this;registerInstance(this,e);this.onInput=createEvent(this,"input",7);this.onFocus=createEvent(this,"focus",7);this.onBlur=createEvent(this,"blur",7);this.onConfirm=createEvent(this,"confirm",7);this.onChange=createEvent(this,"change",7);this.onKeyDown=createEvent(this,"keydown",7);this.isOnComposition=false;this.onInputExcuted=false;this.password=false;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.confirmType="done";this.nativeProps={};this.handleInput=function(e){e.stopPropagation();var n=t,i=n.type,o=n.maxlength,a=n.confirmType,s=n.password;if(!t.isOnComposition&&!t.onInputExcuted){var r=e.target.value;var u=getTrueType(i,a,s);t.onInputExcuted=true;if(u==="number"&&r&&o<=r.length){r=r.substring(0,o);e.target.value=r}t._value=r;t.onInput.emit({value:r,cursor:r.length})}};this.handleFocus=function(e){t.onInputExcuted=false;t.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){t.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();t.onChange.emit({value:e.target.value})};this.handleKeyDown=function(e){var n=e.target.value;var i=e.keyCode||e.code;t.onInputExcuted=false;e.stopPropagation();t.onKeyDown.emit({value:n,cursor:n.length,keyCode:i});i===13&&t.onConfirm.emit({value:n})};this.handleComposition=function(e){if(!(e.target instanceof HTMLInputElement))return;if(e.type==="compositionend"){t.isOnComposition=false;t.onInput.emit({value:e.target.value})}else{t.isOnComposition=true}}}e.prototype.watchHandler=function(e,t){if(e!==t){this._value=e}};e.prototype.watchFocus=function(e,t){var n;if(!t&&e){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};e.prototype.componentWillLoad=function(){this._value=this.value};e.prototype.componentDidLoad=function(){var e=this;var t,n,i;if(this.type==="file"){this.fileListener=function(){e.onInput.emit()};(t=this.inputRef)===null||t===void 0?void 0:t.addEventListener("change",this.fileListener)}else{(n=this.inputRef)===null||n===void 0?void 0:n.addEventListener("compositionstart",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.addEventListener("compositionend",this.handleComposition)}Object.defineProperty(this.el,"value",{get:function(){var t;return(t=e.inputRef)===null||t===void 0?void 0:t.value},set:function(t){e._value=t},configurable:true})};e.prototype.disconnectedCallback=function(){var e;if(this.type==="file"){(e=this.inputRef)===null||e===void 0?void 0:e.removeEventListener("change",this.fileListener)}};e.prototype.render=function(){var e=this;var t=this,n=t._value,i=t.type,o=t.password,a=t.placeholder,s=t.autoFocus,r=t.disabled,u=t.maxlength,l=t.confirmType,
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-5bd7cbab.js";var indexCss="taro-input-core{display:block}input{display:block;height:1.4rem;text-align:inherit;text-overflow:clip;overflow:hidden;white-space:nowrap}";function getTrueType(e,t,n){if(t==="search")e="search";if(n)e="password";if(typeof e==="undefined"){return"text"}if(!e){throw new Error("unexpected type")}if(e==="digit")e="number";return e}function fixControlledValue(e){return e!==null&&e!==void 0?e:""}var Input=function(){function e(e){var t=this;registerInstance(this,e);this.onInput=createEvent(this,"input",7);this.onPaste=createEvent(this,"paste",7);this.onFocus=createEvent(this,"focus",7);this.onBlur=createEvent(this,"blur",7);this.onConfirm=createEvent(this,"confirm",7);this.onChange=createEvent(this,"change",7);this.onKeyDown=createEvent(this,"keydown",7);this.isOnComposition=false;this.isOnPaste=false;this.onInputExcuted=false;this.password=false;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.confirmType="done";this.nativeProps={};this.handleInput=function(e){e.stopPropagation();var n=t,i=n.type,o=n.maxlength,a=n.confirmType,s=n.password;if(!t.isOnComposition&&!t.onInputExcuted){var r=e.target.value;var u=getTrueType(i,a,s);t.onInputExcuted=true;if(u==="number"&&r&&o<=r.length){r=r.substring(0,o);e.target.value=r}t._value=r;t.onInput.emit({value:r,cursor:r.length})}};this.handlePaste=function(e){t.isOnPaste=true;t.onPaste.emit({value:e.target.value})};this.handleFocus=function(e){t.onInputExcuted=false;t.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){t.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();t.onChange.emit({value:e.target.value});if(t.isOnPaste){t.isOnPaste=false;t.onInput.emit({value:e.target.value})}};this.handleKeyDown=function(e){var n=e.target.value;var i=e.keyCode||e.code;t.onInputExcuted=false;e.stopPropagation();t.onKeyDown.emit({value:n,cursor:n.length,keyCode:i});i===13&&t.onConfirm.emit({value:n})};this.handleComposition=function(e){if(!(e.target instanceof HTMLInputElement))return;if(e.type==="compositionend"){t.isOnComposition=false;t.onInput.emit({value:e.target.value})}else{t.isOnComposition=true}}}e.prototype.watchHandler=function(e,t){if(e!==t){this._value=e}};e.prototype.watchFocus=function(e,t){var n;if(!t&&e){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};e.prototype.componentWillLoad=function(){this._value=this.value};e.prototype.componentDidLoad=function(){var e=this;var t,n,i;if(this.type==="file"){this.fileListener=function(){e.onInput.emit()};(t=this.inputRef)===null||t===void 0?void 0:t.addEventListener("change",this.fileListener)}else{(n=this.inputRef)===null||n===void 0?void 0:n.addEventListener("compositionstart",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.addEventListener("compositionend",this.handleComposition)}Object.defineProperty(this.el,"value",{get:function(){var t;return(t=e.inputRef)===null||t===void 0?void 0:t.value},set:function(t){e._value=t},configurable:true})};e.prototype.disconnectedCallback=function(){var e;if(this.type==="file"){(e=this.inputRef)===null||e===void 0?void 0:e.removeEventListener("change",this.fileListener)}};e.prototype.render=function(){var e=this;var t=this,n=t._value,i=t.type,o=t.password,a=t.placeholder,s=t.autoFocus,r=t.disabled,u=t.maxlength,l=t.confirmType,p=t.name,c=t.nativeProps;return h("input",Object.assign({ref:function(t){e.inputRef=t},class:"weui-input",value:fixControlledValue(n),type:getTrueType(i,l,o),placeholder:a,autoFocus:s,disabled:r,maxlength:u,name:p,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},c))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["watchHandler"],autoFocus:["watchFocus"]}},enumerable:false,configurable:true});return e}();Input.style=indexCss;export{Input as taro_input_core};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-5bd7cbab.js";import{c as classnames}from"./index-3c78bcaf.js";var indexCss="taro-scroll-view-core{display:block;width:100%;-webkit-overflow-scrolling:auto}taro-scroll-view-core::-webkit-scrollbar{display:none}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}";function easeOutScroll(l,o,r){if(l===o||typeof l!=="number"){return}var e=o-l;var t=500;var s=Date.now();var c=o>=l;function i(l,o,r,e){return r*l/e+o}function n(){l=i(Date.now()-s,l,e,t);if(c&&l>=o||!c&&o>=l){r(o);return}r(l);requestAnimationFrame(n)}n()}function debounce(l,o){var r;return function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}clearTimeout(r);r=setTimeout((function(){l.apply(void 0,e)}),o)}}var ScrollView=function(){function l(l){var o=this;registerInstance(this,l);this.onScroll=createEvent(this,"scroll",
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-5bd7cbab.js";import{c as classnames}from"./index-3c78bcaf.js";var indexCss="taro-scroll-view-core{display:block;width:100%;-webkit-overflow-scrolling:auto}taro-scroll-view-core::-webkit-scrollbar{display:none}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}";function easeOutScroll(l,o,r){if(l===o||typeof l!=="number"){return}var e=o-l;var t=500;var s=Date.now();var c=o>=l;function i(l,o,r,e){return r*l/e+o}function n(){l=i(Date.now()-s,l,e,t);if(c&&l>=o||!c&&o>=l){r(o);return}r(l);requestAnimationFrame(n)}n()}function debounce(l,o){var r;return function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}clearTimeout(r);r=setTimeout((function(){l.apply(void 0,e)}),o)}}var ScrollView=function(){function l(l){var o=this;registerInstance(this,l);this.onScroll=createEvent(this,"scroll",3);this.onScrollToUpper=createEvent(this,"scrolltoupper",3);this.onScrollToLower=createEvent(this,"scrolltolower",3);this.scrollX=false;this.scrollY=false;this.upperThreshold=50;this.lowerThreshold=50;this.scrollWithAnimation=false;this.handleScroll=function(l){if(l instanceof CustomEvent)return;var r=o.el,e=r.scrollLeft,t=r.scrollTop,s=r.scrollHeight,c=r.scrollWidth;o._scrollLeft=e;o._scrollTop=t;o.uperAndLower();o.onScroll.emit({scrollLeft:e,scrollTop:t,scrollHeight:s,scrollWidth:c})};this.uperAndLower=debounce((function(){var l=o.el,r=l.offsetWidth,e=l.offsetHeight,t=l.scrollLeft,s=l.scrollTop,c=l.scrollHeight,i=l.scrollWidth;var n=Number(o.lowerThreshold);var a=Number(o.upperThreshold);if(!isNaN(n)&&(o.scrollY&&e+s+n>=c||o.scrollX&&r+t+n>=i)){o.onScrollToLower.emit({direction:o.scrollX?"right":o.scrollY?"bottom":""})}if(!isNaN(a)&&(o.scrollY&&s<=a||o.scrollX&&t<=a)){o.onScrollToUpper.emit({direction:o.scrollX?"left":o.scrollY?"top":""})}}),200)}l.prototype.watchScrollLeft=function(l){var o=this;var r=Number(l);if(this.scrollX&&!isNaN(r)&&r!==this._scrollLeft){if(this.scrollWithAnimation){easeOutScroll(this._scrollLeft,r,(function(l){return o.el.scrollLeft=l}))}else{this.el.scrollLeft=r}this._scrollLeft=r}};l.prototype.watchScrollTop=function(l){var o=this;var r=Number(l);if(this.scrollY&&!isNaN(r)&&r!==this._scrollTop){if(this.scrollWithAnimation){easeOutScroll(this._scrollTop,r,(function(l){return o.el.scrollTop=l}))}else{this.el.scrollTop=r}this._scrollTop=r}};l.prototype.watchScrollIntoView=function(l){var o;if(typeof l==="string"&&l){(o=document.querySelector("#"+l))===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth",block:"center",inline:"start"})}};l.prototype.componentDidLoad=function(){var l=this;var o=this,r=o.scrollY,e=o.scrollX,t=o.scrollWithAnimation;var s=Number(this.mpScrollTop);var c=Number(this.mpScrollLeft);if(r&&!isNaN(s)){if(t){easeOutScroll(0,s,(function(o){return l.el.scrollTop=o}))}else{this.el.scrollTop=s}this._scrollTop=s}if(e&&!isNaN(c)){if(t){easeOutScroll(0,c,(function(o){return l.el.scrollLeft=o}))}else{this.el.scrollLeft=c}this._scrollLeft=c}};l.prototype.render=function(){var l=this,o=l.scrollX,r=l.scrollY;var e=classnames({"taro-scroll-view__scroll-x":o,"taro-scroll-view__scroll-y":r});return h(Host,{class:e,onScroll:this.handleScroll},h("slot",null))};Object.defineProperty(l.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(l,"watchers",{get:function(){return{mpScrollLeft:["watchScrollLeft"],mpScrollTop:["watchScrollTop"],mpScrollIntoView:["watchScrollIntoView"]}},enumerable:false,configurable:true});return l}();ScrollView.style=indexCss;export{ScrollView as taro_scroll_view_core};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __spreadArray=this&&this.__spreadArray||function(e,a){for(var t=0,r=a.length,o=e.length;t<r;t++,o++)e[o]=a[t];return e};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-5bd7cbab.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-3c78bcaf.js";function isAbsolute(e){return e.charAt(0)==="/"}function spliceOne(e,a){for(var t=a,r=t+1,o=e.length;r<o;t+=1,r+=1){e[t]=e[r]}e.pop()}function resolvePathname(e,a){if(a===undefined)a="";var t=e&&e.split("/")||[];var r=a&&a.split("/")||[];var o=e&&isAbsolute(e);var n=a&&isAbsolute(a);var s=o||n;if(e&&isAbsolute(e)){r=t}else if(t.length){r.pop();r=r.concat(t)}if(!r.length)return"/";var i;if(r.length){var l=r[r.length-1];i=l==="."||l===".."||l===""}else{i=false}var d=0;for(var b=r.length;b>=0;b--){var h=r[b];if(h==="."){spliceOne(r,b)}else if(h===".."){spliceOne(r,b);d++}else if(d){spliceOne(r,b);d--}}if(!s)for(;d--;d)r.unshift("..");if(s&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(i&&c.substr(-1)!=="/")c+="/";return c}var splitUrl=function(e){var a=e||"";var t;var r={path:null,query:null,fragment:null};t=a.indexOf("#");if(t>-1){r.fragment=a.substring(t+1);a=a.substring(0,t)}t=a.indexOf("?");if(t>-1){r.query=a.substring(t+1);a=a.substring(0,t)}r.path=a;return r};var TabbarItem=function(e){var a=e.index,t=e.isSelected,r=t===void 0?false:t,o=e.textColor,n=e.iconPath,s=e.badgeText,i=e.showRedDot,l=i===void 0?false:i,d=e.text,b=e.onSelect;var c=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var f={position:"absolute",top:"-2px",right:"-13px"};var u={position:"absolute",top:"0",right:"-6px"};function v(){b(a)}return h("a",{key:a,href:"javascript:;",class:c,onClick:v},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!s&&h("span",{class:"weui-badge taro-tabbar-badge",style:f},s),l&&h("span",{class:"weui-badge weui-badge_dot",style:u})),h("p",{class:"weui-tabbar__label",style:{color:o}},d))};var indexCss="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";var addLeadingSlash=function(e){return e[0]==="/"?e:"/"+e};var hasBasename=function(e,a){return new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,a){return hasBasename(e,a)?e.substr(a.length):e};var STATUS_SHOW=0;var STATUS_HIDE=1;var STATUS_SLIDEOUT=2;var basicTabBarClassName="taro-tabbar__tabbar";var hideTabBarClassName="taro-tabbar__tabbar-hide";var hideTabBarWithAnimationClassName="taro-tabbar__tabbar-slideout";var Tabbar=function(){function e(e){var a=this;registerInstance(this,e);this.onLongPress=createEvent(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=STATUS_SHOW;this.getOriginUrl=function(e){var t=a.customRoutes.filter((function(a){var t=a[1];var r=splitUrl(t).path;var o=splitUrl(e).path;return r===o}));return t.length?t[0][0]:e};this.getSelectedIndex=function(e){var t=-1;a.list.forEach((function(a,r){var o=a.pagePath;var n=splitUrl(e).path;var s=splitUrl(o).path;if(n===s){t=r}}));return t};this.switchTab=function(e){a.selectedIndex=e;Taro.switchTab({url:a.list[e].pagePath})};this.switchTabHandler=function(e){var t=e.url,r=e.successHandler,o=e.errorHandler;var n=a.getOriginUrl(a.getCurrentUrl()||a.homePage);var s=resolvePathname(t,n);var i=a.getSelectedIndex(s);if(i>-1){a.switchTab(i);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+s+'" is not found'})}};this.routerChangeHandler=function(e){var t;var r;if(e){t=e.toLocation}if(t&&t.path){var o=addLeadingSlash(t.path);r=stripBasename(o==="/"?a.homePage:o,a.conf.basename||"/")}else{r=a.getCurrentUrl()}a.selectedIndex=a.getSelectedIndex(a.getOriginUrl(r))};this.setTabBarBadgeHandler=function(e){var t=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var s=__spreadArray([],a.list);if(t in s){s[t].showRedDot=false;s[t].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}a.list=s};this.removeTabBarBadgeHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}a.list=n};this.showTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}a.list=n};this.hideTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}a.list=n};this.showTabBarHandler=function(e){var t=e.successHandler;a.status=STATUS_SHOW;t({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var t=e.animation,r=e.successHandler;a.status=t?STATUS_SLIDEOUT:STATUS_HIDE;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var t=e.color,r=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,s=e.successHandler;if(o)a.backgroundColor=o;if(n)a.borderStyle=n;if(t)a.color=t;if(r)a.selectedColor=r;s({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var t=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,s=e.successHandler,i=e.errorHandler;var l=__spreadArray([],a.list);if(t in l){if(r)l[t].iconPath=r;if(o)l[t].selectedIconPath=o;if(n)l[t].text=n;s({errMsg:"setTabBarItem:ok"})}else{i({errMsg:"setTabBarItem:fail tabbar item not found"})}a.list=l};var t=this.conf.list;var r=this.conf.customRoutes;if(Object.prototype.toString.call(t)!=="[object Array]"||t.length<2||t.length>5){throw new Error("tabBar 配置错误")}this.homePage=addLeadingSlash(this.conf.homePage);var o=function(e){var a;var t=r[e];e=addLeadingSlash(e);if(typeof t==="string"){n.customRoutes.push([e,addLeadingSlash(t)])}else if((t===null||t===void 0?void 0:t.length)>0){(a=n.customRoutes).push.apply(a,t.map((function(a){return[e,addLeadingSlash(a)]})))}};var n=this;for(var s in r){o(s)}t.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=t;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var a=this.conf.basename||"/";var t;if(e==="hash"){var r=window.location.href;var o=r.indexOf("#");t=o===-1?"":r.substring(o+1)}else{t=location.pathname}var n=addLeadingSlash(stripBasename(t,a));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){Taro.eventCenter.on("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.on("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){Taro.eventCenter.off("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.off("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,a;var t=this;var r=this.tabbarPos,o=r===void 0?"bottom":r;var n=this.status;var s=classnames("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var i=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,basicTabBarClassName+"-"+o,(a={},a[hideTabBarClassName]=i,a[hideTabBarWithAnimationClassName]=l,a))},h("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,a){var r=t.selectedIndex===a;var o;var n;if(r){o=t.selectedColor||"";n=e.selectedIconPath}else{o=t.color||"";n=e.iconPath}return h(TabbarItem,{index:a,onSelect:t.switchTab.bind(t),isSelected:r,textColor:o,iconPath:n,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Tabbar.style=indexCss;export{Tabbar as taro_tabbar};
|
|
1
|
+
var __spreadArray=this&&this.__spreadArray||function(e,a){for(var t=0,r=a.length,o=e.length;t<r;t++,o++)e[o]=a[t];return e};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-5bd7cbab.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-3c78bcaf.js";function isAbsolute(e){return e.charAt(0)==="/"}function spliceOne(e,a){for(var t=a,r=t+1,o=e.length;r<o;t+=1,r+=1){e[t]=e[r]}e.pop()}function resolvePathname(e,a){if(a===undefined)a="";var t=e&&e.split("/")||[];var r=a&&a.split("/")||[];var o=e&&isAbsolute(e);var n=a&&isAbsolute(a);var s=o||n;if(e&&isAbsolute(e)){r=t}else if(t.length){r.pop();r=r.concat(t)}if(!r.length)return"/";var i;if(r.length){var l=r[r.length-1];i=l==="."||l===".."||l===""}else{i=false}var d=0;for(var b=r.length;b>=0;b--){var h=r[b];if(h==="."){spliceOne(r,b)}else if(h===".."){spliceOne(r,b);d++}else if(d){spliceOne(r,b);d--}}if(!s)for(;d--;d)r.unshift("..");if(s&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(i&&c.substr(-1)!=="/")c+="/";return c}var splitUrl=function(e){var a=e||"";var t;var r={path:null,query:null,fragment:null};t=a.indexOf("#");if(t>-1){r.fragment=a.substring(t+1);a=a.substring(0,t)}t=a.indexOf("?");if(t>-1){r.query=a.substring(t+1);a=a.substring(0,t)}r.path=a;return r};var TabbarItem=function(e){var a=e.index,t=e.isSelected,r=t===void 0?false:t,o=e.textColor,n=e.iconPath,s=e.badgeText,i=e.showRedDot,l=i===void 0?false:i,d=e.text,b=e.onSelect;var c=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var f={position:"absolute",top:"-2px",right:"-13px"};var u={position:"absolute",top:"0",right:"-6px"};function v(){b(a)}return h("a",{key:a,href:"javascript:;",class:c,onClick:v},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!s&&h("span",{class:"weui-badge taro-tabbar-badge",style:f},s),l&&h("span",{class:"weui-badge weui-badge_dot",style:u})),h("p",{class:"weui-tabbar__label",style:{color:o}},d))};var indexCss="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";var addLeadingSlash=function(e){return e[0]==="/"?e:"/"+e};var hasBasename=function(e,a){return new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,a){return hasBasename(e,a)?e.substr(a.length):e};var STATUS_SHOW=0;var STATUS_HIDE=1;var STATUS_SLIDEOUT=2;var basicTabBarClassName="taro-tabbar__tabbar";var hideTabBarClassName="taro-tabbar__tabbar-hide";var hideTabBarWithAnimationClassName="taro-tabbar__tabbar-slideout";var Tabbar=function(){function e(e){var a=this;registerInstance(this,e);this.onLongPress=createEvent(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=STATUS_SHOW;this.getOriginUrl=function(e){var t=a.customRoutes.filter((function(a){var t=a[1];var r=splitUrl(t).path;var o=splitUrl(e).path;return r===o}));return t.length?t[0][0]:e};this.getSelectedIndex=function(e){var t=-1;a.list.forEach((function(a,r){var o=a.pagePath;var n=splitUrl(e).path;var s=splitUrl(o).path;if(n===s){t=r}}));return t};this.switchTab=function(e){a.selectedIndex=e;Taro.switchTab({url:a.list[e].pagePath})};this.switchTabHandler=function(e){var t=e.url,r=e.successHandler,o=e.errorHandler;var n=a.getOriginUrl(a.getCurrentUrl()||a.homePage);var s=resolvePathname(t,n);var i=a.getSelectedIndex(s);if(i>-1){a.switchTab(i);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+s+'" is not found'})}};this.routerChangeHandler=function(e){var t;var r;if(e){t=e.toLocation}if(t&&t.path){var o=addLeadingSlash(t.path);r=stripBasename(o==="/"?a.homePage:o,a.conf.basename||"/")}else{r=a.getCurrentUrl()}a.selectedIndex=a.getSelectedIndex(a.getOriginUrl(r))};this.setTabBarBadgeHandler=function(e){var t=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var s=__spreadArray([],a.list);if(t in s){s[t].showRedDot=false;s[t].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}a.list=s};this.removeTabBarBadgeHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}a.list=n};this.showTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}a.list=n};this.hideTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}a.list=n};this.showTabBarHandler=function(e){var t=e.successHandler;a.status=STATUS_SHOW;t({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var t=e.animation,r=e.successHandler;a.status=t?STATUS_SLIDEOUT:STATUS_HIDE;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var t=e.color,r=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,s=e.successHandler;if(o)a.backgroundColor=o;if(n)a.borderStyle=n;if(t)a.color=t;if(r)a.selectedColor=r;s({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var t=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,s=e.successHandler,i=e.errorHandler;var l=__spreadArray([],a.list);if(t in l){if(r)l[t].iconPath=r;if(o)l[t].selectedIconPath=o;if(n)l[t].text=n;s({errMsg:"setTabBarItem:ok"})}else{i({errMsg:"setTabBarItem:fail tabbar item not found"})}a.list=l};var t=this.conf.list;var r=this.conf.customRoutes;if(Object.prototype.toString.call(t)!=="[object Array]"||t.length<2||t.length>5){throw new Error("tabBar 配置错误")}this.homePage=addLeadingSlash(this.conf.homePage);var o=function(e){var a;var t=r[e];e=addLeadingSlash(e);if(typeof t==="string"){n.customRoutes.push([e,addLeadingSlash(t)])}else if((t===null||t===void 0?void 0:t.length)>0){(a=n.customRoutes).push.apply(a,t.map((function(a){return[e,addLeadingSlash(a)]})))}};var n=this;for(var s in r){o(s)}t.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=t;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var a=this.conf.basename||"/";var t;if(e==="hash"){var r=window.location.href;var o=r.indexOf("#");t=o===-1?"":r.substring(o+1)}else{t=location.pathname}var n=addLeadingSlash(stripBasename(t,a));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){Taro.eventCenter.on("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.on("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){Taro.eventCenter.off("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.off("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,a;var t=this;var r=this.tabbarPos,o=r===void 0?"bottom":r;var n=this.status;var s=classnames("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var i=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,basicTabBarClassName+"-"+o,(a={},a[hideTabBarClassName]=i,a[hideTabBarWithAnimationClassName]=l,a))},h("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,a){var r=t.selectedIndex===a;var o;var n;if(r){o=t.selectedColor||"";n=e.selectedIconPath}else{o=t.color||"";n=e.iconPath}return h(TabbarItem,{index:a,onSelect:t.switchTab.bind(t),isSelected:r,textColor:o,iconPath:n,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Tabbar.style=indexCss;export{Tabbar as taro_tabbar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-b2d01686.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(e){t=e.p;r=e.b}],execute:function(){var e=function(){var e=o.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return t(r)};e().then((function(e){return r([["p-fde3a009.system",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-1e4f1702.system",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-b15d0302.system",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-e2f6448d.system",[[0,"taro-ad-core"]]],["p-d1c2481c.system",[[0,"taro-ad-custom-core"]]],["p-3643d8f7.system",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-8f90fca9.system",[[0,"taro-block-core"]]],["p-e0af1d0d.system",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-bd3fa355.system",[[0,"taro-camera-core"]]],["p-fd8312e5.system",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-964692f7.system",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-99ed3ed2.system",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-cfbdd4e3.system",[[0,"taro-custom-wrapper-core"]]],["p-0472e474.system",[[0,"taro-editor-core"]]],["p-1b790eb0.system",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-8b2bf902.system",[[0,"taro-functional-page-navigator-core"]]],["p-17039974.system",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-fcc1c676.system",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-
|
|
1
|
+
System.register(["./p-b2d01686.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(e){t=e.p;r=e.b}],execute:function(){var e=function(){var e=o.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return t(r)};e().then((function(e){return r([["p-fde3a009.system",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-1e4f1702.system",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-b15d0302.system",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-e2f6448d.system",[[0,"taro-ad-core"]]],["p-d1c2481c.system",[[0,"taro-ad-custom-core"]]],["p-3643d8f7.system",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-8f90fca9.system",[[0,"taro-block-core"]]],["p-e0af1d0d.system",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-bd3fa355.system",[[0,"taro-camera-core"]]],["p-fd8312e5.system",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-964692f7.system",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-99ed3ed2.system",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-cfbdd4e3.system",[[0,"taro-custom-wrapper-core"]]],["p-0472e474.system",[[0,"taro-editor-core"]]],["p-1b790eb0.system",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-8b2bf902.system",[[0,"taro-functional-page-navigator-core"]]],["p-17039974.system",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-fcc1c676.system",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-9dc9c615.system",[[0,"taro-input-core",{value:[1],type:[1],password:[4],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],confirmType:[1,"confirm-type"],name:[1],nativeProps:[16],_value:[32]}]]],["p-0c2982fc.system",[[0,"taro-keyboard-accessory-core"]]],["p-7d848382.system",[[4,"taro-label-core",{for:[1]}]]],["p-7cdad34e.system",[[0,"taro-live-player-core"]]],["p-527a38ee.system",[[0,"taro-live-pusher-core"]]],["p-ebf5b2eb.system",[[0,"taro-map-core"]]],["p-cdffee54.system",[[0,"taro-match-media-core"]]],["p-264b7229.system",[[0,"taro-movable-area-core"]]],["p-fb0959c1.system",[[0,"taro-movable-view-core"]]],["p-e03fa2d5.system",[[0,"taro-navigation-bar-core"]]],["p-98b47fc9.system",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["p-7423fc3b.system",[[0,"taro-official-account-core"]]],["p-9a618935.system",[[0,"taro-open-data-core"]]],["p-3334ac67.system",[[0,"taro-page-container-core"]]],["p-df5a19b0.system",[[0,"taro-page-meta-core"]]],["p-fb2252b7.system",[[0,"taro-picker-view-column-core"]]],["p-43de2f12.system",[[0,"taro-picker-view-core"]]],["p-cea9a198.system",[[0,"taro-progress-core",{percent:[2],showInfo:[4,"show-info"],borderRadius:[8,"border-radius"],fontSize:[8,"font-size"],strokeWidth:[8,"stroke-width"],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],active:[4]}]]],["p-04818461.system",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["p-fdd73355.system",[[0,"taro-rich-text-core",{nodes:[1]}]]],["p-fd0d1168.system",[[4,"taro-scroll-view-core",{scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],upperThreshold:[8,"upper-threshold"],lowerThreshold:[8,"lower-threshold"],mpScrollTop:[8,"scroll-top"],mpScrollLeft:[8,"scroll-left"],mpScrollIntoView:[1,"scroll-into-view"],scrollWithAnimation:[4,"scroll-with-animation"]}]]],["p-336f2b2a.system",[[0,"taro-share-element-core"]]],["p-703dfad8.system",[[0,"taro-slider-core",{min:[2],max:[2],step:[2],disabled:[4],value:[1026],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],blockSize:[2,"block-size"],blockColor:[1,"block-color"],showValue:[4,"show-value"],name:[1],val:[32],totalWidth:[32],touching:[32],ogX:[32],touchId:[32],percent:[32],ogPercent:[32],isWillLoadCalled:[32]}]]],["p-06af26db.system",[[0,"taro-slot-core"]]],["p-ffe63ce9.system",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["p-abe415b4.system",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["p-50066d5e.system",[[4,"taro-text-core",{selectable:[4]}]]],["p-2dc57c71.system",[[0,"taro-textarea-core",{value:[1],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],autoHeight:[4,"auto-height"],name:[1],nativeProps:[16],line:[32]}]]],["p-fe156231.system",[[4,"taro-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-99cb65a6.system",[[0,"taro-voip-room-core"]]],["p-9fc88fc1.system",[[0,"taro-web-view-core",{src:[1]}]]],["p-fc4939c6.system",[[4,"taro-picker-core",{mode:[1],disabled:[4],range:[16],rangeKey:[1,"range-key"],value:[8],start:[1],end:[1],fields:[1],name:[1],pickerValue:[32],height:[32],hidden:[32],fadeOut:[32],isWillLoadCalled:[32]}],[0,"taro-picker-group",{mode:[1],range:[16],rangeKey:[1,"range-key"],height:[2],columnId:[1,"column-id"],updateHeight:[16],onColumnChange:[16],updateDay:[16],startY:[32],preY:[32],hadMove:[32],touchEnd:[32],isMove:[32]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-d394a61f.system",[[0,"taro-video-core",{src:[1],duration:[2],controls:[4],autoplay:[4],loop:[4],muted:[4],initialTime:[2,"initial-time"],poster:[1],objectFit:[1,"object-fit"],showProgress:[4,"show-progress"],showFullscreenBtn:[4,"show-fullscreen-btn"],showPlayBtn:[4,"show-play-btn"],showCenterPlayBtn:[4,"show-center-play-btn"],showMuteBtn:[4,"show-mute-btn"],danmuList:[16],danmuBtn:[4,"danmu-btn"],enableDanmu:[4,"enable-danmu"],enablePlayGesture:[4,"enable-play-gesture"],enableProgressGesture:[4,"enable-progress-gesture"],vslideGesture:[4,"vslide-gesture"],vslideGestureInFullscreen:[4,"vslide-gesture-in-fullscreen"],nativeProps:[16],_duration:[32],_enableDanmu:[32],isPlaying:[32],isFirst:[32],isFullScreen:[32],fullScreenTimestamp:[32],isMute:[32],play:[64],pause:[64],stop:[64],seek:[64],requestFullScreen:[64],exitFullScreen:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{controls:[4],currentTime:[2,"current-time"],duration:[2],isPlaying:[4,"is-playing"],pauseFunc:[16],playFunc:[16],seekFunc:[16],showPlayBtn:[4,"show-play-btn"],showProgress:[4,"show-progress"],setProgressBall:[64],toggleVisibility:[64],getIsDraggingProgressBall:[64],setCurrentTime:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{enable:[4],danmuList:[32],sendDanmu:[64],tick:[64]}]]]],e)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-b2d01686.system.js"],(function(t){"use strict";var e,n,i,o;return{setters:[function(t){e=t.r;n=t.c;i=t.h;o=t.g}],execute:function(){var s="taro-input-core{display:block}input{display:block;height:1.4rem;text-align:inherit;text-overflow:clip;overflow:hidden;white-space:nowrap}";function a(t,e,n){if(e==="search")t="search";if(n)t="password";if(typeof t==="undefined"){return"text"}if(!t){throw new Error("unexpected type")}if(t==="digit")t="number";return t}function u(t){return t!==null&&t!==void 0?t:""}var r=t("taro_input_core",function(){function t(t){var i=this;e(this,t);this.onInput=n(this,"input",7);this.onPaste=n(this,"paste",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onKeyDown=n(this,"keydown",7);this.isOnComposition=false;this.isOnPaste=false;this.onInputExcuted=false;this.password=false;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.confirmType="done";this.nativeProps={};this.handleInput=function(t){t.stopPropagation();var e=i,n=e.type,o=e.maxlength,s=e.confirmType,u=e.password;if(!i.isOnComposition&&!i.onInputExcuted){var r=t.target.value;var l=a(n,s,u);i.onInputExcuted=true;if(l==="number"&&r&&o<=r.length){r=r.substring(0,o);t.target.value=r}i._value=r;i.onInput.emit({value:r,cursor:r.length})}};this.handlePaste=function(t){i.isOnPaste=true;i.onPaste.emit({value:t.target.value})};this.handleFocus=function(t){i.onInputExcuted=false;i.onFocus.emit({value:t.target.value})};this.handleBlur=function(t){i.onBlur.emit({value:t.target.value})};this.handleChange=function(t){t.stopPropagation();i.onChange.emit({value:t.target.value});if(i.isOnPaste){i.isOnPaste=false;i.onInput.emit({value:t.target.value})}};this.handleKeyDown=function(t){var e=t.target.value;var n=t.keyCode||t.code;i.onInputExcuted=false;t.stopPropagation();i.onKeyDown.emit({value:e,cursor:e.length,keyCode:n});n===13&&i.onConfirm.emit({value:e})};this.handleComposition=function(t){if(!(t.target instanceof HTMLInputElement))return;if(t.type==="compositionend"){i.isOnComposition=false;i.onInput.emit({value:t.target.value})}else{i.isOnComposition=true}}}t.prototype.watchHandler=function(t,e){if(t!==e){this._value=t}};t.prototype.watchFocus=function(t,e){var n;if(!e&&t){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};t.prototype.componentWillLoad=function(){this._value=this.value};t.prototype.componentDidLoad=function(){var t=this;var e,n,i;if(this.type==="file"){this.fileListener=function(){t.onInput.emit()};(e=this.inputRef)===null||e===void 0?void 0:e.addEventListener("change",this.fileListener)}else{(n=this.inputRef)===null||n===void 0?void 0:n.addEventListener("compositionstart",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.addEventListener("compositionend",this.handleComposition)}Object.defineProperty(this.el,"value",{get:function(){var e;return(e=t.inputRef)===null||e===void 0?void 0:e.value},set:function(e){t._value=e},configurable:true})};t.prototype.disconnectedCallback=function(){var t;if(this.type==="file"){(t=this.inputRef)===null||t===void 0?void 0:t.removeEventListener("change",this.fileListener)}};t.prototype.render=function(){var t=this;var e=this,n=e._value,o=e.type,s=e.password,r=e.placeholder,l=e.autoFocus,h=e.disabled,p=e.maxlength,c=e.confirmType,f=e.name,d=e.nativeProps;return i("input",Object.assign({ref:function(e){t.inputRef=e},class:"weui-input",value:u(n),type:a(o,c,s),placeholder:r,autoFocus:l,disabled:h,maxlength:p,name:f,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},d))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["watchHandler"],autoFocus:["watchFocus"]}},enumerable:false,configurable:true});return t}());r.style=s}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __spreadArray=this&&this.__spreadArray||function(e,t){for(var r=0,a=t.length,o=e.length;r<a;r++,o++)e[o]=t[r];return e};System.register(["./p-b2d01686.system.js","@tarojs/taro","./p-94c20f60.system.js"],(function(e){"use strict";var t,r,a,o,n,i,s;return{setters:[function(e){t=e.h;r=e.r;a=e.c;o=e.H;n=e.g},function(e){i=e.default},function(e){s=e.c}],execute:function(){function l(e){return e.charAt(0)==="/"}function d(e,t){for(var r=t,a=r+1,o=e.length;a<o;r+=1,a+=1){e[r]=e[a]}e.pop()}function b(e,t){if(t===undefined)t="";var r=e&&e.split("/")||[];var a=t&&t.split("/")||[];var o=e&&l(e);var n=t&&l(t);var i=o||n;if(e&&l(e)){a=r}else if(r.length){a.pop();a=a.concat(r)}if(!a.length)return"/";var s;if(a.length){var b=a[a.length-1];s=b==="."||b===".."||b===""}else{s=false}var h=0;for(var c=a.length;c>=0;c--){var f=a[c];if(f==="."){d(a,c)}else if(f===".."){d(a,c);h++}else if(h){d(a,c);h--}}if(!i)for(;h--;h)a.unshift("..");if(i&&a[0]!==""&&(!a[0]||!l(a[0])))a.unshift("");var u=a.join("/");if(s&&u.substr(-1)!=="/")u+="/";return u}var h=function(e){var t=e||"";var r;var a={path:null,query:null,fragment:null};r=t.indexOf("#");if(r>-1){a.fragment=t.substring(r+1);t=t.substring(0,r)}r=t.indexOf("?");if(r>-1){a.query=t.substring(r+1);t=t.substring(0,r)}a.path=t;return a};var c=function(e){var r=e.index,a=e.isSelected,o=a===void 0?false:a,n=e.textColor,i=e.iconPath,l=e.badgeText,d=e.showRedDot,b=d===void 0?false:d,h=e.text,c=e.onSelect;var f=s("weui-tabbar__item",{"weui-bar__item_on":o});var u={position:"absolute",top:"-2px",right:"-13px"};var v={position:"absolute",top:"0",right:"-6px"};function g(){c(r)}return t("a",{key:r,href:"javascript:;",class:f,onClick:g},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:i,alt:"",class:"weui-tabbar__icon"}),!!l&&t("span",{class:"weui-badge taro-tabbar-badge",style:u},l),b&&t("span",{class:"weui-badge weui-badge_dot",style:v})),t("p",{class:"weui-tabbar__label",style:{color:n}},h))};var f="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";var u=function(e){return e[0]==="/"?e:"/"+e};var v=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var g=function(e,t){return v(e,t)?e.substr(t.length):e};var _=0;var p=1;var T=2;var B="taro-tabbar__tabbar";var m="taro-tabbar__tabbar-hide";var H="taro-tabbar__tabbar-slideout";var x=e("taro_tabbar",function(){function e(e){var t=this;r(this,e);this.onLongPress=a(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=_;this.getOriginUrl=function(e){var r=t.customRoutes.filter((function(t){var r=t[1];var a=h(r).path;var o=h(e).path;return a===o}));return r.length?r[0][0]:e};this.getSelectedIndex=function(e){var r=-1;t.list.forEach((function(t,a){var o=t.pagePath;var n=h(e).path;var i=h(o).path;if(n===i){r=a}}));return r};this.switchTab=function(e){t.selectedIndex=e;i.switchTab({url:t.list[e].pagePath})};this.switchTabHandler=function(e){var r=e.url,a=e.successHandler,o=e.errorHandler;var n=t.getOriginUrl(t.getCurrentUrl()||t.homePage);var i=b(r,n);var s=t.getSelectedIndex(i);if(s>-1){t.switchTab(s);a({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+i+'" is not found'})}};this.routerChangeHandler=function(e){var r;var a;if(e){r=e.toLocation}if(r&&r.path){var o=u(r.path);a=g(o==="/"?t.homePage:o,t.conf.basename||"/")}else{a=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(a))};this.setTabBarBadgeHandler=function(e){var r=e.index,a=e.text,o=e.successHandler,n=e.errorHandler;var i=__spreadArray([],t.list);if(r in i){i[r].showRedDot=false;i[r].badgeText=a;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}t.list=i};this.removeTabBarBadgeHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].badgeText=null;a({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}t.list=n};this.showTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].showRedDot=true;a({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}t.list=n};this.hideTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].showRedDot=false;a({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}t.list=n};this.showTabBarHandler=function(e){var r=e.successHandler;t.status=_;r({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var r=e.animation,a=e.successHandler;t.status=r?T:p;a({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var r=e.color,a=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,i=e.successHandler;if(o)t.backgroundColor=o;if(n)t.borderStyle=n;if(r)t.color=r;if(a)t.selectedColor=a;i({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var r=e.index,a=e.iconPath,o=e.selectedIconPath,n=e.text,i=e.successHandler,s=e.errorHandler;var l=__spreadArray([],t.list);if(r in l){if(a)l[r].iconPath=a;if(o)l[r].selectedIconPath=o;if(n)l[r].text=n;i({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}t.list=l};var o=this.conf.list;var n=this.conf.customRoutes;if(Object.prototype.toString.call(o)!=="[object Array]"||o.length<2||o.length>5){throw new Error("tabBar 配置错误")}this.homePage=u(this.conf.homePage);var s=function(e){var t;var r=n[e];e=u(e);if(typeof r==="string"){l.customRoutes.push([e,u(r)])}else if((r===null||r===void 0?void 0:r.length)>0){(t=l.customRoutes).push.apply(t,r.map((function(t){return[e,u(t)]})))}};var l=this;for(var d in n){s(d)}o.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=o;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var t=this.conf.basename||"/";var r;if(e==="hash"){var a=window.location.href;var o=a.indexOf("#");r=o===-1?"":a.substring(o+1)}else{r=location.pathname}var n=u(g(r,t));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){i.eventCenter.on("__taroRouterChange",this.routerChangeHandler);i.eventCenter.on("__taroSwitchTab",this.switchTabHandler);i.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);i.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);i.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);i.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);i.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);i.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);i.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);i.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){i.eventCenter.off("__taroRouterChange",this.routerChangeHandler);i.eventCenter.off("__taroSwitchTab",this.switchTabHandler);i.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);i.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);i.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);i.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);i.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);i.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);i.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);i.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,r;var a=this;var n=this.tabbarPos,i=n===void 0?"bottom":n;var l=this.status;var d=s("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var b=this.selectedIndex===-1||l===p;var h=l===T;return t(o,{class:s(B,B+"-"+i,(r={},r[m]=b,r[H]=h,r))},t("div",{class:d,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,r){var o=a.selectedIndex===r;var n;var i;if(o){n=a.selectedColor||"";i=e.selectedIconPath}else{n=a.color||"";i=e.iconPath}return t(c,{index:r,onSelect:a.switchTab.bind(a),isSelected:o,textColor:n,iconPath:i,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());x.style=f}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,g as h}from"./p-f05e1558.js";function e(t,i,s){if("search"===i&&(t="search"),s&&(t="password"),void 0===t)return"text";if(!t)throw new Error("unexpected type");return"digit"===t&&(t="number"),t}let o=class{constructor(s){t(this,s),this.onInput=i(this,"input",7),this.onPaste=i(this,"paste",7),this.onFocus=i(this,"focus",7),this.onBlur=i(this,"blur",7),this.onConfirm=i(this,"confirm",7),this.onChange=i(this,"change",7),this.onKeyDown=i(this,"keydown",7),this.isOnComposition=!1,this.isOnPaste=!1,this.onInputExcuted=!1,this.password=!1,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.confirmType="done",this.nativeProps={},this.handleInput=t=>{t.stopPropagation();const{type:i,maxlength:s,confirmType:h,password:o}=this;if(!this.isOnComposition&&!this.onInputExcuted){let n=t.target.value;const a=e(i,h,o);this.onInputExcuted=!0,"number"===a&&n&&s<=n.length&&(n=n.substring(0,s),t.target.value=n),this._value=n,this.onInput.emit({value:n,cursor:n.length})}},this.handlePaste=t=>{this.isOnPaste=!0,this.onPaste.emit({value:t.target.value})},this.handleFocus=t=>{this.onInputExcuted=!1,this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value}),this.isOnPaste&&(this.isOnPaste=!1,this.onInput.emit({value:t.target.value}))},this.handleKeyDown=t=>{const{value:i}=t.target,s=t.keyCode||t.code;this.onInputExcuted=!1,t.stopPropagation(),this.onKeyDown.emit({value:i,cursor:i.length,keyCode:s}),13===s&&this.onConfirm.emit({value:i})},this.handleComposition=t=>{t.target instanceof HTMLInputElement&&("compositionend"===t.type?(this.isOnComposition=!1,this.onInput.emit({value:t.target.value})):this.isOnComposition=!0)}}watchHandler(t,i){t!==i&&(this._value=t)}watchFocus(t,i){var s;!i&&t&&(null===(s=this.inputRef)||void 0===s||s.focus())}componentWillLoad(){this._value=this.value}componentDidLoad(){var t,i,s;"file"===this.type?(this.fileListener=()=>{this.onInput.emit()},null===(t=this.inputRef)||void 0===t||t.addEventListener("change",this.fileListener)):(null===(i=this.inputRef)||void 0===i||i.addEventListener("compositionstart",this.handleComposition),null===(s=this.inputRef)||void 0===s||s.addEventListener("compositionend",this.handleComposition)),Object.defineProperty(this.el,"value",{get:()=>{var t;return null===(t=this.inputRef)||void 0===t?void 0:t.value},set:t=>{this._value=t},configurable:!0})}disconnectedCallback(){var t;"file"===this.type&&(null===(t=this.inputRef)||void 0===t||t.removeEventListener("change",this.fileListener))}render(){const{_value:t,type:i,password:h,placeholder:o,autoFocus:n,disabled:a,maxlength:r,confirmType:l,name:u,nativeProps:c}=this;return s("input",Object.assign({ref:t=>{this.inputRef=t},class:"weui-input",value:(d=t,null!=d?d:""),type:e(i,l,h),placeholder:o,autoFocus:n,disabled:a,maxlength:r,name:u,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},c));var d}get el(){return h(this)}static get watchers(){return{value:["watchHandler"],autoFocus:["watchFocus"]}}};o.style="taro-input-core{display:block}input{display:block;height:1.4rem;text-align:inherit;text-overflow:clip;overflow:hidden;white-space:nowrap}";export{o as taro_input_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as o,H as i,g as l}from"./p-f05e1558.js";import{c as r}from"./p-37cfdd8f.js";function c(t,s,o){if(t===s||"number"!=typeof t)return;const i=s-t,l=Date.now(),r=s>=t;!function c(){var e;e=Date.now()-l,t=i*e/500+t,r&&t>=s||!r&&s>=t?o(s):(o(t),requestAnimationFrame(c))}()}let e=class{constructor(o){t(this,o),this.onScroll=s(this,"scroll",
|
|
1
|
+
import{r as t,c as s,h as o,H as i,g as l}from"./p-f05e1558.js";import{c as r}from"./p-37cfdd8f.js";function c(t,s,o){if(t===s||"number"!=typeof t)return;const i=s-t,l=Date.now(),r=s>=t;!function c(){var e;e=Date.now()-l,t=i*e/500+t,r&&t>=s||!r&&s>=t?o(s):(o(t),requestAnimationFrame(c))}()}let e=class{constructor(o){t(this,o),this.onScroll=s(this,"scroll",3),this.onScrollToUpper=s(this,"scrolltoupper",3),this.onScrollToLower=s(this,"scrolltolower",3),this.scrollX=!1,this.scrollY=!1,this.upperThreshold=50,this.lowerThreshold=50,this.scrollWithAnimation=!1,this.handleScroll=t=>{if(t instanceof CustomEvent)return;const{scrollLeft:s,scrollTop:o,scrollHeight:i,scrollWidth:l}=this.el;this._scrollLeft=s,this._scrollTop=o,this.uperAndLower(),this.onScroll.emit({scrollLeft:s,scrollTop:o,scrollHeight:i,scrollWidth:l})},this.uperAndLower=function(t){let s;return function(...o){clearTimeout(s),s=setTimeout((function(){t(...o)}),200)}}((()=>{const{offsetWidth:t,offsetHeight:s,scrollLeft:o,scrollTop:i,scrollHeight:l,scrollWidth:r}=this.el,c=Number(this.lowerThreshold),e=Number(this.upperThreshold);!isNaN(c)&&(this.scrollY&&s+i+c>=l||this.scrollX&&t+o+c>=r)&&this.onScrollToLower.emit({direction:this.scrollX?"right":this.scrollY?"bottom":""}),!isNaN(e)&&(this.scrollY&&i<=e||this.scrollX&&o<=e)&&this.onScrollToUpper.emit({direction:this.scrollX?"left":this.scrollY?"top":""})}))}watchScrollLeft(t){const s=Number(t);this.scrollX&&!isNaN(s)&&s!==this._scrollLeft&&(this.scrollWithAnimation?c(this._scrollLeft,s,(t=>this.el.scrollLeft=t)):this.el.scrollLeft=s,this._scrollLeft=s)}watchScrollTop(t){const s=Number(t);this.scrollY&&!isNaN(s)&&s!==this._scrollTop&&(this.scrollWithAnimation?c(this._scrollTop,s,(t=>this.el.scrollTop=t)):this.el.scrollTop=s,this._scrollTop=s)}watchScrollIntoView(t){var s;"string"==typeof t&&t&&(null===(s=document.querySelector(`#${t}`))||void 0===s||s.scrollIntoView({behavior:"smooth",block:"center",inline:"start"}))}componentDidLoad(){const{scrollY:t,scrollX:s,scrollWithAnimation:o}=this,i=Number(this.mpScrollTop),l=Number(this.mpScrollLeft);t&&!isNaN(i)&&(o?c(0,i,(t=>this.el.scrollTop=t)):this.el.scrollTop=i,this._scrollTop=i),s&&!isNaN(l)&&(o?c(0,l,(t=>this.el.scrollLeft=t)):this.el.scrollLeft=l,this._scrollLeft=l)}render(){const{scrollX:t,scrollY:s}=this,l=r({"taro-scroll-view__scroll-x":t,"taro-scroll-view__scroll-y":s});return o(i,{class:l,onScroll:this.handleScroll},o("slot",null))}get el(){return l(this)}static get watchers(){return{mpScrollLeft:["watchScrollLeft"],mpScrollTop:["watchScrollTop"],mpScrollIntoView:["watchScrollIntoView"]}}};e.style="taro-scroll-view-core{display:block;width:100%;-webkit-overflow-scrolling:auto}taro-scroll-view-core::-webkit-scrollbar{display:none}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}";export{e as taro_scroll_view_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as a,c as r,H as e,g as s}from"./p-f05e1558.js";import o from"@tarojs/taro";import{c as i}from"./p-37cfdd8f.js";function h(t){return"/"===t.charAt(0)}function n(t,a){for(var r=a,e=r+1,s=t.length;e<s;r+=1,e+=1)t[r]=t[e];t.pop()}const b=t=>{let a,r=t||"";const e={path:null,query:null,fragment:null};return a=r.indexOf("#"),a>-1&&(e.fragment=r.substring(a+1),r=r.substring(0,a)),a=r.indexOf("?"),a>-1&&(e.query=r.substring(a+1),r=r.substring(0,a)),e.path=r,e},l=({index:a,isSelected:r=!1,textColor:e,iconPath:s,badgeText:o,showRedDot:h=!1,text:n,onSelect:b})=>{const l=i("weui-tabbar__item",{"weui-bar__item_on":r});return t("a",{key:a,href:"javascript:;",class:l,onClick:function(){b(a)}},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:s,alt:"",class:"weui-tabbar__icon"}),!!o&&t("span",{class:"weui-badge taro-tabbar-badge",style:{position:"absolute",top:"-2px",right:"-13px"}},o),h&&t("span",{class:"weui-badge weui-badge_dot",style:{position:"absolute",top:"0",right:"-6px"}})),t("p",{class:"weui-tabbar__label",style:{color:e}},n))},d=t=>"/"===t[0]?t:`/${t}`,c=(t,a)=>((t,a)=>new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(t))(t,a)?t.substr(a.length):t;let _=class{constructor(t){a(this,t),this.onLongPress=r(this,"longpress",7),this.homePage="",this.customRoutes=[],this.tabbarPos="bottom",this.selectedIndex=-1,this.status=0,this.getOriginUrl=t=>{const a=this.customRoutes.filter((([,a])=>b(a).path===b(t).path));return a.length?a[0][0]:t},this.getSelectedIndex=t=>{let a=-1;return this.list.forEach((({pagePath:r},e)=>{b(t).path===b(r).path&&(a=e)})),a},this.switchTab=t=>{this.selectedIndex=t,o.switchTab({url:this.list[t].pagePath})},this.switchTabHandler=({url:t,successHandler:a,errorHandler:r})=>{const e=function(t,a){void 0===a&&(a="");var r,e=t&&t.split("/")||[],s=a&&a.split("/")||[],o=t&&h(t),i=a&&h(a),b=o||i;if(t&&h(t)?s=e:e.length&&(s.pop(),s=s.concat(e)),!s.length)return"/";if(s.length){var l=s[s.length-1];r="."===l||".."===l||""===l}else r=!1;for(var d=0,c=s.length;c>=0;c--){var _=s[c];"."===_?n(s,c):".."===_?(n(s,c),d++):d&&(n(s,c),d--)}if(!b)for(;d--;d)s.unshift("..");!b||""===s[0]||s[0]&&h(s[0])||s.unshift("");var u=s.join("/");return r&&"/"!==u.substr(-1)&&(u+="/"),u}(t,this.getOriginUrl(this.getCurrentUrl()||this.homePage)),s=this.getSelectedIndex(e);s>-1?(this.switchTab(s),a({errMsg:"switchTab:ok"})):r({errMsg:`switchTab:fail page "${e}" is not found`})},this.routerChangeHandler=t=>{let a,r;if(t&&(a=t.toLocation),a&&a.path){const t=d(a.path);r=c("/"===t?this.homePage:t,this.conf.basename||"/")}else r=this.getCurrentUrl();this.selectedIndex=this.getSelectedIndex(this.getOriginUrl(r))},this.setTabBarBadgeHandler=({index:t,text:a,successHandler:r,errorHandler:e})=>{const s=[...this.list];t in s?(s[t].showRedDot=!1,s[t].badgeText=a,r({errMsg:"setTabBarBadge:ok"})):e({errMsg:"setTabBarBadge:fail tabbar item not found"}),this.list=s},this.removeTabBarBadgeHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].badgeText=null,e[t].badgeText=null,a({errMsg:"removeTabBarBadge:ok"})):r({errMsg:"removeTabBarBadge:fail tabbar item not found"}),this.list=e},this.showTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].badgeText=null,e[t].showRedDot=!0,a({errMsg:"showTabBarRedDot:ok"})):r({errMsg:"showTabBarRedDot:fail tabbar item not found"}),this.list=e},this.hideTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].showRedDot=!1,a({errMsg:"hideTabBarRedDot:ok"})):r({errMsg:"hideTabBarRedDot:fail tabbar item not found"}),this.list=e},this.showTabBarHandler=({successHandler:t})=>{this.status=0,t({errMsg:"showTabBar:ok"})},this.hideTabBarHandler=({animation:t,successHandler:a})=>{this.status=t?2:1,a({errMsg:"hideTabBar:ok"})},this.setTabBarStyleHandler=({color:t,selectedColor:a,backgroundColor:r,borderStyle:e,successHandler:s})=>{r&&(this.backgroundColor=r),e&&(this.borderStyle=e),t&&(this.color=t),a&&(this.selectedColor=a),s({errMsg:"setTabBarStyle:ok"})},this.setTabBarItemHandler=({index:t,iconPath:a,selectedIconPath:r,text:e,successHandler:s,errorHandler:o})=>{const i=[...this.list];t in i?(a&&(i[t].iconPath=a),r&&(i[t].selectedIconPath=r),e&&(i[t].text=e),s({errMsg:"setTabBarItem:ok"})):o({errMsg:"setTabBarItem:fail tabbar item not found"}),this.list=i};const e=this.conf.list,s=this.conf.customRoutes;if("[object Array]"!==Object.prototype.toString.call(e)||e.length<2||e.length>5)throw new Error("tabBar 配置错误");this.homePage=d(this.conf.homePage);for(let t in s){const a=s[t];t=d(t),"string"==typeof a?this.customRoutes.push([t,d(a)]):(null==a?void 0:a.length)>0&&this.customRoutes.push(...a.map((a=>[t,d(a)])))}e.forEach((t=>{0!==t.pagePath.indexOf("/")&&(t.pagePath="/"+t.pagePath)})),this.list=e,this.borderStyle=this.conf.borderStyle,this.backgroundColor=this.conf.backgroundColor,this.color=this.conf.color,this.selectedColor=this.conf.selectedColor}getCurrentUrl(){const t=this.conf.basename||"/";let a;if("hash"===this.conf.mode){const t=window.location.href,r=t.indexOf("#");a=-1===r?"":t.substring(r+1)}else a=location.pathname;const r=d(c(a,t));return"/"===r?this.homePage:r}bindEvent(){o.eventCenter.on("__taroRouterChange",this.routerChangeHandler),o.eventCenter.on("__taroSwitchTab",this.switchTabHandler),o.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler),o.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),o.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),o.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),o.eventCenter.on("__taroShowTabBar",this.showTabBarHandler),o.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler),o.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler),o.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)}removeEvent(){o.eventCenter.off("__taroRouterChange",this.routerChangeHandler),o.eventCenter.off("__taroSwitchTab",this.switchTabHandler),o.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler),o.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),o.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),o.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),o.eventCenter.off("__taroShowTabBar",this.showTabBarHandler),o.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler),o.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler),o.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)}componentDidLoad(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom",this.bindEvent(),this.routerChangeHandler()}disconnectedCallback(){this.removeEvent()}render(){const{tabbarPos:a="bottom"}=this,r=this.status,s=i("weui-tabbar",{[`taro-tabbar__border-${this.borderStyle||"black"}`]:!0});return t(e,{class:i("taro-tabbar__tabbar",`taro-tabbar__tabbar-${a}`,{"taro-tabbar__tabbar-hide":-1===this.selectedIndex||1===r,"taro-tabbar__tabbar-slideout":2===r})},t("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map(((a,r)=>{const e=this.selectedIndex===r;let s,o;return e?(s=this.selectedColor||"",o=a.selectedIconPath):(s=this.color||"",o=a.iconPath),t(l,{index:r,onSelect:this.switchTab.bind(this),isSelected:e,textColor:s,iconPath:o,text:a.text,badgeText:a.badgeText,showRedDot:a.showRedDot})}))))}get tabbar(){return s(this)}};_.style="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:
|
|
1
|
+
import{h as t,r as a,c as r,H as e,g as s}from"./p-f05e1558.js";import o from"@tarojs/taro";import{c as i}from"./p-37cfdd8f.js";function h(t){return"/"===t.charAt(0)}function n(t,a){for(var r=a,e=r+1,s=t.length;e<s;r+=1,e+=1)t[r]=t[e];t.pop()}const b=t=>{let a,r=t||"";const e={path:null,query:null,fragment:null};return a=r.indexOf("#"),a>-1&&(e.fragment=r.substring(a+1),r=r.substring(0,a)),a=r.indexOf("?"),a>-1&&(e.query=r.substring(a+1),r=r.substring(0,a)),e.path=r,e},l=({index:a,isSelected:r=!1,textColor:e,iconPath:s,badgeText:o,showRedDot:h=!1,text:n,onSelect:b})=>{const l=i("weui-tabbar__item",{"weui-bar__item_on":r});return t("a",{key:a,href:"javascript:;",class:l,onClick:function(){b(a)}},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:s,alt:"",class:"weui-tabbar__icon"}),!!o&&t("span",{class:"weui-badge taro-tabbar-badge",style:{position:"absolute",top:"-2px",right:"-13px"}},o),h&&t("span",{class:"weui-badge weui-badge_dot",style:{position:"absolute",top:"0",right:"-6px"}})),t("p",{class:"weui-tabbar__label",style:{color:e}},n))},d=t=>"/"===t[0]?t:`/${t}`,c=(t,a)=>((t,a)=>new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(t))(t,a)?t.substr(a.length):t;let _=class{constructor(t){a(this,t),this.onLongPress=r(this,"longpress",7),this.homePage="",this.customRoutes=[],this.tabbarPos="bottom",this.selectedIndex=-1,this.status=0,this.getOriginUrl=t=>{const a=this.customRoutes.filter((([,a])=>b(a).path===b(t).path));return a.length?a[0][0]:t},this.getSelectedIndex=t=>{let a=-1;return this.list.forEach((({pagePath:r},e)=>{b(t).path===b(r).path&&(a=e)})),a},this.switchTab=t=>{this.selectedIndex=t,o.switchTab({url:this.list[t].pagePath})},this.switchTabHandler=({url:t,successHandler:a,errorHandler:r})=>{const e=function(t,a){void 0===a&&(a="");var r,e=t&&t.split("/")||[],s=a&&a.split("/")||[],o=t&&h(t),i=a&&h(a),b=o||i;if(t&&h(t)?s=e:e.length&&(s.pop(),s=s.concat(e)),!s.length)return"/";if(s.length){var l=s[s.length-1];r="."===l||".."===l||""===l}else r=!1;for(var d=0,c=s.length;c>=0;c--){var _=s[c];"."===_?n(s,c):".."===_?(n(s,c),d++):d&&(n(s,c),d--)}if(!b)for(;d--;d)s.unshift("..");!b||""===s[0]||s[0]&&h(s[0])||s.unshift("");var u=s.join("/");return r&&"/"!==u.substr(-1)&&(u+="/"),u}(t,this.getOriginUrl(this.getCurrentUrl()||this.homePage)),s=this.getSelectedIndex(e);s>-1?(this.switchTab(s),a({errMsg:"switchTab:ok"})):r({errMsg:`switchTab:fail page "${e}" is not found`})},this.routerChangeHandler=t=>{let a,r;if(t&&(a=t.toLocation),a&&a.path){const t=d(a.path);r=c("/"===t?this.homePage:t,this.conf.basename||"/")}else r=this.getCurrentUrl();this.selectedIndex=this.getSelectedIndex(this.getOriginUrl(r))},this.setTabBarBadgeHandler=({index:t,text:a,successHandler:r,errorHandler:e})=>{const s=[...this.list];t in s?(s[t].showRedDot=!1,s[t].badgeText=a,r({errMsg:"setTabBarBadge:ok"})):e({errMsg:"setTabBarBadge:fail tabbar item not found"}),this.list=s},this.removeTabBarBadgeHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].badgeText=null,e[t].badgeText=null,a({errMsg:"removeTabBarBadge:ok"})):r({errMsg:"removeTabBarBadge:fail tabbar item not found"}),this.list=e},this.showTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].badgeText=null,e[t].showRedDot=!0,a({errMsg:"showTabBarRedDot:ok"})):r({errMsg:"showTabBarRedDot:fail tabbar item not found"}),this.list=e},this.hideTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].showRedDot=!1,a({errMsg:"hideTabBarRedDot:ok"})):r({errMsg:"hideTabBarRedDot:fail tabbar item not found"}),this.list=e},this.showTabBarHandler=({successHandler:t})=>{this.status=0,t({errMsg:"showTabBar:ok"})},this.hideTabBarHandler=({animation:t,successHandler:a})=>{this.status=t?2:1,a({errMsg:"hideTabBar:ok"})},this.setTabBarStyleHandler=({color:t,selectedColor:a,backgroundColor:r,borderStyle:e,successHandler:s})=>{r&&(this.backgroundColor=r),e&&(this.borderStyle=e),t&&(this.color=t),a&&(this.selectedColor=a),s({errMsg:"setTabBarStyle:ok"})},this.setTabBarItemHandler=({index:t,iconPath:a,selectedIconPath:r,text:e,successHandler:s,errorHandler:o})=>{const i=[...this.list];t in i?(a&&(i[t].iconPath=a),r&&(i[t].selectedIconPath=r),e&&(i[t].text=e),s({errMsg:"setTabBarItem:ok"})):o({errMsg:"setTabBarItem:fail tabbar item not found"}),this.list=i};const e=this.conf.list,s=this.conf.customRoutes;if("[object Array]"!==Object.prototype.toString.call(e)||e.length<2||e.length>5)throw new Error("tabBar 配置错误");this.homePage=d(this.conf.homePage);for(let t in s){const a=s[t];t=d(t),"string"==typeof a?this.customRoutes.push([t,d(a)]):(null==a?void 0:a.length)>0&&this.customRoutes.push(...a.map((a=>[t,d(a)])))}e.forEach((t=>{0!==t.pagePath.indexOf("/")&&(t.pagePath="/"+t.pagePath)})),this.list=e,this.borderStyle=this.conf.borderStyle,this.backgroundColor=this.conf.backgroundColor,this.color=this.conf.color,this.selectedColor=this.conf.selectedColor}getCurrentUrl(){const t=this.conf.basename||"/";let a;if("hash"===this.conf.mode){const t=window.location.href,r=t.indexOf("#");a=-1===r?"":t.substring(r+1)}else a=location.pathname;const r=d(c(a,t));return"/"===r?this.homePage:r}bindEvent(){o.eventCenter.on("__taroRouterChange",this.routerChangeHandler),o.eventCenter.on("__taroSwitchTab",this.switchTabHandler),o.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler),o.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),o.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),o.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),o.eventCenter.on("__taroShowTabBar",this.showTabBarHandler),o.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler),o.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler),o.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)}removeEvent(){o.eventCenter.off("__taroRouterChange",this.routerChangeHandler),o.eventCenter.off("__taroSwitchTab",this.switchTabHandler),o.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler),o.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),o.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),o.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),o.eventCenter.off("__taroShowTabBar",this.showTabBarHandler),o.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler),o.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler),o.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)}componentDidLoad(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom",this.bindEvent(),this.routerChangeHandler()}disconnectedCallback(){this.removeEvent()}render(){const{tabbarPos:a="bottom"}=this,r=this.status,s=i("weui-tabbar",{[`taro-tabbar__border-${this.borderStyle||"black"}`]:!0});return t(e,{class:i("taro-tabbar__tabbar",`taro-tabbar__tabbar-${a}`,{"taro-tabbar__tabbar-hide":-1===this.selectedIndex||1===r,"taro-tabbar__tabbar-slideout":2===r})},t("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map(((a,r)=>{const e=this.selectedIndex===r;let s,o;return e?(s=this.selectedColor||"",o=a.selectedIconPath):(s=this.color||"",o=a.iconPath),t(l,{index:r,onSelect:this.switchTab.bind(this),isSelected:e,textColor:s,iconPath:o,text:a.text,badgeText:a.badgeText,showRedDot:a.showRedDot})}))))}get tabbar(){return s(this)}};_.style="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";export{_ as taro_tabbar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-b2d01686.system.js","./p-94c20f60.system.js"],(function(l){"use strict";var o,r,t,e,s,i;return{setters:[function(l){o=l.r;r=l.c;t=l.h;e=l.H;s=l.g},function(l){i=l.c}],execute:function(){var c="taro-scroll-view-core{display:block;width:100%;-webkit-overflow-scrolling:auto}taro-scroll-view-core::-webkit-scrollbar{display:none}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}";function n(l,o,r){if(l===o||typeof l!=="number"){return}var t=o-l;var e=500;var s=Date.now();var i=o>=l;function c(l,o,r,t){return r*l/t+o}function n(){l=c(Date.now()-s,l,t,e);if(i&&l>=o||!i&&o>=l){r(o);return}r(l);requestAnimationFrame(n)}n()}function f(l,o){var r;return function(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}clearTimeout(r);r=setTimeout((function(){l.apply(void 0,t)}),o)}}var h=l("taro_scroll_view_core",function(){function l(l){var t=this;o(this,l);this.onScroll=r(this,"scroll",
|
|
1
|
+
System.register(["./p-b2d01686.system.js","./p-94c20f60.system.js"],(function(l){"use strict";var o,r,t,e,s,i;return{setters:[function(l){o=l.r;r=l.c;t=l.h;e=l.H;s=l.g},function(l){i=l.c}],execute:function(){var c="taro-scroll-view-core{display:block;width:100%;-webkit-overflow-scrolling:auto}taro-scroll-view-core::-webkit-scrollbar{display:none}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}";function n(l,o,r){if(l===o||typeof l!=="number"){return}var t=o-l;var e=500;var s=Date.now();var i=o>=l;function c(l,o,r,t){return r*l/t+o}function n(){l=c(Date.now()-s,l,t,e);if(i&&l>=o||!i&&o>=l){r(o);return}r(l);requestAnimationFrame(n)}n()}function f(l,o){var r;return function(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}clearTimeout(r);r=setTimeout((function(){l.apply(void 0,t)}),o)}}var h=l("taro_scroll_view_core",function(){function l(l){var t=this;o(this,l);this.onScroll=r(this,"scroll",3);this.onScrollToUpper=r(this,"scrolltoupper",3);this.onScrollToLower=r(this,"scrolltolower",3);this.scrollX=false;this.scrollY=false;this.upperThreshold=50;this.lowerThreshold=50;this.scrollWithAnimation=false;this.handleScroll=function(l){if(l instanceof CustomEvent)return;var o=t.el,r=o.scrollLeft,e=o.scrollTop,s=o.scrollHeight,i=o.scrollWidth;t._scrollLeft=r;t._scrollTop=e;t.uperAndLower();t.onScroll.emit({scrollLeft:r,scrollTop:e,scrollHeight:s,scrollWidth:i})};this.uperAndLower=f((function(){var l=t.el,o=l.offsetWidth,r=l.offsetHeight,e=l.scrollLeft,s=l.scrollTop,i=l.scrollHeight,c=l.scrollWidth;var n=Number(t.lowerThreshold);var f=Number(t.upperThreshold);if(!isNaN(n)&&(t.scrollY&&r+s+n>=i||t.scrollX&&o+e+n>=c)){t.onScrollToLower.emit({direction:t.scrollX?"right":t.scrollY?"bottom":""})}if(!isNaN(f)&&(t.scrollY&&s<=f||t.scrollX&&e<=f)){t.onScrollToUpper.emit({direction:t.scrollX?"left":t.scrollY?"top":""})}}),200)}l.prototype.watchScrollLeft=function(l){var o=this;var r=Number(l);if(this.scrollX&&!isNaN(r)&&r!==this._scrollLeft){if(this.scrollWithAnimation){n(this._scrollLeft,r,(function(l){return o.el.scrollLeft=l}))}else{this.el.scrollLeft=r}this._scrollLeft=r}};l.prototype.watchScrollTop=function(l){var o=this;var r=Number(l);if(this.scrollY&&!isNaN(r)&&r!==this._scrollTop){if(this.scrollWithAnimation){n(this._scrollTop,r,(function(l){return o.el.scrollTop=l}))}else{this.el.scrollTop=r}this._scrollTop=r}};l.prototype.watchScrollIntoView=function(l){var o;if(typeof l==="string"&&l){(o=document.querySelector("#"+l))===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth",block:"center",inline:"start"})}};l.prototype.componentDidLoad=function(){var l=this;var o=this,r=o.scrollY,t=o.scrollX,e=o.scrollWithAnimation;var s=Number(this.mpScrollTop);var i=Number(this.mpScrollLeft);if(r&&!isNaN(s)){if(e){n(0,s,(function(o){return l.el.scrollTop=o}))}else{this.el.scrollTop=s}this._scrollTop=s}if(t&&!isNaN(i)){if(e){n(0,i,(function(o){return l.el.scrollLeft=o}))}else{this.el.scrollLeft=i}this._scrollLeft=i}};l.prototype.render=function(){var l=this,o=l.scrollX,r=l.scrollY;var s=i({"taro-scroll-view__scroll-x":o,"taro-scroll-view__scroll-y":r});return t(e,{class:s,onScroll:this.handleScroll},t("slot",null))};Object.defineProperty(l.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(l,"watchers",{get:function(){return{mpScrollLeft:["watchScrollLeft"],mpScrollTop:["watchScrollTop"],mpScrollIntoView:["watchScrollIntoView"]}},enumerable:false,configurable:true});return l}());h.style=c}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-f05e1558.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),e(r)})().then((e=>o([["p-d5971476",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-55b0a30b",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-32937866",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-cf55a63c",[[0,"taro-ad-core"]]],["p-14dbbb42",[[0,"taro-ad-custom-core"]]],["p-5f8b5f62",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-b9280444",[[0,"taro-block-core"]]],["p-83dedaa2",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-c218c298",[[0,"taro-camera-core"]]],["p-4dbed323",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-9d0ab7c4",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-74540410",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-a1423df9",[[0,"taro-custom-wrapper-core"]]],["p-94502fc3",[[0,"taro-editor-core"]]],["p-8a5e67cb",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-3c0230ba",[[0,"taro-functional-page-navigator-core"]]],["p-11932905",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-9eb7dfa8",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-f05e1558.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),e(r)})().then((e=>o([["p-d5971476",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-55b0a30b",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-32937866",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-cf55a63c",[[0,"taro-ad-core"]]],["p-14dbbb42",[[0,"taro-ad-custom-core"]]],["p-5f8b5f62",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-b9280444",[[0,"taro-block-core"]]],["p-83dedaa2",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-c218c298",[[0,"taro-camera-core"]]],["p-4dbed323",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-9d0ab7c4",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-74540410",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-a1423df9",[[0,"taro-custom-wrapper-core"]]],["p-94502fc3",[[0,"taro-editor-core"]]],["p-8a5e67cb",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-3c0230ba",[[0,"taro-functional-page-navigator-core"]]],["p-11932905",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-9eb7dfa8",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-b55fedc1",[[0,"taro-input-core",{value:[1],type:[1],password:[4],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],confirmType:[1,"confirm-type"],name:[1],nativeProps:[16],_value:[32]}]]],["p-0303f9e0",[[0,"taro-keyboard-accessory-core"]]],["p-e27798a4",[[4,"taro-label-core",{for:[1]}]]],["p-cb395e7d",[[0,"taro-live-player-core"]]],["p-0ee69803",[[0,"taro-live-pusher-core"]]],["p-3dfb1807",[[0,"taro-map-core"]]],["p-92e95d3f",[[0,"taro-match-media-core"]]],["p-554e1039",[[0,"taro-movable-area-core"]]],["p-b75d8a65",[[0,"taro-movable-view-core"]]],["p-065ec61d",[[0,"taro-navigation-bar-core"]]],["p-2d2f8064",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["p-15bea37d",[[0,"taro-official-account-core"]]],["p-c362734b",[[0,"taro-open-data-core"]]],["p-b6d6c744",[[0,"taro-page-container-core"]]],["p-7721e046",[[0,"taro-page-meta-core"]]],["p-95529dc0",[[0,"taro-picker-view-column-core"]]],["p-5c420456",[[0,"taro-picker-view-core"]]],["p-06bffead",[[0,"taro-progress-core",{percent:[2],showInfo:[4,"show-info"],borderRadius:[8,"border-radius"],fontSize:[8,"font-size"],strokeWidth:[8,"stroke-width"],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],active:[4]}]]],["p-56618f09",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["p-8db237e0",[[0,"taro-rich-text-core",{nodes:[1]}]]],["p-cc818a13",[[4,"taro-scroll-view-core",{scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],upperThreshold:[8,"upper-threshold"],lowerThreshold:[8,"lower-threshold"],mpScrollTop:[8,"scroll-top"],mpScrollLeft:[8,"scroll-left"],mpScrollIntoView:[1,"scroll-into-view"],scrollWithAnimation:[4,"scroll-with-animation"]}]]],["p-cfbfeee8",[[0,"taro-share-element-core"]]],["p-3633bb84",[[0,"taro-slider-core",{min:[2],max:[2],step:[2],disabled:[4],value:[1026],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],blockSize:[2,"block-size"],blockColor:[1,"block-color"],showValue:[4,"show-value"],name:[1],val:[32],totalWidth:[32],touching:[32],ogX:[32],touchId:[32],percent:[32],ogPercent:[32],isWillLoadCalled:[32]}]]],["p-b87cf623",[[0,"taro-slot-core"]]],["p-e6298500",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["p-e1040131",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["p-d567b95e",[[4,"taro-text-core",{selectable:[4]}]]],["p-63ff7fa7",[[0,"taro-textarea-core",{value:[1],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],autoHeight:[4,"auto-height"],name:[1],nativeProps:[16],line:[32]}]]],["p-17cf8b5b",[[4,"taro-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-59d38db0",[[0,"taro-voip-room-core"]]],["p-8bc82aaa",[[0,"taro-web-view-core",{src:[1]}]]],["p-865c21b5",[[4,"taro-picker-core",{mode:[1],disabled:[4],range:[16],rangeKey:[1,"range-key"],value:[8],start:[1],end:[1],fields:[1],name:[1],pickerValue:[32],height:[32],hidden:[32],fadeOut:[32],isWillLoadCalled:[32]}],[0,"taro-picker-group",{mode:[1],range:[16],rangeKey:[1,"range-key"],height:[2],columnId:[1,"column-id"],updateHeight:[16],onColumnChange:[16],updateDay:[16],startY:[32],preY:[32],hadMove:[32],touchEnd:[32],isMove:[32]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-431197bc",[[0,"taro-video-core",{src:[1],duration:[2],controls:[4],autoplay:[4],loop:[4],muted:[4],initialTime:[2,"initial-time"],poster:[1],objectFit:[1,"object-fit"],showProgress:[4,"show-progress"],showFullscreenBtn:[4,"show-fullscreen-btn"],showPlayBtn:[4,"show-play-btn"],showCenterPlayBtn:[4,"show-center-play-btn"],showMuteBtn:[4,"show-mute-btn"],danmuList:[16],danmuBtn:[4,"danmu-btn"],enableDanmu:[4,"enable-danmu"],enablePlayGesture:[4,"enable-play-gesture"],enableProgressGesture:[4,"enable-progress-gesture"],vslideGesture:[4,"vslide-gesture"],vslideGestureInFullscreen:[4,"vslide-gesture-in-fullscreen"],nativeProps:[16],_duration:[32],_enableDanmu:[32],isPlaying:[32],isFirst:[32],isFullScreen:[32],fullScreenTimestamp:[32],isMute:[32],play:[64],pause:[64],stop:[64],seek:[64],requestFullScreen:[64],exitFullScreen:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{controls:[4],currentTime:[2,"current-time"],duration:[2],isPlaying:[4,"is-playing"],pauseFunc:[16],playFunc:[16],seekFunc:[16],showPlayBtn:[4,"show-play-btn"],showProgress:[4,"show-progress"],setProgressBall:[64],toggleVisibility:[64],getIsDraggingProgressBall:[64],setCurrentTime:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{enable:[4],danmuList:[32],sendDanmu:[64],tick:[64]}]]]],e)));
|