1.0.13 • Published 4 months ago

react-timeline-scheduler v1.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

react-timeline-scheduler

A fully customizable, interactive timeline scheduler for managing tasks efficiently. Designed for production planning, scheduling, and tracking progress.

npm license downloads

A highly customizable timeline scheduler for managing production tasks efficiently in React applications.

✨ Features

  • Customizable Timeline - Adjust the view to show tasks by week, month, or custom ranges.
  • Task Progress Tracking - Visualize progress with a progress bar.
  • Dynamic Styling - Supports custom styles and colors per task.
  • Tooltip Support - Custom tooltips for detailed task information.

Installation

npm install react-timeline-scheduler

or

yarn add react-timeline-scheduler

Usage

import { WeeklyPlan } from "react-timeline-scheduler";
import { ProductionTask } from "react-timeline-scheduler/types";

const tasks: ProductionTask[] = [
  {
    id: "task-1",
    label: "Task A",
    departmentName: "Manufacturing",
    departmentId: "dept-1",
    startDate: new Date("2024-02-01"),
    endDate: new Date("2024-02-05"),
    progress: 50,
    bgColorKey: "blue",
    styleAllocationId: "style-1",
    extendedStyles: { borderRadius: "8px" },
    tooltipComponent: (task) => (
      <div>
        {task.label} - {task.progress}% Complete
      </div>
    ),
  },
  {
    id: "task-2",
    label: "Task B",
    departmentName: "Assembly",
    departmentId: "dept-2",
    startDate: new Date("2024-02-03"),
    endDate: new Date("2024-02-07"),
    prevEndDate: new Date("2024-02-06"),
    progress: 75,
    bgColorKey: "green",
    styleAllocationId: "style-2",
  },
];

const MyComponent = () => {
  return <WeeklyPlan tasks={tasks} />;
};

export default MyComponent;

📌 Props

WeeklyPlan

Prop NameTypeDescription
dataProductionTask[]Array of tasks to display in the scheduler.
startDateDateThe start date of the scheduler.
endDateDateThe end date of the scheduler.
onTaskClick(task: ProductionTask) => voidCallback when a task is clicked.
onTaskUpdate(updatedTask: ProductionTask) => voidCallback when a task is updated.

ProductionTask

PropertyTypeDescription
idstringUnique identifier for the task.
labelstringTask name.
departmentNamestringDepartment name the task belongs to.
departmentIdstringIdentifier for the department.
startDateDateTask start date.
endDateDateTask end date.
prevEndDateDate?Previous end date, useful for tracking changes.
styleAllocationIdstringID for style allocation.
progressnumber?Task completion progress (0-100).
bgColorKeystring?Key for background color theme.
extendedStylesOmit<React.CSSProperties, "width">?Custom styles for the task.
tooltipComponent(task: ProductionTask) => React.ReactNodeCustom tooltip rendering function.

<WeeklyPlan config={{data: []}} />

PropTypeRequiredDescription
dataProductionTask[]List of tasks to display in the scheduler.

ProductionTask

export interface ProductionTask {
  id: string;
  label: string;
  departmentName: string;
  departmentId: string;
  startDate: Date;
  endDate: Date;
  prevEndDate?: Date;
  styleAllocationId: string;
  progress?: number;
  bgColorKey?: string;
  extendedStyles?: Omit<React.CSSProperties, "width">;
  tooltipComponent?: (task: ProductionTask) => React.ReactNode;
}

🎨 Customization

  • Background Color: bgColorKey can be used to set task background colors dynamically.
  • Extended Styles: Pass additional CSS properties via extendedStyles.
  • Tooltips: Use tooltipComponent to display custom tooltip content.

📜 License

MIT License © 2024

1.0.13

4 months ago

1.0.12

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago