cy-element-ui 1.0.82 → 1.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/lib/autocomplete.js +15 -15
  2. package/lib/calendar.js +120 -120
  3. package/lib/carousel-item.js +4 -4
  4. package/lib/carousel.js +2 -2
  5. package/lib/cascader-panel.js +12 -12
  6. package/lib/cascader.js +18 -18
  7. package/lib/checkbox-button.js +2 -2
  8. package/lib/checkbox-group.js +2 -2
  9. package/lib/checkbox.js +2 -2
  10. package/lib/collapse-item.js +58 -58
  11. package/lib/color-picker.js +15 -15
  12. package/lib/date-picker.js +265 -798
  13. package/lib/descriptions.js +2 -2
  14. package/lib/dialog.js +5 -5
  15. package/lib/drawer.js +2 -2
  16. package/lib/dropdown-item.js +2 -2
  17. package/lib/dropdown-menu.js +2 -2
  18. package/lib/dropdown.js +57 -57
  19. package/lib/element-ui.common.js +610 -1142
  20. package/lib/empty.js +4 -4
  21. package/lib/fileUpload.js +10 -10
  22. package/lib/form-item.js +4 -4
  23. package/lib/form.js +2 -2
  24. package/lib/image.js +12 -12
  25. package/lib/index.js +1 -1
  26. package/lib/infinite-scroll.js +2 -2
  27. package/lib/input-number.js +7 -7
  28. package/lib/input.js +6 -6
  29. package/lib/menu-item.js +52 -52
  30. package/lib/menu.js +3 -3
  31. package/lib/message-box.js +7 -7
  32. package/lib/message.js +3 -3
  33. package/lib/mixins/migrating.js +1 -1
  34. package/lib/notification.js +2 -2
  35. package/lib/option-group.js +2 -2
  36. package/lib/option.js +21 -21
  37. package/lib/page-header.js +4 -4
  38. package/lib/pagination.js +17 -17
  39. package/lib/popconfirm.js +60 -60
  40. package/lib/popover.js +58 -58
  41. package/lib/radio-button.js +2 -2
  42. package/lib/radio-group.js +2 -2
  43. package/lib/radio.js +2 -2
  44. package/lib/rate.js +6 -6
  45. package/lib/scrollbar.js +3 -3
  46. package/lib/select.js +17 -17
  47. package/lib/slider.js +17 -17
  48. package/lib/statistic.js +2 -2
  49. package/lib/steps.js +5 -5
  50. package/lib/switch.js +5 -5
  51. package/lib/tabDialog.js +7 -7
  52. package/lib/table-column.js +4 -4
  53. package/lib/table.js +17 -17
  54. package/lib/tabs.js +4 -4
  55. package/lib/time-picker.js +232 -765
  56. package/lib/time-select.js +223 -756
  57. package/lib/tooltip.js +2 -2
  58. package/lib/transfer.js +72 -72
  59. package/lib/tree.js +67 -67
  60. package/lib/treeSelect.js +62 -62
  61. package/lib/upload.js +8 -8
  62. package/package.json +1 -1
  63. package/packages/autocomplete/src/autocomplete-suggestions.vue +3 -3
  64. package/packages/autocomplete/src/autocomplete.vue +6 -6
  65. package/packages/calendar/src/date-table.vue +2 -2
  66. package/packages/calendar/src/main.vue +5 -5
  67. package/packages/carousel/src/item.vue +1 -1
  68. package/packages/carousel/src/main.vue +1 -1
  69. package/packages/cascader/src/cascader.vue +15 -15
  70. package/packages/cascader-panel/src/cascader-menu.vue +3 -3
  71. package/packages/cascader-panel/src/cascader-node.vue +3 -3
  72. package/packages/cascader-panel/src/cascader-panel.vue +4 -4
  73. package/packages/cascader-panel/src/node.js +2 -2
  74. package/packages/cascader-panel/src/store.js +1 -1
  75. package/packages/checkbox/src/checkbox-button.vue +1 -1
  76. package/packages/checkbox/src/checkbox-group.vue +1 -1
  77. package/packages/checkbox/src/checkbox.vue +1 -1
  78. package/packages/collapse/src/collapse-item.vue +3 -3
  79. package/packages/color-picker/src/components/picker-dropdown.vue +4 -4
  80. package/packages/color-picker/src/main.vue +2 -2
  81. package/packages/date-picker/src/basic/date-table.vue +3 -3
  82. package/packages/date-picker/src/basic/month-table.vue +4 -4
  83. package/packages/date-picker/src/basic/time-spinner.vue +3 -3
  84. package/packages/date-picker/src/basic/year-table.vue +3 -3
  85. package/packages/date-picker/src/panel/date-range.vue +5 -5
  86. package/packages/date-picker/src/panel/date.vue +5 -5
  87. package/packages/date-picker/src/panel/month-range.vue +5 -5
  88. package/packages/date-picker/src/panel/time-range.vue +2 -2
  89. package/packages/date-picker/src/panel/time-select.vue +2 -2
  90. package/packages/date-picker/src/panel/time.vue +2 -2
  91. package/packages/date-picker/src/picker.vue +414 -956
  92. package/packages/descriptions/src/index.js +1 -1
  93. package/packages/dialog/src/component.vue +3 -3
  94. package/packages/drawer/src/main.vue +2 -2
  95. package/packages/dropdown/src/dropdown-item.vue +1 -1
  96. package/packages/dropdown/src/dropdown-menu.vue +1 -1
  97. package/packages/dropdown/src/dropdown.vue +6 -6
  98. package/packages/empty/src/index.vue +1 -1
  99. package/packages/fileUpload/src/main.vue +3 -3
  100. package/packages/form/src/form-item.vue +3 -3
  101. package/packages/form/src/form.vue +1 -1
  102. package/packages/image/src/image-viewer.vue +3 -3
  103. package/packages/image/src/main.vue +3 -3
  104. package/packages/infinite-scroll/src/main.js +2 -2
  105. package/packages/input/src/input.vue +4 -4
  106. package/packages/input-number/src/input-number.vue +3 -3
  107. package/packages/loading/src/directive.js +3 -3
  108. package/packages/loading/src/index.js +4 -4
  109. package/packages/menu/src/menu-item.vue +2 -2
  110. package/packages/menu/src/menu.vue +4 -4
  111. package/packages/menu/src/submenu.vue +3 -3
  112. package/packages/message/src/main.js +3 -3
  113. package/packages/message-box/src/main.js +2 -2
  114. package/packages/message-box/src/main.vue +7 -7
  115. package/packages/notification/src/main.js +3 -3
  116. package/packages/page-header/src/main.vue +1 -1
  117. package/packages/pagination/src/pagination.js +5 -5
  118. package/packages/popconfirm/src/main.vue +3 -3
  119. package/packages/popover/src/main.vue +4 -4
  120. package/packages/radio/src/radio-button.vue +1 -1
  121. package/packages/radio/src/radio-group.vue +1 -1
  122. package/packages/radio/src/radio.vue +1 -1
  123. package/packages/rate/src/main.vue +3 -3
  124. package/packages/scrollbar/src/bar.js +1 -1
  125. package/packages/scrollbar/src/main.js +3 -3
  126. package/packages/select/src/option-group.vue +1 -1
  127. package/packages/select/src/option.vue +2 -2
  128. package/packages/select/src/select-dropdown.vue +1 -1
  129. package/packages/select/src/select.vue +11 -11
  130. package/packages/slider/src/button.vue +1 -1
  131. package/packages/slider/src/main.vue +2 -2
  132. package/packages/statistic/src/main.vue +1 -1
  133. package/packages/steps/src/steps.vue +1 -1
  134. package/packages/switch/src/component.vue +3 -3
  135. package/packages/tabDialog/src/main.vue +1 -1
  136. package/packages/table/src/config.js +1 -1
  137. package/packages/table/src/filter-panel.vue +7 -7
  138. package/packages/table/src/store/current.js +1 -1
  139. package/packages/table/src/store/index.js +1 -1
  140. package/packages/table/src/store/watcher.js +1 -1
  141. package/packages/table/src/table-body.js +4 -4
  142. package/packages/table/src/table-column.js +1 -1
  143. package/packages/table/src/table-header.js +2 -2
  144. package/packages/table/src/table-layout.js +1 -1
  145. package/packages/table/src/table-row.js +1 -1
  146. package/packages/table/src/table.vue +5 -5
  147. package/packages/table/src/util.js +1 -1
  148. package/packages/tabs/src/tab-bar.vue +1 -1
  149. package/packages/tabs/src/tab-nav.vue +1 -1
  150. package/packages/tooltip/src/main.js +3 -3
  151. package/packages/transfer/src/main.vue +4 -4
  152. package/packages/transfer/src/transfer-panel.vue +4 -4
  153. package/packages/tree/src/model/node.js +2 -2
  154. package/packages/tree/src/tree-node.vue +3 -3
  155. package/packages/tree/src/tree.vue +3 -3
  156. package/packages/treeSelect/src/main.vue +2 -2
  157. package/packages/upload/src/index.vue +2 -2
  158. package/packages/upload/src/upload-list.vue +2 -2
  159. package/src/directives/repeat-click.js +2 -2
  160. package/src/index.js +1 -1
  161. package/src/locale/format.js +1 -1
  162. package/src/locale/index.js +1 -1
  163. package/src/mixins/locale.js +1 -1
  164. package/src/mixins/migrating.js +2 -2
  165. package/src/transitions/collapse-transition.js +1 -1
  166. package/src/utils/clickoutside.js +1 -1
  167. package/src/utils/date-util.js +2 -2
  168. package/src/utils/popup/index.js +2 -2
  169. package/src/utils/popup/popup-manager.js +1 -1
  170. package/src/utils/util.js +1 -1
  171. package/src/utils/vdom.js +1 -1
  172. package/src/utils/vue-popper.js +1 -1
