@nocobase/plugin-gantt 2.1.0-beta.36 → 2.1.0-beta.38

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 (146) hide show
  1. package/client-v2.d.ts +2 -0
  2. package/client-v2.js +3 -0
  3. package/dist/client/index.js +1 -1
  4. package/dist/client-v2/143.1a8cf1cd5ce17b64.js +10 -0
  5. package/dist/client-v2/416.b7bb09162520e448.js +10 -0
  6. package/dist/client-v2/617.de3dc437887f3f07.js +10 -0
  7. package/dist/client-v2/872.e640aca77c79d895.js +10 -0
  8. package/dist/client-v2/index.d.ts +10 -0
  9. package/dist/client-v2/index.js +10 -0
  10. package/dist/client-v2/locale.d.ts +78 -0
  11. package/dist/client-v2/models/GanttBlockModel.d.ts +98 -0
  12. package/dist/client-v2/models/GanttBlockModel.helpers.d.ts +31 -0
  13. package/dist/client-v2/models/GanttBlockModel.settings.d.ts +9 -0
  14. package/dist/client-v2/models/actions/GanttActionModels.d.ts +33 -0
  15. package/dist/client-v2/models/actions/GanttPopupModels.d.ts +26 -0
  16. package/dist/client-v2/models/components/GanttBlock.d.ts +13 -0
  17. package/dist/client-v2/models/components/GanttBlock.helpers.d.ts +22 -0
  18. package/dist/client-v2/models/components/GanttBlock.styles.d.ts +22 -0
  19. package/dist/client-v2/models/components/GanttBlock.tree.d.ts +46 -0
  20. package/dist/client-v2/models/components/getLabelFormatValue.d.ts +11 -0
  21. package/dist/client-v2/models/index.d.ts +11 -0
  22. package/dist/client-v2/plugin.d.ts +13 -0
  23. package/dist/externalVersion.js +7 -6
  24. package/dist/locale/de-DE.json +2 -0
  25. package/dist/locale/en-US.json +25 -1
  26. package/dist/locale/es-ES.json +2 -0
  27. package/dist/locale/fr-FR.json +2 -0
  28. package/dist/locale/hu-HU.json +2 -0
  29. package/dist/locale/id-ID.json +2 -0
  30. package/dist/locale/it-IT.json +2 -0
  31. package/dist/locale/ja-JP.json +2 -0
  32. package/dist/locale/ko-KR.json +2 -0
  33. package/dist/locale/nl-NL.json +2 -0
  34. package/dist/locale/pt-BR.json +2 -0
  35. package/dist/locale/ru-RU.json +2 -0
  36. package/dist/locale/tr-TR.json +2 -0
  37. package/dist/locale/uk-UA.json +2 -0
  38. package/dist/locale/vi-VN.json +2 -0
  39. package/dist/locale/zh-CN.json +25 -1
  40. package/dist/locale/zh-TW.json +4 -0
  41. package/dist/node_modules/@ctrl/tinycolor/LICENSE +7 -0
  42. package/dist/node_modules/@ctrl/tinycolor/dist/bundles/tinycolor.umd.min.js +2 -0
  43. package/dist/node_modules/@ctrl/tinycolor/dist/conversion.d.ts +61 -0
  44. package/dist/node_modules/@ctrl/tinycolor/dist/conversion.js +250 -0
  45. package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.d.ts +4 -0
  46. package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.js +157 -0
  47. package/dist/node_modules/@ctrl/tinycolor/dist/format-input.d.ts +37 -0
  48. package/dist/node_modules/@ctrl/tinycolor/dist/format-input.js +189 -0
  49. package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.d.ts +14 -0
  50. package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.js +30 -0
  51. package/dist/node_modules/@ctrl/tinycolor/dist/index.d.ts +207 -0
  52. package/dist/node_modules/@ctrl/tinycolor/dist/index.js +512 -0
  53. package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.d.ts +46 -0
  54. package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.js +2 -0
  55. package/dist/node_modules/@ctrl/tinycolor/dist/module/conversion.js +235 -0
  56. package/dist/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +154 -0
  57. package/dist/node_modules/@ctrl/tinycolor/dist/module/format-input.js +183 -0
  58. package/dist/node_modules/@ctrl/tinycolor/dist/module/from-ratio.js +25 -0
  59. package/dist/node_modules/@ctrl/tinycolor/dist/module/index.js +508 -0
  60. package/dist/node_modules/@ctrl/tinycolor/dist/module/interfaces.js +1 -0
  61. package/dist/node_modules/@ctrl/tinycolor/dist/module/public_api.js +12 -0
  62. package/dist/node_modules/@ctrl/tinycolor/dist/module/random.js +278 -0
  63. package/dist/node_modules/@ctrl/tinycolor/dist/module/readability.js +80 -0
  64. package/dist/node_modules/@ctrl/tinycolor/dist/module/to-ms-filter.js +16 -0
  65. package/dist/node_modules/@ctrl/tinycolor/dist/module/umd_api.js +20 -0
  66. package/dist/node_modules/@ctrl/tinycolor/dist/module/util.js +82 -0
  67. package/dist/node_modules/@ctrl/tinycolor/dist/public_api.d.ts +11 -0
  68. package/dist/node_modules/@ctrl/tinycolor/dist/public_api.js +1 -0
  69. package/dist/node_modules/@ctrl/tinycolor/dist/random.d.ts +24 -0
  70. package/dist/node_modules/@ctrl/tinycolor/dist/random.js +282 -0
  71. package/dist/node_modules/@ctrl/tinycolor/dist/readability.d.ts +46 -0
  72. package/dist/node_modules/@ctrl/tinycolor/dist/readability.js +86 -0
  73. package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.d.ts +5 -0
  74. package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.js +20 -0
  75. package/dist/node_modules/@ctrl/tinycolor/dist/umd_api.d.ts +23 -0
  76. package/dist/node_modules/@ctrl/tinycolor/dist/umd_api.js +22 -0
  77. package/dist/node_modules/@ctrl/tinycolor/dist/util.d.ts +36 -0
  78. package/dist/node_modules/@ctrl/tinycolor/dist/util.js +92 -0
  79. package/dist/node_modules/@ctrl/tinycolor/package.json +1 -0
  80. package/dist/shared/components/calendar/calendar.d.ts +22 -0
  81. package/dist/shared/components/calendar/calendar.js +417 -0
  82. package/dist/shared/components/calendar/style.d.ts +14 -0
  83. package/dist/shared/components/calendar/style.js +79 -0
  84. package/dist/shared/components/calendar/top-part-of-calendar.d.ts +19 -0
  85. package/dist/shared/components/calendar/top-part-of-calendar.js +57 -0
  86. package/dist/shared/components/gantt/style.d.ts +14 -0
  87. package/dist/shared/components/gantt/style.js +74 -0
  88. package/dist/shared/components/gantt/task-gantt-content.d.ts +35 -0
  89. package/dist/shared/components/gantt/task-gantt-content.js +337 -0
  90. package/dist/shared/components/gantt/task-gantt.d.ts +24 -0
  91. package/dist/shared/components/gantt/task-gantt.js +128 -0
  92. package/dist/shared/components/grid/grid-body.d.ts +21 -0
  93. package/dist/shared/components/grid/grid-body.js +114 -0
  94. package/dist/shared/components/grid/grid.d.ts +12 -0
  95. package/dist/shared/components/grid/grid.js +50 -0
  96. package/dist/shared/components/grid/style.d.ts +14 -0
  97. package/dist/shared/components/grid/style.js +54 -0
  98. package/dist/shared/components/other/arrow.d.ts +20 -0
  99. package/dist/shared/components/other/arrow.js +90 -0
  100. package/dist/shared/components/other/horizontal-scroll.d.ts +16 -0
  101. package/dist/shared/components/other/horizontal-scroll.js +64 -0
  102. package/dist/shared/components/other/style.d.ts +16 -0
  103. package/dist/shared/components/other/style.js +125 -0
  104. package/dist/shared/components/other/tooltip.d.ts +36 -0
  105. package/dist/shared/components/other/tooltip.js +137 -0
  106. package/dist/shared/components/other/vertical-scroll.d.ts +17 -0
  107. package/dist/shared/components/other/vertical-scroll.js +74 -0
  108. package/dist/shared/components/task-item/bar/bar-date-handle.d.ts +19 -0
  109. package/dist/shared/components/task-item/bar/bar-date-handle.js +62 -0
  110. package/dist/shared/components/task-item/bar/bar-display.d.ts +29 -0
  111. package/dist/shared/components/task-item/bar/bar-display.js +98 -0
  112. package/dist/shared/components/task-item/bar/bar-progress-handle.d.ts +15 -0
  113. package/dist/shared/components/task-item/bar/bar-progress-handle.js +49 -0
  114. package/dist/shared/components/task-item/bar/bar-small.d.ts +11 -0
  115. package/dist/shared/components/task-item/bar/bar-small.js +85 -0
  116. package/dist/shared/components/task-item/bar/bar.d.ts +11 -0
  117. package/dist/shared/components/task-item/bar/bar.js +113 -0
  118. package/dist/shared/components/task-item/bar/style.d.ts +10 -0
  119. package/dist/shared/components/task-item/bar/style.js +58 -0
  120. package/dist/shared/components/task-item/milestone/milestone.d.ts +11 -0
  121. package/dist/shared/components/task-item/milestone/milestone.js +72 -0
  122. package/dist/shared/components/task-item/milestone/style.d.ts +10 -0
  123. package/dist/shared/components/task-item/milestone/style.js +45 -0
  124. package/dist/shared/components/task-item/project/project.d.ts +11 -0
  125. package/dist/shared/components/task-item/project/project.js +77 -0
  126. package/dist/shared/components/task-item/project/style.d.ts +11 -0
  127. package/dist/shared/components/task-item/project/style.js +51 -0
  128. package/dist/shared/components/task-item/style.d.ts +12 -0
  129. package/dist/shared/components/task-item/style.js +74 -0
  130. package/dist/shared/components/task-item/task-item.d.ts +23 -0
  131. package/dist/shared/components/task-item/task-item.js +132 -0
  132. package/dist/shared/helpers/bar-helper.d.ts +22 -0
  133. package/dist/shared/helpers/bar-helper.js +415 -0
  134. package/dist/shared/helpers/date-helper.d.ts +27 -0
  135. package/dist/shared/helpers/date-helper.js +231 -0
  136. package/dist/shared/helpers/other-helper.d.ts +17 -0
  137. package/dist/shared/helpers/other-helper.js +97 -0
  138. package/dist/shared/types/bar-task.d.ts +30 -0
  139. package/dist/shared/types/bar-task.js +24 -0
  140. package/dist/shared/types/date-setup.d.ts +13 -0
  141. package/dist/shared/types/date-setup.js +24 -0
  142. package/dist/shared/types/gantt-task-actions.d.ts +16 -0
  143. package/dist/shared/types/gantt-task-actions.js +24 -0
  144. package/dist/shared/types/public-types.d.ts +145 -0
  145. package/dist/shared/types/public-types.js +46 -0
  146. package/package.json +2 -2
@@ -0,0 +1,97 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var other_helper_exports = {};
28
+ __export(other_helper_exports, {
29
+ getYmd: () => getYmd,
30
+ isBarTask: () => isBarTask,
31
+ isKeyboardEvent: () => isKeyboardEvent,
32
+ isMouseEvent: () => isMouseEvent,
33
+ removeHiddenTasks: () => removeHiddenTasks,
34
+ sortTasks: () => sortTasks
35
+ });
36
+ module.exports = __toCommonJS(other_helper_exports);
37
+ function isKeyboardEvent(event) {
38
+ return event.key !== void 0;
39
+ }
40
+ function isMouseEvent(event) {
41
+ return event.clientX !== void 0;
42
+ }
43
+ function isBarTask(task) {
44
+ return task.x1 !== void 0;
45
+ }
46
+ function removeHiddenTasks(tasks) {
47
+ const groupedTasks = tasks.filter((t) => t.hideChildren && t.type === "project");
48
+ if (groupedTasks.length > 0) {
49
+ for (let i = 0; groupedTasks.length > i; i++) {
50
+ const groupedTask = groupedTasks[i];
51
+ const children = getChildren(tasks, groupedTask);
52
+ tasks = tasks.filter((t) => children.indexOf(t) === -1);
53
+ }
54
+ }
55
+ return tasks;
56
+ }
57
+ function getChildren(taskList, task) {
58
+ let tasks = [];
59
+ if (task.type !== "project") {
60
+ tasks = taskList.filter((t) => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
61
+ } else {
62
+ tasks = taskList.filter((t) => t.project && t.project === task.id);
63
+ }
64
+ const taskChildren = [];
65
+ tasks.forEach((t) => {
66
+ taskChildren.push(...getChildren(taskList, t));
67
+ });
68
+ tasks = tasks.concat(tasks, taskChildren);
69
+ return tasks;
70
+ }
71
+ const sortTasks = (taskA, taskB) => {
72
+ const orderA = taskA.displayOrder || Number.MAX_VALUE;
73
+ const orderB = taskB.displayOrder || Number.MAX_VALUE;
74
+ if (orderA > orderB) {
75
+ return 1;
76
+ } else if (orderA < orderB) {
77
+ return -1;
78
+ } else {
79
+ return 0;
80
+ }
81
+ };
82
+ const getYmd = (date) => {
83
+ var _a;
84
+ if (!isNaN((_a = date == null ? void 0 : date.getTime) == null ? void 0 : _a.call(date))) {
85
+ return date.getFullYear() + `/${date.getMonth() + 1}/` + date.getDate();
86
+ }
87
+ return 0;
88
+ };
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ getYmd,
92
+ isBarTask,
93
+ isKeyboardEvent,
94
+ isMouseEvent,
95
+ removeHiddenTasks,
96
+ sortTasks
97
+ });
@@ -0,0 +1,30 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Task, TaskType } from './public-types';
10
+ export interface BarTask extends Task {
11
+ index: number;
12
+ typeInternal: TaskTypeInternal;
13
+ x1: number;
14
+ x2: number;
15
+ y: number;
16
+ height: number;
17
+ progressX: number;
18
+ progressWidth: number;
19
+ barCornerRadius: number;
20
+ handleWidth: number;
21
+ barChildren: BarTask[];
22
+ color?: string;
23
+ styles: {
24
+ backgroundColor: string;
25
+ backgroundSelectedColor: string;
26
+ progressColor: string;
27
+ progressSelectedColor: string;
28
+ };
29
+ }
30
+ export type TaskTypeInternal = TaskType | 'smalltask';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var bar_task_exports = {};
24
+ module.exports = __toCommonJS(bar_task_exports);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ViewMode } from './public-types';
10
+ export interface DateSetup {
11
+ dates: Date[];
12
+ viewMode: ViewMode;
13
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var date_setup_exports = {};
24
+ module.exports = __toCommonJS(date_setup_exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { BarTask } from './bar-task';
10
+ export type BarMoveAction = 'progress' | 'end' | 'start' | 'move';
11
+ export type GanttContentMoveAction = 'mouseenter' | 'mouseleave' | 'delete' | 'dblclick' | 'click' | 'select' | '' | BarMoveAction;
12
+ export type GanttEvent = {
13
+ changedTask?: BarTask;
14
+ originalSelectedTask?: BarTask;
15
+ action: GanttContentMoveAction;
16
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var gantt_task_actions_exports = {};
24
+ module.exports = __toCommonJS(gantt_task_actions_exports);
@@ -0,0 +1,145 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /// <reference types="react" />
10
+ export declare enum ViewMode {
11
+ Hour = "hour",
12
+ QuarterDay = "quarterDay",
13
+ HalfDay = "halfDay",
14
+ Day = "day",
15
+ /** ISO-8601 week */
16
+ Week = "week",
17
+ Month = "month",
18
+ QuarterYear = "quarterYear",
19
+ Year = "year"
20
+ }
21
+ export type TaskType = 'task' | 'milestone' | 'project';
22
+ export interface Task {
23
+ id: string;
24
+ type: TaskType;
25
+ name: string;
26
+ start: Date;
27
+ end: Date;
28
+ /**
29
+ * From 0 to 100
30
+ */
31
+ progress: number;
32
+ color?: string;
33
+ styles?: {
34
+ backgroundColor?: string;
35
+ backgroundSelectedColor?: string;
36
+ progressColor?: string;
37
+ progressSelectedColor?: string;
38
+ };
39
+ isDisabled?: boolean;
40
+ project?: string;
41
+ dependencies?: string[];
42
+ hideChildren?: boolean;
43
+ displayOrder?: number;
44
+ }
45
+ export interface EventOption {
46
+ /**
47
+ * Time step value for date changes.
48
+ */
49
+ timeStep?: number;
50
+ /**
51
+ * Invokes on bar select on unselect.
52
+ */
53
+ onSelect?: (task: Task, isSelected: boolean) => void;
54
+ /**
55
+ * Invokes on bar double click.
56
+ */
57
+ onDoubleClick?: (task: Task) => void;
58
+ /**
59
+ * Invokes on bar click.
60
+ */
61
+ onClick?: (task: Task) => void;
62
+ /**
63
+ * Invokes on end and start time change. Chart undoes operation if method return false or error.
64
+ */
65
+ onDateChange?: (task: Task, children: Task[]) => void | boolean | Promise<void> | Promise<boolean>;
66
+ /**
67
+ * Invokes on progress change. Chart undoes operation if method return false or error.
68
+ */
69
+ onProgressChange?: (task: Task, children: Task[]) => void | boolean | Promise<void> | Promise<boolean>;
70
+ /**
71
+ * Invokes on delete selected task. Chart undoes operation if method return false or error.
72
+ */
73
+ onDelete?: (task: Task) => void | boolean | Promise<void> | Promise<boolean>;
74
+ /**
75
+ * Invokes on expander on task list
76
+ */
77
+ onExpanderClick?: (task: Task) => void;
78
+ }
79
+ export interface DisplayOption {
80
+ viewMode?: ViewMode;
81
+ viewDate?: Date;
82
+ preStepsCount?: number;
83
+ /**
84
+ * Specifies the month name language. Able formats: ISO 639-2, Java Locale
85
+ */
86
+ locale?: string;
87
+ rtl?: boolean;
88
+ }
89
+ export interface StylingOption {
90
+ headerHeight?: number;
91
+ columnWidth?: number;
92
+ listCellWidth?: string;
93
+ rowHeight?: number;
94
+ ganttHeight?: number;
95
+ barCornerRadius?: number;
96
+ handleWidth?: number;
97
+ fontFamily?: string;
98
+ fontSize?: string;
99
+ /**
100
+ * How many of row width can be taken by task.
101
+ * From 0 to 100
102
+ */
103
+ barFill?: number;
104
+ barProgressColor?: string;
105
+ barProgressSelectedColor?: string;
106
+ barBackgroundColor?: string;
107
+ barBackgroundSelectedColor?: string;
108
+ projectProgressColor?: string;
109
+ projectProgressSelectedColor?: string;
110
+ projectBackgroundColor?: string;
111
+ projectBackgroundSelectedColor?: string;
112
+ milestoneBackgroundColor?: string;
113
+ milestoneBackgroundSelectedColor?: string;
114
+ arrowColor?: string;
115
+ arrowIndent?: number;
116
+ todayColor?: string;
117
+ TooltipContent?: React.FC<{
118
+ task: Task;
119
+ fontSize: string;
120
+ fontFamily: string;
121
+ }>;
122
+ TaskListHeader?: React.FC<{
123
+ headerHeight: number;
124
+ rowWidth: string;
125
+ fontFamily: string;
126
+ fontSize: string;
127
+ }>;
128
+ TaskListTable?: React.FC<{
129
+ rowHeight: number;
130
+ rowWidth: string;
131
+ fontFamily: string;
132
+ fontSize: string;
133
+ locale: string;
134
+ tasks: Task[];
135
+ selectedTaskId: string;
136
+ /**
137
+ * Sets selected task by id
138
+ */
139
+ setSelectedTask: (taskId: string) => void;
140
+ onExpanderClick: (task: Task) => void;
141
+ }>;
142
+ }
143
+ export interface GanttProps extends EventOption, DisplayOption, StylingOption {
144
+ tasks: Task[];
145
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var public_types_exports = {};
28
+ __export(public_types_exports, {
29
+ ViewMode: () => ViewMode
30
+ });
31
+ module.exports = __toCommonJS(public_types_exports);
32
+ var ViewMode = /* @__PURE__ */ ((ViewMode2) => {
33
+ ViewMode2["Hour"] = "hour";
34
+ ViewMode2["QuarterDay"] = "quarterDay";
35
+ ViewMode2["HalfDay"] = "halfDay";
36
+ ViewMode2["Day"] = "day";
37
+ ViewMode2["Week"] = "week";
38
+ ViewMode2["Month"] = "month";
39
+ ViewMode2["QuarterYear"] = "quarterYear";
40
+ ViewMode2["Year"] = "year";
41
+ return ViewMode2;
42
+ })(ViewMode || {});
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ ViewMode
46
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-gantt",
3
- "version": "2.1.0-beta.36",
3
+ "version": "2.1.0-beta.38",
4
4
  "displayName": "Block: Gantt",
5
5
  "displayName.ru-RU": "Блок: Диаграмма Ганта",
6
6
  "displayName.zh-CN": "区块:甘特图",
@@ -21,7 +21,7 @@
21
21
  "@nocobase/server": "2.x",
22
22
  "@nocobase/test": "2.x"
23
23
  },
24
- "gitHead": "397d45c744f6eb48b3a0cd785c87cbf1257c3513",
24
+ "gitHead": "d1c585108ff6e51c17b0b52bacb1a2d621d9c119",
25
25
  "keywords": [
26
26
  "Blocks"
27
27
  ]