vxe-gantt 3.9.4 → 3.9.6

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 (48) hide show
  1. package/es/components.d.ts +2 -1
  2. package/es/components.js +3 -4
  3. package/es/gantt/src/gantt-body.js +103 -79
  4. package/es/gantt/src/gantt-chart.js +376 -252
  5. package/es/gantt/src/gantt-footer.js +22 -14
  6. package/es/gantt/src/gantt-header.js +141 -110
  7. package/es/gantt/src/gantt-view.js +243 -198
  8. package/es/gantt/src/gantt.js +295 -187
  9. package/es/index.esm.js +4 -2
  10. package/es/index.js +4 -2
  11. package/es/ui/index.d.ts +0 -1
  12. package/es/ui/index.js +1 -2
  13. package/es/ui/src/log.js +1 -1
  14. package/es/ui/src/utils.d.ts +1 -1
  15. package/lib/components.js +5 -6
  16. package/lib/gantt/src/gantt-body.js +103 -79
  17. package/lib/gantt/src/gantt-chart.js +376 -252
  18. package/lib/gantt/src/gantt-footer.js +22 -14
  19. package/lib/gantt/src/gantt-header.js +141 -110
  20. package/lib/gantt/src/gantt-view.js +243 -198
  21. package/lib/gantt/src/gantt.js +295 -187
  22. package/lib/index.common.js +4 -2
  23. package/lib/index.js +4 -2
  24. package/lib/index.umd.js +1369 -1029
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/ui/index.js +1 -2
  27. package/lib/ui/src/log.js +1 -1
  28. package/package.json +7 -7
  29. package/packages/components.ts +21 -22
  30. package/packages/gantt/index.ts +32 -32
  31. package/packages/gantt/src/gantt-body.ts +349 -325
  32. package/packages/gantt/src/gantt-chart.ts +699 -575
  33. package/packages/gantt/src/gantt-footer.ts +81 -73
  34. package/packages/gantt/src/gantt-header.ts +218 -187
  35. package/packages/gantt/src/gantt-view.ts +2861 -2823
  36. package/packages/gantt/src/gantt.ts +3308 -3192
  37. package/packages/gantt/src/static.ts +35 -35
  38. package/packages/gantt/src/util.ts +35 -35
  39. package/packages/index.ts +15 -13
  40. package/packages/ui/index.ts +132 -135
  41. package/packages/ui/src/comp.ts +3 -3
  42. package/packages/ui/src/depend.ts +14 -14
  43. package/packages/ui/src/dom.ts +202 -202
  44. package/packages/ui/src/log.ts +19 -19
  45. package/packages/ui/src/utils.ts +68 -68
  46. package/packages/ui/src/vn.ts +13 -13
  47. package/types/all.d.ts +29 -29
  48. package/types/index.d.ts +4 -4