@@ -467,7 +467,7 @@ function normalizeComponent(
467
467
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isMac; });
468
468
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
469
469
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
470
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
470
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
471
471
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
472
472
 
473
473
 
@@ -728,60 +728,6 @@ var isMac = function isMac() {
728
728
  /* 4 */
729
729
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
730
730
 
731
- "use strict";
732
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
733
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
734
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
735
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
736
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
737
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
738
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
739
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
740
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
741
-
742
-
743
-
744
- function isString(obj) {
745
- return Object.prototype.toString.call(obj) === '[object String]';
746
- }
747
-
748
- function isObject(obj) {
749
- return Object.prototype.toString.call(obj) === '[object Object]';
750
- }
751
-
752
- function isHtmlElement(node) {
753
- return node && node.nodeType === Node.ELEMENT_NODE;
754
- }
755
-
756
- /**
757
- * - Inspired:
758
- * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
759
- */
760
- var isFunction = function isFunction(functionToCheck) {
761
- var getType = {};
762
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
763
- };
764
-
765
- if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
766
- isFunction = function isFunction(obj) {
767
- return typeof obj === 'function' || false;
768
- };
769
- }
770
-
771
-
772
-
773
- var isUndefined = function isUndefined(val) {
774
- return val === void 0;
775
- };
776
-
777
- var isDefined = function isDefined(val) {
778
- return val !== undefined && val !== null;
779
- };
780
-
781
- /***/ }),
782
- /* 5 */
783
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
784
-
785
731
  "use strict";
786
732
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return getI18nSettings; });
787
733
  /* unused harmony export toDate */
@@ -1120,6 +1066,60 @@ var validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
1120
1066
  return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
1121
1067
  };
1122
1068
 
1069
+ /***/ }),
1070
+ /* 5 */
1071
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1072
+
1073
+ "use strict";
1074
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
1075
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
1076
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
1077
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
1078
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
1079
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
1080
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1081
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
1082
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1083
+
1084
+
1085
+
1086
+ function isString(obj) {
1087
+ return Object.prototype.toString.call(obj) === '[object String]';
1088
+ }
1089
+
1090
+ function isObject(obj) {
1091
+ return Object.prototype.toString.call(obj) === '[object Object]';
1092
+ }
1093
+
1094
+ function isHtmlElement(node) {
1095
+ return node && node.nodeType === Node.ELEMENT_NODE;
1096
+ }
1097
+
1098
+ /**
1099
+ * - Inspired:
1100
+ * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
1101
+ */
1102
+ var isFunction = function isFunction(functionToCheck) {
1103
+ var getType = {};
1104
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
1105
+ };
1106
+
1107
+ if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
1108
+ isFunction = function isFunction(obj) {
1109
+ return typeof obj === 'function' || false;
1110
+ };
1111
+ }
1112
+
1113
+
1114
+
1115
+ var isUndefined = function isUndefined(val) {
1116
+ return val === void 0;
1117
+ };
1118
+
1119
+ var isDefined = function isDefined(val) {
1120
+ return val !== undefined && val !== null;
1121
+ };
1122
+
1123
1123
  /***/ }),
