vxe-table 4.0.30 → 4.1.1

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 (127) hide show
  1. package/README.md +1 -0
  2. package/README.zh-TW.md +1 -0
  3. package/es/button/style.css +2 -2
  4. package/es/checkbox/style.css +1 -1
  5. package/es/edit/src/hook.js +2 -2
  6. package/es/export/src/hook.js +24 -0
  7. package/es/export/src/util.js +20 -8
  8. package/es/export/style.css +1 -1
  9. package/es/filter/src/hook.js +2 -2
  10. package/es/filter/style.css +2 -2
  11. package/es/footer/src/footer.js +4 -4
  12. package/es/form/src/form.js +13 -6
  13. package/es/form/src/render.js +4 -4
  14. package/es/grid/src/grid.js +48 -1
  15. package/es/header/src/header.js +7 -5
  16. package/es/header/style.css +3 -10
  17. package/es/input/style.css +4 -4
  18. package/es/menu/style.css +1 -1
  19. package/es/modal/style.css +1 -1
  20. package/es/pager/style.css +2 -2
  21. package/es/radio/style.css +1 -1
  22. package/es/select/src/select.js +5 -5
  23. package/es/select/style.css +1 -1
  24. package/es/style.css +1 -1
  25. package/es/style.min.css +1 -1
  26. package/es/table/src/body.js +18 -14
  27. package/es/table/src/emits.js +1 -0
  28. package/es/table/src/props.js +4 -1
  29. package/es/table/src/table.js +219 -89
  30. package/es/table/style.css +15 -12
  31. package/es/toolbar/style.css +1 -1
  32. package/es/v-x-e-table/src/conf.js +2 -1
  33. package/es/v-x-e-table/src/renderer.js +4 -4
  34. package/es/validator/src/hook.js +12 -5
  35. package/helper/vetur/attributes.json +16 -204
  36. package/helper/vetur/tags.json +3 -65
  37. package/lib/button/style/style.css +2 -2
  38. package/lib/button/style/style.min.css +1 -1
  39. package/lib/checkbox/style/style.css +1 -1
  40. package/lib/checkbox/style/style.min.css +1 -1
  41. package/lib/edit/src/hook.js +2 -2
  42. package/lib/edit/src/hook.min.js +1 -1
  43. package/lib/export/src/hook.js +28 -0
  44. package/lib/export/src/hook.min.js +1 -1
  45. package/lib/export/src/util.js +21 -7
  46. package/lib/export/src/util.min.js +1 -1
  47. package/lib/export/style/style.css +1 -1
  48. package/lib/export/style/style.min.css +1 -1
  49. package/lib/filter/src/hook.js +8 -2
  50. package/lib/filter/src/hook.min.js +1 -1
  51. package/lib/filter/style/style.css +2 -2
  52. package/lib/filter/style/style.min.css +1 -1
  53. package/lib/footer/src/footer.js +4 -4
  54. package/lib/footer/src/footer.min.js +1 -1
  55. package/lib/form/src/form.js +23 -6
  56. package/lib/form/src/form.min.js +1 -1
  57. package/lib/form/src/render.js +4 -4
  58. package/lib/form/src/render.min.js +1 -1
  59. package/lib/grid/src/grid.js +56 -1
  60. package/lib/grid/src/grid.min.js +1 -1
  61. package/lib/header/src/header.js +7 -5
  62. package/lib/header/src/header.min.js +1 -1
  63. package/lib/header/style/style.css +3 -10
  64. package/lib/header/style/style.min.css +1 -1
  65. package/lib/index.umd.js +561 -186
  66. package/lib/index.umd.min.js +1 -1
  67. package/lib/input/style/style.css +4 -4
  68. package/lib/input/style/style.min.css +1 -1
  69. package/lib/menu/style/style.css +1 -1
  70. package/lib/menu/style/style.min.css +1 -1
  71. package/lib/modal/style/style.css +1 -1
  72. package/lib/modal/style/style.min.css +1 -1
  73. package/lib/pager/style/style.css +2 -2
  74. package/lib/pager/style/style.min.css +1 -1
  75. package/lib/radio/style/style.css +1 -1
  76. package/lib/radio/style/style.min.css +1 -1
  77. package/lib/select/src/select.js +5 -5
  78. package/lib/select/style/style.css +1 -1
  79. package/lib/select/style/style.min.css +1 -1
  80. package/lib/style.css +1 -1
  81. package/lib/style.min.css +1 -1
  82. package/lib/table/src/body.js +18 -14
  83. package/lib/table/src/body.min.js +1 -1
  84. package/lib/table/src/emits.js +1 -1
  85. package/lib/table/src/emits.min.js +1 -1
  86. package/lib/table/src/props.js +4 -1
  87. package/lib/table/src/props.min.js +1 -1
  88. package/lib/table/src/table.js +288 -120
  89. package/lib/table/src/table.min.js +1 -1
  90. package/lib/table/style/style.css +15 -12
  91. package/lib/table/style/style.min.css +1 -1
  92. package/lib/toolbar/style/style.css +1 -1
  93. package/lib/toolbar/style/style.min.css +1 -1
  94. package/lib/v-x-e-table/src/conf.js +2 -1
  95. package/lib/v-x-e-table/src/conf.min.js +1 -1
  96. package/lib/v-x-e-table/src/renderer.js +4 -4
  97. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  98. package/lib/validator/src/hook.js +12 -5
  99. package/lib/validator/src/hook.min.js +1 -1
  100. package/package.json +4 -4
  101. package/packages/edit/src/hook.ts +2 -2
  102. package/packages/export/src/hook.ts +24 -0
  103. package/packages/export/src/util.ts +17 -5
  104. package/packages/filter/src/hook.ts +2 -2
  105. package/packages/footer/src/footer.ts +4 -4
  106. package/packages/form/src/form.ts +10 -6
  107. package/packages/form/src/render.ts +4 -4
  108. package/packages/grid/src/grid.ts +48 -1
  109. package/packages/header/src/header.ts +7 -5
  110. package/packages/select/src/select.ts +5 -5
  111. package/packages/table/src/body.ts +18 -14
  112. package/packages/table/src/emits.ts +1 -0
  113. package/packages/table/src/props.ts +4 -1
  114. package/packages/table/src/table.ts +222 -88
  115. package/packages/v-x-e-table/src/conf.ts +2 -1
  116. package/packages/v-x-e-table/src/renderer.ts +4 -4
  117. package/packages/validator/src/hook.ts +9 -5
  118. package/styles/header.scss +9 -12
  119. package/styles/table.scss +9 -3
  120. package/styles/variable.scss +2 -2
  121. package/types/column.d.ts +5 -1
  122. package/types/form-item.d.ts +5 -1
  123. package/types/form.d.ts +5 -1
  124. package/types/grid.d.ts +4 -0
  125. package/types/modal.d.ts +4 -5
  126. package/types/table.d.ts +53 -11
  127. package/types/validator.d.ts +5 -1
