vxe-table 4.10.14 → 4.10.15

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 (44) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/hook.js +5 -5
  6. package/es/table/src/body.js +57 -43
  7. package/es/table/src/table.js +209 -44
  8. package/es/table/style.css +26 -0
  9. package/es/table/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +26 -0
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/lib/index.css +1 -1
  15. package/lib/index.min.css +1 -1
  16. package/lib/index.umd.js +330 -107
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/style.css +1 -1
  19. package/lib/style.min.css +1 -1
  20. package/lib/table/module/edit/hook.js +10 -5
  21. package/lib/table/module/edit/hook.min.js +1 -1
  22. package/lib/table/src/body.js +65 -58
  23. package/lib/table/src/body.min.js +1 -1
  24. package/lib/table/src/table.js +253 -42
  25. package/lib/table/src/table.min.js +1 -1
  26. package/lib/table/style/style.css +26 -0
  27. package/lib/table/style/style.min.css +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/lib/vxe-table/style/style.css +26 -0
  33. package/lib/vxe-table/style/style.min.css +1 -1
  34. package/package.json +1 -1
  35. package/packages/table/module/edit/hook.ts +5 -5
  36. package/packages/table/src/body.ts +60 -50
  37. package/packages/table/src/table.ts +220 -44
  38. package/styles/components/table.scss +26 -0
  39. /package/es/{iconfont.1739333111603.ttf → iconfont.1739428251944.ttf} +0 -0
  40. /package/es/{iconfont.1739333111603.woff → iconfont.1739428251944.woff} +0 -0
  41. /package/es/{iconfont.1739333111603.woff2 → iconfont.1739428251944.woff2} +0 -0
  42. /package/lib/{iconfont.1739333111603.ttf → iconfont.1739428251944.ttf} +0 -0
  43. /package/lib/{iconfont.1739333111603.woff → iconfont.1739428251944.woff} +0 -0
  44. /package/lib/{iconfont.1739333111603.woff2 → iconfont.1739428251944.woff2} +0 -0
