tg-ganttchart 0.0.8 → 0.0.10
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/dist/demo.html +1 -0
- package/dist/tgganttchart.common.js +11480 -0
- package/dist/tgganttchart.common.js.map +1 -0
- package/dist/tgganttchart.css +1 -0
- package/dist/tgganttchart.umd.js +11491 -0
- package/dist/tgganttchart.umd.js.map +1 -0
- package/dist/tgganttchart.umd.min.js +7 -0
- package/dist/tgganttchart.umd.min.js.map +1 -0
- package/package.json +4 -1
- package/babel.config.js +0 -5
- package/src/.eslintrc.js +0 -18
- package/src/App.vue +0 -780
- package/src/GanttElastic.standalone.vue +0 -48
- package/src/GanttElastic.vue +0 -2305
- package/src/assets/logo.png +0 -0
- package/src/components/Calendar/Calendar.vue +0 -559
- package/src/components/Calendar/CalendarRow.vue +0 -112
- package/src/components/Chart/Chart.vue +0 -117
- package/src/components/Chart/DaysHighlight.vue +0 -60
- package/src/components/Chart/DependencyLines.vue +0 -112
- package/src/components/Chart/Grid.vue +0 -205
- package/src/components/Chart/ProgressBar.vue +0 -110
- package/src/components/Chart/Row/Epic.vue +0 -131
- package/src/components/Chart/Row/Milestone.vue +0 -117
- package/src/components/Chart/Row/Project.vue +0 -132
- package/src/components/Chart/Row/Story.vue +0 -127
- package/src/components/Chart/Row/Subtask.vue +0 -117
- package/src/components/Chart/Row/Task.mixin.js +0 -47
- package/src/components/Chart/Row/Task.vue +0 -82
- package/src/components/Chart/Text.vue +0 -105
- package/src/components/Expander.vue +0 -114
- package/src/components/GanttElastic.standalone.vue +0 -48
- package/src/components/GanttElastic.vue +0 -1646
- package/src/components/Header/GanttViewFilter.vue +0 -154
- package/src/components/Header/Header.vue +0 -266
- package/src/components/MainView.vue +0 -283
- package/src/components/TaskList/ItemColumn.vue +0 -212
- package/src/components/TaskList/TaskList.vue +0 -45
- package/src/components/TaskList/TaskListHeader.vue +0 -143
- package/src/components/TaskList/TaskListItem.vue +0 -35
- package/src/components/bundle.js +0 -28
- package/src/components/components/Calendar/Calendar.vue +0 -332
- package/src/components/components/Calendar/CalendarRow.vue +0 -96
- package/src/components/components/Chart/Chart.vue +0 -111
- package/src/components/components/Chart/DaysHighlight.vue +0 -71
- package/src/components/components/Chart/DependencyLines.vue +0 -112
- package/src/components/components/Chart/Grid.vue +0 -164
- package/src/components/components/Chart/ProgressBar.vue +0 -110
- package/src/components/components/Chart/Row/Milestone.vue +0 -117
- package/src/components/components/Chart/Row/Project.vue +0 -131
- package/src/components/components/Chart/Row/Task.mixin.js +0 -46
- package/src/components/components/Chart/Row/Task.vue +0 -107
- package/src/components/components/Chart/Text.vue +0 -105
- package/src/components/components/Expander.vue +0 -126
- package/src/components/components/Header/Header.vue +0 -265
- package/src/components/components/MainView.vue +0 -282
- package/src/components/components/TaskList/ItemColumn.vue +0 -121
- package/src/components/components/TaskList/TaskList.vue +0 -45
- package/src/components/components/TaskList/TaskListHeader.vue +0 -143
- package/src/components/components/TaskList/TaskListItem.vue +0 -35
- package/src/components/components/bundle.js +0 -28
- package/src/components/style.js +0 -308
- package/src/index.js +0 -12
- package/src/main.js +0 -6
- package/src/style.js +0 -398
- package/vue.config.js +0 -42
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g
|
|
3
|
-
class="gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-epic-wrapper"
|
|
4
|
-
:style="{
|
|
5
|
-
...root.style['chart-row-bar-wrapper'],
|
|
6
|
-
...root.style['chart-row-epic-wrapper'],
|
|
7
|
-
...task.style['chart-row-bar-wrapper']
|
|
8
|
-
}"
|
|
9
|
-
>
|
|
10
|
-
<foreignObject
|
|
11
|
-
class="gantt-elastic__chart-expander gantt-elastic__chart-expander--epic"
|
|
12
|
-
:style="{
|
|
13
|
-
...root.style['chart-expander'],
|
|
14
|
-
...root.style['chart-expander--epic'],
|
|
15
|
-
...task.style['chart-expander']
|
|
16
|
-
}"
|
|
17
|
-
:x="task.x - root.state.options.chart.expander.offset - root.state.options.chart.expander.size"
|
|
18
|
-
:y="task.y + (root.state.options.row.height - root.state.options.chart.expander.size) / 2"
|
|
19
|
-
:width="root.state.options.chart.expander.size"
|
|
20
|
-
:height="root.state.options.chart.expander.size"
|
|
21
|
-
v-if="displayExpander"
|
|
22
|
-
>
|
|
23
|
-
<expander :tasks="[task]" :options="root.state.options.chart.expander" type="chart"></expander>
|
|
24
|
-
</foreignObject>
|
|
25
|
-
<svg
|
|
26
|
-
class="gantt-elastic__chart-row-bar gantt-elastic__chart-row-epic"
|
|
27
|
-
:style="{ ...root.style['chart-row-bar'], ...root.style['chart-row-epic'], ...task.style['chart-row-bar'] }"
|
|
28
|
-
:x="task.x"
|
|
29
|
-
:y="task.y"
|
|
30
|
-
:width="task.width"
|
|
31
|
-
:height="task.height"
|
|
32
|
-
:viewBox="`0 0 ${task.width} ${task.height}`"
|
|
33
|
-
@click="emitEvent('click', $event)"
|
|
34
|
-
@mouseenter="emitEvent('mouseenter', $event)"
|
|
35
|
-
@mouseover="emitEvent('mouseover', $event)"
|
|
36
|
-
@mouseout="emitEvent('mouseout', $event)"
|
|
37
|
-
@mousemove="emitEvent('mousemove', $event)"
|
|
38
|
-
@mousedown="emitEvent('mousedown', $event)"
|
|
39
|
-
@mouseup="emitEvent('mouseup', $event)"
|
|
40
|
-
@mousewheel="emitEvent('mousewheel', $event)"
|
|
41
|
-
@touchstart="emitEvent('touchstart', $event)"
|
|
42
|
-
@touchmove="emitEvent('touchmove', $event)"
|
|
43
|
-
@touchend="emitEvent('touchend', $event)"
|
|
44
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
-
>
|
|
46
|
-
<defs>
|
|
47
|
-
<clipPath :id="clipPathId">
|
|
48
|
-
<path :d="getPoints"></path>
|
|
49
|
-
</clipPath>
|
|
50
|
-
</defs>
|
|
51
|
-
<path
|
|
52
|
-
class="gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-epic-polygon"
|
|
53
|
-
:style="{
|
|
54
|
-
...root.style['chart-row-bar-polygon'],
|
|
55
|
-
...root.style['chart-row-epic-polygon'],
|
|
56
|
-
...task.style['base'],
|
|
57
|
-
...task.style['chart-row-bar-polygon']
|
|
58
|
-
}"
|
|
59
|
-
:d="getPoints"
|
|
60
|
-
></path>
|
|
61
|
-
<progress-bar :task="task" :clip-path="'url(#' + clipPathId + ')'"></progress-bar>
|
|
62
|
-
</svg>
|
|
63
|
-
<chart-text :task="task" v-if="root.state.options.chart.text.display"></chart-text>
|
|
64
|
-
</g>
|
|
65
|
-
</template>
|
|
66
|
-
|
|
67
|
-
<script>
|
|
68
|
-
import ChartText from '../Text.vue';
|
|
69
|
-
import ProgressBar from '../ProgressBar.vue';
|
|
70
|
-
import Expander from '../../Expander.vue';
|
|
71
|
-
import taskMixin from './Task.mixin.js';
|
|
72
|
-
export default {
|
|
73
|
-
name: 'Epic',
|
|
74
|
-
components: {
|
|
75
|
-
ChartText,
|
|
76
|
-
ProgressBar,
|
|
77
|
-
Expander
|
|
78
|
-
},
|
|
79
|
-
inject: ['root'],
|
|
80
|
-
props: ['task'],
|
|
81
|
-
mixins: [taskMixin],
|
|
82
|
-
data() {
|
|
83
|
-
return {};
|
|
84
|
-
},
|
|
85
|
-
computed: {
|
|
86
|
-
/**
|
|
87
|
-
* Get clip path id
|
|
88
|
-
*
|
|
89
|
-
* @returns {string}
|
|
90
|
-
*/
|
|
91
|
-
clipPathId() {
|
|
92
|
-
return 'gantt-elastic__epic-clip-path-' + this.task.id;
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get points (same shape as project)
|
|
97
|
-
*
|
|
98
|
-
* @returns {string}
|
|
99
|
-
*/
|
|
100
|
-
getPoints() {
|
|
101
|
-
const task = this.task;
|
|
102
|
-
const bottom = task.height - task.height / 4;
|
|
103
|
-
const corner = task.height / 6;
|
|
104
|
-
const smallCorner = task.height / 8;
|
|
105
|
-
return `M ${smallCorner},0
|
|
106
|
-
L ${task.width - smallCorner} 0
|
|
107
|
-
L ${task.width} ${smallCorner}
|
|
108
|
-
L ${task.width} ${bottom}
|
|
109
|
-
L ${task.width - corner} ${task.height}
|
|
110
|
-
L ${task.width - corner * 2} ${bottom}
|
|
111
|
-
L ${corner * 2} ${bottom}
|
|
112
|
-
L ${corner} ${task.height}
|
|
113
|
-
L 0 ${bottom}
|
|
114
|
-
L 0 ${smallCorner}
|
|
115
|
-
Z
|
|
116
|
-
`;
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Should we display expander?
|
|
121
|
-
*
|
|
122
|
-
* @returns {boolean}
|
|
123
|
-
*/
|
|
124
|
-
displayExpander() {
|
|
125
|
-
const expander = this.root.state.options.chart.expander;
|
|
126
|
-
const hasChildren = this.task.allChildren && this.task.allChildren.length > 0;
|
|
127
|
-
return (expander.display || (expander.displayIfTaskListHidden && !this.root.state.options.taskList.display)) && hasChildren;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
</script>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<g
|
|
4
|
-
class="gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-milestone-wrapper"
|
|
5
|
-
:style="{
|
|
6
|
-
...root.style['chart-row-bar-wrapper'],
|
|
7
|
-
...root.style['chart-row-milestone-wrapper'],
|
|
8
|
-
...task.style['chart-row-bar-wrapper']
|
|
9
|
-
}"
|
|
10
|
-
>
|
|
11
|
-
<foreignObject
|
|
12
|
-
class="gantt-elastic__chart-expander gantt-elastic__chart-expander--milestone"
|
|
13
|
-
:style="{
|
|
14
|
-
...root.style['chart-expander'],
|
|
15
|
-
...root.style['chart-expander--milestone'],
|
|
16
|
-
...task.style['chart-expander']
|
|
17
|
-
}"
|
|
18
|
-
:x="task.x - root.state.options.chart.expander.offset - root.state.options.chart.expander.size"
|
|
19
|
-
:y="task.y + (root.state.options.row.height - root.state.options.chart.expander.size) / 2"
|
|
20
|
-
:width="root.state.options.chart.expander.size"
|
|
21
|
-
:height="root.state.options.chart.expander.size"
|
|
22
|
-
v-if="displayExpander"
|
|
23
|
-
>
|
|
24
|
-
<expander :tasks="[task]" :options="root.state.options.chart.expander" type="chart"></expander>
|
|
25
|
-
</foreignObject>
|
|
26
|
-
<svg
|
|
27
|
-
class="gantt-elastic__chart-row-bar gantt-elastic__chart-row-milestone"
|
|
28
|
-
:style="{ ...root.style['chart-row-bar'], ...root.style['chart-row-milestone'], ...task.style['chart-row-bar'] }"
|
|
29
|
-
:x="task.x"
|
|
30
|
-
:y="task.y"
|
|
31
|
-
:width="task.width"
|
|
32
|
-
:height="task.height"
|
|
33
|
-
:viewBox="`0 0 ${task.width} ${task.height}`"
|
|
34
|
-
@click="emitEvent('click', $event)"
|
|
35
|
-
@mouseenter="emitEvent('mouseenter', $event)"
|
|
36
|
-
@mouseover="emitEvent('mouseover', $event)"
|
|
37
|
-
@mouseout="emitEvent('mouseout', $event)"
|
|
38
|
-
@mousemove="emitEvent('mousemove', $event)"
|
|
39
|
-
@mousedown="emitEvent('mousedown', $event)"
|
|
40
|
-
@mouseup="emitEvent('mouseup', $event)"
|
|
41
|
-
@mousewheel="emitEvent('mousewheel', $event)"
|
|
42
|
-
@touchstart="emitEvent('touchstart', $event)"
|
|
43
|
-
@touchmove="emitEvent('touchmove', $event)"
|
|
44
|
-
@touchend="emitEvent('touchend', $event)"
|
|
45
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
-
>
|
|
47
|
-
<defs>
|
|
48
|
-
<clipPath :id="clipPathId">
|
|
49
|
-
<polygon :points="getPoints"></polygon>
|
|
50
|
-
</clipPath>
|
|
51
|
-
</defs>
|
|
52
|
-
<polygon
|
|
53
|
-
class="gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-milestone-polygon"
|
|
54
|
-
:style="{
|
|
55
|
-
...root.style['chart-row-bar-polygon'],
|
|
56
|
-
...root.style['chart-row-milestone-polygon'],
|
|
57
|
-
...task.style['base'],
|
|
58
|
-
...task.style['chart-row-bar-polygon']
|
|
59
|
-
}"
|
|
60
|
-
:points="getPoints"
|
|
61
|
-
></polygon>
|
|
62
|
-
<progress-bar :task="task" :clip-path="'url(#' + clipPathId + ')'"></progress-bar>
|
|
63
|
-
</svg>
|
|
64
|
-
<chart-text :task="task" v-if="root.state.options.chart.text.display"></chart-text>
|
|
65
|
-
</g>
|
|
66
|
-
</template>
|
|
67
|
-
|
|
68
|
-
<script>
|
|
69
|
-
import ChartText from '../Text.vue';
|
|
70
|
-
import ProgressBar from '../ProgressBar.vue';
|
|
71
|
-
import Expander from '../../Expander.vue';
|
|
72
|
-
import taskMixin from './Task.mixin.js';
|
|
73
|
-
export default {
|
|
74
|
-
name: 'Milestone',
|
|
75
|
-
components: {
|
|
76
|
-
ChartText,
|
|
77
|
-
ProgressBar,
|
|
78
|
-
Expander
|
|
79
|
-
},
|
|
80
|
-
inject: ['root'],
|
|
81
|
-
props: ['task'],
|
|
82
|
-
mixins: [taskMixin],
|
|
83
|
-
data() {
|
|
84
|
-
return {};
|
|
85
|
-
},
|
|
86
|
-
computed: {
|
|
87
|
-
/**
|
|
88
|
-
* Get clip path id
|
|
89
|
-
*
|
|
90
|
-
* @returns {string}
|
|
91
|
-
*/
|
|
92
|
-
clipPathId() {
|
|
93
|
-
return 'gantt-elastic__milestone-clip-path-' + this.task.id;
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Get points
|
|
98
|
-
*
|
|
99
|
-
* @returns {string}
|
|
100
|
-
*/
|
|
101
|
-
getPoints() {
|
|
102
|
-
const task = this.task;
|
|
103
|
-
const fifty = task.height / 2;
|
|
104
|
-
let offset = fifty;
|
|
105
|
-
if (task.width / 2 - offset < 0) {
|
|
106
|
-
offset = task.width / 2;
|
|
107
|
-
}
|
|
108
|
-
return `0,${fifty}
|
|
109
|
-
${offset},0
|
|
110
|
-
${task.width - offset},0
|
|
111
|
-
${task.width},${fifty}
|
|
112
|
-
${task.width - offset},${task.height}
|
|
113
|
-
${offset},${task.height}`;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
</script>
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<g
|
|
4
|
-
class="gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-project-wrapper"
|
|
5
|
-
:style="{
|
|
6
|
-
...root.style['chart-row-bar-wrapper'],
|
|
7
|
-
...root.style['chart-row-project-wrapper'],
|
|
8
|
-
...task.style['chart-row-bar-wrapper']
|
|
9
|
-
}"
|
|
10
|
-
>
|
|
11
|
-
<foreignObject
|
|
12
|
-
class="gantt-elastic__chart-expander gantt-elastic__chart-expander--project"
|
|
13
|
-
:style="{
|
|
14
|
-
...root.style['chart-expander'],
|
|
15
|
-
...root.style['chart-expander--project'],
|
|
16
|
-
...task.style['chart-expander']
|
|
17
|
-
}"
|
|
18
|
-
:x="task.x - root.state.options.chart.expander.offset - root.state.options.chart.expander.size"
|
|
19
|
-
:y="task.y + (root.state.options.row.height - root.state.options.chart.expander.size) / 2"
|
|
20
|
-
:width="root.state.options.chart.expander.size"
|
|
21
|
-
:height="root.state.options.chart.expander.size"
|
|
22
|
-
v-if="displayExpander"
|
|
23
|
-
>
|
|
24
|
-
<expander :tasks="[task]" :options="root.state.options.chart.expander" type="chart"></expander>
|
|
25
|
-
</foreignObject>
|
|
26
|
-
<svg
|
|
27
|
-
class="gantt-elastic__chart-row-bar gantt-elastic__chart-row-project"
|
|
28
|
-
:style="{ ...root.style['chart-row-bar'], ...root.style['chart-row-project'], ...task.style['chart-row-bar'] }"
|
|
29
|
-
:x="task.x"
|
|
30
|
-
:y="task.y"
|
|
31
|
-
:width="task.width"
|
|
32
|
-
:height="task.height"
|
|
33
|
-
:viewBox="`0 0 ${task.width} ${task.height}`"
|
|
34
|
-
@click="emitEvent('click', $event)"
|
|
35
|
-
@mouseenter="emitEvent('mouseenter', $event)"
|
|
36
|
-
@mouseover="emitEvent('mouseover', $event)"
|
|
37
|
-
@mouseout="emitEvent('mouseout', $event)"
|
|
38
|
-
@mousemove="emitEvent('mousemove', $event)"
|
|
39
|
-
@mousedown="emitEvent('mousedown', $event)"
|
|
40
|
-
@mouseup="emitEvent('mouseup', $event)"
|
|
41
|
-
@mousewheel="emitEvent('mousewheel', $event)"
|
|
42
|
-
@touchstart="emitEvent('touchstart', $event)"
|
|
43
|
-
@touchmove="emitEvent('touchmove', $event)"
|
|
44
|
-
@touchend="emitEvent('touchend', $event)"
|
|
45
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
-
>
|
|
47
|
-
<defs>
|
|
48
|
-
<clipPath :id="clipPathId">
|
|
49
|
-
<path :d="getPoints"></path>
|
|
50
|
-
</clipPath>
|
|
51
|
-
</defs>
|
|
52
|
-
<path
|
|
53
|
-
class="gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-project-polygon"
|
|
54
|
-
:style="{
|
|
55
|
-
...root.style['chart-row-bar-polygon'],
|
|
56
|
-
...root.style['chart-row-project-polygon'],
|
|
57
|
-
...task.style['base'],
|
|
58
|
-
...task.style['chart-row-bar-polygon']
|
|
59
|
-
}"
|
|
60
|
-
:d="getPoints"
|
|
61
|
-
></path>
|
|
62
|
-
<progress-bar :task="task" :clip-path="'url(#' + clipPathId + ')'"></progress-bar>
|
|
63
|
-
</svg>
|
|
64
|
-
<chart-text :task="task" v-if="root.state.options.chart.text.display"></chart-text>
|
|
65
|
-
</g>
|
|
66
|
-
</template>
|
|
67
|
-
|
|
68
|
-
<script>
|
|
69
|
-
import ChartText from '../Text.vue';
|
|
70
|
-
import ProgressBar from '../ProgressBar.vue';
|
|
71
|
-
import Expander from '../../Expander.vue';
|
|
72
|
-
import taskMixin from './Task.mixin.js';
|
|
73
|
-
export default {
|
|
74
|
-
name: 'Project',
|
|
75
|
-
components: {
|
|
76
|
-
ChartText,
|
|
77
|
-
ProgressBar,
|
|
78
|
-
Expander
|
|
79
|
-
},
|
|
80
|
-
inject: ['root'],
|
|
81
|
-
props: ['task'],
|
|
82
|
-
mixins: [taskMixin],
|
|
83
|
-
data() {
|
|
84
|
-
return {};
|
|
85
|
-
},
|
|
86
|
-
computed: {
|
|
87
|
-
/**
|
|
88
|
-
* Get clip path id
|
|
89
|
-
*
|
|
90
|
-
* @returns {string}
|
|
91
|
-
*/
|
|
92
|
-
clipPathId() {
|
|
93
|
-
return 'gantt-elastic__project-clip-path-' + this.task.id;
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Get points
|
|
98
|
-
*
|
|
99
|
-
* @returns {string}
|
|
100
|
-
*/
|
|
101
|
-
getPoints() {
|
|
102
|
-
const task = this.task;
|
|
103
|
-
const bottom = task.height - task.height / 4;
|
|
104
|
-
const corner = task.height / 6;
|
|
105
|
-
const smallCorner = task.height / 8;
|
|
106
|
-
return `M ${smallCorner},0
|
|
107
|
-
L ${task.width - smallCorner} 0
|
|
108
|
-
L ${task.width} ${smallCorner}
|
|
109
|
-
L ${task.width} ${bottom}
|
|
110
|
-
L ${task.width - corner} ${task.height}
|
|
111
|
-
L ${task.width - corner * 2} ${bottom}
|
|
112
|
-
L ${corner * 2} ${bottom}
|
|
113
|
-
L ${corner} ${task.height}
|
|
114
|
-
L 0 ${bottom}
|
|
115
|
-
L 0 ${smallCorner}
|
|
116
|
-
Z
|
|
117
|
-
`;
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Should we display expander?
|
|
122
|
-
*
|
|
123
|
-
* @returns {boolean}
|
|
124
|
-
*/
|
|
125
|
-
displayExpander() {
|
|
126
|
-
const expander = this.root.state.options.chart.expander;
|
|
127
|
-
const hasChildren = this.task.allChildren && this.task.allChildren.length > 0;
|
|
128
|
-
return (expander.display || (expander.displayIfTaskListHidden && !this.root.state.options.taskList.display)) && hasChildren;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
</script>
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g
|
|
3
|
-
class="gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-story-wrapper"
|
|
4
|
-
:style="{
|
|
5
|
-
...root.style['chart-row-bar-wrapper'],
|
|
6
|
-
...root.style['chart-row-story-wrapper'],
|
|
7
|
-
...task.style['chart-row-bar-wrapper']
|
|
8
|
-
}"
|
|
9
|
-
>
|
|
10
|
-
<foreignObject
|
|
11
|
-
class="gantt-elastic__chart-expander gantt-elastic__chart-expander--story"
|
|
12
|
-
:style="{
|
|
13
|
-
...root.style['chart-expander'],
|
|
14
|
-
...root.style['chart-expander--story'],
|
|
15
|
-
...task.style['chart-expander']
|
|
16
|
-
}"
|
|
17
|
-
:x="task.x - root.state.options.chart.expander.offset - root.state.options.chart.expander.size"
|
|
18
|
-
:y="task.y + (root.state.options.row.height - root.state.options.chart.expander.size) / 2"
|
|
19
|
-
:width="root.state.options.chart.expander.size"
|
|
20
|
-
:height="root.state.options.chart.expander.size"
|
|
21
|
-
v-if="displayExpander"
|
|
22
|
-
>
|
|
23
|
-
<expander :tasks="[task]" :options="root.state.options.chart.expander" type="chart"></expander>
|
|
24
|
-
</foreignObject>
|
|
25
|
-
<svg
|
|
26
|
-
class="gantt-elastic__chart-row-bar gantt-elastic__chart-row-story"
|
|
27
|
-
:style="{ ...root.style['chart-row-bar'], ...root.style['chart-row-story'], ...task.style['chart-row-bar'] }"
|
|
28
|
-
:x="task.x"
|
|
29
|
-
:y="task.y"
|
|
30
|
-
:width="task.width"
|
|
31
|
-
:height="task.height"
|
|
32
|
-
:viewBox="`0 0 ${task.width} ${task.height}`"
|
|
33
|
-
@click="emitEvent('click', $event)"
|
|
34
|
-
@mouseenter="emitEvent('mouseenter', $event)"
|
|
35
|
-
@mouseover="emitEvent('mouseover', $event)"
|
|
36
|
-
@mouseout="emitEvent('mouseout', $event)"
|
|
37
|
-
@mousemove="emitEvent('mousemove', $event)"
|
|
38
|
-
@mousedown="emitEvent('mousedown', $event)"
|
|
39
|
-
@mouseup="emitEvent('mouseup', $event)"
|
|
40
|
-
@mousewheel="emitEvent('mousewheel', $event)"
|
|
41
|
-
@touchstart="emitEvent('touchstart', $event)"
|
|
42
|
-
@touchmove="emitEvent('touchmove', $event)"
|
|
43
|
-
@touchend="emitEvent('touchend', $event)"
|
|
44
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
-
>
|
|
46
|
-
<defs>
|
|
47
|
-
<clipPath :id="clipPathId">
|
|
48
|
-
<path :d="getPoints"></path>
|
|
49
|
-
</clipPath>
|
|
50
|
-
</defs>
|
|
51
|
-
<path
|
|
52
|
-
class="gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-story-polygon"
|
|
53
|
-
:style="{
|
|
54
|
-
...root.style['chart-row-bar-polygon'],
|
|
55
|
-
...root.style['chart-row-story-polygon'],
|
|
56
|
-
...task.style['base'],
|
|
57
|
-
...task.style['chart-row-bar-polygon']
|
|
58
|
-
}"
|
|
59
|
-
:d="getPoints"
|
|
60
|
-
></path>
|
|
61
|
-
<progress-bar :task="task" :clip-path="'url(#' + clipPathId + ')'"></progress-bar>
|
|
62
|
-
</svg>
|
|
63
|
-
<chart-text :task="task" v-if="root.state.options.chart.text.display"></chart-text>
|
|
64
|
-
</g>
|
|
65
|
-
</template>
|
|
66
|
-
|
|
67
|
-
<script>
|
|
68
|
-
import ChartText from '../Text.vue';
|
|
69
|
-
import ProgressBar from '../ProgressBar.vue';
|
|
70
|
-
import Expander from '../../Expander.vue';
|
|
71
|
-
import taskMixin from './Task.mixin.js';
|
|
72
|
-
export default {
|
|
73
|
-
name: 'Story',
|
|
74
|
-
components: {
|
|
75
|
-
ChartText,
|
|
76
|
-
ProgressBar,
|
|
77
|
-
Expander
|
|
78
|
-
},
|
|
79
|
-
inject: ['root'],
|
|
80
|
-
props: ['task'],
|
|
81
|
-
mixins: [taskMixin],
|
|
82
|
-
data() {
|
|
83
|
-
return {};
|
|
84
|
-
},
|
|
85
|
-
computed: {
|
|
86
|
-
/**
|
|
87
|
-
* Get clip path id
|
|
88
|
-
*
|
|
89
|
-
* @returns {string}
|
|
90
|
-
*/
|
|
91
|
-
clipPathId() {
|
|
92
|
-
return 'gantt-elastic__story-clip-path-' + this.task.id;
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get points (rounded rectangle for stories)
|
|
97
|
-
*
|
|
98
|
-
* @returns {string}
|
|
99
|
-
*/
|
|
100
|
-
getPoints() {
|
|
101
|
-
const task = this.task;
|
|
102
|
-
const corner = Math.min(task.height / 4, 8); // Rounded corners
|
|
103
|
-
return `M ${corner},0
|
|
104
|
-
L ${task.width - corner} 0
|
|
105
|
-
Q ${task.width} 0 ${task.width} ${corner}
|
|
106
|
-
L ${task.width} ${task.height - corner}
|
|
107
|
-
Q ${task.width} ${task.height} ${task.width - corner} ${task.height}
|
|
108
|
-
L ${corner} ${task.height}
|
|
109
|
-
Q 0 ${task.height} 0 ${task.height - corner}
|
|
110
|
-
L 0 ${corner}
|
|
111
|
-
Q 0 0 ${corner} 0
|
|
112
|
-
Z`;
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Should we display expander?
|
|
117
|
-
*
|
|
118
|
-
* @returns {boolean}
|
|
119
|
-
*/
|
|
120
|
-
displayExpander() {
|
|
121
|
-
const expander = this.root.state.options.chart.expander;
|
|
122
|
-
const hasChildren = this.task.allChildren && this.task.allChildren.length > 0;
|
|
123
|
-
return (expander.display || (expander.displayIfTaskListHidden && !this.root.state.options.taskList.display)) && hasChildren;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
</script>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g
|
|
3
|
-
class="gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-subtask-wrapper"
|
|
4
|
-
:style="{
|
|
5
|
-
...root.style['chart-row-bar-wrapper'],
|
|
6
|
-
...root.style['chart-row-subtask-wrapper'],
|
|
7
|
-
...task.style['chart-row-bar-wrapper']
|
|
8
|
-
}"
|
|
9
|
-
>
|
|
10
|
-
<foreignObject
|
|
11
|
-
class="gantt-elastic__chart-expander gantt-elastic__chart-expander--subtask"
|
|
12
|
-
:style="{
|
|
13
|
-
...root.style['chart-expander'],
|
|
14
|
-
...root.style['chart-expander--subtask'],
|
|
15
|
-
...task.style['chart-expander']
|
|
16
|
-
}"
|
|
17
|
-
:x="task.x - root.state.options.chart.expander.offset - root.state.options.chart.expander.size"
|
|
18
|
-
:y="task.y + (root.state.options.row.height - root.state.options.chart.expander.size) / 2"
|
|
19
|
-
:width="root.state.options.chart.expander.size"
|
|
20
|
-
:height="root.state.options.chart.expander.size"
|
|
21
|
-
v-if="displayExpander"
|
|
22
|
-
>
|
|
23
|
-
<expander :tasks="[task]" :options="root.state.options.chart.expander" type="chart"></expander>
|
|
24
|
-
</foreignObject>
|
|
25
|
-
<svg
|
|
26
|
-
class="gantt-elastic__chart-row-bar gantt-elastic__chart-row-subtask"
|
|
27
|
-
:style="{ ...root.style['chart-row-bar'], ...root.style['chart-row-subtask'], ...task.style['chart-row-bar'] }"
|
|
28
|
-
:x="task.x"
|
|
29
|
-
:y="task.y"
|
|
30
|
-
:width="task.width"
|
|
31
|
-
:height="task.height"
|
|
32
|
-
:viewBox="`0 0 ${task.width} ${task.height}`"
|
|
33
|
-
@click="emitEvent('click', $event)"
|
|
34
|
-
@mouseenter="emitEvent('mouseenter', $event)"
|
|
35
|
-
@mouseover="emitEvent('mouseover', $event)"
|
|
36
|
-
@mouseout="emitEvent('mouseout', $event)"
|
|
37
|
-
@mousemove="emitEvent('mousemove', $event)"
|
|
38
|
-
@mousedown="emitEvent('mousedown', $event)"
|
|
39
|
-
@mouseup="emitEvent('mouseup', $event)"
|
|
40
|
-
@mousewheel="emitEvent('mousewheel', $event)"
|
|
41
|
-
@touchstart="emitEvent('touchstart', $event)"
|
|
42
|
-
@touchmove="emitEvent('touchmove', $event)"
|
|
43
|
-
@touchend="emitEvent('touchend', $event)"
|
|
44
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
-
>
|
|
46
|
-
<defs>
|
|
47
|
-
<clipPath :id="clipPathId">
|
|
48
|
-
<polygon :points="getPoints"></polygon>
|
|
49
|
-
</clipPath>
|
|
50
|
-
</defs>
|
|
51
|
-
<polygon
|
|
52
|
-
class="gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-subtask-polygon"
|
|
53
|
-
:style="{
|
|
54
|
-
...root.style['chart-row-bar-polygon'],
|
|
55
|
-
...root.style['chart-row-subtask-polygon'],
|
|
56
|
-
...task.style['base'],
|
|
57
|
-
...task.style['chart-row-bar-polygon']
|
|
58
|
-
}"
|
|
59
|
-
:points="getPoints"
|
|
60
|
-
></polygon>
|
|
61
|
-
<progress-bar :task="task" :clip-path="'url(#' + clipPathId + ')'"></progress-bar>
|
|
62
|
-
</svg>
|
|
63
|
-
<chart-text :task="task" v-if="root.state.options.chart.text.display"></chart-text>
|
|
64
|
-
</g>
|
|
65
|
-
</template>
|
|
66
|
-
|
|
67
|
-
<script>
|
|
68
|
-
import ChartText from '../Text.vue';
|
|
69
|
-
import ProgressBar from '../ProgressBar.vue';
|
|
70
|
-
import Expander from '../../Expander.vue';
|
|
71
|
-
import taskMixin from './Task.mixin.js';
|
|
72
|
-
export default {
|
|
73
|
-
name: 'Subtask',
|
|
74
|
-
components: {
|
|
75
|
-
ChartText,
|
|
76
|
-
ProgressBar,
|
|
77
|
-
Expander
|
|
78
|
-
},
|
|
79
|
-
inject: ['root'],
|
|
80
|
-
props: ['task'],
|
|
81
|
-
mixins: [taskMixin],
|
|
82
|
-
data() {
|
|
83
|
-
return {};
|
|
84
|
-
},
|
|
85
|
-
computed: {
|
|
86
|
-
/**
|
|
87
|
-
* Get clip path id
|
|
88
|
-
*
|
|
89
|
-
* @returns {string}
|
|
90
|
-
*/
|
|
91
|
-
clipPathId() {
|
|
92
|
-
return 'gantt-elastic__subtask-clip-path-' + this.task.id;
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get points (simple rectangle for subtasks)
|
|
97
|
-
*
|
|
98
|
-
* @returns {string}
|
|
99
|
-
*/
|
|
100
|
-
getPoints() {
|
|
101
|
-
const task = this.task;
|
|
102
|
-
return `0,0 ${task.width},0 ${task.width},${task.height} 0,${task.height}`;
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Should we display expander?
|
|
107
|
-
*
|
|
108
|
-
* @returns {boolean}
|
|
109
|
-
*/
|
|
110
|
-
displayExpander() {
|
|
111
|
-
const expander = this.root.state.options.chart.expander;
|
|
112
|
-
const hasChildren = this.task.allChildren && this.task.allChildren.length > 0;
|
|
113
|
-
return (expander.display || (expander.displayIfTaskListHidden && !this.root.state.options.taskList.display)) && hasChildren;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
</script>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export default {
|
|
3
|
-
computed: {
|
|
4
|
-
/**
|
|
5
|
-
* Get view box
|
|
6
|
-
*
|
|
7
|
-
* @returns {string}
|
|
8
|
-
*/
|
|
9
|
-
getViewBox() {
|
|
10
|
-
const task = this.task;
|
|
11
|
-
return `0 0 ${task.width} ${task.height}`;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get group transform
|
|
16
|
-
*
|
|
17
|
-
* @returns {string}
|
|
18
|
-
*/
|
|
19
|
-
getGroupTransform() {
|
|
20
|
-
return `translate(${this.task.x} ${this.task.y})`;
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Should we display expander?
|
|
25
|
-
*
|
|
26
|
-
* @returns {boolean}
|
|
27
|
-
*/
|
|
28
|
-
displayExpander() {
|
|
29
|
-
const expander = this.root.state.options.chart.expander;
|
|
30
|
-
const hasChildren = this.task.allChildren && this.task.allChildren.length > 0;
|
|
31
|
-
return (expander.display || (expander.displayIfTaskListHidden && !this.root.state.options.taskList.display)) && hasChildren;
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
methods: {
|
|
35
|
-
/**
|
|
36
|
-
* Emit event
|
|
37
|
-
*
|
|
38
|
-
* @param {string} eventName
|
|
39
|
-
* @param {Event} event
|
|
40
|
-
*/
|
|
41
|
-
emitEvent(eventName, event) {
|
|
42
|
-
if (!this.root.state.options.scroll.scrolling) {
|
|
43
|
-
this.root.$emit(`chart-${this.task.type}-${eventName}`, { event, data: this.task });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|