@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,g as h}from"./p-059912fd.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}function o(t){return null!=t?t:""}let n=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.onInputExcuted=!1}},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.value=t.target.value,this.onInput.emit({value:t.target.value,cursor:t.target.value.length}))},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.value=t.target.value,this.onInput.emit({value:t.target.value,cursor:t.target.value.length})):this.isOnComposition=!0)}}watchFocus(t,i){var s;!i&&t&&(null===(s=this.inputRef)||void 0===s||s.focus())}watchValue(t){const i=o(t);this.inputRef&&this.inputRef.value!==i&&(this.inputRef.value=i)}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:n,autoFocus:a,disabled:r,maxlength:u,confirmType:l,name:c,nativeProps:p}=this;return s("input",Object.assign({ref:t=>{this.inputRef=t},class:"weui-input",value:o(t),type:e(i,l,h),placeholder:n,autoFocus:a,disabled:r,maxlength:u,name:c,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},p))}get el(){return h(this)}static get watchers(){return{autoFocus:["watchFocus"],value:["watchValue"]}}};n.style="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;white-space:nowrap}";export{n as taro_input_core}
|