progress & list table hotfix
This commit is contained in:
parent
75e929f77a
commit
b555e8a3c6
12
example/package-lock.json
generated
12
example/package-lock.json
generated
@ -379,9 +379,9 @@
|
|||||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
||||||
},
|
},
|
||||||
"@types/react": {
|
"@types/react": {
|
||||||
"version": "16.9.48",
|
"version": "16.9.49",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.48.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.49.tgz",
|
||||||
"integrity": "sha512-4ykBVswgYitPGMXFRxJCHkxJDU2rjfU3/zw67f8+dB7sNdVJXsrwqoYxz/stkAucymnEEbRPFmX7Ce5Mc/kJCw==",
|
"integrity": "sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/prop-types": "*",
|
"@types/prop-types": "*",
|
||||||
"csstype": "^3.0.2"
|
"csstype": "^3.0.2"
|
||||||
@ -799,9 +799,9 @@
|
|||||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
||||||
},
|
},
|
||||||
"@types/react": {
|
"@types/react": {
|
||||||
"version": "16.9.48",
|
"version": "16.9.49",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.48.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.49.tgz",
|
||||||
"integrity": "sha512-4ykBVswgYitPGMXFRxJCHkxJDU2rjfU3/zw67f8+dB7sNdVJXsrwqoYxz/stkAucymnEEbRPFmX7Ce5Mc/kJCw==",
|
"integrity": "sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/prop-types": "*",
|
"@types/prop-types": "*",
|
||||||
"csstype": "^3.0.2"
|
"csstype": "^3.0.2"
|
||||||
|
|||||||
@ -111,7 +111,7 @@ const App = () => {
|
|||||||
onTaskDelete={onTaskDelete}
|
onTaskDelete={onTaskDelete}
|
||||||
onProgressChange={onProgressChange}
|
onProgressChange={onProgressChange}
|
||||||
onDoubleClick={onDblClick}
|
onDoubleClick={onDblClick}
|
||||||
listCellWidth={isChecked ? "150px" : ""}
|
listCellWidth={isChecked ? "155px" : ""}
|
||||||
columnWidth={columnWidth}
|
columnWidth={columnWidth}
|
||||||
/>
|
/>
|
||||||
<h3>Gantt With Limited Height</h3>
|
<h3>Gantt With Limited Height</h3>
|
||||||
@ -122,7 +122,7 @@ const App = () => {
|
|||||||
onTaskDelete={onTaskDelete}
|
onTaskDelete={onTaskDelete}
|
||||||
onProgressChange={onProgressChange}
|
onProgressChange={onProgressChange}
|
||||||
onDoubleClick={onDblClick}
|
onDoubleClick={onDblClick}
|
||||||
listCellWidth={isChecked ? "150px" : ""}
|
listCellWidth={isChecked ? "155px" : ""}
|
||||||
ganttHeight={300}
|
ganttHeight={300}
|
||||||
columnWidth={columnWidth}
|
columnWidth={columnWidth}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gantt-task-react",
|
"name": "gantt-task-react",
|
||||||
"version": "0.1.7",
|
"version": "0.1.8",
|
||||||
"description": "Interactive Gantt Chart for React with TypeScript.",
|
"description": "Interactive Gantt Chart for React with TypeScript.",
|
||||||
"author": "MaTeMaTuK <maksym.vikarii@gmail.com>",
|
"author": "MaTeMaTuK <maksym.vikarii@gmail.com>",
|
||||||
"homepage": "https://github.com/MaTeMaTuK/gantt-task-react",
|
"homepage": "https://github.com/MaTeMaTuK/gantt-task-react",
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const Gantt: React.SFC<GanttProps> = ({
|
|||||||
tasks,
|
tasks,
|
||||||
headerHeight = 50,
|
headerHeight = 50,
|
||||||
columnWidth = 60,
|
columnWidth = 60,
|
||||||
listCellWidth = "150px",
|
listCellWidth = "155px",
|
||||||
rowHeight = 50,
|
rowHeight = 50,
|
||||||
ganttHeight = 0,
|
ganttHeight = 0,
|
||||||
viewMode = ViewMode.Day,
|
viewMode = ViewMode.Day,
|
||||||
@ -151,7 +151,7 @@ export const Gantt: React.SFC<GanttProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// task change event
|
// task change event
|
||||||
const onTasksDateChange = (tasks: Task[]) => {
|
const handleTasksChange = (tasks: Task[]) => {
|
||||||
setGanttTasks(tasks);
|
setGanttTasks(tasks);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ export const Gantt: React.SFC<GanttProps> = ({
|
|||||||
fontSize,
|
fontSize,
|
||||||
arrowIndent,
|
arrowIndent,
|
||||||
svgHeight,
|
svgHeight,
|
||||||
onTasksDateChange: onTasksDateChange,
|
onTasksChange: handleTasksChange,
|
||||||
onDateChange,
|
onDateChange,
|
||||||
onProgressChange,
|
onProgressChange,
|
||||||
onDoubleClick,
|
onDoubleClick,
|
||||||
|
|||||||
@ -46,7 +46,7 @@ export type TaskGanttContentProps = {
|
|||||||
fontSize: string;
|
fontSize: string;
|
||||||
fontFamily: string;
|
fontFamily: string;
|
||||||
}>;
|
}>;
|
||||||
onTasksDateChange: (tasks: Task[]) => void;
|
onTasksChange: (tasks: Task[]) => void;
|
||||||
} & EventOption;
|
} & EventOption;
|
||||||
|
|
||||||
export const TaskGanttContent: React.FC<TaskGanttContentProps> = ({
|
export const TaskGanttContent: React.FC<TaskGanttContentProps> = ({
|
||||||
@ -68,7 +68,7 @@ export const TaskGanttContent: React.FC<TaskGanttContentProps> = ({
|
|||||||
arrowIndent,
|
arrowIndent,
|
||||||
fontFamily,
|
fontFamily,
|
||||||
fontSize,
|
fontSize,
|
||||||
onTasksDateChange,
|
onTasksChange,
|
||||||
onDateChange,
|
onDateChange,
|
||||||
onProgressChange,
|
onProgressChange,
|
||||||
onDoubleClick,
|
onDoubleClick,
|
||||||
@ -139,7 +139,7 @@ export const TaskGanttContent: React.FC<TaskGanttContentProps> = ({
|
|||||||
if (onTaskDelete) {
|
if (onTaskDelete) {
|
||||||
await onTaskDelete(selectedTask);
|
await onTaskDelete(selectedTask);
|
||||||
const newTasks = barTasks.filter(t => t.id !== selectedTask.id);
|
const newTasks = barTasks.filter(t => t.id !== selectedTask.id);
|
||||||
onTasksDateChange(newTasks);
|
onTasksChange(newTasks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (action === "mouseenter") {
|
} else if (action === "mouseenter") {
|
||||||
@ -226,13 +226,15 @@ export const TaskGanttContent: React.FC<TaskGanttContentProps> = ({
|
|||||||
isNotLikeOriginal
|
isNotLikeOriginal
|
||||||
) {
|
) {
|
||||||
await onDateChange(changedTask);
|
await onDateChange(changedTask);
|
||||||
const newTasks = barTasks.map(t =>
|
|
||||||
t.id === changedTask.id ? changedTask : t
|
|
||||||
);
|
|
||||||
onTasksDateChange(newTasks);
|
|
||||||
} else if (onProgressChange && isNotLikeOriginal) {
|
} else if (onProgressChange && isNotLikeOriginal) {
|
||||||
await onProgressChange(changedTask);
|
await onProgressChange(changedTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const newTasks = barTasks.map(t =>
|
||||||
|
t.id === changedTask.id ? changedTask : t
|
||||||
|
);
|
||||||
|
onTasksChange(newTasks);
|
||||||
|
|
||||||
svg.current.removeEventListener("mousemove", handleMouseMove);
|
svg.current.removeEventListener("mousemove", handleMouseMove);
|
||||||
svg.current.removeEventListener("mouseup", handleMouseUp);
|
svg.current.removeEventListener("mouseup", handleMouseUp);
|
||||||
setBarEvent({ action: "" });
|
setBarEvent({ action: "" });
|
||||||
|
|||||||
@ -45,6 +45,7 @@ export const TaskListTableDefault: React.FC<{
|
|||||||
className={styles.taskListCell}
|
className={styles.taskListCell}
|
||||||
style={{
|
style={{
|
||||||
minWidth: rowWidth,
|
minWidth: rowWidth,
|
||||||
|
maxWidth: rowWidth,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t.start.toLocaleDateString(locale, dateTimeOptions)}
|
{t.start.toLocaleDateString(locale, dateTimeOptions)}
|
||||||
@ -53,6 +54,7 @@ export const TaskListTableDefault: React.FC<{
|
|||||||
className={styles.taskListCell}
|
className={styles.taskListCell}
|
||||||
style={{
|
style={{
|
||||||
minWidth: rowWidth,
|
minWidth: rowWidth,
|
||||||
|
maxWidth: rowWidth,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t.end.toLocaleDateString(locale, dateTimeOptions)}
|
{t.end.toLocaleDateString(locale, dateTimeOptions)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user