vxe-gantt 0.0.2 → 3.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 (94) hide show
  1. package/README.md +18 -24
  2. package/es/components.js +3 -2
  3. package/es/gantt/src/gantt-body.js +137 -0
  4. package/es/gantt/src/gantt-chart.js +125 -0
  5. package/es/gantt/src/gantt-header.js +97 -0
  6. package/es/gantt/src/gantt-view.js +820 -0
  7. package/es/gantt/src/gantt.js +1897 -43
  8. package/es/gantt/src/util.js +9 -0
  9. package/es/gantt/style.css +624 -0
  10. package/es/gantt/style.min.css +1 -0
  11. package/es/index.esm.js +5 -2
  12. package/es/style.css +1 -0
  13. package/es/style.min.css +1 -0
  14. package/es/ui/index.js +55 -5
  15. package/es/ui/src/comp.js +1 -2
  16. package/es/ui/src/dom.js +44 -105
  17. package/es/ui/src/log.js +3 -2
  18. package/es/ui/src/utils.js +4 -3
  19. package/es/ui/src/vn.js +1 -32
  20. package/es/vxe-gantt/style.css +624 -0
  21. package/es/vxe-gantt/style.min.css +1 -0
  22. package/helper/vetur/attributes.json +1 -1
  23. package/helper/vetur/tags.json +1 -1
  24. package/lib/components.js +20 -19
  25. package/lib/components.min.js +1 -1
  26. package/lib/gantt/index.js +3 -3
  27. package/lib/gantt/index.min.js +1 -1
  28. package/lib/gantt/src/gantt-body.js +140 -0
  29. package/lib/gantt/src/gantt-body.min.js +1 -0
  30. package/lib/gantt/src/gantt-chart.js +134 -0
  31. package/lib/gantt/src/gantt-chart.min.js +1 -0
  32. package/lib/gantt/src/gantt-header.js +97 -0
  33. package/lib/gantt/src/gantt-header.min.js +1 -0
  34. package/lib/gantt/src/gantt-view.js +808 -0
  35. package/lib/gantt/src/gantt-view.min.js +1 -0
  36. package/lib/gantt/src/gantt.js +2045 -48
  37. package/lib/gantt/src/gantt.min.js +1 -1
  38. package/lib/gantt/src/util.js +16 -0
  39. package/lib/gantt/src/util.min.js +1 -0
  40. package/lib/gantt/style/style.css +624 -0
  41. package/lib/gantt/style/style.min.css +1 -0
  42. package/lib/index.common.js +12 -7
  43. package/lib/index.umd.js +11484 -235
  44. package/lib/index.umd.min.js +1 -1
  45. package/lib/style.css +1 -0
  46. package/lib/style.min.css +1 -0
  47. package/lib/ui/index.js +54 -14
  48. package/lib/ui/index.min.js +1 -1
  49. package/lib/ui/src/comp.js +3 -2
  50. package/lib/ui/src/comp.min.js +1 -1
  51. package/lib/ui/src/dom.js +78 -138
  52. package/lib/ui/src/dom.min.js +1 -1
  53. package/lib/ui/src/log.js +4 -3
  54. package/lib/ui/src/log.min.js +1 -1
  55. package/lib/ui/src/utils.js +5 -4
  56. package/lib/ui/src/utils.min.js +1 -1
  57. package/lib/ui/src/vn.js +1 -43
  58. package/lib/ui/src/vn.min.js +0 -1
  59. package/lib/vxe-gantt/index.js +4 -2
  60. package/lib/vxe-gantt/index.min.js +1 -1
  61. package/lib/vxe-gantt/style/style.css +624 -0
  62. package/lib/vxe-gantt/style/style.min.css +1 -0
  63. package/lib/vxe-ui/index.js +4 -2
  64. package/lib/vxe-ui/index.min.js +1 -1
  65. package/package.json +13 -13
  66. package/packages/components.ts +8 -5
  67. package/packages/gantt/index.ts +2 -2
  68. package/packages/gantt/src/gantt-body.ts +155 -0
  69. package/packages/gantt/src/gantt-chart.ts +143 -0
  70. package/packages/gantt/src/gantt-header.ts +109 -0
  71. package/packages/gantt/src/gantt-view.ts +908 -0
  72. package/packages/gantt/src/gantt.ts +2048 -46
  73. package/packages/gantt/src/util.ts +12 -0
  74. package/packages/index.ts +6 -2
  75. package/packages/ui/index.ts +56 -4
  76. package/packages/ui/src/comp.ts +2 -2
  77. package/packages/ui/src/dom.ts +53 -110
  78. package/packages/ui/src/log.ts +4 -2
  79. package/packages/ui/src/utils.ts +5 -3
  80. package/packages/ui/src/vn.ts +0 -37
  81. package/styles/components/gantt-module/all.scss +1 -0
  82. package/styles/components/gantt-module/gantt-chart.scss +65 -0
  83. package/styles/components/gantt.scss +591 -0
  84. package/styles/helpers/baseMixin.scss +96 -0
  85. package/styles/helpers/baseVar.scss +4 -0
  86. package/styles/helpers/placement.scss +39 -0
  87. package/styles/theme/base.scss +11 -0
  88. package/styles/theme/dark.scss +5 -0
  89. package/styles/theme/light.scss +5 -0
  90. package/types/all.d.ts +3 -3
  91. package/types/index.d.ts +2 -2
  92. package/README.en.md +0 -72
  93. package/README.ja-JP.md +0 -72
  94. package/README.zh-TW.md +0 -73
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _comp = require("../../ui/src/comp");
8
+ var _core = require("@vxe-ui/core");
9
+ var _xeUtils = _interopRequireDefault(require("xe-utils"));
10
+ var _util = require("./util");
11
+ var _utils = require("../../ui/src/utils");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ var renderEmptyElement = _core.VxeUI.renderEmptyElement;
14
+ var _default = exports.default = (0, _comp.defineVxeComponent)({
15
+ name: 'VxeGanttViewChart',
16
+ inject: {
17
+ $xeGantt: {
18
+ default: null
19
+ },
20
+ $xeGanttView: {
21
+ default: null
22
+ }
23
+ },
24
+ props: {},
25
+ data: function data() {
26
+ return {};
27
+ },
28
+ computed: Object.assign({}, {}),
29
+ methods: {
30
+ //
31
+ // Render
32
+ //
33
+ renderVN: function renderVN(h) {
34
+ var _vm = this;
35
+ var $xeGantt = _vm.$xeGantt;
36
+ var $xeGanttView = _vm.$xeGanttView;
37
+ var $xeTable = $xeGanttView.internalData.xeTable;
38
+ var tableInternalData = $xeTable ? $xeTable : {};
39
+ var fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData || {};
40
+ var cellOpts = {};
41
+ var rowOpts = {};
42
+ var defaultRowHeight = 0;
43
+ if ($xeTable) {
44
+ cellOpts = $xeTable.computeCellOpts;
45
+ rowOpts = $xeTable.computeRowOpts;
46
+ defaultRowHeight = $xeTable.computeDefaultRowHeight;
47
+ }
48
+ var reactData = $xeGanttView.reactData;
49
+ var tableData = reactData.tableData;
50
+ var titleField = $xeGantt.computeTitleField;
51
+ var progressField = $xeGantt.computeProgressField;
52
+ var taskBarOpts = $xeGantt.computeTaskBarOpts;
53
+ var showProgress = taskBarOpts.showProgress,
54
+ showContent = taskBarOpts.showContent,
55
+ contentMethod = taskBarOpts.contentMethod,
56
+ barStyle = taskBarOpts.barStyle;
57
+ var _ref = barStyle || {},
58
+ round = _ref.round;
59
+ var trVNs = [];
60
+ tableData.forEach(function (row, rIndex) {
61
+ var rowid = $xeTable ? $xeTable.getRowid(row) : '';
62
+ var rowRest = fullAllDataRowIdData[rowid] || {};
63
+ var cellHeight = (0, _util.getCellRestHeight)(rowRest, cellOpts, rowOpts, defaultRowHeight);
64
+ var title = (0, _utils.getStringValue)(_xeUtils.default.get(row, titleField));
65
+ var progressValue = showProgress ? Math.min(100, Math.max(0, _xeUtils.default.toNumber(_xeUtils.default.get(row, progressField)))) : 0;
66
+ if (contentMethod) {
67
+ title = (0, _utils.getStringValue)(contentMethod({
68
+ row: row,
69
+ title: title
70
+ }));
71
+ }
72
+ trVNs.push(h('div', {
73
+ key: rIndex,
74
+ attrs: {
75
+ rowid: rowid
76
+ },
77
+ class: ['vxe-gantt-view--chart-row', {
78
+ 'is--round': round
79
+ }],
80
+ style: {
81
+ height: "".concat(cellHeight, "px")
82
+ }
83
+ }, [h('div', {
84
+ class: 'vxe-gantt-view--chart-bar',
85
+ attrs: {
86
+ rowid: rowid
87
+ },
88
+ on: {
89
+ click: function click(evnt) {
90
+ $xeGantt.handleTaskBarClickEvent(evnt, {
91
+ row: row
92
+ });
93
+ },
94
+ dblclick: function dblclick(evnt) {
95
+ $xeGantt.handleTaskBarDblclickEvent(evnt, {
96
+ row: row
97
+ });
98
+ }
99
+ }
100
+ }, [showProgress ? h('div', {
101
+ class: 'vxe-gantt-view--chart-progress',
102
+ style: {
103
+ width: "".concat(progressValue || 0, "%")
104
+ }
105
+ }) : renderEmptyElement($xeGantt), showContent ? h('div', {
106
+ class: 'vxe-gantt-view--chart-content'
107
+ }, title) : renderEmptyElement($xeGantt)])]));
108
+ });
109
+ return h('div', {
110
+ ref: 'refElem',
111
+ class: 'vxe-gantt-view--chart-wrapper'
112
+ }, trVNs);
113
+ }
114
+ },
115
+ mounted: function mounted() {
116
+ var _vm = this;
117
+ var $xeGanttView = _vm.$xeGanttView;
118
+ var internalData = $xeGanttView.internalData;
119
+ var elemStore = internalData.elemStore;
120
+ var prefix = 'main-chart-';
121
+ elemStore["".concat(prefix, "wrapper")] = _vm.$refs.refElem;
122
+ },
123
+ destroyed: function destroyed() {
124
+ var _vm = this;
125
+ var $xeGanttView = _vm.$xeGanttView;
126
+ var internalData = $xeGanttView.internalData;
127
+ var elemStore = internalData.elemStore;
128
+ var prefix = 'main-chart-';
129
+ elemStore["".concat(prefix, "wrapper")] = null;
130
+ },
131
+ render: function render(h) {
132
+ return this.renderVN(h);
133
+ }
134
+ });
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_core=require("@vxe-ui/core"),_xeUtils=_interopRequireDefault(require("xe-utils")),_util=require("./util"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var renderEmptyElement=_core.VxeUI.renderEmptyElement,_default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewChart",inject:{$xeGantt:{default:null},$xeGanttView:{default:null}},props:{},data:function(){return{}},computed:Object.assign({},{}),methods:{renderVN:function(l){var o=this.$xeGantt,e=this.$xeGanttView,u=e.internalData.xeTable,s=(u||{}).fullAllDataRowIdData||{},c={},d={},p=0;u&&(c=u.computeCellOpts,d=u.computeRowOpts,p=u.computeDefaultRowHeight);var e=e.reactData.tableData,m=o.computeTitleField,f=o.computeProgressField,t=o.computeTaskBarOpts,h=t.showProgress,w=t.showContent,x=t.contentMethod,v=(t.barStyle||{}).round,g=[];return e.forEach(function(t,e){var r=u?u.getRowid(t):"",a=s[r]||{},a=(0,_util.getCellRestHeight)(a,c,d,p),n=(0,_utils.getStringValue)(_xeUtils.default.get(t,m)),i=h?Math.min(100,Math.max(0,_xeUtils.default.toNumber(_xeUtils.default.get(t,f)))):0;x&&(n=(0,_utils.getStringValue)(x({row:t,title:n}))),g.push(l("div",{key:e,attrs:{rowid:r},class:["vxe-gantt-view--chart-row",{"is--round":v}],style:{height:"".concat(a,"px")}},[l("div",{class:"vxe-gantt-view--chart-bar",attrs:{rowid:r},on:{click:function(e){o.handleTaskBarClickEvent(e,{row:t})},dblclick:function(e){o.handleTaskBarDblclickEvent(e,{row:t})}}},[h?l("div",{class:"vxe-gantt-view--chart-progress",style:{width:"".concat(i||0,"%")}}):renderEmptyElement(o),w?l("div",{class:"vxe-gantt-view--chart-content"},n):renderEmptyElement(o)])]))}),l("div",{ref:"refElem",class:"vxe-gantt-view--chart-wrapper"},g)}},mounted:function(){this.$xeGanttView.internalData.elemStore["".concat("main-chart-","wrapper")]=this.$refs.refElem},destroyed:function(){this.$xeGanttView.internalData.elemStore["".concat("main-chart-","wrapper")]=null},render:function(e){return this.renderVN(e)}});
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _comp = require("../../ui/src/comp");
8
+ var _default = exports.default = (0, _comp.defineVxeComponent)({
9
+ name: 'VxeGanttView',
10
+ inject: {
11
+ $xeGantt: {
12
+ default: null
13
+ },
14
+ $xeGanttView: {
15
+ default: null
16
+ }
17
+ },
18
+ props: {},
19
+ data: function data() {
20
+ return {};
21
+ },
22
+ computed: Object.assign({}, {}),
23
+ methods: {
24
+ //
25
+ // Render
26
+ //
27
+ renderVN: function renderVN(h) {
28
+ var _vm = this;
29
+ var $xeGanttView = _vm.$xeGanttView;
30
+ var reactData = $xeGanttView.reactData;
31
+ var tableColumn = reactData.tableColumn,
32
+ headerGroups = reactData.headerGroups,
33
+ viewCellWidth = reactData.viewCellWidth;
34
+ return h('div', {
35
+ ref: 'refElem',
36
+ class: 'vxe-gantt-view--header-wrapper'
37
+ }, [h('div', {
38
+ ref: 'refHeaderScroll',
39
+ class: 'vxe-gantt-view--header-inner-wrapper',
40
+ on: {
41
+ scroll: $xeGanttView.triggerHeaderScrollEvent
42
+ }
43
+ }, [h('div', {
44
+ ref: 'refHeaderXSpace',
45
+ class: 'vxe-body--x-space'
46
+ }), h('table', {
47
+ ref: 'refHeaderTable',
48
+ class: 'vxe-gantt-view--header-table'
49
+ }, [h('colgroup', {}, tableColumn.map(function (column, cIndex) {
50
+ return h('col', {
51
+ key: cIndex,
52
+ style: {
53
+ width: "".concat(viewCellWidth, "px")
54
+ }
55
+ });
56
+ })), h('thead', {}, headerGroups.map(function (cols, rIndex) {
57
+ return h('tr', {
58
+ key: rIndex
59
+ }, cols.map(function (column, cIndex) {
60
+ return h('th', {
61
+ key: cIndex,
62
+ class: 'vxe-gantt-view--header-column',
63
+ attrs: {
64
+ colspan: column.children ? column.children.length : null,
65
+ title: "".concat(column.field)
66
+ }
67
+ }, column.title);
68
+ }));
69
+ }))])])]);
70
+ }
71
+ },
72
+ mounted: function mounted() {
73
+ var _vm = this;
74
+ var $xeGanttView = _vm.$xeGanttView;
75
+ var internalData = $xeGanttView.internalData;
76
+ var elemStore = internalData.elemStore;
77
+ var prefix = 'main-header-';
78
+ elemStore["".concat(prefix, "wrapper")] = _vm.$refs.refElem;
79
+ elemStore["".concat(prefix, "scroll")] = _vm.$refs.refHeaderScroll;
80
+ elemStore["".concat(prefix, "table")] = _vm.$refs.refHeaderTable;
81
+ elemStore["".concat(prefix, "xSpace")] = _vm.$refs.refHeaderXSpace;
82
+ },
83
+ destroyed: function destroyed() {
84
+ var _vm = this;
85
+ var $xeGanttView = _vm.$xeGanttView;
86
+ var internalData = $xeGanttView.internalData;
87
+ var elemStore = internalData.elemStore;
88
+ var prefix = 'main-header-';
89
+ elemStore["".concat(prefix, "wrapper")] = null;
90
+ elemStore["".concat(prefix, "scroll")] = null;
91
+ elemStore["".concat(prefix, "table")] = null;
92
+ elemStore["".concat(prefix, "xSpace")] = null;
93
+ },
94
+ render: function render(h) {
95
+ return this.renderVN(h);
96
+ }
97
+ });
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttView",inject:{$xeGantt:{default:null},$xeGanttView:{default:null}},props:{},data:function(){return{}},computed:Object.assign({},{}),methods:{renderVN:function(r){var e=this.$xeGanttView,t=e.reactData,a=t.tableColumn,n=t.headerGroups,l=t.viewCellWidth;return r("div",{ref:"refElem",class:"vxe-gantt-view--header-wrapper"},[r("div",{ref:"refHeaderScroll",class:"vxe-gantt-view--header-inner-wrapper",on:{scroll:e.triggerHeaderScrollEvent}},[r("div",{ref:"refHeaderXSpace",class:"vxe-body--x-space"}),r("table",{ref:"refHeaderTable",class:"vxe-gantt-view--header-table"},[r("colgroup",{},a.map(function(e,t){return r("col",{key:t,style:{width:"".concat(l,"px")}})})),r("thead",{},n.map(function(e,t){return r("tr",{key:t},e.map(function(e,t){return r("th",{key:t,class:"vxe-gantt-view--header-column",attrs:{colspan:e.children?e.children.length:null,title:"".concat(e.field)}},e.title)}))}))])])])}},mounted:function(){var e=this,t=e.$xeGanttView.internalData.elemStore,r="main-header-";t["".concat(r,"wrapper")]=e.$refs.refElem,t["".concat(r,"scroll")]=e.$refs.refHeaderScroll,t["".concat(r,"table")]=e.$refs.refHeaderTable,t["".concat(r,"xSpace")]=e.$refs.refHeaderXSpace},destroyed:function(){var e=this.$xeGanttView.internalData.elemStore,t="main-header-";e["".concat(t,"wrapper")]=null,e["".concat(t,"scroll")]=null,e["".concat(t,"table")]=null,e["".concat(t,"xSpace")]=null},render:function(e){return this.renderVN(e)}});