@@ -40,7 +40,7 @@ export default defineComponent({
40
40
  var xesize = inject('xesize', null);
41
41
  var xID = $xetable.xID, tableProps = $xetable.props, tableContext = $xetable.context, tableReactData = $xetable.reactData, tableInternalData = $xetable.internalData;
42
42
  var _a = $xetable.getRefMaps(), refTableHeader = _a.refTableHeader, refTableBody = _a.refTableBody, refTableFooter = _a.refTableFooter, refTableLeftBody = _a.refTableLeftBody, refTableRightBody = _a.refTableRightBody, refValidTooltip = _a.refValidTooltip;
43
- var _b = $xetable.getComputeMaps(), computeEditOpts = _b.computeEditOpts, computeMouseOpts = _b.computeMouseOpts, computeSYOpts = _b.computeSYOpts, computeEmptyOpts = _b.computeEmptyOpts, computeKeyboardOpts = _b.computeKeyboardOpts, computeTooltipOpts = _b.computeTooltipOpts, computeRadioOpts = _b.computeRadioOpts, computeTreeOpts = _b.computeTreeOpts, computeCheckboxOpts = _b.computeCheckboxOpts, computeValidOpts = _b.computeValidOpts;
43
+ var _b = $xetable.getComputeMaps(), computeEditOpts = _b.computeEditOpts, computeMouseOpts = _b.computeMouseOpts, computeSYOpts = _b.computeSYOpts, computeEmptyOpts = _b.computeEmptyOpts, computeKeyboardOpts = _b.computeKeyboardOpts, computeTooltipOpts = _b.computeTooltipOpts, computeRadioOpts = _b.computeRadioOpts, computeTreeOpts = _b.computeTreeOpts, computeCheckboxOpts = _b.computeCheckboxOpts, computeValidOpts = _b.computeValidOpts, computeRowOpts = _b.computeRowOpts;
44
44
  var refElem = ref();
45
45
  var refBodyTable = ref();
46
46
  var refBodyColgroup = ref();
@@ -113,16 +113,18 @@ export default defineComponent({
113
113
  var renderColumn = function ($seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
114
114
  var _a;
115
115
  var columnKey = tableProps.columnKey, height = tableProps.height, allColumnOverflow = tableProps.showOverflow, cellClassName = tableProps.cellClassName, cellStyle = tableProps.cellStyle, allAlign = tableProps.align, spanMethod = tableProps.spanMethod, mouseConfig = tableProps.mouseConfig, editConfig = tableProps.editConfig, editRules = tableProps.editRules, tooltipConfig = tableProps.tooltipConfig;
116
- var tableData = tableReactData.tableData, overflowX = tableReactData.overflowX, scrollXLoad = tableReactData.scrollXLoad, scrollYLoad = tableReactData.scrollYLoad, currentColumn = tableReactData.currentColumn, mergeList = tableReactData.mergeList, editStore = tableReactData.editStore, validStore = tableReactData.validStore, isAllOverflow = tableReactData.isAllOverflow;
116
+ var tableData = tableReactData.tableData, overflowX = tableReactData.overflowX, scrollYLoad = tableReactData.scrollYLoad, currentColumn = tableReactData.currentColumn, mergeList = tableReactData.mergeList, editStore = tableReactData.editStore, validStore = tableReactData.validStore, isAllOverflow = tableReactData.isAllOverflow;
117
117
  var afterFullData = tableInternalData.afterFullData;
118
118
  var validOpts = computeValidOpts.value;
119
119
  var checkboxOpts = computeCheckboxOpts.value;
120
120
  var editOpts = computeEditOpts.value;
121
121
  var tooltipOpts = computeTooltipOpts.value;
122
+ var rowOpts = computeRowOpts.value;
122
123
  var sYOpts = computeSYOpts.value;
123
124
  var type = column.type, cellRender = column.cellRender, editRender = column.editRender, align = column.align, showOverflow = column.showOverflow, className = column.className, treeNode = column.treeNode;
124
125
  var actived = editStore.actived;
125
- var rHeight = sYOpts.rHeight;
126
+ var scrollYRHeight = sYOpts.rHeight;
127
+ var rowHeight = rowOpts.height;
126
128
  var showAllTip = tooltipOpts.showAll;
127
129
  var columnIndex = $xetable.getColumnIndex(column);
128
130
  var _columnIndex = $xetable.getVTColumnIndex(column);
@@ -141,7 +143,7 @@ export default defineComponent({
141
143
  var attrs = { colid: column.id };
142
144
  var params = { $table: $xetable, $seq: $seq, seq: seq, rowid: rowid, row: row, rowIndex: rowIndex, $rowIndex: $rowIndex, _rowIndex: _rowIndex, column: column, columnIndex: columnIndex, $columnIndex: $columnIndex, _columnIndex: _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items: items };
143
145
  // 虚拟滚动不支持动态高度
144
- if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
146
+ if (scrollYLoad && !hasEllipsis) {
145
147
  showEllipsis = hasEllipsis = true;
146
148
  }
147
149
  // hover 进入事件
@@ -234,7 +236,7 @@ export default defineComponent({
234
236
  'c--ellipsis': showEllipsis
235
237
  }],
236
238
  style: {
237
- maxHeight: hasEllipsis && rHeight ? rHeight + "px" : ''
239
+ maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
238
240
  }
239
241
  }));
240
242
  }
@@ -247,7 +249,7 @@ export default defineComponent({
247
249
  'c--ellipsis': showEllipsis
248
250
  }],
249
251
  style: {
250
- maxHeight: hasEllipsis && rHeight ? rHeight + "px" : ''
252
+ maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
251
253
  },
252
254
  title: showTitle ? $xetable.getCellLabel(row, column) : null
253
255
  }, column.renderCell(params))]));
