vxe-gantt 0.0.2 → 4.0.0-beta.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 (93) hide show
  1. package/README.md +27 -1
  2. package/es/gantt/src/emits.js +4 -0
  3. package/es/gantt/src/gantt-body.js +103 -0
  4. package/es/gantt/src/gantt-chart.js +77 -0
  5. package/es/gantt/src/gantt-header.js +70 -0
  6. package/es/gantt/src/gantt-view.js +768 -0
  7. package/es/gantt/src/gantt.js +1707 -22
  8. package/es/gantt/src/grid-emits.js +16 -0
  9. package/es/gantt/src/grid-props.js +7 -0
  10. package/es/gantt/src/props.js +2 -0
  11. package/es/gantt/src/table-emits.js +97 -0
  12. package/es/gantt/src/table-props.js +298 -0
  13. package/es/gantt/src/util.js +12 -0
  14. package/es/gantt/style.css +599 -0
  15. package/es/gantt/style.min.css +1 -0
  16. package/es/style.css +1 -0
  17. package/es/style.min.css +1 -0
  18. package/es/ui/index.js +47 -3
  19. package/es/ui/src/dom.js +44 -105
  20. package/es/ui/src/log.js +1 -1
  21. package/es/ui/src/utils.js +18 -17
  22. package/es/ui/src/vn.js +1 -32
  23. package/es/vxe-gantt/style.css +599 -0
  24. package/es/vxe-gantt/style.min.css +1 -0
  25. package/lib/gantt/src/emits.js +8 -0
  26. package/lib/gantt/src/emits.min.js +1 -0
  27. package/lib/gantt/src/gantt-body.js +118 -0
  28. package/lib/gantt/src/gantt-body.min.js +1 -0
  29. package/lib/gantt/src/gantt-chart.js +94 -0
  30. package/lib/gantt/src/gantt-chart.min.js +1 -0
  31. package/lib/gantt/src/gantt-header.js +78 -0
  32. package/lib/gantt/src/gantt-header.min.js +1 -0
  33. package/lib/gantt/src/gantt-view.js +810 -0
  34. package/lib/gantt/src/gantt-view.min.js +1 -0
  35. package/lib/gantt/src/gantt.js +1945 -20
  36. package/lib/gantt/src/gantt.min.js +1 -1
  37. package/lib/gantt/src/grid-emits.js +8 -0
  38. package/lib/gantt/src/grid-emits.min.js +1 -0
  39. package/lib/gantt/src/grid-props.js +24 -0
  40. package/lib/gantt/src/grid-props.min.js +1 -0
  41. package/lib/gantt/src/props.js +13 -0
  42. package/lib/gantt/src/props.min.js +1 -0
  43. package/lib/gantt/src/table-emits.js +7 -0
  44. package/lib/gantt/src/table-emits.min.js +1 -0
  45. package/lib/gantt/src/table-props.js +306 -0
  46. package/lib/gantt/src/table-props.min.js +1 -0
  47. package/lib/gantt/src/util.js +19 -0
  48. package/lib/gantt/src/util.min.js +1 -0
  49. package/lib/gantt/style/style.css +599 -0
  50. package/lib/gantt/style/style.min.css +1 -0
  51. package/lib/index.umd.js +6554 -140
  52. package/lib/index.umd.min.js +1 -1
  53. package/lib/style.css +1 -0
  54. package/lib/style.min.css +1 -0
  55. package/lib/ui/index.js +47 -3
  56. package/lib/ui/index.min.js +1 -1
  57. package/lib/ui/src/dom.js +50 -110
  58. package/lib/ui/src/dom.min.js +1 -1
  59. package/lib/ui/src/log.js +1 -1
  60. package/lib/ui/src/log.min.js +1 -1
  61. package/lib/ui/src/utils.js +24 -20
  62. package/lib/ui/src/utils.min.js +1 -1
  63. package/lib/ui/src/vn.js +1 -43
  64. package/lib/ui/src/vn.min.js +0 -1
  65. package/lib/vxe-gantt/style/style.css +599 -0
  66. package/lib/vxe-gantt/style/style.min.css +1 -0
  67. package/package.json +4 -4
  68. package/packages/gantt/src/emits.ts +7 -0
  69. package/packages/gantt/src/gantt-body.ts +119 -0
  70. package/packages/gantt/src/gantt-chart.ts +97 -0
  71. package/packages/gantt/src/gantt-header.ts +79 -0
  72. package/packages/gantt/src/gantt-view.ts +840 -0
  73. package/packages/gantt/src/gantt.ts +1806 -24
  74. package/packages/gantt/src/grid-emits.ts +19 -0
  75. package/packages/gantt/src/grid-props.ts +23 -0
  76. package/packages/gantt/src/props.ts +13 -0
  77. package/packages/gantt/src/table-emits.ts +109 -0
  78. package/packages/gantt/src/table-props.ts +304 -0
  79. package/packages/gantt/src/util.ts +15 -0
  80. package/packages/ui/index.ts +48 -2
  81. package/packages/ui/src/dom.ts +53 -110
  82. package/packages/ui/src/log.ts +1 -1
  83. package/packages/ui/src/utils.ts +22 -21
  84. package/packages/ui/src/vn.ts +0 -37
  85. package/styles/components/gantt-module/all.scss +1 -0
  86. package/styles/components/gantt-module/gantt-chart.scss +46 -0
  87. package/styles/components/gantt.scss +586 -0
  88. package/styles/helpers/baseMixin.scss +96 -0
  89. package/styles/helpers/baseVar.scss +4 -0
  90. package/styles/helpers/placement.scss +39 -0
  91. package/styles/theme/base.scss +7 -0
  92. package/styles/theme/dark.scss +5 -0
  93. package/styles/theme/light.scss +5 -0