1124
1124
  /* 6 */
1125
1125
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -2110,7 +2110,7 @@ var i18n = function i18n(fn) {
2110
2110
  * Show migrating guide in browser console.
2111
2111
  *
2112
2112
  * Usage:
2113
- * import Migrating from 'element-ui/src/mixins/migrating';
2113
+ * import Migrating from 'src/mixins/migrating';
2114
2114
  *
2115
2115
  * mixins: [Migrating]
2116
2116
  *
@@ -2281,7 +2281,7 @@ function isKorean(text) {
2281
2281
  // ESM COMPAT FLAG
2282
2282
  __webpack_require__.r(__webpack_exports__);
2283
2283
 
2284
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=af7512c8
2284
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=d8ebd7ac
2285
2285
  var render = function render() {
2286
2286
  var _vm = this,
2287
2287
  _c = _vm._self._c
@@ -2493,7 +2493,7 @@ var staticRenderFns = []
2493
2493
  render._withStripped = true
2494
2494
 
2495
2495
 
2496
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=af7512c8
2496
+ // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=d8ebd7ac
2497
2497
 
2498
2498
  // EXTERNAL MODULE: ./src/mixins/emitter.js
2499
2499
  var emitter = __webpack_require__(6);
@@ -5014,7 +5014,7 @@ main.install = function (Vue) {
5014
5014
 
5015
5015
  "use strict";
5016
5016
 
5017
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time.vue?vue&type=template&id=0e9e8e4a
5017
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time.vue?vue&type=template&id=cfceabb8
5018
5018
  var render = function render() {
5019
5019
  var _vm = this,
5020
5020
  _c = _vm._self._c
@@ -5101,10 +5101,10 @@ var staticRenderFns = []
5101
5101
  render._withStripped = true
5102
5102
 
5103
5103
 
5104
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=template&id=0e9e8e4a
5104
+ // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=template&id=cfceabb8
5105
5105
 
5106
5106
  // EXTERNAL MODULE: ./src/utils/date-util.js
5107
- var date_util = __webpack_require__(5);
5107
+ var date_util = __webpack_require__(4);
5108
5108
 
5109
5109
  // EXTERNAL MODULE: ./src/mixins/locale.js
5110
5110
  var locale = __webpack_require__(13);
@@ -5305,7 +5305,7 @@ var component = Object(componentNormalizer["a" /* default */])(
5305
5305
 
5306
5306
  "use strict";
5307
5307
 
5308
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=0642cc1d
5308
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=156e5e58
5309
5309
  var render = function render() {
5310
5310
  var _vm = this,
5311
5311
  _c = _vm._self._c
@@ -5482,17 +5482,16 @@ var staticRenderFns = []
5482
5482
  render._withStripped = true
5483
5483
 
5484
5484
 
5485
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=0642cc1d
5485
+ // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=156e5e58
5486
5486
 
5487
5487
  // EXTERNAL MODULE: external "vue"
5488
5488
  var external_vue_ = __webpack_require__(0);
5489
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
5490
5489
 
5491
5490
  // EXTERNAL MODULE: ./src/utils/clickoutside.js
5492
5491
  var clickoutside = __webpack_require__(21);
5493
5492
 
5494
5493
  // EXTERNAL MODULE: ./src/utils/date-util.js
5495
- var date_util = __webpack_require__(5);
5494
+ var date_util = __webpack_require__(4);
5496
5495
 
5497
5496
  // EXTERNAL MODULE: ./src/utils/vue-popper.js
5498
5497
  var vue_popper = __webpack_require__(10);
@@ -5555,794 +5554,262 @@ var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, forma
5555
5554
  if (format === 'timestamp') return new Date(Number(text));
5556
5555
  return Object(date_util["z" /* parseDate */])(text, format);
5557
5556
  };
5558
- var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
5557
+ var pickervue_type_script_lang_js_RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
5559
5558
  if (Array.isArray(value) && value.length === 2) {
5560
5559
  var start = value[0];
5561
5560
  var end = value[1];
5562
-
5563
- if (start && end) {
5564
- return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
5561
+ if (Object(date_util["r" /* isDateObject */])(start) && Object(date_util["r" /* isDateObject */])(end)) {
5562
+ return [Object(date_util["f" /* formatDate */])(start, format), Object(date_util["f" /* formatDate */])(end, format)];
5565
5563
  }
5566
5564
  }
5567
- return '';
5565
+ return ['', ''];
5568
5566
  };
5569
- var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
5570
- if (!Array.isArray(array)) {
5571
- array = array.split(separator);
5572
- }
5573
- if (array.length === 2) {
5574
- var range1 = array[0];
5575
- var range2 = array[1];
5576
-
5577
- return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
5567
+ var pickervue_type_script_lang_js_RANGE_PARSER = function RANGE_PARSER(text, format) {
5568
+ if (Array.isArray(text) && text.length === 2) {
5569
+ return [Object(date_util["z" /* parseDate */])(text[0], format), Object(date_util["z" /* parseDate */])(text[1], format)];
5578
5570
  }
5579
5571
  return [];
5580
5572
  };
5581
- var TYPE_VALUE_RESOLVER_MAP = {
5582
- default: {
5583
- formatter: function formatter(value) {
5584
- if (!value) return '';
5585
- return '' + value;
5586
- },
5587
- parser: function parser(text) {
5588
- if (text === undefined || text === '') return null;
5589
- return text;
5590
- }
5591
- },
5592
- week: {
5593
- formatter: function formatter(value, format) {
5594
- var week = Object(date_util["p" /* getWeekNumber */])(value);
5595
- var month = value.getMonth();
5596
- var trueDate = new Date(value);
5597
- if (week === 1 && month === 11) {
5598
- trueDate.setHours(0, 0, 0, 0);
5599
- trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
5600
- }
5601
- var date = Object(date_util["f" /* formatDate */])(trueDate, format);
5602
-
5603
- date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
5604
- return date;
5605
- },
5606
- parser: function parser(text, format) {
5607
- // parse as if a normal date
5608
- return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
5609
- }
5610
- },
5611
- date: {
5612
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5613
- parser: pickervue_type_script_lang_js_DATE_PARSER
5614
- },
5615
- datetime: {
5616
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5617
- parser: pickervue_type_script_lang_js_DATE_PARSER
5618
- },
5619
- daterange: {
5620
- formatter: RANGE_FORMATTER,
5621
- parser: RANGE_PARSER
5622
- },
5623
- monthrange: {
5624
- formatter: RANGE_FORMATTER,
5625
- parser: RANGE_PARSER
5626
- },
5627
- datetimerange: {
5628
- formatter: RANGE_FORMATTER,
5629
- parser: RANGE_PARSER
5630
- },
5631
- timerange: {
5632
- formatter: RANGE_FORMATTER,
5633
- parser: RANGE_PARSER
5634
- },
5635
- time: {
5636
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5637
- parser: pickervue_type_script_lang_js_DATE_PARSER
5638
- },
5639
- month: {
5640
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5641
- parser: pickervue_type_script_lang_js_DATE_PARSER
5642
- },
5643
- year: {
5644
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5645
- parser: pickervue_type_script_lang_js_DATE_PARSER
5646
- },
5647
- number: {
5648
- formatter: function formatter(value) {
5649
- if (!value) return '';
5650
- return '' + value;
5651
- },
5652
- parser: function parser(text) {
5653
- var result = Number(text);
5654
-
5655
- if (!isNaN(text)) {
5656
- return result;
5657
- } else {
5658
- return null;
5659
- }
5660
- }
5661
- },
5662
- dates: {
5663
- formatter: function formatter(value, format) {
5664
- return value.map(function (date) {
5665
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
5666
- });
5667
- },
5668
- parser: function parser(value, format) {
5669
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
5670
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
5671
- });
5672
- }
5673
- },
5674
- months: {
5675
- formatter: function formatter(value, format) {
5676
- return value.map(function (date) {
5677
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
5678
- });
5679
- },
5680
- parser: function parser(value, format) {
5681
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
5682
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
5683
- });
5684
- }
5685
- },
5686
- years: {
5687
- formatter: function formatter(value, format) {
5688
- return value.map(function (date) {
5689
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
5690
- });
5691
- },
5692
- parser: function parser(value, format) {
5693
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
5694
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
5695
- });
5696
- }
5697
- }
5698
- };
5699
- var PLACEMENT_MAP = {
5700
- left: 'bottom-start',
5701
- center: 'bottom',
5702
- right: 'bottom-end'
5703
- };
5704
-
5705
- var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
5706
- var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
5707
-
5708
- if (!value) return null;
5709
- var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
5710
- var format = customFormat || DEFAULT_FORMATS[type];
5711
- return parser(value, format, rangeSeparator);
5712
- };
5713
-
5714
- var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
5715
- if (!value) return null;
5716
- var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
5717
- var format = customFormat || DEFAULT_FORMATS[type];
5718
- return formatter(value, format);
5719
- };
5720
-
5721
- /*
5722
- * Considers:
5723
- * 1. Date object
5724
- * 2. date string
5725
- * 3. array of 1 or 2
5726
- */
5727
- var valueEquals = function valueEquals(a, b) {
5728
- // considers Date object and string
5729
- var dateEquals = function dateEquals(a, b) {
5730
- var aIsDate = a instanceof Date;
5731
- var bIsDate = b instanceof Date;
5732
- if (aIsDate && bIsDate) {
5733
- return a.getTime() === b.getTime();
5734
- }
5735
- if (!aIsDate && !bIsDate) {
5736
- return a === b;
5737
- }
5738
- return false;
5739
- };
5740
-
5741
- var aIsArray = a instanceof Array;
5742
- var bIsArray = b instanceof Array;
5743
- if (aIsArray && bIsArray) {
5744
- if (a.length !== b.length) {
5745
- return false;
5746
- }
5747
- return a.every(function (item, index) {
5748
- return dateEquals(item, b[index]);
5749
- });
5750
- }
5751
- if (!aIsArray && !bIsArray) {
5752
- return dateEquals(a, b);
5753
- }
5754
- return false;
5755
- };
5756
5573
 
