vxe-table 3.5.4 → 3.5.6

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.
package/lib/index.umd.js CHANGED
@@ -6021,6 +6021,54 @@ module.exports = function (METHOD_NAME, argument) {
6021
6021
  };
6022
6022
 
6023
6023
 
6024
+ /***/ }),
6025
+
6026
+ /***/ "a79d":
6027
+ /***/ (function(module, exports, __webpack_require__) {
6028
+
6029
+ "use strict";
6030
+
6031
+ var $ = __webpack_require__("23e7");
6032
+ var IS_PURE = __webpack_require__("c430");
6033
+ var NativePromise = __webpack_require__("fea9");
6034
+ var fails = __webpack_require__("d039");
6035
+ var getBuiltIn = __webpack_require__("d066");
6036
+ var isCallable = __webpack_require__("1626");
6037
+ var speciesConstructor = __webpack_require__("4840");
6038
+ var promiseResolve = __webpack_require__("cdf9");
6039
+ var redefine = __webpack_require__("6eeb");
6040
+
6041
+ // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
6042
+ var NON_GENERIC = !!NativePromise && fails(function () {
6043
+ NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
6044
+ });
6045
+
6046
+ // `Promise.prototype.finally` method
6047
+ // https://tc39.es/ecma262/#sec-promise.prototype.finally
6048
+ $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
6049
+ 'finally': function (onFinally) {
6050
+ var C = speciesConstructor(this, getBuiltIn('Promise'));
6051
+ var isFunction = isCallable(onFinally);
6052
+ return this.then(
6053
+ isFunction ? function (x) {
6054
+ return promiseResolve(C, onFinally()).then(function () { return x; });
6055
+ } : onFinally,
6056
+ isFunction ? function (e) {
6057
+ return promiseResolve(C, onFinally()).then(function () { throw e; });
6058
+ } : onFinally
6059
+ );
6060
+ }
6061
+ });
6062
+
6063
+ // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
6064
+ if (!IS_PURE && isCallable(NativePromise)) {
6065
+ var method = getBuiltIn('Promise').prototype['finally'];
6066
+ if (NativePromise.prototype['finally'] !== method) {
6067
+ redefine(NativePromise.prototype, 'finally', method, { unsafe: true });
6068
+ }
6069
+ }
6070
+
6071
+
6024
6072
  /***/ }),
6025
6073
 
6026
6074
  /***/ "a9e3":
@@ -8756,7 +8804,7 @@ var es_array_concat = __webpack_require__("99af");
8756
8804
 
8757
8805
 
8758
8806
  function getLog(message, params) {
8759
- return "[vxe-table v".concat("3.5.4", "] ").concat(conf.i18n(message, params));
8807
+ return "[vxe-table v".concat("3.5.6", "] ").concat(conf.i18n(message, params));
8760
8808
  }
8761
8809
 
