<template>
<uni-shadow-root class="vant-picker-index"><view class="van-picker custom-class">
  <view v-if="showToolbar" class="van-picker__toolbar van-hairline--top-bottom toolbar-class">
    <view class="van-picker__cancel" hover-class="van-picker__cancel--hover" hover-stay-time="70" data-type="cancel" @click="emit">
      {{ cancelButtonText }}
    </view>
    <view v-if="title" class="van-picker__title van-ellipsis">{{ title }}</view>
    <view class="van-picker__confirm" hover-class="van-picker__confirm--hover" hover-stay-time="70" data-type="confirm" @click="emit">
      {{ confirmButtonText }}
    </view>
  </view>
  <view v-if="loading" class="van-picker__loading">
    <loading color="#1989fa"></loading>
  </view>
  <view class="van-picker__columns" :style="'height: '+(itemHeight * visibleItemCount)+'px'" @touchmove.stop.prevent="noop">
    <picker-column v-for="(item,index) in (isSimple(columns) ? [columns] : columns)" :key="item.index" class="van-picker__column" :data-index="index" custom-class="column-class" :value-key="valueKey" :initial-options="isSimple(columns) ? item : item.values" :default-index="item.defaultIndex || defaultIndex" :item-height="itemHeight" :visible-item-count="visibleItemCount" active-class="active-class" @change="onChange"></picker-column>
    <view class="van-picker__frame van-hairline--top-bottom" :style="'height: '+(itemHeight)+'px'"></view>
  </view>
</view></uni-shadow-root>
</template>
<wxs module="isSimple" src="./index-isSimple.wxs"></wxs>
<script>
import PickerColumn from '../picker-column/index.vue'
import Loading from '../loading/index.vue'
global['__wxVueOptions'] = {components:{'picker-column': PickerColumn,'loading': Loading}}

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

