框架源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3303 lines
92 KiB

4 years ago
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 297);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 0:
  90. /***/ (function(module, exports, __webpack_require__) {
  91. "use strict";
  92. var _interopRequireDefault = __webpack_require__(1);
  93. exports.__esModule = true;
  94. exports.noop = noop;
  95. exports.isDef = isDef;
  96. exports.isFunction = isFunction;
  97. exports.isObject = isObject;
  98. exports.isPromise = isPromise;
  99. exports.get = get;
  100. exports.isServer = exports.inBrowser = exports.addUnit = exports.createNamespace = void 0;
  101. var _vue = _interopRequireDefault(__webpack_require__(4));
  102. var _create = __webpack_require__(24);
  103. exports.createNamespace = _create.createNamespace;
  104. var _unit = __webpack_require__(20);
  105. exports.addUnit = _unit.addUnit;
  106. var inBrowser = typeof window !== 'undefined';
  107. exports.inBrowser = inBrowser;
  108. var isServer = _vue.default.prototype.$isServer; // eslint-disable-next-line @typescript-eslint/no-empty-function
  109. exports.isServer = isServer;
  110. function noop() {}
  111. function isDef(val) {
  112. return val !== undefined && val !== null;
  113. }
  114. function isFunction(val) {
  115. return typeof val === 'function';
  116. }
  117. function isObject(val) {
  118. return val !== null && typeof val === 'object';
  119. }
  120. function isPromise(val) {
  121. return isObject(val) && isFunction(val.then) && isFunction(val.catch);
  122. }
  123. function get(object, path) {
  124. var keys = path.split('.');
  125. var result = object;
  126. keys.forEach(function (key) {
  127. var _result$key;
  128. result = (_result$key = result[key]) != null ? _result$key : '';
  129. });
  130. return result;
  131. }
  132. /***/ }),
  133. /***/ 1:
  134. /***/ (function(module, exports) {
  135. function _interopRequireDefault(obj) {
  136. return obj && obj.__esModule ? obj : {
  137. "default": obj
  138. };
  139. }
  140. module.exports = _interopRequireDefault;
  141. /***/ }),
  142. /***/ 11:
  143. /***/ (function(module, exports, __webpack_require__) {
  144. "use strict";
  145. var _interopRequireDefault = __webpack_require__(1);
  146. exports.__esModule = true;
  147. exports.default = void 0;
  148. var _vue = _interopRequireDefault(__webpack_require__(4));
  149. var _deepAssign = __webpack_require__(21);
  150. var _zhCN = _interopRequireDefault(__webpack_require__(27));
  151. var proto = _vue.default.prototype;
  152. var defineReactive = _vue.default.util.defineReactive;
  153. defineReactive(proto, '$vantLang', 'zh-CN');
  154. defineReactive(proto, '$vantMessages', {
  155. 'zh-CN': _zhCN.default
  156. });
  157. var _default = {
  158. messages: function messages() {
  159. return proto.$vantMessages[proto.$vantLang];
  160. },
  161. use: function use(lang, messages) {
  162. var _this$add;
  163. proto.$vantLang = lang;
  164. this.add((_this$add = {}, _this$add[lang] = messages, _this$add));
  165. },
  166. add: function add(messages) {
  167. if (messages === void 0) {
  168. messages = {};
  169. }
  170. (0, _deepAssign.deepAssign)(proto.$vantMessages, messages);
  171. }
  172. };
  173. exports.default = _default;
  174. /***/ }),
  175. /***/ 12:
  176. /***/ (function(module, exports) {
  177. /**
  178. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  179. * embed the css on the page. This breaks all relative urls because now they are relative to a
  180. * bundle instead of the current page.
  181. *
  182. * One solution is to only use full urls, but that may be impossible.
  183. *
  184. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  185. *
  186. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  187. *
  188. */
  189. module.exports = function (css) {
  190. // get current location
  191. var location = typeof window !== "undefined" && window.location;
  192. if (!location) {
  193. throw new Error("fixUrls requires window.location");
  194. }
  195. // blank or null?
  196. if (!css || typeof css !== "string") {
  197. return css;
  198. }
  199. var baseUrl = location.protocol + "//" + location.host;
  200. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  201. // convert each url(...)
  202. /*
  203. This regular expression is just a way to recursively match brackets within
  204. a string.
  205. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  206. ( = Start a capturing group
  207. (?: = Start a non-capturing group
  208. [^)(] = Match anything that isn't a parentheses
  209. | = OR
  210. \( = Match a start parentheses
  211. (?: = Start another non-capturing groups
  212. [^)(]+ = Match anything that isn't a parentheses
  213. | = OR
  214. \( = Match a start parentheses
  215. [^)(]* = Match anything that isn't a parentheses
  216. \) = Match a end parentheses
  217. ) = End Group
  218. *\) = Match anything and then a close parens
  219. ) = Close non-capturing group
  220. * = Match anything
  221. ) = Close capturing group
  222. \) = Match a close parens
  223. /gi = Get all matches, not the first. Be case insensitive.
  224. */
  225. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  226. // strip quotes (if they exist)
  227. var unquotedOrigUrl = origUrl
  228. .trim()
  229. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  230. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  231. // already a full url? no change
  232. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  233. return fullMatch;
  234. }
  235. // convert the url to a full url
  236. var newUrl;
  237. if (unquotedOrigUrl.indexOf("//") === 0) {
  238. //TODO: should we add protocol?
  239. newUrl = unquotedOrigUrl;
  240. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  241. // path should be relative to the base url
  242. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  243. } else {
  244. // path should be relative to current directory
  245. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  246. }
  247. // send back the fixed url(...)
  248. return "url(" + JSON.stringify(newUrl) + ")";
  249. });
  250. // send back the fixed css
  251. return fixedCss;
  252. };
  253. /***/ }),
  254. /***/ 125:
  255. /***/ (function(module, exports, __webpack_require__) {
  256. "use strict";
  257. exports.__esModule = true;
  258. exports.deepClone = deepClone;
  259. var _deepAssign = __webpack_require__(21);
  260. function deepClone(obj) {
  261. if (Array.isArray(obj)) {
  262. return obj.map(function (item) {
  263. return deepClone(item);
  264. });
  265. }
  266. if (typeof obj === 'object') {
  267. return (0, _deepAssign.deepAssign)({}, obj);
  268. }
  269. return obj;
  270. }
  271. /***/ }),
  272. /***/ 14:
  273. /***/ (function(module, exports, __webpack_require__) {
  274. "use strict";
  275. var _interopRequireDefault = __webpack_require__(1);
  276. exports.__esModule = true;
  277. exports.inherit = inherit;
  278. exports.emit = emit;
  279. exports.mount = mount;
  280. var _extends2 = _interopRequireDefault(__webpack_require__(18));
  281. var _vue = _interopRequireDefault(__webpack_require__(4));
  282. var inheritKey = ['ref', 'style', 'class', 'attrs', 'refInFor', 'nativeOn', 'directives', 'staticClass', 'staticStyle'];
  283. var mapInheritKey = {
  284. nativeOn: 'on'
  285. }; // inherit partial context, map nativeOn to on
  286. function inherit(context, inheritListeners) {
  287. var result = inheritKey.reduce(function (obj, key) {
  288. if (context.data[key]) {
  289. obj[mapInheritKey[key] || key] = context.data[key];
  290. }
  291. return obj;
  292. }, {});
  293. if (inheritListeners) {
  294. result.on = result.on || {};
  295. (0, _extends2.default)(result.on, context.data.on);
  296. }
  297. return result;
  298. } // emit event
  299. function emit(context, eventName) {
  300. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  301. args[_key - 2] = arguments[_key];
  302. }
  303. var listeners = context.listeners[eventName];
  304. if (listeners) {
  305. if (Array.isArray(listeners)) {
  306. listeners.forEach(function (listener) {
  307. listener.apply(void 0, args);
  308. });
  309. } else {
  310. listeners.apply(void 0, args);
  311. }
  312. }
  313. } // mount functional component
  314. function mount(Component, data) {
  315. var instance = new _vue.default({
  316. el: document.createElement('div'),
  317. props: Component.props,
  318. render: function render(h) {
  319. return h(Component, (0, _extends2.default)({
  320. props: this.$props
  321. }, data));
  322. }
  323. });
  324. document.body.appendChild(instance.$el);
  325. return instance;
  326. }
  327. /***/ }),
  328. /***/ 141:
  329. /***/ (function(module, exports, __webpack_require__) {
  330. "use strict";
  331. var _interopRequireDefault = __webpack_require__(1);
  332. exports.__esModule = true;
  333. exports.default = void 0;
  334. var _extends2 = _interopRequireDefault(__webpack_require__(18));
  335. var _utils = __webpack_require__(0);
  336. var _event = __webpack_require__(30);
  337. var _constant = __webpack_require__(63);
  338. var _shared = __webpack_require__(147);
  339. var _unit = __webpack_require__(20);
  340. var _loading = _interopRequireDefault(__webpack_require__(71));
  341. var _PickerColumn = _interopRequireDefault(__webpack_require__(180));
  342. // Utils
  343. // Components
  344. var _createNamespace = (0, _utils.createNamespace)('picker'),
  345. createComponent = _createNamespace[0],
  346. bem = _createNamespace[1],
  347. t = _createNamespace[2];
  348. var _default2 = createComponent({
  349. props: (0, _extends2.default)({}, _shared.pickerProps, {
  350. defaultIndex: {
  351. type: [Number, String],
  352. default: 0
  353. },
  354. columns: {
  355. type: Array,
  356. default: function _default() {
  357. return [];
  358. }
  359. },
  360. toolbarPosition: {
  361. type: String,
  362. default: 'top'
  363. },
  364. valueKey: {
  365. type: String,
  366. default: 'text'
  367. }
  368. }),
  369. data: function data() {
  370. return {
  371. children: [],
  372. formattedColumns: []
  373. };
  374. },
  375. computed: {
  376. itemPxHeight: function itemPxHeight() {
  377. return this.itemHeight ? (0, _unit.unitToPx)(this.itemHeight) : _shared.DEFAULT_ITEM_HEIGHT;
  378. },
  379. dataType: function dataType() {
  380. var columns = this.columns;
  381. var firstColumn = columns[0] || {};
  382. if (firstColumn.children) {
  383. return 'cascade';
  384. }
  385. if (firstColumn.values) {
  386. return 'object';
  387. }
  388. return 'text';
  389. }
  390. },
  391. watch: {
  392. columns: {
  393. handler: 'format',
  394. immediate: true
  395. }
  396. },
  397. methods: {
  398. format: function format() {
  399. var columns = this.columns,
  400. dataType = this.dataType;
  401. if (dataType === 'text') {
  402. this.formattedColumns = [{
  403. values: columns
  404. }];
  405. } else if (dataType === 'cascade') {
  406. this.formatCascade();
  407. } else {
  408. this.formattedColumns = columns;
  409. }
  410. },
  411. formatCascade: function formatCascade() {
  412. var formatted = [];
  413. var cursor = {
  414. children: this.columns
  415. };
  416. while (cursor && cursor.children) {
  417. var _cursor$defaultIndex;
  418. var _cursor = cursor,
  419. children = _cursor.children;
  420. var defaultIndex = (_cursor$defaultIndex = cursor.defaultIndex) != null ? _cursor$defaultIndex : +this.defaultIndex;
  421. while (children[defaultIndex] && children[defaultIndex].disabled) {
  422. if (defaultIndex < children.length - 1) {
  423. defaultIndex++;
  424. } else {
  425. defaultIndex = 0;
  426. break;
  427. }
  428. }
  429. formatted.push({
  430. values: cursor.children,
  431. className: cursor.className,
  432. defaultIndex: defaultIndex
  433. });
  434. cursor = children[defaultIndex];
  435. }
  436. this.formattedColumns = formatted;
  437. },
  438. emit: function emit(event) {
  439. var _this = this;
  440. if (this.dataType === 'text') {
  441. this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));
  442. } else {
  443. var values = this.getValues(); // compatible with old version of wrong parameters
  444. // should be removed in next major version
  445. // see: https://github.com/youzan/vant/issues/5905
  446. if (this.dataType === 'cascade') {
  447. values = values.map(function (item) {
  448. return item[_this.valueKey];
  449. });
  450. }
  451. this.$emit(event, values, this.getIndexes());
  452. }
  453. },
  454. onCascadeChange: function onCascadeChange(columnIndex) {
  455. var cursor = {
  456. children: this.columns
  457. };
  458. var indexes = this.getIndexes();
  459. for (var i = 0; i <= columnIndex; i++) {
  460. cursor = cursor.children[indexes[i]];
  461. }
  462. while (cursor && cursor.children) {
  463. columnIndex++;
  464. this.setColumnValues(columnIndex, cursor.children);
  465. cursor = cursor.children[cursor.defaultIndex || 0];
  466. }
  467. },
  468. onChange: function onChange(columnIndex) {
  469. var _this2 = this;
  470. if (this.dataType === 'cascade') {
  471. this.onCascadeChange(columnIndex);
  472. }
  473. if (this.dataType === 'text') {
  474. this.$emit('change', this, this.getColumnValue(0), this.getColumnIndex(0));
  475. } else {
  476. var values = this.getValues(); // compatible with old version of wrong parameters
  477. // should be removed in next major version
  478. // see: https://github.com/youzan/vant/issues/5905
  479. if (this.dataType === 'cascade') {
  480. values = values.map(function (item) {
  481. return item[_this2.valueKey];
  482. });
  483. }
  484. this.$emit('change', this, values, columnIndex);
  485. }
  486. },
  487. // get column instance by index
  488. getColumn: function getColumn(index) {
  489. return this.children[index];
  490. },
  491. // @exposed-api
  492. // get column value by index
  493. getColumnValue: function getColumnValue(index) {
  494. var column = this.getColumn(index);
  495. return column && column.getValue();
  496. },
  497. // @exposed-api
  498. // set column value by index
  499. setColumnValue: function setColumnValue(index, value) {
  500. var column = this.getColumn(index);
  501. if (column) {
  502. column.setValue(value);
  503. if (this.dataType === 'cascade') {
  504. this.onCascadeChange(index);
  505. }
  506. }
  507. },
  508. // @exposed-api
  509. // get column option index by column index
  510. getColumnIndex: function getColumnIndex(columnIndex) {
  511. return (this.getColumn(columnIndex) || {}).currentIndex;
  512. },
  513. // @exposed-api
  514. // set column option index by column index
  515. setColumnIndex: function setColumnIndex(columnIndex, optionIndex) {
  516. var column = this.getColumn(columnIndex);
  517. if (column) {
  518. column.setIndex(optionIndex);
  519. if (this.dataType === 'cascade') {
  520. this.onCascadeChange(columnIndex);
  521. }
  522. }
  523. },
  524. // @exposed-api
  525. // get options of column by index
  526. getColumnValues: function getColumnValues(index) {
  527. return (this.children[index] || {}).options;
  528. },
  529. // @exposed-api
  530. // set options of column by index
  531. setColumnValues: function setColumnValues(index, options) {
  532. var column = this.children[index];
  533. if (column) {
  534. column.setOptions(options);
  535. }
  536. },
  537. // @exposed-api
  538. // get values of all columns
  539. getValues: function getValues() {
  540. return this.children.map(function (child) {
  541. return child.getValue();
  542. });
  543. },
  544. // @exposed-api
  545. // set values of all columns
  546. setValues: function setValues(values) {
  547. var _this3 = this;
  548. values.forEach(function (value, index) {
  549. _this3.setColumnValue(index, value);
  550. });
  551. },
  552. // @exposed-api
  553. // get indexes of all columns
  554. getIndexes: function getIndexes() {
  555. return this.children.map(function (child) {
  556. return child.currentIndex;
  557. });
  558. },
  559. // @exposed-api
  560. // set indexes of all columns
  561. setIndexes: function setIndexes(indexes) {
  562. var _this4 = this;
  563. indexes.forEach(function (optionIndex, columnIndex) {
  564. _this4.setColumnIndex(columnIndex, optionIndex);
  565. });
  566. },
  567. // @exposed-api
  568. confirm: function confirm() {
  569. this.children.forEach(function (child) {
  570. return child.stopMomentum();
  571. });
  572. this.emit('confirm');
  573. },
  574. cancel: function cancel() {
  575. this.emit('cancel');
  576. },
  577. genTitle: function genTitle() {
  578. var h = this.$createElement;
  579. var titleSlot = this.slots('title');
  580. if (titleSlot) {
  581. return titleSlot;
  582. }
  583. if (this.title) {
  584. return h("div", {
  585. "class": ['van-ellipsis', bem('title')]
  586. }, [this.title]);
  587. }
  588. },
  589. genCancel: function genCancel() {
  590. var h = this.$createElement;
  591. return h("button", {
  592. "attrs": {
  593. "type": "button"
  594. },
  595. "class": bem('cancel'),
  596. "on": {
  597. "click": this.cancel
  598. }
  599. }, [this.slots('cancel') || this.cancelButtonText || t('cancel')]);
  600. },
  601. genConfirm: function genConfirm() {
  602. var h = this.$createElement;
  603. return h("button", {
  604. "attrs": {
  605. "type": "button"
  606. },
  607. "class": bem('confirm'),
  608. "on": {
  609. "click": this.confirm
  610. }
  611. }, [this.slots('confirm') || this.confirmButtonText || t('confirm')]);
  612. },
  613. genToolbar: function genToolbar() {
  614. var h = this.$createElement;
  615. if (this.showToolbar) {
  616. return h("div", {
  617. "class": bem('toolbar')
  618. }, [this.slots() || [this.genCancel(), this.genTitle(), this.genConfirm()]]);
  619. }
  620. },
  621. genColumns: function genColumns() {
  622. var h = this.$createElement;
  623. var itemPxHeight = this.itemPxHeight;
  624. var wrapHeight = itemPxHeight * this.visibleItemCount;
  625. var frameStyle = {
  626. height: itemPxHeight + "px"
  627. };
  628. var columnsStyle = {
  629. height: wrapHeight + "px"
  630. };
  631. var maskStyle = {
  632. backgroundSize: "100% " + (wrapHeight - itemPxHeight) / 2 + "px"
  633. };
  634. return h("div", {
  635. "class": bem('columns'),
  636. "style": columnsStyle,
  637. "on": {
  638. "touchmove": _event.preventDefault
  639. }
  640. }, [this.genColumnItems(), h("div", {
  641. "class": bem('mask'),
  642. "style": maskStyle
  643. }), h("div", {
  644. "class": [_constant.BORDER_UNSET_TOP_BOTTOM, bem('frame')],
  645. "style": frameStyle
  646. })]);
  647. },
  648. genColumnItems: function genColumnItems() {
  649. var _this5 = this;
  650. var h = this.$createElement;
  651. return this.formattedColumns.map(function (item, columnIndex) {
  652. var _item$defaultIndex;
  653. return h(_PickerColumn.default, {
  654. "attrs": {
  655. "readonly": _this5.readonly,
  656. "valueKey": _this5.valueKey,
  657. "allowHtml": _this5.allowHtml,
  658. "className": item.className,
  659. "itemHeight": _this5.itemPxHeight,
  660. "defaultIndex": (_item$defaultIndex = item.defaultIndex) != null ? _item$defaultIndex : +_this5.defaultIndex,
  661. "swipeDuration": _this5.swipeDuration,
  662. "visibleItemCount": _this5.visibleItemCount,
  663. "initialOptions": item.values
  664. },
  665. "scopedSlots": {
  666. option: _this5.$scopedSlots.option
  667. },
  668. "on": {
  669. "change": function change() {
  670. _this5.onChange(columnIndex);
  671. }
  672. }
  673. });
  674. });
  675. }
  676. },
  677. render: function render(h) {
  678. return h("div", {
  679. "class": bem()
  680. }, [this.toolbarPosition === 'top' ? this.genToolbar() : h(), this.loading ? h(_loading.default, {
  681. "class": bem('loading')
  682. }) : h(), this.slots('columns-top'), this.genColumns(), this.slots('columns-bottom'), this.toolbarPosition === 'bottom' ? this.genToolbar() : h()]);
  683. }
  684. });
  685. exports.default = _default2;
  686. /***/ }),
  687. /***/ 146:
  688. /***/ (function(module, exports, __webpack_require__) {
  689. "use strict";
  690. exports.__esModule = true;
  691. exports.times = times;
  692. exports.getTrueValue = getTrueValue;
  693. exports.getMonthEndDay = getMonthEndDay;
  694. var _number = __webpack_require__(19);
  695. function times(n, iteratee) {
  696. var index = -1;
  697. var result = Array(n);
  698. while (++index < n) {
  699. result[index] = iteratee(index);
  700. }
  701. return result;
  702. }
  703. function getTrueValue(value) {
  704. if (!value) {
  705. return 0;
  706. }
  707. while ((0, _number.isNaN)(parseInt(value, 10))) {
  708. if (value.length > 1) {
  709. value = value.slice(1);
  710. } else {
  711. return 0;
  712. }
  713. }
  714. return parseInt(value, 10);
  715. }
  716. function getMonthEndDay(year, month) {
  717. return 32 - new Date(year, month - 1, 32).getDate();
  718. }
  719. /***/ }),
  720. /***/ 147:
  721. /***/ (function(module, exports, __webpack_require__) {
  722. "use strict";
  723. exports.__esModule = true;
  724. exports.pickerProps = exports.DEFAULT_ITEM_HEIGHT = void 0;
  725. var DEFAULT_ITEM_HEIGHT = 44;
  726. exports.DEFAULT_ITEM_HEIGHT = DEFAULT_ITEM_HEIGHT;
  727. var pickerProps = {
  728. title: String,
  729. loading: Boolean,
  730. readonly: Boolean,
  731. itemHeight: [Number, String],
  732. showToolbar: Boolean,
  733. cancelButtonText: String,
  734. confirmButtonText: String,
  735. allowHtml: {
  736. type: Boolean,
  737. default: true
  738. },
  739. visibleItemCount: {
  740. type: [Number, String],
  741. default: 6
  742. },
  743. swipeDuration: {
  744. type: [Number, String],
  745. default: 1000
  746. }
  747. };
  748. exports.pickerProps = pickerProps;
  749. /***/ }),
  750. /***/ 16:
  751. /***/ (function(module, exports, __webpack_require__) {
  752. "use strict";
  753. function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(a){return a.reduce(function(c,a){for(var b in a)if(!c[b])c[b]=a[b];else if(-1!==normalMerge.indexOf(b))c[b]=_extends({},c[b],a[b]);else if(-1!==toArrayMerge.indexOf(b)){var d=c[b]instanceof Array?c[b]:[c[b]],e=a[b]instanceof Array?a[b]:[a[b]];c[b]=d.concat(e)}else if(-1!==functionalMerge.indexOf(b)){for(var f in a[b])if(c[b][f]){var g=c[b][f]instanceof Array?c[b][f]:[c[b][f]],h=a[b][f]instanceof Array?a[b][f]:[a[b][f]];c[b][f]=g.concat(h)}else c[b][f]=a[b][f];}else if("hook"==b)for(var i in a[b])c[b][i]=c[b][i]?mergeFn(c[b][i],a[b][i]):a[b][i];else c[b]=a[b];return c},{})},mergeFn=function(a,b){return function(){a&&a.apply(this,arguments),b&&b.apply(this,arguments)}};module.exports=mergeJsxProps;
  754. /***/ }),
  755. /***/ 168:
  756. /***/ (function(module, exports, __webpack_require__) {
  757. "use strict";
  758. exports.__esModule = true;
  759. exports.isDate = isDate;
  760. var _number = __webpack_require__(19);
  761. function isDate(val) {
  762. return Object.prototype.toString.call(val) === '[object Date]' && !(0, _number.isNaN)(val.getTime());
  763. }
  764. /***/ }),
  765. /***/ 178:
  766. /***/ (function(module, exports, __webpack_require__) {
  767. var content = __webpack_require__(179);
  768. if(typeof content === 'string') content = [[module.i, content, '']];
  769. var transform;
  770. var insertInto;
  771. var options = {"hmr":true}
  772. options.transform = transform
  773. options.insertInto = undefined;
  774. var update = __webpack_require__(6)(content, options);
  775. if(content.locals) module.exports = content.locals;
  776. if(false) {}
  777. /***/ }),
  778. /***/ 179:
  779. /***/ (function(module, exports, __webpack_require__) {
  780. exports = module.exports = __webpack_require__(5)(false);
  781. // Module
  782. exports.push([module.i, ".van-picker{position:relative;background-color:#fff;-webkit-user-select:none;user-select:none}.van-picker__toolbar{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;height:44px}.van-picker__cancel,.van-picker__confirm{height:100%;padding:0 16px;font-size:14px;background-color:transparent;border:none;cursor:pointer}.van-picker__cancel:active,.van-picker__confirm:active{opacity:.7}.van-picker__confirm{color:#576b95}.van-picker__cancel{color:#969799}.van-picker__title{max-width:50%;font-weight:500;font-size:16px;line-height:20px;text-align:center}.van-picker__columns{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;cursor:grab}.van-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:#2cb8b8;background-color:rgba(255,255,255,.9)}.van-picker__frame{position:absolute;top:50%;right:16px;left:16px;z-index:2;-webkit-transform:translateY(-50%);transform:translateY(-50%);pointer-events:none}.van-picker__mask{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;background-image:-webkit-linear-gradient(top,hsla(0,0%,100%,.9),hsla(0,0%,100%,.4)),-webkit-linear-gradient(bottom,hsla(0,0%,100%,.9),hsla(0,0%,100%,.4));background-image:linear-gradient(180deg,hsla(0,0%,100%,.9),hsla(0,0%,100%,.4)),linear-gradient(0deg,hsla(0,0%,100%,.9),hsla(0,0%,100%,.4));background-repeat:no-repeat;background-position:top,bottom;-webkit-transform:translateZ(0);transform:translateZ(0);pointer-events:none}.van-picker-column{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:hidden;font-size:16px}.van-picker-column__wrapper{-webkit-transition-timing-function:cubic-bezier(.23,1,.68,1);transition-timing-function:cubic-bezier(.23,1,.68,1)}.van-picker-column__item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;padding:0 4px;color:#000}.van-picker-column__item--disabled{cursor:not-allowed;opacity:.3}", ""]);
  783. /***/ }),
  784. /***/ 18:
  785. /***/ (function(module, exports) {
  786. function _extends() {
  787. module.exports = _extends = Object.assign || function (target) {
  788. for (var i = 1; i < arguments.length; i++) {
  789. var source = arguments[i];
  790. for (var key in source) {
  791. if (Object.prototype.hasOwnProperty.call(source, key)) {
  792. target[key] = source[key];
  793. }
  794. }
  795. }
  796. return target;
  797. };
  798. return _extends.apply(this, arguments);
  799. }
  800. module.exports = _extends;
  801. /***/ }),
  802. /***/ 180:
  803. /***/ (function(module, exports, __webpack_require__) {
  804. "use strict";
  805. var _interopRequireDefault = __webpack_require__(1);
  806. exports.__esModule = true;
  807. exports.default = void 0;
  808. var _babelHelperVueJsxMergeProps = _interopRequireDefault(__webpack_require__(16));
  809. var _deepClone = __webpack_require__(125);
  810. var _utils = __webpack_require__(0);
  811. var _number = __webpack_require__(81);
  812. var _event = __webpack_require__(30);
  813. var _touch = __webpack_require__(51);
  814. var DEFAULT_DURATION = 200; // 惯性滑动思路:
  815. // 在手指离开屏幕时,如果和上一次 move 时的间隔小于 `MOMENTUM_LIMIT_TIME` 且 move
  816. // 距离大于 `MOMENTUM_LIMIT_DISTANCE` 时,执行惯性滑动
  817. var MOMENTUM_LIMIT_TIME = 300;
  818. var MOMENTUM_LIMIT_DISTANCE = 15;
  819. var _createNamespace = (0, _utils.createNamespace)('picker-column'),
  820. createComponent = _createNamespace[0],
  821. bem = _createNamespace[1];
  822. function getElementTranslateY(element) {
  823. var style = window.getComputedStyle(element);
  824. var transform = style.transform || style.webkitTransform;
  825. var translateY = transform.slice(7, transform.length - 1).split(', ')[5];
  826. return Number(translateY);
  827. }
  828. function isOptionDisabled(option) {
  829. return (0, _utils.isObject)(option) && option.disabled;
  830. }
  831. var _default2 = createComponent({
  832. mixins: [_touch.TouchMixin],
  833. props: {
  834. valueKey: String,
  835. readonly: Boolean,
  836. allowHtml: Boolean,
  837. className: String,
  838. itemHeight: Number,
  839. defaultIndex: Number,
  840. swipeDuration: [Number, String],
  841. visibleItemCount: [Number, String],
  842. initialOptions: {
  843. type: Array,
  844. default: function _default() {
  845. return [];
  846. }
  847. }
  848. },
  849. data: function data() {
  850. return {
  851. offset: 0,
  852. duration: 0,
  853. options: (0, _deepClone.deepClone)(this.initialOptions),
  854. currentIndex: this.defaultIndex
  855. };
  856. },
  857. created: function created() {
  858. if (this.$parent.children) {
  859. this.$parent.children.push(this);
  860. }
  861. this.setIndex(this.currentIndex);
  862. },
  863. mounted: function mounted() {
  864. this.bindTouchEvent(this.$el);
  865. },
  866. destroyed: function destroyed() {
  867. var children = this.$parent.children;
  868. if (children) {
  869. children.splice(children.indexOf(this), 1);
  870. }
  871. },
  872. watch: {
  873. initialOptions: 'setOptions',
  874. defaultIndex: function defaultIndex(val) {
  875. this.setIndex(val);
  876. }
  877. },
  878. computed: {
  879. count: function count() {
  880. return this.options.length;
  881. },
  882. baseOffset: function baseOffset() {
  883. return this.itemHeight * (this.visibleItemCount - 1) / 2;
  884. }
  885. },
  886. methods: {
  887. setOptions: function setOptions(options) {
  888. if (JSON.stringify(options) !== JSON.stringify(this.options)) {
  889. this.options = (0, _deepClone.deepClone)(options);
  890. this.setIndex(this.defaultIndex);
  891. }
  892. },
  893. onTouchStart: function onTouchStart(event) {
  894. if (this.readonly) {
  895. return;
  896. }
  897. this.touchStart(event);
  898. if (this.moving) {
  899. var translateY = getElementTranslateY(this.$refs.wrapper);
  900. this.offset = Math.min(0, translateY - this.baseOffset);
  901. this.startOffset = this.offset;
  902. } else {
  903. this.startOffset = this.offset;
  904. }
  905. this.duration = 0;
  906. this.transitionEndTrigger = null;
  907. this.touchStartTime = Date.now();
  908. this.momentumOffset = this.startOffset;
  909. },
  910. onTouchMove: function onTouchMove(event) {
  911. if (this.readonly) {
  912. return;
  913. }
  914. this.touchMove(event);
  915. if (this.direction === 'vertical') {
  916. this.moving = true;
  917. (0, _event.preventDefault)(event, true);
  918. }
  919. this.offset = (0, _number.range)(this.startOffset + this.deltaY, -(this.count * this.itemHeight), this.itemHeight);
  920. var now = Date.now();
  921. if (now - this.touchStartTime > MOMENTUM_LIMIT_TIME) {
  922. this.touchStartTime = now;
  923. this.momentumOffset = this.offset;
  924. }
  925. },
  926. onTouchEnd: function onTouchEnd() {
  927. var _this = this;
  928. if (this.readonly) {
  929. return;
  930. }
  931. var distance = this.offset - this.momentumOffset;
  932. var duration = Date.now() - this.touchStartTime;
  933. var allowMomentum = duration < MOMENTUM_LIMIT_TIME && Math.abs(distance) > MOMENTUM_LIMIT_DISTANCE;
  934. if (allowMomentum) {
  935. this.momentum(distance, duration);
  936. return;
  937. }
  938. var index = this.getIndexByOffset(this.offset);
  939. this.duration = DEFAULT_DURATION;
  940. this.setIndex(index, true); // compatible with desktop scenario
  941. // use setTimeout to skip the click event Emitted after touchstart
  942. setTimeout(function () {
  943. _this.moving = false;
  944. }, 0);
  945. },
  946. onTransitionEnd: function onTransitionEnd() {
  947. this.stopMomentum();
  948. },
  949. onClickItem: function onClickItem(index) {
  950. if (this.moving || this.readonly) {
  951. return;
  952. }
  953. this.transitionEndTrigger = null;
  954. this.duration = DEFAULT_DURATION;
  955. this.setIndex(index, true);
  956. },
  957. adjustIndex: function adjustIndex(index) {
  958. index = (0, _number.range)(index, 0, this.count);
  959. for (var i = index; i < this.count; i++) {
  960. if (!isOptionDisabled(this.options[i])) return i;
  961. }
  962. for (var _i = index - 1; _i >= 0; _i--) {
  963. if (!isOptionDisabled(this.options[_i])) return _i;
  964. }
  965. },
  966. getOptionText: function getOptionText(option) {
  967. if ((0, _utils.isObject)(option) && this.valueKey in option) {
  968. return option[this.valueKey];
  969. }
  970. return option;
  971. },
  972. setIndex: function setIndex(index, emitChange) {
  973. var _this2 = this;
  974. index = this.adjustIndex(index) || 0;
  975. var offset = -index * this.itemHeight;
  976. var trigger = function trigger() {
  977. if (index !== _this2.currentIndex) {
  978. _this2.currentIndex = index;
  979. if (emitChange) {
  980. _this2.$emit('change', index);
  981. }
  982. }
  983. }; // trigger the change event after transitionend when moving
  984. if (this.moving && offset !== this.offset) {
  985. this.transitionEndTrigger = trigger;
  986. } else {
  987. trigger();
  988. }
  989. this.offset = offset;
  990. },
  991. setValue: function setValue(value) {
  992. var options = this.options;
  993. for (var i = 0; i < options.length; i++) {
  994. if (this.getOptionText(options[i]) === value) {
  995. return this.setIndex(i);
  996. }
  997. }
  998. },
  999. getValue: function getValue() {
  1000. return this.options[this.currentIndex];
  1001. },
  1002. getIndexByOffset: function getIndexByOffset(offset) {
  1003. return (0, _number.range)(Math.round(-offset / this.itemHeight), 0, this.count - 1);
  1004. },
  1005. momentum: function momentum(distance, duration) {
  1006. var speed = Math.abs(distance / duration);
  1007. distance = this.offset + speed / 0.003 * (distance < 0 ? -1 : 1);
  1008. var index = this.getIndexByOffset(distance);
  1009. this.duration = +this.swipeDuration;
  1010. this.setIndex(index, true);
  1011. },
  1012. stopMomentum: function stopMomentum() {
  1013. this.moving = false;
  1014. this.duration = 0;
  1015. if (this.transitionEndTrigger) {
  1016. this.transitionEndTrigger();
  1017. this.transitionEndTrigger = null;
  1018. }
  1019. },
  1020. genOptions: function genOptions() {
  1021. var _this3 = this;
  1022. var h = this.$createElement;
  1023. var optionStyle = {
  1024. height: this.itemHeight + "px"
  1025. };
  1026. return this.options.map(function (option, index) {
  1027. var _domProps;
  1028. var text = _this3.getOptionText(option);
  1029. var disabled = isOptionDisabled(option);
  1030. var data = {
  1031. style: optionStyle,
  1032. attrs: {
  1033. role: 'button',
  1034. tabindex: disabled ? -1 : 0
  1035. },
  1036. class: [bem('item', {
  1037. disabled: disabled,
  1038. selected: index === _this3.currentIndex
  1039. })],
  1040. on: {
  1041. click: function click() {
  1042. _this3.onClickItem(index);
  1043. }
  1044. }
  1045. };
  1046. var childData = {
  1047. class: 'van-ellipsis',
  1048. domProps: (_domProps = {}, _domProps[_this3.allowHtml ? 'innerHTML' : 'textContent'] = text, _domProps)
  1049. };
  1050. return h("li", (0, _babelHelperVueJsxMergeProps.default)([{}, data]), [_this3.slots('option', option) || h("div", (0, _babelHelperVueJsxMergeProps.default)([{}, childData]))]);
  1051. });
  1052. }
  1053. },
  1054. render: function render() {
  1055. var h = arguments[0];
  1056. var wrapperStyle = {
  1057. transform: "translate3d(0, " + (this.offset + this.baseOffset) + "px, 0)",
  1058. transitionDuration: this.duration + "ms",
  1059. transitionProperty: this.duration ? 'all' : 'none'
  1060. };
  1061. return h("div", {
  1062. "class": [bem(), this.className]
  1063. }, [h("ul", {
  1064. "ref": "wrapper",
  1065. "style": wrapperStyle,
  1066. "class": bem('wrapper'),
  1067. "on": {
  1068. "transitionend": this.onTransitionEnd
  1069. }
  1070. }, [this.genOptions()])]);
  1071. }
  1072. });
  1073. exports.default = _default2;
  1074. /***/ }),
  1075. /***/ 19:
  1076. /***/ (function(module, exports, __webpack_require__) {
  1077. "use strict";
  1078. exports.__esModule = true;
  1079. exports.isNumeric = isNumeric;
  1080. exports.isNaN = isNaN;
  1081. function isNumeric(val) {
  1082. return /^\d+(\.\d+)?$/.test(val);
  1083. }
  1084. function isNaN(val) {
  1085. if (Number.isNaN) {
  1086. return Number.isNaN(val);
  1087. } // eslint-disable-next-line no-self-compare
  1088. return val !== val;
  1089. }
  1090. /***/ }),
  1091. /***/ 198:
  1092. /***/ (function(module, exports, __webpack_require__) {
  1093. "use strict";
  1094. var _interopRequireDefault = __webpack_require__(1);
  1095. exports.__esModule = true;
  1096. exports.default = void 0;
  1097. var _extends2 = _interopRequireDefault(__webpack_require__(18));
  1098. var _utils = __webpack_require__(0);
  1099. var _TimePicker = _interopRequireDefault(__webpack_require__(299));
  1100. var _DatePicker = _interopRequireDefault(__webpack_require__(300));
  1101. var _createNamespace = (0, _utils.createNamespace)('datetime-picker'),
  1102. createComponent = _createNamespace[0],
  1103. bem = _createNamespace[1];
  1104. var _default = createComponent({
  1105. props: (0, _extends2.default)({}, _TimePicker.default.props, _DatePicker.default.props),
  1106. methods: {
  1107. // @exposed-api
  1108. getPicker: function getPicker() {
  1109. return this.$refs.root.getPicker();
  1110. }
  1111. },
  1112. render: function render() {
  1113. var h = arguments[0];
  1114. var Component = this.type === 'time' ? _TimePicker.default : _DatePicker.default;
  1115. return h(Component, {
  1116. "ref": "root",
  1117. "class": bem(),
  1118. "scopedSlots": this.$scopedSlots,
  1119. "props": (0, _extends2.default)({}, this.$props),
  1120. "on": (0, _extends2.default)({}, this.$listeners)
  1121. });
  1122. }
  1123. });
  1124. exports.default = _default;
  1125. /***/ }),
  1126. /***/ 20:
  1127. /***/ (function(module, exports, __webpack_require__) {
  1128. "use strict";
  1129. exports.__esModule = true;
  1130. exports.addUnit = addUnit;
  1131. exports.unitToPx = unitToPx;
  1132. var _ = __webpack_require__(0);
  1133. var _number = __webpack_require__(19);
  1134. function addUnit(value) {
  1135. if (!(0, _.isDef)(value)) {
  1136. return undefined;
  1137. }
  1138. value = String(value);
  1139. return (0, _number.isNumeric)(value) ? value + "px" : value;
  1140. } // cache
  1141. var rootFontSize;
  1142. function getRootFontSize() {
  1143. if (!rootFontSize) {
  1144. var doc = document.documentElement;
  1145. var fontSize = doc.style.fontSize || window.getComputedStyle(doc).fontSize;
  1146. rootFontSize = parseFloat(fontSize);
  1147. }
  1148. return rootFontSize;
  1149. }
  1150. function convertRem(value) {
  1151. value = value.replace(/rem/g, '');
  1152. return +value * getRootFontSize();
  1153. }
  1154. function convertVw(value) {
  1155. value = value.replace(/vw/g, '');
  1156. return +value * window.innerWidth / 100;
  1157. }
  1158. function convertVh(value) {
  1159. value = value.replace(/vh/g, '');
  1160. return +value * window.innerHeight / 100;
  1161. }
  1162. function unitToPx(value) {
  1163. if (typeof value === 'number') {
  1164. return value;
  1165. }
  1166. if (_.inBrowser) {
  1167. if (value.indexOf('rem') !== -1) {
  1168. return convertRem(value);
  1169. }
  1170. if (value.indexOf('vw') !== -1) {
  1171. return convertVw(value);
  1172. }
  1173. if (value.indexOf('vh') !== -1) {
  1174. return convertVh(value);
  1175. }
  1176. }
  1177. return parseFloat(value);
  1178. }
  1179. /***/ }),
  1180. /***/ 21:
  1181. /***/ (function(module, exports, __webpack_require__) {
  1182. "use strict";
  1183. exports.__esModule = true;
  1184. exports.deepAssign = deepAssign;
  1185. var _ = __webpack_require__(0);
  1186. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1187. function assignKey(to, from, key) {
  1188. var val = from[key];
  1189. if (!(0, _.isDef)(val)) {
  1190. return;
  1191. }
  1192. if (!hasOwnProperty.call(to, key) || !(0, _.isObject)(val)) {
  1193. to[key] = val;
  1194. } else {
  1195. // eslint-disable-next-line @typescript-eslint/no-use-before-define
  1196. to[key] = deepAssign(Object(to[key]), from[key]);
  1197. }
  1198. }
  1199. function deepAssign(to, from) {
  1200. Object.keys(from).forEach(function (key) {
  1201. assignKey(to, from, key);
  1202. });
  1203. return to;
  1204. }
  1205. /***/ }),
  1206. /***/ 22:
  1207. /***/ (function(module, exports, __webpack_require__) {
  1208. var content = __webpack_require__(23);
  1209. if(typeof content === 'string') content = [[module.i, content, '']];
  1210. var transform;
  1211. var insertInto;
  1212. var options = {"hmr":true}
  1213. options.transform = transform
  1214. options.insertInto = undefined;
  1215. var update = __webpack_require__(6)(content, options);
  1216. if(content.locals) module.exports = content.locals;
  1217. if(false) {}
  1218. /***/ }),
  1219. /***/ 23:
  1220. /***/ (function(module, exports, __webpack_require__) {
  1221. exports = module.exports = __webpack_require__(5)(false);
  1222. // Module
  1223. exports.push([module.i, "html{-webkit-tap-highlight-color:transparent}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Helvetica Neue',Helvetica,Segoe UI,Arial,Roboto,'PingFang SC',miui,'Hiragino Sans GB','Microsoft Yahei',sans-serif}a{text-decoration:none}button,input,textarea{color:inherit;font:inherit}[class*=van-]:focus,a:focus,button:focus,input:focus,textarea:focus{outline:0}ol,ul{margin:0;padding:0;list-style:none}.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:3;-webkit-box-orient:vertical}.van-clearfix::after{display:table;clear:both;content:''}[class*=van-hairline]::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after,.van-hairline-unset--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-up-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-up-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-up-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-up-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-down-enter{from{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes van-slide-down-enter{from{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@-webkit-keyframes van-slide-down-leave{to{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes van-slide-down-leave{to{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@-webkit-keyframes van-slide-left-enter{from{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes van-slide-left-enter{from{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@-webkit-keyframes van-slide-left-leave{to{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes van-slide-left-leave{to{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@-webkit-keyframes van-slide-right-enter{from{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes van-slide-right-enter{from{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@-webkit-keyframes van-slide-right-leave{to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes van-slide-right-leave{to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in both ease-out;animation:.3s van-fade-in both ease-out}.van-fade-leave-active{-webkit-animation:.3s van-fade-out both ease-in;animation:.3s van-fade-out both ease-in
  1224. /***/ }),
  1225. /***/ 24:
  1226. /***/ (function(module, exports, __webpack_require__) {
  1227. "use strict";
  1228. exports.__esModule = true;
  1229. exports.createNamespace = createNamespace;
  1230. var _bem = __webpack_require__(25);
  1231. var _component = __webpack_require__(26);
  1232. var _i18n = __webpack_require__(29);
  1233. function createNamespace(name) {
  1234. name = 'van-' + name;
  1235. return [(0, _component.createComponent)(name), (0, _bem.createBEM)(name), (0, _i18n.createI18N)(name)];
  1236. }
  1237. /***/ }),
  1238. /***/ 244:
  1239. /***/ (function(module, exports, __webpack_require__) {
  1240. "use strict";
  1241. var _interopRequireDefault = __webpack_require__(1);
  1242. exports.__esModule = true;
  1243. exports.TimePickerMixin = exports.sharedProps = void 0;
  1244. var _extends2 = _interopRequireDefault(__webpack_require__(18));
  1245. var _utils = __webpack_require__(146);
  1246. var _string = __webpack_require__(9);
  1247. var _shared = __webpack_require__(147);
  1248. var _picker = _interopRequireDefault(__webpack_require__(141));
  1249. var sharedProps = (0, _extends2.default)({}, _shared.pickerProps, {
  1250. value: null,
  1251. filter: Function,
  1252. columnsOrder: Array,
  1253. showToolbar: {
  1254. type: Boolean,
  1255. default: true
  1256. },
  1257. formatter: {
  1258. type: Function,
  1259. default: function _default(type, value) {
  1260. return value;
  1261. }
  1262. }
  1263. });
  1264. exports.sharedProps = sharedProps;
  1265. var TimePickerMixin = {
  1266. data: function data() {
  1267. return {
  1268. innerValue: this.formatValue(this.value)
  1269. };
  1270. },
  1271. computed: {
  1272. originColumns: function originColumns() {
  1273. var _this = this;
  1274. return this.ranges.map(function (_ref) {
  1275. var type = _ref.type,
  1276. rangeArr = _ref.range;
  1277. var values = (0, _utils.times)(rangeArr[1] - rangeArr[0] + 1, function (index) {
  1278. var value = (0, _string.padZero)(rangeArr[0] + index);
  1279. return value;
  1280. });
  1281. if (_this.filter) {
  1282. values = _this.filter(type, values);
  1283. }
  1284. return {
  1285. type: type,
  1286. values: values
  1287. };
  1288. });
  1289. },
  1290. columns: function columns() {
  1291. var _this2 = this;
  1292. return this.originColumns.map(function (column) {
  1293. return {
  1294. values: column.values.map(function (value) {
  1295. return _this2.formatter(column.type, value);
  1296. })
  1297. };
  1298. });
  1299. }
  1300. },
  1301. watch: {
  1302. columns: 'updateColumnValue',
  1303. innerValue: function innerValue(val) {
  1304. this.$emit('input', val);
  1305. }
  1306. },
  1307. mounted: function mounted() {
  1308. var _this3 = this;
  1309. this.updateColumnValue();
  1310. this.$nextTick(function () {
  1311. _this3.updateInnerValue();
  1312. });
  1313. },
  1314. methods: {
  1315. // @exposed-api
  1316. getPicker: function getPicker() {
  1317. return this.$refs.picker;
  1318. },
  1319. onConfirm: function onConfirm() {
  1320. this.$emit('confirm', this.innerValue);
  1321. },
  1322. onCancel: function onCancel() {
  1323. this.$emit('cancel');
  1324. }
  1325. },
  1326. render: function render() {
  1327. var _this4 = this;
  1328. var h = arguments[0];
  1329. var props = {};
  1330. Object.keys(_shared.pickerProps).forEach(function (key) {
  1331. props[key] = _this4[key];
  1332. });
  1333. return h(_picker.default, {
  1334. "ref": "picker",
  1335. "attrs": {
  1336. "columns": this.columns,
  1337. "readonly": this.readonly
  1338. },
  1339. "scopedSlots": this.$scopedSlots,
  1340. "on": {
  1341. "change": this.onChange,
  1342. "confirm": this.onConfirm,
  1343. "cancel": this.onCancel
  1344. },
  1345. "props": (0, _extends2.default)({}, props)
  1346. });
  1347. }
  1348. };
  1349. exports.TimePickerMixin = TimePickerMixin;
  1350. /***/ }),
  1351. /***/ 25:
  1352. /***/ (function(module, exports, __webpack_require__) {
  1353. "use strict";
  1354. exports.__esModule = true;
  1355. exports.createBEM = createBEM;
  1356. /**
  1357. * bem helper
  1358. * b() // 'button'
  1359. * b('text') // 'button__text'
  1360. * b({ disabled }) // 'button button--disabled'
  1361. * b('text', { disabled }) // 'button__text button__text--disabled'
  1362. * b(['disabled', 'primary']) // 'button button--disabled button--primary'
  1363. */
  1364. function gen(name, mods) {
  1365. if (!mods) {
  1366. return '';
  1367. }
  1368. if (typeof mods === 'string') {
  1369. return " " + name + "--" + mods;
  1370. }
  1371. if (Array.isArray(mods)) {
  1372. return mods.reduce(function (ret, item) {
  1373. return ret + gen(name, item);
  1374. }, '');
  1375. }
  1376. return Object.keys(mods).reduce(function (ret, key) {
  1377. return ret + (mods[key] ? gen(name, key) : '');
  1378. }, '');
  1379. }
  1380. function createBEM(name) {
  1381. return function (el, mods) {
  1382. if (el && typeof el !== 'string') {
  1383. mods = el;
  1384. el = '';
  1385. }
  1386. el = el ? name + "__" + el : name;
  1387. return "" + el + gen(el, mods);
  1388. };
  1389. }
  1390. /***/ }),
  1391. /***/ 26:
  1392. /***/ (function(module, exports, __webpack_require__) {
  1393. "use strict";
  1394. var _interopRequireDefault = __webpack_require__(1);
  1395. exports.__esModule = true;
  1396. exports.unifySlots = unifySlots;
  1397. exports.createComponent = createComponent;
  1398. __webpack_require__(11);
  1399. var _ = __webpack_require__(0);
  1400. var _string = __webpack_require__(9);
  1401. var _slots = __webpack_require__(28);
  1402. var _vue = _interopRequireDefault(__webpack_require__(4));
  1403. /**
  1404. * Create a basic component with common options
  1405. */
  1406. function install(Vue) {
  1407. var name = this.name;
  1408. Vue.component(name, this);
  1409. Vue.component((0, _string.camelize)("-" + name), this);
  1410. } // unify slots & scopedSlots
  1411. function unifySlots(context) {
  1412. // use data.scopedSlots in lower Vue version
  1413. var scopedSlots = context.scopedSlots || context.data.scopedSlots || {};
  1414. var slots = context.slots();
  1415. Object.keys(slots).forEach(function (key) {
  1416. if (!scopedSlots[key]) {
  1417. scopedSlots[key] = function () {
  1418. return slots[key];
  1419. };
  1420. }
  1421. });
  1422. return scopedSlots;
  1423. } // should be removed after Vue 3
  1424. function transformFunctionComponent(pure) {
  1425. return {
  1426. functional: true,
  1427. props: pure.props,
  1428. model: pure.model,
  1429. render: function render(h, context) {
  1430. return pure(h, context.props, unifySlots(context), context);
  1431. }
  1432. };
  1433. }
  1434. function createComponent(name) {
  1435. return function (sfc) {
  1436. if ((0, _.isFunction)(sfc)) {
  1437. sfc = transformFunctionComponent(sfc);
  1438. }
  1439. if (!sfc.functional) {
  1440. sfc.mixins = sfc.mixins || [];
  1441. sfc.mixins.push(_slots.SlotsMixin);
  1442. }
  1443. sfc.name = name;
  1444. sfc.install = install;
  1445. return sfc;
  1446. };
  1447. }
  1448. /***/ }),
  1449. /***/ 27:
  1450. /***/ (function(module, exports, __webpack_require__) {
  1451. "use strict";
  1452. exports.__esModule = true;
  1453. exports.default = void 0;
  1454. var _default = {
  1455. name: '姓名',
  1456. tel: '电话',
  1457. save: '保存',
  1458. confirm: '确认',
  1459. cancel: '取消',
  1460. delete: '删除',
  1461. complete: '完成',
  1462. loading: '加载中...',
  1463. telEmpty: '请填写电话',
  1464. nameEmpty: '请填写姓名',
  1465. nameInvalid: '请输入正确的姓名',
  1466. confirmDelete: '确定要删除吗',
  1467. telInvalid: '请输入正确的手机号',
  1468. vanCalendar: {
  1469. end: '结束',
  1470. start: '开始',
  1471. title: '日期选择',
  1472. confirm: '确定',
  1473. startEnd: '开始/结束',
  1474. weekdays: ['日', '一', '二', '三', '四', '五', '六'],
  1475. monthTitle: function monthTitle(year, month) {
  1476. return year + "\u5E74" + month + "\u6708";
  1477. },
  1478. rangePrompt: function rangePrompt(maxRange) {
  1479. return "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 " + maxRange + " \u5929";
  1480. }
  1481. },
  1482. vanCascader: {
  1483. select: '请选择'
  1484. },
  1485. vanContactCard: {
  1486. addText: '添加联系人'
  1487. },
  1488. vanContactList: {
  1489. addText: '新建联系人'
  1490. },
  1491. vanPagination: {
  1492. prev: '上一页',
  1493. next: '下一页'
  1494. },
  1495. vanPullRefresh: {
  1496. pulling: '下拉即可刷新...',
  1497. loosing: '释放即可刷新...'
  1498. },
  1499. vanSubmitBar: {
  1500. label: '合计:'
  1501. },
  1502. vanCoupon: {
  1503. unlimited: '无使用门槛',
  1504. discount: function discount(_discount) {
  1505. return _discount + "\u6298";
  1506. },
  1507. condition: function condition(_condition) {
  1508. return "\u6EE1" + _condition + "\u5143\u53EF\u7528";
  1509. }
  1510. },
  1511. vanCouponCell: {
  1512. title: '优惠券',
  1513. tips: '暂无可用',
  1514. count: function count(_count) {
  1515. return _count + "\u5F20\u53EF\u7528";
  1516. }
  1517. },
  1518. vanCouponList: {
  1519. empty: '暂无优惠券',
  1520. exchange: '兑换',
  1521. close: '不使用优惠券',
  1522. enable: '可用',
  1523. disabled: '不可用',
  1524. placeholder: '请输入优惠码'
  1525. },
  1526. vanAddressEdit: {
  1527. area: '地区',
  1528. postal: '邮政编码',
  1529. areaEmpty: '请选择地区',
  1530. addressEmpty: '请填写详细地址',
  1531. postalEmpty: '邮政编码格式不正确',
  1532. defaultAddress: '设为默认收货地址',
  1533. telPlaceholder: '收货人手机号',
  1534. namePlaceholder: '收货人姓名',
  1535. areaPlaceholder: '选择省 / 市 / 区'
  1536. },
  1537. vanAddressEditDetail: {
  1538. label: '详细地址',
  1539. placeholder: '街道门牌、楼层房间号等信息'
  1540. },
  1541. vanAddressList: {
  1542. add: '新增地址'
  1543. }
  1544. };
  1545. exports.default = _default;
  1546. /***/ }),
  1547. /***/ 28:
  1548. /***/ (function(module, exports, __webpack_require__) {
  1549. "use strict";
  1550. exports.__esModule = true;
  1551. exports.SlotsMixin = void 0;
  1552. /**
  1553. * Use scopedSlots in Vue 2.6+
  1554. * downgrade to slots in lower version
  1555. */
  1556. var SlotsMixin = {
  1557. methods: {
  1558. slots: function slots(name, props) {
  1559. if (name === void 0) {
  1560. name = 'default';
  1561. }
  1562. var $slots = this.$slots,
  1563. $scopedSlots = this.$scopedSlots;
  1564. var scopedSlot = $scopedSlots[name];
  1565. if (scopedSlot) {
  1566. return scopedSlot(props);
  1567. }
  1568. return $slots[name];
  1569. }
  1570. }
  1571. };
  1572. exports.SlotsMixin = SlotsMixin;
  1573. /***/ }),
  1574. /***/ 29:
  1575. /***/ (function(module, exports, __webpack_require__) {
  1576. "use strict";
  1577. var _interopRequireDefault = __webpack_require__(1);
  1578. exports.__esModule = true;
  1579. exports.createI18N = createI18N;
  1580. var _ = __webpack_require__(0);
  1581. var _string = __webpack_require__(9);
  1582. var _locale = _interopRequireDefault(__webpack_require__(11));
  1583. function createI18N(name) {
  1584. var prefix = (0, _string.camelize)(name) + '.';
  1585. return function (path) {
  1586. var messages = _locale.default.messages();
  1587. var message = (0, _.get)(messages, prefix + path) || (0, _.get)(messages, path);
  1588. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1589. args[_key - 1] = arguments[_key];
  1590. }
  1591. return (0, _.isFunction)(message) ? message.apply(void 0, args) : message;
  1592. };
  1593. }
  1594. /***/ }),
  1595. /***/ 297:
  1596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1597. "use strict";
  1598. __webpack_require__.r(__webpack_exports__);
  1599. /* harmony import */ var _tisdesign_m_lib_datetime_picker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(198);
  1600. /* harmony import */ var _tisdesign_m_lib_datetime_picker__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tisdesign_m_lib_datetime_picker__WEBPACK_IMPORTED_MODULE_0__);
  1601. /* harmony import */ var _tisdesign_m_lib_datetime_picker_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(298);
  1602. /* harmony import */ var _tisdesign_m_lib_datetime_picker_style__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tisdesign_m_lib_datetime_picker_style__WEBPACK_IMPORTED_MODULE_1__);
  1603. _tisdesign_m_lib_datetime_picker__WEBPACK_IMPORTED_MODULE_0___default.a.name = 'm-datetime-picker';
  1604. /* harmony default export */ __webpack_exports__["default"] = (_tisdesign_m_lib_datetime_picker__WEBPACK_IMPORTED_MODULE_0___default.a);
  1605. /***/ }),
  1606. /***/ 298:
  1607. /***/ (function(module, exports, __webpack_require__) {
  1608. __webpack_require__(22);
  1609. __webpack_require__(73);
  1610. __webpack_require__(178);
  1611. /***/ }),
  1612. /***/ 299:
  1613. /***/ (function(module, exports, __webpack_require__) {
  1614. "use strict";
  1615. var _interopRequireDefault = __webpack_require__(1);
  1616. exports.__esModule = true;
  1617. exports.default = void 0;
  1618. var _extends2 = _interopRequireDefault(__webpack_require__(18));
  1619. var _utils = __webpack_require__(0);
  1620. var _string = __webpack_require__(9);
  1621. var _number = __webpack_require__(81);
  1622. var _shared = __webpack_require__(244);
  1623. var _createNamespace = (0, _utils.createNamespace)('time-picker'),
  1624. createComponent = _createNamespace[0];
  1625. var _default = createComponent({
  1626. mixins: [_shared.TimePickerMixin],
  1627. props: (0, _extends2.default)({}, _shared.sharedProps, {
  1628. minHour: {
  1629. type: [Number, String],
  1630. default: 0
  1631. },
  1632. maxHour: {
  1633. type: [Number, String],
  1634. default: 23
  1635. },
  1636. minMinute: {
  1637. type: [Number, String],
  1638. default: 0
  1639. },
  1640. maxMinute: {
  1641. type: [Number, String],
  1642. default: 59
  1643. }
  1644. }),
  1645. computed: {
  1646. ranges: function ranges() {
  1647. return [{
  1648. type: 'hour',
  1649. range: [+this.minHour, +this.maxHour]
  1650. }, {
  1651. type: 'minute',
  1652. range: [+this.minMinute, +this.maxMinute]
  1653. }];
  1654. }
  1655. },
  1656. watch: {
  1657. filter: 'updateInnerValue',
  1658. minHour: 'updateInnerValue',
  1659. maxHour: 'updateInnerValue',
  1660. minMinute: 'updateInnerValue',
  1661. maxMinute: 'updateInnerValue',
  1662. value: function value(val) {
  1663. val = this.formatValue(val);
  1664. if (val !== this.innerValue) {
  1665. this.innerValue = val;
  1666. this.updateColumnValue();
  1667. }
  1668. }
  1669. },
  1670. methods: {
  1671. formatValue: function formatValue(value) {
  1672. if (!value) {
  1673. value = (0, _string.padZero)(this.minHour) + ":" + (0, _string.padZero)(this.minMinute);
  1674. }
  1675. var _value$split = value.split(':'),
  1676. hour = _value$split[0],
  1677. minute = _value$split[1];
  1678. hour = (0, _string.padZero)((0, _number.range)(hour, this.minHour, this.maxHour));
  1679. minute = (0, _string.padZero)((0, _number.range)(minute, this.minMinute, this.maxMinute));
  1680. return hour + ":" + minute;
  1681. },
  1682. updateInnerValue: function updateInnerValue() {
  1683. var _this$getPicker$getIn = this.getPicker().getIndexes(),
  1684. hourIndex = _this$getPicker$getIn[0],
  1685. minuteIndex = _this$getPicker$getIn[1];
  1686. var _this$originColumns = this.originColumns,
  1687. hourColumn = _this$originColumns[0],
  1688. minuteColumn = _this$originColumns[1];
  1689. var hour = hourColumn.values[hourIndex] || hourColumn.values[0];
  1690. var minute = minuteColumn.values[minuteIndex] || minuteColumn.values[0];
  1691. this.innerValue = this.formatValue(hour + ":" + minute);
  1692. this.updateColumnValue();
  1693. },
  1694. onChange: function onChange(picker) {
  1695. var _this = this;
  1696. this.updateInnerValue();
  1697. this.$nextTick(function () {
  1698. _this.$nextTick(function () {
  1699. _this.$emit('change', picker);
  1700. });
  1701. });
  1702. },
  1703. updateColumnValue: function updateColumnValue() {
  1704. var _this2 = this;
  1705. var formatter = this.formatter;
  1706. var pair = this.innerValue.split(':');
  1707. var values = [formatter('hour', pair[0]), formatter('minute', pair[1])];
  1708. this.$nextTick(function () {
  1709. _this2.getPicker().setValues(values);
  1710. });
  1711. }
  1712. }
  1713. });
  1714. exports.default = _default;
  1715. /***/ }),
  1716. /***/ 30:
  1717. /***/ (function(module, exports, __webpack_require__) {
  1718. "use strict";
  1719. exports.__esModule = true;
  1720. exports.on = on;
  1721. exports.off = off;
  1722. exports.stopPropagation = stopPropagation;
  1723. exports.preventDefault = preventDefault;
  1724. exports.supportsPassive = void 0;
  1725. var _ = __webpack_require__(0);
  1726. // eslint-disable-next-line import/no-mutable-exports
  1727. var supportsPassive = false;
  1728. exports.supportsPassive = supportsPassive;
  1729. if (!_.isServer) {
  1730. try {
  1731. var opts = {};
  1732. Object.defineProperty(opts, 'passive', {
  1733. // eslint-disable-next-line getter-return
  1734. get: function get() {
  1735. /* istanbul ignore next */
  1736. exports.supportsPassive = supportsPassive = true;
  1737. }
  1738. });
  1739. window.addEventListener('test-passive', null, opts); // eslint-disable-next-line no-empty
  1740. } catch (e) {}
  1741. }
  1742. function on(target, event, handler, passive) {
  1743. if (passive === void 0) {
  1744. passive = false;
  1745. }
  1746. if (!_.isServer) {
  1747. target.addEventListener(event, handler, supportsPassive ? {
  1748. capture: false,
  1749. passive: passive
  1750. } : false);
  1751. }
  1752. }
  1753. function off(target, event, handler) {
  1754. if (!_.isServer) {
  1755. target.removeEventListener(event, handler);
  1756. }
  1757. }
  1758. function stopPropagation(event) {
  1759. event.stopPropagation();
  1760. }
  1761. function preventDefault(event, isStopPropagation) {
  1762. /* istanbul ignore else */
  1763. if (typeof event.cancelable !== 'boolean' || event.cancelable) {
  1764. event.preventDefault();
  1765. }
  1766. if (isStopPropagation) {
  1767. stopPropagation(event);
  1768. }
  1769. }
  1770. /***/ }),
  1771. /***/ 300:
  1772. /***/ (function(module, exports, __webpack_require__) {
  1773. "use strict";
  1774. var _interopRequireDefault = __webpack_require__(1);
  1775. exports.__esModule = true;
  1776. exports.default = void 0;
  1777. var _extends2 = _interopRequireDefault(__webpack_require__(18));
  1778. var _utils = __webpack_require__(0);
  1779. var _date = __webpack_require__(168);
  1780. var _string = __webpack_require__(9);
  1781. var _utils2 = __webpack_require__(146);
  1782. var _shared = __webpack_require__(244);
  1783. var currentYear = new Date().getFullYear();
  1784. var _createNamespace = (0, _utils.createNamespace)('date-picker'),
  1785. createComponent = _createNamespace[0];
  1786. var _default2 = createComponent({
  1787. mixins: [_shared.TimePickerMixin],
  1788. props: (0, _extends2.default)({}, _shared.sharedProps, {
  1789. type: {
  1790. type: String,
  1791. default: 'datetime'
  1792. },
  1793. minDate: {
  1794. type: Date,
  1795. default: function _default() {
  1796. return new Date(currentYear - 10, 0, 1);
  1797. },
  1798. validator: _date.isDate
  1799. },
  1800. maxDate: {
  1801. type: Date,
  1802. default: function _default() {
  1803. return new Date(currentYear + 10, 11, 31);
  1804. },
  1805. validator: _date.isDate
  1806. }
  1807. }),
  1808. watch: {
  1809. filter: 'updateInnerValue',
  1810. minDate: 'updateInnerValue',
  1811. maxDate: 'updateInnerValue',
  1812. value: function value(val) {
  1813. val = this.formatValue(val);
  1814. if (val.valueOf() !== this.innerValue.valueOf()) {
  1815. this.innerValue = val;
  1816. }
  1817. }
  1818. },
  1819. computed: {
  1820. ranges: function ranges() {
  1821. var _this$getBoundary = this.getBoundary('max', this.innerValue),
  1822. maxYear = _this$getBoundary.maxYear,
  1823. maxDate = _this$getBoundary.maxDate,
  1824. maxMonth = _this$getBoundary.maxMonth,
  1825. maxHour = _this$getBoundary.maxHour,
  1826. maxMinute = _this$getBoundary.maxMinute;
  1827. var _this$getBoundary2 = this.getBoundary('min', this.innerValue),
  1828. minYear = _this$getBoundary2.minYear,
  1829. minDate = _this$getBoundary2.minDate,
  1830. minMonth = _this$getBoundary2.minMonth,
  1831. minHour = _this$getBoundary2.minHour,
  1832. minMinute = _this$getBoundary2.minMinute;
  1833. var result = [{
  1834. type: 'year',
  1835. range: [minYear, maxYear]
  1836. }, {
  1837. type: 'month',
  1838. range: [minMonth, maxMonth]
  1839. }, {
  1840. type: 'day',
  1841. range: [minDate, maxDate]
  1842. }, {
  1843. type: 'hour',
  1844. range: [minHour, maxHour]
  1845. }, {
  1846. type: 'minute',
  1847. range: [minMinute, maxMinute]
  1848. }];
  1849. switch (this.type) {
  1850. case 'date':
  1851. result = result.slice(0, 3);
  1852. break;
  1853. case 'year-month':
  1854. result = result.slice(0, 2);
  1855. break;
  1856. case 'month-day':
  1857. result = result.slice(1, 3);
  1858. break;
  1859. case 'datehour':
  1860. result = result.slice(0, 4);
  1861. break;
  1862. }
  1863. if (this.columnsOrder) {
  1864. var columnsOrder = this.columnsOrder.concat(result.map(function (column) {
  1865. return column.type;
  1866. }));
  1867. result.sort(function (a, b) {
  1868. return columnsOrder.indexOf(a.type) - columnsOrder.indexOf(b.type);
  1869. });
  1870. }
  1871. return result;
  1872. }
  1873. },
  1874. methods: {
  1875. formatValue: function formatValue(value) {
  1876. if (!(0, _date.isDate)(value)) {
  1877. value = this.minDate;
  1878. }
  1879. value = Math.max(value, this.minDate.getTime());
  1880. value = Math.min(value, this.maxDate.getTime());
  1881. return new Date(value);
  1882. },
  1883. getBoundary: function getBoundary(type, value) {
  1884. var _ref;
  1885. var boundary = this[type + "Date"];
  1886. var year = boundary.getFullYear();
  1887. var month = 1;
  1888. var date = 1;
  1889. var hour = 0;
  1890. var minute = 0;
  1891. if (type === 'max') {
  1892. month = 12;
  1893. date = (0, _utils2.getMonthEndDay)(value.getFullYear(), value.getMonth() + 1);
  1894. hour = 23;
  1895. minute = 59;
  1896. }
  1897. if (value.getFullYear() === year) {
  1898. month = boundary.getMonth() + 1;
  1899. if (value.getMonth() + 1 === month) {
  1900. date = boundary.getDate();
  1901. if (value.getDate() === date) {
  1902. hour = boundary.getHours();
  1903. if (value.getHours() === hour) {
  1904. minute = boundary.getMinutes();
  1905. }
  1906. }
  1907. }
  1908. }
  1909. return _ref = {}, _ref[type + "Year"] = year, _ref[type + "Month"] = month, _ref[type + "Date"] = date, _ref[type + "Hour"] = hour, _ref[type + "Minute"] = minute, _ref;
  1910. },
  1911. updateInnerValue: function updateInnerValue() {
  1912. var _this = this;
  1913. var type = this.type;
  1914. var indexes = this.getPicker().getIndexes();
  1915. var getValue = function getValue(type) {
  1916. var index = 0;
  1917. _this.originColumns.forEach(function (column, columnIndex) {
  1918. if (type === column.type) {
  1919. index = columnIndex;
  1920. }
  1921. });
  1922. var values = _this.originColumns[index].values;
  1923. return (0, _utils2.getTrueValue)(values[indexes[index]]);
  1924. };
  1925. var year;
  1926. var month;
  1927. var day;
  1928. if (type === 'month-day') {
  1929. year = this.innerValue.getFullYear();
  1930. month = getValue('month');
  1931. day = getValue('day');
  1932. } else {
  1933. year = getValue('year');
  1934. month = getValue('month');
  1935. day = type === 'year-month' ? 1 : getValue('day');
  1936. }
  1937. var maxDay = (0, _utils2.getMonthEndDay)(year, month);
  1938. day = day > maxDay ? maxDay : day;
  1939. var hour = 0;
  1940. var minute = 0;
  1941. if (type === 'datehour') {
  1942. hour = getValue('hour');
  1943. }
  1944. if (type === 'datetime') {
  1945. hour = getValue('hour');
  1946. minute = getValue('minute');
  1947. }
  1948. var value = new Date(year, month - 1, day, hour, minute);
  1949. this.innerValue = this.formatValue(value);
  1950. },
  1951. onChange: function onChange(picker) {
  1952. var _this2 = this;
  1953. this.updateInnerValue();
  1954. this.$nextTick(function () {
  1955. _this2.$nextTick(function () {
  1956. _this2.$emit('change', picker);
  1957. });
  1958. });
  1959. },
  1960. updateColumnValue: function updateColumnValue() {
  1961. var _this3 = this;
  1962. var value = this.innerValue;
  1963. var formatter = this.formatter;
  1964. var values = this.originColumns.map(function (column) {
  1965. switch (column.type) {
  1966. case 'year':
  1967. return formatter('year', "" + value.getFullYear());
  1968. case 'month':
  1969. return formatter('month', (0, _string.padZero)(value.getMonth() + 1));
  1970. case 'day':
  1971. return formatter('day', (0, _string.padZero)(value.getDate()));
  1972. case 'hour':
  1973. return formatter('hour', (0, _string.padZero)(value.getHours()));
  1974. case 'minute':
  1975. return formatter('minute', (0, _string.padZero)(value.getMinutes()));
  1976. default:
  1977. // no default
  1978. return null;
  1979. }
  1980. });
  1981. this.$nextTick(function () {
  1982. _this3.getPicker().setValues(values);
  1983. });
  1984. }
  1985. }
  1986. });
  1987. exports.default = _default2;
  1988. /***/ }),
  1989. /***/ 4:
  1990. /***/ (function(module, exports) {
  1991. module.exports = require("vue");
  1992. /***/ }),
  1993. /***/ 5:
  1994. /***/ (function(module, exports, __webpack_require__) {
  1995. "use strict";
  1996. /*
  1997. MIT License http://www.opensource.org/licenses/mit-license.php
  1998. Author Tobias Koppers @sokra
  1999. */
  2000. // css base code, injected by the css-loader
  2001. module.exports = function (useSourceMap) {
  2002. var list = []; // return the list of modules as css string
  2003. list.toString = function toString() {
  2004. return this.map(function (item) {
  2005. var content = cssWithMappingToString(item, useSourceMap);
  2006. if (item[2]) {
  2007. return '@media ' + item[2] + '{' + content + '}';
  2008. } else {
  2009. return content;
  2010. }
  2011. }).join('');
  2012. }; // import a list of modules into the list
  2013. list.i = function (modules, mediaQuery) {
  2014. if (typeof modules === 'string') {
  2015. modules = [[null, modules, '']];
  2016. }
  2017. var alreadyImportedModules = {};
  2018. for (var i = 0; i < this.length; i++) {
  2019. var id = this[i][0];
  2020. if (id != null) {
  2021. alreadyImportedModules[id] = true;
  2022. }
  2023. }
  2024. for (i = 0; i < modules.length; i++) {
  2025. var item = modules[i]; // skip already imported module
  2026. // this implementation is not 100% perfect for weird media query combinations
  2027. // when a module is imported multiple times with different media queries.
  2028. // I hope this will never occur (Hey this way we have smaller bundles)
  2029. if (item[0] == null || !alreadyImportedModules[item[0]]) {
  2030. if (mediaQuery && !item[2]) {
  2031. item[2] = mediaQuery;
  2032. } else if (mediaQuery) {
  2033. item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
  2034. }
  2035. list.push(item);
  2036. }
  2037. }
  2038. };
  2039. return list;
  2040. };
  2041. function cssWithMappingToString(item, useSourceMap) {
  2042. var content = item[1] || '';
  2043. var cssMapping = item[3];
  2044. if (!cssMapping) {
  2045. return content;
  2046. }
  2047. if (useSourceMap && typeof btoa === 'function') {
  2048. var sourceMapping = toComment(cssMapping);
  2049. var sourceURLs = cssMapping.sources.map(function (source) {
  2050. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
  2051. });
  2052. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  2053. }
  2054. return [content].join('\n');
  2055. } // Adapted from convert-source-map (MIT)
  2056. function toComment(sourceMap) {
  2057. // eslint-disable-next-line no-undef
  2058. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  2059. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  2060. return '/*# ' + data + ' */';
  2061. }
  2062. /***/ }),
  2063. /***/ 51:
  2064. /***/ (function(module, exports, __webpack_require__) {
  2065. "use strict";
  2066. exports.__esModule = true;
  2067. exports.TouchMixin = void 0;
  2068. var _event = __webpack_require__(30);
  2069. var MIN_DISTANCE = 10;
  2070. function getDirection(x, y) {
  2071. if (x > y && x > MIN_DISTANCE) {
  2072. return 'horizontal';
  2073. }
  2074. if (y > x && y > MIN_DISTANCE) {
  2075. return 'vertical';
  2076. }
  2077. return '';
  2078. }
  2079. var TouchMixin = {
  2080. data: function data() {
  2081. return {
  2082. direction: ''
  2083. };
  2084. },
  2085. methods: {
  2086. touchStart: function touchStart(event) {
  2087. this.resetTouchStatus();
  2088. this.startX = event.touches[0].clientX;
  2089. this.startY = event.touches[0].clientY;
  2090. },
  2091. touchMove: function touchMove(event) {
  2092. var touch = event.touches[0];
  2093. this.deltaX = touch.clientX - this.startX;
  2094. this.deltaY = touch.clientY - this.startY;
  2095. this.offsetX = Math.abs(this.deltaX);
  2096. this.offsetY = Math.abs(this.deltaY);
  2097. this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
  2098. },
  2099. resetTouchStatus: function resetTouchStatus() {
  2100. this.direction = '';
  2101. this.deltaX = 0;
  2102. this.deltaY = 0;
  2103. this.offsetX = 0;
  2104. this.offsetY = 0;
  2105. },
  2106. // avoid Vue 2.6 event bubble issues by manually binding events
  2107. // https://github.com/youzan/vant/issues/3015
  2108. bindTouchEvent: function bindTouchEvent(el) {
  2109. var onTouchStart = this.onTouchStart,
  2110. onTouchMove = this.onTouchMove,
  2111. onTouchEnd = this.onTouchEnd;
  2112. (0, _event.on)(el, 'touchstart', onTouchStart);
  2113. (0, _event.on)(el, 'touchmove', onTouchMove);
  2114. if (onTouchEnd) {
  2115. (0, _event.on)(el, 'touchend', onTouchEnd);
  2116. (0, _event.on)(el, 'touchcancel', onTouchEnd);
  2117. }
  2118. }
  2119. }
  2120. };
  2121. exports.TouchMixin = TouchMixin;
  2122. /***/ }),
  2123. /***/ 6:
  2124. /***/ (function(module, exports, __webpack_require__) {
  2125. /*
  2126. MIT License http://www.opensource.org/licenses/mit-license.php
  2127. Author Tobias Koppers @sokra
  2128. */
  2129. var stylesInDom = {};
  2130. var memoize = function (fn) {
  2131. var memo;
  2132. return function () {
  2133. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  2134. return memo;
  2135. };
  2136. };
  2137. var isOldIE = memoize(function () {
  2138. // Test for IE <= 9 as proposed by Browserhacks
  2139. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  2140. // Tests for existence of standard globals is to allow style-loader
  2141. // to operate correctly into non-standard environments
  2142. // @see https://github.com/webpack-contrib/style-loader/issues/177
  2143. return window && document && document.all && !window.atob;
  2144. });
  2145. var getTarget = function (target, parent) {
  2146. if (parent){
  2147. return parent.querySelector(target);
  2148. }
  2149. return document.querySelector(target);
  2150. };
  2151. var getElement = (function (fn) {
  2152. var memo = {};
  2153. return function(target, parent) {
  2154. // If passing function in options, then use it for resolve "head" element.
  2155. // Useful for Shadow Root style i.e
  2156. // {
  2157. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  2158. // }
  2159. if (typeof target === 'function') {
  2160. return target();
  2161. }
  2162. if (typeof memo[target] === "undefined") {
  2163. var styleTarget = getTarget.call(this, target, parent);
  2164. // Special case to return head of iframe instead of iframe itself
  2165. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  2166. try {
  2167. // This will throw an exception if access to iframe is blocked
  2168. // due to cross-origin restrictions
  2169. styleTarget = styleTarget.contentDocument.head;
  2170. } catch(e) {
  2171. styleTarget = null;
  2172. }
  2173. }
  2174. memo[target] = styleTarget;
  2175. }
  2176. return memo[target]
  2177. };
  2178. })();
  2179. var singleton = null;
  2180. var singletonCounter = 0;
  2181. var stylesInsertedAtTop = [];
  2182. var fixUrls = __webpack_require__(12);
  2183. module.exports = function(list, options) {
  2184. if (typeof DEBUG !== "undefined" && DEBUG) {
  2185. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  2186. }
  2187. options = options || {};
  2188. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  2189. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  2190. // tags it will allow on a page
  2191. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  2192. // By default, add <style> tags to the <head> element
  2193. if (!options.insertInto) options.insertInto = "head";
  2194. // By default, add <style> tags to the bottom of the target
  2195. if (!options.insertAt) options.insertAt = "bottom";
  2196. var styles = listToStyles(list, options);
  2197. addStylesToDom(styles, options);
  2198. return function update (newList) {
  2199. var mayRemove = [];
  2200. for (var i = 0; i < styles.length; i++) {
  2201. var item = styles[i];
  2202. var domStyle = stylesInDom[item.id];
  2203. domStyle.refs--;
  2204. mayRemove.push(domStyle);
  2205. }
  2206. if(newList) {
  2207. var newStyles = listToStyles(newList, options);
  2208. addStylesToDom(newStyles, options);
  2209. }
  2210. for (var i = 0; i < mayRemove.length; i++) {
  2211. var domStyle = mayRemove[i];
  2212. if(domStyle.refs === 0) {
  2213. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  2214. delete stylesInDom[domStyle.id];
  2215. }
  2216. }
  2217. };
  2218. };
  2219. function addStylesToDom (styles, options) {
  2220. for (var i = 0; i < styles.length; i++) {
  2221. var item = styles[i];
  2222. var domStyle = stylesInDom[item.id];
  2223. if(domStyle) {
  2224. domStyle.refs++;
  2225. for(var j = 0; j < domStyle.parts.length; j++) {
  2226. domStyle.parts[j](item.parts[j]);
  2227. }
  2228. for(; j < item.parts.length; j++) {
  2229. domStyle.parts.push(addStyle(item.parts[j], options));
  2230. }
  2231. } else {
  2232. var parts = [];
  2233. for(var j = 0; j < item.parts.length; j++) {
  2234. parts.push(addStyle(item.parts[j], options));
  2235. }
  2236. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  2237. }
  2238. }
  2239. }
  2240. function listToStyles (list, options) {
  2241. var styles = [];
  2242. var newStyles = {};
  2243. for (var i = 0; i < list.length; i++) {
  2244. var item = list[i];
  2245. var id = options.base ? item[0] + options.base : item[0];
  2246. var css = item[1];
  2247. var media = item[2];
  2248. var sourceMap = item[3];
  2249. var part = {css: css, media: media, sourceMap: sourceMap};
  2250. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  2251. else newStyles[id].parts.push(part);
  2252. }
  2253. return styles;
  2254. }
  2255. function insertStyleElement (options, style) {
  2256. var target = getElement(options.insertInto)
  2257. if (!target) {
  2258. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  2259. }
  2260. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  2261. if (options.insertAt === "top") {
  2262. if (!lastStyleElementInsertedAtTop) {
  2263. target.insertBefore(style, target.firstChild);
  2264. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  2265. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  2266. } else {
  2267. target.appendChild(style);
  2268. }
  2269. stylesInsertedAtTop.push(style);
  2270. } else if (options.insertAt === "bottom") {
  2271. target.appendChild(style);
  2272. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  2273. var nextSibling = getElement(options.insertAt.before, target);
  2274. target.insertBefore(style, nextSibling);
  2275. } else {
  2276. throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
  2277. }
  2278. }
  2279. function removeStyleElement (style) {
  2280. if (style.parentNode === null) return false;
  2281. style.parentNode.removeChild(style);
  2282. var idx = stylesInsertedAtTop.indexOf(style);
  2283. if(idx >= 0) {
  2284. stylesInsertedAtTop.splice(idx, 1);
  2285. }
  2286. }
  2287. function createStyleElement (options) {
  2288. var style = document.createElement("style");
  2289. if(options.attrs.type === undefined) {
  2290. options.attrs.type = "text/css";
  2291. }
  2292. if(options.attrs.nonce === undefined) {
  2293. var nonce = getNonce();
  2294. if (nonce) {
  2295. options.attrs.nonce = nonce;
  2296. }
  2297. }
  2298. addAttrs(style, options.attrs);
  2299. insertStyleElement(options, style);
  2300. return style;
  2301. }
  2302. function createLinkElement (options) {
  2303. var link = document.createElement("link");
  2304. if(options.attrs.type === undefined) {
  2305. options.attrs.type = "text/css";
  2306. }
  2307. options.attrs.rel = "stylesheet";
  2308. addAttrs(link, options.attrs);
  2309. insertStyleElement(options, link);
  2310. return link;
  2311. }
  2312. function addAttrs (el, attrs) {
  2313. Object.keys(attrs).forEach(function (key) {
  2314. el.setAttribute(key, attrs[key]);
  2315. });
  2316. }
  2317. function getNonce() {
  2318. if (false) {}
  2319. return __webpack_require__.nc;
  2320. }
  2321. function addStyle (obj, options) {
  2322. var style, update, remove, result;
  2323. // If a transform function was defined, run it on the css
  2324. if (options.transform && obj.css) {
  2325. result = typeof options.transform === 'function'
  2326. ? options.transform(obj.css)
  2327. : options.transform.default(obj.css);
  2328. if (result) {
  2329. // If transform returns a value, use that instead of the original css.
  2330. // This allows running runtime transformations on the css.
  2331. obj.css = result;
  2332. } else {
  2333. // If the transform function returns a falsy value, don't add this css.
  2334. // This allows conditional loading of css
  2335. return function() {
  2336. // noop
  2337. };
  2338. }
  2339. }
  2340. if (options.singleton) {
  2341. var styleIndex = singletonCounter++;
  2342. style = singleton || (singleton = createStyleElement(options));
  2343. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  2344. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  2345. } else if (
  2346. obj.sourceMap &&
  2347. typeof URL === "function" &&
  2348. typeof URL.createObjectURL === "function" &&
  2349. typeof URL.revokeObjectURL === "function" &&
  2350. typeof Blob === "function" &&
  2351. typeof btoa === "function"
  2352. ) {
  2353. style = createLinkElement(options);
  2354. update = updateLink.bind(null, style, options);
  2355. remove = function () {
  2356. removeStyleElement(style);
  2357. if(style.href) URL.revokeObjectURL(style.href);
  2358. };
  2359. } else {
  2360. style = createStyleElement(options);
  2361. update = applyToTag.bind(null, style);
  2362. remove = function () {
  2363. removeStyleElement(style);
  2364. };
  2365. }
  2366. update(obj);
  2367. return function updateStyle (newObj) {
  2368. if (newObj) {
  2369. if (
  2370. newObj.css === obj.css &&
  2371. newObj.media === obj.media &&
  2372. newObj.sourceMap === obj.sourceMap
  2373. ) {
  2374. return;
  2375. }
  2376. update(obj = newObj);
  2377. } else {
  2378. remove();
  2379. }
  2380. };
  2381. }
  2382. var replaceText = (function () {
  2383. var textStore = [];
  2384. return function (index, replacement) {
  2385. textStore[index] = replacement;
  2386. return textStore.filter(Boolean).join('\n');
  2387. };
  2388. })();
  2389. function applyToSingletonTag (style, index, remove, obj) {
  2390. var css = remove ? "" : obj.css;
  2391. if (style.styleSheet) {
  2392. style.styleSheet.cssText = replaceText(index, css);
  2393. } else {
  2394. var cssNode = document.createTextNode(css);
  2395. var childNodes = style.childNodes;
  2396. if (childNodes[index]) style.removeChild(childNodes[index]);
  2397. if (childNodes.length) {
  2398. style.insertBefore(cssNode, childNodes[index]);
  2399. } else {
  2400. style.appendChild(cssNode);
  2401. }
  2402. }
  2403. }
  2404. function applyToTag (style, obj) {
  2405. var css = obj.css;
  2406. var media = obj.media;
  2407. if(media) {
  2408. style.setAttribute("media", media)
  2409. }
  2410. if(style.styleSheet) {
  2411. style.styleSheet.cssText = css;
  2412. } else {
  2413. while(style.firstChild) {
  2414. style.removeChild(style.firstChild);
  2415. }
  2416. style.appendChild(document.createTextNode(css));
  2417. }
  2418. }
  2419. function updateLink (link, options, obj) {
  2420. var css = obj.css;
  2421. var sourceMap = obj.sourceMap;
  2422. /*
  2423. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  2424. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  2425. on by default. Otherwise default to the convertToAbsoluteUrls option
  2426. directly
  2427. */
  2428. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  2429. if (options.convertToAbsoluteUrls || autoFixUrls) {
  2430. css = fixUrls(css);
  2431. }
  2432. if (sourceMap) {
  2433. // http://stackoverflow.com/a/26603875
  2434. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  2435. }
  2436. var blob = new Blob([css], { type: "text/css" });
  2437. var oldSrc = link.href;
  2438. link.href = URL.createObjectURL(blob);
  2439. if(oldSrc) URL.revokeObjectURL(oldSrc);
  2440. }
  2441. /***/ }),
  2442. /***/ 63:
  2443. /***/ (function(module, exports, __webpack_require__) {
  2444. "use strict";
  2445. exports.__esModule = true;
  2446. exports.BORDER_UNSET_TOP_BOTTOM = exports.BORDER_TOP_BOTTOM = exports.BORDER_SURROUND = exports.BORDER_BOTTOM = exports.BORDER_LEFT = exports.BORDER_TOP = exports.BORDER = exports.RED = void 0;
  2447. // color
  2448. var RED = '#ee0a24'; // border
  2449. exports.RED = RED;
  2450. var BORDER = 'van-hairline';
  2451. exports.BORDER = BORDER;
  2452. var BORDER_TOP = BORDER + "--top";
  2453. exports.BORDER_TOP = BORDER_TOP;
  2454. var BORDER_LEFT = BORDER + "--left";
  2455. exports.BORDER_LEFT = BORDER_LEFT;
  2456. var BORDER_BOTTOM = BORDER + "--bottom";
  2457. exports.BORDER_BOTTOM = BORDER_BOTTOM;
  2458. var BORDER_SURROUND = BORDER + "--surround";
  2459. exports.BORDER_SURROUND = BORDER_SURROUND;
  2460. var BORDER_TOP_BOTTOM = BORDER + "--top-bottom";
  2461. exports.BORDER_TOP_BOTTOM = BORDER_TOP_BOTTOM;
  2462. var BORDER_UNSET_TOP_BOTTOM = BORDER + "-unset--top-bottom";
  2463. exports.BORDER_UNSET_TOP_BOTTOM = BORDER_UNSET_TOP_BOTTOM;
  2464. /***/ }),
  2465. /***/ 71:
  2466. /***/ (function(module, exports, __webpack_require__) {
  2467. "use strict";
  2468. var _interopRequireDefault = __webpack_require__(1);
  2469. exports.__esModule = true;
  2470. exports.default = void 0;
  2471. var _babelHelperVueJsxMergeProps = _interopRequireDefault(__webpack_require__(16));
  2472. var _utils = __webpack_require__(0);
  2473. var _functional = __webpack_require__(14);
  2474. // Utils
  2475. var _createNamespace = (0, _utils.createNamespace)('loading'),
  2476. createComponent = _createNamespace[0],
  2477. bem = _createNamespace[1];
  2478. function LoadingIcon(h, props) {
  2479. if (props.type === 'spinner') {
  2480. var Spin = [];
  2481. for (var i = 0; i < 12; i++) {
  2482. Spin.push(h("i"));
  2483. }
  2484. return Spin;
  2485. }
  2486. return h("svg", {
  2487. "class": bem('circular'),
  2488. "attrs": {
  2489. "viewBox": "25 25 50 50"
  2490. }
  2491. }, [h("circle", {
  2492. "attrs": {
  2493. "cx": "50",
  2494. "cy": "50",
  2495. "r": "20",
  2496. "fill": "none"
  2497. }
  2498. })]);
  2499. }
  2500. function LoadingText(h, props, slots) {
  2501. if (slots.default) {
  2502. var _props$textColor;
  2503. var style = {
  2504. fontSize: (0, _utils.addUnit)(props.textSize),
  2505. color: (_props$textColor = props.textColor) != null ? _props$textColor : props.color
  2506. };
  2507. return h("span", {
  2508. "class": bem('text'),
  2509. "style": style
  2510. }, [slots.default()]);
  2511. }
  2512. }
  2513. function Loading(h, props, slots, ctx) {
  2514. var color = props.color,
  2515. size = props.size,
  2516. type = props.type;
  2517. var style = {
  2518. color: color
  2519. };
  2520. if (size) {
  2521. var iconSize = (0, _utils.addUnit)(size);
  2522. style.width = iconSize;
  2523. style.height = iconSize;
  2524. }
  2525. return h("div", (0, _babelHelperVueJsxMergeProps.default)([{
  2526. "class": bem([type, {
  2527. vertical: props.vertical
  2528. }])
  2529. }, (0, _functional.inherit)(ctx, true)]), [h("span", {
  2530. "class": bem('spinner', type),
  2531. "style": style
  2532. }, [LoadingIcon(h, props)]), LoadingText(h, props, slots)]);
  2533. }
  2534. Loading.props = {
  2535. color: String,
  2536. size: [Number, String],
  2537. vertical: Boolean,
  2538. textSize: [Number, String],
  2539. textColor: String,
  2540. type: {
  2541. type: String,
  2542. default: 'circular'
  2543. }
  2544. };
  2545. var _default = createComponent(Loading);
  2546. exports.default = _default;
  2547. /***/ }),
  2548. /***/ 73:
  2549. /***/ (function(module, exports, __webpack_require__) {
  2550. var content = __webpack_require__(74);
  2551. if(typeof content === 'string') content = [[module.i, content, '']];
  2552. var transform;
  2553. var insertInto;
  2554. var options = {"hmr":true}
  2555. options.transform = transform
  2556. options.insertInto = undefined;
  2557. var update = __webpack_require__(6)(content, options);
  2558. if(content.locals) module.exports = content.locals;
  2559. if(false) {}
  2560. /***/ }),
  2561. /***/ 74:
  2562. /***/ (function(module, exports, __webpack_require__) {
  2563. exports = module.exports = __webpack_require__(5)(false);
  2564. // Module
  2565. exports.push([module.i, ".van-loading{position:relative;color:#c8c9cc;font-size:0;vertical-align:middle}.van-loading__spinner{position:relative;display:inline-block;width:30px;max-width:100%;height:30px;max-height:100%;vertical-align:middle;-webkit-animation:van-rotate .8s linear infinite;animation:van-rotate .8s linear infinite}.van-loading__spinner--spinner{-webkit-animation-timing-function:steps(12);animation-timing-function:steps(12)}.van-loading__spinner--spinner i{position:absolute;top:0;left:0;width:100%;height:100%}.van-loading__spinner--spinner i::before{display:block;width:2px;height:25%;margin:0 auto;background-color:currentColor;border-radius:40%;content:' '}.van-loading__spinner--circular{-webkit-animation-duration:2s;animation-duration:2s}.van-loading__circular{display:block;width:100%;height:100%}.van-loading__circular circle{-webkit-animation:van-circular 1.5s ease-in-out infinite;animation:van-circular 1.5s ease-in-out infinite;stroke:currentColor;stroke-width:3;stroke-linecap:round}.van-loading__text{display:inline-block;margin-left:8px;color:#969799;font-size:14px;vertical-align:middle}.van-loading--vertical{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.van-loading--vertical .van-loading__text{margin:8px 0 0}@-webkit-keyframes van-circular{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}100%{stroke-dasharray:90,150;stroke-dashoffset:-120}}@keyframes van-circular{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}100%{stroke-dasharray:90,150;stroke-dashoffset:-120}}.van-loading__spinner--spinner i:nth-of-type(1){-webkit-transform:rotate(30deg);transform:rotate(30deg);opacity:1}.van-loading__spinner--spinner i:nth-of-type(2){-webkit-transform:rotate(60deg);transform:rotate(60deg);opacity:.9375}.van-loading__spinner--spinner i:nth-of-type(3){-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:.875}.van-loading__spinner--spinner i:nth-of-type(4){-webkit-transform:rotate(120deg);transform:rotate(120deg);opacity:.8125}.van-loading__spinner--spinner i:nth-of-type(5){-webkit-transform:rotate(150deg);transform:rotate(150deg);opacity:.75}.van-loading__spinner--spinner i:nth-of-type(6){-webkit-transform:rotate(180deg);transform:rotate(180deg);opacity:.6875}.van-loading__spinner--spinner i:nth-of-type(7){-webkit-transform:rotate(210deg);transform:rotate(210deg);opacity:.625}.van-loading__spinner--spinner i:nth-of-type(8){-webkit-transform:rotate(240deg);transform:rotate(240deg);opacity:.5625}.van-loading__spinner--spinner i:nth-of-type(9){-webkit-transform:rotate(270deg);transform:rotate(270deg);opacity:.5}.van-loading__spinner--spinner i:nth-of-type(10){-webkit-transform:rotate(300deg);transform:rotate(300deg);opacity:.4375}.van-loading__spinner--spinner i:nth-of-type(11){-webkit-transform:rotate(330deg);transform:rotate(330deg);opacity:.375}.van-loading__spinner--spinner i:nth-of-type(12){-webkit-transform:rotate(360deg);transform:rotate(360deg);opacity:.3125}", ""]);
  2566. /***/ }),
  2567. /***/ 81:
  2568. /***/ (function(module, exports, __webpack_require__) {
  2569. "use strict";
  2570. exports.__esModule = true;
  2571. exports.range = range;
  2572. exports.formatNumber = formatNumber;
  2573. function range(num, min, max) {
  2574. return Math.min(Math.max(num, min), max);
  2575. }
  2576. function trimExtraChar(value, _char, regExp) {
  2577. var index = value.indexOf(_char);
  2578. if (index === -1) {
  2579. return value;
  2580. }
  2581. if (_char === '-' && index !== 0) {
  2582. return value.slice(0, index);
  2583. }
  2584. return value.slice(0, index + 1) + value.slice(index).replace(regExp, '');
  2585. }
  2586. function formatNumber(value, allowDot, allowMinus) {
  2587. if (allowDot === void 0) {
  2588. allowDot = true;
  2589. }
  2590. if (allowMinus === void 0) {
  2591. allowMinus = true;
  2592. }
  2593. if (allowDot) {
  2594. value = trimExtraChar(value, '.', /\./g);
  2595. } else {
  2596. value = value.split('.')[0];
  2597. }
  2598. if (allowMinus) {
  2599. value = trimExtraChar(value, '-', /-/g);
  2600. } else {
  2601. value = value.replace(/-/, '');
  2602. }
  2603. var regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
  2604. return value.replace(regExp, '');
  2605. }
  2606. /***/ }),
  2607. /***/ 9:
  2608. /***/ (function(module, exports, __webpack_require__) {
  2609. "use strict";
  2610. exports.__esModule = true;
  2611. exports.camelize = camelize;
  2612. exports.padZero = padZero;
  2613. var camelizeRE = /-(\w)/g;
  2614. function camelize(str) {
  2615. return str.replace(camelizeRE, function (_, c) {
  2616. return c.toUpperCase();
  2617. });
  2618. }
  2619. function padZero(num, targetLength) {
  2620. if (targetLength === void 0) {
  2621. targetLength = 2;
  2622. }
  2623. var str = num + '';
  2624. while (str.length < targetLength) {
  2625. str = '0' + str;
  2626. }
  2627. return str;
  2628. }
  2629. /***/ })
  2630. /******/ });