@@ -277,13 +279,13 @@ export default defineComponent({
277
279
  _a['col--valid-error'] = hasValidError,
278
280
  _a['col--current'] = currentColumn === column,
279
281
  _a), getPropClass(className, params), getPropClass(cellClassName, params)], key: columnKey ? column.id : $columnIndex }, attrs), { style: Object.assign({
280
- height: hasEllipsis && rHeight ? rHeight + "px" : ''
282
+ height: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
281
283
  }, cellStyle ? (XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) : null) }), tdOns), tdVNs);
282
284
  };
283
- var renderRows = function ($seq, rowLevel, fixedType, tableData, tableColumn) {
285
+ var renderRows = function ($seq, fixedType, tableData, tableColumn) {
284
286
  var stripe = tableProps.stripe, rowKey = tableProps.rowKey, highlightHoverRow = tableProps.highlightHoverRow, rowClassName = tableProps.rowClassName, rowStyle = tableProps.rowStyle, allColumnOverflow = tableProps.showOverflow, editConfig = tableProps.editConfig, treeConfig = tableProps.treeConfig;
285
287
  var hasFixedColumn = tableReactData.hasFixedColumn, treeExpandeds = tableReactData.treeExpandeds, scrollYLoad = tableReactData.scrollYLoad, editStore = tableReactData.editStore, rowExpandeds = tableReactData.rowExpandeds, expandColumn = tableReactData.expandColumn, selectRow = tableReactData.selectRow;
286
- var scrollYStore = tableInternalData.scrollYStore;
288
+ var fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData, scrollYStore = tableInternalData.scrollYStore;
287
289
  var checkboxOpts = computeCheckboxOpts.value;
288
290
  var radioOpts = computeRadioOpts.value;
289
291
  var treeOpts = computeTreeOpts.value;
@@ -315,6 +317,8 @@ export default defineComponent({
315
317
  };
316
318
  }
317
319
  var rowid = getRowid($xetable, row);
320
+ var rest = fullAllDataRowIdData[rowid];
321
+ var rowLevel = rest ? rest.level : 0;
318
322
  var params = { $table: $xetable, $seq: $seq, seq: seq, rowid: rowid, fixed: fixedType, type: renderType, level: rowLevel, row: row, rowIndex: rowIndex, $rowIndex: $rowIndex, _rowIndex: _rowIndex };
319
323
  var isNewRow = false;
320
324
  if (editConfig) {
@@ -358,10 +362,10 @@ export default defineComponent({
358
362
  ]));
359
363
  }
360
364
  // 如果是树形表格
361
- if (treeConfig && treeExpandeds.length) {
365
+ if (treeConfig && !scrollYLoad && treeExpandeds.length) {
362
366
  var rowChildren = row[treeOpts.children];
363
367
  if (rowChildren && rowChildren.length && $xetable.findRowIndexOf(treeExpandeds, row) > -1) {
364
- rows.push.apply(rows, renderRows($seq ? $seq + "." + seq : "" + seq, rowLevel + 1, fixedType, rowChildren, tableColumn));
368
+ rows.push.apply(rows, renderRows($seq ? $seq + "." + seq : "" + seq, fixedType, rowChildren, tableColumn));
365
369
  }
366
370
  }
367
371
  });