package/README.md CHANGED
@@ -21,12 +21,38 @@
21
21
  * **V4**
22
22
  * [x] v4.0 基于 vue3.2+,只支持现代浏览器,不支持 IE
23
23
  * **V3**
24
- * [x] v3.0 基于 vue2.6+,只支持现代浏览器,不支持 IE
24
+ * [x] v3.0 基于 vue2.6~2.7,只支持现代浏览器,不支持 IE
25
25
  * **V2**
26
26
  * [x] ~~v2.0 基于 vue2.6+,停止维护~~
27
27
  * **V1**
28
28
  * [x] ~~v1.0 基于 vue2.6+,停止维护~~
29
29
 
30
+ ## 浏览器支持
31
+
32
+ ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)
33
+ --- | --- | --- | --- | --- |
34
+ 80+ ✔ | 80+ ✔ | 90+ ✔ | 75+ ✔ | 10+ ✔ |
35
+
36
+ ## 在线文档
37
+
38
+ 👉 [基础库](https://vxeui.com)
39
+ 👉 [表格库](https://vxetable.cn)
40
+ 👉 [甘特图](https://gantt.vxeui.com)
41
+ 👉 [可视化](https://design.vxeui.com)
42
+
43
+ ## QQ 交流群
44
+
45
+ 该群供大家交流問題,如果群人数已满,将会不定期剔除不活跃的。
46
+
47
+ ![qq](https://vxeui.com/resource/donation/qq1.png)
48
+ ![qq](https://vxeui.com/resource/donation/qq2.png)
49
+
50
+ ## 功能点
51
+
52
+ [👀 Vxe Gantt](https://gantt.vxeui.com/)
53
+
54
+ * [x] gantt 甘特图
55
+
30
56
  ## 安装
31
57
 
32
58
  版本:[vue](https://www.npmjs.com/package/vue) 3.x
@@ -0,0 +1,4 @@
1
+ import { gridEmits } from './grid-emits';
2
+ export const ganttEmits = [
3
+ ...gridEmits
4
+ ];
@@ -0,0 +1,103 @@
1
+ import { h, inject, ref, onMounted, onUnmounted } from 'vue';
2
+ import { defineVxeComponent } from '../../ui/src/comp';
3
+ import { getCellRestHeight } from './util';
4
+ import GanttViewChartComponent from './gantt-chart';
5
+ export default defineVxeComponent({
6
+ name: 'VxeGanttViewBody',
7
+ setup() {
8
+ const $xeGantt = inject('$xeGantt', {});
9
+ const $xeGanttView = inject('$xeGanttView', {});
10
+ const { reactData, internalData } = $xeGanttView;
11
+ const { refTable } = $xeGantt.getRefMaps();
12
+ const refElem = ref();
13
+ const refBodyScroll = ref();
14
+ const refBodyTable = ref();
15
+ const refBodyXSpace = ref();
16
+ const refBodyYSpace = ref();
17
+ const renderRows = () => {
18
+ const $xeTable = refTable.value;
19
+ const fullAllDataRowIdData = $xeTable ? $xeTable.internalData.fullAllDataRowIdData : {};
20
+ let cellOpts = {};
21
+ let rowOpts = {};
22
+ let defaultRowHeight = 0;
23
+ if ($xeTable) {
24
+ const { computeCellOpts, computeRowOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps();
25
+ cellOpts = computeCellOpts.value;
26
+ rowOpts = computeRowOpts.value;
27
+ defaultRowHeight = computeDefaultRowHeight.value;
28
+ }
29
+ const { tableData, tableColumn } = reactData;
30
+ const trVNs = [];
31
+ tableData.forEach((row, rIndex) => {
32
+ const rowid = $xeTable ? $xeTable.getRowid(row) : '';
33
+ const rowRest = fullAllDataRowIdData[rowid] || {};
34
+ const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
35
+ trVNs.push(h('tr', {
36
+ key: rIndex
37
+ }, tableColumn.map((column, cIndex) => {
38
+ return h('td', {
39
+ key: cIndex,
40
+ class: 'vxe-gantt-view--body-column',
41
+ style: {
42
+ height: `${cellHeight}px`
43
+ }
44
+ });
45
+ })));
46
+ });
47
+ return trVNs;
48
+ };
49
+ const renderVN = () => {
50
+ const { tableColumn } = reactData;
51
+ return h('div', {
52
+ ref: refElem,
53
+ class: 'vxe-gantt-view--body-wrapper'
54
+ }, [
55
+ h('div', {
56
+ ref: refBodyScroll,
57
+ class: 'vxe-gantt-view--body-inner-wrapper',
58
+ onScroll: $xeGanttView.triggerBodyScrollEvent
59
+ }, [
60
+ h('div', {
61
+ ref: refBodyXSpace,
62
+ class: 'vxe-body--x-space'
63
+ }),
64
+ h('div', {
65
+ ref: refBodyYSpace,
66
+ class: 'vxe-body--y-space'
67
+ }),
68
+ h('table', {
69
+ ref: refBodyTable,
70
+ class: 'vxe-gantt-view--body-table'
71
+ }, [
72
+ h('colgroup', {}, tableColumn.map((column, cIndex) => {
73
+ return h('col', {
74
+ key: cIndex
75
+ });
76
+ })),
77
+ h('tbody', {}, renderRows())
78
+ ]),
79
+ h(GanttViewChartComponent)
80
+ ])
81
+ ]);
82
+ };
83
+ onMounted(() => {
84
+ const { elemStore } = internalData;
85
+ const prefix = 'main-body-';
86
+ elemStore[`${prefix}wrapper`] = refElem;
87
+ elemStore[`${prefix}scroll`] = refBodyScroll;
88
+ elemStore[`${prefix}table`] = refBodyTable;
89
+ elemStore[`${prefix}xSpace`] = refBodyXSpace;
90
+ elemStore[`${prefix}ySpace`] = refBodyYSpace;
91
+ });
92
+ onUnmounted(() => {
93
+ const { elemStore } = internalData;
94
+ const prefix = 'main-body-';
95
+ elemStore[`${prefix}wrapper`] = null;
96
+ elemStore[`${prefix}scroll`] = null;
97
+ elemStore[`${prefix}table`] = null;
98
+ elemStore[`${prefix}xSpace`] = null;
99
+ elemStore[`${prefix}ySpace`] = null;
100
+ });
101
+ return renderVN;
102
+ }
103
+ });
@@ -0,0 +1,77 @@
1
+ import { h, inject, ref, onMounted, onUnmounted } from 'vue';
2
+ import { defineVxeComponent } from '../../ui/src/comp';
3
+ import XEUtils from 'xe-utils';
4
+ import { getCellRestHeight } from './util';
5
+ export default defineVxeComponent({
6
+ name: 'VxeGanttViewChart',
7
+ setup() {
8
+ const $xeGantt = inject('$xeGantt', {});
9
+ const $xeGanttView = inject('$xeGanttView', {});
10
+ const { reactData, internalData } = $xeGanttView;
11
+ const { refTable } = $xeGantt.getRefMaps();
12
+ const { computeProgressField } = $xeGantt.getComputeMaps();
13
+ const refElem = ref();
14
+ const renderVN = () => {
15
+ const $xeTable = refTable.value;
16
+ const fullAllDataRowIdData = $xeTable ? $xeTable.internalData.fullAllDataRowIdData : {};
17
+ let cellOpts = {};
18
+ let rowOpts = {};
19
+ let defaultRowHeight = 0;
20
+ if ($xeTable) {
21
+ const { computeCellOpts, computeRowOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps();
22
+ cellOpts = computeCellOpts.value;
23
+ rowOpts = computeRowOpts.value;
24
+ defaultRowHeight = computeDefaultRowHeight.value;
25
+ }
26
+ const { tableData } = reactData;
27
+ const progressField = computeProgressField.value;
28
+ const trVNs = [];
29
+ tableData.forEach((row, rIndex) => {
30
+ const rowid = $xeTable ? $xeTable.getRowid(row) : '';
31
+ const rowRest = fullAllDataRowIdData[rowid] || {};
32
+ const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
33
+ const progressValue = XEUtils.get(row, progressField);
34
+ trVNs.push(h('div', {
35
+ key: rIndex,
36
+ rowid,
37
+ class: 'vxe-gantt-view--chart-row',
38
+ style: {
39
+ height: `${cellHeight}px`
40
+ }
41
+ }, [
42
+ h('div', {
43
+ class: 'vxe-gantt-view--chart-bar',
44
+ rowid
45
+ }, [
46
+ h('div', {
47
+ class: 'vxe-gantt-view--chart-progress',
48
+ style: progressValue
49
+ ? {
50
+ width: `${progressValue}%`
51
+ }
52
+ : undefined
53
+ }),
54
+ h('div', {
55
+ class: 'vxe-gantt-view--chart-content'
56
+ })
57
+ ])
58
+ ]));
59
+ });
60
+ return h('div', {
61
+ ref: refElem,
62
+ class: 'vxe-gantt-view--chart-wrapper'
63
+ }, trVNs);
64
+ };
65
+ onMounted(() => {
66
+ const { elemStore } = internalData;
67
+ const prefix = 'main-chart-';
68
+ elemStore[`${prefix}wrapper`] = refElem;
69
+ });
70
+ onUnmounted(() => {
71
+ const { elemStore } = internalData;
72
+ const prefix = 'main-chart-';
73
+ elemStore[`${prefix}wrapper`] = null;
74
+ });
75
+ return renderVN;
76
+ }
77
+ });
@@ -0,0 +1,70 @@
1
+ import { h, inject, ref, onMounted, onUnmounted } from 'vue';
2
+ import { defineVxeComponent } from '../../ui/src/comp';
3
+ export default defineVxeComponent({
4
+ name: 'VxeGanttView',
5
+ setup() {
6
+ const $xeGanttView = inject('$xeGanttView', {});
7
+ const { reactData, internalData } = $xeGanttView;
8
+ const refElem = ref();
9
+ const refHeaderScroll = ref();
10
+ const refHeaderTable = ref();
11
+ const refHeaderXSpace = ref();
12
+ const renderVN = () => {
13
+ const { tableColumn, headerGroups } = reactData;
14
+ return h('div', {
15
+ ref: refElem,
16
+ class: 'vxe-gantt-view--header-wrapper'
17
+ }, [
18
+ h('div', {
19
+ ref: refHeaderScroll,
20
+ class: 'vxe-gantt-view--header-inner-wrapper',
21
+ onScroll: $xeGanttView.triggerHeaderScrollEvent
22
+ }, [
23
+ h('div', {
24
+ ref: refHeaderXSpace,
25
+ class: 'vxe-body--x-space'
26
+ }),
27
+ h('table', {
28
+ ref: refHeaderTable,
29
+ class: 'vxe-gantt-view--header-table'
30
+ }, [
31
+ h('colgroup', {}, tableColumn.map((column, cIndex) => {
32
+ return h('col', {
33
+ key: cIndex
34
+ });
35
+ })),
36
+ h('thead', {}, headerGroups.map((cols, rIndex) => {
37
+ return h('tr', {
38
+ key: rIndex
39
+ }, cols.map((column, cIndex) => {
40
+ return h('th', {
41
+ key: cIndex,
42
+ class: 'vxe-gantt-view--header-column',
43
+ colspan: column.children ? column.children.length : null,
44
+ title: `${column.field}`
45
+ }, column.title);
46
+ }));
47
+ }))
48
+ ])
49
+ ])
50
+ ]);
51
+ };
52
+ onMounted(() => {
53
+ const { elemStore } = internalData;
54
+ const prefix = 'main-header-';
55
+ elemStore[`${prefix}wrapper`] = refElem;
56
+ elemStore[`${prefix}scroll`] = refHeaderScroll;
57
+ elemStore[`${prefix}table`] = refHeaderTable;
58
+ elemStore[`${prefix}xSpace`] = refHeaderXSpace;
59
+ });
60
+ onUnmounted(() => {
61
+ const { elemStore } = internalData;
62
+ const prefix = 'main-header-';
63
+ elemStore[`${prefix}wrapper`] = null;
64
+ elemStore[`${prefix}scroll`] = null;
65
+ elemStore[`${prefix}table`] = null;
66
+ elemStore[`${prefix}xSpace`] = null;
67
+ });
68
+ return renderVN;
69
+ }
70
+ });