@tarojs/components 3.3.14 → 3.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-cover-image-core.cjs.entry.js +17 -3
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +49 -3
- package/dist/cjs/taro-input-core.cjs.entry.js +4 -4
- package/dist/cjs/taro-tabbar.cjs.entry.js +66 -20
- package/dist/cjs/taro-textarea-core.cjs.entry.js +63 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/cover-image/cover-image.js +94 -0
- package/dist/collection/components/cover-image/style/index.css +5 -0
- package/dist/collection/components/cover-view/cover-view.js +166 -4
- package/dist/collection/components/cover-view/style/cover-view.css +3 -0
- package/dist/collection/components/input/input.js +4 -4
- package/dist/collection/components/tabbar/tabbar.js +70 -20
- package/dist/collection/components/textarea/style/index.css +6 -2
- package/dist/collection/components/textarea/textarea.js +98 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-cover-image-core.entry.js +18 -4
- package/dist/esm/taro-cover-view-core.entry.js +50 -4
- package/dist/esm/taro-input-core.entry.js +4 -4
- package/dist/esm/taro-tabbar.entry.js +66 -20
- package/dist/esm/taro-textarea-core.entry.js +63 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-cover-image-core.entry.js +1 -1
- package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
- package/dist/taro-components/p-139d4d14.entry.js +1 -0
- package/dist/taro-components/p-30bfacb9.system.js +1 -1
- package/dist/taro-components/p-33bcdee9.entry.js +1 -0
- package/dist/taro-components/p-39bee235.entry.js +1 -0
- package/dist/taro-components/p-79b3c05a.entry.js +1 -0
- package/dist/taro-components/p-8235b7b7.system.entry.js +1 -0
- package/dist/taro-components/p-9bd65170.system.entry.js +1 -0
- package/dist/taro-components/p-be2d1c4a.system.entry.js +1 -0
- package/dist/taro-components/p-cb8099dd.entry.js +1 -0
- package/dist/taro-components/p-d8363f59.system.entry.js +1 -0
- package/dist/taro-components/{p-2ef4681b.system.entry.js → p-d9494012.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/cover-image/cover-image.d.ts +11 -0
- package/dist/types/components/cover-view/cover-view.d.ts +14 -2
- package/dist/types/components/tabbar/tabbar.d.ts +20 -1
- package/dist/types/components/textarea/textarea.d.ts +6 -0
- package/dist/types/components.d.ts +18 -0
- package/dist-h5/vue/createComponent.js +4 -0
- package/dist-h5/vue/createFormsComponent.js +8 -1
- package/package.json +4 -4
- package/dist/collection/components/cover-view/cover-image.js +0 -11
- package/dist/taro-components/p-2c5d57af.entry.js +0 -1
- package/dist/taro-components/p-382cabbc.system.entry.js +0 -1
- package/dist/taro-components/p-70f40e3a.entry.js +0 -1
- package/dist/taro-components/p-af9ec312.system.entry.js +0 -1
- package/dist/taro-components/p-b6e0dca6.entry.js +0 -1
- package/dist/taro-components/p-c221cebb.system.entry.js +0 -1
- package/dist/taro-components/p-c5722042.entry.js +0 -1
- package/dist/taro-components/p-f8d0dabb.entry.js +0 -1
- package/dist/taro-components/p-f9013b36.system.entry.js +0 -1
- package/dist/types/components/cover-view/cover-image.d.ts +0 -4
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["taro-checkbox-core_2",[[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"]]]]],["taro-radio-core_2",[[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"]]]]],["taro-swiper-core_2",[[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"]}]]],["taro-audio-core",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["taro-block-core",[[0,"taro-block-core"]]],["taro-button-core",[[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"]]]]],["taro-camera-core",[[0,"taro-camera-core"]]],["taro-canvas-core",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["taro-cover-image-core",[[0,"taro-cover-image-core"]]],["taro-cover-view-core",[[
|
|
16
|
+
return bootstrapLazy([["taro-checkbox-core_2",[[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"]]]]],["taro-radio-core_2",[[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"]]]]],["taro-swiper-core_2",[[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"]}]]],["taro-audio-core",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["taro-block-core",[[0,"taro-block-core"]]],["taro-button-core",[[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"]]]]],["taro-camera-core",[[0,"taro-camera-core"]]],["taro-canvas-core",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["taro-cover-image-core",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["taro-cover-view-core",[[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"]]]]],["taro-custom-wrapper-core",[[0,"taro-custom-wrapper-core"]]],["taro-form-core",[[4,"taro-form-core",{"slotParent":[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["taro-icon-core",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["taro-image-core",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32]}]]],["taro-input-core",[[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]}]]],["taro-label-core",[[4,"taro-label-core",{"for":[1]}]]],["taro-movable-area-core",[[0,"taro-movable-area-core"]]],["taro-movable-view-core",[[0,"taro-movable-view-core"]]],["taro-navigator-core",[[0,"taro-navigator-core",{"hoverClass":[1,"hover-class"],"url":[1],"openType":[1,"open-type"],"isHover":[4,"is-hover"],"delta":[2]},[[0,"click","onClick"]]]]],["taro-open-data-core",[[0,"taro-open-data-core"]]],["taro-picker-view-column-core",[[0,"taro-picker-view-column-core"]]],["taro-picker-view-core",[[0,"taro-picker-view-core"]]],["taro-progress-core",[[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]}]]],["taro-pull-to-refresh",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["taro-rich-text-core",[[0,"taro-rich-text-core",{"nodes":[1]}]]],["taro-scroll-view-core",[[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"]}]]],["taro-slider-core",[[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]}]]],["taro-switch-core",[[0,"taro-switch-core",{"type":[1],"checked":[4],"color":[1],"name":[1],"disabled":[4],"nativeProps":[16],"isChecked":[32],"isWillLoadCalled":[32]}]]],["taro-tabbar",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["taro-text-core",[[4,"taro-text-core",{"selectable":[4]}]]],["taro-textarea-core",[[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]}]]],["taro-view-core",[[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"]]]]],["taro-web-view-core",[[0,"taro-web-view-core",{"src":[1]}]]],["taro-picker-core_2",[[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"]]]]],["taro-video-control_3",[[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]}]]]], options);
|
|
17
17
|
});
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-165a6222.js';
|
|
2
|
+
|
|
3
|
+
const indexCss = "taro-cover-image-core{overflow:hidden;width:320px;height:240px}";
|
|
2
4
|
|
|
3
5
|
let CoverImage = class {
|
|
4
6
|
constructor(hostRef) {
|
|
5
7
|
registerInstance(this, hostRef);
|
|
8
|
+
this.onLoad = createEvent(this, "load", 7);
|
|
9
|
+
this.onError = createEvent(this, "error", 7);
|
|
10
|
+
this.nativeProps = {};
|
|
11
|
+
}
|
|
12
|
+
imageOnLoad() {
|
|
13
|
+
const { width, height, } = this.imgRef;
|
|
14
|
+
this.onLoad.emit({
|
|
15
|
+
width,
|
|
16
|
+
height
|
|
17
|
+
});
|
|
6
18
|
}
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
imageOnError() {
|
|
20
|
+
this.onError.emit();
|
|
9
21
|
}
|
|
10
22
|
render() {
|
|
11
|
-
|
|
23
|
+
const { src, imageOnLoad, imageOnError, nativeProps } = this;
|
|
24
|
+
return (h("img", Object.assign({ ref: img => (this.imgRef = img), src: src, onLoad: imageOnLoad.bind(this), onError: imageOnError.bind(this) }, nativeProps)));
|
|
12
25
|
}
|
|
13
26
|
};
|
|
27
|
+
CoverImage.style = indexCss;
|
|
14
28
|
|
|
15
29
|
export { CoverImage as taro_cover_image_core };
|
|
@@ -1,15 +1,61 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-165a6222.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-165a6222.js';
|
|
2
|
+
import { c as classnames } from './index-85e10859.js';
|
|
3
|
+
|
|
4
|
+
const coverViewCss = "taro-cover-view-core{display:block}";
|
|
2
5
|
|
|
3
6
|
let CoverView = class {
|
|
4
7
|
constructor(hostRef) {
|
|
5
8
|
registerInstance(this, hostRef);
|
|
9
|
+
this.onLongPress = createEvent(this, "longpress", 7);
|
|
10
|
+
this.hoverStartTime = 50;
|
|
11
|
+
this.hoverStayTime = 400;
|
|
12
|
+
this.hover = false;
|
|
13
|
+
this.touch = false;
|
|
14
|
+
this.startTime = 0;
|
|
15
|
+
}
|
|
16
|
+
onTouchStart() {
|
|
17
|
+
if (this.hoverClass) {
|
|
18
|
+
this.touch = true;
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
if (this.touch) {
|
|
21
|
+
this.hover = true;
|
|
22
|
+
}
|
|
23
|
+
}, this.hoverStartTime);
|
|
24
|
+
}
|
|
25
|
+
this.timeoutEvent = setTimeout(() => {
|
|
26
|
+
this.onLongPress.emit();
|
|
27
|
+
}, 350);
|
|
28
|
+
this.startTime = Date.now();
|
|
29
|
+
}
|
|
30
|
+
onTouchMove() {
|
|
31
|
+
clearTimeout(this.timeoutEvent);
|
|
6
32
|
}
|
|
7
|
-
|
|
8
|
-
|
|
33
|
+
onTouchEnd() {
|
|
34
|
+
const spanTime = Date.now() - this.startTime;
|
|
35
|
+
if (spanTime < 350) {
|
|
36
|
+
clearTimeout(this.timeoutEvent);
|
|
37
|
+
}
|
|
38
|
+
if (this.hoverClass) {
|
|
39
|
+
this.touch = false;
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
if (!this.touch) {
|
|
42
|
+
this.hover = false;
|
|
43
|
+
}
|
|
44
|
+
}, this.hoverStayTime);
|
|
45
|
+
}
|
|
9
46
|
}
|
|
10
47
|
render() {
|
|
11
|
-
|
|
48
|
+
const cls = classnames({
|
|
49
|
+
[`${this.hoverClass}`]: this.hover
|
|
50
|
+
});
|
|
51
|
+
let attr = {};
|
|
52
|
+
if (!!this.animation) {
|
|
53
|
+
attr['animation'] = this.animation;
|
|
54
|
+
attr['data-animation'] = this.animation;
|
|
55
|
+
}
|
|
56
|
+
return (h(Host, Object.assign({ class: cls }, attr), h("slot", null)));
|
|
12
57
|
}
|
|
13
58
|
};
|
|
59
|
+
CoverView.style = coverViewCss;
|
|
14
60
|
|
|
15
61
|
export { CoverView as taro_cover_view_core };
|
|
@@ -122,7 +122,7 @@ let Input = class {
|
|
|
122
122
|
this._value = this.value;
|
|
123
123
|
}
|
|
124
124
|
componentDidLoad() {
|
|
125
|
-
var _a, _b, _c;
|
|
125
|
+
var _a, _b, _c, _d;
|
|
126
126
|
if (this.type === 'file') {
|
|
127
127
|
this.fileListener = () => {
|
|
128
128
|
this.onInput.emit();
|
|
@@ -140,6 +140,7 @@ let Input = class {
|
|
|
140
140
|
},
|
|
141
141
|
configurable: true
|
|
142
142
|
});
|
|
143
|
+
this.autoFocus && ((_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.focus());
|
|
143
144
|
}
|
|
144
145
|
disconnectedCallback() {
|
|
145
146
|
var _a;
|
|
@@ -148,11 +149,10 @@ let Input = class {
|
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
render() {
|
|
151
|
-
const { _value, type, password, placeholder, disabled, maxlength,
|
|
152
|
+
const { _value, type, password, placeholder, disabled, maxlength, confirmType, name, nativeProps } = this;
|
|
152
153
|
return (h("input", Object.assign({ ref: input => {
|
|
153
154
|
this.inputRef = input;
|
|
154
|
-
|
|
155
|
-
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, disabled: disabled, maxlength: maxlength, autofocus: autoFocus, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
|
|
155
|
+
}, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
|
|
156
156
|
}
|
|
157
157
|
get el() { return getElement(this); }
|
|
158
158
|
static get watchers() { return {
|
|
@@ -152,18 +152,18 @@ let Tabbar = class {
|
|
|
152
152
|
this.status = STATUS_SHOW;
|
|
153
153
|
this.getOriginUrl = (url) => {
|
|
154
154
|
const customRoute = this.customRoutes.filter(([, customUrl]) => {
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
return
|
|
155
|
+
const pathA = splitUrl(customUrl).path;
|
|
156
|
+
const pathB = splitUrl(url).path;
|
|
157
|
+
return pathA === pathB;
|
|
158
158
|
});
|
|
159
159
|
return customRoute.length ? customRoute[0][0] : url;
|
|
160
160
|
};
|
|
161
161
|
this.getSelectedIndex = (url) => {
|
|
162
162
|
let foundIndex = -1;
|
|
163
163
|
this.list.forEach(({ pagePath }, idx) => {
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
164
|
+
const pathA = splitUrl(url).path;
|
|
165
|
+
const pathB = splitUrl(pagePath).path;
|
|
166
|
+
if (pathA === pathB) {
|
|
167
167
|
foundIndex = idx;
|
|
168
168
|
}
|
|
169
169
|
});
|
|
@@ -206,23 +206,27 @@ let Tabbar = class {
|
|
|
206
206
|
}
|
|
207
207
|
this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage));
|
|
208
208
|
};
|
|
209
|
-
this.setTabBarBadgeHandler = ({ index, text, errorHandler }) => {
|
|
210
|
-
const list = this.list;
|
|
209
|
+
this.setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }) => {
|
|
210
|
+
const list = [...this.list];
|
|
211
211
|
if (index in list) {
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
list[index].showRedDot = false;
|
|
213
|
+
list[index].badgeText = text;
|
|
214
|
+
successHandler({
|
|
215
|
+
errMsg: 'setTabBarBadge:ok'
|
|
216
|
+
});
|
|
214
217
|
}
|
|
215
218
|
else {
|
|
216
219
|
errorHandler({
|
|
217
220
|
errMsg: 'setTabBarBadge:fail tabbar item not found'
|
|
218
221
|
});
|
|
219
222
|
}
|
|
223
|
+
this.list = list;
|
|
220
224
|
};
|
|
221
225
|
this.removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }) => {
|
|
222
|
-
const list = this.list;
|
|
226
|
+
const list = [...this.list];
|
|
223
227
|
if (index in list) {
|
|
224
|
-
|
|
225
|
-
|
|
228
|
+
list[index].badgeText = null;
|
|
229
|
+
list[index].badgeText = null;
|
|
226
230
|
successHandler({
|
|
227
231
|
errMsg: 'removeTabBarBadge:ok'
|
|
228
232
|
});
|
|
@@ -232,9 +236,10 @@ let Tabbar = class {
|
|
|
232
236
|
errMsg: 'removeTabBarBadge:fail tabbar item not found'
|
|
233
237
|
});
|
|
234
238
|
}
|
|
239
|
+
this.list = list;
|
|
235
240
|
};
|
|
236
241
|
this.showTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
|
|
237
|
-
const list = this.list;
|
|
242
|
+
const list = [...this.list];
|
|
238
243
|
if (index in list) {
|
|
239
244
|
list[index].badgeText = null;
|
|
240
245
|
list[index].showRedDot = true;
|
|
@@ -247,9 +252,10 @@ let Tabbar = class {
|
|
|
247
252
|
errMsg: 'showTabBarRedDot:fail tabbar item not found'
|
|
248
253
|
});
|
|
249
254
|
}
|
|
255
|
+
this.list = list;
|
|
250
256
|
};
|
|
251
257
|
this.hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
|
|
252
|
-
const list = this.list;
|
|
258
|
+
const list = [...this.list];
|
|
253
259
|
if (index in list) {
|
|
254
260
|
list[index].showRedDot = false;
|
|
255
261
|
successHandler({
|
|
@@ -261,6 +267,7 @@ let Tabbar = class {
|
|
|
261
267
|
errMsg: 'hideTabBarRedDot:fail tabbar item not found'
|
|
262
268
|
});
|
|
263
269
|
}
|
|
270
|
+
this.list = list;
|
|
264
271
|
};
|
|
265
272
|
this.showTabBarHandler = ({ successHandler }) => {
|
|
266
273
|
this.status = STATUS_SHOW;
|
|
@@ -274,6 +281,39 @@ let Tabbar = class {
|
|
|
274
281
|
errMsg: 'hideTabBar:ok'
|
|
275
282
|
});
|
|
276
283
|
};
|
|
284
|
+
this.setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {
|
|
285
|
+
if (backgroundColor)
|
|
286
|
+
this.backgroundColor = backgroundColor;
|
|
287
|
+
if (borderStyle)
|
|
288
|
+
this.borderStyle = borderStyle;
|
|
289
|
+
if (color)
|
|
290
|
+
this.color = color;
|
|
291
|
+
if (selectedColor)
|
|
292
|
+
this.selectedColor = selectedColor;
|
|
293
|
+
successHandler({
|
|
294
|
+
errMsg: 'setTabBarStyle:ok'
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
this.setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {
|
|
298
|
+
const list = [...this.list];
|
|
299
|
+
if (index in list) {
|
|
300
|
+
if (iconPath)
|
|
301
|
+
list[index].iconPath = iconPath;
|
|
302
|
+
if (selectedIconPath)
|
|
303
|
+
list[index].selectedIconPath = selectedIconPath;
|
|
304
|
+
if (text)
|
|
305
|
+
list[index].text = text;
|
|
306
|
+
successHandler({
|
|
307
|
+
errMsg: 'setTabBarItem:ok'
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
errorHandler({
|
|
312
|
+
errMsg: 'setTabBarItem:fail tabbar item not found'
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
this.list = list;
|
|
316
|
+
};
|
|
277
317
|
const list = this.conf.list;
|
|
278
318
|
const customRoutes = this.conf.customRoutes;
|
|
279
319
|
if (Object.prototype.toString.call(list) !== '[object Array]' ||
|
|
@@ -291,6 +331,7 @@ let Tabbar = class {
|
|
|
291
331
|
}
|
|
292
332
|
});
|
|
293
333
|
this.list = list;
|
|
334
|
+
this.borderStyle = this.conf.borderStyle;
|
|
294
335
|
}
|
|
295
336
|
getCurrentUrl() {
|
|
296
337
|
const routerMode = this.conf.mode;
|
|
@@ -318,6 +359,8 @@ let Tabbar = class {
|
|
|
318
359
|
Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
|
|
319
360
|
Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler);
|
|
320
361
|
Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler);
|
|
362
|
+
Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler);
|
|
363
|
+
Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler);
|
|
321
364
|
}
|
|
322
365
|
removeEvent() {
|
|
323
366
|
Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler);
|
|
@@ -328,6 +371,8 @@ let Tabbar = class {
|
|
|
328
371
|
Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
|
|
329
372
|
Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler);
|
|
330
373
|
Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler);
|
|
374
|
+
Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler);
|
|
375
|
+
Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler);
|
|
331
376
|
}
|
|
332
377
|
componentDidLoad() {
|
|
333
378
|
this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom';
|
|
@@ -338,10 +383,10 @@ let Tabbar = class {
|
|
|
338
383
|
this.removeEvent();
|
|
339
384
|
}
|
|
340
385
|
render() {
|
|
341
|
-
const {
|
|
386
|
+
const { tabbarPos = 'bottom' } = this;
|
|
342
387
|
const status = this.status;
|
|
343
388
|
const containerCls = classnames('weui-tabbar', {
|
|
344
|
-
[`taro-tabbar__border-${
|
|
389
|
+
[`taro-tabbar__border-${this.borderStyle || 'black'}`]: true
|
|
345
390
|
});
|
|
346
391
|
const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE;
|
|
347
392
|
const shouldSlideout = status === STATUS_SLIDEOUT;
|
|
@@ -349,19 +394,20 @@ let Tabbar = class {
|
|
|
349
394
|
[hideTabBarClassName]: shouldHideTabBar,
|
|
350
395
|
[hideTabBarWithAnimationClassName]: shouldSlideout
|
|
351
396
|
}) }, h("div", { class: containerCls, style: {
|
|
352
|
-
backgroundColor:
|
|
397
|
+
backgroundColor: this.backgroundColor || ''
|
|
353
398
|
} }, this.list.map((item, index) => {
|
|
354
399
|
const isSelected = this.selectedIndex === index;
|
|
355
400
|
let textColor;
|
|
356
401
|
let iconPath;
|
|
357
402
|
if (isSelected) {
|
|
358
|
-
textColor =
|
|
403
|
+
textColor = this.selectedColor;
|
|
359
404
|
iconPath = item.selectedIconPath;
|
|
360
405
|
}
|
|
361
406
|
else {
|
|
362
|
-
textColor =
|
|
407
|
+
textColor = this.color || '';
|
|
363
408
|
iconPath = item.iconPath;
|
|
364
409
|
}
|
|
410
|
+
console.log('TabbarItem', item);
|
|
365
411
|
return (h(TabbarItem, { index: index, onSelect: this.switchTab.bind(this), isSelected: isSelected, textColor: textColor, iconPath: iconPath, text: item.text, badgeText: item.badgeText, showRedDot: item.showRedDot }));
|
|
366
412
|
}))));
|
|
367
413
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-165a6222.js';
|
|
2
2
|
|
|
3
|
-
const indexCss = "taro-textarea-core{display:block;width:300px
|
|
3
|
+
const indexCss = "taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{-webkit-appearance:none;cursor:auto;width:100%;height:150px;border:0;display:block;position:relative;line-height:1.5}.taro-textarea:focus{outline:none}";
|
|
4
4
|
|
|
5
5
|
function fixControlledValue(value) {
|
|
6
6
|
return value !== null && value !== void 0 ? value : '';
|
|
@@ -12,12 +12,16 @@ let Textarea = class {
|
|
|
12
12
|
this.onFocus = createEvent(this, "focus", 7);
|
|
13
13
|
this.onBlur = createEvent(this, "blur", 7);
|
|
14
14
|
this.onChange = createEvent(this, "change", 7);
|
|
15
|
+
this.onLineChange = createEvent(this, "linechange", 7);
|
|
15
16
|
this.disabled = false;
|
|
16
17
|
this.maxlength = 140;
|
|
17
18
|
this.autoFocus = false;
|
|
19
|
+
this.autoHeight = false;
|
|
18
20
|
this.nativeProps = {};
|
|
21
|
+
this.line = 1;
|
|
19
22
|
this.hanldeInput = (e) => {
|
|
20
23
|
e.stopPropagation();
|
|
24
|
+
this.handleLineChange();
|
|
21
25
|
this.onInput.emit({
|
|
22
26
|
value: e.target.value,
|
|
23
27
|
cursor: e.target.value.length
|
|
@@ -39,6 +43,58 @@ let Textarea = class {
|
|
|
39
43
|
value: e.target.value
|
|
40
44
|
});
|
|
41
45
|
};
|
|
46
|
+
this.handleLineChange = () => {
|
|
47
|
+
const line = this.getNumberOfLines();
|
|
48
|
+
if (line !== this.line) {
|
|
49
|
+
this.line = line;
|
|
50
|
+
this.onLineChange.emit({
|
|
51
|
+
height: this.textareaRef.clientHeight,
|
|
52
|
+
lineCount: this.line
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
this.calculateContentHeight = (ta, scanAmount) => {
|
|
57
|
+
let origHeight = ta.style.height, height = ta.offsetHeight, scrollHeight = ta.scrollHeight, overflow = ta.style.overflow;
|
|
58
|
+
/// only bother if the ta is bigger than content
|
|
59
|
+
if (height >= scrollHeight) {
|
|
60
|
+
/// check that our browser supports changing dimension
|
|
61
|
+
/// calculations mid-way through a function call...
|
|
62
|
+
ta.style.height = height + scanAmount + 'px';
|
|
63
|
+
/// because the scrollbar can cause calculation problems
|
|
64
|
+
ta.style.overflow = 'hidden';
|
|
65
|
+
/// by checking that scrollHeight has updated
|
|
66
|
+
if (scrollHeight < ta.scrollHeight) {
|
|
67
|
+
/// now try and scan the ta's height downwards
|
|
68
|
+
/// until scrollHeight becomes larger than height
|
|
69
|
+
while (ta.offsetHeight >= ta.scrollHeight) {
|
|
70
|
+
ta.style.height = (height -= scanAmount) + 'px';
|
|
71
|
+
}
|
|
72
|
+
/// be more specific to get the exact height
|
|
73
|
+
while (ta.offsetHeight < ta.scrollHeight) {
|
|
74
|
+
ta.style.height = height++ + 'px';
|
|
75
|
+
}
|
|
76
|
+
/// reset the ta back to it's original height
|
|
77
|
+
ta.style.height = origHeight;
|
|
78
|
+
/// put the overflow back
|
|
79
|
+
ta.style.overflow = overflow;
|
|
80
|
+
return height;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return scrollHeight;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
this.getNumberOfLines = () => {
|
|
88
|
+
const ta = this.textareaRef, style = window.getComputedStyle ? window.getComputedStyle(ta) : ta.style,
|
|
89
|
+
// This will get the line-height only if it is set in the css,
|
|
90
|
+
// otherwise it's "normal"
|
|
91
|
+
taLineHeight = parseInt(style.lineHeight, 10),
|
|
92
|
+
// Get the scroll height of the textarea
|
|
93
|
+
taHeight = this.calculateContentHeight(ta, taLineHeight),
|
|
94
|
+
// calculate the number of lines
|
|
95
|
+
numberOfLines = Math.floor(taHeight / taLineHeight);
|
|
96
|
+
return numberOfLines;
|
|
97
|
+
};
|
|
42
98
|
}
|
|
43
99
|
componentDidLoad() {
|
|
44
100
|
Object.defineProperty(this.el, 'value', {
|
|
@@ -49,12 +105,16 @@ let Textarea = class {
|
|
|
49
105
|
this.autoFocus && this.textareaRef.focus();
|
|
50
106
|
}
|
|
51
107
|
render() {
|
|
52
|
-
const { value, placeholder, disabled, maxlength, autoFocus, name, nativeProps, hanldeInput, handleFocus, handleBlur, handleChange } = this;
|
|
108
|
+
const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, hanldeInput, handleFocus, handleBlur, handleChange } = this;
|
|
109
|
+
const otherProps = {};
|
|
110
|
+
if (autoHeight) {
|
|
111
|
+
otherProps.rows = this.line;
|
|
112
|
+
}
|
|
53
113
|
return (h("textarea", Object.assign({ ref: input => {
|
|
54
114
|
if (input) {
|
|
55
115
|
this.textareaRef = input;
|
|
56
116
|
}
|
|
57
|
-
}, class:
|
|
117
|
+
}, class: `taro-textarea ${autoHeight ? 'auto-height' : ''}`, value: fixControlledValue(value), placeholder: placeholder, name: name, disabled: disabled, maxlength: maxlength, autofocus: autoFocus, onInput: hanldeInput, onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange }, nativeProps, otherProps)));
|
|
58
118
|
}
|
|
59
119
|
get el() { return getElement(this); }
|
|
60
120
|
};
|
package/dist/esm-es5/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as promiseResolve,b as bootstrapLazy}from"./index-165a6222.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(o,e){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["taro-checkbox-core_2",[[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"]]]]],["taro-radio-core_2",[[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"]]]]],["taro-swiper-core_2",[[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"]}]]],["taro-audio-core",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["taro-block-core",[[0,"taro-block-core"]]],["taro-button-core",[[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"]]]]],["taro-camera-core",[[0,"taro-camera-core"]]],["taro-canvas-core",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["taro-cover-image-core",[[0,"taro-cover-image-core"]]],["taro-cover-view-core",[[
|
|
1
|
+
import{p as promiseResolve,b as bootstrapLazy}from"./index-165a6222.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(o,e){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["taro-checkbox-core_2",[[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"]]]]],["taro-radio-core_2",[[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"]]]]],["taro-swiper-core_2",[[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"]}]]],["taro-audio-core",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["taro-block-core",[[0,"taro-block-core"]]],["taro-button-core",[[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"]]]]],["taro-camera-core",[[0,"taro-camera-core"]]],["taro-canvas-core",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["taro-cover-image-core",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["taro-cover-view-core",[[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"]]]]],["taro-custom-wrapper-core",[[0,"taro-custom-wrapper-core"]]],["taro-form-core",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["taro-icon-core",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["taro-image-core",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["taro-input-core",[[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]}]]],["taro-label-core",[[4,"taro-label-core",{for:[1]}]]],["taro-movable-area-core",[[0,"taro-movable-area-core"]]],["taro-movable-view-core",[[0,"taro-movable-view-core"]]],["taro-navigator-core",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["taro-open-data-core",[[0,"taro-open-data-core"]]],["taro-picker-view-column-core",[[0,"taro-picker-view-column-core"]]],["taro-picker-view-core",[[0,"taro-picker-view-core"]]],["taro-progress-core",[[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]}]]],["taro-pull-to-refresh",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["taro-rich-text-core",[[0,"taro-rich-text-core",{nodes:[1]}]]],["taro-scroll-view-core",[[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"]}]]],["taro-slider-core",[[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]}]]],["taro-switch-core",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["taro-tabbar",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["taro-text-core",[[4,"taro-text-core",{selectable:[4]}]]],["taro-textarea-core",[[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]}]]],["taro-view-core",[[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"]]]]],["taro-web-view-core",[[0,"taro-web-view-core",{src:[1]}]]],["taro-picker-core_2",[[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"]]]]],["taro-video-control_3",[[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)}))};export{defineCustomElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as promiseResolve,b as bootstrapLazy}from"./index-165a6222.js";var patchBrowser=function(){var o=import.meta.url;var e={};if(o!==""){e.resourcesUrl=new URL(".",o).href}return promiseResolve(e)};patchBrowser().then((function(o){return bootstrapLazy([["taro-checkbox-core_2",[[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"]]]]],["taro-radio-core_2",[[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"]]]]],["taro-swiper-core_2",[[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"]}]]],["taro-audio-core",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["taro-block-core",[[0,"taro-block-core"]]],["taro-button-core",[[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"]]]]],["taro-camera-core",[[0,"taro-camera-core"]]],["taro-canvas-core",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["taro-cover-image-core",[[0,"taro-cover-image-core"]]],["taro-cover-view-core",[[
|
|
1
|
+
import{p as promiseResolve,b as bootstrapLazy}from"./index-165a6222.js";var patchBrowser=function(){var o=import.meta.url;var e={};if(o!==""){e.resourcesUrl=new URL(".",o).href}return promiseResolve(e)};patchBrowser().then((function(o){return bootstrapLazy([["taro-checkbox-core_2",[[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"]]]]],["taro-radio-core_2",[[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"]]]]],["taro-swiper-core_2",[[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"]}]]],["taro-audio-core",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["taro-block-core",[[0,"taro-block-core"]]],["taro-button-core",[[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"]]]]],["taro-camera-core",[[0,"taro-camera-core"]]],["taro-canvas-core",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["taro-cover-image-core",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["taro-cover-view-core",[[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"]]]]],["taro-custom-wrapper-core",[[0,"taro-custom-wrapper-core"]]],["taro-form-core",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["taro-icon-core",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["taro-image-core",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["taro-input-core",[[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]}]]],["taro-label-core",[[4,"taro-label-core",{for:[1]}]]],["taro-movable-area-core",[[0,"taro-movable-area-core"]]],["taro-movable-view-core",[[0,"taro-movable-view-core"]]],["taro-navigator-core",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["taro-open-data-core",[[0,"taro-open-data-core"]]],["taro-picker-view-column-core",[[0,"taro-picker-view-column-core"]]],["taro-picker-view-core",[[0,"taro-picker-view-core"]]],["taro-progress-core",[[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]}]]],["taro-pull-to-refresh",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["taro-rich-text-core",[[0,"taro-rich-text-core",{nodes:[1]}]]],["taro-scroll-view-core",[[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"]}]]],["taro-slider-core",[[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]}]]],["taro-switch-core",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["taro-tabbar",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["taro-text-core",[[4,"taro-text-core",{selectable:[4]}]]],["taro-textarea-core",[[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]}]]],["taro-view-core",[[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"]]]]],["taro-web-view-core",[[0,"taro-web-view-core",{src:[1]}]]],["taro-picker-core_2",[[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"]]]]],["taro-video-control_3",[[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]}]]]],o)}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,
|
|
1
|
+
import{r as registerInstance,c as createEvent,h}from"./index-165a6222.js";var indexCss="taro-cover-image-core{overflow:hidden;width:320px;height:240px}";var CoverImage=function(){function r(r){registerInstance(this,r);this.onLoad=createEvent(this,"load",7);this.onError=createEvent(this,"error",7);this.nativeProps={}}r.prototype.imageOnLoad=function(){var r=this.imgRef,e=r.width,t=r.height;this.onLoad.emit({width:e,height:t})};r.prototype.imageOnError=function(){this.onError.emit()};r.prototype.render=function(){var r=this;var e=this,t=e.src,i=e.imageOnLoad,o=e.imageOnError,n=e.nativeProps;return h("img",Object.assign({ref:function(e){return r.imgRef=e},src:t,onLoad:i.bind(this),onError:o.bind(this)},n))};return r}();CoverImage.style=indexCss;export{CoverImage as taro_cover_image_core};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host}from"./index-165a6222.js";var CoverView=function(){function
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-165a6222.js";import{c as classnames}from"./index-85e10859.js";var coverViewCss="taro-cover-view-core{display:block}";var CoverView=function(){function t(t){registerInstance(this,t);this.onLongPress=createEvent(this,"longpress",7);this.hoverStartTime=50;this.hoverStayTime=400;this.hover=false;this.touch=false;this.startTime=0}t.prototype.onTouchStart=function(){var t=this;if(this.hoverClass){this.touch=true;setTimeout((function(){if(t.touch){t.hover=true}}),this.hoverStartTime)}this.timeoutEvent=setTimeout((function(){t.onLongPress.emit()}),350);this.startTime=Date.now()};t.prototype.onTouchMove=function(){clearTimeout(this.timeoutEvent)};t.prototype.onTouchEnd=function(){var t=this;var e=Date.now()-this.startTime;if(e<350){clearTimeout(this.timeoutEvent)}if(this.hoverClass){this.touch=false;setTimeout((function(){if(!t.touch){t.hover=false}}),this.hoverStayTime)}};t.prototype.render=function(){var t;var e=classnames((t={},t[""+this.hoverClass]=this.hover,t));var i={};if(!!this.animation){i["animation"]=this.animation;i["data-animation"]=this.animation}return h(Host,Object.assign({class:e},i),h("slot",null))};return t}();CoverView.style=coverViewCss;export{CoverView as taro_cover_view_core};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-165a6222.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.disabled,r=t.maxlength,u=t.
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-165a6222.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,o;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});this.autoFocus&&((o=this.inputRef)===null||o===void 0?void 0:o.focus())};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.disabled,r=t.maxlength,u=t.confirmType,l=t.name,p=t.nativeProps;return h("input",Object.assign({ref:function(t){e.inputRef=t},class:"weui-input",value:fixControlledValue(n),type:getTrueType(i,u,o),placeholder:a,disabled:s,maxlength:r,name:l,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown},p))};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};
|