vxe-gantt 4.9.2 → 4.9.4

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