vxe-gantt 4.9.0 → 4.9.2

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 (127) hide show
  1. package/dist/all.esm.js +6382 -6461
  2. package/dist/style.css +982 -1
  3. package/dist/style.mini.css +1 -0
  4. package/es/components.d.ts +6 -0
  5. package/es/components.js +11 -9
  6. package/es/gantt/index.d.ts +1613 -0
  7. package/es/gantt/index.js +17 -12
  8. package/es/gantt/src/emits.d.ts +2 -0
  9. package/es/gantt/src/emits.js +23 -20
  10. package/es/gantt/src/gantt-body.d.ts +5 -0
  11. package/es/gantt/src/gantt-body.js +266 -259
  12. package/es/gantt/src/gantt-chart.d.ts +5 -0
  13. package/es/gantt/src/gantt-chart.js +449 -441
  14. package/es/gantt/src/gantt-footer.d.ts +4 -0
  15. package/es/gantt/src/gantt-footer.js +43 -40
  16. package/es/gantt/src/gantt-header.d.ts +4 -0
  17. package/es/gantt/src/gantt-header.js +151 -155
  18. package/es/gantt/src/gantt-view.d.ts +3 -0
  19. package/es/gantt/src/gantt-view.js +2376 -2441
  20. package/es/gantt/src/gantt.d.ts +251 -0
  21. package/es/gantt/src/gantt.js +2655 -2709
  22. package/es/gantt/src/grid-emits.d.ts +2 -0
  23. package/es/gantt/src/grid-emits.js +18 -15
  24. package/es/gantt/src/static.d.ts +34 -0
  25. package/es/gantt/src/static.js +16 -36
  26. package/es/gantt/src/table-emits.d.ts +2 -0
  27. package/es/gantt/src/table-emits.js +126 -119
  28. package/es/gantt/src/util.d.ts +10 -0
  29. package/es/gantt/src/util.js +39 -29
  30. package/es/gantt/style.css +1 -1
  31. package/es/gantt/style.mini.css +1 -0
  32. package/es/index.d.ts +3 -0
  33. package/es/index.esm.js +6 -3
  34. package/es/index.js +6 -0
  35. package/es/ui/index.d.ts +3 -0
  36. package/es/ui/index.js +123 -120
  37. package/es/ui/src/comp.d.ts +2 -0
  38. package/es/ui/src/comp.js +5 -2
  39. package/es/ui/src/depend.d.ts +1 -0
  40. package/es/ui/src/depend.js +14 -12
  41. package/es/ui/src/dom.d.ts +49 -0
  42. package/es/ui/src/dom.js +180 -169
  43. package/es/ui/src/log.d.ts +6 -0
  44. package/es/ui/src/log.js +18 -13
  45. package/es/ui/src/utils.d.ts +26 -0
  46. package/es/ui/src/utils.js +58 -51
  47. package/es/ui/src/vn.d.ts +2 -0
  48. package/es/ui/src/vn.js +9 -6
  49. package/es/vxe-gantt/index.d.ts +3 -0
  50. package/es/vxe-gantt/index.js +6 -3
  51. package/es/vxe-gantt/style.css +1 -1
  52. package/es/vxe-gantt/style.mini.css +1 -0
  53. package/es/vxe-ui/index.d.ts +3 -0
  54. package/es/vxe-ui/index.js +6 -3
  55. package/lib/components.js +39 -34
  56. package/lib/gantt/index.js +45 -31
  57. package/lib/gantt/src/emits.js +42 -6
  58. package/lib/gantt/src/gantt-body.js +152 -196
  59. package/lib/gantt/src/gantt-chart.js +310 -344
  60. package/lib/gantt/src/gantt-footer.js +48 -39
  61. package/lib/gantt/src/gantt-header.js +162 -164
  62. package/lib/gantt/src/gantt-view.js +964 -1256
  63. package/lib/gantt/src/gantt.js +1177 -1642
  64. package/lib/gantt/src/grid-emits.js +37 -6
  65. package/lib/gantt/src/static.js +34 -40
  66. package/lib/gantt/src/table-emits.js +145 -13
  67. package/lib/gantt/src/util.js +33 -16
  68. package/lib/gantt/style/index.js +1 -1
  69. package/lib/gantt/style/style.css +1 -1
  70. package/lib/gantt/style/style.mini.css +1 -0
  71. package/lib/index.common.js +35 -19
  72. package/lib/index.js +37 -0
  73. package/lib/index.umd.js +2964 -7775
  74. package/lib/index.umd.min.js +1 -1
  75. package/lib/style.css +982 -1
  76. package/lib/style.mini.css +1 -0
  77. package/lib/ui/index.js +36 -27
  78. package/lib/ui/src/comp.js +23 -6
  79. package/lib/ui/src/depend.js +28 -11
  80. package/lib/ui/src/dom.js +74 -81
  81. package/lib/ui/src/log.js +34 -18
  82. package/lib/ui/src/utils.js +62 -48
  83. package/lib/ui/src/vn.js +34 -8
  84. package/lib/ui/style/index.js +1 -1
  85. package/lib/vxe-gantt/index.js +35 -19
  86. package/lib/vxe-gantt/style/index.js +1 -1
  87. package/lib/vxe-gantt/style/style.css +1 -1
  88. package/lib/vxe-gantt/style/style.mini.css +1 -0
  89. package/lib/vxe-ui/index.js +35 -19
  90. package/lib/vxe-ui/style/index.js +1 -1
  91. package/package.json +7 -4
  92. package/packages/gantt/src/gantt-view.ts +2 -0
  93. package/packages/ui/src/utils.ts +4 -3
  94. package/dist/style.min.css +0 -1
  95. package/es/gantt/style.min.css +0 -1
  96. package/es/style.css +0 -1
  97. package/es/style.min.css +0 -1
  98. package/es/vxe-gantt/style.min.css +0 -1
  99. package/lib/components.min.js +0 -1
  100. package/lib/gantt/index.min.js +0 -1
  101. package/lib/gantt/src/emits.min.js +0 -1
  102. package/lib/gantt/src/gantt-body.min.js +0 -1
  103. package/lib/gantt/src/gantt-chart.min.js +0 -1
  104. package/lib/gantt/src/gantt-footer.min.js +0 -1
  105. package/lib/gantt/src/gantt-header.min.js +0 -1
  106. package/lib/gantt/src/gantt-view.min.js +0 -1
  107. package/lib/gantt/src/gantt.min.js +0 -1
  108. package/lib/gantt/src/grid-emits.min.js +0 -1
  109. package/lib/gantt/src/static.min.js +0 -1
  110. package/lib/gantt/src/table-emits.min.js +0 -1
  111. package/lib/gantt/src/util.min.js +0 -1
  112. package/lib/gantt/style/style.min.css +0 -1
  113. package/lib/style.min.css +0 -1
  114. package/lib/ui/index.min.js +0 -1
  115. package/lib/ui/src/comp.min.js +0 -1
  116. package/lib/ui/src/depend.min.js +0 -1
  117. package/lib/ui/src/dom.min.js +0 -1
  118. package/lib/ui/src/log.min.js +0 -1
  119. package/lib/ui/src/utils.min.js +0 -1
  120. package/lib/ui/src/vn.min.js +0 -1
  121. package/lib/vxe-gantt/index.min.js +0 -1
  122. package/lib/vxe-gantt/style/style.min.css +0 -1
  123. package/lib/vxe-ui/index.min.js +0 -1
  124. /package/es/ui/{style.min.css → style.mini.css} +0 -0
  125. /package/es/vxe-ui/{style.min.css → style.mini.css} +0 -0
  126. /package/lib/ui/style/{style.min.css → style.mini.css} +0 -0
  127. /package/lib/vxe-ui/style/{style.min.css → style.mini.css} +0 -0
