<template>
<uni-shadow-root class="vant-field-index"><van-cell :icon="leftIcon" :title="label" :center="center" :border="border" :is-link="isLink" :required="required" :custom-style="customStyle" :title-width="titleWidth" custom-class="van-field" :size="size">
  <slot name="left-icon" slot="icon"></slot>
  <slot name="label" slot="title"></slot>
  <view :class="'van-field__body '+(type === 'textarea' ? 'van-field__body--textarea' : '')">
    <textarea v-if="type === 'textarea'" :class="'input-class '+(utils.bem('field__input', [inputAlign, { disabled, error }]))" :fixed="fixed" :focus="focus" :value="value" :disabled="disabled || readonly" :maxlength="maxlength" :auto-height="autosize" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition" :show-confirm-bar="showConfirmBar" @input="onInput" @blur="onBlur" @focus="onFocus" @confirm="onConfirm">
      <view v-if="value == null || value.length === 0" :style="placeholderStyle" :class="utils.bem('field__placeholder', { error })">
        {{ placeholder }}
      </view>
    </textarea>
    <input v-else :class="'input-class '+(utils.bem('field__input', [inputAlign, { disabled, error }]))" :type="type" :focus="focus" :value="value" :disabled="disabled || readonly" :maxlength="maxlength" :placeholder="placeholder" :placeholder-style="placeholderStyle" :placeholder-class="error ? 'van-field__placeholder--error' : 'van-field__placeholder'" :confirm-type="confirmType" :confirm-hold="confirmHold" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition" :password="password || type === 'password'" @input="onInput" @blur="onBlur" @focus="onFocus" @confirm="onConfirm"></input>
    <van-icon v-if="showClear" size="16px" name="clear" class="van-field__clear-root van-field__icon-root" @touchstart.native="onClear"></van-icon>
    <view class="van-field__icon-container" @click="onClickIcon">
      <van-icon v-if="rightIcon || icon" size="16px" :name="rightIcon || icon" :class="'van-field__icon-root '+(iconClass)" custom-class="right-icon-class"></van-icon>
      <slot name="right-icon"></slot>
      <slot name="icon"></slot>
    </view>
    <view class="van-field__button">
      <slot name="button"></slot>
    </view>
  </view>
  <view v-if="errorMessage" :class="'van-field__error-message '+(utils.bem('field__error', [errorMessageAlign, { disabled, error }]))">
    {{ errorMessage }}
  </view>
</van-cell></uni-shadow-root>
</template>
<wxs src="../wxs/utils.wxs" module="utils"></wxs>
<script>
import VanCell from '../cell/index.vue'
import VanIcon from '../icon/index.vue'
global['__wxVueOptions'] = {components:{'van-cell': VanCell,'van-icon': VanIcon}}

