vxe-gantt 4.0.0-beta.5 → 4.0.0-beta.7

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 (47) hide show
  1. package/es/gantt/src/gantt-body.js +23 -6
  2. package/es/gantt/src/gantt-chart.js +6 -1
  3. package/es/gantt/src/gantt-header.js +1 -15
  4. package/es/gantt/src/gantt-view.js +34 -62
  5. package/es/gantt/src/gantt.js +18 -6
  6. package/es/gantt/src/util.js +0 -6
  7. package/es/gantt/style.css +17 -3
  8. package/es/gantt/style.min.css +1 -1
  9. package/es/style.css +1 -1
  10. package/es/style.min.css +1 -1
  11. package/es/ui/index.js +1 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-gantt/style.css +17 -3
  14. package/es/vxe-gantt/style.min.css +1 -1
  15. package/lib/gantt/src/gantt-body.js +30 -5
  16. package/lib/gantt/src/gantt-body.min.js +1 -1
  17. package/lib/gantt/src/gantt-chart.js +8 -1
  18. package/lib/gantt/src/gantt-chart.min.js +1 -1
  19. package/lib/gantt/src/gantt-header.js +1 -18
  20. package/lib/gantt/src/gantt-header.min.js +1 -1
  21. package/lib/gantt/src/gantt-view.js +39 -69
  22. package/lib/gantt/src/gantt-view.min.js +1 -1
  23. package/lib/gantt/src/gantt.js +21 -4
  24. package/lib/gantt/src/gantt.min.js +1 -1
  25. package/lib/gantt/src/util.js +0 -7
  26. package/lib/gantt/src/util.min.js +1 -1
  27. package/lib/gantt/style/style.css +17 -3
  28. package/lib/gantt/style/style.min.css +1 -1
  29. package/lib/index.umd.js +221 -157
  30. package/lib/index.umd.min.js +1 -1
  31. package/lib/style.css +1 -1
  32. package/lib/style.min.css +1 -1
  33. package/lib/ui/index.js +1 -1
  34. package/lib/ui/index.min.js +1 -1
  35. package/lib/ui/src/log.js +1 -1
  36. package/lib/ui/src/log.min.js +1 -1
  37. package/lib/vxe-gantt/style/style.css +17 -3
  38. package/lib/vxe-gantt/style/style.min.css +1 -1
  39. package/package.json +3 -3
  40. package/packages/gantt/src/gantt-body.ts +23 -6
  41. package/packages/gantt/src/gantt-chart.ts +7 -1
  42. package/packages/gantt/src/gantt-header.ts +1 -19
  43. package/packages/gantt/src/gantt-view.ts +37 -67
  44. package/packages/gantt/src/gantt.ts +18 -6
  45. package/packages/gantt/src/util.ts +0 -7
  46. package/styles/components/gantt-module/gantt-chart.scss +1 -3
  47. package/styles/components/gantt.scss +15 -0
@@ -41,7 +41,7 @@ function createInternalData (): GanttViewInternalData {
41
41
  }
42
42
  }
43
43
  const maxYHeight = 5e6
44
- const maxXWidth = 5e6
44
+ // const maxXWidth = 5e6
45
45
 
