Skip to content

Commit f172a27

Browse files
committed
Merge branch 'release/1.2.0'
2 parents fb54672 + bfff583 commit f172a27

21 files changed

+926
-162
lines changed

docs/.vitepress/theme/components/ConnectionsGanttDemo.vue

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const rows = ref([
2222
}
2323
]
2424
},
25-
start: '2024-12-10 09:00',
26-
end: '2024-12-10 14:00',
25+
start: '2024-12-25 09:00',
26+
end: '2024-12-25 14:00',
2727
},
2828
{
2929
ganttBarConfig: {
@@ -39,8 +39,8 @@ const rows = ref([
3939
}
4040
]
4141
},
42-
start: '2024-12-10 15:00',
43-
end: '2024-12-11 12:00',
42+
start: '2024-12-25 15:00',
43+
end: '2024-12-26 12:00',
4444
},
4545
],
4646
},
@@ -61,17 +61,17 @@ const rows = ref([
6161
}
6262
]
6363
},
64-
start: '2024-12-11 13:00',
65-
end: '2024-12-12 12:00',
64+
start: '2024-12-26 13:00',
65+
end: '2024-12-26 12:00',
6666
},
6767
{
6868
ganttBarConfig: {
6969
id: 'dev2',
7070
label: 'Testing',
7171
style: { background: '#D4A5A5' },
7272
},
73-
start: '2024-12-12 13:00',
74-
end: '2024-12-12 17:00',
73+
start: '2024-12-26 13:00',
74+
end: '2024-12-26 17:00',
7575
},
7676
],
7777
},
@@ -86,14 +86,15 @@ onMounted(() => {
8686
<ClientOnly>
8787
<div class="demo-container" v-if="isLibraryReady">
8888
<g-gantt-chart
89-
chart-start="2024-12-10 08:00"
90-
chart-end="2024-12-13 23:00"
89+
chart-start="2024-12-25 08:00"
90+
chart-end="2024-12-27 23:00"
9191
precision="hour"
9292
bar-start="start"
9393
bar-end="end"
9494
:enable-connections="true"
9595
:push-on-connect="true"
9696
color-scheme="dark"
97+
:holidayHighlight="'US'"
9798
>
9899
<g-gantt-row
99100
v-for="row in rows"

docs/.vitepress/theme/components/OtherGanttDemo.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ onMounted(() => {
247247
:enable-connections="true"
248248
grid
249249
label-column-title="Rows"
250-
251250
>
252251
<g-gantt-row
253252
v-for="row in rows"

docs/api/types.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ interface BarConnection {
5454
animated?: boolean;
5555
animationSpeed?: ConnectionSpeed;
5656
}
57+
58+
export interface GanttMilestone {
59+
date: string
60+
name: string
61+
description?: string
62+
color?: string
63+
}
5764
```
5865
## Label Data Types
5966

docs/components/g-gantt-chart.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ Here's a minimal example of using the GGanttChart component:
6464
| currentTime | `boolean` | `false` | Show current time indicator |
6565
| currentTimeLabel | `string` | `''` | Label for current time indicator |
6666
| dateFormat | `string \| false` | `'YYYY-MM-DD HH:mm'` | Format for dates |
67-
67+
| milestones | `GanttMilestone[]` | `[]` | List of milestone |
68+
| holidayHighlight| `string` | `` | Country Cody of date-holidays |
6869

6970
### Events
7071

docs/examples/advanced.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,85 @@ const rows = ref([
121121
color: #666;
122122
}
123123
</style>
124+
```
125+
126+
## Multi Label Columns
127+
128+
```vue
129+
<template>
130+
<g-gantt-chart
131+
v-bind="chartConfig"
132+
:push-on-overlap="true"
133+
:no-overlap="true"
134+
label-column-title="Project Details"
135+
:multi-column-label="multiColumnLabel"
136+
>
137+
<g-gantt-row
138+
v-for="row in rows"
139+
:key="row.label"
140+
:label="row.label"
141+
:bars="row.bars"
142+
/>
143+
</g-gantt-chart>
144+
</template>
145+
146+
<script setup lang="ts">
147+
const rows = ref([
148+
{
149+
label: 'Constrained Tasks',
150+
bars: [
151+
{
152+
start: '2024-01-01',
153+
end: '2024-01-15',
154+
ganttBarConfig: {
155+
id: '1',
156+
label: 'Immobile Task',
157+
immobile: true
158+
}
159+
},
160+
{
161+
start: '2024-01-16',
162+
end: '2024-01-30',
163+
ganttBarConfig: {
164+
id: '2',
165+
label: 'Movable Task',
166+
pushOnOverlap: true
167+
}
168+
}
169+
]
170+
}
171+
])
172+
173+
const getN = (row: ChartRow) => {
174+
return row.bars.length
175+
}
176+
177+
const sortN = (a: ChartRow, b: ChartRow) => {
178+
const aId = a.bars.length ?? 0
179+
const bId = b.bars.length ?? 0
180+
return aId < bId ? -1 : aId > bId ? 1 : 0
181+
}
182+
183+
184+
const multiColumnLabel = ref<LabelColumnConfig[]>([
185+
{
186+
field: 'Id',
187+
sortable: false,
188+
},
189+
{
190+
field: 'Label',
191+
},
192+
{
193+
field: 'StartDate',
194+
},
195+
{
196+
field: 'Duration',
197+
},
198+
{
199+
field: 'Bars N°',
200+
valueGetter: getN,
201+
sortFn: sortN,
202+
},
203+
])
204+
</script>
124205
```

0 commit comments

Comments
 (0)