@@ -22,20 +22,28 @@ var gantt_footer_default = defineVxeComponent({
22
22
  renderVN(h) {
23
23
  const _vm = this;
24
24
  const $xeGantt = _vm.$xeGantt;
25
- return h("div", {
26
- ref: "refElem",
27
- class: "vxe-gantt-view--footer-wrapper"
28
- }, [
29
- h("div", {
30
- ref: "refHeaderScroll",
31
- class: "vxe-gantt-view--footer-inner-wrapper",
32
- on: {
33
- contextmenu(evnt) {
34
- $xeGantt.handleTaskFooterContextmenuEvent(evnt, { source: sourceType, type: viewType, $rowIndex: -1 });
35
- }
36
- }
37
- }, [])
38
- ]);
25
+ return h(
26
+ "div",
27
+ {
28
+ ref: "refElem",
29
+ class: "vxe-gantt-view--footer-wrapper"
30
+ },
31
+ [
32
+ h(
33
+ "div",
34
+ {
35
+ ref: "refHeaderScroll",
36
+ class: "vxe-gantt-view--footer-inner-wrapper",
37
+ on: {
38
+ contextmenu(evnt) {
39
+ $xeGantt.handleTaskFooterContextmenuEvent(evnt, { source: sourceType, type: viewType, $rowIndex: -1 });
40
+ }
41
+ }
42
+ },
43
+ []
44
+ )
45
+ ]
46
+ );
39
47
  }
40
48
  },
41
49
  mounted() {
@@ -33,117 +33,148 @@ var gantt_header_default = defineVxeComponent({
33
33
  const minScale = $xeGantt.computeMinScale;
34
34
  const scaleStep = $xeGantt.computeScaleStep;
35
35
  const { showNowLine } = taskViewOpts;
36
- return h("div", {
37
- ref: "refElem",
38
- class: "vxe-gantt-view--header-wrapper"
39
- }, [
40
- h("div", {
41
- ref: "refHeaderScroll",
42
- class: "vxe-gantt-view--header-inner-wrapper",
43
- on: {
44
- scroll: $xeGanttView.triggerHeaderScrollEvent
45
- }
46
- }, [
47
- h("div", {
48
- ref: "refHeaderXSpace",
49
- class: "vxe-body--x-space"
50
- }),
51
- h("table", {
52
- ref: "refHeaderTable",
53
- class: "vxe-gantt-view--header-table"
54
- }, [
55
- h("colgroup", {}, visibleColumn.map((column, cIndex) => {
56
- return h("col", {
57
- key: cIndex,
58
- style: {
59
- width: `${viewCellWidth}px`
60
- }
61
- });
62
- })),
63
- h("thead", {}, headerGroups.map(({ scaleItem, columns }, $rowIndex) => {
64
- const { type, titleFormat, titleMethod, headerCellStyle, slots } = scaleItem;
65
- const titleSlot = slots ? slots.title : null;
66
- const isLast = $rowIndex === headerGroups.length - 1;
67
- const todayValue = isLast && showNowLine ? todayDateMaps[type] : null;
68
- return h("tr", {
69
- key: $rowIndex
70
- }, columns.map((column, cIndex) => {
71
- const { field, childCount, dateObj, startDateObj, endDateObj } = column;
72
- let label = `${column.title}`;
73
- if ((isLast || minScale && (minScale.type === "date" || minScale.type === "day") && (type === "date" || type === "day")) && scaleStep > 1) {
74
- label = getI18n(`vxe.gantt.stepFormat.${type}`, {
75
- start: startDateObj,
76
- end: endDateObj,
77
- eStartLabel: getI18n(`vxe.gantt.dayss.w${startDateObj.e}`),
78
- eEndLabel: getI18n(`vxe.gantt.dayss.w${endDateObj.e}`)
79
- });
80
- } else {
81
- if (type === "day") {
82
- if ($rowIndex) {
83
- label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, {
84
- eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
36
+ return h(
37
+ "div",
38
+ {
39
+ ref: "refElem",
40
+ class: "vxe-gantt-view--header-wrapper"
41
+ },
42
+ [
43
+ h(
44
+ "div",
45
+ {
46
+ ref: "refHeaderScroll",
47
+ class: "vxe-gantt-view--header-inner-wrapper",
48
+ on: {
49
+ scroll: $xeGanttView.triggerHeaderScrollEvent
50
+ }
51
+ },
52
+ [
53
+ h("div", {
54
+ ref: "refHeaderXSpace",
55
+ class: "vxe-body--x-space"
56
+ }),
57
+ h(
58
+ "table",
59
+ {
60
+ ref: "refHeaderTable",
61
+ class: "vxe-gantt-view--header-table"
62
+ },
63
+ [
64
+ h(
65
+ "colgroup",
66
+ {},
67
+ visibleColumn.map((column, cIndex) => {
68
+ return h("col", {
69
+ key: cIndex,
70
+ style: {
71
+ width: `${viewCellWidth}px`
72
+ }
85
73
  });
86
- } else {
87
- label = getI18n(`vxe.gantt.tFullFormat.${type}`, {
88
- eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
89
- });
90
- }
91
- } else {
92
- if ($rowIndex) {
93
- label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
94
- } else {
95
- label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj);
96
- }
97
- }
98
- }
99
- let cellVNs = label;
100
- const ctParams = {
101
- source: sourceType,
102
- type: viewType,
103
- column,
104
- scaleObj: scaleItem,
105
- title: label,
106
- dateObj,
107
- startDateObj,
108
- endDateObj,
109
- $rowIndex
110
- };
111
- if (titleSlot) {
112
- cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h);
113
- } else if (titleMethod) {
114
- cellVNs = `${titleMethod(ctParams)}`;
115
- } else if (titleFormat) {
116
- cellVNs = XEUtils.toDateString(dateObj.date, titleFormat);
117
- }
118
- let cellStys = {};
119
- if (headerCellStyle) {
120
- if (XEUtils.isFunction(headerCellStyle)) {
121
- cellStys = headerCellStyle(ctParams) || null;
122
- } else {
123
- cellStys = headerCellStyle;
124
- }
125
- }
126
- return h("th", {
127
- key: cIndex,
128
- class: ["vxe-gantt-view--header-column", {
129
- "is--now": showNowLine && todayValue && todayValue === field
130
- }],
131
- attrs: {
132
- colspan: childCount || null,
133
- title: titleSlot ? null : label
134
- },
135
- style: cellStys || void 0,
136
- on: {
137
- contextmenu(evnt) {
138
- $xeGantt.handleTaskHeaderContextmenuEvent(evnt, ctParams);
139
- }
140
- }
141
- }, cellVNs);
142
- }));
143
- }))
144
- ])
145
- ])
146
- ]);
74
+ })
75
+ ),
76
+ h(
77
+ "thead",
78
+ {},
79
+ headerGroups.map(({ scaleItem, columns }, $rowIndex) => {
80
+ const { type, titleFormat, titleMethod, headerCellStyle, slots } = scaleItem;
81
+ const titleSlot = slots ? slots.title : null;
82
+ const isLast = $rowIndex === headerGroups.length - 1;
83
+ const todayValue = isLast && showNowLine ? todayDateMaps[type] : null;
84
+ return h(
85
+ "tr",
86
+ {
87
+ key: $rowIndex
88
+ },
89
+ columns.map((column, cIndex) => {
90
+ const { field, childCount, dateObj, startDateObj, endDateObj } = column;
91
+ let label = `${column.title}`;
92
+ if ((isLast || minScale && (minScale.type === "date" || minScale.type === "day") && (type === "date" || type === "day")) && scaleStep > 1) {
93
+ label = getI18n(`vxe.gantt.stepFormat.${type}`, {
94
+ start: startDateObj,
95
+ end: endDateObj,
96
+ eStartLabel: getI18n(`vxe.gantt.dayss.w${startDateObj.e}`),
97
+ eEndLabel: getI18n(`vxe.gantt.dayss.w${endDateObj.e}`)
98
+ });
99
+ } else {
100
+ if (type === "day") {
101
+ if ($rowIndex) {
102
+ label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, {
103
+ eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
104
+ });
105
+ } else {
106
+ label = getI18n(`vxe.gantt.tFullFormat.${type}`, {
107
+ eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
108
+ });
109
+ }
110
+ } else {
111
+ if ($rowIndex) {
112
+ label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
113
+ } else {
114
+ label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj);
115
+ }
116
+ }
117
+ }
118
+ let cellVNs = label;
119
+ const ctParams = {
120
+ source: sourceType,
121
+ type: viewType,
122
+ column,
123
+ scaleObj: scaleItem,
124
+ title: label,
125
+ dateObj,
126
+ startDateObj,
127
+ endDateObj,
128
+ $rowIndex
129
+ };
130
+ if (titleSlot) {
131
+ cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h);
132
+ } else if (titleMethod) {
133
+ cellVNs = `${titleMethod(ctParams)}`;
134
+ } else if (titleFormat) {
135
+ cellVNs = XEUtils.toDateString(dateObj.date, titleFormat);
136
+ }
137
+ let cellStys = {};
138
+ if (headerCellStyle) {
139
+ if (XEUtils.isFunction(headerCellStyle)) {
140
+ cellStys = headerCellStyle(ctParams) || null;
141
+ } else {
142
+ cellStys = headerCellStyle;
143
+ }
144
+ }
145
+ return h(
146
+ "th",
147
+ {
148
+ key: cIndex,
149
+ class: [
150
+ "vxe-gantt-view--header-column",
151
+ {
152
+ "is--now": showNowLine && todayValue && todayValue === field
153
+ }
154
+ ],
155
+ attrs: {
156
+ colspan: childCount || null,
157
+ title: titleSlot ? null : label
158
+ },
159
+ style: cellStys || void 0,
160
+ on: {
161
+ contextmenu(evnt) {
162
+ $xeGantt.handleTaskHeaderContextmenuEvent(evnt, ctParams);
163
+ }
164
+ }
165
+ },
166
+ cellVNs
167
+ );
168
+ })
169
+ );
170
+ })
171
+ )
172
+ ]
173
+ )
174
+ ]
175
+ )
176
+ ]
177
+ );
147
178
  }
148
179
  },
149
180
  mounted() {