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.
Files changed (66) hide show
  1. package/dist/demo.html +1 -0
  2. package/dist/tgganttchart.common.js +11480 -0
  3. package/dist/tgganttchart.common.js.map +1 -0
  4. package/dist/tgganttchart.css +1 -0
  5. package/dist/tgganttchart.umd.js +11491 -0
  6. package/dist/tgganttchart.umd.js.map +1 -0
  7. package/dist/tgganttchart.umd.min.js +7 -0
  8. package/dist/tgganttchart.umd.min.js.map +1 -0
  9. package/package.json +4 -1
  10. package/babel.config.js +0 -5
  11. package/src/.eslintrc.js +0 -18
  12. package/src/App.vue +0 -780
  13. package/src/GanttElastic.standalone.vue +0 -48
  14. package/src/GanttElastic.vue +0 -2305
  15. package/src/assets/logo.png +0 -0
  16. package/src/components/Calendar/Calendar.vue +0 -559
  17. package/src/components/Calendar/CalendarRow.vue +0 -112
  18. package/src/components/Chart/Chart.vue +0 -117
  19. package/src/components/Chart/DaysHighlight.vue +0 -60
  20. package/src/components/Chart/DependencyLines.vue +0 -112
  21. package/src/components/Chart/Grid.vue +0 -205
  22. package/src/components/Chart/ProgressBar.vue +0 -110
  23. package/src/components/Chart/Row/Epic.vue +0 -131
  24. package/src/components/Chart/Row/Milestone.vue +0 -117
  25. package/src/components/Chart/Row/Project.vue +0 -132
  26. package/src/components/Chart/Row/Story.vue +0 -127
  27. package/src/components/Chart/Row/Subtask.vue +0 -117
  28. package/src/components/Chart/Row/Task.mixin.js +0 -47
  29. package/src/components/Chart/Row/Task.vue +0 -82
  30. package/src/components/Chart/Text.vue +0 -105
  31. package/src/components/Expander.vue +0 -114
  32. package/src/components/GanttElastic.standalone.vue +0 -48
  33. package/src/components/GanttElastic.vue +0 -1646
  34. package/src/components/Header/GanttViewFilter.vue +0 -154
  35. package/src/components/Header/Header.vue +0 -266
  36. package/src/components/MainView.vue +0 -283
  37. package/src/components/TaskList/ItemColumn.vue +0 -212
  38. package/src/components/TaskList/TaskList.vue +0 -45
  39. package/src/components/TaskList/TaskListHeader.vue +0 -143
  40. package/src/components/TaskList/TaskListItem.vue +0 -35
  41. package/src/components/bundle.js +0 -28
  42. package/src/components/components/Calendar/Calendar.vue +0 -332
  43. package/src/components/components/Calendar/CalendarRow.vue +0 -96
  44. package/src/components/components/Chart/Chart.vue +0 -111
  45. package/src/components/components/Chart/DaysHighlight.vue +0 -71
  46. package/src/components/components/Chart/DependencyLines.vue +0 -112
  47. package/src/components/components/Chart/Grid.vue +0 -164
  48. package/src/components/components/Chart/ProgressBar.vue +0 -110
  49. package/src/components/components/Chart/Row/Milestone.vue +0 -117
  50. package/src/components/components/Chart/Row/Project.vue +0 -131
  51. package/src/components/components/Chart/Row/Task.mixin.js +0 -46
  52. package/src/components/components/Chart/Row/Task.vue +0 -107
  53. package/src/components/components/Chart/Text.vue +0 -105
  54. package/src/components/components/Expander.vue +0 -126
  55. package/src/components/components/Header/Header.vue +0 -265
  56. package/src/components/components/MainView.vue +0 -282
  57. package/src/components/components/TaskList/ItemColumn.vue +0 -121
  58. package/src/components/components/TaskList/TaskList.vue +0 -45
  59. package/src/components/components/TaskList/TaskListHeader.vue +0 -143
  60. package/src/components/components/TaskList/TaskListItem.vue +0 -35
  61. package/src/components/components/bundle.js +0 -28
  62. package/src/components/style.js +0 -308
  63. package/src/index.js +0 -12
  64. package/src/main.js +0 -6
  65. package/src/style.js +0 -398
  66. package/vue.config.js +0 -42
