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
  *
@@ -2262,7 +2262,7 @@ function isKorean(text) {
2262
2262
  // ESM COMPAT FLAG
2263
2263
  __webpack_require__.r(__webpack_exports__);
2264
2264
 
2265
- // 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
2265
+ // 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
2266
2266
  var render = function render() {
2267
2267
  var _vm = this,
2268
2268
  _c = _vm._self._c
@@ -2474,7 +2474,7 @@ var staticRenderFns = []
2474
2474
  render._withStripped = true
2475
2475
 
2476
2476
 
2477
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=af7512c8
2477
+ // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=d8ebd7ac
2478
2478
 
2479
2479
  // EXTERNAL MODULE: ./src/mixins/emitter.js
2480
2480
  var emitter = __webpack_require__(6);
@@ -4999,7 +4999,7 @@ function scrollIntoView(container, selected) {
4999
4999
 
5000
5000
  "use strict";
5001
5001
 
5002
- // 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
5002
+ // 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
5003
5003
  var render = function render() {
5004
5004
  var _vm = this,
5005
5005
  _c = _vm._self._c
@@ -5176,17 +5176,16 @@ var staticRenderFns = []
5176
5176
  render._withStripped = true
5177
5177
 
5178
5178
 
5179
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=0642cc1d
5179
+ // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=156e5e58
5180
5180
 
5181
5181
  // EXTERNAL MODULE: external "vue"
5182
5182
  var external_vue_ = __webpack_require__(0);
5183
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
5184
5183
 
5185
5184
  // EXTERNAL MODULE: ./src/utils/clickoutside.js
5186
5185
  var clickoutside = __webpack_require__(21);
5187
5186
 
5188
5187
  // EXTERNAL MODULE: ./src/utils/date-util.js
5189
- var date_util = __webpack_require__(5);
5188
+ var date_util = __webpack_require__(4);
5190
5189
 
5191
5190
  // EXTERNAL MODULE: ./src/utils/vue-popper.js
5192
5191
  var vue_popper = __webpack_require__(10);
@@ -5249,794 +5248,262 @@ var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, forma
5249
5248
  if (format === 'timestamp') return new Date(Number(text));
5250
5249
  return Object(date_util["z" /* parseDate */])(text, format);
5251
5250
  };
5252
- var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
5251
+ var pickervue_type_script_lang_js_RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
5253
5252
  if (Array.isArray(value) && value.length === 2) {
5254
5253
  var start = value[0];
5255
5254
  var end = value[1];
5256
-
5257
- if (start && end) {
5258
- return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
5255
+ if (Object(date_util["r" /* isDateObject */])(start) && Object(date_util["r" /* isDateObject */])(end)) {
5256
+ return [Object(date_util["f" /* formatDate */])(start, format), Object(date_util["f" /* formatDate */])(end, format)];
5259
5257
  }
5260
5258
  }
5261
- return '';
5259
+ return ['', ''];
5262
5260
  };
5263
- var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
5264
- if (!Array.isArray(array)) {
5265
- array = array.split(separator);
5266
- }
5267
- if (array.length === 2) {
5268
- var range1 = array[0];
5269
- var range2 = array[1];
5270
-
5271
- return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
5261
+ var pickervue_type_script_lang_js_RANGE_PARSER = function RANGE_PARSER(text, format) {
5262
+ if (Array.isArray(text) && text.length === 2) {
5263
+ return [Object(date_util["z" /* parseDate */])(text[0], format), Object(date_util["z" /* parseDate */])(text[1], format)];
5272
5264
  }
5273
5265
  return [];
5274
5266
  };
5275
- var TYPE_VALUE_RESOLVER_MAP = {
5276
- default: {
5277
- formatter: function formatter(value) {
5278
- if (!value) return '';
5279
- return '' + value;
5280
- },
5281
- parser: function parser(text) {
5282
- if (text === undefined || text === '') return null;
5283
- return text;
5284
- }
5285
- },
5286
- week: {
5287
- formatter: function formatter(value, format) {
5288
- var week = Object(date_util["p" /* getWeekNumber */])(value);
5289
- var month = value.getMonth();
5290
- var trueDate = new Date(value);
5291
- if (week === 1 && month === 11) {
5292
- trueDate.setHours(0, 0, 0, 0);
5293
- trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
5294
- }
5295
- var date = Object(date_util["f" /* formatDate */])(trueDate, format);
5296
-
5297
- date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
5298
- return date;
5299
- },
5300
- parser: function parser(text, format) {
5301
- // parse as if a normal date
5302
- return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
5303
- }
5304
- },
5305
- date: {
5306
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5307
- parser: pickervue_type_script_lang_js_DATE_PARSER
5308
- },
5309
- datetime: {
5310
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5311
- parser: pickervue_type_script_lang_js_DATE_PARSER
5312
- },
5313
- daterange: {
5314
- formatter: RANGE_FORMATTER,
5315
- parser: RANGE_PARSER
5316
- },
5317
- monthrange: {
5318
- formatter: RANGE_FORMATTER,
5319
- parser: RANGE_PARSER
5320
- },
5321
- datetimerange: {
5322
- formatter: RANGE_FORMATTER,
5323
- parser: RANGE_PARSER
5324
- },
5325
- timerange: {
5326
- formatter: RANGE_FORMATTER,
5327
- parser: RANGE_PARSER
5328
- },
5329
- time: {
5330
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5331
- parser: pickervue_type_script_lang_js_DATE_PARSER
5332
- },
5333
- month: {
5334
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5335
- parser: pickervue_type_script_lang_js_DATE_PARSER
5336
- },
5337
- year: {
5338
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
5339
- parser: pickervue_type_script_lang_js_DATE_PARSER
5340
- },
5341
- number: {
5342
- formatter: function formatter(value) {
5343
- if (!value) return '';
5344
- return '' + value;
5345
- },
5346
- parser: function parser(text) {
5347
- var result = Number(text);
5348
-
5349
- if (!isNaN(text)) {
5350
- return result;
5351
- } else {
5352
- return null;
5353
- }
5354
- }
5355
- },
5356
- dates: {
5357
- formatter: function formatter(value, format) {
5358
- return value.map(function (date) {
5359
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
5360
- });
5361
- },
5362
- parser: function parser(value, format) {
5363
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
5364
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
5365
- });
5366
- }
5367
- },
5368
- months: {
5369
- formatter: function formatter(value, format) {
5370
- return value.map(function (date) {
5371
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
5372
- });
5373
- },
5374
- parser: function parser(value, format) {
5375
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
5376
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
5377
- });
5378
- }
5379
- },
5380
- years: {
5381
- formatter: function formatter(value, format) {
5382
- return value.map(function (date) {
5383
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
5384
- });
5385
- },
5386
- parser: function parser(value, format) {
5387
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
5388
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
5389
- });
5390
- }
5391
- }
5392
- };
5393
- var PLACEMENT_MAP = {
5394
- left: 'bottom-start',
5395
- center: 'bottom',
5396
- right: 'bottom-end'
5397
- };
5398
-
5399
- var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
5400
- var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
5401
-
5402
- if (!value) return null;
5403
- var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
5404
- var format = customFormat || DEFAULT_FORMATS[type];
5405
- return parser(value, format, rangeSeparator);
5406
- };
5407
-
5408
- var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
5409
- if (!value) return null;
5410
- var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
5411
- var format = customFormat || DEFAULT_FORMATS[type];
5412
- return formatter(value, format);
5413
- };
5414
-
5415
- /*
5416
- * Considers:
5417
- * 1. Date object
5418
- * 2. date string
5419
- * 3. array of 1 or 2
5420
- */
5421
- var valueEquals = function valueEquals(a, b) {
5422
- // considers Date object and string
5423
- var dateEquals = function dateEquals(a, b) {
5424
- var aIsDate = a instanceof Date;
5425
- var bIsDate = b instanceof Date;
5426
- if (aIsDate && bIsDate) {
5427
- return a.getTime() === b.getTime();
5428
- }
5429
- if (!aIsDate && !bIsDate) {
5430
- return a === b;
5431
- }
5432
- return false;
5433
- };
5434
-
5435
- var aIsArray = a instanceof Array;
5436
- var bIsArray = b instanceof Array;
5437
- if (aIsArray && bIsArray) {
5438
- if (a.length !== b.length) {
5439
- return false;
5440
- }
5441
- return a.every(function (item, index) {
5442
- return dateEquals(item, b[index]);
5443
- });
5444
- }
5445
- if (!aIsArray && !bIsArray) {
5446
- return dateEquals(a, b);
5447
- }
5448
- return false;
5449
- };
5450
5267
 
