vxe-table 3.4.12-beta.0 → 3.4.13

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 (49) hide show
  1. package/README.en.md +3 -1
  2. package/README.md +3 -1
  3. package/README.zh-TW.md +3 -1
  4. package/lib/edit/src/mixin.js +39 -13
  5. package/lib/edit/src/mixin.min.js +1 -1
  6. package/lib/export/src/mixin.js +15 -10
  7. package/lib/export/src/mixin.min.js +1 -1
  8. package/lib/footer/src/footer.js +11 -0
  9. package/lib/footer/src/footer.min.js +1 -1
  10. package/lib/form/src/form.js +2 -1
  11. package/lib/form/src/form.min.js +1 -1
  12. package/lib/grid/src/grid.js +5 -2
  13. package/lib/grid/src/grid.min.js +1 -1
  14. package/lib/header/src/header.js +12 -0
  15. package/lib/header/src/header.min.js +1 -1
  16. package/lib/index.css +1 -1
  17. package/lib/index.umd.js +229 -78
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/input/src/input.js +62 -39
  20. package/lib/input/src/input.min.js +1 -1
  21. package/lib/modal/src/modal.js +1 -1
  22. package/lib/modal/src/modal.min.js +1 -1
  23. package/lib/pulldown/src/pulldown.js +13 -0
  24. package/lib/pulldown/src/pulldown.min.js +1 -1
  25. package/lib/style.css +1 -1
  26. package/lib/style.min.css +1 -1
  27. package/lib/table/src/body.js +24 -5
  28. package/lib/table/src/body.min.js +1 -1
  29. package/lib/table/src/methods.js +48 -9
  30. package/lib/table/src/methods.min.js +1 -1
  31. package/lib/tools/src/utils.js +1 -0
  32. package/lib/tools/src/utils.min.js +1 -1
  33. package/package.json +4 -4
  34. package/packages/edit/src/mixin.js +20 -11
  35. package/packages/export/src/mixin.js +16 -9
  36. package/packages/footer/src/footer.js +10 -0
  37. package/packages/form/src/form.js +2 -1
  38. package/packages/grid/src/grid.js +3 -2
  39. package/packages/header/src/header.js +11 -0
  40. package/packages/input/src/input.js +46 -34
  41. package/packages/modal/src/modal.js +1 -1
  42. package/packages/pulldown/src/pulldown.js +12 -0
  43. package/packages/table/src/body.js +41 -7
  44. package/packages/table/src/methods.js +28 -9
  45. package/packages/tools/src/utils.js +1 -0
  46. package/styles/button.scss +4 -4
  47. package/styles/modal.scss +14 -13
  48. package/styles/table.scss +4 -4
  49. package/styles/variable.scss +8 -0
