vxe-table 3.18.0-beta.7 → 3.18.0

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 (147) hide show
  1. package/es/locale/lang/ar-EG.js +30 -0
  2. package/es/locale/lang/de-DE.js +30 -0
  3. package/es/locale/lang/en-US.js +42 -12
  4. package/es/locale/lang/es-ES.js +30 -0
  5. package/es/locale/lang/fr-FR.js +30 -0
  6. package/es/locale/lang/hu-HU.js +30 -0
  7. package/es/locale/lang/hy-AM.js +30 -0
  8. package/es/locale/lang/id-ID.js +30 -0
  9. package/es/locale/lang/it-IT.js +30 -0
  10. package/es/locale/lang/ja-JP.js +30 -0
  11. package/es/locale/lang/ko-KR.js +30 -0
  12. package/es/locale/lang/ms-MY.js +30 -0
  13. package/es/locale/lang/nb-NO.js +30 -0
  14. package/es/locale/lang/pt-BR.js +30 -0
  15. package/es/locale/lang/ru-RU.js +30 -0
  16. package/es/locale/lang/th-TH.js +30 -0
  17. package/es/locale/lang/ug-CN.js +30 -0
  18. package/es/locale/lang/uk-UA.js +30 -0
  19. package/es/locale/lang/uz-UZ.js +30 -0
  20. package/es/locale/lang/vi-VN.js +30 -0
  21. package/es/locale/lang/zh-CHT.js +30 -0
  22. package/es/locale/lang/zh-CN.js +32 -0
  23. package/es/style.css +1 -1
  24. package/es/table/module/keyboard/mixin.js +175 -172
  25. package/es/table/src/footer.js +2 -2
  26. package/es/table/src/header.js +2 -2
  27. package/es/table/src/table.js +22 -3
  28. package/es/table/src/util.js +1 -1
  29. package/es/ui/index.js +1 -1
  30. package/es/ui/src/log.js +1 -1
  31. package/lib/index.umd.js +244 -192
  32. package/lib/index.umd.min.js +1 -1
  33. package/lib/locale/lang/ar-EG.js +30 -0
  34. package/lib/locale/lang/ar-EG.min.js +1 -1
  35. package/lib/locale/lang/ar-EG.umd.js +30 -0
  36. package/lib/locale/lang/de-DE.js +30 -0
  37. package/lib/locale/lang/de-DE.min.js +1 -1
  38. package/lib/locale/lang/de-DE.umd.js +30 -0
  39. package/lib/locale/lang/en-US.js +42 -12
  40. package/lib/locale/lang/en-US.min.js +1 -1
  41. package/lib/locale/lang/en-US.umd.js +42 -12
  42. package/lib/locale/lang/es-ES.js +30 -0
  43. package/lib/locale/lang/es-ES.min.js +1 -1
  44. package/lib/locale/lang/es-ES.umd.js +30 -0
  45. package/lib/locale/lang/fr-FR.js +30 -0
  46. package/lib/locale/lang/fr-FR.min.js +1 -1
  47. package/lib/locale/lang/fr-FR.umd.js +30 -0
  48. package/lib/locale/lang/hu-HU.js +30 -0
  49. package/lib/locale/lang/hu-HU.min.js +1 -1
  50. package/lib/locale/lang/hu-HU.umd.js +30 -0
  51. package/lib/locale/lang/hy-AM.js +30 -0
  52. package/lib/locale/lang/hy-AM.min.js +1 -1
  53. package/lib/locale/lang/hy-AM.umd.js +30 -0
  54. package/lib/locale/lang/id-ID.js +30 -0
  55. package/lib/locale/lang/id-ID.min.js +1 -1
  56. package/lib/locale/lang/id-ID.umd.js +30 -0
  57. package/lib/locale/lang/it-IT.js +30 -0
  58. package/lib/locale/lang/it-IT.min.js +1 -1
  59. package/lib/locale/lang/it-IT.umd.js +30 -0
  60. package/lib/locale/lang/ja-JP.js +30 -0
  61. package/lib/locale/lang/ja-JP.min.js +1 -1
  62. package/lib/locale/lang/ja-JP.umd.js +30 -0
  63. package/lib/locale/lang/ko-KR.js +30 -0
  64. package/lib/locale/lang/ko-KR.min.js +1 -1
  65. package/lib/locale/lang/ko-KR.umd.js +30 -0
  66. package/lib/locale/lang/ms-MY.js +30 -0
  67. package/lib/locale/lang/ms-MY.min.js +1 -1
  68. package/lib/locale/lang/ms-MY.umd.js +30 -0
  69. package/lib/locale/lang/nb-NO.js +30 -0
  70. package/lib/locale/lang/nb-NO.min.js +1 -1
  71. package/lib/locale/lang/nb-NO.umd.js +30 -0
  72. package/lib/locale/lang/pt-BR.js +30 -0
  73. package/lib/locale/lang/pt-BR.min.js +1 -1
  74. package/lib/locale/lang/pt-BR.umd.js +30 -0
  75. package/lib/locale/lang/ru-RU.js +30 -0
  76. package/lib/locale/lang/ru-RU.min.js +1 -1
  77. package/lib/locale/lang/ru-RU.umd.js +30 -0
  78. package/lib/locale/lang/th-TH.js +30 -0
  79. package/lib/locale/lang/th-TH.min.js +1 -1
  80. package/lib/locale/lang/th-TH.umd.js +30 -0
  81. package/lib/locale/lang/ug-CN.js +30 -0
  82. package/lib/locale/lang/ug-CN.min.js +1 -1
  83. package/lib/locale/lang/ug-CN.umd.js +30 -0
  84. package/lib/locale/lang/uk-UA.js +30 -0
  85. package/lib/locale/lang/uk-UA.min.js +1 -1
  86. package/lib/locale/lang/uk-UA.umd.js +30 -0
  87. package/lib/locale/lang/uz-UZ.js +30 -0
  88. package/lib/locale/lang/uz-UZ.min.js +1 -1
  89. package/lib/locale/lang/uz-UZ.umd.js +30 -0
  90. package/lib/locale/lang/vi-VN.js +30 -0
  91. package/lib/locale/lang/vi-VN.min.js +1 -1
  92. package/lib/locale/lang/vi-VN.umd.js +30 -0
  93. package/lib/locale/lang/zh-CHT.js +30 -0
  94. package/lib/locale/lang/zh-CHT.min.js +1 -1
  95. package/lib/locale/lang/zh-CHT.umd.js +30 -0
  96. package/lib/locale/lang/zh-CN.js +32 -0
  97. package/lib/locale/lang/zh-CN.min.js +1 -1
  98. package/lib/locale/lang/zh-CN.umd.js +32 -0
  99. package/lib/style.css +1 -1
  100. package/lib/table/module/keyboard/mixin.js +184 -185
  101. package/lib/table/module/keyboard/mixin.min.js +1 -1
  102. package/lib/table/src/footer.js +1 -1
  103. package/lib/table/src/footer.min.js +1 -1
  104. package/lib/table/src/header.js +1 -1
  105. package/lib/table/src/header.min.js +1 -1
  106. package/lib/table/src/table.js +23 -2
  107. package/lib/table/src/table.min.js +1 -1
  108. package/lib/table/src/util.js +2 -2
  109. package/lib/table/src/util.min.js +1 -1
  110. package/lib/ui/index.js +1 -1
  111. package/lib/ui/index.min.js +1 -1
  112. package/lib/ui/src/log.js +1 -1
  113. package/lib/ui/src/log.min.js +1 -1
  114. package/package.json +1 -1
  115. package/packages/locale/lang/ar-EG.ts +30 -0
  116. package/packages/locale/lang/de-DE.ts +30 -0
  117. package/packages/locale/lang/en-US.ts +42 -12
  118. package/packages/locale/lang/es-ES.ts +30 -0
  119. package/packages/locale/lang/fr-FR.ts +30 -0
  120. package/packages/locale/lang/hu-HU.ts +30 -0
  121. package/packages/locale/lang/hy-AM.ts +30 -0
  122. package/packages/locale/lang/id-ID.ts +30 -0
  123. package/packages/locale/lang/it-IT.ts +30 -0
  124. package/packages/locale/lang/ja-JP.ts +30 -0
  125. package/packages/locale/lang/ko-KR.ts +30 -0
  126. package/packages/locale/lang/ms-MY.ts +30 -0
  127. package/packages/locale/lang/nb-NO.ts +30 -0
  128. package/packages/locale/lang/pt-BR.ts +30 -0
  129. package/packages/locale/lang/ru-RU.ts +30 -0
  130. package/packages/locale/lang/th-TH.ts +30 -0
  131. package/packages/locale/lang/ug-CN.ts +30 -0
  132. package/packages/locale/lang/uk-UA.ts +30 -0
  133. package/packages/locale/lang/uz-UZ.ts +30 -0
  134. package/packages/locale/lang/vi-VN.ts +30 -0
  135. package/packages/locale/lang/zh-CHT.ts +30 -0
  136. package/packages/locale/lang/zh-CN.ts +32 -0
  137. package/packages/table/module/keyboard/mixin.ts +169 -165
  138. package/packages/table/src/footer.ts +2 -2
  139. package/packages/table/src/header.ts +2 -2
  140. package/packages/table/src/table.ts +23 -3
  141. package/packages/table/src/util.ts +1 -1
  142. /package/es/{iconfont.1755650997091.ttf → iconfont.1756083626568.ttf} +0 -0
  143. /package/es/{iconfont.1755650997091.woff → iconfont.1756083626568.woff} +0 -0
  144. /package/es/{iconfont.1755650997091.woff2 → iconfont.1756083626568.woff2} +0 -0
  145. /package/lib/{iconfont.1755650997091.ttf → iconfont.1756083626568.ttf} +0 -0
  146. /package/lib/{iconfont.1755650997091.woff → iconfont.1756083626568.woff} +0 -0
  147. /package/lib/{iconfont.1755650997091.woff2 → iconfont.1756083626568.woff2} +0 -0