46
46
  export default defineVxeComponent({
47
47
  name: 'VxeGanttView',
@@ -75,9 +75,9 @@ export default defineVxeComponent({
75
75
  // 是否启用了纵向 Y 可视渲染方式加载
76
76
  scrollYLoad: false,
77
77
  // 是否存在纵向滚动条
78
- overflowY: false,
78
+ overflowY: true,
79
79
  // 是否存在横向滚动条
80
- overflowX: false,
80
+ overflowX: true,
81
81
  // 纵向滚动条的宽度
82
82
  scrollbarWidth: 0,
83
83
  // 横向滚动条的高度
@@ -430,61 +430,11 @@ export default defineVxeComponent({
430
430
  return nextTick()
431
431
  }
432
432
 
433
- const updateScrollXSpace = () => {
434
- const { scrollXLoad, scrollXWidth } = reactData
435
- const { elemStore } = internalData
436
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
437
- const bodyTableElem = getRefElem(elemStore['main-body-table'])
438
-
439
- let xSpaceLeft = 0
440
-
441
- let clientWidth = 0
442
- if (bodyScrollElem) {
443
- clientWidth = bodyScrollElem.clientWidth
444
- }
445
- // 虚拟渲染
446
- let isScrollXBig = false
447
- let ySpaceWidth = scrollXWidth
448
- if (scrollXWidth > maxXWidth) {
449
- // 触右
450
- if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollLeft + clientWidth >= maxXWidth) {
451
- xSpaceLeft = maxXWidth - bodyTableElem.clientWidth
452
- } else {
453
- xSpaceLeft = (maxXWidth - clientWidth) * (xSpaceLeft / (scrollXWidth - clientWidth))
454
- }
455
- ySpaceWidth = maxXWidth
456
- isScrollXBig = true
457
- }
458
-
459
- if (bodyTableElem) {
460
- bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`
461
- }
462
-
463
- const layoutList = ['header', 'body', 'footer']
464
- layoutList.forEach(layout => {
465
- const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
466
- if (xSpaceElem) {
467
- xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : ''
468
- }
469
- })
470
-
471
- reactData.scrollXLeft = xSpaceLeft
472
- reactData.scrollXWidth = ySpaceWidth
473
- reactData.isScrollXBig = isScrollXBig
474
-
475
- const scrollXSpaceEl = refScrollXSpaceElem.value
476
- if (scrollXSpaceEl) {
477
- scrollXSpaceEl.style.width = `${ySpaceWidth}px`
478
- }
433
+ // const updateScrollXSpace = () => {
479
434
 
480
- calcScrollbar()
481
- return nextTick().then(() => {
482
- updateStyle()
483
- })
484
- }
435
+ // }
485
436
 
486
437
  const updateScrollYSpace = () => {
487
- const { scrollYLoad, overflowY } = reactData
488
438
  const { elemStore } = internalData
489
439
  const $xeTable = internalData.xeTable
490
440
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
@@ -516,21 +466,19 @@ export default defineVxeComponent({
516
466
  }
517
467
  ySpaceHeight = maxYHeight
518
468
  }
519
- if (!(scrollYLoad && overflowY)) {
520
- scrollYTop = 0
521
- }
522
469
 
470
+ const bodyChartWrapperElem = getRefElem(elemStore['main-chart-wrapper'])
523
471
  if (bodyTableElem) {
524
472
  bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`
525
473
  }
474
+ if (bodyChartWrapperElem) {
475
+ bodyChartWrapperElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`
476
+ }
526
477
 
527
- const layoutList = ['header', 'body', 'footer']
528
- layoutList.forEach(layout => {
529
- const ySpaceElem = getRefElem(elemStore[`main-${layout}-ySpace`])
530
- if (ySpaceElem) {
531
- ySpaceElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
532
- }
533
- })
478
+ const bodyYSpaceElem = getRefElem(elemStore['main-body-ySpace'])
479
+ if (bodyYSpaceElem) {
480
+ bodyYSpaceElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
481
+ }
534
482
 
535
483
  const scrollYSpaceEl = refScrollYSpaceElem.value
536
484
  if (scrollYSpaceEl) {
@@ -736,8 +684,30 @@ export default defineVxeComponent({
736
684
  handleScrollEvent(evnt, isRollY, isRollX, currTopNum, wrapperEl.scrollLeft)
737
685
  }
738
686
  },
739
- updateScrollXSpace,
740
- updateScrollYSpace
687
+ handleUpdateSXSpace () {
688
+ const { scrollXLoad, scrollXWidth } = reactData
689
+ const { elemStore } = internalData
690
+
691
+ const layoutList = ['header', 'body', 'footer']
692
+ layoutList.forEach(layout => {
693
+ const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
694
+ if (xSpaceElem) {
695
+ xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : ''
696
+ }
697
+ })
698
+
699
+ const scrollXSpaceEl = refScrollXSpaceElem.value
700
+ if (scrollXSpaceEl) {
701
+ scrollXSpaceEl.style.width = `${scrollXWidth}px`
702
+ }
703
+
704
+ calcScrollbar()
705
+ return nextTick()
706
+ },
707
+ handleUpdateSYSpace: updateScrollYSpace,
708
+ handleUpdateSYStatus (sYLoad) {
709
+ reactData.scrollYLoad = sYLoad
710
+ }
741
711
  }
742
712
 
743
713
  const handleGlobalResizeEvent = () => {
@@ -1402,7 +1402,11 @@ export default defineVxeComponent({
1402
1402
  if ($xeTable) {
1403
1403
  const tableProps = $xeTable.props
1404
1404
  const { highlightCurrentRow } = tableProps
1405
- const { computeRowOpts } = $xeTable.getComputeMaps()
1405
+ const tableReactData = $xeTable.reactData
1406
+ const { radioColumn, checkboxColumn } = tableReactData
1407
+ const { computeRadioOpts, computeCheckboxOpts, computeRowOpts } = $xeTable.getComputeMaps()
1408
+ const radioOpts = computeRadioOpts.value
1409
+ const checkboxOpts = computeCheckboxOpts.value
1406
1410
  const rowOpts = computeRowOpts.value
1407
1411
  const { row } = params
1408
1412
  // 如果是当前行
@@ -1413,6 +1417,14 @@ export default defineVxeComponent({
1413
1417
  $rowIndex: $xeTable.getVMRowIndex(row)
1414
1418
  }, params))
1415
1419
  }
1420
+ // 如果是单选框
1421
+ if ((radioColumn && radioOpts.trigger === 'row')) {
1422
+ $xeTable.triggerRadioRowEvent(evnt, params)
1423
+ }
1424
+ // 如果是复选框
1425
+ if ((checkboxColumn && checkboxOpts.trigger === 'row')) {
1426
+ $xeTable.handleToggleCheckRowEvent(evnt, params)
1427
+ }
1416
1428
  }
1417
1429
  $xeGantt.dispatchEvent('task-cell-click', params, evnt)
1418
1430
  },
@@ -1811,7 +1823,10 @@ export default defineVxeComponent({
1811
1823
  class: 'vxe-gantt--resizable-split-number-right'
1812
1824
  }, '20px')
1813
1825
  ])
1814
- ])
1826
+ ]),
1827
+ h('div', {
1828
+ class: 'vxe-gantt--border-line'
1829
+ })
1815
1830
  ])
1816
1831
  )
1817
1832
  break
@@ -1857,10 +1872,7 @@ export default defineVxeComponent({
1857
1872
  ]),
1858
1873
  h('div', {
1859
1874
  class: 'vxe-gantt--layout-footer-wrapper'
1860
- }, renderChildLayout(footKeys)),
1861
- h('div', {
1862
- class: 'vxe-gantt--border-line'
1863
- })
1875
+ }, renderChildLayout(footKeys))
1864
1876
  ]
1865
1877
  }
1866
1878
 
@@ -10,13 +10,6 @@ export function getRefElem (refEl: any) {
10
10
  return null
11
11
  }
12
12
 
13
- export function getCellHeight (height: number | 'unset' | undefined | null) {
14
- if (height === 'unset') {
15
- return 0
16
- }
17
- return height || 0
18
- }
19
-
20
13
  export function getCellRestHeight (rowRest: VxeTableDefines.RowCacheItem, cellOpts: VxeTablePropTypes.CellConfig, rowOpts: VxeTablePropTypes.RowConfig, defaultRowHeight: number) {
21
14
  return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
22
15
  }
@@ -14,9 +14,6 @@
14
14
  border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius);
15
15
  }
16
16
  }
17
- & > .vxe-gantt-view--chart-progress {
18
- border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius) 0 0 var(--vxe-ui-gantt-view-task-bar-border-radius);
19
- }
20
17
  }
21
18
  }
22
19
  }
@@ -31,6 +28,7 @@
31
28
  transform: translateY(-50%);
32
29
  height: var(--vxe-ui-gantt-view-chart-bar-height);
33
30
  background-color: var(--vxe-ui-gantt-view-task-bar-background-color);
31
+ overflow: hidden;
34
32
  pointer-events: all;
35
33
  &:hover {
36
34
  &::after {
@@ -531,6 +531,9 @@
531
531
  float: left;
532
532
  }
533
533
  }
534
+ .vxe-gantt-view--header-table {
535
+ height: 100%;
536
+ }
534
537
  .vxe-gantt-view--header-table,
535
538
  .vxe-gantt-view--body-table {
536
539
  border: 0;
@@ -583,6 +586,12 @@
583
586
  &.row--stripe {
584
587
  background-color: var(--vxe-ui-table-row-striped-background-color);
585
588
  }
589
+ &.row--radio {
590
+ background-color: var(--vxe-ui-table-row-radio-checked-background-color);
591
+ }
592
+ &.row--checked {
593
+ background-color: var(--vxe-ui-table-row-checkbox-checked-background-color);
594
+ }
586
595
  &.row--current {
587
596
  background-color: var(--vxe-ui-table-row-current-background-color);
588
597
  }
@@ -591,6 +600,12 @@
591
600
  &.row--stripe {
592
601
  background-color: var(--vxe-ui-table-row-hover-striped-background-color);
593
602
  }
603
+ &.row--radio {
604
+ background-color: var(--vxe-ui-table-row-hover-radio-checked-background-color);
605
+ }
606
+ &.row--checked {
607
+ background-color: var(--vxe-ui-table-row-hover-checkbox-checked-background-color);
608
+ }
594
609
  &.row--current {
595
610
  background-color: var(--vxe-ui-table-row-hover-current-background-color);
596
611
  }