8762
8810
  function outLog(type) {
@@ -10025,7 +10073,7 @@ function _t(key, args) {
10025
10073
  var v = 'v3';
10026
10074
  var VXETable = {
10027
10075
  v: v,
10028
- version: "3.5.4",
10076
+ version: "3.5.6",
10029
10077
  reg: reg,
10030
10078
  use: use,
10031
10079
  setup: setup,
@@ -11971,6 +12019,9 @@ var es_string_trim = __webpack_require__("498a");
11971
12019
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
11972
12020
  var es_array_sort = __webpack_require__("4e82");
11973
12021
 
12022
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.finally.js
12023
+ var es_promise_finally = __webpack_require__("a79d");
12024
+
11974
12025
  // CONCATENATED MODULE: ./packages/table/src/cell.js
11975
12026
 
11976
12027
 
@@ -12928,6 +12979,7 @@ var Cell = {
12928
12979
 
12929
12980
 
12930
12981
 
12982
+
12931
12983
 
12932
12984
 
12933
12985
  var methods_setCellValue = utils.setCellValue,
@@ -17985,16 +18037,16 @@ var Methods = {
17985
18037
  row: row,
17986
18038
  rowIndex: _this40.getRowIndex(row),
17987
18039
  $rowIndex: _this40.getVMRowIndex(row)
17988
- }).catch(function (e) {
17989
- return e;
17990
18040
  }).then(function () {
17991
18041
  rest.expandLoaded = true;
18042
+
18043
+ _this40.rowExpandeds.push(row);
18044
+ }).catch(function () {
18045
+ rest.expandLoaded = false;
18046
+ }).finally(function () {
17992
18047
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(_this40.expandLazyLoadeds, function (item) {
17993
18048
  return item === row;
17994
18049
  });
17995
-
17996
- _this40.rowExpandeds.push(row);
17997
-
17998
18050
  resolve(_this40.$nextTick().then(_this40.recalculate));
17999
18051
  });
18000
18052
  });
@@ -18294,9 +18346,8 @@ var Methods = {
18294
18346
  loadMethod({
18295
18347
  $table: _this44,
18296
18348
  row: row
18297
- }).catch(function () {
18298
- return [];
18299
18349
  }).then(function (childRecords) {
18350
+ // 响应成功后则展开行,并将子节点挂载到该节点下
18300
18351
  rest.treeLoaded = true;
18301
18352
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
18302
18353
  return item === row;
@@ -18307,7 +18358,7 @@ var Methods = {
18307
18358
  }
18308
18359
 
18309
18360
  if (childRecords) {
18310
- _this44.loadTreeChildren(row, childRecords).then(function (childRows) {
18361
+ return _this44.loadTreeChildren(row, childRecords).then(function (childRows) {
18311
18362
  if (childRows.length && treeExpandeds.indexOf(row) === -1) {
18312
18363
  treeExpandeds.push(row);
18313
18364
  } // 如果当前节点已选中,则展开后子节点也被选中
@@ -18317,23 +18368,25 @@ var Methods = {
18317
18368
  _this44.setCheckboxRow(childRows, true);
18318
18369
  }
18319
18370
 
18320
- _this44.$nextTick().then(function () {
18371
+ return _this44.$nextTick().then(function () {
18321
18372
  if (transform) {
18322
18373
  return _this44.handleTableData();
18323
18374
  }
18324
- }).then(function () {
18325
- return _this44.recalculate();
18326
- }).then(function () {
18327
- return resolve();
18328
18375
  });
18329
18376
  });
18330
- } else {
18331
- _this44.$nextTick().then(function () {
18332
- return _this44.recalculate();
18333
- }).then(function () {
18334
- return resolve();
18335
- });
18336
18377
  }
18378
+ }).catch(function () {
18379
+ // 如果响应异常,则不展开,再次点击后将重新触发懒加载
18380
+ rest.treeLoaded = false;
18381
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
18382
+ return item === row;
18383
+ });
18384
+ }).finally(function () {
18385
+ _this44.$nextTick().then(function () {
18386
+ return _this44.recalculate();
18387
+ }).then(function () {
18388
+ return resolve();
18389
+ });
18337
18390
  });
18338
18391
  });
18339
18392
  },
@@ -18705,7 +18758,7 @@ var Methods = {
18705
18758
  updateScrollXData: function updateScrollXData() {
18706
18759
  var _this49 = this;
18707
18760
 
18708
- this.tableColumn = [];
18761
+ // this.tableColumn = []
18709
18762
  this.$nextTick(function () {
18710
18763
  _this49.handleTableColumn();
18711
18764
 
@@ -18768,7 +18821,7 @@ var Methods = {
18768
18821
  updateScrollYData: function updateScrollYData() {
18769
18822
  var _this50 = this;
18770
18823
 
18771
- this.tableData = [];
18824
+ // this.tableData = []
18772
18825
  this.$nextTick(function () {
18773
18826
  _this50.handleTableData();
18774
18827
 
@@ -23877,7 +23930,13 @@ function toFloatValueFixed(inputValue, digitsValue) {
23877
23930
 
23878
23931
 
23879
23932
 
23880
- var yearSize = 20;
23933
+
23934
+
23935
+
23936
+
23937
+
23938
+
23939
+ var yearSize = 12;
23881
23940
  var monthSize = 20;
23882
23941
  var quarterSize = 8;
23883
23942
 
@@ -23956,7 +24015,9 @@ function renderDateDayTable(h, _vm) {
23956
24015
  dateValue = _vm.dateValue,
23957
24016
  datePanelValue = _vm.datePanelValue,
23958
24017
  dateHeaders = _vm.dateHeaders,
23959
- dayDatas = _vm.dayDatas;
24018
+ dayDatas = _vm.dayDatas,
24019
+ multiple = _vm.multiple,
24020
+ dateListValue = _vm.dateListValue;
23960
24021
  var matchFormat = 'yyyy-MM-dd';
23961
24022
  return [h('table', {
23962
24023
  class: "vxe-input--date-".concat(datePanelType, "-view"),
@@ -23976,7 +24037,9 @@ function renderDateDayTable(h, _vm) {
23976
24037
  'is--now': item.isNow,
23977
24038
  'is--next': item.isNext,
23978
24039
  'is--disabled': isDateDisabled(_vm, item),
23979
- 'is--selected': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
24040
+ 'is--selected': multiple ? dateListValue.some(function (val) {
24041
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
24042
+ }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
23980
24043
  'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
23981
24044
  },
23982
24045
  on: {
@@ -23997,7 +24060,9 @@ function renderDateWeekTable(h, _vm) {
23997
24060
  dateValue = _vm.dateValue,
23998
24061
  datePanelValue = _vm.datePanelValue,
23999
24062
  weekHeaders = _vm.weekHeaders,
24000
- weekDates = _vm.weekDates;
24063
+ weekDates = _vm.weekDates,
24064
+ multiple = _vm.multiple,
24065
+ dateListValue = _vm.dateListValue;
24001
24066
  var matchFormat = 'yyyyMMdd';
24002
24067
  return [h('table', {
24003
24068
  class: "vxe-input--date-".concat(datePanelType, "-view"),
@@ -24009,7 +24074,11 @@ function renderDateWeekTable(h, _vm) {
24009
24074
  }, [h('thead', [h('tr', weekHeaders.map(function (item) {
24010
24075
  return h('th', item.label);
24011
24076
  }))]), h('tbody', weekDates.map(function (rows) {
24012
- var isSelected = rows.some(function (item) {
24077
+ var isSelected = multiple ? rows.some(function (item) {
24078
+ return dateListValue.some(function (val) {
24079
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
24080
+ });
24081
+ }) : rows.some(function (item) {
24013
24082
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat);
24014
24083
  });
24015
24084
  var isHover = rows.some(function (item) {
@@ -24043,7 +24112,9 @@ function renderDateMonthTable(h, _vm) {
24043
24112
  var dateValue = _vm.dateValue,
24044
24113
  datePanelType = _vm.datePanelType,
24045
24114
  monthDatas = _vm.monthDatas,
24046
- datePanelValue = _vm.datePanelValue;
24115
+ datePanelValue = _vm.datePanelValue,
24116
+ multiple = _vm.multiple,
24117
+ dateListValue = _vm.dateListValue;
24047
24118
  var matchFormat = 'yyyyMM';
24048
24119
  return [h('table', {
24049
24120
  class: "vxe-input--date-".concat(datePanelType, "-view"),
@@ -24061,7 +24132,9 @@ function renderDateMonthTable(h, _vm) {
24061
24132
  'is--now': item.isNow,
24062
24133
  'is--next': item.isNext,
24063
24134
  'is--disabled': isDateDisabled(_vm, item),
24064
- 'is--selected': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
24135
+ 'is--selected': multiple ? dateListValue.some(function (val) {
24136
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
24137
+ }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
24065
24138
  'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
24066
24139
  },
24067
24140
  on: {
@@ -24081,7 +24154,9 @@ function renderDateQuarterTable(h, _vm) {
24081
24154
  var dateValue = _vm.dateValue,
24082
24155
  datePanelType = _vm.datePanelType,
24083
24156
  quarterDatas = _vm.quarterDatas,
24084
- datePanelValue = _vm.datePanelValue;
24157
+ datePanelValue = _vm.datePanelValue,
24158
+ multiple = _vm.multiple,
24159
+ dateListValue = _vm.dateListValue;
24085
24160
  var matchFormat = 'yyyyq';
24086
24161
  return [h('table', {
24087
24162
  class: "vxe-input--date-".concat(datePanelType, "-view"),
@@ -24099,7 +24174,9 @@ function renderDateQuarterTable(h, _vm) {
24099
24174
  'is--now': item.isNow,
24100
24175
  'is--next': item.isNext,
24101
24176
  'is--disabled': isDateDisabled(_vm, item),
24102
- 'is--selected': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
24177
+ 'is--selected': multiple ? dateListValue.some(function (val) {
24178
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
24179
+ }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
24103
24180
  'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
24104
24181
  },
24105
24182
  on: {
@@ -24119,7 +24196,9 @@ function renderDateYearTable(h, _vm) {
24119
24196
  var dateValue = _vm.dateValue,
24120
24197
  datePanelType = _vm.datePanelType,
24121
24198
  yearDatas = _vm.yearDatas,
24122
- datePanelValue = _vm.datePanelValue;
24199
+ datePanelValue = _vm.datePanelValue,
24200
+ multiple = _vm.multiple,
24201
+ dateListValue = _vm.dateListValue;
24123
24202
  var matchFormat = 'yyyy';
24124
24203
  return [h('table', {
24125
24204
  class: "vxe-input--date-".concat(datePanelType, "-view"),
@@ -24132,10 +24211,14 @@ function renderDateYearTable(h, _vm) {
24132
24211
  return h('tr', rows.map(function (item) {
24133
24212
  return h('td', {
24134
24213
  class: {
24135
- 'is--disabled': isDateDisabled(_vm, item),
24214
+ 'is--prev': item.isPrev,
24136
24215
  'is--current': item.isCurrent,
24137
24216
  'is--now': item.isNow,
24138
- 'is--selected': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
24217
+ 'is--next': item.isNext,
24218
+ 'is--disabled': isDateDisabled(item),
24219
+ 'is--selected': multiple ? dateListValue.some(function (val) {
24220
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
24221
+ }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
24139
24222
  'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
24140
24223
  },
24141
24224
  on: {
@@ -24175,7 +24258,9 @@ function renderDatePanel(h, _vm) {
24175
24258
  var datePanelType = _vm.datePanelType,
24176
24259
  selectDatePanelLabel = _vm.selectDatePanelLabel,
24177
24260
  isDisabledPrevDateBtn = _vm.isDisabledPrevDateBtn,
24178
- isDisabledNextDateBtn = _vm.isDisabledNextDateBtn;
24261
+ isDisabledNextDateBtn = _vm.isDisabledNextDateBtn,
24262
+ multiple = _vm.multiple,
24263
+ supportMultiples = _vm.supportMultiples;
24179
24264
  return [h('div', {
24180
24265
  class: 'vxe-input--date-picker-header'
24181
24266
  }, [h('div', {
@@ -24214,7 +24299,17 @@ function renderDatePanel(h, _vm) {
24214
24299
  }
24215
24300
  }, [h('i', {
24216
24301
  class: 'vxe-icon--caret-right'
24217
- })])])]), h('div', {
24302
+ })]), multiple && supportMultiples ? h('span', {
24303
+ class: 'vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn'
24304
+ }, [h('button', {
24305
+ class: 'vxe-input--date-picker-confirm',
24306
+ attrs: {
24307
+ type: 'button'
24308
+ },
24309
+ on: {
24310
+ click: _vm.dateConfirmEvent
24311
+ }
24312
+ }, conf.i18n('vxe.button.confirm'))]) : null])]), h('div', {
24218
24313
  class: 'vxe-input--date-picker-body'
24219
24314
  }, renderDateTable(h, _vm))];
24220
24315
  }
@@ -24511,6 +24606,7 @@ function renderExtraSuffixIcon(h, _vm) {
24511
24606
  return conf.input.size || conf.size;
24512
24607
  }
24513
24608
  },
24609
+ multiple: Boolean,
24514
24610
  // number、integer、float
24515
24611
  min: {
24516
24612
  type: [String, Number],
@@ -24631,9 +24727,9 @@ function renderExtraSuffixIcon(h, _vm) {
24631
24727
  return ['number', 'integer', 'float'].indexOf(this.type) > -1;
24632
24728
  },
24633
24729
  isDatePickerType: function isDatePickerType() {
24634
- return this.hasTime || ['date', 'week', 'month', 'quarter', 'year'].indexOf(this.type) > -1;
24730
+ return this.isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(this.type) > -1;
24635
24731
  },
24636
- hasTime: function hasTime() {
24732
+ isDateTimeType: function isDateTimeType() {
24637
24733
  var type = this.type;
24638
24734
  return type === 'time' || type === 'datetime';
24639
24735
  },
@@ -24687,6 +24783,45 @@ function renderExtraSuffixIcon(h, _vm) {
24687
24783
  dateMaxTime: function dateMaxTime() {
24688
24784
  return this.maxDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(this.maxDate) : null;
24689
24785
  },
24786
+ supportMultiples: function supportMultiples() {
24787
+ return ['date', 'week', 'month', 'quarter', 'year'].includes(this.type);
24788
+ },
24789
+ dateListValue: function dateListValue() {
24790
+ var _this = this;
24791
+
24792
+ var value = this.value,
24793
+ multiple = this.multiple,
24794
+ isDatePickerType = this.isDatePickerType,
24795
+ dateValueFormat = this.dateValueFormat;
24796
+
24797
+ if (multiple && value && isDatePickerType) {
24798
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(value).split(',').map(function (item) {
24799
+ var date = _this.parseDate(item, dateValueFormat);
24800
+
24801
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(date)) {
24802
+ return date;
24803
+ }
24804
+
24805
+ return null;
24806
+ });
24807
+ }
24808
+
24809
+ return [];
24810
+ },
24811
+ dateMultipleValue: function dateMultipleValue() {
24812
+ var dateListValue = this.dateListValue,
24813
+ dateValueFormat = this.dateValueFormat;
24814
+ return dateListValue.map(function (date) {
24815
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
24816
+ });
24817
+ },
24818
+ dateMultipleLabel: function dateMultipleLabel() {
24819
+ var dateListValue = this.dateListValue,
24820
+ dateLabelFormat = this.dateLabelFormat;
24821
+ return dateListValue.map(function (date) {
24822
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateLabelFormat);
24823
+ }).join(', ');
24824
+ },
24690
24825
  dateValue: function dateValue() {
24691
24826
  var value = this.value,
24692
24827
  isDatePickerType = this.isDatePickerType,
@@ -24714,7 +24849,7 @@ function renderExtraSuffixIcon(h, _vm) {
24714
24849
  },
24715
24850
  hmsTime: function hmsTime() {
24716
24851
  var dateValue = this.dateValue;
24717
- return dateValue && this.hasTime ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
24852
+ return dateValue && this.isDateTimeType ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
24718
24853
  },
24719
24854
  dateLabelFormat: function dateLabelFormat() {
24720
24855
  if (this.isDatePickerType) {
@@ -24806,15 +24941,18 @@ function renderExtraSuffixIcon(h, _vm) {
24806
24941
 
24807
24942
  if (selectMonth && currentDate) {
24808
24943
  var currFullYear = currentDate.getFullYear();
24809
- var startYear = new Date(('' + selectMonth.getFullYear()).replace(/\d{1}$/, '0'), 0, 1);
24944
+ var selectFullYear = selectMonth.getFullYear();
24945
+ var startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1);
24810
24946
 
24811
- for (var index = -10; index < yearSize - 10; index++) {
24812
- var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(startYear, index, 'first');
24947
+ for (var index = -4; index < yearSize + 4; index++) {
24948
+ var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(startYearDate, index, 'first');
24813
24949
  var itemFullYear = date.getFullYear();
24814
24950
  months.push({
24815
24951
  date: date,
24816
24952
  isCurrent: true,
24953
+ isPrev: index < 0,
24817
24954
  isNow: currFullYear === itemFullYear,
24955
+ isNext: index >= yearSize,
24818
24956
  year: itemFullYear
24819
24957
  });
24820
24958
  }
@@ -24947,7 +25085,7 @@ function renderExtraSuffixIcon(h, _vm) {
24947
25085
  hourList: function hourList() {
24948
25086
  var list = [];
24949
25087
 
24950
- if (this.hasTime) {
25088
+ if (this.isDateTimeType) {
24951
25089
  for (var index = 0; index < 24; index++) {
24952
25090
  list.push({
24953
25091
  value: index,
@@ -24961,7 +25099,7 @@ function renderExtraSuffixIcon(h, _vm) {
24961
25099
  minuteList: function minuteList() {
24962
25100
  var list = [];
24963
25101
 
24964
- if (this.hasTime) {
25102
+ if (this.isDateTimeType) {
24965
25103
  for (var index = 0; index < 60; index++) {
24966
25104
  list.push({
24967
25105
  value: index,
@@ -25011,8 +25149,9 @@ function renderExtraSuffixIcon(h, _vm) {
25011
25149
  inpReadonly: function inpReadonly() {
25012
25150
  var type = this.type,
25013
25151
  readonly = this.readonly,
25014
- editable = this.editable;
25015
- return readonly || !editable || type === 'week' || type === 'quarter';
25152
+ editable = this.editable,
25153
+ multiple = this.multiple;
25154
+ return readonly || multiple || !editable || type === 'week' || type === 'quarter';
25016
25155
  }
25017
25156
  },
25018
25157
  watch: {
@@ -25036,7 +25175,7 @@ function renderExtraSuffixIcon(h, _vm) {
25036
25175
  dateLabelFormat: function dateLabelFormat() {
25037
25176
  if (this.isDatePickerType) {
25038
25177
  this.dateParseValue(this.datePanelValue);
25039
- this.inputValue = this.datePanelLabel;
25178
+ this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel;
25040
25179
  }
25041
25180
  }
25042
25181
  },
@@ -25369,7 +25508,7 @@ function renderExtraSuffixIcon(h, _vm) {
25369
25508
  changeValue: function changeValue() {
25370
25509
  if (this.isDatePickerType) {
25371
25510
  this.dateParseValue(this.inputValue);
25372
- this.inputValue = this.datePanelLabel;
25511
+ this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel;
25373
25512
  }
25374
25513
  },
25375
25514
  afterCheckValue: function afterCheckValue() {
@@ -25493,21 +25632,21 @@ function renderExtraSuffixIcon(h, _vm) {
25493
25632
  clearTimeout(this.downbumTimeout);
25494
25633
  },
25495
25634
  numberDownPrevEvent: function numberDownPrevEvent(evnt) {
25496
- var _this = this;
25635
+ var _this2 = this;
25497
25636
 
25498
25637
  this.downbumTimeout = setTimeout(function () {
25499
- _this.numberPrevEvent(evnt);
25638
+ _this2.numberPrevEvent(evnt);
25500
25639
 
25501
- _this.numberDownPrevEvent(evnt);
25640
+ _this2.numberDownPrevEvent(evnt);
25502
25641
  }, 60);
25503
25642
  },
25504
25643
  numberDownNextEvent: function numberDownNextEvent(evnt) {
25505
- var _this2 = this;
25644
+ var _this3 = this;
25506
25645
 
25507
25646
  this.downbumTimeout = setTimeout(function () {
25508
- _this2.numberNextEvent(evnt);
25647
+ _this3.numberNextEvent(evnt);
25509
25648
 
25510
- _this2.numberDownNextEvent(evnt);
25649
+ _this3.numberDownNextEvent(evnt);
25511
25650
  }, 60);
25512
25651
  },
25513
25652
  numberKeydownEvent: function numberKeydownEvent(evnt) {
@@ -25526,7 +25665,7 @@ function renderExtraSuffixIcon(h, _vm) {
25526
25665
  }
25527
25666
  },
25528
25667
  numberMousedownEvent: function numberMousedownEvent(evnt) {
25529
- var _this3 = this;
25668
+ var _this4 = this;
25530
25669
 
25531
25670
  this.numberStopDown();
25532
25671
 
@@ -25541,9 +25680,9 @@ function renderExtraSuffixIcon(h, _vm) {
25541
25680
 
25542
25681
  this.downbumTimeout = setTimeout(function () {
25543
25682
  if (isPrevNumber) {
25544
- _this3.numberDownPrevEvent(evnt);
25683
+ _this4.numberDownPrevEvent(evnt);
25545
25684
  } else {
25546
- _this3.numberDownNextEvent(evnt);
25685
+ _this4.numberDownNextEvent(evnt);
25547
25686
  }
25548
25687
  }, 500);
25549
25688
  }
@@ -25655,8 +25794,12 @@ function renderExtraSuffixIcon(h, _vm) {
25655
25794
  },
25656
25795
  dateTodayMonthEvent: function dateTodayMonthEvent(evnt) {
25657
25796
  this.dateNowHandle();
25658
- this.dateChange(this.currentDate);
25659
- this.hidePanel();
25797
+
25798
+ if (!this.multiple) {
25799
+ this.dateChange(this.currentDate);
25800
+ this.hidePanel();
25801
+ }
25802
+
25660
25803
  this.$emit('date-today', {
25661
25804
  type: this.type,
25662
25805
  $event: evnt
@@ -25699,7 +25842,8 @@ function renderExtraSuffixIcon(h, _vm) {
25699
25842
  },
25700
25843
  dateSelectItem: function dateSelectItem(date) {
25701
25844
  var type = this.type,
25702
- datePanelType = this.datePanelType;
25845
+ datePanelType = this.datePanelType,
25846
+ multiple = this.multiple;
25703
25847
  var isWeekType = type === 'week';
25704
25848
 
25705
25849
  if (type === 'month') {
@@ -25708,18 +25852,27 @@ function renderExtraSuffixIcon(h, _vm) {
25708
25852
  this.dateCheckMonth(date);
25709
25853
  } else {
25710
25854
  this.dateChange(date);
25711
- this.hidePanel();
25855
+
25856
+ if (!multiple) {
25857
+ this.hidePanel();
25858
+ }
25712
25859
  }
25713
25860
  } else if (type === 'year') {
25714
- this.hidePanel();
25715
25861
  this.dateChange(date);
25862
+
25863
+ if (!multiple) {
25864
+ this.hidePanel();
25865
+ }
25716
25866
  } else if (type === 'quarter') {
25717
25867
  if (datePanelType === 'year') {
25718
25868
  this.datePanelType = 'quarter';
25719
25869
  this.dateCheckMonth(date);
25720
25870
  } else {
25721
25871
  this.dateChange(date);
25722
- this.hidePanel();
25872
+
25873
+ if (!multiple) {
25874
+ this.hidePanel();
25875
+ }
25723
25876
  }
25724
25877
  } else {
25725
25878
  if (datePanelType === 'month') {
@@ -25730,7 +25883,10 @@ function renderExtraSuffixIcon(h, _vm) {
25730
25883
  this.dateCheckMonth(date);
25731
25884
  } else {
25732
25885
  this.dateChange(date);
25733
- this.hidePanel();
25886
+
25887
+ if (!multiple) {
25888
+ this.hidePanel();
25889
+ }
25734
25890
  }
25735
25891
  }
25736
25892
 
@@ -25961,12 +26117,14 @@ function renderExtraSuffixIcon(h, _vm) {
25961
26117
  var value = this.value,
25962
26118
  datetimePanelValue = this.datetimePanelValue,
25963
26119
  dateValueFormat = this.dateValueFormat,
25964
- firstDayOfWeek = this.firstDayOfWeek;
26120
+ firstDayOfWeek = this.firstDayOfWeek,
26121
+ isDateTimeType = this.isDateTimeType,
26122
+ multiple = this.multiple;
25965
26123
 
25966
26124
  if (this.type === 'week') {
25967
26125
  var sWeek = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.selectDay);
25968
26126
  date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
25969
- } else if (this.hasTime) {
26127
+ } else if (isDateTimeType) {
25970
26128
  date.setHours(datetimePanelValue.getHours());
25971
26129
  date.setMinutes(datetimePanelValue.getMinutes());
25972
26130
  date.setSeconds(datetimePanelValue.getSeconds());
@@ -25977,10 +26135,51 @@ function renderExtraSuffixIcon(h, _vm) {
25977
26135
  });
25978
26136
  this.dateCheckMonth(date);
25979
26137
 
25980
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(value, inpVal)) {
25981
- this.emitModel(inpVal, {
25982
- type: 'update'
25983
- });
26138
+ if (multiple) {
26139
+ // 如果为多选
26140
+ var dateMultipleValue = this.dateMultipleValue;
26141
+
26142
+ if (isDateTimeType) {
26143
+ // 如果是datetime特殊类型
26144
+ var dateListValue = this.dateListValue;
26145
+ var datetimeRest = [];
26146
+ dateListValue.forEach(function (item) {
26147
+ if (item && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(date, item, 'yyyyMMdd')) {
26148
+ item.setHours(datetimePanelValue.getHours());
26149
+ item.setMinutes(datetimePanelValue.getMinutes());
26150
+ item.setSeconds(datetimePanelValue.getSeconds());
26151
+ datetimeRest.push(item);
26152
+ }
26153
+ });
26154
+ datetimeRest.push(date);
26155
+ this.emitModel(datetimeRest.map(function (date) {
26156
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
26157
+ }).join(','), {
26158
+ type: 'update'
26159
+ });
26160
+ } else {
26161
+ // 如果是日期类型
26162
+ if (dateMultipleValue.some(function (val) {
26163
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(val, inpVal);
26164
+ })) {
26165
+ this.emitModel(dateMultipleValue.filter(function (val) {
26166
+ return !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(val, inpVal);
26167
+ }).join(','), {
26168
+ type: 'update'
26169
+ });
26170
+ } else {
26171
+ this.emitModel(dateMultipleValue.concat([inpVal]).join(','), {
26172
+ type: 'update'
26173
+ });
26174
+ }
26175
+ }
26176
+ } else {
26177
+ // 如果为单选
26178
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(value, inpVal)) {
26179
+ this.emitModel(inpVal, {
26180
+ type: 'update'
26181
+ });
26182
+ }
25984
26183
  }
25985
26184
  },
25986
26185
  dateCheckMonth: function dateCheckMonth(date) {
@@ -25991,7 +26190,7 @@ function renderExtraSuffixIcon(h, _vm) {
25991
26190
  }
25992
26191
  },
25993
26192
  dateOpenPanel: function dateOpenPanel() {
25994
- var _this4 = this;
26193
+ var _this5 = this;
25995
26194
 
25996
26195
  var type = this.type,
25997
26196
  dateValue = this.dateValue;
@@ -26011,15 +26210,15 @@ function renderExtraSuffixIcon(h, _vm) {
26011
26210
  this.dateNowHandle();
26012
26211
  }
26013
26212
 
26014
- if (this.hasTime) {
26213
+ if (this.isDateTimeType) {
26015
26214
  this.datetimePanelValue = this.datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
26016
26215
  this.$nextTick(function () {
26017
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(_this4.$refs.timeBody.querySelectorAll('li.is--selected'), _this4.updateTimePos);
26216
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(_this5.$refs.timeBody.querySelectorAll('li.is--selected'), _this5.updateTimePos);
26018
26217
  });
26019
26218
  }
26020
26219
  },
26021
26220
  dateRevert: function dateRevert() {
26022
- this.inputValue = this.datePanelLabel;
26221
+ this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel;
26023
26222
  },
26024
26223
  // 日期
26025
26224
  // 弹出面板
@@ -26029,7 +26228,7 @@ function renderExtraSuffixIcon(h, _vm) {
26029
26228
  }
26030
26229
  },
26031
26230
  showPanel: function showPanel() {
26032
- var _this5 = this;
26231
+ var _this6 = this;
26033
26232
 
26034
26233
  var disabled = this.disabled,
26035
26234
  visiblePanel = this.visiblePanel,
@@ -26045,28 +26244,33 @@ function renderExtraSuffixIcon(h, _vm) {
26045
26244
  }
26046
26245
 
26047
26246
  setTimeout(function () {
26048
- _this5.visiblePanel = true;
26247
+ _this6.visiblePanel = true;
26049
26248
  }, 10);
26050
26249
  this.updateZindex();
26051
- this.updatePlacement();
26250
+ return this.updatePlacement();
26052
26251
  }
26252
+
26253
+ return this.$nextTick();
26053
26254
  },
26054
26255
  hidePanel: function hidePanel() {
26055
- var _this6 = this;
26256
+ var _this7 = this;
26056
26257
 
26057
- this.visiblePanel = false;
26058
- this.hidePanelTimeout = setTimeout(function () {
26059
- _this6.animatVisible = false;
26060
- }, 350);
26258
+ return new Promise(function (resolve) {
26259
+ _this7.visiblePanel = false;
26260
+ _this7.hidePanelTimeout = setTimeout(function () {
26261
+ _this7.animatVisible = false;
26262
+ resolve();
26263
+ }, 350);
26264
+ });
26061
26265
  },
26062
26266
  updatePlacement: function updatePlacement() {
26063
- var _this7 = this;
26267
+ var _this8 = this;
26064
26268
 
26065
26269
  return this.$nextTick().then(function () {
26066
- var $refs = _this7.$refs,
26067
- transfer = _this7.transfer,
26068
- placement = _this7.placement,
26069
- panelIndex = _this7.panelIndex;
26270
+ var $refs = _this8.$refs,
26271
+ transfer = _this8.transfer,
26272
+ placement = _this8.placement,
26273
+ panelIndex = _this8.panelIndex;
26070
26274
  var targetElem = $refs.input;
26071
26275
  var panelElem = $refs.panel;
26072
26276
 
@@ -26140,9 +26344,9 @@ function renderExtraSuffixIcon(h, _vm) {
26140
26344
  }
26141
26345
  }
26142
26346
 
26143
- _this7.panelStyle = panelStyle;
26144
- _this7.panelPlacement = panelPlacement;
26145
- return _this7.$nextTick();
26347
+ _this8.panelStyle = panelStyle;
26348
+ _this8.panelPlacement = panelPlacement;
26349
+ return _this8.$nextTick();
26146
26350
  }
26147
26351
  });
26148
26352
  },
@@ -35924,32 +36128,35 @@ function tooltip_renderContent(h, _vm) {
35924
36128
  content = this.content,
35925
36129
  value = this.value;
35926
36130
  var parentNode = $el.parentNode;
35927
- var target;
35928
- this.tipContent = content;
35929
- this.tipZindex = utils.nextZIndex();
35930
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.children, function (elem, index) {
35931
- if (index > 1) {
35932
- parentNode.insertBefore(elem, $el);
35933
36131
 
35934
- if (!target) {
35935
- target = elem;
36132
+ if (parentNode) {
36133
+ var target;
36134
+ this.tipContent = content;
36135
+ this.tipZindex = utils.nextZIndex();
36136
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.children, function (elem, index) {
36137
+ if (index > 1) {
36138
+ parentNode.insertBefore(elem, $el);
36139
+
36140
+ if (!target) {
36141
+ target = elem;
36142
+ }
35936
36143
  }
35937
- }
35938
- });
35939
- parentNode.removeChild($el);
35940
- this.target = target;
36144
+ });
36145
+ parentNode.removeChild($el);
36146
+ this.target = target;
35941
36147
 
35942
- if (target) {
35943
- if (trigger === 'hover') {
35944
- target.onmouseleave = this.targetMouseleaveEvent;
35945
- target.onmouseenter = this.targetMouseenterEvent;
35946
- } else if (trigger === 'click') {
35947
- target.onclick = this.clickEvent;
36148
+ if (target) {
36149
+ if (trigger === 'hover') {
36150
+ target.onmouseleave = this.targetMouseleaveEvent;
36151
+ target.onmouseenter = this.targetMouseenterEvent;
36152
+ } else if (trigger === 'click') {
36153
+ target.onclick = this.clickEvent;
36154
+ }
35948
36155
  }
35949
- }
35950
36156
 
35951
- if (value) {
35952
- this.open();
36157
+ if (value) {
36158
+ this.open();
36159
+ }
35953
36160
  }
35954
36161
  },
35955
36162
  beforeDestroy: function beforeDestroy() {
@@ -36773,7 +36980,12 @@ function renderItems(h, _vm, itemList) {
36773
36980
  $form: _this3,
36774
36981
  $event: evnt
36775
36982
  });
36776
- } else {}
36983
+ } else {
36984
+ _this3.$emit('submit', {
36985
+ data: _this3.data,
36986
+ $event: evnt
36987
+ });
36988
+ }
36777
36989
  });
36778
36990
  }
36779
36991
  },