\r\n \r\n \r\n style=\"max-width: 30px;\"\r\n />\r\n \r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./navBar.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./navBar.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./navBar.vue?vue&type=template&id=7f9774c3&scoped=true&\"\nimport script from \"./navBar.vue?vue&type=script&lang=js&\"\nexport * from \"./navBar.vue?vue&type=script&lang=js&\"\nimport style0 from \"./navBar.vue?vue&type=style&index=0&id=7f9774c3&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7f9774c3\",\n null\n \n)\n\ncomponent.options.__file = \"navBar.vue\"\nexport default component.exports","import '../../style/base.css';\nimport '../index.css';","import deepAssign from './deep-assign';\nexport default function deepClone(obj) {\n if (Array.isArray(obj)) {\n return obj.map(function (item) {\n return deepClone(item);\n });\n } else if (typeof obj === 'object') {\n return deepAssign({}, obj);\n }\n\n return obj;\n}","import create from '../utils/create';\nimport deepClone from '../utils/deep-clone';\nimport { isObj, range } from '../utils';\nvar DEFAULT_DURATION = 200;\nexport default create({\n render: function render() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: [_vm.b(), _vm.className],\n style: _vm.columnStyle,\n on: {\n \"touchstart\": _vm.onTouchStart,\n \"touchmove\": function touchmove($event) {\n $event.preventDefault();\n return _vm.onTouchMove($event);\n },\n \"touchend\": _vm.onTouchEnd,\n \"touchcancel\": _vm.onTouchEnd\n }\n }, [_c('ul', {\n style: _vm.wrapperStyle\n }, _vm._l(_vm.options, function (option, index) {\n return _c('li', {\n staticClass: \"van-ellipsis\",\n class: _vm.b('item', {\n disabled: _vm.isDisabled(option),\n selected: index === _vm.currentIndex\n }),\n style: _vm.optionStyle,\n domProps: {\n \"innerHTML\": _vm._s(_vm.getOptionText(option))\n },\n on: {\n \"click\": function click($event) {\n _vm.setIndex(index, true);\n }\n }\n });\n }))]);\n },\n name: 'picker-column',\n props: {\n valueKey: String,\n className: String,\n itemHeight: Number,\n defaultIndex: Number,\n initialOptions: Array,\n visibleItemCount: Number\n },\n data: function data() {\n return {\n startY: 0,\n offset: 0,\n duration: 0,\n startOffset: 0,\n options: deepClone(this.initialOptions),\n currentIndex: this.defaultIndex\n };\n },\n created: function created() {\n this.$parent.children && this.$parent.children.push(this);\n this.setIndex(this.currentIndex);\n },\n destroyed: function destroyed() {\n var children = this.$parent.children;\n children && children.splice(children.indexOf(this), 1);\n },\n watch: {\n defaultIndex: function defaultIndex() {\n this.setIndex(this.defaultIndex);\n }\n },\n computed: {\n count: function count() {\n return this.options.length;\n },\n baseOffset: function baseOffset() {\n return this.itemHeight * (this.visibleItemCount - 1) / 2;\n },\n columnStyle: function columnStyle() {\n return {\n height: this.itemHeight * this.visibleItemCount + 'px'\n };\n },\n wrapperStyle: function wrapperStyle() {\n return {\n transition: this.duration + \"ms\",\n transform: \"translate3d(0, \" + (this.offset + this.baseOffset) + \"px, 0)\",\n lineHeight: this.itemHeight + 'px'\n };\n },\n optionStyle: function optionStyle() {\n return {\n height: this.itemHeight + 'px'\n };\n }\n },\n methods: {\n onTouchStart: function onTouchStart(event) {\n this.startY = event.touches[0].clientY;\n this.startOffset = this.offset;\n this.duration = 0;\n },\n onTouchMove: function onTouchMove(event) {\n var deltaY = event.touches[0].clientY - this.startY;\n this.offset = range(this.startOffset + deltaY, -(this.count * this.itemHeight), this.itemHeight);\n },\n onTouchEnd: function onTouchEnd() {\n if (this.offset !== this.startOffset) {\n this.duration = DEFAULT_DURATION;\n var index = range(Math.round(-this.offset / this.itemHeight), 0, this.count - 1);\n this.setIndex(index, true);\n }\n },\n adjustIndex: function adjustIndex(index) {\n index = range(index, 0, this.count);\n\n for (var i = index; i < this.count; i++) {\n if (!this.isDisabled(this.options[i])) return i;\n }\n\n for (var _i = index - 1; _i >= 0; _i--) {\n if (!this.isDisabled(this.options[_i])) return _i;\n }\n },\n isDisabled: function isDisabled(option) {\n return isObj(option) && option.disabled;\n },\n getOptionText: function getOptionText(option) {\n return isObj(option) && this.valueKey in option ? option[this.valueKey] : option;\n },\n setIndex: function setIndex(index, userAction) {\n index = this.adjustIndex(index) || 0;\n this.offset = -index * this.itemHeight;\n\n if (index !== this.currentIndex) {\n this.currentIndex = index;\n userAction && this.$emit('change', index);\n }\n },\n setValue: function setValue(value) {\n var options = this.options;\n\n for (var i = 0; i < options.length; i++) {\n if (this.getOptionText(options[i]) === value) {\n return this.setIndex(i);\n }\n }\n },\n getValue: function getValue() {\n return this.options[this.currentIndex];\n }\n }\n});","/**\n * Common Picker Props\n */\nexport default {\n props: {\n title: String,\n loading: Boolean,\n showToolbar: Boolean,\n cancelButtonText: String,\n confirmButtonText: String,\n visibleItemCount: {\n type: Number,\n default: 5\n },\n itemHeight: {\n type: Number,\n default: 44\n }\n }\n};","import create from '../utils/create';\nimport PickerColumn from './PickerColumn';\nimport deepClone from '../utils/deep-clone';\nimport PickerMixin from '../mixins/picker';\nexport default create({\n render: function render() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: _vm.b()\n }, [_vm.showToolbar ? _c('div', {\n staticClass: \"van-hairline--top-bottom\",\n class: _vm.b('toolbar')\n }, [_vm._t(\"default\", [_c('div', {\n class: _vm.b('cancel'),\n on: {\n \"click\": function click($event) {\n _vm.emit('cancel');\n }\n }\n }, [_vm._v(\"\\n \" + _vm._s(_vm.cancelButtonText || _vm.$t('cancel')) + \"\\n \")]), _vm.title ? _c('div', {\n staticClass: \"van-ellipsis\",\n class: _vm.b('title'),\n domProps: {\n \"textContent\": _vm._s(_vm.title)\n }\n }) : _vm._e(), _c('div', {\n class: _vm.b('confirm'),\n on: {\n \"click\": function click($event) {\n _vm.emit('confirm');\n }\n }\n }, [_vm._v(\"\\n \" + _vm._s(_vm.confirmButtonText || _vm.$t('confirm')) + \"\\n \")])])], 2) : _vm._e(), _vm.loading ? _c('div', {\n class: _vm.b('loading')\n }, [_c('loading')], 1) : _vm._e(), _c('div', {\n class: _vm.b('columns'),\n style: _vm.columnsStyle,\n on: {\n \"touchmove\": function touchmove($event) {\n $event.preventDefault();\n }\n }\n }, [_vm._l(_vm.simple ? [_vm.columns] : _vm.columns, function (item, index) {\n return _c('picker-column', {\n key: index,\n attrs: {\n \"value-key\": _vm.valueKey,\n \"initial-options\": _vm.simple ? item : item.values,\n \"class-name\": item.className,\n \"default-index\": item.defaultIndex,\n \"item-height\": _vm.itemHeight,\n \"visible-item-count\": _vm.visibleItemCount\n },\n on: {\n \"change\": function change($event) {\n _vm.onChange(index);\n }\n }\n });\n }), _c('div', {\n staticClass: \"van-hairline--top-bottom\",\n class: _vm.b('frame'),\n style: _vm.frameStyle\n })], 2)]);\n },\n name: 'picker',\n mixins: [PickerMixin],\n components: {\n PickerColumn: PickerColumn\n },\n props: {\n columns: Array,\n valueKey: {\n type: String,\n default: 'text'\n }\n },\n data: function data() {\n return {\n children: []\n };\n },\n computed: {\n frameStyle: function frameStyle() {\n return {\n height: this.itemHeight + 'px'\n };\n },\n columnsStyle: function columnsStyle() {\n return {\n height: this.itemHeight * this.visibleItemCount + 'px'\n };\n },\n simple: function simple() {\n return this.columns.length && !this.columns[0].values;\n }\n },\n watch: {\n columns: function columns() {\n this.setColumns();\n }\n },\n methods: {\n setColumns: function setColumns() {\n var _this = this;\n\n var columns = this.simple ? [{\n values: this.columns\n }] : this.columns;\n columns.forEach(function (columns, index) {\n _this.setColumnValues(index, deepClone(columns.values));\n });\n },\n emit: function emit(event) {\n if (this.simple) {\n this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));\n } else {\n this.$emit(event, this.getValues(), this.getIndexes());\n }\n },\n onChange: function onChange(columnIndex) {\n if (this.simple) {\n this.$emit('change', this, this.getColumnValue(0), this.getColumnIndex(0));\n } else {\n this.$emit('change', this, this.getValues(), columnIndex);\n }\n },\n // get column instance by index\n getColumn: function getColumn(index) {\n return this.children[index];\n },\n // get column value by index\n getColumnValue: function getColumnValue(index) {\n var column = this.getColumn(index);\n return column && column.getValue();\n },\n // set column value by index\n setColumnValue: function setColumnValue(index, value) {\n var column = this.getColumn(index);\n column && column.setValue(value);\n },\n // get column option index by column index\n getColumnIndex: function getColumnIndex(columnIndex) {\n return (this.getColumn(columnIndex) || {}).currentIndex;\n },\n // set column option index by column index\n setColumnIndex: function setColumnIndex(columnIndex, optionIndex) {\n var column = this.getColumn(columnIndex);\n column && column.setIndex(optionIndex);\n },\n // get options of column by index\n getColumnValues: function getColumnValues(index) {\n return (this.children[index] || {}).options;\n },\n // set options of column by index\n setColumnValues: function setColumnValues(index, options) {\n var column = this.children[index];\n\n if (column && JSON.stringify(column.options) !== JSON.stringify(options)) {\n column.options = options;\n column.setIndex(0);\n }\n },\n // get values of all columns\n getValues: function getValues() {\n return this.children.map(function (child) {\n return child.getValue();\n });\n },\n // set values of all columns\n setValues: function setValues(values) {\n var _this2 = this;\n\n values.forEach(function (value, index) {\n _this2.setColumnValue(index, value);\n });\n },\n // get indexes of all columns\n getIndexes: function getIndexes() {\n return this.children.map(function (child) {\n return child.currentIndex;\n });\n },\n // set indexes of all columns\n setIndexes: function setIndexes(indexes) {\n var _this3 = this;\n\n indexes.forEach(function (optionIndex, columnIndex) {\n _this3.setColumnIndex(columnIndex, optionIndex);\n });\n }\n }\n});"],"sourceRoot":""}