@@ -129,6 +129,174 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
129
129
  });
130
130
  return params;
131
131
  }
132
+ function handleCheckboxRangeEvent($xeTable, evnt, params) {
133
+ const internalData = $xeTable;
134
+ const { elemStore } = internalData;
135
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
136
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
137
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
138
+ const { column, cell } = params;
139
+ if (column.type === 'checkbox') {
140
+ let bodyWrapperElem = bodyScrollElem;
141
+ if (leftScrollElem && column.fixed === 'left') {
142
+ bodyWrapperElem = leftScrollElem;
143
+ }
144
+ else if (rightScrollElem && column.fixed === 'right') {
145
+ bodyWrapperElem = rightScrollElem;
146
+ }
147
+ if (!bodyWrapperElem) {
148
+ return;
149
+ }
150
+ const el = $xeTable.$refs.refElem;
151
+ const disX = evnt.clientX;
152
+ const disY = evnt.clientY;
153
+ const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
154
+ const trElem = cell.parentNode;
155
+ const selectRecords = $xeTable.getCheckboxRecords();
156
+ let lastRangeRows = [];
157
+ const marginSize = 1;
158
+ const offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
159
+ const startTop = offsetRest.offsetTop + evnt.offsetY;
160
+ const startLeft = offsetRest.offsetLeft + evnt.offsetX;
161
+ const startScrollTop = bodyWrapperElem.scrollTop;
162
+ const rowHeight = trElem.offsetHeight;
163
+ const trRect = trElem.getBoundingClientRect();
164
+ const offsetClientTop = disY - trRect.y;
165
+ let mouseScrollTimeout = null;
166
+ let isMouseScrollDown = false;
167
+ let mouseScrollSpaceSize = 1;
168
+ const triggerEvent = (type, evnt) => {
169
+ $xeTable.dispatchEvent(`checkbox-range-${type}`, {
170
+ records: () => $xeTable.getCheckboxRecords(),
171
+ reserves: () => $xeTable.getCheckboxReserveRecords()
172
+ }, evnt);
173
+ };
174
+ const handleChecked = (evnt) => {
175
+ const { clientX, clientY } = evnt;
176
+ const offsetLeft = clientX - disX;
177
+ const offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
178
+ let rangeHeight = Math.abs(offsetTop);
179
+ let rangeWidth = Math.abs(offsetLeft);
180
+ let rangeTop = startTop;
181
+ let rangeLeft = startLeft;
182
+ if (offsetTop < marginSize) {
183
+ // 向上
184
+ rangeTop += offsetTop;
185
+ if (rangeTop < marginSize) {
186
+ rangeTop = marginSize;
187
+ rangeHeight = startTop;
188
+ }
189
+ }
190
+ else {
191
+ // 向下
192
+ rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
193
+ }
194
+ if (offsetLeft < marginSize) {
195
+ // 向左
196
+ rangeLeft += offsetLeft;
197
+ if (rangeWidth > startLeft) {
198
+ rangeLeft = marginSize;
199
+ rangeWidth = startLeft;
200
+ }
201
+ }
202
+ else {
203
+ // 向右
204
+ rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
205
+ }
206
+ checkboxRangeElem.style.height = `${rangeHeight}px`;
207
+ checkboxRangeElem.style.width = `${rangeWidth}px`;
208
+ checkboxRangeElem.style.left = `${rangeLeft}px`;
209
+ checkboxRangeElem.style.top = `${rangeTop}px`;
210
+ checkboxRangeElem.style.display = 'block';
211
+ const rangeRows = getCheckboxRangeRows($xeTable, evnt, params, trElem, trRect, offsetClientTop, offsetTop < marginSize ? -rangeHeight : rangeHeight);
212
+ // 至少滑动 10px 才能有效匹配
213
+ if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
214
+ const isControlKey = hasControlKey(evnt);
215
+ lastRangeRows = rangeRows;
216
+ if (isControlKey) {
217
+ rangeRows.forEach((row) => {
218
+ $xeTable.handleBatchSelectRows([row], selectRecords.indexOf(row) === -1);
219
+ });
220
+ }
221
+ else {
222
+ $xeTable.setAllCheckboxRow(false);
223
+ $xeTable.handleCheckedCheckboxRow(rangeRows, true, false);
224
+ }
225
+ triggerEvent('change', evnt);
226
+ }
227
+ };
228
+ // 停止鼠标滚动
229
+ const stopMouseScroll = () => {
230
+ clearTimeout(mouseScrollTimeout);
231
+ mouseScrollTimeout = null;
232
+ };
233
+ // 开始鼠标滚动
234
+ const startMouseScroll = (evnt) => {
235
+ stopMouseScroll();
236
+ mouseScrollTimeout = setTimeout(() => {
237
+ if (mouseScrollTimeout) {
238
+ const { scrollLeft, scrollTop, clientHeight, scrollHeight } = bodyWrapperElem;
239
+ const topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
240
+ if (isMouseScrollDown) {
241
+ if (scrollTop + clientHeight < scrollHeight) {
242
+ $xeTable.scrollTo(scrollLeft, scrollTop + topSize);
243
+ startMouseScroll(evnt);
244
+ handleChecked(evnt);
245
+ }
246
+ else {
247
+ stopMouseScroll();
248
+ }
249
+ }
250
+ else {
251
+ if (scrollTop) {
252
+ $xeTable.scrollTo(scrollLeft, scrollTop - topSize);
253
+ startMouseScroll(evnt);
254
+ handleChecked(evnt);
255
+ }
256
+ else {
257
+ stopMouseScroll();
258
+ }
259
+ }
260
+ }
261
+ }, 50);
262
+ };
263
+ addClass(el, 'drag--range');
264
+ document.onmousemove = evnt => {
265
+ evnt.preventDefault();
266
+ evnt.stopPropagation();
267
+ const { clientY } = evnt;
268
+ const { boundingTop } = getAbsolutePos(bodyWrapperElem);
269
+ // 如果超过可视区,触发滚动
270
+ if (clientY < boundingTop) {
271
+ isMouseScrollDown = false;
272
+ mouseScrollSpaceSize = boundingTop - clientY;
273
+ if (!mouseScrollTimeout) {
274
+ startMouseScroll(evnt);
275
+ }
276
+ }
277
+ else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
278
+ isMouseScrollDown = true;
279
+ mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
280
+ if (!mouseScrollTimeout) {
281
+ startMouseScroll(evnt);
282
+ }
283
+ }
284
+ else if (mouseScrollTimeout) {
285
+ stopMouseScroll();
286
+ }
287
+ handleChecked(evnt);
288
+ };
289
+ document.onmouseup = (evnt) => {
290
+ stopMouseScroll();
291
+ removeClass(el, 'drag--range');
292
+ checkboxRangeElem.removeAttribute('style');
293
+ document.onmousemove = null;
294
+ document.onmouseup = null;
295
+ triggerEvent('end', evnt);
296
+ };
297
+ triggerEvent('start', evnt);
298
+ }
299
+ }
132
300
  export default {
133
301
  methods: {
134
302
  // 处理 Tab 键移动
@@ -351,189 +519,24 @@ export default {
351
519
  },
352
520
  handleCellMousedownEvent(evnt, params) {
353
521
  const $xeTable = this;
354
- const { editConfig, editOpts, handleSelected, checkboxConfig, checkboxOpts, mouseConfig, mouseOpts } = this;
522
+ const props = $xeTable;
523
+ const { editConfig, checkboxConfig, mouseConfig } = props;
524
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
525
+ const mouseOpts = $xeTable.computeMouseOpts;
526
+ const editOpts = $xeTable.computeEditOpts;
355
527
  if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaModnEvent) {
356
528
  return $xeTable.triggerCellAreaModnEvent(evnt, params);
357
529
  }
358
530
  else {
359
531
  if (checkboxConfig && checkboxOpts.range) {
360
- this.handleCheckboxRangeEvent(evnt, params);
532
+ handleCheckboxRangeEvent($xeTable, evnt, params);
361
533
  }
362
534
  if (mouseConfig && mouseOpts.selected) {
363
535
  if (!editConfig || editOpts.mode === 'cell') {
364
- handleSelected(params, evnt);
536
+ $xeTable.handleSelected(params, evnt);
365
537
  }
366
538
  }
367
539
  }
368
- },
369
- handleCheckboxRangeEvent(evnt, params) {
370
- const $xeTable = this;
371
- const internalData = $xeTable;
372
- const { elemStore } = internalData;
373
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
374
- const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
375
- const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
376
- const { column, cell } = params;
377
- if (column.type === 'checkbox') {
378
- let bodyWrapperElem = bodyScrollElem;
379
- if (leftScrollElem && column.fixed === 'left') {
380
- bodyWrapperElem = leftScrollElem;
381
- }
382
- else if (rightScrollElem && column.fixed === 'right') {
383
- bodyWrapperElem = rightScrollElem;
384
- }
385
- if (!bodyWrapperElem) {
386
- return;
387
- }
388
- const el = $xeTable.$refs.refElem;
389
- const disX = evnt.clientX;
390
- const disY = evnt.clientY;
391
- const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
392
- const trElem = cell.parentNode;
393
- const selectRecords = this.getCheckboxRecords();
394
- let lastRangeRows = [];
395
- const marginSize = 1;
396
- const offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
397
- const startTop = offsetRest.offsetTop + evnt.offsetY;
398
- const startLeft = offsetRest.offsetLeft + evnt.offsetX;
399
- const startScrollTop = bodyWrapperElem.scrollTop;
400
- const rowHeight = trElem.offsetHeight;
401
- const trRect = trElem.getBoundingClientRect();
402
- const offsetClientTop = disY - trRect.y;
403
- let mouseScrollTimeout = null;
404
- let isMouseScrollDown = false;
405
- let mouseScrollSpaceSize = 1;
406
- const triggerEvent = (type, evnt) => {
407
- this.emitEvent(`checkbox-range-${type}`, {
408
- records: () => this.getCheckboxRecords(),
409
- reserves: () => this.getCheckboxReserveRecords()
410
- }, evnt);
411
- };
412
- const handleChecked = (evnt) => {
413
- const { clientX, clientY } = evnt;
414
- const offsetLeft = clientX - disX;
415
- const offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
416
- let rangeHeight = Math.abs(offsetTop);
417
- let rangeWidth = Math.abs(offsetLeft);
418
- let rangeTop = startTop;
419
- let rangeLeft = startLeft;
420
- if (offsetTop < marginSize) {
421
- // 向上
422
- rangeTop += offsetTop;
423
- if (rangeTop < marginSize) {
424
- rangeTop = marginSize;
425
- rangeHeight = startTop;
426
- }
427
- }
428
- else {
429
- // 向下
430
- rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
431
- }
432
- if (offsetLeft < marginSize) {
433
- // 向左
434
- rangeLeft += offsetLeft;
435
- if (rangeWidth > startLeft) {
436
- rangeLeft = marginSize;
437
- rangeWidth = startLeft;
438
- }
439
- }
440
- else {
441
- // 向右
442
- rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
443
- }
444
- checkboxRangeElem.style.height = `${rangeHeight}px`;
445
- checkboxRangeElem.style.width = `${rangeWidth}px`;
446
- checkboxRangeElem.style.left = `${rangeLeft}px`;
447
- checkboxRangeElem.style.top = `${rangeTop}px`;
448
- checkboxRangeElem.style.display = 'block';
449
- const rangeRows = getCheckboxRangeRows(this, evnt, params, trElem, trRect, offsetClientTop, offsetTop < marginSize ? -rangeHeight : rangeHeight);
450
- // 至少滑动 10px 才能有效匹配
451
- if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
452
- const isControlKey = hasControlKey(evnt);
453
- lastRangeRows = rangeRows;
454
- if (isControlKey) {
455
- rangeRows.forEach((row) => {
456
- $xeTable.handleBatchSelectRows([row], selectRecords.indexOf(row) === -1);
457
- });
458
- }
459
- else {
460
- this.setAllCheckboxRow(false);
461
- this.handleCheckedCheckboxRow(rangeRows, true, false);
462
- }
463
- triggerEvent('change', evnt);
464
- }
465
- };
466
- // 停止鼠标滚动
467
- const stopMouseScroll = () => {
468
- clearTimeout(mouseScrollTimeout);
469
- mouseScrollTimeout = null;
470
- };
471
- // 开始鼠标滚动
472
- const startMouseScroll = (evnt) => {
473
- stopMouseScroll();
474
- mouseScrollTimeout = setTimeout(() => {
475
- if (mouseScrollTimeout) {
476
- const { scrollLeft, scrollTop, clientHeight, scrollHeight } = bodyWrapperElem;
477
- const topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
478
- if (isMouseScrollDown) {
479
- if (scrollTop + clientHeight < scrollHeight) {
480
- this.scrollTo(scrollLeft, scrollTop + topSize);
481
- startMouseScroll(evnt);
482
- handleChecked(evnt);
483
- }
484
- else {
485
- stopMouseScroll();
486
- }
487
- }
488
- else {
489
- if (scrollTop) {
490
- this.scrollTo(scrollLeft, scrollTop - topSize);
491
- startMouseScroll(evnt);
492
- handleChecked(evnt);
493
- }
494
- else {
495
- stopMouseScroll();
496
- }
497
- }
498
- }
499
- }, 50);
500
- };
501
- addClass(el, 'drag--range');
502
- document.onmousemove = evnt => {
503
- evnt.preventDefault();
504
- evnt.stopPropagation();
505
- const { clientY } = evnt;
506
- const { boundingTop } = getAbsolutePos(bodyWrapperElem);
507
- // 如果超过可视区,触发滚动
508
- if (clientY < boundingTop) {
509
- isMouseScrollDown = false;
510
- mouseScrollSpaceSize = boundingTop - clientY;
511
- if (!mouseScrollTimeout) {
512
- startMouseScroll(evnt);
513
- }
514
- }
515
- else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
516
- isMouseScrollDown = true;
517
- mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
518
- if (!mouseScrollTimeout) {
519
- startMouseScroll(evnt);
520
- }
521
- }
522
- else if (mouseScrollTimeout) {
523
- stopMouseScroll();
524
- }
525
- handleChecked(evnt);
526
- };
527
- document.onmouseup = (evnt) => {
528
- stopMouseScroll();
529
- removeClass(el, 'drag--range');
530
- checkboxRangeElem.removeAttribute('style');
531
- document.onmousemove = null;
532
- document.onmouseup = null;
533
- triggerEvent('end', evnt);
534
- };
535
- triggerEvent('start', evnt);
536
- }
537
540
  }
