diff --git a/dist/input/index.js b/dist/input/index.js index e8c56c8e..45f0c7be 100644 --- a/dist/input/index.js +++ b/dist/input/index.js @@ -1 +1 @@ -import eventBus from"../core/utils/event-bus.js";import validator from"../behaviors/validator";import rules from"../behaviors/rules";Component({options:{multipleSlots:!0},behaviors:["wx://form-field",validator,rules],externalClasses:["l-class","l-label-class","l-error-text","l-error-text-class","l-input-class","l-row-class"],properties:{label:String,hideLabel:Boolean,labelCustom:Boolean,showRow:{type:Boolean,value:!0},required:Boolean,placeholder:String,type:{type:String,value:"text",options:["text","idcard","digit","password","number"]},value:String,colon:Boolean,focus:Boolean,clear:Boolean,maxlength:{type:Number,value:140},width:{type:Number,value:null},labelWidth:{type:Number,value:200},labelLayout:{type:String,value:"left",options:["left","right"]},disabled:Boolean,placeholderStyle:String,showEye:{type:Boolean,value:!1}},data:{},attached(){},methods:{handleInputChange(e){const{detail:t={}}=e,{value:a=""}=t;this.setData({value:a}),eventBus.emit("lin-form-change-"+this.id,this.id),this.triggerEvent("lininput",e.detail)},handleInputFocus(e){this.triggerEvent("linfocus",e.detail)},handleInputBlur(e){this.validatorData({[this.data.name]:e.detail.value}),eventBus.emit("lin-form-blur-"+this.id,this.id),this.triggerEvent("linblur",e.detail)},handleInputConfirm(e){const{detail:t={}}=e,{value:a=""}=t;this.setData({value:a}),this.triggerEvent("linconfirm",e.detail)},onClearTap(e){this.setData({value:""}),this.triggerEvent("linclear",e.detail)},getValues(){return this.data.value},reset(){this.setData({value:""})},onTapEyeIcon(){const e=this.data.type;"text"===e?this.setData({type:"password"}):"password"===e&&this.setData({type:"text"})}}}); \ No newline at end of file +import eventBus from"../core/utils/event-bus.js";import validator from"../behaviors/validator";import rules from"../behaviors/rules";Component({options:{multipleSlots:!0},behaviors:["wx://form-field",validator,rules],externalClasses:["l-class","l-label-class","l-error-text","l-error-text-class","l-input-class","l-row-class"],properties:{label:String,hideLabel:Boolean,labelCustom:Boolean,showRow:{type:Boolean,value:!0},required:Boolean,placeholder:String,type:{type:String,value:"text",options:["text","idcard","digit","password","number"]},value:String,colon:Boolean,focus:Boolean,clear:Boolean,maxlength:{type:Number,value:140},width:{type:Number,value:null},labelWidth:{type:Number,value:200},labelLayout:{type:String,value:"left",options:["left","right"]},disabled:Boolean,placeholderStyle:String,showEye:{type:Boolean,value:!1},adjustPosition:{type:Boolean,value:!0}},data:{},attached(){},methods:{handleInputChange(e){const{detail:t={}}=e,{value:a=""}=t;this.setData({value:a}),eventBus.emit("lin-form-change-"+this.id,this.id),this.triggerEvent("lininput",e.detail)},handleInputFocus(e){this.triggerEvent("linfocus",e.detail)},handleInputBlur(e){this.validatorData({[this.data.name]:e.detail.value}),eventBus.emit("lin-form-blur-"+this.id,this.id),this.triggerEvent("linblur",e.detail)},handleInputConfirm(e){const{detail:t={}}=e,{value:a=""}=t;this.setData({value:a}),this.triggerEvent("linconfirm",e.detail)},onClearTap(e){this.setData({value:""}),this.triggerEvent("linclear",e.detail)},getValues(){return this.data.value},reset(){this.setData({value:""})},onTapEyeIcon(){const e=this.data.type;"text"===e?this.setData({type:"password"}):"password"===e&&this.setData({type:"text"})}}}); \ No newline at end of file diff --git a/dist/input/index.wxml b/dist/input/index.wxml index 08a37f78..3b34a826 100644 --- a/dist/input/index.wxml +++ b/dist/input/index.wxml @@ -10,8 +10,8 @@ - - + + diff --git a/examples/dist/input/index.js b/examples/dist/input/index.js index b6a46852..378c9ec7 100644 --- a/examples/dist/input/index.js +++ b/examples/dist/input/index.js @@ -71,6 +71,11 @@ Component({ showEye: { type: Boolean, value: false + }, + // 键盘弹起时,是否自动上推页面 + adjustPosition:{ + type: Boolean, + value: true } }, diff --git a/examples/dist/input/index.wxml b/examples/dist/input/index.wxml index 72703fb1..30b76726 100644 --- a/examples/dist/input/index.wxml +++ b/examples/dist/input/index.wxml @@ -14,6 +14,7 @@