vxe-table 3.20.0-beta.9 → 3.20.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 (190) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +6 -0
  4. package/es/locale/lang/de-DE.js +6 -0
  5. package/es/locale/lang/en-US.js +6 -0
  6. package/es/locale/lang/es-ES.js +6 -0
  7. package/es/locale/lang/fr-FR.js +6 -0
  8. package/es/locale/lang/hu-HU.js +6 -0
  9. package/es/locale/lang/hy-AM.js +6 -0
  10. package/es/locale/lang/id-ID.js +6 -0
  11. package/es/locale/lang/it-IT.js +6 -0
  12. package/es/locale/lang/ja-JP.js +6 -0
  13. package/es/locale/lang/ko-KR.js +6 -0
  14. package/es/locale/lang/ms-MY.js +6 -0
  15. package/es/locale/lang/nb-NO.js +6 -0
  16. package/es/locale/lang/pt-BR.js +6 -0
  17. package/es/locale/lang/ru-RU.js +6 -0
  18. package/es/locale/lang/th-TH.js +6 -0
  19. package/es/locale/lang/ug-CN.js +6 -0
  20. package/es/locale/lang/uk-UA.js +6 -0
  21. package/es/locale/lang/uz-UZ.js +6 -0
  22. package/es/locale/lang/vi-VN.js +6 -0
  23. package/es/locale/lang/zh-CHT.js +6 -0
  24. package/es/locale/lang/zh-CN.js +6 -0
  25. package/es/style.css +1 -1
  26. package/es/style.min.css +1 -1
  27. package/es/table/module/export/mixin.js +15 -1
  28. package/es/table/module/keyboard/mixin.js +18 -8
  29. package/es/table/module/validator/mixin.js +7 -6
  30. package/es/table/render/index.js +11 -0
  31. package/es/table/src/body.js +12 -5
  32. package/es/table/src/column.js +1 -1
  33. package/es/table/src/columnInfo.js +2 -0
  34. package/es/table/src/methods.js +208 -79
  35. package/es/table/src/props.js +4 -0
  36. package/es/table/src/table.js +64 -3
  37. package/es/table/src/util.js +38 -20
  38. package/es/table/style.css +11 -17
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +7 -1
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +11 -17
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/lib/index.css +1 -1
  45. package/lib/index.min.css +1 -1
  46. package/lib/index.umd.js +241 -76
  47. package/lib/index.umd.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.js +6 -0
  49. package/lib/locale/lang/ar-EG.min.js +1 -1
  50. package/lib/locale/lang/ar-EG.umd.js +6 -0
  51. package/lib/locale/lang/de-DE.js +6 -0
  52. package/lib/locale/lang/de-DE.min.js +1 -1
  53. package/lib/locale/lang/de-DE.umd.js +6 -0
  54. package/lib/locale/lang/en-US.js +6 -0
  55. package/lib/locale/lang/en-US.min.js +1 -1
  56. package/lib/locale/lang/en-US.umd.js +6 -0
  57. package/lib/locale/lang/es-ES.js +6 -0
  58. package/lib/locale/lang/es-ES.min.js +1 -1
  59. package/lib/locale/lang/es-ES.umd.js +6 -0
  60. package/lib/locale/lang/fr-FR.js +6 -0
  61. package/lib/locale/lang/fr-FR.min.js +1 -1
  62. package/lib/locale/lang/fr-FR.umd.js +6 -0
  63. package/lib/locale/lang/hu-HU.js +6 -0
  64. package/lib/locale/lang/hu-HU.min.js +1 -1
  65. package/lib/locale/lang/hu-HU.umd.js +6 -0
  66. package/lib/locale/lang/hy-AM.js +6 -0
  67. package/lib/locale/lang/hy-AM.min.js +1 -1
  68. package/lib/locale/lang/hy-AM.umd.js +6 -0
  69. package/lib/locale/lang/id-ID.js +6 -0
  70. package/lib/locale/lang/id-ID.min.js +1 -1
  71. package/lib/locale/lang/id-ID.umd.js +6 -0
  72. package/lib/locale/lang/it-IT.js +6 -0
  73. package/lib/locale/lang/it-IT.min.js +1 -1
  74. package/lib/locale/lang/it-IT.umd.js +6 -0
  75. package/lib/locale/lang/ja-JP.js +6 -0
  76. package/lib/locale/lang/ja-JP.min.js +1 -1
  77. package/lib/locale/lang/ja-JP.umd.js +6 -0
  78. package/lib/locale/lang/ko-KR.js +6 -0
  79. package/lib/locale/lang/ko-KR.min.js +1 -1
  80. package/lib/locale/lang/ko-KR.umd.js +6 -0
  81. package/lib/locale/lang/ms-MY.js +6 -0
  82. package/lib/locale/lang/ms-MY.min.js +1 -1
  83. package/lib/locale/lang/ms-MY.umd.js +6 -0
  84. package/lib/locale/lang/nb-NO.js +6 -0
  85. package/lib/locale/lang/nb-NO.min.js +1 -1
  86. package/lib/locale/lang/nb-NO.umd.js +6 -0
  87. package/lib/locale/lang/pt-BR.js +6 -0
  88. package/lib/locale/lang/pt-BR.min.js +1 -1
  89. package/lib/locale/lang/pt-BR.umd.js +6 -0
  90. package/lib/locale/lang/ru-RU.js +6 -0
  91. package/lib/locale/lang/ru-RU.min.js +1 -1
  92. package/lib/locale/lang/ru-RU.umd.js +6 -0
  93. package/lib/locale/lang/th-TH.js +6 -0
  94. package/lib/locale/lang/th-TH.min.js +1 -1
  95. package/lib/locale/lang/th-TH.umd.js +6 -0
  96. package/lib/locale/lang/ug-CN.js +6 -0
  97. package/lib/locale/lang/ug-CN.min.js +1 -1
  98. package/lib/locale/lang/ug-CN.umd.js +6 -0
  99. package/lib/locale/lang/uk-UA.js +6 -0
  100. package/lib/locale/lang/uk-UA.min.js +1 -1
  101. package/lib/locale/lang/uk-UA.umd.js +6 -0
  102. package/lib/locale/lang/uz-UZ.js +6 -0
  103. package/lib/locale/lang/uz-UZ.min.js +1 -1
  104. package/lib/locale/lang/uz-UZ.umd.js +6 -0
  105. package/lib/locale/lang/vi-VN.js +6 -0
  106. package/lib/locale/lang/vi-VN.min.js +1 -1
  107. package/lib/locale/lang/vi-VN.umd.js +6 -0
  108. package/lib/locale/lang/zh-CHT.js +6 -0
  109. package/lib/locale/lang/zh-CHT.min.js +1 -1
  110. package/lib/locale/lang/zh-CHT.umd.js +6 -0
  111. package/lib/locale/lang/zh-CN.js +6 -0
  112. package/lib/locale/lang/zh-CN.min.js +1 -1
  113. package/lib/locale/lang/zh-CN.umd.js +6 -0
  114. package/lib/style.css +1 -1
  115. package/lib/style.min.css +1 -1
  116. package/lib/table/module/export/mixin.js +18 -6
  117. package/lib/table/module/export/mixin.min.js +1 -1
  118. package/lib/table/module/keyboard/mixin.js +18 -4
  119. package/lib/table/module/keyboard/mixin.min.js +1 -1
  120. package/lib/table/module/validator/mixin.js +8 -6
  121. package/lib/table/module/validator/mixin.min.js +1 -1
  122. package/lib/table/render/index.js +15 -0
  123. package/lib/table/render/index.min.js +1 -1
  124. package/lib/table/src/body.js +13 -4
  125. package/lib/table/src/body.min.js +1 -1
  126. package/lib/table/src/column.js +1 -1
  127. package/lib/table/src/column.min.js +1 -1
  128. package/lib/table/src/columnInfo.js +2 -0
  129. package/lib/table/src/columnInfo.min.js +1 -1
  130. package/lib/table/src/methods.js +806 -14157
  131. package/lib/table/src/methods.min.js +1 -1
  132. package/lib/table/src/props.js +4 -0
  133. package/lib/table/src/props.min.js +1 -1
  134. package/lib/table/src/table.js +74 -2
  135. package/lib/table/src/table.min.js +1 -1
  136. package/lib/table/src/util.js +41 -21
  137. package/lib/table/src/util.min.js +1 -1
  138. package/lib/table/style/style.css +11 -17
  139. package/lib/table/style/style.min.css +1 -1
  140. package/lib/ui/index.js +7 -1
  141. package/lib/ui/index.min.js +1 -1
  142. package/lib/ui/src/log.js +1 -1
  143. package/lib/ui/src/log.min.js +1 -1
  144. package/lib/vxe-table/style/style.css +11 -17
  145. package/lib/vxe-table/style/style.min.css +1 -1
  146. package/package.json +2 -2
  147. package/packages/locale/lang/ar-EG.ts +6 -0
  148. package/packages/locale/lang/de-DE.ts +6 -0
  149. package/packages/locale/lang/en-US.ts +6 -0
  150. package/packages/locale/lang/es-ES.ts +6 -0
  151. package/packages/locale/lang/fr-FR.ts +6 -0
  152. package/packages/locale/lang/hu-HU.ts +6 -0
  153. package/packages/locale/lang/hy-AM.ts +6 -0
  154. package/packages/locale/lang/id-ID.ts +6 -0
  155. package/packages/locale/lang/it-IT.ts +6 -0
  156. package/packages/locale/lang/ja-JP.ts +6 -0
  157. package/packages/locale/lang/ko-KR.ts +6 -0
  158. package/packages/locale/lang/ms-MY.ts +6 -0
  159. package/packages/locale/lang/nb-NO.ts +6 -0
  160. package/packages/locale/lang/pt-BR.ts +6 -0
  161. package/packages/locale/lang/ru-RU.ts +6 -0
  162. package/packages/locale/lang/th-TH.ts +6 -0
  163. package/packages/locale/lang/ug-CN.ts +6 -0
  164. package/packages/locale/lang/uk-UA.ts +6 -0
  165. package/packages/locale/lang/uz-UZ.ts +6 -0
  166. package/packages/locale/lang/vi-VN.ts +6 -0
  167. package/packages/locale/lang/zh-CHT.ts +6 -0
  168. package/packages/locale/lang/zh-CN.ts +6 -0
  169. package/packages/table/module/export/mixin.ts +13 -1
  170. package/packages/table/module/keyboard/mixin.ts +21 -12
  171. package/packages/table/module/validator/mixin.ts +7 -6
  172. package/packages/table/render/index.ts +12 -0
  173. package/packages/table/src/body.ts +12 -5
  174. package/packages/table/src/column.ts +1 -1
  175. package/packages/table/src/columnInfo.ts +2 -0
  176. package/packages/table/src/methods.ts +201 -78
  177. package/packages/table/src/props.ts +4 -0
  178. package/packages/table/src/table.ts +70 -2
  179. package/packages/table/src/util.ts +43 -19
  180. package/packages/ui/index.ts +6 -0
  181. package/styles/components/table-module/filter.scss +1 -1
  182. package/styles/components/table-module/menu.scss +4 -9
  183. package/styles/components/table.scss +8 -2
  184. package/styles/theme/base.scss +0 -1
  185. /package/es/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
  186. /package/es/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
  187. /package/es/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
  188. /package/lib/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
  189. /package/lib/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
  190. /package/lib/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