@@ -1,82 +0,0 @@
1
- <template>
2
- <g class="gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-task-wrapper" :style="{
3
- ...root.style['chart-row-bar-wrapper'],
4
- ...root.style['chart-row-task-wrapper'],
5
- ...task.style['chart-row-bar-wrapper']
6
- }">
7
- <foreignObject class="gantt-elastic__chart-expander gantt-elastic__chart-expander--task" :style="{
8
- ...root.style['chart-expander'],
9
- ...root.style['chart-expander--task'],
10
- ...task.style['chart-expander']
11
- }" :x="task.x - root.state.options.chart.expander.offset - root.state.options.chart.expander.size"
12
- :y="task.y + (root.state.options.row.height - root.state.options.chart.expander.size) / 2"
13
- :width="root.state.options.chart.expander.size" :height="root.state.options.chart.expander.size"
14
- v-if="displayExpander">
15
- <expander :tasks="[task]" :options="root.state.options.chart.expander" type="chart"></expander>
16
- </foreignObject>
17
- <svg class="gantt-elastic__chart-row-bar gantt-elastic__chart-row-task"
18
- :style="{ ...root.style['chart-row-bar'], ...root.style['chart-row-task'], ...task.style['chart-row-bar'] }"
19
- :x="task.x" :y="task.y" :width="task.width" :height="task.height" :viewBox="`0 0 ${task.width} ${task.height}`"
20
- @click="emitEvent('click', $event)" @mouseenter="emitEvent('mouseenter', $event)"
21
- @mouseover="emitEvent('mouseover', $event)" @mouseout="emitEvent('mouseout', $event)"
22
- @mousemove="emitEvent('mousemove', $event)" @mousedown="emitEvent('mousedown', $event)"
23
- @mouseup="emitEvent('mouseup', $event)" @mousewheel="emitEvent('mousewheel', $event)"
24
- @touchstart="emitEvent('touchstart', $event)" @touchmove="emitEvent('touchmove', $event)"
25
- @touchend="emitEvent('touchend', $event)" xmlns="http://www.w3.org/2000/svg">
26
- <defs>
27
- <clipPath :id="clipPathId">
28
- <polygon :points="getPoints"></polygon>
29
- </clipPath>
30
- </defs>
31
- <polygon class="gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-task-polygon" :style="{
32
- ...root.style['chart-row-bar-polygon'],
33
- ...root.style['chart-row-task-polygon'],
34
- ...task.style['base'],
35
- ...task.style['chart-row-bar-polygon']
36
- }" :points="getPoints"></polygon>
37
- <progress-bar :task="task" :clip-path="'url(#' + clipPathId + ')'"></progress-bar>
38
- </svg>
39
- <chart-text :task="task" v-if="root.state.options.chart.text.display"></chart-text>
40
- </g>
41
- </template>
42
-
43
- <script>
44
- import ChartText from '../Text.vue';
45
- import ProgressBar from '../ProgressBar.vue';
46
- import Expander from '../../Expander.vue';
47
- import taskMixin from './Task.mixin.js';
48
- export default {
49
- name: 'Task',
50
- components: {
51
- ChartText,
52
- ProgressBar,
53
- Expander
54
- },
55
- inject: ['root'],
56
- props: ['task'],
57
- mixins: [taskMixin],
58
- data() {
59
- return {};
60
- },
61
- computed: {
62
- /**
63
- * Get clip path id
64
- *
65
- * @returns {string}
66
- */
67
- clipPathId() {
68
- return 'gantt-elastic__task-clip-path-' + this.task.id;
69
- },
70
-
71
- /**
72
- * Get points
73
- *
74
- * @returns {string}
75
- */
76
- getPoints() {
77
- const task = this.task;
78
- return `0,0 ${task.width},0 ${task.width},${task.height} 0,${task.height}`;
79
- }
80
- }
81
- };
82
- </script>
@@ -1,105 +0,0 @@
1
-
2
- <template>
3
- <svg
4
- class="gantt-elastic__chart-row-text-wrapper"
5
- :style="{ ...root.style['chart-row-text-wrapper'] }"
6
- :x="task.x + task.width + root.state.options.chart.text.offset"
7
- :y="task.y - root.state.options.chart.grid.horizontal.gap"
8
- :width="getWidth"
9
- :height="getHeight"
10
- >
11
- <foreignObject x="0" y="0" width="100%" :height="getHeight">
12
- <div
13
- xmlns="http://www.w3.org/1999/xhtml"
14
- class="gantt-elastic__chart-row-text"
15
- :style="{ ...root.style['chart-row-text'] }"
16
- >
17
- <div
18
- class="gantt-elastic__chart-row-text-content gantt-elastic__chart-row-text-content--text"
19
- :style="{
20
- ...root.style['chart-row-text-content'],
21
- ...root.style['chart-row-text-content--text'],
22
- ...contentStyle
23
- }"
24
- v-if="!html"
25
- >
26
- <div>{{ task.label }}</div>
27
- </div>
28
- <div
29
- class="gantt-elastic__chart-row-text-content gantt-elastic__chart-row-text-content--html"
30
- :style="{
31
- ...root.style['chart-row-text-content'],
32
- ...root.style['chart-row-text-content--html'],
33
- ...contentStyle
34
- }"
35
- v-if="html"
36
- v-html="task.label"
37
- ></div>
38
- </div>
39
- </foreignObject>
40
- </svg>
41
- </template>
42
-
43
- <script>
44
- export default {
45
- name: 'ChartText',
46
- inject: ['root'],
47
- props: ['task'],
48
- data() {
49
- return {};
50
- },
51
- computed: {
52
- /**
53
- * Get width
54
- *
55
- * @returns {number}
56
- */
57
- getWidth() {
58
- const textStyle = this.root.style['chart-row-text'];
59
- const font = `${textStyle['font-weight']} ${textStyle['font-size']} ${textStyle['font-family']}`;
60
- this.setFont(font); // Set font in a method
61
- const textWidth = this.root.state.ctx.measureText(this.task.label).width;
62
- return textWidth + this.root.state.options.chart.text.xPadding * 2;
63
- },
64
-
65
- /**
66
- * Get height
67
- *
68
- * @returns {number}
69
- */
70
- getHeight() {
71
- return this.task.height + this.root.state.options.chart.grid.horizontal.gap * 2;
72
- },
73
-
74
- /**
75
- * Get content style
76
- *
77
- * @returns {object}
78
- */
79
- contentStyle() {
80
- return { height: '100%', 'line-height': this.getHeight + 'px' };
81
- },
82
-
83
- /**
84
- * Should we render text as html?
85
- *
86
- * @returns {boolean}
87
- */
88
- html() {
89
- const cols = this.root.state.options.taskList.columns;
90
- for (let i = 0, len = cols.length; i < len; i++) {
91
- const col = cols[i];
92
- if (col.value === 'label' && typeof col.html !== 'undefined' && col.html) {
93
- return true;
94
- }
95
- }
96
- return false;
97
- }
98
- },
99
- methods: {
100
- setFont(font) {
101
- this.root.state.ctx.font = font; // Set font in a method
102
- }
103
- }
104
- };
105
- </script>
@@ -1,114 +0,0 @@
1
-
2
- <template>
3
- <div :class="getClassPrefix() + '-wrapper'" :style="{ ...root.style[getClassPrefix(false) + '-wrapper'], ...style }">
4
- <svg
5
- :class="getClassPrefix() + '-content'"
6
- :style="{ ...root.style[getClassPrefix(false) + '-content'] }"
7
- :width="options.size"
8
- :height="options.size"
9
- v-if="allChildren.length"
10
- @click="toggle"
11
- viewBox="0 0 16 16"
12
- >
13
- <!-- Simple arrow icon for expand/collapse -->
14
- <path
15
- :class="getClassPrefix() + '-arrow'"
16
- :style="{ ...root.style[getClassPrefix(false) + '-arrow'] }"
17
- :d="collapsed ? 'M6 4 L10 8 L6 12' : 'M4 6 L8 10 L12 6'"
18
- fill="none"
19
- stroke="currentColor"
20
- stroke-width="2"
21
- stroke-linecap="round"
22
- stroke-linejoin="round"
23
- />
24
- </svg>
25
- </div>
26
- </template>
27
-
28
- <script>
29
- export default {
30
- name: 'Expander',
31
- inject: ['root'],
32
- props: ['tasks', 'options', 'type'],
33
- data() {
34
- const border = 0.5;
35
- return {
36
- border,
37
- borderStyle: {
38
- 'stroke-width': border
39
- },
40
- lineOffset: 5
41
- };
42
- },
43
- computed: {
44
- style() {
45
- if (this.type !== 'taskList') {
46
- return {};
47
- }
48
- const margin = this.root.state.options.taskList.expander.margin;
49
- const padding = this.tasks[0].parents.length * this.root.state.options.taskList.expander.padding;
50
- return {
51
- 'padding-left': padding + margin + 'px',
52
- margin: 'auto 0'
53
- };
54
- },
55
- /**
56
- * Get all tasks
57
- *
58
- * @returns {array}
59
- */
60
- allChildren() {
61
- const children = [];
62
- this.tasks.forEach(task => {
63
- task.allChildren.forEach(childId => {
64
- children.push(childId);
65
- });
66
- });
67
- return children;
68
- },
69
- /**
70
- * Is current expander collapsed?
71
- *
72
- * @returns {boolean}
73
- */
74
- collapsed() {
75
- if (this.tasks.length === 0) {
76
- return false;
77
- }
78
- let collapsed = 0;
79
- for (let i = 0, len = this.tasks.length; i < len; i++) {
80
- if (this.tasks[i].collapsed) {
81
- collapsed++;
82
- }
83
- }
84
- return collapsed === this.tasks.length;
85
- }
86
- },
87
- methods: {
88
- /**
89
- * Get specific class prefix
90
- *
91
- * @returns {string}
92
- */
93
- getClassPrefix(full = true) {
94
- return `${full ? 'gantt-elastic__' : ''}${this.options.type}-expander`;
95
- },
96
- /**
97
- * Toggle expander
98
- */
99
- toggle() {
100
- if (this.tasks.length === 0) {
101
- return;
102
- }
103
- const collapsed = !this.collapsed;
104
- this.tasks.forEach(task => {
105
- task.collapsed = collapsed;
106
- });
107
-
108
- // Force reactivity update
109
- this.$forceUpdate();
110
- this.root.$forceUpdate();
111
- }
112
- }
113
- };
114
- </script>
@@ -1,48 +0,0 @@
1
- <template>
2
- <gantt-elastic :tasks="tasks" :options="options" :dynamicStyle="dynamicStyle">
3
- <component v-if="components.header" :is="components.header" slot="header"></component>
4
- <component v-if="components.footer" :is="components.footer" slot="footer"></component>
5
- </gantt-elastic>
6
- </template>
7
-
8
- <script>
9
- import GanttElastic from './GanttElastic.vue';
10
-
11
- export default {
12
- name: 'GanttElasticStandalone',
13
- components: {
14
- 'gantt-elastic': GanttElastic,
15
- },
16
- props: {
17
- // Props to receive from parent
18
- tasks: {
19
- type: Array,
20
- default: () => [],
21
- },
22
- options: {
23
- type: Object,
24
- default: () => ({}),
25
- },
26
- dynamicStyle: {
27
- type: Object,
28
- default: () => ({}),
29
- },
30
- header: {
31
- type: Object,
32
- default: () => ({}),
33
- },
34
- footer: {
35
- type: Object,
36
- default: () => ({}),
37
- },
38
- },
39
- data() {
40
- return {
41
- components: {
42
- header: this.header,
43
- footer: this.footer,
44
- },
45
- };
46
- },
47
- };
48
- </script>