package/es/gantt/index.js CHANGED
@@ -1,16 +1,21 @@
1
- import { VxeUI } from '@vxe-ui/core';
2
- import { checkDependVersion } from '../ui/src/depend';
3
- import VxeGanttComponent from './src/gantt';
4
- export const VxeGantt = Object.assign({}, VxeGanttComponent, {
5
- install(app) {
6
- checkDependVersion();
7
- app.component(VxeGanttComponent.name, VxeGanttComponent);
8
- }
1
+ import { VxeUI } from "@vxe-ui/core";
2
+ import { checkDependVersion } from "../ui/src/depend";
3
+ import VxeGanttComponent from "./src/gantt";
4
+ const VxeGantt = Object.assign({}, VxeGanttComponent, {
5
+ install(app) {
6
+ checkDependVersion();
7
+ app.component(VxeGanttComponent.name, VxeGanttComponent);
8
+ }
9
9
  });
10
10
  if (VxeUI.dynamicApp) {
11
- VxeUI.dynamicApp.use(VxeGantt);
11
+ VxeUI.dynamicApp.use(VxeGantt);
12
12
  }
13
13
  VxeUI.component(VxeGanttComponent);
14
- export * from './src/static';
15
- export const Gantt = VxeGantt;
16
- export default VxeGantt;
14
+ export * from "./src/static";
15
+ const Gantt = VxeGantt;
16
+ var gantt_default = VxeGantt;
17
+ export {
18
+ Gantt,
19
+ VxeGantt,
20
+ gantt_default as default
21
+ };
@@ -0,0 +1,2 @@
1
+ import type { VxeGanttEmits } from '../../../types';
2
+ export declare const ganttEmits: VxeGanttEmits;
@@ -1,21 +1,24 @@
1
- import { gridEmits } from './grid-emits';
2
- export const ganttEmits = [
3
- ...gridEmits,
4
- 'task-cell-click',
5
- 'task-cell-dblclick',
6
- 'task-bar-mouseenter',
7
- 'task-bar-mouseleave',
8
- 'task-bar-click',
9
- 'task-bar-dblclick',
10
- 'task-view-cell-click',
11
- 'task-view-cell-dblclick',
12
- 'task-move-start',
13
- 'task-move-drag',
14
- 'task-move-end',
15
- 'task-resize-start',
16
- 'task-resize-drag',
17
- 'task-resize-end',
18
- 'task-link-click',
19
- 'task-link-dblclick',
20
- 'task-link-remove'
1
+ import { gridEmits } from "./grid-emits";
2
+ const ganttEmits = [
3
+ ...gridEmits,
4
+ "task-cell-click",
5
+ "task-cell-dblclick",
6
+ "task-bar-mouseenter",
7
+ "task-bar-mouseleave",
8
+ "task-bar-click",
9
+ "task-bar-dblclick",
10
+ "task-view-cell-click",
11
+ "task-view-cell-dblclick",
12
+ "task-move-start",
13
+ "task-move-drag",
14
+ "task-move-end",
15
+ "task-resize-start",
16
+ "task-resize-drag",
17
+ "task-resize-end",
18
+ "task-link-click",
19
+ "task-link-dblclick",
20
+ "task-link-remove"
21
21
  ];
22
+ export {
23
+ ganttEmits
24
+ };
@@ -0,0 +1,5 @@
1
+ import { VNode } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
+ [key: string]: any;
4
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
5
+ export default _default;
@@ -1,262 +1,269 @@
1
- import { h, inject, ref, onMounted, onUnmounted } from 'vue';
2
- import { defineVxeComponent } from '../../ui/src/comp';
3
- import { getCellRestHeight } from './util';
4
- import { getClass } from '../../ui/src/utils';
5
- import XEUtils from 'xe-utils';
6
- import GanttViewChartComponent from './gantt-chart';
7
- const sourceType = 'gantt';
8
- const viewType = 'body';
9
- export default defineVxeComponent({
10
- name: 'VxeGanttViewBody',
11
- setup() {
12
- const $xeGantt = inject('$xeGantt', {});
13
- const $xeGanttView = inject('$xeGanttView', {});
14
- const { computeTaskViewOpts, computeScaleUnit } = $xeGantt.getComputeMaps();
15
- const { reactData, internalData } = $xeGanttView;
16
- const refElem = ref();
17
- const refBodyScroll = ref();
18
- const refBodyTable = ref();
19
- const refBodyXSpace = ref();
20
- const refBodyYSpace = ref();
21
- const renderColumn = ($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex) => {
22
- const tableReactData = $xeTable.reactData;
23
- const { resizeHeightFlag } = tableReactData;
24
- const tableInternalData = $xeTable.internalData;
25
- const { fullAllDataRowIdData, visibleColumn } = tableInternalData;
26
- const { computeCellOpts, computeRowOpts, computeDefaultRowHeight, computeResizableOpts } = $xeTable.getComputeMaps();
27
- const cellOpts = computeCellOpts.value;
28
- const rowOpts = computeRowOpts.value;
29
- const defaultRowHeight = computeDefaultRowHeight.value;
30
- const resizableOpts = computeResizableOpts.value;
31
- const { isAllRowDrag } = resizableOpts;
32
- const { headerGroups } = reactData;
33
- const { todayDateMaps } = internalData;
34
- const taskViewOpts = computeTaskViewOpts.value;
35
- const { showNowLine, viewStyle } = taskViewOpts;
36
- const scaleUnit = computeScaleUnit.value;
37
- const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
38
- const { field, dateObj, startDateObj, endDateObj } = column;
39
- const { cellClassName, cellStyle } = viewStyle || {};
40
- const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
41
- const rowRest = fullAllDataRowIdData[rowid] || {};
42
- const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
43
- const tdVNs = [];
44
- if (isAllRowDrag && rowOpts.resizable) {
45
- const cellParams = {
46
- $table: $xeTable,
47
- $grid: null,
48
- $gantt: $xeGantt,
49
- seq: -1,
50
- rowid,
51
- row,
52
- rowIndex,
53
- $rowIndex,
54
- _rowIndex,
55
- column: visibleColumn[0],
56
- columnIndex: 0,
57
- $columnIndex: 0,
58
- _columnIndex: 0,
59
- fixed: '',
60
- source: sourceType,
61
- type: viewType,
62
- isHidden: false,
63
- isEdit: false,
64
- level: -1,
65
- // 已废弃属性
66
- visibleData: [],
67
- data: [],
68
- items: []
69
- };
70
- tdVNs.push(h('div', {
71
- class: 'vxe-gantt-view-cell--row-resizable',
72
- onMousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
73
- onDblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
74
- }));
75
- }
76
- const ctParams = {
77
- $gantt: $xeGantt,
78
- source: sourceType,
79
- type: viewType,
80
- scaleType: scaleUnit,
81
- dateObj,
82
- startDateObj,
83
- endDateObj,
84
- row,
85
- column,
86
- $rowIndex,
87
- rowIndex,
88
- _rowIndex
89
- };
90
- return h('td', {
91
- key: cellClassName || cellStyle ? field : $columnIndex,
92
- class: [
93
- 'vxe-gantt-view--body-column',
94
- {
95
- 'is--now': showNowLine && todayValue === field
96
- },
97
- getClass(cellClassName, ctParams)
98
- ],
99
- style: cellStyle
100
- ? Object.assign({}, XEUtils.isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
101
- height: `${cellHeight}px`
102
- })
103
- : {
104
- height: `${cellHeight}px`
105
- },
106
- onClick(evnt) {
107
- $xeGantt.handleTaskCellClickEvent(evnt, { row, column });
108
- },
109
- onDblclick(evnt) {
110
- $xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
111
- },
112
- onContextmenu(evnt) {
113
- $xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
114
- }
115
- }, tdVNs);
1
+ import { h, inject, ref, onMounted, onUnmounted } from "vue";
2
+ import { defineVxeComponent } from "../../ui/src/comp";
3
+ import { getCellRestHeight } from "./util";
4
+ import { getClass } from "../../ui/src/utils";
5
+ import XEUtils from "xe-utils";
6
+ import GanttViewChartComponent from "./gantt-chart";
7
+ const sourceType = "gantt";
8
+ const viewType = "body";
9
+ var gantt_body_default = defineVxeComponent({
10
+ name: "VxeGanttViewBody",
11
+ setup() {
12
+ const $xeGantt = inject("$xeGantt", {});
13
+ const $xeGanttView = inject("$xeGanttView", {});
14
+ const { computeTaskViewOpts, computeScaleUnit } = $xeGantt.getComputeMaps();
15
+ const { reactData, internalData } = $xeGanttView;
16
+ const refElem = ref();
17
+ const refBodyScroll = ref();
18
+ const refBodyTable = ref();
19
+ const refBodyXSpace = ref();
20
+ const refBodyYSpace = ref();
21
+ const renderColumn = ($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex) => {
22
+ const tableReactData = $xeTable.reactData;
23
+ const { resizeHeightFlag } = tableReactData;
24
+ const tableInternalData = $xeTable.internalData;
25
+ const { fullAllDataRowIdData, visibleColumn } = tableInternalData;
26
+ const { computeCellOpts, computeRowOpts, computeDefaultRowHeight, computeResizableOpts } = $xeTable.getComputeMaps();
27
+ const cellOpts = computeCellOpts.value;
28
+ const rowOpts = computeRowOpts.value;
29
+ const defaultRowHeight = computeDefaultRowHeight.value;
30
+ const resizableOpts = computeResizableOpts.value;
31
+ const { isAllRowDrag } = resizableOpts;
32
+ const { headerGroups } = reactData;
33
+ const { todayDateMaps } = internalData;
34
+ const taskViewOpts = computeTaskViewOpts.value;
35
+ const { showNowLine, viewStyle } = taskViewOpts;
36
+ const scaleUnit = computeScaleUnit.value;
37
+ const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
38
+ const { field, dateObj, startDateObj, endDateObj } = column;
39
+ const { cellClassName, cellStyle } = viewStyle || {};
40
+ const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
41
+ const rowRest = fullAllDataRowIdData[rowid] || {};
42
+ const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
43
+ const tdVNs = [];
44
+ if (isAllRowDrag && rowOpts.resizable) {
45
+ const cellParams = {
46
+ $table: $xeTable,
47
+ $grid: null,
48
+ $gantt: $xeGantt,
49
+ seq: -1,
50
+ rowid,
51
+ row,
52
+ rowIndex,
53
+ $rowIndex,
54
+ _rowIndex,
55
+ column: visibleColumn[0],
56
+ columnIndex: 0,
57
+ $columnIndex: 0,
58
+ _columnIndex: 0,
59
+ fixed: "",
60
+ source: sourceType,
61
+ type: viewType,
62
+ isHidden: false,
63
+ isEdit: false,
64
+ level: -1,
65
+ // 已废弃属性
66
+ visibleData: [],
67
+ data: [],
68
+ items: []
116
69
  };
117
- const renderRows = ($xeTable, tableData) => {
118
- const tableProps = $xeTable.props;
119
- const { treeConfig, stripe, highlightHoverRow, editConfig } = tableProps;
120
- const tableReactData = $xeTable.reactData;
121
- const { treeExpandedFlag, selectRadioRow, pendingRowFlag, isRowGroupStatus } = tableReactData;
122
- const tableInternalData = $xeTable.internalData;
123
- const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps } = tableInternalData;
124
- const { computeRadioOpts, computeCheckboxOpts, computeTreeOpts, computeRowOpts } = $xeTable.getComputeMaps();
125
- const radioOpts = computeRadioOpts.value;
126
- const checkboxOpts = computeCheckboxOpts.value;
127
- const rowOpts = computeRowOpts.value;
128
- const treeOpts = computeTreeOpts.value;
129
- const { transform } = treeOpts;
130
- const childrenField = treeOpts.children || treeOpts.childrenField;
131
- const scaleUnit = computeScaleUnit.value;
132
- const taskViewOpts = computeTaskViewOpts.value;
133
- const { viewStyle } = taskViewOpts;
134
- const { rowClassName, rowStyle, cellClassName, cellStyle } = viewStyle || {};
135
- const { tableColumn, scrollYLoad } = reactData;
136
- const trVNs = [];
137
- tableData.forEach((row, $rowIndex) => {
138
- const rowid = $xeTable.getRowid(row);
139
- const rowRest = fullAllDataRowIdData[rowid] || {};
140
- const trOns = {};
141
- let rowIndex = $rowIndex;
142
- let _rowIndex = -1;
143
- if (rowRest) {
144
- rowIndex = rowRest.index;
145
- _rowIndex = rowRest._index;
146
- }
147
- // 是否新增行
148
- let isNewRow = false;
149
- if (editConfig) {
150
- isNewRow = $xeTable.isInsertByRow(row);
151
- }
152
- // 当前行事件
153
- if (rowOpts.isHover || highlightHoverRow) {
154
- trOns.onMouseenter = (evnt) => {
155
- $xeTable.triggerHoverEvent(evnt, { row, rowIndex });
156
- };
157
- trOns.onMouseleave = () => {
158
- $xeTable.clearHoverRow();
159
- };
160
- }
161
- // 拖拽行事件
162
- if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
163
- trOns.onDragstart = $xeTable.handleRowDragDragstartEvent;
164
- trOns.onDragend = $xeTable.handleRowDragDragendEvent;
165
- trOns.onDragover = $xeTable.handleRowDragDragoverEvent;
166
- }
167
- const rowParams = {
168
- $gantt: $xeGantt,
169
- source: sourceType,
170
- type: viewType,
171
- scaleType: scaleUnit,
172
- row,
173
- rowIndex,
174
- $rowIndex,
175
- _rowIndex
176
- };
177
- trVNs.push(h('tr', Object.assign({ key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex, class: [
178
- 'vxe-gantt-view--body-row',
179
- {
180
- 'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
181
- 'is--new': isNewRow,
182
- 'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
183
- 'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
184
- 'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
185
- },
186
- getClass(rowClassName, rowParams)
187
- ], rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(rowParams) || undefined : rowStyle) : undefined }, trOns), tableColumn.map((column, $columnIndex) => renderColumn($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex))));
188
- let isExpandTree = false;
189
- let rowChildren = [];
190
- if (treeConfig && !scrollYLoad && !transform) {
191
- rowChildren = row[childrenField];
192
- isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
193
- }
194
- // 如果是树形表格
195
- if (isExpandTree) {
196
- trVNs.push(...renderRows($xeTable, rowChildren));
197
- }
198
- });
199
- return trVNs;
70
+ tdVNs.push(
71
+ h("div", {
72
+ class: "vxe-gantt-view-cell--row-resizable",
73
+ onMousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
74
+ onDblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
75
+ })
76
+ );
77
+ }
78
+ const ctParams = {
79
+ $gantt: $xeGantt,
80
+ source: sourceType,
81
+ type: viewType,
82
+ scaleType: scaleUnit,
83
+ dateObj,
84
+ startDateObj,
85
+ endDateObj,
86
+ row,
87
+ column,
88
+ $rowIndex,
89
+ rowIndex,
90
+ _rowIndex
91
+ };
92
+ return h("td", {
93
+ key: cellClassName || cellStyle ? field : $columnIndex,
94
+ class: [
95
+ "vxe-gantt-view--body-column",
96
+ {
97
+ "is--now": showNowLine && todayValue === field
98
+ },
99
+ getClass(cellClassName, ctParams)
100
+ ],
101
+ style: cellStyle ? Object.assign({}, XEUtils.isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
102
+ height: `${cellHeight}px`
103
+ }) : {
104
+ height: `${cellHeight}px`
105
+ },
106
+ onClick(evnt) {
107
+ $xeGantt.handleTaskCellClickEvent(evnt, { row, column });
108
+ },
109
+ onDblclick(evnt) {
110
+ $xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
111
+ },
112
+ onContextmenu(evnt) {
113
+ $xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
114
+ }
115
+ }, tdVNs);
116
+ };
117
+ const renderRows = ($xeTable, tableData) => {
118
+ const tableProps = $xeTable.props;
119
+ const { treeConfig, stripe, highlightHoverRow, editConfig } = tableProps;
120
+ const tableReactData = $xeTable.reactData;
121
+ const { treeExpandedFlag, selectRadioRow, pendingRowFlag, isRowGroupStatus } = tableReactData;
122
+ const tableInternalData = $xeTable.internalData;
123
+ const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps } = tableInternalData;
124
+ const { computeRadioOpts, computeCheckboxOpts, computeTreeOpts, computeRowOpts } = $xeTable.getComputeMaps();
125
+ const radioOpts = computeRadioOpts.value;
126
+ const checkboxOpts = computeCheckboxOpts.value;
127
+ const rowOpts = computeRowOpts.value;
128
+ const treeOpts = computeTreeOpts.value;
129
+ const { transform } = treeOpts;
130
+ const childrenField = treeOpts.children || treeOpts.childrenField;
131
+ const scaleUnit = computeScaleUnit.value;
132
+ const taskViewOpts = computeTaskViewOpts.value;
133
+ const { viewStyle } = taskViewOpts;
134
+ const { rowClassName, rowStyle, cellClassName, cellStyle } = viewStyle || {};
135
+ const { tableColumn, scrollYLoad } = reactData;
136
+ const trVNs = [];
137
+ tableData.forEach((row, $rowIndex) => {
138
+ const rowid = $xeTable.getRowid(row);
139
+ const rowRest = fullAllDataRowIdData[rowid] || {};
140
+ const trOns = {};
141
+ let rowIndex = $rowIndex;
142
+ let _rowIndex = -1;
143
+ if (rowRest) {
144
+ rowIndex = rowRest.index;
145
+ _rowIndex = rowRest._index;
146
+ }
147
+ let isNewRow = false;
148
+ if (editConfig) {
149
+ isNewRow = $xeTable.isInsertByRow(row);
150
+ }
151
+ if (rowOpts.isHover || highlightHoverRow) {
152
+ trOns.onMouseenter = (evnt) => {
153
+ $xeTable.triggerHoverEvent(evnt, { row, rowIndex });
154
+ };
155
+ trOns.onMouseleave = () => {
156
+ $xeTable.clearHoverRow();
157
+ };
158
+ }
159
+ if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
160
+ trOns.onDragstart = $xeTable.handleRowDragDragstartEvent;
161
+ trOns.onDragend = $xeTable.handleRowDragDragendEvent;
162
+ trOns.onDragover = $xeTable.handleRowDragDragoverEvent;
163
+ }
164
+ const rowParams = {
165
+ $gantt: $xeGantt,
166
+ source: sourceType,
167
+ type: viewType,
168
+ scaleType: scaleUnit,
169
+ row,
170
+ rowIndex,
171
+ $rowIndex,
172
+ _rowIndex
200
173
  };
201
- const renderVN = () => {
202
- const $xeTable = $xeGanttView.internalData.xeTable;
203
- const { tableData, tableColumn, viewCellWidth } = reactData;
204
- return h('div', {
205
- ref: refElem,
206
- class: 'vxe-gantt-view--body-wrapper'
207
- }, [
208
- h('div', {
209
- ref: refBodyScroll,
210
- class: 'vxe-gantt-view--body-inner-wrapper',
211
- onScroll: $xeGanttView.triggerBodyScrollEvent,
212
- onContextmenu(evnt) {
213
- $xeGantt.handleTaskBodyContextmenuEvent(evnt, { source: sourceType, type: viewType, rowIndex: -1, $rowIndex: -1, _rowIndex: -1 });
214
- }
215
- }, [
216
- h('div', {
217
- ref: refBodyXSpace,
218
- class: 'vxe-body--x-space'
219
- }),
220
- h('div', {
221
- ref: refBodyYSpace,
222
- class: 'vxe-body--y-space'
223
- }),
224
- h('table', {
225
- ref: refBodyTable,
226
- class: 'vxe-gantt-view--body-table'
227
- }, [
228
- h('colgroup', {}, tableColumn.map((column, cIndex) => {
229
- return h('col', {
230
- key: cIndex,
231
- style: {
232
- width: `${viewCellWidth}px`
233
- }
234
- });
235
- })),
236
- h('tbody', {}, $xeTable ? renderRows($xeTable, tableData) : [])
237
- ]),
238
- h(GanttViewChartComponent)
239
- ])
240
- ]);
241
- };
242
- onMounted(() => {
243
- const { elemStore } = internalData;
244
- const prefix = 'main-body-';
245
- elemStore[`${prefix}wrapper`] = refElem;
246
- elemStore[`${prefix}scroll`] = refBodyScroll;
247
- elemStore[`${prefix}table`] = refBodyTable;
248
- elemStore[`${prefix}xSpace`] = refBodyXSpace;
249
- elemStore[`${prefix}ySpace`] = refBodyYSpace;
250
- });
251
- onUnmounted(() => {
252
- const { elemStore } = internalData;
253
- const prefix = 'main-body-';
254
- elemStore[`${prefix}wrapper`] = null;
255
- elemStore[`${prefix}scroll`] = null;
256
- elemStore[`${prefix}table`] = null;
257
- elemStore[`${prefix}xSpace`] = null;
258
- elemStore[`${prefix}ySpace`] = null;
259
- });
260
- return renderVN;
261
- }
174
+ trVNs.push(
175
+ h("tr", {
176
+ key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
177
+ class: [
178
+ "vxe-gantt-view--body-row",
179
+ {
180
+ "row--stripe": stripe && (_rowIndex + 1) % 2 === 0,
181
+ "is--new": isNewRow,
182
+ "row--radio": radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
183
+ "row--checked": checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
184
+ "row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid]
185
+ },
186
+ getClass(rowClassName, rowParams)
187
+ ],
188
+ rowid,
189
+ style: rowStyle ? XEUtils.isFunction(rowStyle) ? rowStyle(rowParams) || void 0 : rowStyle : void 0,
190
+ ...trOns
191
+ }, tableColumn.map((column, $columnIndex) => renderColumn($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex)))
192
+ );
193
+ let isExpandTree = false;
194
+ let rowChildren = [];
195
+ if (treeConfig && !scrollYLoad && !transform) {
196
+ rowChildren = row[childrenField];
197
+ isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
198
+ }
199
+ if (isExpandTree) {
200
+ trVNs.push(...renderRows($xeTable, rowChildren));
201
+ }
202
+ });
203
+ return trVNs;
204
+ };
205
+ const renderVN = () => {
206
+ const $xeTable = $xeGanttView.internalData.xeTable;
207
+ const { tableData, tableColumn, viewCellWidth } = reactData;
208
+ return h("div", {
209
+ ref: refElem,
210
+ class: "vxe-gantt-view--body-wrapper"
211
+ }, [
212
+ h("div", {
213
+ ref: refBodyScroll,
214
+ class: "vxe-gantt-view--body-inner-wrapper",
215
+ onScroll: $xeGanttView.triggerBodyScrollEvent,
216
+ onContextmenu(evnt) {
217
+ $xeGantt.handleTaskBodyContextmenuEvent(evnt, { source: sourceType, type: viewType, rowIndex: -1, $rowIndex: -1, _rowIndex: -1 });
218
+ }
219
+ }, [
220
+ h("div", {
221
+ ref: refBodyXSpace,
222
+ class: "vxe-body--x-space"
223
+ }),
224
+ h("div", {
225
+ ref: refBodyYSpace,
226
+ class: "vxe-body--y-space"
227
+ }),
228
+ h("table", {
229
+ ref: refBodyTable,
230
+ class: "vxe-gantt-view--body-table"
231
+ }, [
232
+ h("colgroup", {}, tableColumn.map((column, cIndex) => {
233
+ return h("col", {
234
+ key: cIndex,
235
+ style: {
236
+ width: `${viewCellWidth}px`
237
+ }
238
+ });
239
+ })),
240
+ h("tbody", {}, $xeTable ? renderRows($xeTable, tableData) : [])
241
+ ]),
242
+ h(GanttViewChartComponent)
243
+ ])
244
+ ]);
245
+ };
246
+ onMounted(() => {
247
+ const { elemStore } = internalData;
248
+ const prefix = "main-body-";
249
+ elemStore[`${prefix}wrapper`] = refElem;
250
+ elemStore[`${prefix}scroll`] = refBodyScroll;
251
+ elemStore[`${prefix}table`] = refBodyTable;
252
+ elemStore[`${prefix}xSpace`] = refBodyXSpace;
253
+ elemStore[`${prefix}ySpace`] = refBodyYSpace;
254
+ });
255
+ onUnmounted(() => {
256
+ const { elemStore } = internalData;
257
+ const prefix = "main-body-";
258
+ elemStore[`${prefix}wrapper`] = null;
259
+ elemStore[`${prefix}scroll`] = null;
260
+ elemStore[`${prefix}table`] = null;
261
+ elemStore[`${prefix}xSpace`] = null;
262
+ elemStore[`${prefix}ySpace`] = null;
263
+ });
264
+ return renderVN;
265
+ }
262
266
  });
267
+ export {
268
+ gantt_body_default as default
269
+ };
@@ -0,0 +1,5 @@
1
+ import { VNode } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
+ [key: string]: any;
4
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
5
+ export default _default;