@@ -1338,7 +1338,21 @@ export default {
1338
1338
  return Promise.resolve((beforeQueryAll || ajaxMethods)(params))
1339
1339
  .then(rest => {
1340
1340
  const listProp = resConfigs.list;
1341
- handleOptions.data = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : XEUtils.get(rest, listProp)) : rest) || [];
1341
+ let tdData = [];
1342
+ if (listProp) {
1343
+ if (XEUtils.isFunction(listProp)) {
1344
+ tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
1345
+ }
1346
+ else {
1347
+ tdData = XEUtils.isArray(rest) ? rest : XEUtils.get(rest, listProp);
1348
+ }
1349
+ }
1350
+ else {
1351
+ if (XEUtils.isArray(rest)) {
1352
+ tdData = rest;
1353
+ }
1354
+ }
1355
+ handleOptions.data = tdData;
1342
1356
  if (afterQueryAll) {
1343
1357
  afterQueryAll(params);
1344
1358
  }
@@ -78,9 +78,19 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
78
78
  const internalData = $xeTable;
79
79
  const { afterFullData, visibleColumn } = internalData;
80
80
  const params = Object.assign({}, args);
81
- const _rowIndex = $xeTable.getVTRowIndex(params.row);
82
- const _columnIndex = $xeTable.getVTColumnIndex(params.column);
83
- evnt.preventDefault();
81
+ const { row, column } = params;
82
+ const _rowIndex = $xeTable.getVTRowIndex(row);
83
+ const _columnIndex = $xeTable.getVTColumnIndex(column);
84
+ const refTableBody = $xeTable.$refs.refTableBody;
85
+ const tableBodyElem = refTableBody ? refTableBody.$el : null;
86
+ const tableWidth = tableBodyElem ? tableBodyElem.clientWidth : 0;
87
+ let colAlign = isLeftArrow || isRightArrow || (column.renderWidth < tableWidth);
88
+ if ((isLeftArrow && _columnIndex >= 0) || (isRightArrow && _columnIndex <= visibleColumn.length - 1)) {
89
+ colAlign = false;
90
+ }
91
+ else {
92
+ evnt.preventDefault();
93
+ }
84
94
  if (isUpArrow && _rowIndex > 0) {
85
95
  // 移动到上一行
86
96
  params.rowIndex = _rowIndex - 1;
@@ -101,7 +111,9 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
101
111
  params.columnIndex = _columnIndex + 1;
102
112
  params.column = visibleColumn[params.columnIndex];
103
113
  }
104
- $xeTable.scrollToRow(params.row, params.column).then(() => {
114
+ $xeTable.scrollToRow(params.row, params.column, {
115
+ colAlign
116
+ }).then(() => {
105
117
  params.cell = $xeTable.getCellElement(params.row, params.column);
106
118
  $xeTable.handleSelected(params, evnt);
107
119
  });
@@ -347,16 +359,14 @@ export default {
347
359
  $xeTable.handleEdit(params, evnt);
348
360
  }
349
361
  else {
350
- $xeTable.scrollToRow(params.row, params.column)
351
- .then(() => {
362
+ $xeTable.scrollToRow(params.row, params.column).then(() => {
352
363
  $xeTable.handleSelected(params, evnt);
353
364
  });
354
365
  }
355
366
  }
356
367
  }
357
368
  else {
358
- $xeTable.scrollToRow(params.row, params.column)
359
- .then(() => {
369
+ $xeTable.scrollToRow(params.row, params.column).then(() => {
360
370
  $xeTable.handleSelected(params, evnt);
361
371
  });
362
372
  }
@@ -117,20 +117,21 @@ function validRuleValue(rule, val, required) {
117
117
  }
118
118
  return true;
119
119
  }
120
- function checkRuleStatus(rule, val) {
121
- const { required } = rule;
122
- const isEmptyVal = XEUtils.isArray(val) ? !val.length : eqEmptyValue(val);
120
+ function checkRuleStatus(rule, row, val) {
121
+ const { required, field } = rule;
122
+ const currVal = field ? XEUtils.get(row, field) : val;
123
+ const isEmptyVal = XEUtils.isArray(currVal) ? !currVal.length : eqEmptyValue(currVal);
123
124
  if (required) {
124
125
  if (isEmptyVal) {
125
126
  return false;
126
127
  }
127
- if (!validRuleValue(rule, val, required)) {
128
+ if (!validRuleValue(rule, currVal, required)) {
128
129
  return false;
129
130
  }
130
131
  }
131
132
  else {
132
133
  if (!isEmptyVal) {
133
- if (!validRuleValue(rule, val, required)) {
134
+ if (!validRuleValue(rule, currVal, required)) {
134
135
  return false;
135
136
  }
136
137
  }
@@ -459,7 +460,7 @@ export default {
459
460
  }
460
461
  }
461
462
  else {
462
- if (!checkRuleStatus(rule, cellValue)) {
463
+ if (!checkRuleStatus(rule, row, cellValue)) {
463
464
  internalData.validRuleErr = true;
464
465
  errorRules.push(new Rule(rule));
465
466
  }
@@ -725,6 +725,16 @@ function handleNumberCell(h, renderOpts, params) {
725
725
  }
726
726
  : {});
727
727
  }
728
+ function handleFormatDatePicker(renderOpts, params) {
729
+ const { props = {} } = renderOpts;
730
+ const { cellValue } = params;
731
+ if (cellValue) {
732
+ if (props.type !== 'time') {
733
+ return getLabelFormatDate(cellValue, props);
734
+ }
735
+ }
736
+ return cellValue;
737
+ }
728
738
  function handleFormatSelect(renderOpts, params) {
729
739
  const { cellValue } = params;
730
740
  return handleSelectCellValue(cellValue, renderOpts);
@@ -954,6 +964,7 @@ renderer.mixin({
954
964
  }
955
965
  return getCellLabelVNs(h, renderOpts, params, cellValue);
956
966
  },
967
+ tableCellFormatter: handleFormatDatePicker,
957
968
  renderTableDefault: defaultEditRender,
958
969
  createTableFilterOptions: defaultFilterOptions,
959
970
  renderTableFilter: defaultFilterRender,
@@ -80,7 +80,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
80
80
  const $xeGantt = $xeTable.$xeGantt;
81
81
  const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
82
82
  const { tableData, tableColumn, dragRow, overflowX, overflowY, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData;
83
- const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData;
83
+ const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps } = tableInternalData;
84
84
  const cellOpts = $xeTable.computeCellOpts;
85
85
  const validOpts = $xeTable.computeValidOpts;
86
86
  const checkboxOpts = $xeTable.computeCheckboxOpts;
@@ -99,7 +99,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
99
99
  const areaOpts = $xeTable.computeAreaOpts;
100
100
  const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
101
101
  const { selectCellToRow } = areaOpts;
102
- const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
102
+ const { field, type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
103
103
  const { verticalAlign: allVerticalAlign } = cellOpts;
104
104
  const { actived } = editStore;
105
105
  const rowRest = fullAllDataRowIdData[rowid] || {};
@@ -254,8 +254,8 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
254
254
  }
255
255
  }
256
256
  // 如果编辑列开启显示状态
257
- if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
258
- isDirty = $xeTable.isUpdateByRow(row, column.field);
257
+ if (!fixedHiddenColumn && editConfig && (editOpts.showStatus || editOpts.showUpdateStatus) && keepUpdateFieldMaps[field]) {
258
+ isDirty = $xeTable.isUpdateByRow(row, field);
259
259
  }
260
260
  const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad);
261
261
  let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
@@ -552,6 +552,13 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
552
552
  const expandOpts = $xeTable.computeExpandOpts;
553
553
  const { height: expandHeight, padding, mode: expandMode } = expandOpts;
554
554
  if (expandMode === 'fixed') {
555
+ const currExpHeight = rowRest.expandHeight;
556
+ let expHeight = 0;
557
+ if (rowExpandHeightFlag) {
558
+ if (currExpHeight || expandHeight) {
559
+ expHeight = (currExpHeight || expandHeight || 0) + 1;
560
+ }
561
+ }
555
562
  rows.push(h('tr', {
556
563
  class: 'vxe-body--row-expanded-place',
557
564
  key: `expand_${rowid}`,
@@ -565,7 +572,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
565
572
  colspan: tableColumn.length
566
573
  },
567
574
  style: {
568
- height: `${rowExpandHeightFlag ? (rowRest.expandHeight || expandHeight) : 0}px`
575
+ height: `${expHeight}px`
569
576
  }
570
577
  })
571
578
  ]));
@@ -133,7 +133,7 @@ export const columnProps = {
133
133
  // 内容渲染配置项
134
134
  contentRender: Object,
135
135
  // 聚合函数
136
- aggFunc: [String, Boolean],
136
+ aggFunc: [Boolean, String],
137
137
  // 将单元格复制到剪贴板
138
138
  copyMethod: Function,
139
139
  // 将剪贴单元格的值清除
@@ -155,6 +155,8 @@ export class ColumnInfo {
155
155
  sortNumber: 0,
156
156
  renderSortNumber: 0,
157
157
  renderAggFn: '',
158
+ renderAggDigits: null,
159
+ renderAggFormat: null,
158
160
  renderFixed: '',
159
161
  renderVisible: false,
160
162
  renderWidth: 0,