5451
- var isString = function isString(val) {
5452
- return typeof val === 'string' || val instanceof String;
5453
- };
5268
+ /* harmony default export */ var pickervue_type_script_lang_js = ({
5269
+ name: 'ElDatePicker',
5454
5270
 
5455
- var validator = function validator(val) {
5456
- // either: String, Array of String, null / undefined
5457
- return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
5458
- };
5271
+ componentName: 'ElDatePicker',
5459
5272
 
5460
- /* harmony default export */ var pickervue_type_script_lang_js = ({
5461
- mixins: [emitter["a" /* default */], NewPopper],
5273
+ mixins: [emitter["a" /* default */]],
5462
5274
 
5463
- inject: {
5464
- elForm: {
5275
+ props: {
5276
+ modelValue: {
5465
5277
  default: ''
5466
5278
  },
5467
- elFormItem: {
5279
+ value: {
5468
5280
  default: ''
5469
- }
5470
- },
5471
-
5472
- props: {
5473
- size: String,
5474
- format: String,
5475
- valueFormat: String,
5476
- readonly: Boolean,
5477
- placeholder: String,
5478
- startPlaceholder: String,
5479
- endPlaceholder: String,
5480
- prefixIcon: String,
5481
- clearIcon: {
5482
- type: String,
5483
- default: 'el-icon-circle-close'
5484
- },
5485
- name: {
5486
- default: '',
5487
- validator: validator
5488
5281
  },
5282
+ readonly: Boolean,
5489
5283
  disabled: Boolean,
5490
- clearable: {
5491
- type: Boolean,
5492
- default: true
5493
- },
5494
- id: {
5495
- default: '',
5496
- validator: validator
5497
- },
5498
- popperClass: String,
5284
+ size: String,
5499
5285
  editable: {
5500
5286
  type: Boolean,
5501
5287
  default: true
5502
5288
  },
5289
+ type: {
5290
+ type: String,
5291
+ default: 'date',
5292
+ validator: function validator(val) {
5293
+ return ['date', 'dates', 'datetime', 'week', 'month', 'months', 'year', 'years', 'datetimerange', 'daterange', 'monthrange', 'timerange'].indexOf(val) > -1;
5294
+ }
5295
+ },
5296
+ format: String,
5503
5297
  align: {
5504
5298
  type: String,
5505
5299
  default: 'left'
5506
5300
  },
5507
- value: {},
5508
- defaultValue: {},
5509
- defaultTime: {},
5301
+ pickerOptions: Object,
5510
5302
  rangeSeparator: {
5303
+ type: String,
5511
5304
  default: '-'
5512
5305
  },
5513
- pickerOptions: {},
5514
- unlinkPanels: Boolean,
5306
+ startPlaceholder: String,
5307
+ endPlaceholder: String,
5308
+ placeholder: String,
5309
+ timeArrowControl: Boolean,
5310
+ name: [String, Array],
5311
+ autocomplete: {
5312
+ type: String,
5313
+ default: 'off'
5314
+ },
5315
+ popperClass: String,
5316
+ teleported: {
5317
+ type: Boolean,
5318
+ default: true
5319
+ },
5515
5320
  validateEvent: {
5516
5321
  type: Boolean,
5517
5322
  default: true
5323
+ },
5324
+ dateRangeSeparator: {
5325
+ type: String,
5326
+ default: '-'
5518
5327
  }
5519
5328
  },
5520
5329
 
5521
- components: { ElInput: input["default"] },
5522
-
5523
- directives: { Clickoutside: clickoutside["a" /* default */] },
5524
-
5525
5330
  data: function data() {
5526
5331
  return {
5527
5332
  pickerVisible: false,
5333
+ userInput: '',
5528
5334
  showClose: false,
5529
- userInput: null,
5530
- valueOnOpen: null, // value when picker opens, used to determine whether to emit change
5531
- unwatchPickerOptions: null
5335
+ pickerDate: null,
5336
+ selectionMode: 'date',
5337
+ dateRangeSeparator: this.rangeSeparator
5532
5338
  };
5533
5339
  },
5534
5340
 
5535
5341
 
5536
- watch: {
5537
- pickerVisible: function pickerVisible(val) {
5538
- if (this.readonly || this.pickerDisabled) return;
5539
- if (val) {
5540
- this.showPicker();
5541
- this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
5542
- } else {
5543
- this.hidePicker();
5544
- this.emitChange(this.value);
5545
- this.userInput = null;
5546
- if (this.validateEvent) {
5547
- this.dispatch('ElFormItem', 'el.form.blur');
5548
- }
5549
- this.$emit('blur', this);
5550
- this.blur();
5551
- }
5552
- },
5553
-
5554
- parsedValue: {
5555
- immediate: true,
5556
- handler: function handler(val) {
5557
- if (this.picker) {
5558
- this.picker.value = val;
5559
- }
5560
- }
5561
- },
5562
- defaultValue: function defaultValue(val) {
5563
- // NOTE: should eventually move to jsx style picker + panel ?
5564
- if (this.picker) {
5565
- this.picker.defaultValue = val;
5342
+ computed: {
5343
+ actualValue: {
5344
+ get: function get() {
5345
+ return this.modelValue !== undefined ? this.modelValue : this.value;
5346
+ },
5347
+ set: function set(value) {
5348
+ this.$emit('update:modelValue', value);
5349
+ this.$emit('input', value);
5566
5350
  }
5567
5351
  },
5568
- value: function value(val, oldVal) {
5569
- if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
5570
- this.dispatch('ElFormItem', 'el.form.change', val);
5571
- }
5572
- }
5573
- },
5574
-
5575
- computed: {
5576
5352
  ranged: function ranged() {
5577
- return this.type.indexOf('range') > -1;
5353
+ return this.type === 'daterange' || this.type === 'monthrange' || this.type === 'datetimerange' || this.type === 'timerange';
5578
5354
  },
5579
- reference: function reference() {
5580
- var reference = this.$refs.reference;
5581
- return reference.$el || reference;
5355
+ pickerSize: function pickerSize() {
5356
+ return this.size || (this.$ELEMENT || {}).size;
5582
5357
  },
5583
- refInput: function refInput() {
5584
- if (this.reference) {
5585
- return [].slice.call(this.reference.querySelectorAll('input'));
5586
- }
5587
- return [];
5358
+ pickerDisabled: function pickerDisabled() {
5359
+ return this.disabled || (this.elForm || {}).disabled;
5588
5360
  },
5589
- valueIsEmpty: function valueIsEmpty() {
5590
- var val = this.value;
5591
- if (Array.isArray(val)) {
5592
- for (var i = 0, len = val.length; i < len; i++) {
5593
- if (val[i]) {
5594
- return false;
5595
- }
5596
- }
5597
- } else {
5598
- if (val) {
5599
- return false;
5600
- }
5601
- }
5602
- return true;
5361
+ haveTrigger: function haveTrigger() {
5362
+ return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
5603
5363
  },
5604
5364
  triggerClass: function triggerClass() {
5605
- return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
5365
+ return this.pickerVisible ? 'el-icon-d-arrow-down' : 'el-icon-calendar';
5606
5366
  },
5607
- selectionMode: function selectionMode() {
5608
- if (this.type === 'week') {
5609
- return 'week';
5610
- } else if (this.type === 'month') {
5611
- return 'month';
5612
- } else if (this.type === 'year') {
5613
- return 'year';
5614
- } else if (this.type === 'dates') {
5615
- return 'dates';
5616
- } else if (this.type === 'months') {
5617
- return 'months';
5618
- } else if (this.type === 'years') {
5619
- return 'years';
5367
+ elForm: function elForm() {
5368
+ var parent = this.$parent;
5369
+ while (parent) {
5370
+ if (parent.$options.componentName === 'ElForm') {
5371
+ return parent;
5372
+ }
5373
+ parent = parent.$parent;
5620
5374
  }
5621
-
5622
- return 'day';
5375
+ return null;
5623
5376
  },
5624
- haveTrigger: function haveTrigger() {
5625
- if (typeof this.showTrigger !== 'undefined') {
5626
- return this.showTrigger;
5627
- }
5628
- return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
5377
+ displayFormat: function displayFormat() {
5378
+ return this.format || DEFAULT_FORMATS[this.type];
5629
5379
  },
5630
5380
  displayValue: function displayValue() {
5631
- var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
5632
- if (Array.isArray(this.userInput)) {
5633
- return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
5634
- } else if (this.userInput !== null) {
5635
- return this.userInput;
5636
- } else if (formattedValue) {
5637
- return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
5381
+ var value = this.actualValue;
5382
+ if (this.ranged) {
5383
+ if (Array.isArray(value) && value.length === 2) {
5384
+ var start = value[0];
5385
+ var end = value[1];
5386
+ if (Object(date_util["r" /* isDateObject */])(start) && Object(date_util["r" /* isDateObject */])(end)) {
5387
+ return [Object(date_util["f" /* formatDate */])(start, this.displayFormat), Object(date_util["f" /* formatDate */])(end, this.displayFormat)];
5388
+ }
5389
+ }
5390
+ return ['', ''];
5638
5391
  } else {
5639
- return this.ranged ? ['', ''] : '';
5640
- }
5641
- },
5642
- parsedValue: function parsedValue() {
5643
- if (!this.value) return this.value; // component value is not set
5644
- if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
5645
-
5646
- var valueIsDateObject = Object(date_util["r" /* isDateObject */])(this.value) || Array.isArray(this.value) && this.value.every(date_util["r" /* isDateObject */]);
5647
- if (valueIsDateObject) {
5648
- return this.value;
5649
- }
5650
-
5651
- if (this.valueFormat) {
5652
- return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
5392
+ if (Object(date_util["r" /* isDateObject */])(value)) {
5393
+ return Object(date_util["f" /* formatDate */])(value, this.displayFormat);
5394
+ }
5395
+ return '';
5653
5396
  }
5654
-
5655
- // NOTE: deal with common but incorrect usage, should remove in next major version
5656
- // user might provide string / timestamp without value-format, coerce them into date (or array of date)
5657
- return Array.isArray(this.value) ? this.value.map(function (val) {
5658
- return new Date(val);
5659
- }) : new Date(this.value);
5660
5397
  },
5661
- _elFormItemSize: function _elFormItemSize() {
5662
- return (this.elFormItem || {}).elFormItemSize;
5663
- },
5664
- pickerSize: function pickerSize() {
5665
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
5666
- },
5667
- pickerDisabled: function pickerDisabled() {
5668
- return this.disabled || (this.elForm || {}).disabled;
5398
+ clearIcon: function clearIcon() {
5399
+ return 'el-icon-circle-close';
5669
5400
  },
5670
5401
  firstInputId: function firstInputId() {
5671
- var obj = {};
5672
- var id = void 0;
5673
- if (this.ranged) {
5674
- id = this.id && this.id[0];
5675
- } else {
5676
- id = this.id;
5677
- }
5678
- if (id) obj.id = id;
5679
- return obj;
5402
+ return this.name ? { id: 'el-date-picker-' + this.name } : {};
5680
5403
  },
5681
5404
  secondInputId: function secondInputId() {
5682
- var obj = {};
5683
- var id = void 0;
5684
- if (this.ranged) {
5685
- id = this.id && this.id[1];
5686
- }
5687
- if (id) obj.id = id;
5688
- return obj;
5405
+ return this.name && Array.isArray(this.name) ? { id: 'el-date-picker-' + this.name[1] } : {};
5689
5406
  }
5690
5407
  },
5691
5408
 
5692
- created: function created() {
5693
- // vue-popper
5694
- this.popperOptions = {
5695
- boundariesPadding: 0,
5696
- gpuAcceleration: false
5697
- };
5698
- this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
5699
-
5700
- this.$on('fieldReset', this.handleFieldReset);
5701
- },
5702
-
5703
-
5704
- methods: {
5705
- focus: function focus() {
5706
- if (!this.ranged) {
5707
- this.$refs.reference.focus();
5708
- } else {
5709
- this.handleFocus();
5710
- }
5711
- },
5712
- blur: function blur() {
5713
- this.refInput.forEach(function (input) {
5714
- return input.blur();
5715
- });
5716
- },
5717
-
5409
+ watch: {
5410
+ pickerVisible: function pickerVisible(val) {
5411
+ var _this = this;
5718
5412
 
5719
- // {parse, formatTo} Value deals maps component value with internal Date
5720
- parseValue: function parseValue(value) {
5721
- var isParsed = Object(date_util["r" /* isDateObject */])(value) || Array.isArray(value) && value.every(date_util["r" /* isDateObject */]);
5722
- if (this.valueFormat && !isParsed) {
5723
- return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
5413
+ if (val) {
5414
+ this.$emit('visible-change', true);
5415
+ this.$nextTick(function () {
5416
+ _this.updateScrollBar();
5417
+ });
5724
5418
  } else {
5725
- return value;
5419
+ this.$emit('visible-change', false);
5726
5420
  }
5727
5421
  },
5728
- formatToValue: function formatToValue(date) {
5729
- var isFormattable = Object(date_util["r" /* isDateObject */])(date) || Array.isArray(date) && date.every(date_util["r" /* isDateObject */]);
5730
- if (this.valueFormat && isFormattable) {
5731
- return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
5422
+ actualValue: function actualValue(val) {
5423
+ if (this.ranged) {
5424
+ if (Array.isArray(val) && val.length === 2) {
5425
+ this.pickerDate = val[0];
5426
+ }
5732
5427
  } else {
5733
- return date;
5428
+ this.pickerDate = val;
5734
5429
  }
5735
- },
5736
-
5430
+ this.userInput = '';
5431
+ }
5432
+ },
5737
5433
 
5738
- // {parse, formatTo} String deals with user input
5739
- parseString: function parseString(value) {
5740
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
5741
- return parseAsFormatAndType(value, this.format, type);
5742
- },
5743
- formatToString: function formatToString(value) {
5744
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
5745
- return formatAsFormatAndType(value, this.format, type);
5746
- },
5747
- handleMouseEnter: function handleMouseEnter() {
5748
- if (this.readonly || this.pickerDisabled) return;
5749
- if (!this.valueIsEmpty && this.clearable) {
5750
- this.showClose = true;
5751
- }
5434
+ methods: {
5435
+ handleFocus: function handleFocus(e) {
5436
+ if (this.pickerDisabled) return;
5437
+ this.pickerVisible = true;
5438
+ this.$emit('focus', e);
5752
5439
  },
5753
- handleChange: function handleChange() {
5754
- if (this.userInput) {
5755
- var value = this.parseString(this.displayValue);
5756
- if (value) {
5757
- this.picker.value = value;
5758
- if (this.isValidValue(value)) {
5759
- this.emitInput(value);
5760
- this.userInput = null;
5761
- }
5762
- }
5763
- }
5764
- if (this.userInput === '') {
5765
- this.emitInput(null);
5766
- this.emitChange(null);
5767
- this.userInput = null;
5768
- }
5440
+ handleClose: function handleClose() {
5441
+ this.pickerVisible = false;
5442
+ this.showClose = false;
5769
5443
  },
5770
- handleStartInput: function handleStartInput(event) {
5771
- if (this.userInput) {
5772
- this.userInput = [event.target.value, this.userInput[1]];
5773
- } else {
5774
- this.userInput = [event.target.value, null];
5444
+ handleKeydown: function handleKeydown(e) {
5445
+ if (e.keyCode === 27) {
5446
+ this.handleClose();
5775
5447
  }
5776
5448
  },
5777
- handleEndInput: function handleEndInput(event) {
5778
- if (this.userInput) {
5779
- this.userInput = [this.userInput[0], event.target.value];
5449
+ handleClickIcon: function handleClickIcon() {
5450
+ if (this.showClose) {
5451
+ this.handleClear();
5780
5452
  } else {
5781
- this.userInput = [null, event.target.value];
5453
+ this.handleFocus();
5782
5454
  }
5783
5455
  },
5784
- handleStartChange: function handleStartChange(event) {
5785
- var value = this.parseString(this.userInput && this.userInput[0]);
5786
- if (value) {
5787
- this.userInput = [this.formatToString(value), this.displayValue[1]];
5788
- var newValue = [value, this.picker.value && this.picker.value[1]];
5789
- this.picker.value = newValue;
5790
- if (this.isValidValue(newValue)) {
5791
- this.emitInput(newValue);
5792
- this.userInput = null;
5793
- }
5794
- }
5456
+ handleClear: function handleClear() {
5457
+ this.actualValue = this.ranged ? ['', ''] : '';
5458
+ this.showClose = false;
5459
+ this.$emit('clear');
5795
5460
  },
5796
- handleEndChange: function handleEndChange(event) {
5797
- var value = this.parseString(this.userInput && this.userInput[1]);
5798
- if (value) {
5799
- this.userInput = [this.displayValue[0], this.formatToString(value)];
5800
- var newValue = [this.picker.value && this.picker.value[0], value];
5801
- this.picker.value = newValue;
5802
- if (this.isValidValue(newValue)) {
5803
- this.emitInput(newValue);
5804
- this.userInput = null;
5805
- }
5806
- }
5461
+ handleChange: function handleChange(e) {
5462
+ this.$emit('change', e);
5807
5463
  },
5808
- handleClickIcon: function handleClickIcon(event) {
5809
- if (this.readonly || this.pickerDisabled) return;
5810
- if (this.showClose) {
5811
- this.valueOnOpen = this.value;
5812
- event.stopPropagation();
5813
- this.emitInput(null);
5814
- this.emitChange(null);
5815
- this.showClose = false;
5816
- if (this.picker && typeof this.picker.handleClear === 'function') {
5817
- this.picker.handleClear();
5818
- }
5819
- } else {
5820
- this.pickerVisible = !this.pickerVisible;
5821
- }
5464
+ handleStartInput: function handleStartInput(value) {
5465
+ this.userInput = value;
5822
5466
  },
5823
- handleClose: function handleClose() {
5824
- if (!this.pickerVisible) return;
5825
- this.pickerVisible = false;
5826
-
5827
- if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
5828
- // restore to former value
5829
- var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
5830
- this.emitInput(oldValue);
5831
- }
5467
+ handleEndInput: function handleEndInput(value) {
5468
+ this.userInput = value;
5832
5469
  },
5833
- handleFieldReset: function handleFieldReset(initialValue) {
5834
- this.userInput = initialValue === '' ? null : initialValue;
5470
+ handleStartChange: function handleStartChange(value) {
5471
+ this.$emit('change', value);
5835
5472
  },
5836
- handleFocus: function handleFocus() {
5837
- var type = this.type;
5838
-
5839
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
5840
- this.pickerVisible = true;
5841
- }
5842
- this.$emit('focus', this);
5473
+ handleEndChange: function handleEndChange(value) {
5474
+ this.$emit('change', value);
5843
5475
  },
5844
- handleKeydown: function handleKeydown(event) {
5845
- var _this = this;
5846
-
5847
- var keyCode = event.keyCode;
5848
-
5849
- // ESC
5850
- if (keyCode === 27) {
5851
- this.pickerVisible = false;
5852
- event.stopPropagation();
5853
- return;
5854
- }
5855
-
5856
- // Tab
5857
- if (keyCode === 9) {
5858
- if (!this.ranged) {
5859
- this.handleChange();
5860
- this.pickerVisible = this.picker.visible = false;
5861
- this.blur();
5862
- event.stopPropagation();
5863
- } else {
5864
- // user may change focus between two input
5865
- setTimeout(function () {
5866
- if (_this.refInput.indexOf(document.activeElement) === -1) {
5867
- _this.pickerVisible = false;
5868
- _this.blur();
5869
- event.stopPropagation();
5870
- }
5871
- }, 0);
5872
- }
5873
- return;
5874
- }
5875
-
5876
- // Enter
5877
- if (keyCode === 13) {
5878
- if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
5879
- this.handleChange();
5880
- this.pickerVisible = this.picker.visible = false;
5881
- this.blur();
5882
- }
5883
- event.stopPropagation();
5884
- return;
5885
- }
5886
-
5887
- // if user is typing, do not let picker handle key input
5888
- if (this.userInput) {
5889
- event.stopPropagation();
5890
- return;
5891
- }
5892
-
5893
- // delegate other keys to panel
5894
- if (this.picker && this.picker.handleKeydown) {
5895
- this.picker.handleKeydown(event);
5896
- }
5897
- },
5898
- handleRangeClick: function handleRangeClick() {
5899
- var type = this.type;
5900
-
5901
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
5902
- this.pickerVisible = true;
5476
+ handleRangeClick: function handleRangeClick(e) {
5477
+ if (this.pickerDisabled) return;
5478
+ var target = e.target;
5479
+ var isInput = target.tagName === 'INPUT';
5480
+ if (!isInput) {
5481
+ this.pickerVisible = !this.pickerVisible;
5903
5482
  }
5904
- this.$emit('focus', this);
5905
5483
  },
5906
- hidePicker: function hidePicker() {
5907
- if (this.picker) {
5908
- this.picker.resetView && this.picker.resetView();
5909
- this.pickerVisible = this.picker.visible = false;
5910
- this.destroyPopper();
5484
+ handleMouseEnter: function handleMouseEnter() {
5485
+ if (this.actualValue) {
5486
+ this.showClose = true;
5911
5487
  }
5912
5488
  },
5913
- showPicker: function showPicker() {
5489
+ updateScrollBar: function updateScrollBar() {
5914
5490
  var _this2 = this;
5915
5491
 
5916
- if (this.$isServer) return;
5917
- if (!this.picker) {
5918
- this.mountPicker();
5919
- }
5920
- this.pickerVisible = this.picker.visible = true;
5921
-
5922
- this.updatePopper();
5923
-
5924
- this.picker.value = this.parsedValue;
5925
- this.picker.resetView && this.picker.resetView();
5926
-
5927
5492
  this.$nextTick(function () {
5928
- _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
5929
- });
5930
- },
5931
- mountPicker: function mountPicker() {
5932
- var _this3 = this;
5933
-
5934
- this.picker = new external_vue_default.a(this.panel).$mount();
5935
- this.picker.defaultValue = this.defaultValue;
5936
- this.picker.defaultTime = this.defaultTime;
5937
- this.picker.popperClass = this.popperClass;
5938
- this.popperElm = this.picker.$el;
5939
- this.picker.width = this.reference.getBoundingClientRect().width;
5940
- this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
5941
- this.picker.selectionMode = this.selectionMode;
5942
- this.picker.unlinkPanels = this.unlinkPanels;
5943
- this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
5944
- this.$watch('format', function (format) {
5945
- _this3.picker.format = format;
5946
- });
5947
-
5948
- var updateOptions = function updateOptions() {
5949
- var options = _this3.pickerOptions;
5950
-
5951
- if (options && options.selectableRange) {
5952
- var ranges = options.selectableRange;
5953
- var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
5954
- var format = DEFAULT_FORMATS.timerange;
5955
-
5956
- ranges = Array.isArray(ranges) ? ranges : [ranges];
5957
- _this3.picker.selectableRange = ranges.map(function (range) {
5958
- return parser(range, format, _this3.rangeSeparator);
5959
- });
5493
+ var scrollbar = _this2.$refs.reference && _this2.$refs.reference.$el;
5494
+ if (scrollbar) {
5495
+ scrollbar.scrollLeft = 0;
5960
5496
  }
5961
-
5962
- for (var option in options) {
5963
- if (options.hasOwnProperty(option) &&
5964
- // 忽略 time-picker 的该配置项
5965
- option !== 'selectableRange') {
5966
- _this3.picker[option] = options[option];
5967
- }
5968
- }
5969
-
5970
- // main format must prevail over undocumented pickerOptions.format
5971
- if (_this3.format) {
5972
- _this3.picker.format = _this3.format;
5973
- }
5974
- };
5975
- updateOptions();
5976
- this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
5977
- return updateOptions();
5978
- }, { deep: true });
5979
- this.$el.appendChild(this.picker.$el);
5980
- this.picker.resetView && this.picker.resetView();
5981
-
5982
- this.picker.$on('dodestroy', this.doDestroy);
5983
- this.picker.$on('pick', function () {
5984
- var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
5985
- var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5986
-
5987
- _this3.userInput = null;
5988
- _this3.pickerVisible = _this3.picker.visible = visible;
5989
- _this3.emitInput(date);
5990
- _this3.picker.resetView && _this3.picker.resetView();
5991
5497
  });
5992
-
5993
- this.picker.$on('select-range', function (start, end, pos) {
5994
- if (_this3.refInput.length === 0) return;
5995
- if (!pos || pos === 'min') {
5996
- _this3.refInput[0].setSelectionRange(start, end);
5997
- _this3.refInput[0].focus();
5998
- } else if (pos === 'max') {
5999
- _this3.refInput[1].setSelectionRange(start, end);
6000
- _this3.refInput[1].focus();
6001
- }
6002
- });
6003
- },
6004
- unmountPicker: function unmountPicker() {
6005
- if (this.picker) {
6006
- this.picker.$destroy();
6007
- this.picker.$off();
6008
- if (typeof this.unwatchPickerOptions === 'function') {
6009
- this.unwatchPickerOptions();
6010
- }
6011
- this.picker.$el.parentNode.removeChild(this.picker.$el);
6012
- }
6013
- },
6014
- emitChange: function emitChange(val) {
6015
- // determine user real change only
6016
- if (!valueEquals(val, this.valueOnOpen)) {
6017
- this.$emit('change', val);
6018
- this.valueOnOpen = val;
6019
- if (this.validateEvent) {
6020
- this.dispatch('ElFormItem', 'el.form.change', val);
6021
- }
6022
- }
6023
- },
6024
- emitInput: function emitInput(val) {
6025
- var formatted = this.formatToValue(val);
6026
- if (!valueEquals(this.value, formatted)) {
6027
- this.$emit('input', formatted);
6028
- }
6029
- },
6030
- isValidValue: function isValidValue(value) {
6031
- if (!this.picker) {
6032
- this.mountPicker();
6033
- }
6034
- if (this.picker.isValidValue) {
6035
- return value && this.picker.isValidValue(value);
6036
- } else {
6037
- return true;
6038
- }
6039
5498
  }
5499
+ },
5500
+
5501
+ directives: {
5502
+ clickoutside: clickoutside["a" /* default */]
5503
+ },
5504
+
5505
+ components: {
5506
+ ElInput: input["default"]
6040
5507
  }
6041
5508
  });
6042
5509
  // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js
@@ -6113,7 +5580,7 @@ __webpack_require__.r(__webpack_exports__);
6113
5580
  // EXTERNAL MODULE: ./packages/date-picker/src/picker.vue + 4 modules
6114
5581
  var picker = __webpack_require__(41);
6115
5582
 
6116
- // 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-select.vue?vue&type=template&id=288f12fc
5583
+ // 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-select.vue?vue&type=template&id=e0b1ff5a
6117
5584
  var render = function render() {
6118
5585
  var _vm = this,
6119
5586
  _c = _vm._self._c
@@ -6184,7 +5651,7 @@ var staticRenderFns = []
6184
5651
  render._withStripped = true
6185
5652
 
6186
5653
 
6187
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=288f12fc
5654
+ // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=e0b1ff5a
6188
5655
 
6189
5656
  // EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
6190
5657
  var scrollbar = __webpack_require__(25);