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,212 +0,0 @@
1
- <template>
2
- <div class="gantt-elastic__task-list-item-column" :style="itemColumnStyle">
3
- <div class="gantt-elastic__task-list-item-value-wrapper" :style="wrapperStyle">
4
- <slot></slot>
5
- <div class="gantt-elastic__task-list-item-value-container" :style="containerStyle">
6
- <div
7
- v-if="!html"
8
- class="gantt-elastic__task-list-item-value"
9
- :style="valueStyle"
10
- @click="emitEvent('click', $event)"
11
- @mouseenter="emitEvent('mouseenter', $event)"
12
- @mouseover="emitEvent('mouseover', $event)"
13
- @mouseout="emitEvent('mouseout', $event)"
14
- @mousemove="emitEvent('mousemove', $event)"
15
- @mousedown="emitEvent('mousedown', $event)"
16
- @mouseup="emitEvent('mouseup', $event)"
17
- @mousewheel="emitEvent('mousewheel', $event)"
18
- @touchstart="emitEvent('touchstart', $event)"
19
- @touchmove="emitEvent('touchmove', $event)"
20
- @touchend="emitEvent('touchend', $event)"
21
- >
22
- <div v-if="column.expander && taskIcon" class="gantt-elastic__task-list-item-icon" :style="iconStyle">
23
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
24
- <path :d="taskIcon" :fill="iconColor" :stroke="iconStroke" stroke-width="0.8"/>
25
- </svg>
26
- </div>
27
- <span class="gantt-elastic__task-list-item-text">{{ value }}</span>
28
- </div>
29
- <div
30
- v-else
31
- class="gantt-elastic__task-list-item-value"
32
- :style="valueStyle"
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
- >
45
- <div v-if="column.expander && taskIcon" class="gantt-elastic__task-list-item-icon" :style="iconStyle">
46
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
47
- <path :d="taskIcon" :fill="iconColor" :stroke="iconStroke" stroke-width="0.8"/>
48
- </svg>
49
- </div>
50
- <span class="gantt-elastic__task-list-item-text" v-html="value"></span>
51
- </div>
52
- </div>
53
- </div>
54
- </div>
55
- </template>
56
-
57
- <script>
58
- export default {
59
- name: 'ItemColumn',
60
- inject: ['root'],
61
- props: ['column', 'task'],
62
- data() {
63
- return {};
64
- },
65
- methods: {
66
- /**
67
- * Emit event
68
- *
69
- * @param {String} eventName
70
- * @param {Event} event
71
- */
72
- emitEvent(eventName, event) {
73
- if (typeof this.column.events !== 'undefined' && typeof this.column.events[eventName] === 'function') {
74
- this.column.events[eventName]({ event, data: this.task, column: this.column });
75
- }
76
- this.root.$emit(`taskList-${this.task.type}-${eventName}`, { event, data: this.task, column: this.column });
77
- }
78
- },
79
- computed: {
80
- /**
81
- * Should we display html or just text?
82
- *
83
- * @returns {boolean}
84
- */
85
- html() {
86
- if (typeof this.column.html !== 'undefined' && this.column.html === true) {
87
- return true;
88
- }
89
- return false;
90
- },
91
-
92
- /**
93
- * Get column value
94
- *
95
- * @returns {any|string}
96
- */
97
- value() {
98
- if (typeof this.column.value === 'function') {
99
- return this.column.value(this.task);
100
- }
101
- return this.task[this.column.value];
102
- },
103
-
104
- itemColumnStyle() {
105
- return {
106
- ...this.root.style['task-list-item-column'],
107
- ...this.column.style['task-list-item-column'],
108
- width: this.column.finalWidth + 'px',
109
- height: this.column.height + 'px'
110
- };
111
- },
112
-
113
- wrapperStyle() {
114
- return {
115
- ...this.root.style['task-list-item-value-wrapper'],
116
- ...this.column.style['task-list-item-value-wrapper']
117
- };
118
- },
119
-
120
- containerStyle() {
121
- return {
122
- ...this.root.style['task-list-item-value-container'],
123
- ...this.column.style['task-list-item-value-container']
124
- };
125
- },
126
-
127
- valueStyle() {
128
- return { ...this.root.style['task-list-item-value'], ...this.column.style['task-list-item-value'] };
129
- },
130
-
131
- /**
132
- * Get task icon based on task type or custom icon property
133
- *
134
- * @returns {string|null}
135
- */
136
- taskIcon() {
137
- // Check if task has a custom icon property
138
- if (this.task.icon) {
139
- return this.task.icon;
140
- }
141
-
142
- // Default icons based on task type - matching the interface
143
- const iconMap = {
144
- 'milestone': 'M7 2 L12 7 L7 12 L2 7 Z', // Purple diamond for milestones
145
- 'task': 'M3 3 L11 3 L11 11 L3 11 Z', // Blue square for tasks
146
- 'project': 'M7 2 L12 7 L7 12 L2 7 Z', // Purple diamond for projects
147
- 'sprint': 'M3 4 L11 4 L11 10 L3 10 Z', // Rectangle for sprints
148
- 'flag': 'M3 3 L9 3 L9 7 L7 9 L5 7 L5 3 Z M3 3 L3 11 M5 3 L5 11', // Green flag
149
- 'check': 'M3 3 L11 3 L11 11 L3 11 Z M5 7 L7 9 L9 5', // Blue checkmark in square
150
- 'epic': 'M7 2 L12 7 L7 12 L2 7 Z' // Purple diamond for epics
151
- };
152
-
153
- // Always return an icon for tasks, default to task icon if type not found
154
- return iconMap[this.task.type] || iconMap['task'];
155
- },
156
-
157
- /**
158
- * Get icon color based on task properties
159
- *
160
- * @returns {string}
161
- */
162
- iconColor() {
163
- if (this.task.iconColor) {
164
- return this.task.iconColor;
165
- }
166
-
167
- // Default colors based on task type - matching chart grid bar colors
168
- const colorMap = {
169
- 'milestone': '#CD5C5C', // Light maroon - matches chart
170
- 'task': '#3B82F6', // Blue - matches chart
171
- 'project': '#8B5CF6', // Purple - matches chart
172
- 'sprint': '#F59E0B', // Orange rectangle
173
- 'flag': '#10B981', // Green flag
174
- 'check': '#3B82F6', // Blue checkmark
175
- 'epic': '#8B5CF6', // Purple - matches chart
176
- 'story': '#86EFAC', // Light green - matches chart
177
- 'subtask': '#3B82F6' // Blue - matches chart
178
- };
179
-
180
- return colorMap[this.task.type] || '#6B7280'; // Gray default
181
- },
182
-
183
- /**
184
- * Get icon stroke color
185
- *
186
- * @returns {string}
187
- */
188
- iconStroke() {
189
- if (this.task.iconStroke) {
190
- return this.task.iconStroke;
191
- }
192
- return this.iconColor; // Same as fill color
193
- },
194
-
195
- /**
196
- * Get icon style
197
- *
198
- * @returns {object}
199
- */
200
- iconStyle() {
201
- return {
202
- display: 'flex',
203
- alignItems: 'center',
204
- marginRight: '6px',
205
- flexShrink: 0,
206
- width: '14px',
207
- height: '14px'
208
- };
209
- }
210
- }
211
- };
212
- </script>
@@ -1,45 +0,0 @@
1
-
2
- <template>
3
- <div
4
- class="gantt-elastic__task-list-wrapper"
5
- ref="taskListWrapper"
6
- :style="{ ...root.style['task-list-wrapper'], width: '100%', height: '100%' }"
7
- v-show="root.state.options.taskList.display"
8
- >
9
- <div class="gantt-elastic__task-list" :style="{ ...root.style['task-list'] }" ref="taskList">
10
- <task-list-header></task-list-header>
11
- <div
12
- class="gantt-elastic__task-list-items"
13
- ref="taskListItems"
14
- :style="{ ...root.style['task-list-items'], height: root.state.options.rowsHeight + 'px' }"
15
- >
16
- <task-list-item v-for="task in root.visibleTasks" :key="task.id" :task="task"></task-list-item>
17
- </div>
18
- </div>
19
- </div>
20
- </template>
21
-
22
- <script>
23
- import TaskListHeader from './TaskListHeader.vue';
24
- import TaskListItem from './TaskListItem.vue';
25
- export default {
26
- name: 'TaskList',
27
- components: {
28
- TaskListHeader,
29
- TaskListItem
30
- },
31
- inject: ['root'],
32
- data() {
33
- return {};
34
- },
35
-
36
- /**
37
- * Mounted
38
- */
39
- mounted() {
40
- this.root.state.refs.taskListWrapper = this.$refs.taskListWrapper;
41
- this.root.state.refs.taskList = this.$refs.taskList;
42
- this.root.state.refs.taskListItems = this.$refs.taskListItems;
43
- }
44
- };
45
- </script>
@@ -1,143 +0,0 @@
1
- <template>
2
- <div
3
- class="gantt-elastic__task-list-header"
4
- :style="headerStyle"
5
- >
6
- <div
7
- class="gantt-elastic__task-list-header-column"
8
- v-for="column in root.getTaskListColumns"
9
- :key="column._id"
10
- :style="columnStyle(column)"
11
- >
12
- <task-list-expander
13
- v-if="column.expander"
14
- :tasks="collapsible"
15
- :options="root.state.options.taskList.expander"
16
- ></task-list-expander>
17
- <div
18
- class="gantt-elastic__task-list-header-label"
19
- :style="headerLabelStyle(column)"
20
- :column="column"
21
- @mouseup="resizerMouseUp"
22
- >
23
- {{ column.label }}
24
- </div>
25
- <div
26
- class="gantt-elastic__task-list-header-resizer-wrapper"
27
- :style="resizerWrapperStyle(column)"
28
- :column="column"
29
- @mousedown="resizerMouseDown($event, column)"
30
- >
31
- <div class="gantt-elastic__task-list-header-resizer" :style="resizerStyle(column)">
32
- <div
33
- class="gantt-elastic__task-list-header-resizer-dot"
34
- v-for="dot in 3"
35
- :key="dot"
36
- :style="resizerDotStyle(column)"
37
- ></div>
38
- </div>
39
- </div>
40
- </div>
41
- </div>
42
- </template>
43
-
44
- <script>
45
- import TaskListExpander from '../Expander.vue';
46
-
47
- export default {
48
- name: 'TaskListHeader',
49
- components: {
50
- TaskListExpander
51
- },
52
- inject: ['root'],
53
- data() {
54
- return {
55
- resizer: {
56
- moving: false,
57
- x: 0
58
- }
59
- };
60
- },
61
- computed: {
62
- collapsible() {
63
- return this.root.state.tasks.filter(task => task.allChildren.length > 0);
64
- },
65
- headerStyle() {
66
- return {
67
- ...this.root.style['task-list-header'],
68
- height: `${this.root.state.options.calendar.height}px`,
69
- marginBottom: `${this.root.state.options.calendar.gap}px`
70
- };
71
- }
72
- },
73
- methods: {
74
- columnStyle(column) {
75
- return {
76
- ...this.root.style['task-list-header-column'],
77
- ...column.style['task-list-header-column'],
78
- width: `${column.finalWidth}px`
79
- };
80
- },
81
- headerLabelStyle(column) {
82
- return {
83
- ...this.root.style['task-list-header-label'],
84
- ...column.style['task-list-header-label']
85
- };
86
- },
87
- resizerWrapperStyle(column) {
88
- return {
89
- ...this.root.style['task-list-header-resizer-wrapper'],
90
- ...column.style['task-list-header-resizer-wrapper']
91
- };
92
- },
93
- resizerStyle(column) {
94
- return {
95
- ...this.root.style['task-list-header-resizer'],
96
- ...column.style['task-list-header-resizer']
97
- };
98
- },
99
- resizerDotStyle(column) {
100
- return {
101
- ...this.root.style['task-list-header-resizer-dot'],
102
- ...column.style['task-list-header-resizer-dot']
103
- };
104
- },
105
- resizerMouseDown(event, column) {
106
- if (!this.resizer.moving) {
107
- this.resizer.moving = column;
108
- this.resizer.x = event.clientX;
109
- this.resizer.initialWidth = column.width;
110
- this.root.$emit('taskList-column-width-change-start', this.resizer.moving);
111
- }
112
- },
113
- resizerMouseMove(event) {
114
- if (this.resizer.moving) {
115
- const lastWidth = this.resizer.moving.width;
116
- this.resizer.moving.width = this.resizer.initialWidth + event.clientX - this.resizer.x;
117
- if (this.resizer.moving.width < this.root.state.options.taskList.minWidth) {
118
- this.resizer.moving.width = this.root.state.options.taskList.minWidth;
119
- }
120
- if (lastWidth !== this.resizer.moving.width) {
121
- this.root.$emit('taskList-column-width-change', this.resizer.moving);
122
- }
123
- }
124
- },
125
- resizerMouseUp() {
126
- if (this.resizer.moving) {
127
- this.root.$emit('taskList-column-width-change-stop', this.resizer.moving);
128
- this.resizer.moving = false;
129
- }
130
- }
131
- },
132
- created() {
133
- document.addEventListener('mouseup', this.resizerMouseUp);
134
- document.addEventListener('mousemove', this.resizerMouseMove);
135
- this.root.$on('main-view-mousemove', this.resizerMouseMove);
136
- this.root.$on('main-view-mouseup', this.resizerMouseUp);
137
- },
138
- // beforeDestroy() {
139
- // document.removeEventListener('mouseup', this.resizerMouseUp);
140
- // document.removeEventListener('mousemove', this.resizerMouseMove);
141
- // }
142
- };
143
- </script>
@@ -1,35 +0,0 @@
1
-
2
- <template>
3
- <div class="gantt-elastic__task-list-item" :style="{ ...root.style['task-list-item'] }">
4
- <item-column v-for="column in columns" :key="column._id" :column="column" :task="task">
5
- <task-list-expander
6
- v-if="column.expander"
7
- :tasks="[task]"
8
- :options="root.state.options.taskList.expander"
9
- type="taskList"
10
- ></task-list-expander>
11
- </item-column>
12
- </div>
13
- </template>
14
- <script>
15
- import TaskListExpander from '../Expander.vue';
16
- import ItemColumn from './ItemColumn.vue';
17
-
18
- export default {
19
- name: 'TaskListItem',
20
- components: {
21
- TaskListExpander,
22
- ItemColumn
23
- },
24
- inject: ['root'],
25
- props: ['task'],
26
- data() {
27
- return {};
28
- },
29
- computed: {
30
- columns() {
31
- return this.root.state.options.taskList.columns;
32
- }
33
- }
34
- };
35
- </script>
@@ -1,28 +0,0 @@
1
-
2
- import Vue from 'vue';
3
- import { mergeDeep } from '../GanttElastic.vue';
4
- import GanttElasticStandalone from '../GanttElastic.standalone.vue';
5
-
6
- window.GanttElastic = {
7
- component: GanttElasticStandalone,
8
- mount(config) {
9
- const ready = typeof config.ready === 'function' ? config.ready : () => { };
10
- const cfg = mergeDeep({}, config);
11
- if (typeof cfg.dynamicStyle === 'undefined') {
12
- cfg.dynamicStyle = {};
13
- }
14
- const ganttElastic = { ...GanttElasticStandalone };
15
- for (let prop in cfg) {
16
- if (['el', 'ready'].includes(prop)) {
17
- continue;
18
- }
19
- if (typeof ganttElastic[prop] !== 'undefined') {
20
- ganttElastic[prop] = { ...ganttElastic[prop], ...cfg[prop] };
21
- continue;
22
- }
23
- ganttElastic[prop] = cfg[prop];
24
- }
25
- return new Vue(ganttElastic).$on('gantt-elastic-ready', ready).$mount(cfg.el);
26
- }
27
- };
28
- export default GanttElasticStandalone;