vxe-gantt 4.0.0-beta.6 → 4.0.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 (51) 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-footer.js +35 -0
  4. package/es/gantt/src/gantt-header.js +2 -16
  5. package/es/gantt/src/gantt-view.js +35 -48
  6. package/es/gantt/src/gantt.js +30 -8
  7. package/es/gantt/src/util.js +0 -6
  8. package/es/gantt/style.css +25 -3
  9. package/es/gantt/style.min.css +1 -1
  10. package/es/style.css +1 -1
  11. package/es/style.min.css +1 -1
  12. package/es/ui/index.js +1 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-gantt/style.css +25 -3
  15. package/es/vxe-gantt/style.min.css +1 -1
  16. package/lib/gantt/src/gantt-body.js +30 -5
  17. package/lib/gantt/src/gantt-body.min.js +1 -1
  18. package/lib/gantt/src/gantt-chart.js +8 -1
  19. package/lib/gantt/src/gantt-chart.min.js +1 -1
  20. package/lib/gantt/src/gantt-footer.js +45 -0
  21. package/lib/gantt/src/gantt-footer.min.js +1 -0
  22. package/lib/gantt/src/gantt-header.js +2 -19
  23. package/lib/gantt/src/gantt-header.min.js +1 -1
  24. package/lib/gantt/src/gantt-view.js +39 -48
  25. package/lib/gantt/src/gantt-view.min.js +1 -1
  26. package/lib/gantt/src/gantt.js +35 -6
  27. package/lib/gantt/src/gantt.min.js +1 -1
  28. package/lib/gantt/src/util.js +0 -7
  29. package/lib/gantt/src/util.min.js +1 -1
  30. package/lib/gantt/style/style.css +25 -3
  31. package/lib/gantt/style/style.min.css +1 -1
  32. package/lib/index.umd.js +273 -136
  33. package/lib/index.umd.min.js +1 -1
  34. package/lib/style.css +1 -1
  35. package/lib/style.min.css +1 -1
  36. package/lib/ui/index.js +1 -1
  37. package/lib/ui/index.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/lib/vxe-gantt/style/style.css +25 -3
  41. package/lib/vxe-gantt/style/style.min.css +1 -1
  42. package/package.json +3 -3
  43. package/packages/gantt/src/gantt-body.ts +23 -6
  44. package/packages/gantt/src/gantt-chart.ts +7 -1
  45. package/packages/gantt/src/gantt-footer.ts +44 -0
  46. package/packages/gantt/src/gantt-header.ts +2 -20
  47. package/packages/gantt/src/gantt-view.ts +40 -55
  48. package/packages/gantt/src/gantt.ts +32 -8
  49. package/packages/gantt/src/util.ts +0 -7
  50. package/styles/components/gantt-module/gantt-chart.scss +1 -3
  51. package/styles/components/gantt.scss +26 -0
@@ -6,6 +6,7 @@ import { getRefElem } from './util'
6
6
  import XEUtils from 'xe-utils'
7
7
  import GanttViewHeaderComponent from './gantt-header'
8
8
  import GanttViewBodyComponent from './gantt-body'
9
+ import GanttViewFooterComponent from './gantt-footer'
9
10
 
10
11
  import type { VxeGanttViewConstructor, GanttViewReactData, GanttViewPrivateRef, VxeGanttPropTypes, VxeGanttDefines, VxeGanttViewPrivateMethods, GanttViewInternalData, VxeGanttViewMethods, GanttViewPrivateComputed, VxeGanttConstructor, VxeGanttPrivateMethods } from '../../../types'
11
12
 
@@ -327,13 +328,15 @@ export default defineVxeComponent({
327
328
  return
328
329
  }
329
330
 
331
+ const scrollbarOpts = computeScrollbarOpts.value
330
332
  const scrollbarXToTop = computeScrollbarXToTop.value
333
+ const scrollbarYToLeft = computeScrollbarYToLeft.value
331
334
 
332
335
  const xLeftCornerEl = refScrollXLeftCornerElem.value
333
336
  const xRightCornerEl = refScrollXRightCornerElem.value
334
337
  const scrollXVirtualEl = refScrollXVirtualElem.value
335
338
 
336
- const osbWidth = scrollbarWidth
339
+ let osbWidth = scrollbarWidth
337
340
  const osbHeight = scrollbarHeight
338
341
 
339
342
  let tbHeight = 0
@@ -346,6 +349,12 @@ export default defineVxeComponent({
346
349
  tFooterHeight = tableInternalData.tFooterHeight
347
350
  }
348
351
 
352
+ let yScrollbarVisible = 'visible'
353
+ if (scrollbarYToLeft || (scrollbarOpts.y && scrollbarOpts.y.visible === false)) {
354
+ osbWidth = 0
355
+ yScrollbarVisible = 'hidden'
356
+ }
357
+
349
358
  const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
350
359
  if (headerScrollElem) {
351
360
  headerScrollElem.style.height = `${tHeaderHeight}px`
@@ -354,6 +363,10 @@ export default defineVxeComponent({
354
363
  if (bodyScrollElem) {
355
364
  bodyScrollElem.style.height = `${tbHeight}px`
356
365
  }
366
+ const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
367
+ if (footerScrollElem) {
368
+ footerScrollElem.style.height = `${tFooterHeight}px`
369
+ }
357
370
 
358
371
  if (scrollXVirtualEl) {
359
372
  scrollXVirtualEl.style.height = `${osbHeight}px`
@@ -377,7 +390,7 @@ export default defineVxeComponent({
377
390
  if (scrollYVirtualEl) {
378
391
  scrollYVirtualEl.style.width = `${osbWidth}px`
379
392
  scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`
380
- scrollYVirtualEl.style.visibility = 'visible'
393
+ scrollYVirtualEl.style.visibility = yScrollbarVisible
381
394
  }
382
395
  const yTopCornerEl = refScrollYTopCornerElem.value
383
396
  if (yTopCornerEl) {
@@ -431,56 +444,7 @@ export default defineVxeComponent({
431
444
  }
432
445
 
433
446
  // 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
- // }
479
-
480
- // calcScrollbar()
481
- // return nextTick().then(() => {
482
- // updateStyle()
483
- // })
447
+
484
448
  // }
485
449
 
486
450
  const updateScrollYSpace = () => {
@@ -733,8 +697,28 @@ export default defineVxeComponent({
733
697
  handleScrollEvent(evnt, isRollY, isRollX, currTopNum, wrapperEl.scrollLeft)
734
698
  }
735
699
  },
736
- updateScrollYSpace,
737
- updateScrollYStatus (sYLoad) {
700
+ handleUpdateSXSpace () {
701
+ const { scrollXLoad, scrollXWidth } = reactData
702
+ const { elemStore } = internalData
703
+
704
+ const layoutList = ['header', 'body', 'footer']
705
+ layoutList.forEach(layout => {
706
+ const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
707
+ if (xSpaceElem) {
708
+ xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : ''
709
+ }
710
+ })
711
+
712
+ const scrollXSpaceEl = refScrollXSpaceElem.value
713
+ if (scrollXSpaceEl) {
714
+ scrollXSpaceEl.style.width = `${scrollXWidth}px`
715
+ }
716
+
717
+ calcScrollbar()
718
+ return nextTick()
719
+ },
720
+ handleUpdateSYSpace: updateScrollYSpace,
721
+ handleUpdateSYStatus (sYLoad) {
738
722
  reactData.scrollYLoad = sYLoad
739
723
  }
740
724
  }
@@ -813,7 +797,8 @@ export default defineVxeComponent({
813
797
  class: 'vxe-gantt-view--viewport-wrapper'
814
798
  }, [
815
799
  h(GanttViewHeaderComponent),
816
- h(GanttViewBodyComponent)
800
+ h(GanttViewBodyComponent),
801
+ h(GanttViewFooterComponent)
817
802
  ])
818
803
  }
819
804
 
@@ -44,6 +44,8 @@ export default defineVxeComponent({
44
44
  editConfig: PropType<VxeTablePropTypes.EditConfig>
45
45
  sortConfig: PropType<VxeTablePropTypes.SortConfig>
46
46
  filterConfig: PropType<VxeTablePropTypes.FilterConfig>
47
+ expandConfig: PropType<VxeTablePropTypes.ExpandConfig>
48
+ aggregateConfig: PropType<VxeTablePropTypes.AggregateConfig>
47
49
  validConfig: PropType<VxeTablePropTypes.ValidConfig>
48
50
  editRules: PropType<VxeTablePropTypes.EditRules>
49
51
  animat: PropType<VxeTablePropTypes.Animat>
@@ -276,10 +278,10 @@ export default defineVxeComponent({
276
278
  const pagerOpts = computePagerOpts.value
277
279
  const isLoading = computeIsLoading.value
278
280
  const tProps = Object.assign({}, tableExtendProps, {
281
+ // 不支持修改的属性
279
282
  showOverflow: true,
280
283
  showHeaderOverflow: true,
281
- showFooterOverflow: true,
282
- showFooter: false
284
+ showFooterOverflow: true
283
285
  })
284
286
  if (isZMax) {
285
287
  if (tableExtendProps.maxHeight) {
@@ -1402,7 +1404,11 @@ export default defineVxeComponent({
1402
1404
  if ($xeTable) {
1403
1405
  const tableProps = $xeTable.props
1404
1406
  const { highlightCurrentRow } = tableProps
1405
- const { computeRowOpts } = $xeTable.getComputeMaps()
1407
+ const tableReactData = $xeTable.reactData
1408
+ const { radioColumn, checkboxColumn } = tableReactData
1409
+ const { computeRadioOpts, computeCheckboxOpts, computeRowOpts } = $xeTable.getComputeMaps()
1410
+ const radioOpts = computeRadioOpts.value
1411
+ const checkboxOpts = computeCheckboxOpts.value
1406
1412
  const rowOpts = computeRowOpts.value
1407
1413
  const { row } = params
1408
1414
  // 如果是当前行
@@ -1413,6 +1419,14 @@ export default defineVxeComponent({
1413
1419
  $rowIndex: $xeTable.getVMRowIndex(row)
1414
1420
  }, params))
1415
1421
  }
1422
+ // 如果是单选框
1423
+ if ((radioColumn && radioOpts.trigger === 'row')) {
1424
+ $xeTable.triggerRadioRowEvent(evnt, params)
1425
+ }
1426
+ // 如果是复选框
1427
+ if ((checkboxColumn && checkboxOpts.trigger === 'row')) {
1428
+ $xeTable.handleToggleCheckRowEvent(evnt, params)
1429
+ }
1416
1430
  }
1417
1431
  $xeGantt.dispatchEvent('task-cell-click', params, evnt)
1418
1432
  },
@@ -1432,6 +1446,7 @@ export default defineVxeComponent({
1432
1446
  loadColumn (columns: any[]) {
1433
1447
  const $xeTable = refTable.value
1434
1448
  XEUtils.eachTree(columns, (column) => {
1449
+ const { type } = column
1435
1450
  if (column.slots) {
1436
1451
  XEUtils.each(column.slots, (func) => {
1437
1452
  if (!XEUtils.isFunction(func)) {
@@ -1441,6 +1456,9 @@ export default defineVxeComponent({
1441
1456
  }
1442
1457
  })
1443
1458
  }
1459
+ if (type === 'expand') {
1460
+ errLog('vxe.error.errProp', ['type=expand', 'type=seq,radio,checkbox,html'])
1461
+ }
1444
1462
  })
1445
1463
  if ($xeTable) {
1446
1464
  return $xeTable.loadColumn(columns)
@@ -1811,7 +1829,10 @@ export default defineVxeComponent({
1811
1829
  class: 'vxe-gantt--resizable-split-number-right'
1812
1830
  }, '20px')
1813
1831
  ])
1814
- ])
1832
+ ]),
1833
+ h('div', {
1834
+ class: 'vxe-gantt--border-line'
1835
+ })
1815
1836
  ])
1816
1837
  )
1817
1838
  break
@@ -1857,10 +1878,7 @@ export default defineVxeComponent({
1857
1878
  ]),
1858
1879
  h('div', {
1859
1880
  class: 'vxe-gantt--layout-footer-wrapper'
1860
- }, renderChildLayout(footKeys)),
1861
- h('div', {
1862
- class: 'vxe-gantt--border-line'
1863
- })
1881
+ }, renderChildLayout(footKeys))
1864
1882
  ]
1865
1883
  }
1866
1884
 
@@ -1954,6 +1972,12 @@ export default defineVxeComponent({
1954
1972
  if (proxyOpts.props) {
1955
1973
  warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
1956
1974
  }
1975
+ if (props.expandConfig) {
1976
+ warnLog('vxe.error.notProp', ['expand-config'])
1977
+ }
1978
+ if (props.aggregateConfig) {
1979
+ warnLog('vxe.error.notProp', ['aggregate-config'])
1980
+ }
1957
1981
 
1958
1982
  if (columns && columns.length) {
1959
1983
  $xeGantt.loadColumn(columns)
@@ -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 {
@@ -259,6 +259,13 @@
259
259
  background-position: right bottom;
260
260
  }
261
261
  }
262
+ &.border--default,
263
+ &.border--full,
264
+ &.border--inner {
265
+ .vxe-gantt-view--footer-wrapper {
266
+ border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
267
+ }
268
+ }
262
269
  &.border--inner {
263
270
  .vxe-gantt--border-line {
264
271
  border-width: 0 0 1px 0;
@@ -531,6 +538,9 @@
531
538
  float: left;
532
539
  }
533
540
  }
541
+ .vxe-gantt-view--header-table {
542
+ height: 100%;
543
+ }
534
544
  .vxe-gantt-view--header-table,
535
545
  .vxe-gantt-view--body-table {
536
546
  border: 0;
@@ -544,6 +554,10 @@
544
554
  .vxe-gantt-view--header-wrapper {
545
555
  background-color: var(--vxe-ui-table-header-background-color);
546
556
  }
557
+ .vxe-gantt-view--footer-wrapper {
558
+ margin-top: calc(var(--vxe-ui-table-border-width) * -1);
559
+ background-color: var(--vxe-ui-table-footer-background-color);
560
+ }
547
561
  .vxe-gantt-view--header-wrapper,
548
562
  .vxe-gantt-view--body-wrapper {
549
563
  overflow: hidden;
@@ -583,6 +597,12 @@
583
597
  &.row--stripe {
584
598
  background-color: var(--vxe-ui-table-row-striped-background-color);
585
599
  }
600
+ &.row--radio {
601
+ background-color: var(--vxe-ui-table-row-radio-checked-background-color);
602
+ }
603
+ &.row--checked {
604
+ background-color: var(--vxe-ui-table-row-checkbox-checked-background-color);
605
+ }
586
606
  &.row--current {
587
607
  background-color: var(--vxe-ui-table-row-current-background-color);
588
608
  }
@@ -591,6 +611,12 @@
591
611
  &.row--stripe {
592
612
  background-color: var(--vxe-ui-table-row-hover-striped-background-color);
593
613
  }
614
+ &.row--radio {
615
+ background-color: var(--vxe-ui-table-row-hover-radio-checked-background-color);
616
+ }
617
+ &.row--checked {
618
+ background-color: var(--vxe-ui-table-row-hover-checkbox-checked-background-color);
619
+ }
594
620
  &.row--current {
595
621
  background-color: var(--vxe-ui-table-row-hover-current-background-color);
596
622
  }