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.
- package/README.md +18 -24
- package/es/components.js +3 -2
- package/es/gantt/src/gantt-body.js +137 -0
- package/es/gantt/src/gantt-chart.js +125 -0
- package/es/gantt/src/gantt-header.js +97 -0
- package/es/gantt/src/gantt-view.js +820 -0
- package/es/gantt/src/gantt.js +1897 -43
- package/es/gantt/src/util.js +9 -0
- package/es/gantt/style.css +624 -0
- package/es/gantt/style.min.css +1 -0
- package/es/index.esm.js +5 -2
- package/es/style.css +1 -0
- package/es/style.min.css +1 -0
- package/es/ui/index.js +55 -5
- package/es/ui/src/comp.js +1 -2
- package/es/ui/src/dom.js +44 -105
- package/es/ui/src/log.js +3 -2
- package/es/ui/src/utils.js +4 -3
- package/es/ui/src/vn.js +1 -32
- package/es/vxe-gantt/style.css +624 -0
- package/es/vxe-gantt/style.min.css +1 -0
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/components.js +20 -19
- package/lib/components.min.js +1 -1
- package/lib/gantt/index.js +3 -3
- package/lib/gantt/index.min.js +1 -1
- package/lib/gantt/src/gantt-body.js +140 -0
- package/lib/gantt/src/gantt-body.min.js +1 -0
- package/lib/gantt/src/gantt-chart.js +134 -0
- package/lib/gantt/src/gantt-chart.min.js +1 -0
- package/lib/gantt/src/gantt-header.js +97 -0
- package/lib/gantt/src/gantt-header.min.js +1 -0
- package/lib/gantt/src/gantt-view.js +808 -0
- package/lib/gantt/src/gantt-view.min.js +1 -0
- package/lib/gantt/src/gantt.js +2045 -48
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/src/util.js +16 -0
- package/lib/gantt/src/util.min.js +1 -0
- package/lib/gantt/style/style.css +624 -0
- package/lib/gantt/style/style.min.css +1 -0
- package/lib/index.common.js +12 -7
- package/lib/index.umd.js +11484 -235
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -0
- package/lib/style.min.css +1 -0
- package/lib/ui/index.js +54 -14
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +3 -2
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +78 -138
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +4 -3
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +5 -4
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/ui/src/vn.js +1 -43
- package/lib/ui/src/vn.min.js +0 -1
- package/lib/vxe-gantt/index.js +4 -2
- package/lib/vxe-gantt/index.min.js +1 -1
- package/lib/vxe-gantt/style/style.css +624 -0
- package/lib/vxe-gantt/style/style.min.css +1 -0
- package/lib/vxe-ui/index.js +4 -2
- package/lib/vxe-ui/index.min.js +1 -1
- package/package.json +13 -13
- package/packages/components.ts +8 -5
- package/packages/gantt/index.ts +2 -2
- package/packages/gantt/src/gantt-body.ts +155 -0
- package/packages/gantt/src/gantt-chart.ts +143 -0
- package/packages/gantt/src/gantt-header.ts +109 -0
- package/packages/gantt/src/gantt-view.ts +908 -0
- package/packages/gantt/src/gantt.ts +2048 -46
- package/packages/gantt/src/util.ts +12 -0
- package/packages/index.ts +6 -2
- package/packages/ui/index.ts +56 -4
- package/packages/ui/src/comp.ts +2 -2
- package/packages/ui/src/dom.ts +53 -110
- package/packages/ui/src/log.ts +4 -2
- package/packages/ui/src/utils.ts +5 -3
- package/packages/ui/src/vn.ts +0 -37
- package/styles/components/gantt-module/all.scss +1 -0
- package/styles/components/gantt-module/gantt-chart.scss +65 -0
- package/styles/components/gantt.scss +591 -0
- package/styles/helpers/baseMixin.scss +96 -0
- package/styles/helpers/baseVar.scss +4 -0
- package/styles/helpers/placement.scss +39 -0
- package/styles/theme/base.scss +11 -0
- package/styles/theme/dark.scss +5 -0
- package/styles/theme/light.scss +5 -0
- package/types/all.d.ts +3 -3
- package/types/index.d.ts +2 -2
- package/README.en.md +0 -72
- package/README.ja-JP.md +0 -72
- 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)}});
|