5757
- var isString = function isString(val) {
5758
- return typeof val === 'string' || val instanceof String;
5759
- };
5574
+ /* harmony default export */ var pickervue_type_script_lang_js = ({
5575
+ name: 'ElDatePicker',
5760
5576
 
5761
- var validator = function validator(val) {
5762
- // either: String, Array of String, null / undefined
5763
- return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
5764
- };
5577
+ componentName: 'ElDatePicker',
5765
5578
 
5766
- /* harmony default export */ var pickervue_type_script_lang_js = ({
5767
- mixins: [emitter["a" /* default */], NewPopper],
5579
+ mixins: [emitter["a" /* default */]],
5768
5580
 
5769
- inject: {
5770
- elForm: {
5581
+ props: {
5582
+ modelValue: {
5771
5583
  default: ''
5772
5584
  },
5773
- elFormItem: {
5585
+ value: {
5774
5586
  default: ''
5775
- }
5776
- },
5777
-
5778
- props: {
5779
- size: String,
5780
- format: String,
5781
- valueFormat: String,
5782
- readonly: Boolean,
5783
- placeholder: String,
5784
- startPlaceholder: String,
5785
- endPlaceholder: String,
5786
- prefixIcon: String,
5787
- clearIcon: {
5788
- type: String,
5789
- default: 'el-icon-circle-close'
5790
- },
5791
- name: {
5792
- default: '',
5793
- validator: validator
5794
5587
  },
5588
+ readonly: Boolean,
5795
5589
  disabled: Boolean,
5796
- clearable: {
5797
- type: Boolean,
5798
- default: true
5799
- },
5800
- id: {
5801
- default: '',
5802
- validator: validator
5803
- },
5804
- popperClass: String,
5590
+ size: String,
5805
5591
  editable: {
5806
5592
  type: Boolean,
5807
5593
  default: true
5808
5594
  },
5595
+ type: {
5596
+ type: String,
5597
+ default: 'date',
5598
+ validator: function validator(val) {
5599
+ return ['date', 'dates', 'datetime', 'week', 'month', 'months', 'year', 'years', 'datetimerange', 'daterange', 'monthrange', 'timerange'].indexOf(val) > -1;
5600
+ }
5601
+ },
5602
+ format: String,
5809
5603
  align: {
5810
5604
  type: String,
5811
5605
  default: 'left'
5812
5606
  },
5813
- value: {},
5814
- defaultValue: {},
5815
- defaultTime: {},
5607
+ pickerOptions: Object,
5816
5608
  rangeSeparator: {
5609
+ type: String,
5817
5610
  default: '-'
5818
5611
  },
5819
- pickerOptions: {},
5820
- unlinkPanels: Boolean,
5612
+ startPlaceholder: String,
5613
+ endPlaceholder: String,
5614
+ placeholder: String,
5615
+ timeArrowControl: Boolean,
5616
+ name: [String, Array],
5617
+ autocomplete: {
5618
+ type: String,
5619
+ default: 'off'
5620
+ },
5621
+ popperClass: String,
5622
+ teleported: {
5623
+ type: Boolean,
5624
+ default: true
5625
+ },
5821
5626
  validateEvent: {
5822
5627
  type: Boolean,
5823
5628
  default: true
5629
+ },
5630
+ dateRangeSeparator: {
5631
+ type: String,
5632
+ default: '-'
5824
5633
  }
5825
5634
  },
5826
5635
 
5827
- components: { ElInput: input["default"] },
5828
-
5829
- directives: { Clickoutside: clickoutside["a" /* default */] },
5830
-
5831
5636
  data: function data() {
5832
5637
  return {
5833
5638
  pickerVisible: false,
5639
+ userInput: '',
5834
5640
  showClose: false,
5835
- userInput: null,
5836
- valueOnOpen: null, // value when picker opens, used to determine whether to emit change
5837
- unwatchPickerOptions: null
5641
+ pickerDate: null,
5642
+ selectionMode: 'date',
5643
+ dateRangeSeparator: this.rangeSeparator
5838
5644
  };
5839
5645
  },
5840
5646
 
5841
5647
 
5842
- watch: {
5843
- pickerVisible: function pickerVisible(val) {
5844
- if (this.readonly || this.pickerDisabled) return;
5845
- if (val) {
5846
- this.showPicker();
5847
- this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
5848
- } else {
5849
- this.hidePicker();
5850
- this.emitChange(this.value);
5851
- this.userInput = null;
5852
- if (this.validateEvent) {
5853
- this.dispatch('ElFormItem', 'el.form.blur');
5854
- }
5855
- this.$emit('blur', this);
5856
- this.blur();
5857
- }
5858
- },
5859
-
5860
- parsedValue: {
5861
- immediate: true,
5862
- handler: function handler(val) {
5863
- if (this.picker) {
5864
- this.picker.value = val;
5865
- }
5866
- }
5867
- },
5868
- defaultValue: function defaultValue(val) {
5869
- // NOTE: should eventually move to jsx style picker + panel ?
5870
- if (this.picker) {
5871
- this.picker.defaultValue = val;
5648
+ computed: {
5649
+ actualValue: {
5650
+ get: function get() {
5651
+ return this.modelValue !== undefined ? this.modelValue : this.value;
5652
+ },
5653
+ set: function set(value) {
5654
+ this.$emit('update:modelValue', value);
5655
+ this.$emit('input', value);
5872
5656
  }
5873
5657
  },
5874
- value: function value(val, oldVal) {
5875
- if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
5876
- this.dispatch('ElFormItem', 'el.form.change', val);
5877
- }
5878
- }
5879
- },
5880
-
5881
- computed: {
5882
5658
  ranged: function ranged() {
5883
- return this.type.indexOf('range') > -1;
5884
- },
5885
- reference: function reference() {
5886
- var reference = this.$refs.reference;
5887
- return reference.$el || reference;
5659
+ return this.type === 'daterange' || this.type === 'monthrange' || this.type === 'datetimerange' || this.type === 'timerange';
5888
5660
  },
5889
- refInput: function refInput() {
5890
- if (this.reference) {
5891
- return [].slice.call(this.reference.querySelectorAll('input'));
5892
- }
5893
- return [];
5894
- },
5895
- valueIsEmpty: function valueIsEmpty() {
5896
- var val = this.value;
5897
- if (Array.isArray(val)) {
5898
- for (var i = 0, len = val.length; i < len; i++) {
5899
- if (val[i]) {
5900
- return false;
5901
- }
5902
- }
5903
- } else {
5904
- if (val) {
5905
- return false;
5906
- }
5907
- }
5908
- return true;
5661
+ pickerSize: function pickerSize() {
5662
+ return this.size || (this.$ELEMENT || {}).size;
5909
5663
  },
5910
- triggerClass: function triggerClass() {
5911
- return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
5912
- },
5913
- selectionMode: function selectionMode() {
5914
- if (this.type === 'week') {
5915
- return 'week';
5916
- } else if (this.type === 'month') {
5917
- return 'month';
5918
- } else if (this.type === 'year') {
5919
- return 'year';
5920
- } else if (this.type === 'dates') {
5921
- return 'dates';
5922
- } else if (this.type === 'months') {
5923
- return 'months';
5924
- } else if (this.type === 'years') {
5925
- return 'years';
5926
- }
5927
-
5928
- return 'day';
5664
+ pickerDisabled: function pickerDisabled() {
5665
+ return this.disabled || (this.elForm || {}).disabled;
5929
5666
  },
5930
5667
  haveTrigger: function haveTrigger() {
5931
- if (typeof this.showTrigger !== 'undefined') {
5932
- return this.showTrigger;
5933
- }
5934
5668
  return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
5935
5669
  },
5936
- displayValue: function displayValue() {
5937
- var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
5938
- if (Array.isArray(this.userInput)) {
5939
- return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
5940
- } else if (this.userInput !== null) {
5941
- return this.userInput;
5942
- } else if (formattedValue) {
5943
- return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
5944
- } else {
5945
- return this.ranged ? ['', ''] : '';
5946
- }
5670
+ triggerClass: function triggerClass() {
5671
+ return this.pickerVisible ? 'el-icon-d-arrow-down' : 'el-icon-calendar';
5947
5672
  },
5948
- parsedValue: function parsedValue() {
5949
- if (!this.value) return this.value; // component value is not set
5950
- if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
5951
-
5952
- var valueIsDateObject = Object(date_util["r" /* isDateObject */])(this.value) || Array.isArray(this.value) && this.value.every(date_util["r" /* isDateObject */]);
5953
- if (valueIsDateObject) {
5954
- return this.value;
5955
- }
5956
-
5957
- if (this.valueFormat) {
5958
- return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
5673
+ elForm: function elForm() {
5674
+ var parent = this.$parent;
5675
+ while (parent) {
5676
+ if (parent.$options.componentName === 'ElForm') {
5677
+ return parent;
5678
+ }
5679
+ parent = parent.$parent;
5959
5680
  }
5960
-
5961
- // NOTE: deal with common but incorrect usage, should remove in next major version
5962
- // user might provide string / timestamp without value-format, coerce them into date (or array of date)
5963
- return Array.isArray(this.value) ? this.value.map(function (val) {
5964
- return new Date(val);
5965
- }) : new Date(this.value);
5681
+ return null;
5966
5682
  },
5967
- _elFormItemSize: function _elFormItemSize() {
5968
- return (this.elFormItem || {}).elFormItemSize;
5683
+ displayFormat: function displayFormat() {
5684
+ return this.format || DEFAULT_FORMATS[this.type];
5969
5685
  },
5970
- pickerSize: function pickerSize() {
5971
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
5972
- },
5973
- pickerDisabled: function pickerDisabled() {
5974
- return this.disabled || (this.elForm || {}).disabled;
5975
- },
5976
- firstInputId: function firstInputId() {
5977
- var obj = {};
5978
- var id = void 0;
5686
+ displayValue: function displayValue() {
5687
+ var value = this.actualValue;
5979
5688
  if (this.ranged) {
5980
- id = this.id && this.id[0];
5689
+ if (Array.isArray(value) && value.length === 2) {
5690
+ var start = value[0];
5691
+ var end = value[1];
5692
+ if (Object(date_util["r" /* isDateObject */])(start) && Object(date_util["r" /* isDateObject */])(end)) {
5693
+ return [Object(date_util["f" /* formatDate */])(start, this.displayFormat), Object(date_util["f" /* formatDate */])(end, this.displayFormat)];
5694
+ }
5695
+ }
5696
+ return ['', ''];
5981
5697
  } else {
5982
- id = this.id;
5698
+ if (Object(date_util["r" /* isDateObject */])(value)) {
5699
+ return Object(date_util["f" /* formatDate */])(value, this.displayFormat);
5700
+ }
5701
+ return '';
5983
5702
  }
5984
- if (id) obj.id = id;
5985
- return obj;
5703
+ },
5704
+ clearIcon: function clearIcon() {
5705
+ return 'el-icon-circle-close';
5706
+ },
5707
+ firstInputId: function firstInputId() {
5708
+ return this.name ? { id: 'el-date-picker-' + this.name } : {};
5986
5709
  },
5987
5710
  secondInputId: function secondInputId() {
5988
- var obj = {};
5989
- var id = void 0;
5990
- if (this.ranged) {
5991
- id = this.id && this.id[1];
5992
- }
5993
- if (id) obj.id = id;
5994
- return obj;
5711
+ return this.name && Array.isArray(this.name) ? { id: 'el-date-picker-' + this.name[1] } : {};
5995
5712
  }
5996
5713
  },
5997
5714
 
5998
- created: function created() {
5999
- // vue-popper
6000
- this.popperOptions = {
6001
- boundariesPadding: 0,
6002
- gpuAcceleration: false
6003
- };
6004
- this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
6005
-
6006
- this.$on('fieldReset', this.handleFieldReset);
6007
- },
6008
-
6009
-
6010
- methods: {
6011
- focus: function focus() {
6012
- if (!this.ranged) {
6013
- this.$refs.reference.focus();
6014
- } else {
6015
- this.handleFocus();
6016
- }
6017
- },
6018
- blur: function blur() {
6019
- this.refInput.forEach(function (input) {
6020
- return input.blur();
6021
- });
6022
- },
6023
-
5715
+ watch: {
5716
+ pickerVisible: function pickerVisible(val) {
5717
+ var _this = this;
6024
5718
 
6025
- // {parse, formatTo} Value deals maps component value with internal Date
6026
- parseValue: function parseValue(value) {
6027
- var isParsed = Object(date_util["r" /* isDateObject */])(value) || Array.isArray(value) && value.every(date_util["r" /* isDateObject */]);
6028
- if (this.valueFormat && !isParsed) {
6029
- return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
5719
+ if (val) {
5720
+ this.$emit('visible-change', true);
5721
+ this.$nextTick(function () {
5722
+ _this.updateScrollBar();
5723
+ });
6030
5724
  } else {
6031
- return value;
5725
+ this.$emit('visible-change', false);
6032
5726
  }
6033
5727
  },
6034
- formatToValue: function formatToValue(date) {
6035
- var isFormattable = Object(date_util["r" /* isDateObject */])(date) || Array.isArray(date) && date.every(date_util["r" /* isDateObject */]);
6036
- if (this.valueFormat && isFormattable) {
6037
- return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
5728
+ actualValue: function actualValue(val) {
5729
+ if (this.ranged) {
5730
+ if (Array.isArray(val) && val.length === 2) {
5731
+ this.pickerDate = val[0];
5732
+ }
6038
5733
  } else {
6039
- return date;
5734
+ this.pickerDate = val;
6040
5735
  }
6041
- },
6042
-
5736
+ this.userInput = '';
5737
+ }
5738
+ },
6043
5739
 
6044
- // {parse, formatTo} String deals with user input
6045
- parseString: function parseString(value) {
6046
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
6047
- return parseAsFormatAndType(value, this.format, type);
6048
- },
6049
- formatToString: function formatToString(value) {
6050
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
6051
- return formatAsFormatAndType(value, this.format, type);
5740
+ methods: {
5741
+ handleFocus: function handleFocus(e) {
5742
+ if (this.pickerDisabled) return;
5743
+ this.pickerVisible = true;
5744
+ this.$emit('focus', e);
6052
5745
  },
6053
- handleMouseEnter: function handleMouseEnter() {
6054
- if (this.readonly || this.pickerDisabled) return;
6055
- if (!this.valueIsEmpty && this.clearable) {
6056
- this.showClose = true;
6057
- }
5746
+ handleClose: function handleClose() {
5747
+ this.pickerVisible = false;
5748
+ this.showClose = false;
6058
5749
  },
6059
- handleChange: function handleChange() {
6060
- if (this.userInput) {
6061
- var value = this.parseString(this.displayValue);
6062
- if (value) {
6063
- this.picker.value = value;
6064
- if (this.isValidValue(value)) {
6065
- this.emitInput(value);
6066
- this.userInput = null;
6067
- }
6068
- }
6069
- }
6070
- if (this.userInput === '') {
6071
- this.emitInput(null);
6072
- this.emitChange(null);
6073
- this.userInput = null;
5750
+ handleKeydown: function handleKeydown(e) {
5751
+ if (e.keyCode === 27) {
5752
+ this.handleClose();
6074
5753
  }
6075
5754
  },
6076
- handleStartInput: function handleStartInput(event) {
6077
- if (this.userInput) {
6078
- this.userInput = [event.target.value, this.userInput[1]];
5755
+ handleClickIcon: function handleClickIcon() {
5756
+ if (this.showClose) {
5757
+ this.handleClear();
6079
5758
  } else {
6080
- this.userInput = [event.target.value, null];
5759
+ this.handleFocus();
6081
5760
  }
6082
5761
  },
6083
- handleEndInput: function handleEndInput(event) {
6084
- if (this.userInput) {
6085
- this.userInput = [this.userInput[0], event.target.value];
6086
- } else {
6087
- this.userInput = [null, event.target.value];
6088
- }
5762
+ handleClear: function handleClear() {
5763
+ this.actualValue = this.ranged ? ['', ''] : '';
5764
+ this.showClose = false;
5765
+ this.$emit('clear');
6089
5766
  },
6090
- handleStartChange: function handleStartChange(event) {
6091
- var value = this.parseString(this.userInput && this.userInput[0]);
6092
- if (value) {
6093
- this.userInput = [this.formatToString(value), this.displayValue[1]];
6094
- var newValue = [value, this.picker.value && this.picker.value[1]];
6095
- this.picker.value = newValue;
6096
- if (this.isValidValue(newValue)) {
6097
- this.emitInput(newValue);
6098
- this.userInput = null;
6099
- }
6100
- }
5767
+ handleChange: function handleChange(e) {
5768
+ this.$emit('change', e);
6101
5769
  },
6102
- handleEndChange: function handleEndChange(event) {
6103
- var value = this.parseString(this.userInput && this.userInput[1]);
6104
- if (value) {
6105
- this.userInput = [this.displayValue[0], this.formatToString(value)];
6106
- var newValue = [this.picker.value && this.picker.value[0], value];
6107
- this.picker.value = newValue;
6108
- if (this.isValidValue(newValue)) {
6109
- this.emitInput(newValue);
6110
- this.userInput = null;
6111
- }
6112
- }
5770
+ handleStartInput: function handleStartInput(value) {
5771
+ this.userInput = value;
6113
5772
  },
6114
- handleClickIcon: function handleClickIcon(event) {
6115
- if (this.readonly || this.pickerDisabled) return;
6116
- if (this.showClose) {
6117
- this.valueOnOpen = this.value;
6118
- event.stopPropagation();
6119
- this.emitInput(null);
6120
- this.emitChange(null);
6121
- this.showClose = false;
6122
- if (this.picker && typeof this.picker.handleClear === 'function') {
6123
- this.picker.handleClear();
6124
- }
6125
- } else {
6126
- this.pickerVisible = !this.pickerVisible;
6127
- }
5773
+ handleEndInput: function handleEndInput(value) {
5774
+ this.userInput = value;
6128
5775
  },
6129
- handleClose: function handleClose() {
6130
- if (!this.pickerVisible) return;
6131
- this.pickerVisible = false;
6132
-
6133
- if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
6134
- // restore to former value
6135
- var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
6136
- this.emitInput(oldValue);
6137
- }
5776
+ handleStartChange: function handleStartChange(value) {
5777
+ this.$emit('change', value);
6138
5778
  },
6139
- handleFieldReset: function handleFieldReset(initialValue) {
6140
- this.userInput = initialValue === '' ? null : initialValue;
5779
+ handleEndChange: function handleEndChange(value) {
5780
+ this.$emit('change', value);
6141
5781
  },
6142
- handleFocus: function handleFocus() {
6143
- var type = this.type;
6144
-
6145
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
6146
- this.pickerVisible = true;
6147
- }
6148
- this.$emit('focus', this);
6149
- },
6150
- handleKeydown: function handleKeydown(event) {
6151
- var _this = this;
6152
-
6153
- var keyCode = event.keyCode;
6154
-
6155
- // ESC
6156
- if (keyCode === 27) {
6157
- this.pickerVisible = false;
6158
- event.stopPropagation();
6159
- return;
6160
- }
6161
-
6162
- // Tab
6163
- if (keyCode === 9) {
6164
- if (!this.ranged) {
6165
- this.handleChange();
6166
- this.pickerVisible = this.picker.visible = false;
6167
- this.blur();
6168
- event.stopPropagation();
6169
- } else {
6170
- // user may change focus between two input
6171
- setTimeout(function () {
6172
- if (_this.refInput.indexOf(document.activeElement) === -1) {
6173
- _this.pickerVisible = false;
6174
- _this.blur();
6175
- event.stopPropagation();
6176
- }
6177
- }, 0);
6178
- }
6179
- return;
6180
- }
6181
-
6182
- // Enter
6183
- if (keyCode === 13) {
6184
- if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
6185
- this.handleChange();
6186
- this.pickerVisible = this.picker.visible = false;
6187
- this.blur();
6188
- }
6189
- event.stopPropagation();
6190
- return;
6191
- }
6192
-
6193
- // if user is typing, do not let picker handle key input
6194
- if (this.userInput) {
6195
- event.stopPropagation();
6196
- return;
6197
- }
6198
-
6199
- // delegate other keys to panel
6200
- if (this.picker && this.picker.handleKeydown) {
6201
- this.picker.handleKeydown(event);
6202
- }
6203
- },
6204
- handleRangeClick: function handleRangeClick() {
6205
- var type = this.type;
6206
-
6207
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
6208
- this.pickerVisible = true;
5782
+ handleRangeClick: function handleRangeClick(e) {
5783
+ if (this.pickerDisabled) return;
5784
+ var target = e.target;
5785
+ var isInput = target.tagName === 'INPUT';
5786
+ if (!isInput) {
5787
+ this.pickerVisible = !this.pickerVisible;
6209
5788
  }
6210
- this.$emit('focus', this);
6211
5789
  },
6212
- hidePicker: function hidePicker() {
6213
- if (this.picker) {
6214
- this.picker.resetView && this.picker.resetView();
6215
- this.pickerVisible = this.picker.visible = false;
6216
- this.destroyPopper();
5790
+ handleMouseEnter: function handleMouseEnter() {
5791
+ if (this.actualValue) {
5792
+ this.showClose = true;
6217
5793
  }
6218
5794
  },
6219
- showPicker: function showPicker() {
5795
+ updateScrollBar: function updateScrollBar() {
6220
5796
  var _this2 = this;
6221
5797
 
6222
- if (this.$isServer) return;
6223
- if (!this.picker) {
6224
- this.mountPicker();
6225
- }
6226
- this.pickerVisible = this.picker.visible = true;
6227
-
6228
- this.updatePopper();
6229
-
6230
- this.picker.value = this.parsedValue;
6231
- this.picker.resetView && this.picker.resetView();
6232
-
6233
5798
  this.$nextTick(function () {
6234
- _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
6235
- });
6236
- },
6237
- mountPicker: function mountPicker() {
6238
- var _this3 = this;
6239
-
6240
- this.picker = new external_vue_default.a(this.panel).$mount();
6241
- this.picker.defaultValue = this.defaultValue;
6242
- this.picker.defaultTime = this.defaultTime;
6243
- this.picker.popperClass = this.popperClass;
6244
- this.popperElm = this.picker.$el;
6245
- this.picker.width = this.reference.getBoundingClientRect().width;
6246
- this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
6247
- this.picker.selectionMode = this.selectionMode;
6248
- this.picker.unlinkPanels = this.unlinkPanels;
6249
- this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
6250
- this.$watch('format', function (format) {
6251
- _this3.picker.format = format;
6252
- });
6253
-
6254
- var updateOptions = function updateOptions() {
6255
- var options = _this3.pickerOptions;
6256
-
6257
- if (options && options.selectableRange) {
6258
- var ranges = options.selectableRange;
6259
- var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
6260
- var format = DEFAULT_FORMATS.timerange;
6261
-
6262
- ranges = Array.isArray(ranges) ? ranges : [ranges];
6263
- _this3.picker.selectableRange = ranges.map(function (range) {
6264
- return parser(range, format, _this3.rangeSeparator);
6265
- });
6266
- }
6267
-
6268
- for (var option in options) {
6269
- if (options.hasOwnProperty(option) &&
6270
- // 忽略 time-picker 的该配置项
6271
- option !== 'selectableRange') {
6272
- _this3.picker[option] = options[option];
6273
- }
6274
- }
6275
-
6276
- // main format must prevail over undocumented pickerOptions.format
6277
- if (_this3.format) {
6278
- _this3.picker.format = _this3.format;
5799
+ var scrollbar = _this2.$refs.reference && _this2.$refs.reference.$el;
5800
+ if (scrollbar) {
5801
+ scrollbar.scrollLeft = 0;
6279
5802
  }
6280
- };
6281
- updateOptions();
6282
- this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
6283
- return updateOptions();
6284
- }, { deep: true });
6285
- this.$el.appendChild(this.picker.$el);
6286
- this.picker.resetView && this.picker.resetView();
6287
-
6288
- this.picker.$on('dodestroy', this.doDestroy);
6289
- this.picker.$on('pick', function () {
6290
- var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
6291
- var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6292
-
6293
- _this3.userInput = null;
6294
- _this3.pickerVisible = _this3.picker.visible = visible;
6295
- _this3.emitInput(date);
6296
- _this3.picker.resetView && _this3.picker.resetView();
6297
5803
  });
6298
-
6299
- this.picker.$on('select-range', function (start, end, pos) {
6300
- if (_this3.refInput.length === 0) return;
6301
- if (!pos || pos === 'min') {
6302
- _this3.refInput[0].setSelectionRange(start, end);
6303
- _this3.refInput[0].focus();
6304
- } else if (pos === 'max') {
6305
- _this3.refInput[1].setSelectionRange(start, end);
6306
- _this3.refInput[1].focus();
6307
- }
6308
- });
6309
- },
6310
- unmountPicker: function unmountPicker() {
6311
- if (this.picker) {
6312
- this.picker.$destroy();
6313
- this.picker.$off();
6314
- if (typeof this.unwatchPickerOptions === 'function') {
6315
- this.unwatchPickerOptions();
6316
- }
6317
- this.picker.$el.parentNode.removeChild(this.picker.$el);
6318
- }
6319
- },
6320
- emitChange: function emitChange(val) {
6321
- // determine user real change only
6322
- if (!valueEquals(val, this.valueOnOpen)) {
6323
- this.$emit('change', val);
6324
- this.valueOnOpen = val;
6325
- if (this.validateEvent) {
6326
- this.dispatch('ElFormItem', 'el.form.change', val);
6327
- }
6328
- }
6329
- },
6330
- emitInput: function emitInput(val) {
6331
- var formatted = this.formatToValue(val);
6332
- if (!valueEquals(this.value, formatted)) {
6333
- this.$emit('input', formatted);
6334
- }
6335
- },
6336
- isValidValue: function isValidValue(value) {
6337
- if (!this.picker) {
6338
- this.mountPicker();
6339
- }
6340
- if (this.picker.isValidValue) {
6341
- return value && this.picker.isValidValue(value);
6342
- } else {
6343
- return true;
6344
- }
6345
5804
  }
5805
+ },
5806
+
5807
+ directives: {
5808
+ clickoutside: clickoutside["a" /* default */]
5809
+ },
5810
+
5811
+ components: {
5812
+ ElInput: input["default"]
6346
5813
  }
6347
5814
  });
6348
5815
  // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js
@@ -6381,7 +5848,7 @@ var component = Object(componentNormalizer["a" /* default */])(
6381
5848
 
6382
5849
  "use strict";
6383
5850
 
6384
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=60aeb3bd
5851
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=42edb53e
6385
5852
  var render = function render() {
6386
5853
  var _vm = this,
6387
5854
  _c = _vm._self._c
@@ -6735,10 +6202,10 @@ var staticRenderFns = []
6735
6202
  render._withStripped = true
6736
6203
 
6737
6204
 
6738
- // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=60aeb3bd
6205
+ // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=42edb53e
6739
6206
 
6740
6207
  // EXTERNAL MODULE: ./src/utils/date-util.js
6741
- var date_util = __webpack_require__(5);
6208
+ var date_util = __webpack_require__(4);
6742
6209
 
6743
6210
  // EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
6744
6211
  var scrollbar = __webpack_require__(25);
@@ -7015,7 +6482,7 @@ var picker = __webpack_require__(41);
7015
6482
  // EXTERNAL MODULE: ./packages/date-picker/src/panel/time.vue + 4 modules
7016
6483
  var time = __webpack_require__(39);
7017
6484
 
7018
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=48439bdb
6485
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=dd07c916
7019
6486
  var render = function render() {
7020
6487
  var _vm = this,
7021
6488
  _c = _vm._self._c
@@ -7148,10 +6615,10 @@ var staticRenderFns = []
7148
6615
  render._withStripped = true
7149
6616
 
7150
6617
 
7151
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=48439bdb
6618
+ // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=dd07c916
7152
6619
 
7153
6620
  // EXTERNAL MODULE: ./src/utils/date-util.js
7154
- var date_util = __webpack_require__(5);
6621
+ var date_util = __webpack_require__(4);
7155
6622
 
7156
6623
  // EXTERNAL MODULE: ./src/mixins/locale.js
7157
6624
  var locale = __webpack_require__(13);