Skip to content

Commit 1659872

Browse files
engunaipull[bot]
authored andcommitted
🤖 Merge PR #62347 [frappe-gantt] Upgrade version to 0.6 by @zhengruncai
* Upgrade version to 0.6 * added global variable VIEW_ MODE * the attribute viewMode adds the option Year * Upgrade version to 0.6 * added global variable VIEW_ MODE * the attribute viewMode adds the option Year
1 parent c1d2e4b commit 1659872

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

types/frappe-gantt/frappe-gantt-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const gantt1 = new Gantt('#gantt', tasks);
1515
const gantt2 = new Gantt(new HTMLElement(), tasks);
1616
const gantt3 = new Gantt(new SVGElement(), tasks);
1717

18-
gantt1.change_view_mode('Week');
18+
gantt1.change_view_mode(Gantt.VIEW_MODE.WEEK);
1919
gantt1.refresh(tasks);
2020

2121
new Gantt('#gantt', tasks, {

types/frappe-gantt/index.d.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// Type definitions for frappe-gantt 0.4
1+
// Type definitions for frappe-gantt 0.6
22
// Project: https://github.com/frappe/gantt
3-
// Definitions by: Sam Alexander <https://github.com/samalexander>, Elijah Lucian <https://github.com/eli7vh>
3+
// Definitions by: Sam Alexander <https://github.com/samalexander>,
4+
// Elijah Lucian <https://github.com/eli7vh>,
5+
// R2C <https://github.com/zhengruncai>
46
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
57

68
export = Gantt;
@@ -27,6 +29,7 @@ declare namespace Gantt {
2729
_start: Date;
2830
_end: Date;
2931
_index: number;
32+
invalid?: boolean | undefined;
3033
}
3134

3235
interface Options {
@@ -48,5 +51,9 @@ declare namespace Gantt {
4851
on_view_change?: ((mode: viewMode) => void) | undefined;
4952
}
5053

51-
type viewMode = 'Quarter Day' | 'Half Day' | 'Day' | 'Week' | 'Month';
54+
type viewMode = 'Quarter Day' | 'Half Day' | 'Day' | 'Week' | 'Month' | 'Year';
55+
56+
type viewModeKey = 'QUARTER_DAY' | 'HALF_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
57+
58+
const VIEW_MODE: Record<viewModeKey, viewMode>;
5259
}

0 commit comments

Comments
 (0)