@tarojs/components 3.5.3-aplha.0 → 3.5.4
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 +1 -0
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +2 -2
- package/dist/collection/components/input/input.js +1 -0
- package/dist/collection/components/swiper/swiper.js +2 -2
- package/dist/esm/taro-input-core.entry.js +1 -0
- package/dist/esm/taro-swiper-core_2.entry.js +2 -2
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/taro-components/p-0380841f.system.js +1 -1
- package/dist/taro-components/{p-cd88d81a.system.entry.js → p-13f0b11f.system.entry.js} +1 -1
- package/dist/taro-components/p-1b356f4d.entry.js +1 -0
- package/dist/taro-components/{p-e1ed00f7.entry.js → p-63a0c6b0.entry.js} +1 -1
- package/dist/taro-components/p-a39276ff.system.entry.js +1 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/package.json +3 -3
- package/types/Picker.d.ts +25 -0
- package/types/Video.d.ts +23 -47
- package/dist/taro-components/p-06bef0f9.entry.js +0 -1
- package/dist/taro-components/p-6e9805e2.system.entry.js +0 -1
|
@@ -10070,8 +10070,8 @@ let Swiper = class {
|
|
|
10070
10070
|
slideTo() {
|
|
10071
10071
|
that.current = this.realIndex;
|
|
10072
10072
|
},
|
|
10073
|
-
// slideChange 事件在 swiper.slideTo 改写 current 时不触发,因此用
|
|
10074
|
-
|
|
10073
|
+
// slideChange 事件在 swiper.slideTo 改写 current 时不触发,因此用 slideChangeTransitionStart 事件代替
|
|
10074
|
+
slideChangeTransitionStart(_swiper) {
|
|
10075
10075
|
if (that.circular) {
|
|
10076
10076
|
if (_swiper.isBeginning || _swiper.isEnd) {
|
|
10077
10077
|
_swiper.slideToLoop(this.realIndex, 0); // 更新下标
|
|
@@ -213,8 +213,8 @@ export class Swiper {
|
|
|
213
213
|
slideTo() {
|
|
214
214
|
that.current = this.realIndex;
|
|
215
215
|
},
|
|
216
|
-
// slideChange 事件在 swiper.slideTo 改写 current 时不触发,因此用
|
|
217
|
-
|
|
216
|
+
// slideChange 事件在 swiper.slideTo 改写 current 时不触发,因此用 slideChangeTransitionStart 事件代替
|
|
217
|
+
slideChangeTransitionStart(_swiper) {
|
|
218
218
|
if (that.circular) {
|
|
219
219
|
if (_swiper.isBeginning || _swiper.isEnd) {
|
|
220
220
|
_swiper.slideToLoop(this.realIndex, 0); // 更新下标
|
|
@@ -10066,8 +10066,8 @@ let Swiper = class {
|
|
|
10066
10066
|
slideTo() {
|
|
10067
10067
|
that.current = this.realIndex;
|
|
10068
10068
|
},
|
|
10069
|
-
// slideChange 事件在 swiper.slideTo 改写 current 时不触发,因此用
|
|
10070
|
-
|
|
10069
|
+
// slideChange 事件在 swiper.slideTo 改写 current 时不触发,因此用 slideChangeTransitionStart 事件代替
|
|
10070
|
+
slideChangeTransitionStart(_swiper) {
|
|
10071
10071
|
if (that.circular) {
|
|
10072
10072
|
if (_swiper.isBeginning || _swiper.isEnd) {
|
|
10073
10073
|
_swiper.slideToLoop(this.realIndex, 0); // 更新下标
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-8809c729.js";var indexCss="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;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 u=e.target.value;var r=getTrueType(i,a,s);t.onInputExcuted=true;if(r==="number"&&u&&o<=u.length){u=u.substring(0,o);e.target.value=u}t.value=u;t.onInput.emit({value:u,cursor:u.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.value=e.target.value;t.onInput.emit({value:e.target.value,cursor:e.target.value.length})}};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.value=e.target.value;t.onInput.emit({value:e.target.value,cursor:e.target.value.length})}else{t.isOnComposition=true}}}e.prototype.watchFocus=function(e,t){var n;if(!t&&e){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};e.prototype.watchValue=function(e){var t=fixControlledValue(e);if(this.inputRef&&this.inputRef.value!==t){this.inputRef.value=t}};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){return 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,u=t.disabled,r=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:u,maxlength:r,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{autoFocus:["watchFocus"],value:["watchValue"]}},enumerable:false,configurable:true});return e}();Input.style=indexCss;export{Input as taro_input_core};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-8809c729.js";var indexCss="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;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 u=e.target.value;var r=getTrueType(i,a,s);t.onInputExcuted=true;if(r==="number"&&u&&o<=u.length){u=u.substring(0,o);e.target.value=u}t.value=u;t.onInput.emit({value:u,cursor:u.length});t.onInputExcuted=false}};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.value=e.target.value;t.onInput.emit({value:e.target.value,cursor:e.target.value.length})}};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.value=e.target.value;t.onInput.emit({value:e.target.value,cursor:e.target.value.length})}else{t.isOnComposition=true}}}e.prototype.watchFocus=function(e,t){var n;if(!t&&e){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};e.prototype.watchValue=function(e){var t=fixControlledValue(e);if(this.inputRef&&this.inputRef.value!==t){this.inputRef.value=t}};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){return 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,u=t.disabled,r=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:u,maxlength:r,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{autoFocus:["watchFocus"],value:["watchValue"]}},enumerable:false,configurable:true});return e}();Input.style=indexCss;export{Input as taro_input_core};
|