var __assign = undefined && undefined.__assign || function () {
    __assign = Object.assign || function (t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) {
                if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require('./../common/component.js');
var shared_1 = require('./shared.js');
component_1.VantComponent({
    classes: ['active-class', 'toolbar-class', 'column-class'],
    props: __assign({}, shared_1.pickerProps, { valueKey: {
            type: String,
            value: 'text'
        }, defaultIndex: {
            type: Number,
            value: 0
        }, columns: {
            type: Array,
            value: [],
            observer: function observer(columns) {
                if (columns === void 0) {
                    columns = [];
                }
                this.simple = columns.length && !columns[0].values;
                this.children = this.selectAllComponents('.van-picker__column');
                if (Array.isArray(this.children) && this.children.length) {
                    this.setColumns().catch(function () {});
                }
            }
        } }),
    beforeCreate: function beforeCreate() {
        this.children = [];
    },
    methods: {
        noop: function noop() {},
        setColumns: function setColumns() {
            var _this = this;
            var data = this.data;
            var columns = this.simple ? [{ values: data.columns }] : data.columns;
            var stack = columns.map(function (column, index) {
                return _this.setColumnValues(index, column.values);
            });
            return Promise.all(stack);
        },
        emit: function emit(event) {
            var type = event.currentTarget.dataset.type;
            if (this.simple) {
                this.$emit(type, {
                    value: this.getColumnValue(0),
                    index: this.getColumnIndex(0)
                });
            } else {
                this.$emit(type, {
                    value: this.getValues(),
                    index: this.getIndexes()
                });
            }
        },
        onChange: function onChange(event) {
            if (this.simple) {
                this.$emit('change', {
                    picker: this,
                    value: this.getColumnValue(0),
                    index: this.getColumnIndex(0)
                });
            } else {
                this.$emit('change', {
                    picker: this,
                    value: this.getValues(),
                    index: event.currentTarget.dataset.index
                });
            }
        },
        // get column instance by index
        getColumn: function getColumn(index) {
            return this.children[index];
        },
        // get column value by index
        getColumnValue: function getColumnValue(index) {
            var column = this.getColumn(index);
            return column && column.getValue();
        },
        // set column value by index
        setColumnValue: function setColumnValue(index, value) {
            var column = this.getColumn(index);
            if (column == null) {
                return Promise.reject(new Error('setColumnValue: 对应列不存在'));
            }
            return column.setValue(value);
        },
        // get column option index by column index
        getColumnIndex: function getColumnIndex(columnIndex) {
            return (this.getColumn(columnIndex) || {}).data.currentIndex;
        },
        // set column option index by column index
        setColumnIndex: function setColumnIndex(columnIndex, optionIndex) {
            var column = this.getColumn(columnIndex);
            if (column == null) {
                return Promise.reject(new Error('setColumnIndex: 对应列不存在'));
            }
            return column.setIndex(optionIndex);
        },
        // get options of column by index
        getColumnValues: function getColumnValues(index) {
            return (this.children[index] || {}).data.options;
        },
        // set options of column by index
        setColumnValues: function setColumnValues(index, options, needReset) {
            if (needReset === void 0) {
                needReset = true;
            }
            var column = this.children[index];
            if (column == null) {
                return Promise.reject(new Error('setColumnValues: 对应列不存在'));
            }
            var isSame = JSON.stringify(column.data.options) === JSON.stringify(options);
            if (isSame) {
                return Promise.resolve();
            }
            return column.set({ options: options }).then(function () {
                if (needReset) {
                    column.setIndex(0);
                }
            });
        },
        // get values of all columns
        getValues: function getValues() {
            return this.children.map(function (child) {
                return child.getValue();
            });
        },
        // set values of all columns
        setValues: function setValues(values) {
            var _this = this;
            var stack = values.map(function (value, index) {
                return _this.setColumnValue(index, value);
            });
            return Promise.all(stack);
        },
        // get indexes of all columns
        getIndexes: function getIndexes() {
            return this.children.map(function (child) {
                return child.data.currentIndex;
            });
        },
        // set indexes of all columns
        setIndexes: function setIndexes(indexes) {
            var _this = this;
            var stack = indexes.map(function (optionIndex, columnIndex) {
                return _this.setColumnIndex(columnIndex, optionIndex);
            });
            return Promise.all(stack);
        }
    }
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbIl9fYXNzaWduIiwiT2JqZWN0IiwiaSIsIm4iLCJhcmd1bWVudHMiLCJzIiwidCIsInZhbHVlIiwiY29tcG9uZW50XzEiLCJyZXF1aXJlIiwic2hhcmVkXzEiLCJjbGFzc2VzIiwicHJvcHMiLCJ2YWx1ZUtleSIsInR5cGUiLCJkZWZhdWx0SW5kZXgiLCJjb2x1bW5zIiwib2JzZXJ2ZXIiLCJBcnJheSIsImJlZm9yZUNyZWF0ZSIsIm1ldGhvZHMiLCJub29wIiwic2V0Q29sdW1ucyIsIl90aGlzIiwiZGF0YSIsInZhbHVlcyIsInN0YWNrIiwiY29sdW1uIiwiUHJvbWlzZSIsImVtaXQiLCJldmVudCIsImluZGV4Iiwib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VuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0Q29sdW1ucygpLmNhdGNoKGZ1bmN0aW9uICgpIHsgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IH0pLFxuICAgIGJlZm9yZUNyZWF0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLmNoaWxkcmVuID0gW107XG4gICAgfSxcbiAgICBtZXRob2RzOiB7XG4gICAgICAgIG5vb3A6IGZ1bmN0aW9uICgpIHsgfSxcbiAgICAgICAgc2V0Q29sdW1uczogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgICAgIHZhciBkYXRhID0gdGhpcy5kYXRhO1xuICAgICAgICAgICAgdmFyIGNvbHVtbnMgPSB0aGlzLnNpbXBsZSA/IFt7IHZhbHVlczogZGF0YS5jb2x1bW5zIH1dIDogZGF0YS5jb2x1bW5zO1xuICAgICAgICAgICAgdmFyIHN0YWNrID0gY29sdW1ucy5tYXAoZnVuY3Rpb24gKGNvbHVtbiwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuc2V0Q29sdW1uVmFsdWVzKGluZGV4LCBjb2x1bW4udmFsdWVzKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UuYWxsKHN0YWNrKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW1pdDogZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICB2YXIgdHlwZSA9IGV2ZW50LmN1cnJlbnRUYXJnZXQuZGF0YXNldC50eXBlO1xuICAgICAgICAgICAgaWYgKHRoaXMuc2ltcGxlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kZW1pdCh0eXBlLCB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiB0aGlzLmdldENvbHVtblZhbHVlKDApLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogdGhpcy5nZXRDb2x1bW5JbmRleCgwKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kZW1pdCh0eXBlLCB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiB0aGlzLmdldFZhbHVlcygpLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogdGhpcy5nZXRJbmRleGVzKClcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgb25DaGFuZ2U6IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuc2ltcGxlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kZW1pdCgnY2hhbmdlJywge1xuICAgICAgICAgICAgICAgICAgICBwaWNrZXI6IHRoaXMsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiB0aGlzLmdldENvbHVtblZhbHVlKDApLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogdGhpcy5nZXRDb2x1bW5JbmRleCgwKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kZW1pdCgnY2hhbmdlJywge1xuICAgICAgICAgICAgICAgICAgICBwaWNrZXI6IHRoaXMsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiB0aGlzLmdldFZhbHVlcygpLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogZXZlbnQuY3VycmVudFRhcmdldC5kYXRhc2V0LmluZGV4XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIC8vIGdldCBjb2x1bW4gaW5zdGFuY2UgYnkgaW5kZXhcbiAgICAgICAgZ2V0Q29sdW1uOiBmdW5jdGlvbiAoaW5kZXgpIHtcbiAgIC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W5jdGlvbiAoY29sdW1uSW5kZXgsIG9wdGlvbkluZGV4KSB7XG4gICAgICAgICAgICB2YXIgY29sdW1uID0gdGhpcy5nZXRDb2x1bW4oY29sdW1uSW5kZXgpO1xuICAgICAgICAgICAgaWYgKGNvbHVtbiA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KG5ldyBFcnJvcignc2V0Q29sdW1uSW5kZXg6IOWvueW6lOWIl+S4jeWtmOWcqCcpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjb2x1bW4uc2V0SW5kZXgob3B0aW9uSW5kZXgpO1xuICAgICAgICB9LFxuICAgICAgICAvLyBnZXQgb3B0aW9ucyBvZiBjb2x1bW4gYnkgaW5kZXhcbiAgICAgICAgZ2V0Q29sdW1uVmFsdWVzOiBmdW5jdGlvbiAoaW5kZXgpIHtcbiAgICAgICAgICAgIHJldHVybiAodGhpcy5jaGlsZHJlbltpbmRleF0gfHwge30pLmRhdGEub3B0aW9ucztcbiAgICAgICAgfSxcbiAgICAgICAgLy8gc2V0IG9wdGlvbnMgb2YgY29sdW1uIGJ5IGluZGV4XG4gICAgICAgIHNldENvbHVtblZhbHVlczogZnVuY3Rpb24gKGluZGV4LCBvcHRpb25zLCBuZWVkUmVzZXQpIHtcbiAgICAgICAgICAgIGlmIChuZWVkUmVzZXQgPT09IHZvaWQgMCkgeyBuZWVkUmVzZXQgPSB0cnVlOyB9XG4gICAgICAgICAgICB2YXIgY29sdW1uID0gdGhpcy5jaGlsZHJlbltpbmRleF07XG4gICAgICAgICAgICBpZiAoY29sdW1uID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QobmV3IEVycm9yKCdzZXRDb2x1bW5WYWx1ZXM6IOWvueW6lOWIl+S4jeWtmOWcqCcpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBpc1NhbWUgPSBKU09OLnN0cmluZ2lmeShjb2x1bW4uZGF0YS5vcHRpb25zKSA9PT0gSlNPTi5zdHJpbmdpZnkob3B0aW9ucyk7XG4gICAgICAgICAgICBpZiAoaXNTYW1lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGNvbHVtbi5zZXQoeyBvcHRpb25zOiBvcHRpb25zIH0pLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChuZWVkUmVzZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29sdW1uLnNldEluZGV4KDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICAvLyBnZXQgdmFsdWVzIG9mIGFsbCBjb2x1bW5zXG4gICAgICAgIGdldFZhbHVlczogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY2hpbGRyZW4ubWFwKGZ1bmN0aW9uIChjaGlsZCkgeyByZXR1cm4gY2hpbGQuZ2V0VmFsdWUoKTsgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIC8vIHNldCB2YWx1ZXMgb2YgYWxsIGNvbHVtbnNcbiAgICAgICAgc2V0VmFsdWVzOiBmdW5jdGlvbiAodmFsdWVzKSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICAgICAgdmFyIHN0YWNrID0gdmFsdWVzLm1hcChmdW5jdGlvbiAodmFsdWUsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLnNldENvbHVtblZhbHVlKGluZGV4LCB2YWx1ZSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLmFsbChzdGFjayk7XG4gICAgICAgIH0sXG4gICAgICAgIC8vIGdldCBpbmRleGVzIG9mIGFsbCBjb2x1bW5zXG4gICAgICAgIGdldEluZGV4ZXM6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmNoaWxkcmVuLm1hcChmdW5jdGlvbiAoY2hpbGQpIHsgcmV0dXJuIGNoaWxkLmRhdGEuY3VycmVudEluZGV4OyB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgLy8gc2V0IGluZGV4ZXMgb2YgYWxsIGNvbHVtbnNcbiAgICAgICAgc2V0SW5kZXhlczogZnVuY3Rpb24gKGluZGV4ZXMpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgc3RhY2sgPSBpbmRleGVzLm1hcChmdW5jdGlvbiAob3B0aW9uSW5kZXgsIGNvbHVtbkluZGV4KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLnNldENvbHVtbkluZGV4KGNvbHVtbkluZGV4LCBvcHRpb25JbmRleCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLmFsbChzdGFjayk7XG4gICAgICAgIH1cbiAgICB9XG59KTtcbiJdLCJmaWxlIjoiaW5kZXguanMifQ==
export default global['__wxComponents']['vant/picker/index']
</script>
<style platform="mp-weixin">
@import '../common/index.css';.van-picker{position:relative;overflow:hidden;-webkit-text-size-adjust:100%;background-color:#fff;-webkit-user-select:none;user-select:none}.van-picker__toolbar{display:-webkit-flex;display:flex;height:44px;line-height:44px;-webkit-justify-content:space-between;justify-content:space-between}.van-picker__cancel,.van-picker__confirm{padding:0 15px;font-size:14px;color:#1989fa}.van-picker__cancel--hover,.van-picker__confirm--hover{background-color:#f2f3f5}.van-picker__title{max-width:50%;font-size:16px;font-weight:500;text-align:center}.van-picker__columns{position:relative;display:-webkit-flex;display:flex}.van-picker__column{-webkit-flex:1 1;flex:1 1;width:0}.van-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:4;display:-webkit-flex;display:flex;background-color:hsla(0,0%,100%,.9);-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-picker__frame,.van-picker__loading .van-loading{position:absolute;top:50%;left:0;z-index:1;width:100%;pointer-events:none;-webkit-transform:translateY(-50%);transform:translateY(-50%)}
</style>