<reponame>zuolung/taro-vantui<filename>site/demo/weapp/pages/datetime-picker/index.js
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/datetime-picker/index"], {

/***/ "./node_modules/babel-loader/lib/index.js!./src/pages/datetime-picker/index.js":
/*!****************************************************************************!*\
  !*** ./node_modules/babel-loader/lib!./src/pages/datetime-picker/index.js ***!
  \****************************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function (module, __webpack_exports__, __webpack_require__) {

      "use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function () { return Index; });
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createSuper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/createSuper */ "./node_modules/@babel/runtime/helpers/createSuper.js");
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createSuper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createSuper__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
/* harmony import */ var _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! taro-vantui */ "./node_modules/taro-vantui/dist/index.esm.js");
/* harmony import */ var _components_demo_block_index__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../components/demo-block/index */ "./src/components/demo-block/index.js");
/* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./index.scss */ "./src/pages/datetime-picker/index.scss");
/* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_index_scss__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__);


















      var Index = /*#__PURE__*/function (_React$Component) {
        _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default()(Index, _React$Component);

        var _super = _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createSuper__WEBPACK_IMPORTED_MODULE_6___default()(Index);

        function Index() {
          var _this;

          _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Index);

          _this = _super.call(this);

          _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this), "state", {
            minHour: 10,
            maxHour: 20,
            minDate: new Date(2018, 0, 1).getTime(),
            maxDate: new Date(2019, 10, 1).getTime(),
            currentDate1: new Date(2018, 2, 31).getTime(),
            currentDate2: null,
            currentDate3: new Date(2018, 0, 1),
            currentDate4: '12:00',
            loading: false
          });

          _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this), "formatter", function (type, value) {
            if (type === 'year') {
              return "".concat(value, "\u5E74");
            }

            if (type === 'month') {
              return "".concat(value, "\u6708");
            }

            return value;
          });

          _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this), "filter", function (type, options) {
            if (type === 'minute') {
              return options.filter(function (option) {
                return option % 5 === 0;
              });
            }

            return options;
          });

          _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this), "onInput", function (event) {
            var detail = event.detail,
              currentTarget = event.currentTarget;
            console.info(event);

            var result = _this.getResult(detail, currentTarget.dataset.type);

            Object(_antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__[/* toast */ "ob"])(result);
          });

          _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this), "getResult", function (time, type) {
            var date = new Date(time);

            switch (type) {
              case 'datetime':
                return date.toLocaleString();

              case 'date':
                return date.toLocaleDateString();

              case 'year-month':
                return "".concat(date.getFullYear(), "/").concat(date.getMonth() + 1);

              case 'time':
                return time;

              default:
                return '';
            }
          });

          return _this;
        }

        _Users_mac_Desktop_iframe_vantui_packages_vantui_demo_node_modules_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(Index, [{
          key: "render",
          value: function render() {
            var _this2 = this;

            var _this$state = this.state,
              loading = _this$state.loading,
              currentDate1 = _this$state.currentDate1,
              minDate = _this$state.minDate,
              currentDate2 = _this$state.currentDate2,
              currentDate3 = _this$state.currentDate3,
              currentDate4 = _this$state.currentDate4,
              minHour = _this$state.minHour,
              maxHour = _this$state.maxHour;
            return /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsxs"])(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__[/* Block */ "a"], {
              children: [/*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_components_demo_block_index__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"], {
                title: "\u9009\u62E9\u5B8C\u6574\u65F6\u95F4",
                children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__[/* DatetimePicker */ "p"], {
                  type: "datetime",
                  loading: loading,
                  value: currentDate1,
                  minDate: minDate,
                  onInput: function onInput(e) {
                    _this2.onInput({
                      detail: e.detail,
                      currentTarget: {
                        dataset: {
                          type: 'datetime'
                        }
                      },
                      target: {
                        dataset: {
                          type: 'datetime'
                        }
                      }
                    });
                  }
                })
              }), /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_components_demo_block_index__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"], {
                title: "\u9009\u62E9\u65E5\u671F\uFF08\u5E74\u6708\u65E5\uFF09",
                children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__[/* DatetimePicker */ "p"], {
                  type: "date",
                  value: currentDate2,
                  minDate: minDate,
                  onInput: function onInput(e) {
                    _this2.onInput({
                      detail: e.detail,
                      currentTarget: {
                        dataset: {
                          type: 'date'
                        }
                      },
                      target: {
                        dataset: {
                          type: 'date'
                        }
                      }
                    });
                  },
                  formatter: this.formatter
                })
              }), /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_components_demo_block_index__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"], {
                title: "\u9009\u62E9\u65E5\u671F\uFF08\u5E74\u6708\uFF09",
                children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__[/* DatetimePicker */ "p"], {
                  type: "year-month",
                  value: currentDate3,
                  minDate: minDate,
                  onInput: function onInput(e) {
                    _this2.onInput({
                      detail: e.detail,
                      currentTarget: {
                        dataset: {
                          type: 'year-month'
                        }
                      },
                      target: {
                        dataset: {
                          type: 'year-month'
                        }
                      }
                    });
                  }
                })
              }), /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_components_demo_block_index__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"], {
                title: "\u9009\u62E9\u65F6\u95F4",
                children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__[/* DatetimePicker */ "p"], {
                  type: "time",
                  value: currentDate4,
                  minHour: minHour,
                  maxHour: maxHour,
                  onInput: function onInput(e) {
                    _this2.onInput({
                      detail: e.detail,
                      currentTarget: {
                        dataset: {
                          type: 'time'
                        }
                      },
                      target: {
                        dataset: {
                          type: 'time'
                        }
                      }
                    });
                  }
                })
              }), /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_components_demo_block_index__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"], {
                title: "\u9009\u9879\u8FC7\u6EE4\u5668",
                children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__[/* DatetimePicker */ "p"], {
                  type: "time",
                  value: currentDate4,
                  filter: this.filter
                })
              }), /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__["jsx"])(_antmjs_vantui__WEBPACK_IMPORTED_MODULE_10__[/* Toast */ "ib"], {
                id: "van-toast"
              })]
            });
          }
        }]);

        return Index;
      }(react__WEBPACK_IMPORTED_MODULE_9___default.a.Component);



      /***/
}),