global['__wxRoute'] = 'vant/field/index'
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require('./../common/component.js');
component_1.VantComponent({
    field: true,
    classes: ['input-class', 'right-icon-class'],
    props: {
        size: String,
        icon: String,
        label: String,
        error: Boolean,
        fixed: Boolean,
        focus: Boolean,
        center: Boolean,
        isLink: Boolean,
        leftIcon: String,
        rightIcon: String,
        disabled: Boolean,
        autosize: Boolean,
        readonly: Boolean,
        required: Boolean,
        password: Boolean,
        iconClass: String,
        clearable: Boolean,
        inputAlign: String,
        customStyle: String,
        confirmType: String,
        confirmHold: Boolean,
        errorMessage: String,
        placeholder: String,
        placeholderStyle: String,
        errorMessageAlign: String,
        showConfirmBar: {
            type: Boolean,
            value: true
        },
        adjustPosition: {
            type: Boolean,
            value: true
        },
        cursorSpacing: {
            type: Number,
            value: 50
        },
        maxlength: {
            type: Number,
            value: -1
        },
        type: {
            type: String,
            value: 'text'
        },
        border: {
            type: Boolean,
            value: true
        },
        titleWidth: {
            type: String,
            value: '90px'
        }
    },
    data: {
        showClear: false
    },
    beforeCreate: function beforeCreate() {
        this.focused = false;
    },
    methods: {
        onInput: function onInput(event) {
            var _this = this;
            var _a = (event.detail || {}).value,
                value = _a === void 0 ? '' : _a;
            this.set({
                value: value,
                showClear: this.getShowClear(value)
            }, function () {
                _this.emitChange(value);
            });
        },
        onFocus: function onFocus(event) {
            var _a = event.detail || {},
                _b = _a.value,
                value = _b === void 0 ? '' : _b,
                _c = _a.height,
                height = _c === void 0 ? 0 : _c;
            this.$emit('focus', { value: value, height: height });
            this.focused = true;
            this.blurFromClear = false;
            this.set({
                showClear: this.getShowClear()
            });
        },
        onBlur: function onBlur(event) {
            var _this = this;
            var _a = event.detail || {},
                _b = _a.value,
                value = _b === void 0 ? '' : _b,
                _c = _a.cursor,
                cursor = _c === void 0 ? 0 : _c;
            this.$emit('blur', { value: value, cursor: cursor });
            this.focused = false;
            var showClear = this.getShowClear();
            if (this.data.value === value) {
                this.set({
                    showClear: showClear
                });
            } else if (!this.blurFromClear) {
                // fix: the handwritten keyboard does not trigger input change
                this.set({
                    value: value,
                    showClear: showClear
                }, function () {
                    _this.emitChange(value);
                });
            }
        },
        onClickIcon: function onClickIcon() {
            this.$emit('click-icon');
        },
        getShowClear: function getShowClear(value) {
            value = value === undefined ? this.data.value : value;
            return this.data.clearable && this.focused && value && !this.data.readonly;
        },
        onClear: function onClear() {
            var _this = this;
            this.blurFromClear = true;
            this.set({
                value: '',
                showClear: this.getShowClear('')
            }, function () {
                _this.emitChange('');
                _this.$emit('clear', '');
            });
        },
        onConfirm: function onConfirm() {
            this.$emit('confirm', this.data.value);
        },
        emitChange: function emitChange(value) {
            this.$emit('input', value);
            this.$emit('change', value);
        }
    }
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbIk9iamVjdCIsInZhbHVlIiwiY29tcG9uZW50XzEiLCJyZXF1aXJlIiwiZmllbGQiLCJjbGFzc2VzIiwicHJvcHMiLCJzaXplIiwiaWNvbiIsImxhYmVsIiwiZXJyb3IiLCJmaXhlZCIsImZvY3VzIiwiY2VudGVyIiwiaXNMaW5rIiwibGVmdEljb24iLCJyaWdodEljb24iLCJkaXNhYmxlZCIsImF1dG9zaXplIiwicmVhZG9ubHkiLCJyZXF1aXJlZCIsInBhc3N3b3JkIiwiaWNvbkNsYXNzIiwiY2xlYXJhYmxlIiwiaW5wdXRBbGlnbiIsImN1c3RvbVN0eWxlIiwiY29uZmlybVR5cGUiLCJjb25maXJtSG9sZCIsImVycm9yTWVzc2FnZSIsInBsYWNlaG9sZGVyIiwicGxhY2Vob2xkZXJTdHlsZSIsImVycm9yTWV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B1dC1jbGFzcycsICdyaWdodC1pY29uLWNsYXNzJ10sXG4gICAgcHJvcHM6IHtcbiAgICAgICAgc2l6ZTogU3RyaW5nLFxuICAgICAgICBpY29uOiBTdHJpbmcsXG4gICAgICAgIGxhYmVsOiBTdHJpbmcsXG4gICAgICAgIGVycm9yOiBCb29sZWFuLFxuICAgICAgICBmaXhlZDogQm9vbGVhbixcbiAgICAgICAgZm9jdXM6IEJvb2xlYW4sXG4gICAgICAgIGNlbnRlcjogQm9vbGVhbixcbiAgICAgICAgaXNMaW5rOiBCb29sZWFuLFxuICAgICAgICBsZWZ0SWNvbjogU3RyaW5nLFxuICAgICAgICByaWdodEljb246IFN0cmluZyxcbiAgICAgICAgZGlzYWJsZWQ6IEJvb2xlYW4sXG4gICAgICAgIGF1dG9zaXplOiBCb29sZWFuLFxuICAgICAgICByZWFkb25seTogQm9vbGVhbixcbiAgICAgICAgcmVxdWlyZWQ6IEJvb2xlYW4sXG4gICAgICAgIHBhc3N3b3JkOiBCb29sZWFuLFxuICAgICAgICBpY29uQ2xhc3M6IFN0cmluZyxcbiAgICAgICAgY2xlYXJhYmxlOiBCb29sZWFuLFxuICAgICAgICBpbnB1dEFsaWduOiBTdHJpbmcsXG4gICAgICAgIGN1c3RvbVN0eWxlOiBTdHJpbmcsXG4gICAgICAgIGNvbmZpcm1UeXBlOiBTdHJpbmcsXG4gICAgICAgIGNvbmZpcm1Ib2xkOiBCb29sZWFuLFxuICAgICAgICBlcnJvck1lc3NhZ2U6IFN0cmluZyxcbiAgICAgICAgcGxhY2Vob2xkZXI6IFN0cmluZyxcbiAgICAgICAgcGxhY2Vob2xkZXJTdHlsZTogU3RyaW5nLFxuICAgICAgICBlcnJvck1lc3NhZ2VBbGlnbjogU3RyaW5nLFxuICAgICAgICBzaG93Q29uZmlybUJhcjoge1xuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcbiAgICAgICAgICAgIHZhbHVlOiB0cnVlXG4gICAgICAgIH0sXG4gICAgICAgIGFkanVzdFBvc2l0aW9uOiB7XG4gICAgICAgICAgICB0eXBlOiBCb29sZWFuLFxuICAgICAgICAgICAgdmFsdWU6IHRydWVcbiAgICAgICAgfSxcbiAgICAgICAgY3Vyc29yU3BhY2luZzoge1xuICAgICAgICAgICAgdHlwZTogTnVtYmVyLFxuICAgICAgICAgICAgdmFsdWU6IDUwXG4gICAgICAgIH0sXG4gICAgICAgIG1heGxlbmd0aDoge1xuICAgICAgICAgICAgdHlwZTogTnVtYmVyLFxuICAgICAgICAgICAgdmFsdWU6IC0xXG4gICAgICAgIH0sXG4gICAgICAgIHR5cGU6IHtcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgICAgICAgIHZhbHVlOiAndGV4dCdcbiAgICAgICAgfSxcbiAgICAgICAgYm9yZGVyOiB7XG4gICAgICAgICAgICB0eXBlOiBCb29sZWFuLFxuICAgICAgICAgICAgdmFsdWU6IHRydWVcbiAgICAgICAgfSxcbiAgICAgICAgdGl0bGVXaWR0aDoge1xuICAgICAgICAgICAgdHlwZTogU3RyaW5nLFxuICAgICAgICAgICAgdmFsdWU6ICc5MHB4J1xuICAgICAgICB9XG4gICAgfSxcbiAgICBkYXRhOiB7XG4gICAgICAgIHNob3dDbGVhcjogZmFsc2VcbiAgICB9LFxuICAgIGJlZm9yZUNyZWF0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLmZvY3VzZWQgPSBmYWxzZTtcbiAgICB9LFxuICAgIG1ldGhvZHM6IHtcbiAgICAgICAgb25JbnB1dDogZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICAgICAgdmFyIF9hID0gKGV2ZW50LmRldGFpbCB8fCB7fSkudmFsdWUsIHZhbHVlID0gX2EgPT09IHZvaWQgMCA/ICcnIDogX2E7XG4gICAgICAgICAgICB0aGlzLnNldCh7XG4gICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLFxuICAgICAg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iAgICAgICAgICAgIHRoaXMuZm9jdXNlZCA9IGZhbHNlO1xuICAgICAgICAgICAgdmFyIHNob3dDbGVhciA9IHRoaXMuZ2V0U2hvd0NsZWFyKCk7XG4gICAgICAgICAgICBpZiAodGhpcy5kYXRhLnZhbHVlID09PSB2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0KHtcbiAgICAgICAgICAgICAgICAgICAgc2hvd0NsZWFyOiBzaG93Q2xlYXJcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCF0aGlzLmJsdXJGcm9tQ2xlYXIpIHtcbiAgICAgICAgICAgICAgICAvLyBmaXg6IHRoZSBoYW5kd3JpdHRlbiBrZXlib2FyZCBkb2VzIG5vdCB0cmlnZ2VyIGlucHV0IGNoYW5nZVxuICAgICAgICAgICAgICAgIHRoaXMuc2V0KHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICBzaG93Q2xlYXI6IHNob3dDbGVhclxuICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuZW1pdENoYW5nZSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG9uQ2xpY2tJY29uOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLiRlbWl0KCdjbGljay1pY29uJyk7XG4gICAgICAgIH0sXG4gICAgICAgIGdldFNob3dDbGVhcjogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHZhbHVlID09PSB1bmRlZmluZWQgPyB0aGlzLmRhdGEudmFsdWUgOiB2YWx1ZTtcbiAgICAgICAgICAgIHJldHVybiAodGhpcy5kYXRhLmNsZWFyYWJsZSAmJiB0aGlzLmZvY3VzZWQgJiYgdmFsdWUgJiYgIXRoaXMuZGF0YS5yZWFkb25seSk7XG4gICAgICAgIH0sXG4gICAgICAgIG9uQ2xlYXI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB0aGlzLmJsdXJGcm9tQ2xlYXIgPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5zZXQoe1xuICAgICAgICAgICAgICAgIHZhbHVlOiAnJyxcbiAgICAgICAgICAgICAgICBzaG93Q2xlYXI6IHRoaXMuZ2V0U2hvd0NsZWFyKCcnKVxuICAgICAgICAgICAgfSwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIF90aGlzLmVtaXRDaGFuZ2UoJycpO1xuICAgICAgICAgICAgICAgIF90aGlzLiRlbWl0KCdjbGVhcicsICcnKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBvbkNvbmZpcm06IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRoaXMuJGVtaXQoJ2NvbmZpcm0nLCB0aGlzLmRhdGEudmFsdWUpO1xuICAgICAgICB9LFxuICAgICAgICBlbWl0Q2hhbmdlOiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMuJGVtaXQoJ2lucHV0JywgdmFsdWUpO1xuICAgICAgICAgICAgdGhpcy4kZW1pdCgnY2hhbmdlJywgdmFsdWUpO1xuICAgICAgICB9XG4gICAgfVxufSk7XG4iXSwiZmlsZSI6ImluZGV4LmpzIn0=
export default global['__wxComponents']['vant/field/index']
</script>
<style platform="mp-weixin">
@import '../common/index.css';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{position:relative;display:block;width:100%;height:24px;min-height:24px;padding:0;margin:0;line-height:inherit;color:#333;text-align:left;background-color:initial;border:0;box-sizing:border-box;resize:none}.van-field__input--error{color:#f44}.van-field__input--disabled{color:#999;background-color:initial;opacity:1}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;color:#999;pointer-events:none}.van-field__placeholder--error{color:#f44}.van-field__icon-root{display:-webkit-flex;display:flex;min-height:24px;-webkit-align-items:center;align-items:center}.van-field__clear-root,.van-field__icon-container{padding:0 10px;margin-right:-10px;line-height:inherit;vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:10px}.van-field__button:empty{display:none}.van-field__error-message{font-size:12px;color:#f44;text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}
</style>