@@ -570,7 +574,7 @@ export default defineComponent({
570
574
  var renderVN = function () {
571
575
  var fixedColumn = props.fixedColumn, fixedType = props.fixedType, tableColumn = props.tableColumn;
572
576
  var keyboardConfig = tableProps.keyboardConfig, allColumnOverflow = tableProps.showOverflow, spanMethod = tableProps.spanMethod, mouseConfig = tableProps.mouseConfig;
573
- var tableData = tableReactData.tableData, mergeList = tableReactData.mergeList, scrollXLoad = tableReactData.scrollXLoad, scrollYLoad = tableReactData.scrollYLoad, isAllOverflow = tableReactData.isAllOverflow;
577
+ var tableData = tableReactData.tableData, mergeList = tableReactData.mergeList, scrollYLoad = tableReactData.scrollYLoad, isAllOverflow = tableReactData.isAllOverflow;
574
578
  var visibleColumn = tableInternalData.visibleColumn;
575
579
  var slots = tableContext.slots;
576
580
  var sYOpts = computeSYOpts.value;
@@ -581,7 +585,7 @@ export default defineComponent({
581
585
  // const isMergeRightFixedExceeded = computeIsMergeRightFixedExceeded.value
582
586
  // 如果是使用优化模式
583
587
  if (fixedType) {
584
- if (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
588
+ if (scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
585
589
  if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
586
590
  tableColumn = fixedColumn;
587
591
  }
@@ -648,7 +652,7 @@ export default defineComponent({
648
652
  */
649
653
  h('tbody', {
650
654
  ref: refBodyTBody
651
- }, renderRows('', 0, fixedType, tableData, tableColumn))
655
+ }, renderRows('', fixedType, tableData, tableColumn))
652
656
  ]),
653
657
  h('div', {
654
658
  class: 'vxe-table--checkbox-range'
@@ -26,6 +26,7 @@ export default [
26
26
  'sort-change',
27
27
  'clear-sort',
28
28
  'filter-change',
29
+ 'filter-visible',
29
30
  'clear-filter',
30
31
  'resizable-change',
31
32
  'toggle-row-expand',
@@ -94,8 +94,11 @@ export default {
94
94
  autoResize: { type: Boolean, default: function () { return GlobalConfig.table.autoResize; } },
95
95
  // 是否自动根据状态属性去更新响应式表格宽高
96
96
  syncResize: [Boolean, String, Number],
97
- // 设置列的默认参数,仅对部分支持的属性有效
97
+ // 列配置信息
98
98
  columnConfig: Object,
99
+ // 行配置信息
100
+ rowConfig: Object,
101
+ // 列调整配置项
99
102
  resizableConfig: Object,
100
103
  // 序号配置项
101
104
  seqConfig: Object,