UNPKG

thank-ui

Version:

ui lib of vue

1,820 lines (1,617 loc) 3.07 MB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["Thank"] = factory(); else root["Thank"] = factory(); })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./config/production.entry.js": /*!************************************!*\ !*** ./config/production.entry.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Es6Promise = __webpack_require__(/*! es6-promise */ "./node_modules/_es6-promise@4.2.5@es6-promise/dist/es6-promise.js"); Es6Promise.polyfill(); /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/action-sheet/action-sheet.vue?vue&type=script&lang=js&": /*!*********************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/action-sheet/action-sheet.vue?vue&type=script&lang=js& ***! \*********************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _popup = __webpack_require__(/*! ../popup/popup.vue */ "./pot_components/src/components/popup/popup.vue"); var _popup2 = _interopRequireDefault(_popup); var _visibility = __webpack_require__(/*! ../../common/mixins/visibility */ "./pot_components/src/common/mixins/visibility.js"); var _visibility2 = _interopRequireDefault(_visibility); var _popup3 = __webpack_require__(/*! ../../common/mixins/popup */ "./pot_components/src/common/mixins/popup.js"); var _popup4 = _interopRequireDefault(_popup3); var _locale = __webpack_require__(/*! ../../common/mixins/locale */ "./pot_components/src/common/mixins/locale.js"); var _locale2 = _interopRequireDefault(_locale); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // var COMPONENT_NAME = 'pot-action-sheet'; var EVENT_SELECT = 'select'; var EVENT_CANCEL = 'cancel'; exports.default = { name: COMPONENT_NAME, mixins: [_visibility2.default, _popup4.default, _locale2.default], props: { data: { type: Array, default: function _default() { return []; } }, active: { type: Number, default: -1 }, title: { type: String, default: '' }, pickerStyle: { type: Boolean, default: false }, maskClosable: { type: Boolean, default: true }, cancelTxt: { type: String, default: '' } }, computed: { _cancelTxt: function _cancelTxt() { return this.cancelTxt || this.$t('cancel'); } }, methods: { maskClick: function maskClick() { this.maskClosable && this.cancel(); }, cancel: function cancel() { this.hide(); this.$emit(EVENT_CANCEL); }, itemClick: function itemClick(item, index) { this.hide(); this.$emit(EVENT_SELECT, item, index); } }, components: { PotPopup: _popup2.default } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/bubble/bubble.vue?vue&type=script&lang=js&": /*!*********************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/bubble/bubble.vue?vue&type=script&lang=js& ***! \*********************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // exports.default = { props: { y: { type: Number, default: 0 } }, data: function data() { return { width: 50, height: 80 }; }, computed: { distance: function distance() { return Math.max(0, Math.min(this.y * this.ratio, this.maxDistance)); }, style: function style() { return 'width:' + this.width / this.ratio + 'px;height:' + this.height / this.ratio + 'px'; } }, mounted: function mounted() { this.ratio = window.devicePixelRatio; this.width *= this.ratio; this.height *= this.ratio; this.initRadius = 18 * this.ratio; this.minHeadRadius = 12 * this.ratio; this.minTailRadius = 5 * this.ratio; this.initArrowRadius = 10 * this.ratio; this.minArrowRadius = 6 * this.ratio; this.arrowWidth = 3 * this.ratio; this.maxDistance = 40 * this.ratio; this.initCenterX = 25 * this.ratio; this.initCenterY = 25 * this.ratio; this.headCenter = { x: this.initCenterX, y: this.initCenterY }; this._draw(); }, methods: { _draw: function _draw() { var bubble = this.$refs.bubble; var ctx = bubble.getContext('2d'); ctx.clearRect(0, 0, bubble.width, bubble.height); this._drawBubble(ctx); this._drawArrow(ctx); }, _drawBubble: function _drawBubble(ctx) { ctx.save(); ctx.beginPath(); var rate = this.distance / this.maxDistance; var headRadius = this.initRadius - (this.initRadius - this.minHeadRadius) * rate; this.headCenter.y = this.initCenterY - (this.initRadius - this.minHeadRadius) * rate; // upper semicircle ctx.arc(this.headCenter.x, this.headCenter.y, headRadius, 0, Math.PI, true); // left bessel var tailRadius = this.initRadius - (this.initRadius - this.minTailRadius) * rate; var tailCenter = { x: this.headCenter.x, y: this.headCenter.y + this.distance }; var tailPointL = { x: tailCenter.x - tailRadius, y: tailCenter.y }; var controlPointL = { x: tailPointL.x, y: tailPointL.y - this.distance / 2 }; ctx.quadraticCurveTo(controlPointL.x, controlPointL.y, tailPointL.x, tailPointL.y); // lower semicircle ctx.arc(tailCenter.x, tailCenter.y, tailRadius, Math.PI, 0, true); // right bessel var headPointR = { x: this.headCenter.x + headRadius, y: this.headCenter.y }; var controlPointR = { x: tailCenter.x + tailRadius, y: headPointR.y + this.distance / 2 }; ctx.quadraticCurveTo(controlPointR.x, controlPointR.y, headPointR.x, headPointR.y); ctx.fillStyle = 'rgb(170,170,170)'; ctx.fill(); ctx.strokeStyle = 'rgb(153,153,153)'; ctx.stroke(); ctx.restore(); }, _drawArrow: function _drawArrow(ctx) { ctx.save(); ctx.beginPath(); var rate = this.distance / this.maxDistance; var arrowRadius = this.initArrowRadius - (this.initArrowRadius - this.minArrowRadius) * rate; // inner circle ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius - (this.arrowWidth - rate), -Math.PI / 2, 0, true); // outer circle ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius, 0, Math.PI * 3 / 2, false); ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius - this.arrowWidth / 2 + rate); ctx.lineTo(this.headCenter.x + this.arrowWidth * 2 - rate * 2, this.headCenter.y - arrowRadius + this.arrowWidth / 2); ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius + this.arrowWidth * 3 / 2 - rate); ctx.fillStyle = 'rgb(255,255,255)'; ctx.fill(); ctx.strokeStyle = 'rgb(170,170,170)'; ctx.stroke(); ctx.restore(); } }, watch: { y: function y() { this._draw(); } } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/button/button.vue?vue&type=script&lang=js&": /*!*********************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/button/button.vue?vue&type=script&lang=js& ***! \*********************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // // // // // // // var COMPONENT_NAME = 'pot-button'; exports.default = { name: COMPONENT_NAME, props: { icon: { type: String, default: '' }, active: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, inline: { type: Boolean, default: false }, primary: { type: Boolean, default: false }, outline: { type: Boolean, default: false }, light: { type: Boolean, default: false }, type: { type: String, default: 'button' } }, computed: { btnClass: function btnClass() { return { 'pot-btn_active': this.active, 'pot-btn_disabled': this.disabled, 'pot-btn-inline': this.inline, 'pot-btn-primary': this.primary, 'pot-btn-outline': this.outline, 'pot-btn-outline-primary': this.outline && this.primary, 'pot-btn-light': this.light }; } }, methods: { handleClick: function handleClick(event) { if (this.disabled) { event.preventDefault(); event.stopPropagation(); return; } this.$emit('click', event); } } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/cascade-picker/cascade-picker.vue?vue&type=script&lang=js&": /*!*************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/cascade-picker/cascade-picker.vue?vue&type=script&lang=js& ***! \*************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _picker = __webpack_require__(/*! ../picker/picker.vue */ "./pot_components/src/components/picker/picker.vue"); var _picker2 = _interopRequireDefault(_picker); var _visibility = __webpack_require__(/*! ../../common/mixins/visibility */ "./pot_components/src/common/mixins/visibility.js"); var _visibility2 = _interopRequireDefault(_visibility); var _popup = __webpack_require__(/*! ../../common/mixins/popup */ "./pot_components/src/common/mixins/popup.js"); var _popup2 = _interopRequireDefault(_popup); var _basicPicker = __webpack_require__(/*! ../../common/mixins/basic-picker */ "./pot_components/src/common/mixins/basic-picker.js"); var _basicPicker2 = _interopRequireDefault(_basicPicker); var _picker3 = __webpack_require__(/*! ../../common/mixins/picker */ "./pot_components/src/common/mixins/picker.js"); var _picker4 = _interopRequireDefault(_picker3); var _locale = __webpack_require__(/*! ../../common/mixins/locale */ "./pot_components/src/common/mixins/locale.js"); var _locale2 = _interopRequireDefault(_locale); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // // // // // // // // // // // // // // // // // // // // var COMPONENT_NAME = 'pot-cascade-picker'; var EVENT_SELECT = 'select'; var EVENT_CANCEL = 'cancel'; var EVENT_CHANGE = 'change'; exports.default = { name: COMPONENT_NAME, mixins: [_visibility2.default, _popup2.default, _basicPicker2.default, _picker4.default, _locale2.default], props: { async: { type: Boolean, default: false } }, data: function data() { return { cascadeData: this.data.slice(), pickerSelectedIndex: this.selectedIndex.slice(), pickerData: [], pending: false }; }, created: function created() { this._updatePickerData(); }, methods: { setData: function setData(data) { var selectedIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; this.pending = false; this.cascadeData = data.slice(); this.pickerSelectedIndex = selectedIndex.slice(); this._updatePickerData(); }, _pickerSelect: function _pickerSelect(selectedVal, selectedIndex, selectedText) { this.$emit(EVENT_SELECT, selectedVal, selectedIndex, selectedText); }, _pickerCancel: function _pickerCancel() { this.$emit(EVENT_CANCEL); }, _pickerChange: function _pickerChange(i, newIndex) { if (newIndex !== this.pickerSelectedIndex[i]) { this.pickerSelectedIndex.splice(i, 1, newIndex); this.async ? this.pending = i !== this.pickerData.length - 1 : this._updatePickerData(i + 1); } this.$emit(EVENT_CHANGE, i, newIndex); }, _updatePickerData: function _updatePickerData() { var _this = this; var fromColumn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var data = this.cascadeData; var i = 0; while (data) { if (i >= fromColumn) { (function () { var columnData = []; data.forEach(function (item) { columnData.push({ value: item[_this.valueKey], text: item[_this.textKey] }); }); _this.pickerData[i] = columnData; /* refillColumn could only be called after show() */ _this.pickerSelectedIndex[i] = fromColumn === 0 ? _this.pickerSelectedIndex[i] < data.length ? _this.pickerSelectedIndex[i] || 0 : 0 : _this.$refs.picker.refillColumn(i, columnData); })(); } data = data.length ? data[this.pickerSelectedIndex[i]].children : null; i++; } if (i < this.pickerData.length) { this.pickerData.splice(i, this.pickerData.length - i); } this.pickerData = this.pickerData.slice(); } }, components: { potPicker: _picker2.default } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/checkbox-group/checkbox-group.vue?vue&type=script&lang=js&": /*!*************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/checkbox-group/checkbox-group.vue?vue&type=script&lang=js& ***! \*************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _checkbox = __webpack_require__(/*! ../checkbox/checkbox.vue */ "./pot_components/src/components/checkbox/checkbox.vue"); var _checkbox2 = _interopRequireDefault(_checkbox); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var COMPONENT_NAME = 'pot-checkbox-group'; // // // // // // // // // // // // // var EVENT_INPUT = 'input'; var EVENT_CHECKED = 'checked'; var EVENT_CANCLE_CHECKED = 'cancel-checked'; exports.default = { name: COMPONENT_NAME, props: { value: { type: Array }, horizontal: { type: Boolean, default: false }, shape: { type: String, default: 'circle' }, position: { type: String, default: 'left' }, hollowStyle: { type: Boolean, default: false }, options: { type: Array, default: function _default() { return []; } }, min: { type: Number, default: 0 }, max: { type: Number, default: Infinity } }, data: function data() { return { _value: [], _checkboxGroup: true }; }, computed: { groupClass: function groupClass() { if (!this.horizontal) { return 'border-top-1px border-bottom-1px'; } } }, watch: { value: { immediate: true, handler: function handler(newValue, oldValue) { this._value = this.value.concat(); } } }, mounted: function mounted() { var _this = this; this.$on(EVENT_CHECKED, function (value) { if (_this._value.length < _this.max) { _this._value.push(value); } _this.$emit(EVENT_INPUT, _this._value); }); this.$on(EVENT_CANCLE_CHECKED, function (value) { if (_this._value.length > _this.min) { var index = _this._value.indexOf(value); _this._value.splice(index, 1); } _this.$emit(EVENT_INPUT, _this._value); }); }, components: { potCheckbox: _checkbox2.default } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/checkbox/checkbox.vue?vue&type=script&lang=js&": /*!*************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/checkbox/checkbox.vue?vue&type=script&lang=js& ***! \*************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // // // // // // // // // var COMPONENT_NAME = 'pot-checkbox'; var EVENT_INPUT = 'input'; var EVENT_CHECKED = 'checked'; var EVENT_CANCLE_CHECKED = 'cancel-checked'; exports.default = { name: COMPONENT_NAME, props: { value: { type: [Boolean, String] }, label: { type: [Boolean, String] }, disabled: { type: Boolean, default: false }, option: { type: [Boolean, String, Object], default: function _default() { return { _def_option: true }; } }, position: { type: String, default: 'left' }, shape: { type: String, default: 'circle' }, hollowStyle: { type: Boolean, default: false } }, data: function data() { var parent = this.$parent; var isInGroup = parent.$data._checkboxGroup; var isInHorizontalGroup = isInGroup && parent.$props.horizontal; return { isInGroup: isInGroup, isInHorizontalGroup: isInHorizontalGroup }; }, computed: { computedOption: function computedOption() { var option = this.option; var label = this.label; var disabled = this.disabled; if (option._def_option === true) { option = { label: label, value: label, disabled: disabled }; } else if (typeof option === 'string') { option = { label: option, value: option, disabled: false }; } return option; }, checkValue: { get: function get() { if (this.isInGroup) { return this.$parent.value.indexOf(this.computedOption.value) > -1; } else { return Boolean(this.value); } }, set: function set(newValue) { var value = this.computedOption.value; var emitValue = value && newValue ? value : newValue; var parentEmitEvent = newValue ? EVENT_CHECKED : EVENT_CANCLE_CHECKED; this.$emit(EVENT_INPUT, emitValue); if (this.isInGroup) { this.$parent.$emit(parentEmitEvent, value || newValue); } } }, _containerClass: function _containerClass() { return { 'pot-checkbox-hollow': this.hollowStyle, 'pot-checkbox_checked': this.checkValue, 'pot-checkbox_disabled': this.computedOption.disabled, 'border-right-1px': this.isInHorizontalGroup }; }, _wrapClass: function _wrapClass() { if (this.isInGroup && !this.isInHorizontalGroup) { return 'border-bottom-1px'; } }, isSquare: function isSquare() { return this.shape === 'square' || this.hollowStyle; }, _borderIconClass: function _borderIconClass() { return this.isSquare ? 'potic-square-border' : 'potic-round-border'; }, _rightIconClass: function _rightIconClass() { return this.isSquare ? 'potic-square-right' : 'potic-right'; } } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/checker/checker-item.vue?vue&type=script&lang=js&": /*!****************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/checker/checker-item.vue?vue&type=script&lang=js& ***! \****************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // // // // // // // var COMPONENT_NAME = 'pot-checker-item'; exports.default = { name: COMPONENT_NAME, props: { option: { type: Object, default: function _default() { /* istanbul ignore next */ return {}; } } }, computed: { isActive: function isActive() { var isRadio = this.$parent.isRadio; var currentValue = this.$parent.currentValue; var value = this.option.value; return isRadio ? currentValue === value : currentValue.indexOf(value) >= 0; } }, methods: { clickHandler: function clickHandler() { this.$parent.check(this.option); } } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/checker/checker.vue?vue&type=script&lang=js&": /*!***********************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/checker/checker.vue?vue&type=script&lang=js& ***! \***********************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _checkerItem = __webpack_require__(/*! ./checker-item.vue */ "./pot_components/src/components/checker/checker-item.vue"); var _checkerItem2 = _interopRequireDefault(_checkerItem); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var COMPONENT_NAME = 'pot-checker'; // // // // // // // // // // var EVENT_INPUT = 'input'; exports.default = { name: COMPONENT_NAME, props: { value: [String, Number, Array], options: { type: Array, default: function _default() { /* istanbul ignore next */ return []; } }, type: { type: String, default: 'checkbox' }, min: { type: Number, default: 0 }, max: { type: Number, default: function _default() { return this.options.length; } } }, data: function data() { return { currentValue: this.value }; }, computed: { isRadio: function isRadio() { return this.type === 'radio'; } }, watch: { value: function value(newValue) { this.currentValue = newValue; }, currentValue: function currentValue(val) { this.$emit(EVENT_INPUT, val); } }, methods: { check: function check(option) { if (this.isRadio) { this.checkRadio(option); } else { this.checkCheckbox(option); } }, checkRadio: function checkRadio(option) { this.currentValue = option.value; }, checkCheckbox: function checkCheckbox(option) { var value = option.value; var currentValue = this.currentValue; var valueLen = currentValue.length; var min = this.min; var max = this.max; var index = currentValue.indexOf(value); if (index > -1) { valueLen > min && currentValue.splice(index, 1); } else { valueLen < max && currentValue.push(value); } } }, components: { potCheckerItem: _checkerItem2.default } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/container/container.vue?vue&type=script&lang=js&": /*!***************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/container/container.vue?vue&type=script&lang=js& ***! \***************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // // exports.default = { name: 'pot-container' }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/date-picker/date-picker.vue?vue&type=script&lang=js&": /*!*******************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/date-picker/date-picker.vue?vue&type=script&lang=js& ***! \*******************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/object/keys.js"); var _keys2 = _interopRequireDefault(_keys); var _assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/object/assign.js"); var _assign2 = _interopRequireDefault(_assign); var _visibility = __webpack_require__(/*! ../../common/mixins/visibility */ "./pot_components/src/common/mixins/visibility.js"); var _visibility2 = _interopRequireDefault(_visibility); var _popup = __webpack_require__(/*! ../../common/mixins/popup */ "./pot_components/src/common/mixins/popup.js"); var _popup2 = _interopRequireDefault(_popup); var _picker = __webpack_require__(/*! ../../common/mixins/picker */ "./pot_components/src/common/mixins/picker.js"); var _picker2 = _interopRequireDefault(_picker); var _locale = __webpack_require__(/*! ../../common/mixins/locale */ "./pot_components/src/common/mixins/locale.js"); var _locale2 = _interopRequireDefault(_locale); var _util = __webpack_require__(/*! ../../common/helpers/util */ "./pot_components/src/common/helpers/util.js"); var _date = __webpack_require__(/*! ../../common/lang/date */ "./pot_components/src/common/lang/date.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // // // // // // // // // // // // // // // // // // var COMPONENT_NAME = 'pot-date-picker'; var EVENT_SELECT = 'select'; var EVENT_CANCEL = 'cancel'; var EVENT_CHANGE = 'change'; var TYPE_LIST = ['year', 'month', 'date', 'hour', 'minute', 'second']; var NATURE_BOUNDARY_MAP = { month: { natureMin: 1, natureMax: 12 }, date: { natureMin: 1, natureMax: 31 }, hour: { natureMin: 0, natureMax: 23 }, minute: { natureMin: 0, natureMax: 59 }, second: { natureMin: 0, natureMax: 59 } }; var DEFAULT_FORMAT = { year: 'YYYY', month: 'M', date: 'D', hour: 'hh', minute: 'mm', second: 'ss' }; exports.default = { name: COMPONENT_NAME, mixins: [_visibility2.default, _popup2.default, _picker2.default, _locale2.default], props: { min: { type: [Date, Array], default: function _default() { return new Date(2010, 1, 1); } }, max: { type: [Date, Array], default: function _default() { return new Date(2020, 12, 31); } }, startColumn: { type: String, default: function _default() { return 'year'; } }, columnCount: { type: Number, default: 3 }, format: { type: Object, default: function _default() { return {}; } }, value: { type: [Date, Array], default: function _default() { return this.min; } } }, computed: { formatConfig: function formatConfig() { var formatConfig = (0, _assign2.default)({}, DEFAULT_FORMAT); (0, _util.deepAssign)(formatConfig, this.format); return formatConfig; }, natureRangeCache: function natureRangeCache() { var _this = this; var natureRangeCache = { hour: [], minute: [], second: [] }; (0, _keys2.default)(natureRangeCache).forEach(function (key) { natureRangeCache[key] = _this._range(key, NATURE_BOUNDARY_MAP[key].natureMin, NATURE_BOUNDARY_MAP[key].natureMax); }); return natureRangeCache; }, startIndex: function startIndex() { var startIndex = TYPE_LIST.indexOf(this.startColumn); return startIndex < 0 ? 0 : startIndex; }, minArray: function minArray() { return this.min instanceof Date ? dateToArray(this.min).slice(this.startIndex, this.startIndex + this.columnCount) : this.min; }, maxArray: function maxArray() { return this.max instanceof Date ? dateToArray(this.max).slice(this.startIndex, this.startIndex + this.columnCount) : this.max; }, valueArray: function valueArray() { return this.value instanceof Date ? dateToArray(this.value).slice(this.startIndex, this.startIndex + this.columnCount) : this.value; }, data: function data() { var data = []; this._generateData(this.startIndex, 0, data); return data; }, selectedIndex: function selectedIndex() { var _this2 = this; var selectedIndex = []; var data = this.data; var index = void 0; var _loop = function _loop(i) { index = (0, _util.findIndex)(data, function (item) { return _this2.valueArray[i] && item.value === _this2.valueArray[i]; }); selectedIndex[i] = index !== -1 ? index : 0; data = data[selectedIndex[i]] && data[selectedIndex[i]].children; }; for (var i = 0; i < this.columnCount && i < 6 - this.startIndex; i++) { _loop(i); } return selectedIndex; } }, methods: { _select: function _select(selectedVal, selectedIndex, selectedText) { this.$emit(EVENT_SELECT, this._arrayToDate(selectedVal), selectedVal, selectedText); }, _cancel: function _cancel() { this.$emit(EVENT_CANCEL); }, _change: function _change(i, newIndex) { this.$emit(EVENT_CHANGE, i, newIndex); }, _generateData: function _generateData(i, count, item) { var _this3 = this; if (count === 0) { var min = i === 0 ? this.minArray[0] : Math.max(this.minArray[0], NATURE_BOUNDARY_MAP[TYPE_LIST[i]].natureMin); var max = i === 0 ? this.maxArray[0] : Math.min(this.maxArray[0], NATURE_BOUNDARY_MAP[TYPE_LIST[i]].natureMax); item.push.apply(item, this._range(TYPE_LIST[i], min, max, true, true)); } else { if (i < 3 || item.isMin || item.isMax) { var natureMax = i === 2 ? (0, _date.computeNatureMaxDay)(item.value, item.year) : NATURE_BOUNDARY_MAP[TYPE_LIST[i]].natureMax; var _min = item.isMin ? Math.max(this.minArray[count], NATURE_BOUNDARY_MAP[TYPE_LIST[i]].natureMin) : NATURE_BOUNDARY_MAP[TYPE_LIST[i]].natureMin; var _max = item.isMax ? Math.min(this.maxArray[count], natureMax) : natureMax; var storageYear = i === 1 && this.startIndex === 0 && this.columnCount >= 3 && item.value; item.children = this._range(TYPE_LIST[i], _min, _max, item.isMin, item.isMax, storageYear); } else { item.children = this.natureRangeCache[TYPE_LIST[i]]; } } if (count < this.columnCount - 1 && i < 5) { (item.children || item).forEach(function (subItem) { (!subItem.children || subItem.isMin || subItem.isMax) && _this3._generateData(i + 1, count + 1, subItem); }); } }, _arrayToDate: function _arrayToDate(selectedVal) { var args = []; var defaultDateArray = dateToArray(new Date(0)); for (var i = 0; i < 6; i++) { if (i < this.startIndex) { args[i] = defaultDateArray[i]; } else if (i >= this.startIndex + this.columnCount) { args[i] = NATURE_BOUNDARY_MAP[TYPE_LIST[i]].natureMin; } else { args[i] = selectedVal[i - this.startIndex]; } } // Month need to subtract 1. args[1]--; return new (Function.prototype.bind.apply(Date, [null].concat(args)))(); }, _range: function _range(type, min, max, fatherIsMin, fatherIsMax) { var year = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; if (!this._rangeCache) { this._rangeCache = {}; } var k = type + year + min + max + fatherIsMin + fatherIsMax; if (this._rangeCache[k]) { return this._rangeCache[k]; } var arr = []; var format = this.formatConfig[type]; for (var i = min; i <= max; i++) { var object = { text: (0, _date.formatType)(type, format, i, 'i'), value: i }; if (fatherIsMin && i === min) object.isMin = true; if (fatherIsMax && i === max) object.isMax = true; if (year) object.year = year; arr.push(object); } this._rangeCache[k] = arr; return arr; } } }; function dateToArray(date) { return [date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()]; } /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/dialog/dialog.vue?vue&type=script&lang=js&": /*!*********************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/dialog/dialog.vue?vue&type=script&lang=js& ***! \*********************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); var _extends3 = _interopRequireDefault(_extends2); var _assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/object/assign.js"); var _assign2 = _interopRequireDefault(_assign); var _popup = __webpack_require__(/*! ../popup/popup.vue */ "./pot_components/src/components/popup/popup.vue"); var _popup2 = _interopRequireDefault(_popup); var _input = __webpack_require__(/*! ../input/input.vue */ "./pot_components/src/components/input/input.vue"); var _input2 = _interopRequireDefault(_input); var _visibility = __webpack_require__(/*! ../../common/mixins/visibility */ "./pot_components/src/common/mixins/visibility.js"); var _visibility2 = _interopRequireDefault(_visibility); var _popup3 = __webpack_require__(/*! ../../common/mixins/popup */ "./pot_components/src/common/mixins/popup.js"); var _popup4 = _interopRequireDefault(_popup3); var _locale = __webpack_require__(/*! ../../common/mixins/locale */ "./pot_components/src/common/mixins/locale.js"); var _locale2 = _interopRequireDefault(_locale); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var COMPONENT_NAME = 'pot-dialog'; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // var EVENT_CONFIRM = 'confirm'; var EVENT_CANCEL = 'cancel'; var EVENT_CLOSE = 'close'; var defHref = 'javascript:;'; var defConfirmBtn = { textType: 'ok', active: true, disabled: false, href: defHref }; var defCancelBtn = { textType: 'cancel', active: false, disabled: false, href: defHref }; var parseBtn = function parseBtn(btn, defBtn) { if (typeof btn === 'string') { btn = { text: btn }; } var text = defBtn && this.$t(defBtn.textType); return (0, _assign2.default)({}, defBtn, { text: text }, btn); }; exports.default = { name: COMPONENT_NAME, mixins: [_visibility2.default, _popup4.default, _locale2.default], props: { type: { type: String, default: 'alert' }, data: { type: Array, default: function _default() { return []; } }, selects: { type: Array, default: function _default() { return []; } }, prompt: { type: Object, default: function _default() { return { value: '', placeholder: '' }; } }, icon: { type: String, default: '' }, title: { type: String, default: '' }, select: { type: Array, default: function _default() { return ['1', '2', '3', '4']; } }, content: { type: String, default: '' }, showClose: { type: Boolean, default: false }, confirmBtn: { type: [Object, String], default: function _default() { return (0, _extends3.default)({}, defConfirmBtn); } }, cancelBtn: { type: [Object, String], default: function _default() { return (0, _extends3.default)({}, defCancelBtn); } } }, data: function data() { return { defHref: defHref, active: 0, hasSelects: [], promptValue: this.prompt.value }; }, computed: { _confirmBtn: function _confirmBtn() { return parseBtn.call(this, this.confirmBtn, defConfirmBtn); }, _cancelBtn: function _cancelBtn() { return parseBtn.call(this, this.cancelBtn, defCancelBtn); }, isConfirm: function isConfirm() { return this.type === 'confirm'; }, isSelects: function isSelects() { return this.type === 'selects'; }, isSelect: function isSelect() { return this.type === 'select'; }, isPrompt: function isPrompt() { return this.type === 'prompt'; }, containerClass: function containerClass() { return 'pot-dialog-' + this.type; } }, watch: { 'prompt.value': { handler: function handler(newVal) { this.promptValue = newVal; } } }, methods: { onSelects: function onSelects(index) { var i = this.hasSelects.indexOf(index); if (i == -1) { this.hasSelects.push(index); } else { this.hasSelects.splice(i, 1); } }, maskClick: function maskClick(e) { this.maskClosable && this.cancel(e); }, confirm: function confirm(e) { if (this._confirmBtn.disabled) { return; } this.hide(); if (this.isSelect) { this.$emit(EVENT_CONFIRM, e, this.active); } else if (this.isSelects) { this.$emit(EVENT_CONFIRM, e, this.hasSelects); } else { this.$emit(EVENT_CONFIRM, e, this.promptValue); } }, cancel: function cancel(e) { if (this._cancelBtn.disabled) { return; } this.hide(); this.$emit(EVENT_CANCEL, e); }, close: function close(e) { this.hide(); this.$emit(EVENT_CLOSE, e); } }, components: { potPopup: _popup2.default, potInput: _input2.default } }; /***/ }), /***/ "./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js?!./node_modules/_vue-loader@15.4.2@vue-loader/lib/index.js?!./pot_components/src/components/drawer/drawer-item.vue?vue&type=script&lang=js&": /*!**************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/_babel-loader@7.1.5@babel-loader/lib??ref--4-0!./node_modules/_vue-loader@15.4.2@vue-loader/lib??vue-loader-options!./pot_components/src/components/drawer/drawer-item.vue?vue&type=script&lang=js& ***! \**************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /