vxe-gantt 4.0.0-beta.0 → 4.0.0-beta.1

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 (69) hide show
  1. package/README.md +1 -1
  2. package/es/gantt/src/emits.js +5 -1
  3. package/es/gantt/src/gantt-body.js +11 -2
  4. package/es/gantt/src/gantt-chart.js +35 -14
  5. package/es/gantt/src/gantt-header.js +5 -2
  6. package/es/gantt/src/gantt-view.js +5 -1
  7. package/es/gantt/src/gantt.js +84 -32
  8. package/es/gantt/src/grid-props.js +1 -1
  9. package/es/gantt/src/props.js +1 -1
  10. package/es/gantt/src/table-props.js +1 -1
  11. package/es/gantt/style.css +36 -17
  12. package/es/gantt/style.min.css +1 -1
  13. package/es/style.css +1 -1
  14. package/es/style.min.css +1 -1
  15. package/es/ui/index.js +9 -2
  16. package/es/ui/src/log.js +3 -2
  17. package/es/ui/src/utils.js +3 -0
  18. package/es/vxe-gantt/style.css +36 -17
  19. package/es/vxe-gantt/style.min.css +1 -1
  20. package/helper/vetur/attributes.json +1 -1
  21. package/helper/vetur/tags.json +1 -1
  22. package/lib/gantt/src/emits.js +1 -1
  23. package/lib/gantt/src/emits.min.js +1 -1
  24. package/lib/gantt/src/gantt-body.js +16 -2
  25. package/lib/gantt/src/gantt-body.min.js +1 -1
  26. package/lib/gantt/src/gantt-chart.js +47 -10
  27. package/lib/gantt/src/gantt-chart.min.js +1 -1
  28. package/lib/gantt/src/gantt-header.js +6 -2
  29. package/lib/gantt/src/gantt-header.min.js +1 -1
  30. package/lib/gantt/src/gantt-view.js +6 -2
  31. package/lib/gantt/src/gantt-view.min.js +1 -1
  32. package/lib/gantt/src/gantt.js +101 -35
  33. package/lib/gantt/src/gantt.min.js +1 -1
  34. package/lib/gantt/src/grid-props.js +2 -2
  35. package/lib/gantt/src/grid-props.min.js +1 -1
  36. package/lib/gantt/src/props.js +2 -1
  37. package/lib/gantt/src/props.min.js +1 -1
  38. package/lib/gantt/src/table-props.js +2 -2
  39. package/lib/gantt/src/table-props.min.js +1 -1
  40. package/lib/gantt/style/style.css +36 -17
  41. package/lib/gantt/style/style.min.css +1 -1
  42. package/lib/index.umd.js +214 -73
  43. package/lib/index.umd.min.js +1 -1
  44. package/lib/style.css +1 -1
  45. package/lib/style.min.css +1 -1
  46. package/lib/ui/index.js +13 -3
  47. package/lib/ui/index.min.js +1 -1
  48. package/lib/ui/src/log.js +6 -3
  49. package/lib/ui/src/log.min.js +1 -1
  50. package/lib/ui/src/utils.js +4 -0
  51. package/lib/ui/src/utils.min.js +1 -1
  52. package/lib/vxe-gantt/style/style.css +36 -17
  53. package/lib/vxe-gantt/style/style.min.css +1 -1
  54. package/package.json +4 -4
  55. package/packages/gantt/src/emits.ts +6 -1
  56. package/packages/gantt/src/gantt-body.ts +11 -2
  57. package/packages/gantt/src/gantt-chart.ts +26 -9
  58. package/packages/gantt/src/gantt-header.ts +5 -2
  59. package/packages/gantt/src/gantt-view.ts +5 -1
  60. package/packages/gantt/src/gantt.ts +88 -30
  61. package/packages/gantt/src/grid-props.ts +1 -1
  62. package/packages/gantt/src/props.ts +2 -1
  63. package/packages/gantt/src/table-props.ts +1 -1
  64. package/packages/ui/index.ts +9 -1
  65. package/packages/ui/src/log.ts +3 -1
  66. package/packages/ui/src/utils.ts +4 -0
  67. package/styles/components/gantt-module/gantt-chart.scss +28 -9
  68. package/styles/components/gantt.scss +12 -7
  69. package/styles/theme/base.scss +5 -1
@@ -1,4 +1,6 @@
1
- import { VxeUI, setConfig, setIcon } from '@vxe-ui/core'
1
+ import { VxeUI } from '@vxe-ui/core'
2
+
3
+ const { setConfig, setIcon } = VxeUI
2
4
 
3
5
  VxeUI.ganttVersion = process.env.VUE_APP_VXE_VERSION as string
4
6
 
@@ -39,6 +41,12 @@ setConfig({
39
41
  // afterDelete: null,
40
42
  // beforeSave: null,
41
43
  // afterSave: null
44
+ },
45
+ taskSplitConfig: {
46
+ enabled: true,
47
+ resize: true,
48
+ showCollapseTableButton: true,
49
+ showCollapseTaskButton: true
42
50
  }
43
51
  }
44
52
  })
@@ -1,4 +1,6 @@
1
- import { log } from '@vxe-ui/core'
1
+ import { VxeUI } from '@vxe-ui/core'
2
+
3
+ const { log } = VxeUI
2
4
 
3
5
  const version = `gantt v${process.env.VUE_APP_VXE_VERSION}`
4
6
 
@@ -48,3 +48,7 @@ export function formatText (value: any, placeholder?: any) {
48
48
  export function eqEmptyValue (cellValue: any) {
49
49
  return cellValue === '' || XEUtils.eqNull(cellValue)
50
50
  }
51
+
52
+ export function getStringValue (cellValue: any) {
53
+ return eqEmptyValue(cellValue) ? '' : cellValue
54
+ }
@@ -6,19 +6,31 @@
6
6
  }
7
7
  .vxe-gantt-view--chart-row {
8
8
  position: relative;
9
+ &.is--round {
10
+ & > .vxe-gantt-view--chart-bar {
11
+ border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius);
12
+ &:hover {
13
+ &::after {
14
+ border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius);
15
+ }
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
+ }
21
+ }
9
22
  }
10
23
  .vxe-gantt-view--chart-bar {
11
24
  display: flex;
12
25
  flex-direction: row;
26
+ align-items: center;
13
27
  position: absolute;
14
- width: 0;
15
28
  top: 50%;
16
29
  left: 0;
17
30
  color: #ffffff;
18
31
  transform: translateY(-50%);
19
- border-radius: var(--vxe-ui-base-border-radius);
20
32
  height: var(--vxe-ui-gantt-view-chart-bar-height);
21
- background-color: var(--vxe-ui-font-primary-lighten-color);
33
+ background-color: var(--vxe-ui-gantt-view-task-bar-background-color);
22
34
  pointer-events: all;
23
35
  &:hover {
24
36
  &::after {
@@ -29,18 +41,25 @@
29
41
  width: 100%;
30
42
  height: 100%;
31
43
  background-color: rgba(0, 0, 0, 0.1);
32
- border-radius: var(--vxe-ui-base-border-radius);
33
44
  }
34
45
  }
35
46
  }
36
47
  .vxe-gantt-view--chart-progress {
37
48
  flex-shrink: 0;
38
- width: 40px;
49
+ width: 0;
50
+ height: 100%;
39
51
  text-align: left;
40
- border-radius: var(--vxe-ui-base-border-radius) 0 0 var(--vxe-ui-base-border-radius);
41
- background-color: var(--vxe-ui-font-primary-color);
52
+ background-color: var(--vxe-ui-gantt-view-task-bar-completed-background-color);
53
+ overflow: hidden;
54
+ text-overflow: ellipsis;
55
+ white-space: nowrap;
42
56
  }
43
57
  .vxe-gantt-view--chart-content {
44
- flex-grow: 1;
45
- text-align: right;
58
+ position: absolute;
59
+ width: 100%;
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ white-space: nowrap;
63
+ font-size: 0.9em;
64
+ padding: 0 0.6em;
46
65
  }
@@ -75,9 +75,11 @@
75
75
  }
76
76
  .vxe-gantt--view-split-bar {
77
77
  flex-shrink: 0;
78
- cursor: col-resize;
79
78
  width: var(--vxe-ui-gantt-view-split-bar-width);
80
79
  background-color: var(--vxe-ui-gantt-view-split-bar-background-color);
80
+ &.is--resize {
81
+ cursor: col-resize;
82
+ }
81
83
  }
82
84
  &.show--left {
83
85
  .vxe-gantt--table-wrapper {
@@ -87,7 +89,7 @@
87
89
  .vxe-gantt--table-wrapper {
88
90
  flex-grow: unset;
89
91
  flex-shrink: 0;
90
- width: 30%;
92
+ width: var(--vxe-ui-gantt-view-table-default-width);
91
93
  }
92
94
  }
93
95
  }
@@ -279,6 +281,12 @@
279
281
  transform: translate(-50%, -50%);
280
282
  z-index: 15;
281
283
  pointer-events: none;
284
+ & > div {
285
+ margin-top: 1em;
286
+ &:first-child {
287
+ margin-top: 0;
288
+ }
289
+ }
282
290
  }
283
291
  .vxe-gantt--view-split-bar-left-btn,
284
292
  .vxe-gantt--view-split-bar-right-btn {
@@ -304,9 +312,6 @@
304
312
  transform: scale(0.9);
305
313
  }
306
314
  }
307
- .vxe-gantt--view-split-bar-right-btn {
308
- margin-top: 1em;
309
- }
310
315
  .vxe-gantt--resizable-split-tip {
311
316
  display: none;
312
317
  position: absolute;
@@ -496,7 +501,7 @@
496
501
  overflow: hidden;
497
502
  }
498
503
  .vxe-gantt-view--column-info {
499
- width: var(--vxe-ui-gantt-view-column-width);
504
+ width: var(--vxe-ui-gantt-view-default-cell-width);
500
505
  }
501
506
 
502
507
  // 任务视图
@@ -523,7 +528,7 @@
523
528
  border-collapse: separate;
524
529
  table-layout: fixed;
525
530
  col {
526
- width: var(--vxe-ui-gantt-view-column-width);
531
+ width: var(--vxe-ui-gantt-view-default-cell-width);
527
532
  }
528
533
  }
529
534
  .vxe-gantt-view--header-wrapper,
@@ -1,7 +1,11 @@
1
1
  :root {
2
2
  /*gantt*/
3
- --vxe-ui-gantt-view-column-width: 40px;
3
+ --vxe-ui-gantt-view-default-cell-width: 40px;
4
4
  --vxe-ui-gantt-view-chart-bar-height: 1.6em;
5
5
  --vxe-ui-gantt-view-split-bar-width: 10px;
6
6
  --vxe-ui-gantt-view-split-bar-height: 6.8em;
7
+ --vxe-ui-gantt-view-table-default-width: 30%;
8
+ --vxe-ui-gantt-view-task-bar-border-radius: calc(var(--vxe-ui-gantt-view-split-bar-height) / 2);
9
+ --vxe-ui-gantt-view-task-bar-background-color: var(--vxe-ui-font-primary-lighten-color);
10
+ --vxe-ui-gantt-view-task-bar-completed-background-color: var(--vxe-ui-font-primary-color);
7
11
  }