538
541
  }
539
542
  };
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils';
2
2
  import { VxeUI } from '../../ui';
3
3
  import { getClass } from '../../ui/src/utils';
4
4
  import { updateCellTitle } from '../../ui/src/dom';
5
- import { getCellHeight } from './util';
5
+ import { getCalcHeight } from './util';
6
6
  const renderType = 'footer';
7
7
  const { renderer, renderEmptyElement } = VxeUI;
8
8
  function renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData, row, $rowIndex, _rowIndex) {
@@ -25,7 +25,7 @@ function renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData, row, $
25
25
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
26
26
  const cellOpts = $xeTable.computeCellOpts;
27
27
  const footerCellOpts = $xeTable.computeFooterCellOpts;
28
- const currCellHeight = getCellHeight(footerCellOpts.height) || defaultRowHeight;
28
+ const currCellHeight = getCalcHeight(footerCellOpts.height) || defaultRowHeight;
29
29
  return tableColumn.map((column, $columnIndex) => {
30
30
  const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column;
31
31
  const colid = column.id;
@@ -1,7 +1,7 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import { VxeUI } from '../../ui';
3
3
  import { getClass } from '../../ui/src/utils';
4
- import { getCellHeight, convertHeaderColumnToRows } from './util';
4
+ import { getCalcHeight, convertHeaderColumnToRows } from './util';
5
5
  const { renderer, renderEmptyElement } = VxeUI;
6
6
  const cellType = 'header';
7
7
  const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
@@ -22,7 +22,7 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
22
22
  const cellOpts = $xeTable.computeCellOpts;
23
23
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
24
24
  const headerCellOpts = $xeTable.computeHeaderCellOpts;
25
- const currCellHeight = getCellHeight(headerCellOpts.height) || defaultRowHeight;
25
+ const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
26
26
  const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
27
27
  return cols.map((column, $columnIndex) => {
28
28
  const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
@@ -1,7 +1,7 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import { getFuncText, isEnableConf } from '../../ui/src/utils';
3
3
  import { initTpImg } from '../../ui/src/dom';
4
- import { createInternalData, createHandleGetRowId, getCellHeight, hasDeepKey } from './util';
4
+ import { createInternalData, createHandleGetRowId, getCalcHeight, hasDeepKey } from './util';
5
5
  import { VxeUI } from '../../ui';
6
6
  import methods from './methods';
7
7
  import TableBodyComponent from './body';
@@ -864,10 +864,20 @@ export default {
864
864
  },
865
865
  computeHeaderCellOpts() {
866
866
  const $xeTable = this;
867
+ const $xeGantt = $xeTable.$xeGantt;
867
868
  const props = $xeTable;
868
869
  const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig);
870
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
869
871
  const cellOpts = $xeTable.computeCellOpts;
870
- headerCellOpts.height = XEUtils.toNumber(getCellHeight(headerCellOpts.height || cellOpts.height));
872
+ let headCellHeight = XEUtils.toNumber(getCalcHeight(headerCellOpts.height || cellOpts.height));
873
+ if ($xeGantt) {
874
+ const taskScaleConfs = $xeGantt.computeTaskScaleConfs;
875
+ if (taskScaleConfs && taskScaleConfs.length > 2) {
876
+ const ganttMinHeadCellHeight = defaultRowHeight / 2 * taskScaleConfs.length;
877
+ headCellHeight = Math.max(ganttMinHeadCellHeight, headCellHeight);
878
+ }
879
+ }
880
+ headerCellOpts.height = headCellHeight;
871
881
  return headerCellOpts;
872
882
  },
873
883
  computeFooterCellOpts() {
@@ -875,7 +885,7 @@ export default {
875
885
  const props = $xeTable;
876
886
  const footerCellOpts = Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig);
877
887
  const cellOpts = $xeTable.computeCellOpts;
878
- footerCellOpts.height = XEUtils.toNumber(getCellHeight(footerCellOpts.height || cellOpts.height));
888
+ footerCellOpts.height = XEUtils.toNumber(getCalcHeight(footerCellOpts.height || cellOpts.height));
879
889
  return footerCellOpts;
880
890
  },
881
891
  rowOpts() {
@@ -1766,6 +1776,15 @@ export default {
1766
1776
  this.preventEvent(null, 'activated');
1767
1777
  },
1768
1778
  deactivated() {
1779
+ const $xeTable = this;
1780
+ const reactData = $xeTable;
1781
+ const internalData = $xeTable;
1782
+ const { filterStore } = reactData;
1783
+ if (filterStore.visible) {
1784
+ $xeTable.clearFilter();
1785
+ }
1786
+ $xeTable.closeTooltip();
1787
+ internalData.isActivated = false;
1769
1788
  this.preventEvent(null, 'deactivated');
1770
1789
  },
1771
1790
  beforeDestroy() {
@@ -286,7 +286,7 @@ function getElementMarginAndWidth(elem) {
286
286
  }
287
287
  return 0;
288
288
  }
289
- export function getCellHeight(height) {
289
+ export function getCalcHeight(height) {
290
290
  if (height === 'unset') {
291
291
  return 0;
292
292
  }
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.18.0-beta.7";
3
+ export const version = "3.18.0";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.18.0-beta.7"}`;
3
+ const version = `table v${"3.18.0"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);