Skip to content

Conversation

@jeonghanyun
Copy link
Owner

πŸš€ Extra Columns Support Feature

이 PR은 MaTeMaTuK/gantt-task-react PR #274의 "Add extra column support" κΈ°λŠ₯을 ν•œκ΅­μ–΄ 버전에 μ μš©ν•œ κ²ƒμž…λ‹ˆλ‹€.

✨ μ£Όμš” κΈ°λŠ₯

πŸ“Š Extra Columns

  • ExtraColumn μΈν„°νŽ˜μ΄μŠ€λ‘œ μ‚¬μš©μž μ •μ˜ 컬럼 지원
  • render ν•¨μˆ˜λ₯Ό ν†΅ν•œ μ»€μŠ€ν…€ 컬럼 μ½˜ν…μΈ  λ Œλ”λ§
  • key-value ν˜•νƒœλ‘œ extraColumns 데이터 μ €μž₯

🎨 컬럼 λ„ˆλΉ„ μ„€μ •

  • nameColumnWidth: 이름 컬럼 λ„ˆλΉ„ μ„€μ •
  • fromColumnWidth: μ‹œμž‘μΌ 컬럼 λ„ˆλΉ„ μ„€μ •
  • toColumnWidth: μ’…λ£ŒμΌ 컬럼 λ„ˆλΉ„ μ„€μ •

πŸ“… λ‚ μ§œ ν˜•μ‹ 선택

  • DateFormat νƒ€μž…: "locale" | "iso8601"
  • locale: λ‘œμΌ€μΌλ³„ λ‚ μ§œ ν˜•μ‹ (예: "Fri, June 15, 2025")
  • iso8601: ISO 8601 ν˜•μ‹ (예: "2025-06-15")

πŸ”§ μ‚¬μš© 예제

import { Gantt, Task, ExtraColumn, DateFormat } from 'gantt-task-react';

const extraColumns: ExtraColumn[] = [
  {
    key: "status",
    title: "Status",
    width: "120px",
    render: (task) => (
      <span className={`status-${task.extraColumns?.status}`}>
        {task.extraColumns?.status}
      </span>
    )
  },
  {
    key: "assignee",
    title: "Assignee",
    width: "140px"
  }
];

<Gantt 
  tasks={tasks}
  extraColumns={extraColumns}
  nameColumnWidth="200px"
  fromColumnWidth="130px"
  toColumnWidth="130px"
  dateFormat="iso8601"
/>

πŸ“ λ³€κ²½λœ νŒŒμΌλ“€

Core Files

  • src/types/public-types.ts: ExtraColumn, DateFormat νƒ€μž… μΆ”κ°€
  • src/components/gantt/gantt.tsx: μƒˆλ‘œμš΄ props 지원
  • src/components/task-list/task-list-header.tsx: 헀더 컬럼 μΆ”κ°€
  • src/components/task-list/task-list-table.tsx: ν…Œμ΄λΈ” 컬럼 및 λ‚ μ§œ ν˜•μ‹ 지원

Example Files

  • example/src/ExtraColumnsApp.tsx: μƒˆλ‘œμš΄ κΈ°λŠ₯ 데λͺ¨ μ•±
  • example/src/extra-columns-helper.tsx: 예제 데이터 및 μ„€μ •
  • example/src/App.tsx: ExtraColumnsApp μΆ”κ°€
  • example/src/index.css: 뱃지 μŠ€νƒ€μΌ μΆ”κ°€

βœ… ν…ŒμŠ€νŠΈ

  • λΉŒλ“œ 성곡
  • 예제 μ•± μ‹€ν–‰ 확인
  • TypeScript νƒ€μž… 검증
  • npm νŒ¨ν‚€μ§€ 배포 μ™„λ£Œ (@jeonghan/gantt-task-react-19-korean@1.1.0)

πŸ“¦ npm νŒ¨ν‚€μ§€

npm install @jeonghan/gantt-task-react-19-korean@1.1.0

이 κΈ°λŠ₯으둜 Gantt Chartμ—μ„œ λ”μš± ν’λΆ€ν•œ 정보λ₯Ό ν‘œμ‹œν•  수 있게 λ˜μ—ˆμŠ΅λ‹ˆλ‹€! πŸŽ‰

…ate formats

- Add ExtraColumn interface for custom columns with optional render functions
- Add DateFormat type with 'locale' and 'iso8601' options for date formatting
- Add nameColumnWidth, fromColumnWidth, toColumnWidth props for configurable column widths
- Add extraColumns prop to Task interface for storing additional column data
- Update TaskListHeader and TaskListTable components to support extra columns
- Add date format selector in example with ISO 8601 (YYYY-MM-DD) support
- Export new DateFormat and ExtraColumn types from main index
- Add example demonstrating extra columns with status, assignee, priority, and budget
- Update README with comprehensive documentation for new features

BREAKING CHANGE: Task interface extended with optional extraColumns field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants