vxe-table 4.10.6-beta.8 → 4.10.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.
Files changed (178) hide show
  1. package/es/grid/src/grid.js +1 -1
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/locale/lang/ar-EG.js +2 -1
  5. package/es/locale/lang/de-DE.js +2 -1
  6. package/es/locale/lang/en-US.js +4 -3
  7. package/es/locale/lang/es-ES.js +2 -1
  8. package/es/locale/lang/fr-FR.js +2 -1
  9. package/es/locale/lang/hu-HU.js +2 -1
  10. package/es/locale/lang/hy-AM.js +2 -1
  11. package/es/locale/lang/it-IT.js +2 -1
  12. package/es/locale/lang/ja-JP.js +2 -1
  13. package/es/locale/lang/ko-KR.js +2 -1
  14. package/es/locale/lang/nb-NO.js +2 -1
  15. package/es/locale/lang/pt-BR.js +2 -1
  16. package/es/locale/lang/ru-RU.js +4 -3
  17. package/es/locale/lang/th-TH.js +2 -1
  18. package/es/locale/lang/ug-CN.js +2 -1
  19. package/es/locale/lang/uk-UA.js +518 -517
  20. package/es/locale/lang/vi-VN.js +2 -1
  21. package/es/locale/lang/zh-CHT.js +2 -1
  22. package/es/locale/lang/zh-CN.js +2 -1
  23. package/es/style.css +1 -1
  24. package/es/style.min.css +1 -1
  25. package/es/table/module/edit/hook.js +7 -7
  26. package/es/table/module/export/hook.js +97 -62
  27. package/es/table/module/keyboard/hook.js +63 -27
  28. package/es/table/src/body.js +128 -81
  29. package/es/table/src/cell.js +41 -55
  30. package/es/table/src/column.js +13 -1
  31. package/es/table/src/columnInfo.js +3 -0
  32. package/es/table/src/emits.js +2 -0
  33. package/es/table/src/footer.js +48 -10
  34. package/es/table/src/header.js +70 -168
  35. package/es/table/src/props.js +14 -4
  36. package/es/table/src/table.js +884 -426
  37. package/es/table/src/util.js +77 -62
  38. package/es/table/style.css +253 -189
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +26 -11
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +253 -189
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/lib/grid/src/grid.js +1 -1
  45. package/lib/grid/src/grid.min.js +1 -1
  46. package/lib/index.css +1 -1
  47. package/lib/index.min.css +1 -1
  48. package/lib/index.umd.js +1533 -917
  49. package/lib/index.umd.min.js +1 -1
  50. package/lib/locale/lang/ar-EG.js +2 -1
  51. package/lib/locale/lang/ar-EG.min.js +1 -1
  52. package/lib/locale/lang/de-DE.js +2 -1
  53. package/lib/locale/lang/de-DE.min.js +1 -1
  54. package/lib/locale/lang/en-US.js +4 -3
  55. package/lib/locale/lang/en-US.min.js +1 -1
  56. package/lib/locale/lang/en-US.umd.js +4 -3
  57. package/lib/locale/lang/es-ES.js +2 -1
  58. package/lib/locale/lang/es-ES.min.js +1 -1
  59. package/lib/locale/lang/es-ES.umd.js +2 -1
  60. package/lib/locale/lang/fr-FR.js +2 -1
  61. package/lib/locale/lang/fr-FR.min.js +1 -1
  62. package/lib/locale/lang/hu-HU.js +2 -1
  63. package/lib/locale/lang/hu-HU.min.js +1 -1
  64. package/lib/locale/lang/hu-HU.umd.js +2 -1
  65. package/lib/locale/lang/hy-AM.js +2 -1
  66. package/lib/locale/lang/hy-AM.min.js +1 -1
  67. package/lib/locale/lang/it-IT.js +2 -1
  68. package/lib/locale/lang/it-IT.min.js +1 -1
  69. package/lib/locale/lang/ja-JP.js +2 -1
  70. package/lib/locale/lang/ja-JP.min.js +1 -1
  71. package/lib/locale/lang/ja-JP.umd.js +2 -1
  72. package/lib/locale/lang/ko-KR.js +2 -1
  73. package/lib/locale/lang/ko-KR.min.js +1 -1
  74. package/lib/locale/lang/ko-KR.umd.js +2 -1
  75. package/lib/locale/lang/nb-NO.js +2 -1
  76. package/lib/locale/lang/nb-NO.min.js +1 -1
  77. package/lib/locale/lang/pt-BR.js +2 -1
  78. package/lib/locale/lang/pt-BR.min.js +1 -1
  79. package/lib/locale/lang/pt-BR.umd.js +2 -1
  80. package/lib/locale/lang/ru-RU.js +4 -3
  81. package/lib/locale/lang/ru-RU.min.js +1 -1
  82. package/lib/locale/lang/ru-RU.umd.js +4 -3
  83. package/lib/locale/lang/th-TH.js +2 -1
  84. package/lib/locale/lang/th-TH.min.js +1 -1
  85. package/lib/locale/lang/ug-CN.js +2 -1
  86. package/lib/locale/lang/ug-CN.min.js +1 -1
  87. package/lib/locale/lang/uk-UA.js +518 -517
  88. package/lib/locale/lang/uk-UA.min.js +1 -1
  89. package/lib/locale/lang/uk-UA.umd.js +518 -517
  90. package/lib/locale/lang/vi-VN.js +2 -1
  91. package/lib/locale/lang/vi-VN.min.js +1 -1
  92. package/lib/locale/lang/zh-CHT.js +2 -1
  93. package/lib/locale/lang/zh-CHT.min.js +1 -1
  94. package/lib/locale/lang/zh-CN.js +2 -1
  95. package/lib/locale/lang/zh-CN.min.js +1 -1
  96. package/lib/locale/lang/zh-CN.umd.js +2 -1
  97. package/lib/style.css +1 -1
  98. package/lib/style.min.css +1 -1
  99. package/lib/table/module/edit/hook.js +7 -2
  100. package/lib/table/module/edit/hook.min.js +1 -1
  101. package/lib/table/module/export/hook.js +97 -57
  102. package/lib/table/module/export/hook.min.js +1 -1
  103. package/lib/table/module/keyboard/hook.js +71 -28
  104. package/lib/table/module/keyboard/hook.min.js +1 -1
  105. package/lib/table/src/body.js +129 -80
  106. package/lib/table/src/body.min.js +1 -1
  107. package/lib/table/src/cell.js +32 -42
  108. package/lib/table/src/cell.min.js +1 -1
  109. package/lib/table/src/column.js +13 -1
  110. package/lib/table/src/column.min.js +1 -1
  111. package/lib/table/src/columnInfo.js +3 -0
  112. package/lib/table/src/columnInfo.min.js +1 -1
  113. package/lib/table/src/emits.js +1 -1
  114. package/lib/table/src/emits.min.js +1 -1
  115. package/lib/table/src/footer.js +48 -8
  116. package/lib/table/src/footer.min.js +1 -1
  117. package/lib/table/src/header.js +54 -181
  118. package/lib/table/src/header.min.js +1 -1
  119. package/lib/table/src/props.js +14 -4
  120. package/lib/table/src/props.min.js +1 -1
  121. package/lib/table/src/table.js +935 -417
  122. package/lib/table/src/table.min.js +1 -1
  123. package/lib/table/src/util.js +100 -82
  124. package/lib/table/src/util.min.js +1 -1
  125. package/lib/table/style/style.css +253 -189
  126. package/lib/table/style/style.min.css +1 -1
  127. package/lib/ui/index.js +26 -11
  128. package/lib/ui/index.min.js +1 -1
  129. package/lib/ui/src/log.js +1 -1
  130. package/lib/ui/src/log.min.js +1 -1
  131. package/lib/vxe-table/style/style.css +253 -189
  132. package/lib/vxe-table/style/style.min.css +1 -1
  133. package/package.json +2 -2
  134. package/packages/grid/src/grid.ts +1 -1
  135. package/packages/locale/lang/ar-EG.ts +2 -1
  136. package/packages/locale/lang/de-DE.ts +2 -1
  137. package/packages/locale/lang/en-US.ts +4 -3
  138. package/packages/locale/lang/es-ES.ts +2 -1
  139. package/packages/locale/lang/fr-FR.ts +2 -1
  140. package/packages/locale/lang/hu-HU.ts +2 -1
  141. package/packages/locale/lang/hy-AM.ts +2 -1
  142. package/packages/locale/lang/it-IT.ts +2 -1
  143. package/packages/locale/lang/ja-JP.ts +2 -1
  144. package/packages/locale/lang/ko-KR.ts +2 -1
  145. package/packages/locale/lang/nb-NO.ts +2 -1
  146. package/packages/locale/lang/pt-BR.ts +2 -1
  147. package/packages/locale/lang/ru-RU.ts +4 -3
  148. package/packages/locale/lang/th-TH.ts +2 -1
  149. package/packages/locale/lang/ug-CN.ts +2 -1
  150. package/packages/locale/lang/uk-UA.ts +518 -517
  151. package/packages/locale/lang/vi-VN.ts +2 -1
  152. package/packages/locale/lang/zh-CHT.ts +2 -1
  153. package/packages/locale/lang/zh-CN.ts +2 -1
  154. package/packages/table/module/edit/hook.ts +7 -7
  155. package/packages/table/module/export/hook.ts +118 -65
  156. package/packages/table/module/keyboard/hook.ts +59 -25
  157. package/packages/table/src/body.ts +148 -91
  158. package/packages/table/src/cell.ts +41 -63
  159. package/packages/table/src/column.ts +13 -1
  160. package/packages/table/src/columnInfo.ts +3 -0
  161. package/packages/table/src/emits.ts +5 -1
  162. package/packages/table/src/footer.ts +51 -11
  163. package/packages/table/src/header.ts +70 -168
  164. package/packages/table/src/props.ts +14 -5
  165. package/packages/table/src/table.ts +890 -428
  166. package/packages/table/src/util.ts +81 -62
  167. package/packages/ui/index.ts +25 -10
  168. package/styles/components/table.scss +319 -271
  169. package/styles/theme/base.scss +4 -6
  170. package/styles/theme/dark.scss +1 -0
  171. package/styles/theme/light.scss +1 -0
  172. package/styles/variable.scss +1 -1
  173. /package/es/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
  174. /package/es/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
  175. /package/es/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
  176. /package/lib/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
  177. /package/lib/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
  178. /package/lib/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
@@ -123,7 +123,18 @@ function getTxtCellValue(val, vMaps) {
123
123
  const rest = replaceTxtCell(val, vMaps);
124
124
  return rest.replace(/^"+$/g, (qVal) => '"'.repeat(Math.ceil(qVal.length / 2)));
125
125
  }
126
- function parseCsvAndTxt(columns, content, cellSeparator) {
126
+ function toExportField(tableConf, field) {
127
+ const { fieldMaps, titleMaps } = tableConf;
128
+ // title 转 field
129
+ if (!fieldMaps[field]) {
130
+ const teCol = titleMaps[field];
131
+ if (teCol && teCol.field) {
132
+ field = teCol.field;
133
+ }
134
+ }
135
+ return field;
136
+ }
137
+ function parseCsvAndTxt(tableConf, content, cellSeparator) {
127
138
  const list = content.split(enterSymbol);
128
139
  const rows = [];
129
140
  let fields = [];
@@ -144,7 +155,7 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
144
155
  });
145
156
  const cells = rVal.split(cellSeparator);
146
157
  if (!fields.length) {
147
- fields = cells.map((val) => getTxtCellValue(val.trim(), vMaps));
158
+ fields = cells.map((val) => toExportField(tableConf, getTxtCellValue(val.trim(), vMaps)));
148
159
  }
149
160
  else {
150
161
  cells.forEach((val, colIndex) => {
@@ -159,13 +170,13 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
159
170
  }
160
171
  return { fields, rows };
161
172
  }
162
- function parseCsv(columns, content) {
163
- return parseCsvAndTxt(columns, content, ',');
173
+ function parseCsv(tableConf, content) {
174
+ return parseCsvAndTxt(tableConf, content, ',');
164
175
  }
165
- function parseTxt(columns, content) {
166
- return parseCsvAndTxt(columns, content, '\t');
176
+ function parseTxt(tableConf, content) {
177
+ return parseCsvAndTxt(tableConf, content, '\t');
167
178
  }
168
- function parseHTML(columns, content) {
179
+ function parseHTML(tableConf, content) {
169
180
  const domParser = new DOMParser();
170
181
  const xmlDoc = domParser.parseFromString(content, 'text/html');
171
182
  const bodyNodes = getElementsByTagName(xmlDoc, 'body');
@@ -178,7 +189,7 @@ function parseHTML(columns, content) {
178
189
  if (theadNodes.length) {
179
190
  XEUtils.arrayEach(getElementsByTagName(theadNodes[0], 'tr'), rowNode => {
180
191
  XEUtils.arrayEach(getElementsByTagName(rowNode, 'th'), cellNode => {
181
- fields.push(cellNode.textContent);
192
+ fields.push(toExportField(tableConf, cellNode.textContent || ''));
182
193
  });
183
194
  });
184
195
  const tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
@@ -198,7 +209,7 @@ function parseHTML(columns, content) {
198
209
  }
199
210
  return { fields, rows };
200
211
  }
201
- function parseXML(columns, content) {
212
+ function parseXML(tableConf, content) {
202
213
  const domParser = new DOMParser();
203
214
  const xmlDoc = domParser.parseFromString(content, 'application/xml');
204
215
  const sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
@@ -210,7 +221,7 @@ function parseXML(columns, content) {
210
221
  const rowNodes = getElementsByTagName(tableNodes[0], 'Row');
211
222
  if (rowNodes.length) {
212
223
  XEUtils.arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), cellNode => {
213
- fields.push(cellNode.textContent);
224
+ fields.push(toExportField(tableConf, cellNode.textContent || ''));
214
225
  });
215
226
  XEUtils.arrayEach(rowNodes, (rowNode, index) => {
216
227
  if (index) {
@@ -238,21 +249,6 @@ function clearColumnConvert(columns) {
238
249
  delete column.childNodes;
239
250
  }, { children: 'children' });
240
251
  }
241
- /**
242
- * 检查导入的列是否完整
243
- * @param {Array} fields 字段名列表
244
- * @param {Array} rows 数据列表
245
- */
246
- function checkImportData(columns, fields) {
247
- const tableFields = [];
248
- columns.forEach((column) => {
249
- const field = column.field;
250
- if (field) {
251
- tableFields.push(field);
252
- }
253
- });
254
- return fields.some(field => tableFields.indexOf(field) > -1);
255
- }
256
252
  const tableExportMethodKeys = ['exportData', 'importByFile', 'importData', 'saveFile', 'readFile', 'print', 'getPrintHtml', 'openImport', 'closeImport', 'openExport', 'closeExport', 'openPrint', 'closePrint'];
257
253
  hooks.add('tableExportModule', {
258
254
  setupTable($xeTable) {
@@ -772,22 +768,38 @@ hooks.add('tableExportModule', {
772
768
  const handleImport = (content, opts) => {
773
769
  const { tableFullColumn, _importResolve, _importReject } = internalData;
774
770
  let rest = { fields: [], rows: [] };
771
+ const tableFieldMaps = {};
772
+ const tableTitleMaps = {};
773
+ tableFullColumn.forEach((column) => {
774
+ const field = column.field;
775
+ const title = column.getTitle();
776
+ if (field) {
777
+ tableFieldMaps[field] = column;
778
+ }
779
+ if (title) {
780
+ tableTitleMaps[column.getTitle()] = column;
781
+ }
782
+ });
783
+ const tableConf = {
784
+ fieldMaps: tableFieldMaps,
785
+ titleMaps: tableTitleMaps
786
+ };
775
787
  switch (opts.type) {
776
788
  case 'csv':
777
- rest = parseCsv(tableFullColumn, content);
789
+ rest = parseCsv(tableConf, content);
778
790
  break;
779
791
  case 'txt':
780
- rest = parseTxt(tableFullColumn, content);
792
+ rest = parseTxt(tableConf, content);
781
793
  break;
782
794
  case 'html':
783
- rest = parseHTML(tableFullColumn, content);
795
+ rest = parseHTML(tableConf, content);
784
796
  break;
785
797
  case 'xml':
786
- rest = parseXML(tableFullColumn, content);
798
+ rest = parseXML(tableConf, content);
787
799
  break;
788
800
  }
789
801
  const { fields, rows } = rest;
790
- const status = checkImportData(tableFullColumn, fields);
802
+ const status = fields.some(field => tableFieldMaps[field] || tableTitleMaps[field]);
791
803
  if (status) {
792
804
  $xeTable.createData(rows)
793
805
  .then((data) => {
@@ -897,6 +909,48 @@ hooks.add('tableExportModule', {
897
909
  return Promise.reject(e);
898
910
  });
899
911
  };
912
+ const handleFilterColumns = (exportOpts, column, columns) => {
913
+ return columns.some((item) => {
914
+ if (isColumnInfo(item)) {
915
+ return column.id === item.id;
916
+ }
917
+ else if (XEUtils.isString(item)) {
918
+ return column.field === item;
919
+ }
920
+ else {
921
+ const colid = item.id || item.colId;
922
+ const type = item.type;
923
+ const field = item.field;
924
+ if (colid) {
925
+ return column.id === colid;
926
+ }
927
+ else if (field && type) {
928
+ return column.field === field && column.type === type;
929
+ }
930
+ else if (field) {
931
+ return column.field === field;
932
+ }
933
+ else if (type) {
934
+ return column.type === type;
935
+ }
936
+ }
937
+ return false;
938
+ });
939
+ };
940
+ const handleFilterFields = (exportOpts, column, includeFields, excludeFields) => {
941
+ if (excludeFields) {
942
+ if (XEUtils.includes(excludeFields, column.field)) {
943
+ return false;
944
+ }
945
+ }
946
+ if (includeFields) {
947
+ if (XEUtils.includes(includeFields, column.field)) {
948
+ return true;
949
+ }
950
+ return false;
951
+ }
952
+ return exportOpts.original ? column.field : defaultFilterExportColumn(column);
953
+ };
900
954
  const handleExportAndPrint = (options, isPrint) => {
901
955
  const { treeConfig, showHeader, showFooter } = props;
902
956
  const { initStore, mergeList, mergeFooterList, isGroup, footerTableData, exportStore, exportParams } = reactData;
@@ -922,7 +976,7 @@ hooks.add('tableExportModule', {
922
976
  const modes = defOpts.modes || [];
923
977
  const checkMethod = customOpts.checkMethod;
924
978
  const exportColumns = collectColumn.slice(0);
925
- const { columns } = defOpts;
979
+ const { columns, excludeFields, includeFields } = defOpts;
926
980
  // 处理类型
927
981
  const typeList = types.map((value) => {
928
982
  return {
@@ -945,38 +999,19 @@ hooks.add('tableExportModule', {
945
999
  // 默认选中
946
1000
  XEUtils.eachTree(exportColumns, (column, index, items, path, parent) => {
947
1001
  const isColGroup = column.children && column.children.length;
948
- if (isColGroup || defaultFilterExportColumn(column)) {
949
- column.checked = columns
950
- ? columns.some((item) => {
951
- if (isColumnInfo(item)) {
952
- return column.id === item.id;
953
- }
954
- else if (XEUtils.isString(item)) {
955
- return column.field === item;
956
- }
957
- else {
958
- const colid = item.id || item.colId;
959
- const type = item.type;
960
- const field = item.field;
961
- if (colid) {
962
- return column.id === colid;
963
- }
964
- else if (field && type) {
965
- return column.field === field && column.type === type;
966
- }
967
- else if (field) {
968
- return column.field === field;
969
- }
970
- else if (type) {
971
- return column.type === type;
972
- }
973
- }
974
- return false;
975
- })
976
- : column.visible;
977
- column.halfChecked = false;
978
- column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false);
1002
+ let isChecked = false;
1003
+ if (columns && columns.length) {
1004
+ isChecked = handleFilterColumns(defOpts, column, columns);
1005
+ }
1006
+ else if (excludeFields || includeFields) {
1007
+ isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
1008
+ }
1009
+ else {
1010
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
979
1011
  }
1012
+ column.checked = isChecked;
1013
+ column.halfChecked = false;
1014
+ column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false);
980
1015
  });
981
1016
  // 更新条件
982
1017
  Object.assign(exportStore, {
@@ -28,36 +28,65 @@ hooks.add('tableKeyboardModule', {
28
28
  setupTable($xeTable) {
29
29
  const { props, reactData, internalData } = $xeTable;
30
30
  const { refElem } = $xeTable.getRefMaps();
31
- const { computeEditOpts, computeCheckboxOpts, computeMouseOpts, computeTreeOpts } = $xeTable.getComputeMaps();
31
+ const { computeEditOpts, computeCheckboxOpts, computeMouseOpts, computeTreeOpts, computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps();
32
32
  function getCheckboxRangeRows(evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
33
+ const { showOverflow } = props;
34
+ const { fullAllDataRowIdData, isResizeCellHeight } = internalData;
35
+ const rowOpts = computeRowOpts.value;
36
+ const cellOpts = computeCellOpts.value;
37
+ const defaultRowHeight = computeDefaultRowHeight.value;
38
+ const { row } = params;
33
39
  let countHeight = 0;
34
40
  let rangeRows = [];
35
41
  let moveSize = 0;
36
42
  const isDown = moveRange > 0;
37
- const { scrollYLoad, rowHeight } = reactData;
43
+ const { scrollYLoad } = reactData;
38
44
  const { afterFullData } = internalData;
45
+ if (isDown) {
46
+ moveSize = offsetClientTop + moveRange;
47
+ }
48
+ else {
49
+ moveSize = (trRect.height - offsetClientTop) + Math.abs(moveRange);
50
+ }
39
51
  if (scrollYLoad) {
40
- if (isDown) {
41
- moveSize = offsetClientTop + moveRange;
42
- }
43
- else {
44
- moveSize = (trRect.height - offsetClientTop) + Math.abs(moveRange);
45
- }
46
- const _rowIndex = $xeTable.getVTRowIndex(params.row);
47
- if (isDown) {
48
- rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / rowHeight));
52
+ const _rowIndex = $xeTable.getVTRowIndex(row);
53
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
54
+ if (!isCustomCellHeight && showOverflow) {
55
+ if (isDown) {
56
+ rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
57
+ }
58
+ else {
59
+ rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
60
+ }
49
61
  }
50
62
  else {
51
- rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / rowHeight), _rowIndex + 1);
63
+ if (isDown) {
64
+ for (let i = _rowIndex; i < afterFullData.length; i++) {
65
+ const item = afterFullData[i];
66
+ const rowid = $xeTable.getRowid(item);
67
+ const rowRest = fullAllDataRowIdData[rowid] || {};
68
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
69
+ rangeRows.push(item);
70
+ if (countHeight > moveSize) {
71
+ return rangeRows;
72
+ }
73
+ }
74
+ }
75
+ else {
76
+ for (let len = _rowIndex; len >= 0; len--) {
77
+ const item = afterFullData[len];
78
+ const rowid = $xeTable.getRowid(item);
79
+ const rowRest = fullAllDataRowIdData[rowid] || {};
80
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
81
+ rangeRows.push(item);
82
+ if (countHeight > moveSize) {
83
+ return rangeRows;
84
+ }
85
+ }
86
+ }
52
87
  }
53
88
  }
54
89
  else {
55
- if (isDown) {
56
- moveSize = evnt.clientY - trRect.y;
57
- }
58
- else {
59
- moveSize = trRect.y - evnt.clientY + trRect.height;
60
- }
61
90
  const siblingProp = isDown ? 'next' : 'previous';
62
91
  while (targetTrElem && countHeight < moveSize) {
63
92
  const rowNodeRest = $xeTable.getRowNode(targetTrElem);
@@ -71,19 +100,26 @@ hooks.add('tableKeyboardModule', {
71
100
  return rangeRows;
72
101
  }
73
102
  const handleCheckboxRangeEvent = (evnt, params) => {
103
+ const { elemStore } = internalData;
104
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
105
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
106
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
74
107
  const { column, cell } = params;
75
108
  if (column.type === 'checkbox') {
76
- const el = refElem.value;
77
- const { elemStore } = internalData;
78
- const disX = evnt.clientX;
79
- const disY = evnt.clientY;
80
- const bodyWrapperElem = getRefElem(elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper']);
109
+ let bodyWrapperElem = bodyScrollElem;
110
+ if (leftScrollElem && column.fixed === 'left') {
111
+ bodyWrapperElem = leftScrollElem;
112
+ }
113
+ else if (rightScrollElem && column.fixed === 'right') {
114
+ bodyWrapperElem = rightScrollElem;
115
+ }
81
116
  if (!bodyWrapperElem) {
82
117
  return;
83
118
  }
119
+ const el = refElem.value;
120
+ const disX = evnt.clientX;
121
+ const disY = evnt.clientY;
84
122
  const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
85
- const domMousemove = document.onmousemove;
86
- const domMouseup = document.onmouseup;
87
123
  const trElem = cell.parentElement;
88
124
  const selectRecords = $xeTable.getCheckboxRecords();
89
125
  let lastRangeRows = [];
@@ -219,8 +255,8 @@ hooks.add('tableKeyboardModule', {
219
255
  stopMouseScroll();
220
256
  removeClass(el, 'drag--range');
221
257
  checkboxRangeElem.removeAttribute('style');
222
- document.onmousemove = domMousemove;
223
- document.onmouseup = domMouseup;
258
+ document.onmousemove = null;
259
+ document.onmouseup = null;
224
260
  triggerEvent('end', evnt);
225
261
  };
226
262
  triggerEvent('start', evnt);