package/lib/index.umd.js CHANGED
@@ -8931,6 +8931,7 @@ var utils_ColumnInfo = /*#__PURE__*/function () {
8931
8931
  // 基本属性
8932
8932
  type: _vm.type,
8933
8933
  property: _vm.field,
8934
+ field: _vm.field,
8934
8935
  title: _vm.title,
8935
8936
  width: _vm.width,
8936
8937
  minWidth: _vm.minWidth,
@@ -9801,14 +9802,14 @@ function getChangeEvent(renderOpts) {
9801
9802
  return 'change';
9802
9803
  }
9803
9804
 
9804
- function parseDate(value, props) {
9805
+ function renderer_parseDate(value, props) {
9805
9806
  return value && props.valueFormat ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, props.valueFormat) : value;
9806
9807
  }
9807
9808
 
9808
9809
  function getFormatDate(value, props, defaultFormat) {
9809
9810
  var _props$dateConfig = props.dateConfig,
9810
9811
  dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
9811
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
9812
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(renderer_parseDate(value, props), dateConfig.labelFormat || defaultFormat);
9812
9813
  }
9813
9814
 
9814
9815
  function getLabelFormatDate(value, props) {
@@ -11496,6 +11497,19 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11496
11497
  this.$el._onscroll = null;
11497
11498
  this.$el.onscroll = null;
11498
11499
  },
11500
+ destroyed: function destroyed() {
11501
+ var $xetable = this.$parent,
11502
+ fixedType = this.fixedType;
11503
+ var elemStore = $xetable.elemStore;
11504
+ var prefix = "".concat(fixedType || 'main', "-body-");
11505
+ elemStore["".concat(prefix, "wrapper")] = null;
11506
+ elemStore["".concat(prefix, "table")] = null;
11507
+ elemStore["".concat(prefix, "colgroup")] = null;
11508
+ elemStore["".concat(prefix, "list")] = null;
11509
+ elemStore["".concat(prefix, "xSpace")] = null;
11510
+ elemStore["".concat(prefix, "ySpace")] = null;
11511
+ elemStore["".concat(prefix, "emptyBlock")] = null;
11512
+ },
11499
11513
  render: function render(h) {
11500
11514
  var _e = this._e,
11501
11515
  $xetable = this.$parent,
@@ -11662,8 +11676,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11662
11676
  var rightElem = rightBody ? rightBody.$el : null;
11663
11677
  var bodyYElem = elemStore['main-body-ySpace'];
11664
11678
  var bodyXElem = elemStore['main-body-xSpace'];
11665
- var bodyHeight = bodyYElem ? bodyYElem.clientHeight : 0;
11666
- var bodyWidth = bodyXElem ? bodyXElem.clientWidth : 0;
11679
+ var bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
11680
+ var bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
11667
11681
  var scrollTop = scrollBodyElem.scrollTop;
11668
11682
  var scrollLeft = bodyElem.scrollLeft;
11669
11683
  var isRollX = scrollLeft !== lastScrollLeft;
@@ -11719,6 +11733,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11719
11733
  fixed: fixedType,
11720
11734
  scrollTop: scrollTop,
11721
11735
  scrollLeft: scrollLeft,
11736
+ scrollHeight: bodyElem.scrollHeight,
11737
+ scrollWidth: bodyElem.scrollWidth,
11722
11738
  bodyHeight: bodyHeight,
11723
11739
  bodyWidth: bodyWidth,
11724
11740
  isX: isRollX,
@@ -11730,7 +11746,9 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11730
11746
 
11731
11747
  var $xetable = this.$parent;
11732
11748
  var $refs = $xetable.$refs,
11733
- elemStore = $xetable.elemStore;
11749
+ elemStore = $xetable.elemStore,
11750
+ scrollYLoad = $xetable.scrollYLoad,
11751
+ scrollXLoad = $xetable.scrollXLoad;
11734
11752
  var tableBody = $refs.tableBody,
11735
11753
  leftBody = $refs.leftBody,
11736
11754
  rightBody = $refs.rightBody;
@@ -11740,8 +11758,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11740
11758
  var remainSize = this.isPrevWheelTop === isTopWheel ? Math.max(0, this.wheelYSize - this.wheelYTotal) : 0;
11741
11759
  var bodyYElem = elemStore['main-body-ySpace'];
11742
11760
  var bodyXElem = elemStore['main-body-xSpace'];
11743
- var bodyHeight = bodyYElem ? bodyYElem.clientHeight : 0;
11744
- var bodyWidth = bodyXElem ? bodyXElem.clientWidth : 0;
11761
+ var bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
11762
+ var bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
11745
11763
  this.isPrevWheelTop = isTopWheel;
11746
11764
  this.wheelYSize = Math.abs(isTopWheel ? deltaTop - remainSize : deltaTop + remainSize);
11747
11765
  this.wheelYInterval = 0;
@@ -11787,6 +11805,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11787
11805
  fixed: fixedType,
11788
11806
  scrollTop: bodyElem.scrollTop,
11789
11807
  scrollLeft: bodyElem.scrollLeft,
11808
+ scrollHeight: bodyElem.scrollHeight,
11809
+ scrollWidth: bodyElem.scrollWidth,
11790
11810
  bodyHeight: bodyHeight,
11791
11811
  bodyWidth: bodyWidth,
11792
11812
  isX: isRollX,
@@ -14227,16 +14247,23 @@ var Methods = {
14227
14247
  afterFullData = this.afterFullData,
14228
14248
  treeConfig = this.treeConfig,
14229
14249
  treeOpts = this.treeOpts,
14230
- checkboxOpts = this.checkboxOpts;
14250
+ checkboxOpts = this.checkboxOpts,
14251
+ tableFullTreeData = this.tableFullTreeData,
14252
+ afterTreeFullData = this.afterTreeFullData;
14253
+ var transform = treeOpts.transform,
14254
+ children = treeOpts.children,
14255
+ mapChildren = treeOpts.mapChildren;
14231
14256
  var property = checkboxOpts.checkField;
14232
- var currTableData = isFull ? tableFullData : afterFullData;
14257
+ var currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
14233
14258
  var rowList = [];
14234
14259
 
14235
14260
  if (property) {
14236
14261
  if (treeConfig) {
14237
14262
  rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(currTableData, function (row) {
14238
14263
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
14239
- }, treeOpts);
14264
+ }, {
14265
+ children: transform ? mapChildren : children
14266
+ });
14240
14267
  } else {
14241
14268
  rowList = currTableData.filter(function (row) {
14242
14269
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
@@ -14248,7 +14275,9 @@ var Methods = {
14248
14275
  if (treeConfig) {
14249
14276
  rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(currTableData, function (row) {
14250
14277
  return selection.indexOf(row) > -1;
14251
- }, treeOpts);
14278
+ }, {
14279
+ children: transform ? mapChildren : children
14280
+ });
14252
14281
  } else {
14253
14282
  rowList = currTableData.filter(function (row) {
14254
14283
  return selection.indexOf(row) > -1;
@@ -14314,7 +14343,8 @@ var Methods = {
14314
14343
  var filterColumns = [];
14315
14344
  var orderColumns = [];
14316
14345
  tableFullColumn.forEach(function (column) {
14317
- var sortable = column.sortable,
14346
+ var property = column.property,
14347
+ sortable = column.sortable,
14318
14348
  order = column.order,
14319
14349
  filters = column.filters;
14320
14350
 
@@ -14340,7 +14370,8 @@ var Methods = {
14340
14370
  if (!allRemoteSort && sortable && order) {
14341
14371
  orderColumns.push({
14342
14372
  column: column,
14343
- property: column.property,
14373
+ field: column.property,
14374
+ property: property,
14344
14375
  order: order
14345
14376
  });
14346
14377
  }
@@ -14575,6 +14606,30 @@ var Methods = {
14575
14606
  }
14576
14607
  },
14577
14608
 
14609
+ /**
14610
+ * 只对 tree-config 有效,获取行的父级
14611
+ */
14612
+ getParentRow: function getParentRow(rowOrRowid) {
14613
+ var treeConfig = this.treeConfig,
14614
+ fullDataRowIdData = this.fullDataRowIdData;
14615
+
14616
+ if (rowOrRowid && treeConfig) {
14617
+ var rowid;
14618
+
14619
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(rowOrRowid)) {
14620
+ rowid = rowOrRowid;
14621
+ } else {
14622
+ rowid = methods_getRowid(this, rowOrRowid);
14623
+ }
14624
+
14625
+ if (rowid) {
14626
+ return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].parent : null;
14627
+ }
14628
+ }
14629
+
14630
+ return null;
14631
+ },
14632
+
14578
14633
  /**
14579
14634
  * 根据行的唯一主键获取行
14580
14635
  * @param {String/Number} rowid 行主键
@@ -16032,7 +16087,9 @@ var Methods = {
16032
16087
  // 如果是按下非功能键之外允许直接编辑
16033
16088
 
16034
16089
  if (selected.column && selected.row && isEnableConf(selected.column.editRender)) {
16035
- if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
16090
+ if (!editOpts.activeMethod || editOpts.activeMethod(_objectSpread2(_objectSpread2({}, selected.args), {}, {
16091
+ $table: _this26
16092
+ }))) {
16036
16093
  if (editMethod) {
16037
16094
  editMethod({
16038
16095
  row: selected.row,
@@ -17633,12 +17690,14 @@ var Methods = {
17633
17690
  getSortColumns: function getSortColumns() {
17634
17691
  var sortList = [];
17635
17692
  this.tableFullColumn.forEach(function (column) {
17636
- var order = column.order;
17693
+ var property = column.property,
17694
+ order = column.order;
17637
17695
 
17638
17696
  if ((column.sortable || column.remoteSort) && order) {
17639
17697
  sortList.push({
17640
17698
  column: column,
17641
- property: column.property,
17699
+ field: column.property,
17700
+ property: property,
17642
17701
  order: order
17643
17702
  });
17644
17703
  }
@@ -21436,6 +21495,7 @@ var Menu = {
21436
21495
 
21437
21496
 
21438
21497
 
21498
+
21439
21499
  var mixin_getRowid = UtilTools.getRowid;
21440
21500
 
21441
21501
  function insertTreeRow(_vm, newRecords, isAppend) {
@@ -21444,22 +21504,28 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21444
21504
  fullDataRowIdData = _vm.fullDataRowIdData,
21445
21505
  fullAllDataRowIdData = _vm.fullAllDataRowIdData,
21446
21506
  treeOpts = _vm.treeOpts;
21507
+ var rowField = treeOpts.rowField,
21508
+ parentField = treeOpts.parentField,
21509
+ children = treeOpts.children,
21510
+ mapChildren = treeOpts.mapChildren;
21447
21511
  var funcName = isAppend ? 'push' : 'unshift';
21448
21512
  newRecords.forEach(function (item) {
21449
- var parentRowId = item[treeOpts.parentField];
21513
+ var parentRowId = item[parentField];
21450
21514
  var rowid = mixin_getRowid(_vm, item);
21451
21515
  var matchObj = parentRowId ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
21452
- return parentRowId === item[treeOpts.rowField];
21453
- }, treeOpts) : null;
21516
+ return parentRowId === item[rowField];
21517
+ }, {
21518
+ children: mapChildren
21519
+ }) : null;
21454
21520
 
21455
21521
  if (matchObj) {
21456
21522
  var parentRow = matchObj.item;
21457
21523
  var parentRest = fullAllDataRowIdData[mixin_getRowid(_vm, parentRow)];
21458
21524
  var parentLevel = parentRest ? parentRest.level : 0;
21459
- var parentChilds = parentRow[treeOpts.children];
21525
+ var parentChilds = parentRow[children];
21460
21526
 
21461
21527
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(parentChilds)) {
21462
- parentChilds = parentRow[treeOpts.children] = [];
21528
+ parentChilds = parentRow[children] = [];
21463
21529
  }
21464
21530
 
21465
21531
  parentChilds[funcName](item);
@@ -21530,7 +21596,9 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21530
21596
  fullDataRowIdData = this.fullDataRowIdData,
21531
21597
  fullAllDataRowIdData = this.fullAllDataRowIdData,
21532
21598
  treeOpts = this.treeOpts;
21533
- var transform = treeOpts.transform;
21599
+ var transform = treeOpts.transform,
21600
+ rowField = treeOpts.rowField,
21601
+ mapChildren = treeOpts.mapChildren;
21534
21602
 
21535
21603
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(records)) {
21536
21604
  records = [records];
@@ -21578,8 +21646,10 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21578
21646
  // 如果为虚拟树
21579
21647
  if (treeConfig && transform) {
21580
21648
  var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
21581
- return row[treeOpts.rowField] === item[treeOpts.rowField];
21582
- }, treeOpts);
21649
+ return row[rowField] === item[rowField];
21650
+ }, {
21651
+ children: mapChildren
21652
+ });
21583
21653
 
21584
21654
  if (matchObj) {
21585
21655
  var parentRow = matchObj.parent;
@@ -21592,7 +21662,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21592
21662
  if (false) {}
21593
21663
 
21594
21664
  if (parentRow) {
21595
- item[treeOpts.parentField] = parentRow[treeOpts.rowField];
21665
+ item[treeOpts.parentField] = parentRow[rowField];
21596
21666
  }
21597
21667
 
21598
21668
  parentChilds.splice(matchObj.index + i, 0, item);
@@ -21620,7 +21690,15 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21620
21690
  throw new Error(UtilTools.getLog('vxe.error.noTree', ['insert']));
21621
21691
  }
21622
21692
 
21623
- var afIndex = afterFullData.indexOf(row);
21693
+ var afIndex = -1; // 如果是可视索引
21694
+
21695
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
21696
+ if (row < afterFullData.length) {
21697
+ afIndex = row;
21698
+ }
21699
+ } else {
21700
+ afIndex = afterFullData.indexOf(row);
21701
+ }
21624
21702
 
21625
21703
  if (afIndex === -1) {
21626
21704
  throw new Error(UtilTools.error('vxe.error.unableInsert'));
@@ -21971,7 +22049,9 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21971
22049
  // 判断是否禁用编辑
21972
22050
  var type = 'edit-disabled';
21973
22051
 
21974
- if (!activeMethod || activeMethod(params)) {
22052
+ if (!activeMethod || activeMethod(_objectSpread2(_objectSpread2({}, params), {}, {
22053
+ $table: this
22054
+ }))) {
21975
22055
  if (mouseConfig) {
21976
22056
  this.clearSelected(evnt);
21977
22057
  this.clearCellAreas(evnt);
@@ -23154,7 +23234,7 @@ var msgQueue = [];
23154
23234
 
23155
23235
  return this.$nextTick().then(function () {
23156
23236
  if (!_this7.zoomLocat) {
23157
- var marginSize = _this7.marginSize;
23237
+ var marginSize = Math.max(0, _this7.marginSize);
23158
23238
 
23159
23239
  var modalBoxElem = _this7.getBox();
23160
23240
 
@@ -24495,18 +24575,11 @@ function renderExtraSuffixIcon(h, _vm) {
24495
24575
  dateValue: function dateValue() {
24496
24576
  var value = this.value,
24497
24577
  isDatePickerType = this.isDatePickerType,
24498
- type = this.type,
24499
24578
  dateValueFormat = this.dateValueFormat;
24500
24579
  var val = null;
24501
24580
 
24502
24581
  if (value && isDatePickerType) {
24503
- var date;
24504
-
24505
- if (type === 'time') {
24506
- date = toStringTimeDate(value);
24507
- } else {
24508
- date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, dateValueFormat);
24509
- }
24582
+ var date = this.parseDate(value, dateValueFormat);
24510
24583
 
24511
24584
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(date)) {
24512
24585
  val = date;
@@ -24565,13 +24638,16 @@ function renderExtraSuffixIcon(h, _vm) {
24565
24638
 
24566
24639
  return '';
24567
24640
  },
24641
+ firstDayOfWeek: function firstDayOfWeek() {
24642
+ var startDay = this.startDay,
24643
+ startWeek = this.startWeek;
24644
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(startDay) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(startDay) ? startDay : startWeek);
24645
+ },
24568
24646
  weekDatas: function weekDatas() {
24569
24647
  var weeks = [];
24570
24648
 
24571
24649
  if (this.isDatePickerType) {
24572
- var startDay = this.startDay,
24573
- startWeek = this.startWeek;
24574
- var sWeek = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(startDay) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(startDay) ? startDay : startWeek);
24650
+ var sWeek = this.firstDayOfWeek;
24575
24651
  weeks.push(sWeek);
24576
24652
 
24577
24653
  for (var index = 0; index < 6; index++) {
@@ -24737,7 +24813,9 @@ function renderExtraSuffixIcon(h, _vm) {
24737
24813
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.dayList, 7);
24738
24814
  },
24739
24815
  weekDates: function weekDates() {
24740
- return this.dayDatas.map(function (list) {
24816
+ var dayDatas = this.dayDatas,
24817
+ firstDayOfWeek = this.firstDayOfWeek;
24818
+ return dayDatas.map(function (list) {
24741
24819
  var firstItem = list[0];
24742
24820
  var item = {
24743
24821
  date: firstItem.date,
@@ -24746,7 +24824,7 @@ function renderExtraSuffixIcon(h, _vm) {
24746
24824
  isCurrent: false,
24747
24825
  isNow: false,
24748
24826
  isNext: false,
24749
- label: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getYearWeek(firstItem.date)
24827
+ label: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getYearWeek(firstItem.date, firstDayOfWeek)
24750
24828
  };
24751
24829
  return [item].concat(list);
24752
24830
  });
@@ -24841,8 +24919,10 @@ function renderExtraSuffixIcon(h, _vm) {
24841
24919
  this.initValue();
24842
24920
  },
24843
24921
  dateLabelFormat: function dateLabelFormat() {
24844
- this.dateParseValue(this.datePanelValue);
24845
- this.inputValue = this.datePanelLabel;
24922
+ if (this.isDatePickerType) {
24923
+ this.dateParseValue(this.datePanelValue);
24924
+ this.inputValue = this.datePanelLabel;
24925
+ }
24846
24926
  }
24847
24927
  },
24848
24928
  created: function created() {
@@ -25134,6 +25214,15 @@ function renderExtraSuffixIcon(h, _vm) {
25134
25214
  $event: evnt
25135
25215
  });
25136
25216
  },
25217
+ parseDate: function parseDate(value, format) {
25218
+ var type = this.type;
25219
+
25220
+ if (type === 'time') {
25221
+ return toStringTimeDate(value);
25222
+ }
25223
+
25224
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, format);
25225
+ },
25137
25226
 
25138
25227
  /**
25139
25228
  * 检查初始值
@@ -25178,7 +25267,8 @@ function renderExtraSuffixIcon(h, _vm) {
25178
25267
  datetimePanelValue = this.datetimePanelValue,
25179
25268
  dateLabelFormat = this.dateLabelFormat,
25180
25269
  min = this.min,
25181
- max = this.max;
25270
+ max = this.max,
25271
+ firstDayOfWeek = this.firstDayOfWeek;
25182
25272
 
25183
25273
  if (!inpReadonly) {
25184
25274
  if (isNumType) {
@@ -25207,13 +25297,7 @@ function renderExtraSuffixIcon(h, _vm) {
25207
25297
  if (inputValue) {
25208
25298
  if (type === 'week' || type === 'quarter') {// 周和季度选择器不支持解析,无需处理
25209
25299
  } else {
25210
- var inpDateVal;
25211
-
25212
- if (type === 'time') {
25213
- inpDateVal = toStringTimeDate(inputValue);
25214
- } else {
25215
- inpDateVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(inputValue, dateLabelFormat);
25216
- }
25300
+ var inpDateVal = this.parseDate(inputValue, dateLabelFormat);
25217
25301
 
25218
25302
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(inpDateVal)) {
25219
25303
  if (type === 'time') {
@@ -25240,7 +25324,9 @@ function renderExtraSuffixIcon(h, _vm) {
25240
25324
  isChange = true;
25241
25325
  }
25242
25326
 
25243
- this.inputValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(inpDateVal, dateLabelFormat);
25327
+ this.inputValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(inpDateVal, dateLabelFormat, {
25328
+ firstDay: firstDayOfWeek
25329
+ });
25244
25330
 
25245
25331
  if (isChange) {
25246
25332
  this.dateChange(inpDateVal);
@@ -25633,20 +25719,35 @@ function renderExtraSuffixIcon(h, _vm) {
25633
25719
  dateParseValue: function dateParseValue(date) {
25634
25720
  var type = this.type,
25635
25721
  dateLabelFormat = this.dateLabelFormat,
25636
- valueFormat = this.valueFormat;
25722
+ valueFormat = this.valueFormat,
25723
+ firstDayOfWeek = this.firstDayOfWeek;
25637
25724
  var dValue = null;
25638
25725
  var dLabel = '';
25639
25726
 
25640
25727
  if (date) {
25641
- if (type === 'time') {
25642
- dValue = toStringTimeDate(date);
25643
- } else {
25644
- dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(date, valueFormat);
25645
- }
25728
+ dValue = this.parseDate(date, valueFormat);
25646
25729
  }
25647
25730
 
25648
25731
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(dValue)) {
25649
- dLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(dValue, dateLabelFormat);
25732
+ dLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(dValue, dateLabelFormat, {
25733
+ firstDay: firstDayOfWeek
25734
+ }); // 由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年
25735
+
25736
+ if (dateLabelFormat && type === 'week') {
25737
+ var firstWeekDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(dValue, 0, firstDayOfWeek, firstDayOfWeek);
25738
+
25739
+ if (firstWeekDate.getFullYear() < dValue.getFullYear()) {
25740
+ var yyIndex = dateLabelFormat.indexOf('yyyy');
25741
+
25742
+ if (yyIndex > -1) {
25743
+ var yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
25744
+
25745
+ if (yyNum && !isNaN(yyNum)) {
25746
+ dLabel = dLabel.replace("".concat(yyNum), "".concat(yyNum - 1));
25747
+ }
25748
+ }
25749
+ }
25750
+ }
25650
25751
  } else {
25651
25752
  dValue = null;
25652
25753
  }
@@ -25657,7 +25758,8 @@ function renderExtraSuffixIcon(h, _vm) {
25657
25758
  dateOffsetEvent: function dateOffsetEvent(evnt) {
25658
25759
  var isActivated = this.isActivated,
25659
25760
  datePanelValue = this.datePanelValue,
25660
- datePanelType = this.datePanelType;
25761
+ datePanelType = this.datePanelType,
25762
+ firstDayOfWeek = this.firstDayOfWeek;
25661
25763
 
25662
25764
  if (isActivated) {
25663
25765
  evnt.preventDefault();
@@ -25715,11 +25817,11 @@ function renderExtraSuffixIcon(h, _vm) {
25715
25817
  if (isLeftArrow) {
25716
25818
  offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, -1);
25717
25819
  } else if (isUpArrow) {
25718
- offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1);
25820
+ offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1, firstDayOfWeek);
25719
25821
  } else if (isRightArrow) {
25720
25822
  offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, 1);
25721
25823
  } else if (isDwArrow) {
25722
- offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, 1);
25824
+ offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, 1, firstDayOfWeek);
25723
25825
  }
25724
25826
 
25725
25827
  this.dateMoveDay(offsetDay);
@@ -25743,18 +25845,21 @@ function renderExtraSuffixIcon(h, _vm) {
25743
25845
  dateChange: function dateChange(date) {
25744
25846
  var value = this.value,
25745
25847
  datetimePanelValue = this.datetimePanelValue,
25746
- dateValueFormat = this.dateValueFormat;
25848
+ dateValueFormat = this.dateValueFormat,
25849
+ firstDayOfWeek = this.firstDayOfWeek;
25747
25850
 
25748
25851
  if (this.type === 'week') {
25749
25852
  var sWeek = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.selectDay);
25750
- date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek);
25853
+ date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
25751
25854
  } else if (this.hasTime) {
25752
25855
  date.setHours(datetimePanelValue.getHours());
25753
25856
  date.setMinutes(datetimePanelValue.getMinutes());
25754
25857
  date.setSeconds(datetimePanelValue.getSeconds());
25755
25858
  }
25756
25859
 
25757
- var inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
25860
+ var inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat, {
25861
+ firstDay: firstDayOfWeek
25862
+ });
25758
25863
  this.dateCheckMonth(date);
25759
25864
 
25760
25865
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(value, inpVal)) {
@@ -27965,6 +28070,7 @@ var es_string_repeat = __webpack_require__("38cf");
27965
28070
 
27966
28071
 
27967
28072
 
28073
+
27968
28074
 
27969
28075
 
27970
28076
  var mixin_formatText = UtilTools.formatText; // 默认导出或打印的 HTML 样式
@@ -28000,16 +28106,18 @@ function hasTreeChildren($xetable, row) {
28000
28106
  return row[treeOpts.children] && row[treeOpts.children].length > 0;
28001
28107
  }
28002
28108
 
28003
- function getSeq($xetable, row, rowIndex, column, columnIndex) {
28109
+ function getSeq($xetable, row, $rowIndex, column, $columnIndex) {
28004
28110
  var seqOpts = $xetable.seqOpts;
28005
28111
  var seqMethod = seqOpts.seqMethod || column.seqMethod;
28006
28112
 
28007
28113
  if (seqMethod) {
28008
28114
  return seqMethod({
28009
28115
  row: row,
28010
- rowIndex: rowIndex,
28116
+ rowIndex: $xetable.getRowIndex(row),
28117
+ $rowIndex: $rowIndex,
28011
28118
  column: column,
28012
- columnIndex: columnIndex
28119
+ columnIndex: $xetable.getColumnIndex(column),
28120
+ $columnIndex: $columnIndex
28013
28121
  });
28014
28122
  }
28015
28123
 
@@ -28037,7 +28145,8 @@ function toBooleanValue(cellValue) {
28037
28145
  }
28038
28146
 
28039
28147
  function getLabelData($xetable, opts, columns, datas) {
28040
- var isAllExpand = opts.isAllExpand;
28148
+ var isAllExpand = opts.isAllExpand,
28149
+ mode = opts.mode;
28041
28150
  var treeConfig = $xetable.treeConfig,
28042
28151
  treeOpts = $xetable.treeOpts,
28043
28152
  radioOpts = $xetable.radioOpts,
@@ -28051,7 +28160,7 @@ function getLabelData($xetable, opts, columns, datas) {
28051
28160
  // 如果是树表格只允许导出数据源
28052
28161
  var rest = [];
28053
28162
  var expandMaps = new Map();
28054
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(datas, function (item, rowIndex, items, path, parent, nodes) {
28163
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(datas, function (item, $rowIndex, items, path, parent, nodes) {
28055
28164
  var row = item._row || item;
28056
28165
  var parentRow = parent && parent._row ? parent._row : parent;
28057
28166
 
@@ -28063,7 +28172,7 @@ function getLabelData($xetable, opts, columns, datas) {
28063
28172
  _hasChild: hasRowChild,
28064
28173
  _expand: hasRowChild && $xetable.isTreeExpandByRow(row)
28065
28174
  };
28066
- columns.forEach(function (column, columnIndex) {
28175
+ columns.forEach(function (column, $columnIndex) {
28067
28176
  var cellValue = '';
28068
28177
  var renderOpts = column.editRender || column.cellRender;
28069
28178
  var exportLabelMethod = column.exportMethod;
@@ -28086,7 +28195,9 @@ function getLabelData($xetable, opts, columns, datas) {
28086
28195
  } else {
28087
28196
  switch (column.type) {
28088
28197
  case 'seq':
28089
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
28198
+ cellValue = mode === 'all' ? path.map(function (num, i) {
28199
+ return i % 2 === 0 ? Number(num) + 1 : '.';
28200
+ }).join('') : getSeq($xetable, row, $rowIndex, column, $columnIndex);
28090
28201
  break;
28091
28202
 
28092
28203
  case 'checkbox':
@@ -28135,11 +28246,11 @@ function getLabelData($xetable, opts, columns, datas) {
28135
28246
  return rest;
28136
28247
  }
28137
28248
 
28138
- return datas.map(function (row, rowIndex) {
28249
+ return datas.map(function (row, $rowIndex) {
28139
28250
  var item = {
28140
28251
  _row: row
28141
28252
  };
28142
- columns.forEach(function (column, columnIndex) {
28253
+ columns.forEach(function (column, $columnIndex) {
28143
28254
  var cellValue = '';
28144
28255
  var renderOpts = column.editRender || column.cellRender;
28145
28256
  var exportLabelMethod = column.exportMethod;
@@ -28162,7 +28273,7 @@ function getLabelData($xetable, opts, columns, datas) {
28162
28273
  } else {
28163
28274
  switch (column.type) {
28164
28275
  case 'seq':
28165
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
28276
+ cellValue = mode === 'all' ? $rowIndex + 1 : getSeq($xetable, row, $rowIndex, column, $columnIndex);
28166
28277
  break;
28167
28278
 
28168
28279
  case 'checkbox':
@@ -30951,6 +31062,18 @@ var cellType = 'header';
30951
31062
  elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
30952
31063
  elemStore["".concat(prefix, "repair")] = $refs.repair;
30953
31064
  },
31065
+ destroyed: function destroyed() {
31066
+ var $xetable = this.$parent,
31067
+ fixedType = this.fixedType;
31068
+ var elemStore = $xetable.elemStore;
31069
+ var prefix = "".concat(fixedType || 'main', "-header-");
31070
+ elemStore["".concat(prefix, "wrapper")] = null;
31071
+ elemStore["".concat(prefix, "table")] = null;
31072
+ elemStore["".concat(prefix, "colgroup")] = null;
31073
+ elemStore["".concat(prefix, "list")] = null;
31074
+ elemStore["".concat(prefix, "xSpace")] = null;
31075
+ elemStore["".concat(prefix, "repair")] = null;
31076
+ },
30954
31077
  render: function render(h) {
30955
31078
  var _this = this;
30956
31079
 
@@ -31320,6 +31443,17 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
31320
31443
  elemStore["".concat(prefix, "list")] = $refs.tfoot;
31321
31444
  elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
31322
31445
  },
31446
+ destroyed: function destroyed() {
31447
+ var $xetable = this.$parent,
31448
+ fixedType = this.fixedType;
31449
+ var elemStore = $xetable.elemStore;
31450
+ var prefix = "".concat(fixedType || 'main', "-footer-");
31451
+ elemStore["".concat(prefix, "wrapper")] = null;
31452
+ elemStore["".concat(prefix, "table")] = null;
31453
+ elemStore["".concat(prefix, "colgroup")] = null;
31454
+ elemStore["".concat(prefix, "list")] = null;
31455
+ elemStore["".concat(prefix, "xSpace")] = null;
31456
+ },
31323
31457
  render: function render(h) {
31324
31458
  var _e = this._e,
31325
31459
  $xetable = this.$parent,
@@ -32135,7 +32269,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
32135
32269
  proxyConfig = this.proxyConfig;
32136
32270
 
32137
32271
  if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
32138
- console.error('[vxe-grid] There is a conflict between the props proxy-config and data.');
32272
+ UtilTools.error('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config']);
32139
32273
  }
32140
32274
 
32141
32275
  if (false) {}
@@ -32286,7 +32420,9 @@ Object.keys(packages_table.methods).forEach(function (name) {
32286
32420
  handleActiveMethod: function handleActiveMethod(params) {
32287
32421
  var editConfig = this.editConfig;
32288
32422
  var activeMethod = editConfig ? editConfig.activeMethod : null;
32289
- return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params));
32423
+ return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(_objectSpread2(_objectSpread2({}, params), {}, {
32424
+ $grid: this
32425
+ })));
32290
32426
  },
32291
32427
  initToolbar: function initToolbar() {
32292
32428
  var _this3 = this;
@@ -32496,6 +32632,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
32496
32632
 
32497
32633
  sortList = defaultSort.map(function (item) {
32498
32634
  return {
32635
+ field: item.field,
32499
32636
  property: item.field,
32500
32637
  order: item.order
32501
32638
  };
@@ -36406,6 +36543,7 @@ function renderItems(h, _vm, itemList) {
36406
36543
  evnt.preventDefault();
36407
36544
 
36408
36545
  if (!this.preventSubmit) {
36546
+ this.clearValidate();
36409
36547
  this.beginValidate(this.getItems()).then(function () {
36410
36548
  _this3.$emit('submit', {
36411
36549
  data: _this3.data,
@@ -36550,6 +36688,7 @@ function renderItems(h, _vm, itemList) {
36550
36688
  return this.$nextTick();
36551
36689
  },
36552
36690
  validate: function validate(callback) {
36691
+ this.clearValidate();
36553
36692
  return this.beginValidate(this.getItems(), '', callback);
36554
36693
  },
36555
36694
  validateField: function validateField(field, callback) {
@@ -36566,7 +36705,6 @@ function renderItems(h, _vm, itemList) {
36566
36705
  var validRest = {};
36567
36706
  var validFields = [];
36568
36707
  var itemValids = [];
36569
- this.clearValidate();
36570
36708
  clearTimeout(this.showErrTime);
36571
36709
 
36572
36710
  if (data && formRules) {
@@ -37666,6 +37804,7 @@ var List = Object.assign(src_list, {
37666
37804
  name: 'VxePulldown',
37667
37805
  mixins: [size],
37668
37806
  props: {
37807
+ value: Boolean,
37669
37808
  disabled: Boolean,
37670
37809
  placement: String,
37671
37810
  size: {
@@ -37689,6 +37828,15 @@ var List = Object.assign(src_list, {
37689
37828
  isActivated: false
37690
37829
  };
37691
37830
  },
37831
+ watch: {
37832
+ value: function value(_value) {
37833
+ if (_value) {
37834
+ this.showPanel();
37835
+ } else {
37836
+ this.hidePanel();
37837
+ }
37838
+ }
37839
+ },
37692
37840
  created: function created() {
37693
37841
  GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
37694
37842
  GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
@@ -37829,6 +37977,8 @@ var List = Object.assign(src_list, {
37829
37977
  setTimeout(function () {
37830
37978
  _this.visiblePanel = true;
37831
37979
 
37980
+ _this.$emit('update:input', true);
37981
+
37832
37982
  _this.updatePlacement();
37833
37983
 
37834
37984
  setTimeout(function () {
@@ -37850,6 +38000,7 @@ var List = Object.assign(src_list, {
37850
38000
  var _this2 = this;
37851
38001
 
37852
38002
  this.visiblePanel = false;
38003
+ this.$emit('update:input', false);
37853
38004
  return new Promise(function (resolve) {
37854
38005
  if (_this2.animatVisible) {
37855
38006
  _this2.hidePanelTimeout = setTimeout(function () {