@@ -21,7 +21,7 @@ export default defineComponent({
21
21
  setup(props) {
22
22
  const $xeTable = inject('$xeTable', {});
23
23
  const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
24
- const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeLeftFixedWidth, computeRightFixedWidth, computeResizableOpts } = $xeTable.getComputeMaps();
24
+ const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeResizableOpts } = $xeTable.getComputeMaps();
25
25
  const refElem = ref();
26
26
  const refBodyScroll = ref();
27
27
  const refBodyTable = ref();
@@ -379,7 +379,7 @@ export default defineComponent({
379
379
  };
380
380
  const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
381
381
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
382
- const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
382
+ const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove, rowExpandHeightFlag } = tableReactData;
383
383
  const { fullAllDataRowIdData } = tableInternalData;
384
384
  const checkboxOpts = computeCheckboxOpts.value;
385
385
  const radioOpts = computeRadioOpts.value;
@@ -412,19 +412,19 @@ export default defineComponent({
412
412
  };
413
413
  }
414
414
  const rowid = getRowid($xeTable, row);
415
- const rest = fullAllDataRowIdData[rowid];
415
+ const rowRest = fullAllDataRowIdData[rowid];
416
416
  let rowLevel = 0;
417
417
  let seq = -1;
418
418
  let _rowIndex = 0;
419
- if (rest) {
420
- rowLevel = rest.level;
419
+ if (rowRest) {
420
+ rowLevel = rowRest.level;
421
421
  if (treeConfig && transform && seqMode === 'increasing') {
422
- seq = rest._index + 1;
422
+ seq = rowRest._index + 1;
423
423
  }
424
424
  else {
425
- seq = rest.seq;
425
+ seq = rowRest.seq;
426
426
  }
427
- _rowIndex = rest._index;
427
+ _rowIndex = rowRest._index;
428
428
  }
429
429
  const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
430
430
  // 行是否被展开
@@ -472,39 +472,57 @@ export default defineComponent({
472
472
  // 如果行被展开了
473
473
  if (isExpandRow) {
474
474
  const expandOpts = computeExpandOpts.value;
475
- const { height: expandHeight, padding } = expandOpts;
476
- const cellStyle = {};
477
- if (expandHeight) {
478
- cellStyle.height = `${expandHeight}px`;
479
- }
480
- if (treeConfig) {
481
- cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
475
+ const { height: expandHeight, padding, mode: expandMode } = expandOpts;
476
+ if (expandMode === 'fixed') {
477
+ rows.push(h('tr', {
478
+ class: 'vxe-body--row-expanded-place',
479
+ key: `expand_${rowid}`,
480
+ rowid
481
+ }, [
482
+ h('td', {
483
+ class: 'vxe-body--row-expanded-place-column',
484
+ colspan: tableColumn.length,
485
+ style: {
486
+ height: `${rowExpandHeightFlag ? (rowRest.expandHeight || expandHeight) : 0}px`
487
+ }
488
+ })
489
+ ]));
482
490
  }
483
- const { showOverflow } = expandColumn;
484
- const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
485
- const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
486
- rows.push(h('tr', Object.assign({ class: ['vxe-body--expanded-row', {
487
- 'is--padding': padding
488
- }], key: `expand_${rowid}`, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle) : null }, trOn), [
489
- h('td', {
490
- class: {
491
- 'vxe-body--expanded-column': 1,
492
- 'fixed--hidden': fixedType && !hasFixedColumn,
493
- 'col--ellipsis': hasEllipsis
494
- },
495
- colspan: tableColumn.length
491
+ else {
492
+ const cellStyle = {};
493
+ if (expandHeight) {
494
+ cellStyle.height = `${expandHeight}px`;
495
+ }
496
+ if (treeConfig) {
497
+ cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
498
+ }
499
+ const { showOverflow } = expandColumn;
500
+ const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
501
+ const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
502
+ rows.push(h('tr', {
503
+ class: ['vxe-body--expanded-row', {
504
+ 'is--padding': padding
505
+ }],
506
+ key: `expand_${rowid}`
496
507
  }, [
497
- h('div', {
498
- class: {
499
- 'vxe-body--expanded-cell': 1,
500
- 'is--ellipsis': expandHeight
501
- },
502
- style: cellStyle
508
+ h('td', {
509
+ class: ['vxe-body--expanded-column', {
510
+ 'fixed--hidden': fixedType && !hasFixedColumn,
511
+ 'col--ellipsis': hasEllipsis
512
+ }],
513
+ colspan: tableColumn.length
503
514
  }, [
504
- expandColumn.renderData(expandParams)
515
+ h('div', {
516
+ class: ['vxe-body--expanded-cell', {
517
+ 'is--ellipsis': expandHeight
518
+ }],
519
+ style: cellStyle
520
+ }, [
521
+ expandColumn.renderData(expandParams)
522
+ ])
505
523
  ])
506
- ])
507
- ]));
524
+ ]));
525
+ }
508
526
  }
509
527
  // 如果是树形表格
510
528
  if (isExpandTree) {
@@ -551,14 +569,13 @@ export default defineComponent({
551
569
  const emptyOpts = computeEmptyOpts.value;
552
570
  const mouseOpts = computeMouseOpts.value;
553
571
  const rowDragOpts = computeRowDragOpts.value;
554
- const leftFixedWidth = computeLeftFixedWidth.value;
555
- const rightFixedWidth = computeRightFixedWidth.value;
572
+ const expandOpts = computeExpandOpts.value;
556
573
  let renderDataList = tableData;
557
574
  let renderColumnList = tableColumn;
558
575
  let isOptimizeMode = false;
559
576
  // 如果是使用优化模式
560
577
  if (scrollXLoad || scrollYLoad || isAllOverflow) {
561
- if (expandColumn || spanMethod || footerSpanMethod) {
578
+ if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
562
579
  // 如果不支持优化模式
563
580
  }
564
581
  else {
@@ -639,9 +656,6 @@ export default defineComponent({
639
656
  $xeTable.triggerBodyScrollEvent(evnt, fixedType);
640
657
  }
641
658
  };
642
- if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
643
- ons.onWheel = $xeTable.triggerBodyWheelEvent;
644
- }
645
659
  return h('div', {
646
660
  ref: refElem,
647
661
  class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],