/***/ "./node_modules/core-js/modules/es.array.filter.js":
/*!*********************************************************!*\
  !*** ./node_modules/core-js/modules/es.array.filter.js ***!
  \*********************************************************/
/*! no static exports found */
/***/ (function (module, exports, __webpack_require__) {

      "use strict";

      var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
      var $filter = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").filter;
      var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");

      var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');

      // `Array.prototype.filter` method
      // https://tc39.es/ecma262/#sec-array.prototype.filter
      // with adding support of @@species
      $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
        filter: function filter(callbackfn /* , thisArg */) {
          return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
        }
      });


      /***/
}),

/***/ "./src/pages/datetime-picker/index.js":
/*!********************************************!*\
  !*** ./src/pages/datetime-picker/index.js ***!
  \********************************************/
/*! no exports provided */
/*! all exports used */
/***/ (function (module, __webpack_exports__, __webpack_require__) {

      "use strict";
      __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/runtime */ "./node_modules/@tarojs/runtime/dist/runtime.esm.js");
/* harmony import */ var _node_modules_babel_loader_lib_index_js_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/babel-loader/lib!./index.js */ "./node_modules/babel-loader/lib/index.js!./src/pages/datetime-picker/index.js");


      var config = { "navigationBarTitleText": "DatetimePicker 时间选择" };


      var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__["createPageConfig"])(_node_modules_babel_loader_lib_index_js_index_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], 'pages/datetime-picker/index', { root: { cn: [] } }, config || {}))



      /***/
}),

/***/ "./src/pages/datetime-picker/index.scss":
/*!**********************************************!*\
  !*** ./src/pages/datetime-picker/index.scss ***!
  \**********************************************/
/*! no static exports found */
/***/ (function (module, exports, __webpack_require__) {

      // extracted by mini-css-extract-plugin

      /***/
})

}, [["./src/pages/datetime-picker/index.js", "runtime", "taro", "vendors", "common"]]]);
//# sourceMappingURL=index.js.map