@mogura/moguchart-core 0.5.2

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.
@@ -0,0 +1,612 @@
1
+ import type { MoguchartLocale } from './i18n';
2
+ /**
3
+ * ガントチャートのバーに適用できるパターンの種類
4
+ */
5
+ export type BarPattern = 'diagonal-stripe' | 'diagonal-stripe-thin' | 'diagonal-stripe-thick' | 'diagonal-stripe-reverse' | 'vertical-stripe' | 'horizontal-stripe' | 'checkerboard' | 'dots' | 'dots-dense' | 'triangle' | 'circle' | 'grid' | 'diagonal-grid';
6
+ /**
7
+ * タスクのバーのパターン設定
8
+ */
9
+ export interface GanttTaskPattern {
10
+ /** パターンの種類 */
11
+ type: BarPattern;
12
+ /** パターンの色 (CSS color string) */
13
+ color?: string;
14
+ }
15
+ /**
16
+ * マーカーの種類
17
+ */
18
+ export type MarkerType = 'triangle-up' | 'triangle-down' | 'triangle-left' | 'triangle-right' | 'diamond' | 'square';
19
+ /**
20
+ * マーカーのアンカー位置
21
+ */
22
+ export type AnchorType = 'start' | 'end' | 'center';
23
+ /**
24
+ * マーカーの設定
25
+ */
26
+ export interface GanttMarker {
27
+ /** マーカーの一意なID */
28
+ id: string;
29
+ /** マーカーの表示名 */
30
+ name?: string;
31
+ /** マーカーの日時 */
32
+ date: Date;
33
+ /** マーカーのアンカー位置 */
34
+ anchor?: AnchorType;
35
+ /** マーカーの種類 */
36
+ type: MarkerType;
37
+ /** マーカーの色 (CSS color string) */
38
+ color?: string;
39
+ /** マーカーのカスタムスタイル (CSS文字列) */
40
+ style?: string;
41
+ }
42
+ /**
43
+ * ガントチャート上の個々のタスクを表すインターフェース
44
+ */
45
+ export interface GanttTask {
46
+ /** タスクの一意なID */
47
+ id: string;
48
+ /** タスクの表示名 */
49
+ name?: string;
50
+ /** 開始日時 */
51
+ start: Date;
52
+ /** 終了日時 */
53
+ end: Date;
54
+ /** バーのカスタムスタイル (CSS文字列) */
55
+ style?: string;
56
+ /** バーのラベルのカスタムスタイル (CSS文字列) */
57
+ labelStyle?: string;
58
+ /** バーの塗りつぶしパターン */
59
+ pattern?: GanttTaskPattern;
60
+ /** 依存関係にあるタスクのID配列 */
61
+ dependencies?: string[];
62
+ /**
63
+ * ドラッグによる移動の許可設定
64
+ * 'both': 縦横移動可能 (デフォルト)
65
+ * 'x': 横移動のみ可能
66
+ * 'y': 縦移動のみ可能
67
+ * 'none': 移動不可
68
+ */
69
+ movable?: 'both' | 'x' | 'y' | 'none';
70
+ /** リサイズ可否 (指定がない場合はmovableの設定に準ずる) */
71
+ resizable?: boolean;
72
+ }
73
+ /**
74
+ * ガントチャートの行を表すインターフェース
75
+ */
76
+ export interface GanttRow {
77
+ /** 行の一意なID */
78
+ id: string;
79
+ /** 行ヘッダーに表示するラベル */
80
+ name: string;
81
+ /** この行に含まれるタスクの配列 */
82
+ tasks: GanttTask[];
83
+ /** マーカーの配列 */
84
+ markers?: GanttMarker[];
85
+ /** 行を表示するかどうか (デフォルト: true) */
86
+ visible?: boolean;
87
+ }
88
+ /**
89
+ * 内部計算用: レーン情報が付与されたタスク
90
+ */
91
+ export interface TaskWithLane extends GanttTask {
92
+ /** 表示されるレーン番号 (0始まり) */
93
+ lane: number;
94
+ }
95
+ /**
96
+ * ガントチャートのバーに関するオプション
97
+ */
98
+ export interface GanttChartOptionBar {
99
+ /** バーの高さ (px) */
100
+ height?: number;
101
+ /** バーの上下マージン (px) */
102
+ margin?: number;
103
+ /** バーの角丸の半径 (px) */
104
+ cornerRadius?: number;
105
+ }
106
+ /**
107
+ * 行ヘッダーに関するオプション
108
+ */
109
+ export interface GanttChartOptionRowHeader {
110
+ /** ヘッダーの幅 (px) */
111
+ width?: number;
112
+ /** ヘッダーの背景色 */
113
+ backgroundColor?: string;
114
+ /** ヘッダーのリサイズ可否 (デフォルト: true) */
115
+ resizable?: boolean;
116
+ /** ヘッダーの最小幅 (px) */
117
+ minWidth?: number;
118
+ /** ヘッダーの最大幅 (px) */
119
+ maxWidth?: number;
120
+ }
121
+ /**
122
+ * マイルストーンに関するオプション
123
+ */
124
+ export interface GanttChartMilestone {
125
+ /** マイルストーンの一意なID */
126
+ id: string;
127
+ /** マイルストーンの表示名 */
128
+ name: string;
129
+ /** マイルストーンの日時 */
130
+ start: Date;
131
+ /** マイルストーンの色 */
132
+ color: string;
133
+ /** 線の幅 (px)。デフォルト: 2 */
134
+ width?: number;
135
+ /** マイルストーンのカスタムスタイル (CSS文字列) */
136
+ style?: string;
137
+ }
138
+ /**
139
+ * カレンダー表示に関するオプション
140
+ */
141
+ export interface GanttChartOptionCalendar {
142
+ /** チャートの開始日時 */
143
+ start: Date;
144
+ /** チャートの終了日時 */
145
+ end: Date;
146
+ /** 1日あたりのピクセル幅 */
147
+ pxPerDay: number;
148
+ /** 月あたりのピクセル幅(指定された場合、月単位の等幅表示になる) */
149
+ pxPerMonth?: number;
150
+ /** 月の表示フォーマット (例: 'YYYY年M月') */
151
+ monthFormat?: string;
152
+ /** 行の背景を表示するかどうか */
153
+ showRowBackground?: boolean;
154
+ /** 祝日判定ロジック (trueを返すと祝日として扱われる) */
155
+ isHoliday?: (date: Date) => boolean;
156
+ /** 時間単位のグリッドを表示するかどうか */
157
+ showTime?: boolean;
158
+ /** 年月を表示するかどうか */
159
+ showMonths?: boolean;
160
+ /** 日付を表示するかどうか */
161
+ showDays?: boolean;
162
+ /** 現在時刻線を表示するかどうか */
163
+ showCurrentTime?: boolean;
164
+ /** 現在時刻バッジを表示するかどうか */
165
+ showCurrentTimeBadge?: boolean;
166
+ /** 現在時刻線を自動更新する間隔(ミリ秒)。0または未指定の場合は更新しない */
167
+ currentTimeUpdateInterval?: number;
168
+ /** 週番号ヘッダーを表示するかどうか */
169
+ showWeeks?: boolean;
170
+ /** 週の始まりの曜日 (0=日曜, 1=月曜, ..., 6=土曜)。デフォルト: 1 (月曜) */
171
+ weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
172
+ /** 週番号の表示フォーマット関数 (引数: 年の通算週番号、デフォルト: 'W1', 'W2'...) */
173
+ weekFormat?: (weekNumber: number, startDate: Date) => string;
174
+ /** 週番号セルのテキスト配置 (デフォルト: 'center') */
175
+ weekTextAlign?: 'left' | 'center' | 'right';
176
+ /** 月単位表示(上段=年、下段=月)を有効にするかどうか */
177
+ showMonthsRow?: boolean;
178
+ /** 月セルのテキスト配置 (デフォルト: 'center') */
179
+ monthTextAlign?: 'left' | 'center' | 'right';
180
+ /** マイルストーンの配列 */
181
+ milestones?: GanttChartMilestone[];
182
+ /** マウスカーソル位置の縦罫線を表示するかどうか */
183
+ showCursorLine?: boolean;
184
+ /** カーソル縦罫線の色 (CSS color string)。デフォルト: 現在時刻線と同色 */
185
+ cursorLineColor?: string;
186
+ }
187
+ /**
188
+ * カレンダー月セルのカスタムレンダリング用コンテキスト
189
+ */
190
+ export interface CalendarMonthCellContext {
191
+ /** 年 */
192
+ year: number;
193
+ /** 月 (0-11) */
194
+ month: number;
195
+ /** セルの幅 (px) */
196
+ width: number;
197
+ /** デフォルトのラベルテキスト */
198
+ defaultLabel: string;
199
+ }
200
+ /**
201
+ * カレンダー日セルのカスタムレンダリング用コンテキスト
202
+ */
203
+ export interface CalendarDayCellContext {
204
+ /** 日付 */
205
+ date: Date;
206
+ /** セルの幅 (px) */
207
+ width: number;
208
+ /** 土曜日かどうか */
209
+ isSaturday: boolean;
210
+ /** 日曜日かどうか */
211
+ isSunday: boolean;
212
+ /** 祝日かどうか */
213
+ isHoliday: boolean;
214
+ /** デフォルトのラベルテキスト */
215
+ defaultLabel: string;
216
+ }
217
+ /**
218
+ * カレンダー週セルのカスタムレンダリング用コンテキスト
219
+ */
220
+ export interface CalendarWeekCellContext {
221
+ /** 週番号 */
222
+ weekNumber: number;
223
+ /** 週の開始日 */
224
+ startDate: Date;
225
+ /** セルの幅 (px) */
226
+ width: number;
227
+ /** デフォルトのラベルテキスト */
228
+ defaultLabel: string;
229
+ }
230
+ /**
231
+ * カレンダー時間セルのカスタムレンダリング用コンテキスト
232
+ */
233
+ export interface CalendarHourCellContext {
234
+ /** 時間 (0-23) */
235
+ hour: number;
236
+ /** セルの幅 (px) */
237
+ width: number;
238
+ /** 対応する日付 */
239
+ date: Date;
240
+ }
241
+ /**
242
+ * ガントチャート背景の各日セルのカスタムレンダリング用コンテキスト
243
+ */
244
+ export interface ChartBackgroundCellContext {
245
+ /** 日付 */
246
+ date: Date;
247
+ /** セルの幅 (px) */
248
+ width: number;
249
+ /** セルの高さ (px) */
250
+ height: number;
251
+ /** 行のID */
252
+ rowId: string;
253
+ /** 土曜日かどうか */
254
+ isSaturday: boolean;
255
+ /** 日曜日かどうか */
256
+ isSunday: boolean;
257
+ /** 祝日かどうか */
258
+ isHoliday: boolean;
259
+ /** デフォルトの背景色 */
260
+ defaultColor: string;
261
+ /** 列インデックス (0始まり) */
262
+ index: number;
263
+ }
264
+ /**
265
+ * カスタムレンダリングに関するオプション
266
+ */
267
+ export interface GanttChartOptionCustomRendering {
268
+ /** バーのコンテンツをレンダリングする関数 */
269
+ barContent?: (task: GanttTask) => string | unknown;
270
+ /** 行ヘッダーのコンテンツをレンダリングする関数 */
271
+ rowHeaderContent?: (row: GanttRow) => string | unknown;
272
+ /** ツールチップのコンテンツをレンダリングする関数 */
273
+ tooltip?: (task: GanttTask) => string | unknown;
274
+ /** ドラッグ中の情報オーバーレイのコンテンツをレンダリングする関数 */
275
+ dragInfo?: (task: GanttTask, newStart: Date, newEnd: Date, targetRow?: GanttRow) => string | unknown;
276
+ /** 行ヘッダーの左上コーナーセルのコンテンツをレンダリングする関数 */
277
+ cornerContent?: () => string | unknown;
278
+ /** カレンダーの月セルをレンダリングする関数 */
279
+ calendarMonthContent?: (context: CalendarMonthCellContext) => string | unknown;
280
+ /** カレンダーの日セルをレンダリングする関数 */
281
+ calendarDayContent?: (context: CalendarDayCellContext) => string | unknown;
282
+ /** カレンダーの週セルをレンダリングする関数 */
283
+ calendarWeekContent?: (context: CalendarWeekCellContext) => string | unknown;
284
+ /** カレンダーの時間セルをレンダリングする関数 */
285
+ calendarHourContent?: (context: CalendarHourCellContext) => string | unknown;
286
+ /** ガントチャート部の背景セルをレンダリングする関数。各日のセルごとに呼ばれ、HTML文字列またはTemplateResultを返す */
287
+ chartBackground?: (context: ChartBackgroundCellContext) => string | unknown;
288
+ }
289
+ /**
290
+ * チャート背景右クリックイベントの詳細データ
291
+ */
292
+ export interface ChartContextMenuEventDetail {
293
+ event: MouseEvent;
294
+ date: Date;
295
+ rowId: string;
296
+ }
297
+ /**
298
+ * 依存関係線のスタイル
299
+ * - 'curve': ベジェ曲線
300
+ * - 'orthogonal': 直角折れ線(角丸付き)(デフォルト)
301
+ */
302
+ export type DependencyLineStyle = 'curve' | 'orthogonal';
303
+ /**
304
+ * 依存関係線に関するオプション
305
+ */
306
+ export interface GanttChartOptionDependency {
307
+ /** 矢印を表示するかどうか (デフォルト: true) */
308
+ showArrows?: boolean;
309
+ /** 矢印の大きさ (px)。デフォルト: 8 */
310
+ arrowSize?: number;
311
+ /**
312
+ * 接続線のスタイル (デフォルト: 'orthogonal')
313
+ * - 'curve': ベジェ曲線
314
+ * - 'orthogonal': 直角折れ線(角が丸くなる)
315
+ */
316
+ lineStyle?: DependencyLineStyle;
317
+ /** orthogonalスタイル時の角丸半径 (px)。デフォルト: 8 */
318
+ cornerRadius?: number;
319
+ }
320
+ /**
321
+ * ガントチャート全体のオプション設定
322
+ */
323
+ export interface GanttChartOption {
324
+ /** バーの設定 */
325
+ bar?: GanttChartOptionBar;
326
+ /** 行ヘッダーの設定 */
327
+ rowHeader?: GanttChartOptionRowHeader;
328
+ /** カレンダーの設定 */
329
+ calendar: GanttChartOptionCalendar;
330
+ /** 読み取り専用モードかどうか */
331
+ readOnly?: boolean;
332
+ /** ツールチップを表示するまでの遅延時間 (ms) */
333
+ tooltipDelay?: number;
334
+ /** ツールチップを表示するかどうか */
335
+ showTooltip?: boolean;
336
+ /** ドラッグ中の情報オーバーレイを表示するかどうか */
337
+ showDragInfoOverlay?: boolean;
338
+ /** テーマ ('light' | 'dark' | 'system') */
339
+ theme?: 'light' | 'dark' | 'system';
340
+ /** カスタムテーマカラー */
341
+ customTheme?: Partial<ThemeColorPalette>;
342
+ /** 行の並び替えを有効にするかどうか */
343
+ enableRowReordering?: boolean;
344
+ /** スナップする時間単位(分)。デフォルトは1440(1日) */
345
+ snapDuration?: number;
346
+ /** 非表示に設定された行を表示するかどうか (デフォルト: false) */
347
+ showHiddenRows?: boolean;
348
+ /** カスタムレンダリング設定 */
349
+ customRendering?: GanttChartOptionCustomRendering;
350
+ /** ロケール設定 (デフォルト: 日本語) */
351
+ locale?: MoguchartLocale;
352
+ /** 依存関係線の設定 */
353
+ dependency?: GanttChartOptionDependency;
354
+ /** キーボード操作の設定 */
355
+ keyboard?: {
356
+ /** キーボード操作を有効にするか (デフォルト: true) */
357
+ enabled?: boolean;
358
+ /** Shift+矢印キーでのタスク移動量(分)。省略時は snapDuration を使用 */
359
+ moveStep?: number;
360
+ };
361
+ }
362
+ /**
363
+ * タスク更新イベントの詳細データ
364
+ */
365
+ export interface TaskUpdateEventDetail extends GanttTask {
366
+ /** X方向の移動量 */
367
+ dx?: number;
368
+ /** Y方向の移動量 */
369
+ dy: number;
370
+ /** ドラッグ中かどうか */
371
+ isDragging: boolean;
372
+ /** ドロップ先の行ID */
373
+ targetRowId?: string;
374
+ /** マウスのX座標(ドラッグ中のみ) */
375
+ x?: number;
376
+ /** マウスのY座標(ドラッグ中のみ) */
377
+ y?: number;
378
+ /** タスク移動モード(move/copy) */
379
+ mode: GanttTaskMoveMode;
380
+ /** 複数選択移動時の対象タスクID配列 */
381
+ selectedTaskIds?: string[];
382
+ }
383
+ /**
384
+ * バーのホバーイベント詳細
385
+ */
386
+ export interface BarHoverEventDetail {
387
+ /** 対象のタスク */
388
+ task: GanttTask;
389
+ /** マウスのX座標 */
390
+ x: number;
391
+ /** マウスのY座標 */
392
+ y: number;
393
+ }
394
+ /**
395
+ * タスククリックイベントの詳細
396
+ */
397
+ export interface TaskClickEventDetail {
398
+ /** 対象のタスク */
399
+ task: GanttTask;
400
+ /** 元のマウスイベント */
401
+ event: MouseEvent;
402
+ }
403
+ /**
404
+ * タスクのコンテキストメニューイベントの詳細
405
+ */
406
+ export interface TaskContextMenuEventDetail {
407
+ /** 対象のタスク */
408
+ task: GanttTask;
409
+ /** 元のマウスイベント */
410
+ event: MouseEvent;
411
+ }
412
+ /**
413
+ * タスクドロップイベントの詳細
414
+ */
415
+ export interface TaskDropEventDetail {
416
+ /** ドロップされたタスク情報 */
417
+ task: GanttTask;
418
+ /** ドロップ位置の日時 */
419
+ dropDate: Date;
420
+ /** ドロップ先の行ID */
421
+ targetRowId: string;
422
+ }
423
+ /**
424
+ * 行の並び替えイベント詳細
425
+ */
426
+ export interface RowReorderEventDetail {
427
+ /** 移動元の行ID */
428
+ sourceId: string;
429
+ /** 移動元の行ID配列(複数選択時) */
430
+ sourceIds?: string[];
431
+ /** 移動先の行ID */
432
+ targetId: string;
433
+ /** 移動先に対する位置 ('top' | 'bottom') */
434
+ position?: 'top' | 'bottom';
435
+ /** 並び替え後の行データ */
436
+ rows: GanttRow[];
437
+ }
438
+ /**
439
+ * 行ヘッダーのリサイズイベント詳細
440
+ */
441
+ export interface RowHeaderResizeEventDetail {
442
+ /** 新しい幅 (px) */
443
+ width: number;
444
+ }
445
+ /**
446
+ * 行選択変更イベントの詳細
447
+ */
448
+ export interface RowSelectionChangeEventDetail {
449
+ /** 選択されている行IDの配列 */
450
+ selectedIds: string[];
451
+ }
452
+ /**
453
+ * バー選択変更イベントの詳細
454
+ */
455
+ export interface BarSelectionChangeEventDetail {
456
+ /** 選択されているタスクIDの配列 */
457
+ selectedIds: string[];
458
+ }
459
+ /**
460
+ * 行ヘッダークリックイベントの詳細
461
+ */
462
+ export interface RowHeaderClickEventDetail {
463
+ /** クリックされた行ID */
464
+ rowId: string;
465
+ /** クリックされた行データ */
466
+ row: GanttRow;
467
+ /** 元のクリックイベント */
468
+ event: MouseEvent;
469
+ /** クリックされたヘッダー要素 */
470
+ target: HTMLElement;
471
+ }
472
+ /**
473
+ * 行ヘッダーダブルクリックイベントの詳細
474
+ */
475
+ export interface RowHeaderDblClickEventDetail {
476
+ /** ダブルクリックされた行ID */
477
+ rowId: string;
478
+ /** ダブルクリックされた行データ */
479
+ row: GanttRow;
480
+ /** 元のダブルクリックイベント */
481
+ event: MouseEvent;
482
+ /** ダブルクリックされたヘッダー要素 */
483
+ target: HTMLElement;
484
+ }
485
+ /**
486
+ * 行ヘッダー右クリックイベントの詳細
487
+ */
488
+ export interface RowHeaderContextMenuEventDetail {
489
+ /** 右クリックされた行ID */
490
+ rowId: string;
491
+ /** 右クリックされた行データ */
492
+ row: GanttRow;
493
+ /** 元のコンテキストメニューイベント */
494
+ event: MouseEvent;
495
+ /** 右クリックされたヘッダー要素 */
496
+ target: HTMLElement;
497
+ }
498
+ /**
499
+ * テーマカラーパレット定義
500
+ */
501
+ export interface ThemeColorPalette {
502
+ /** 背景色 */
503
+ bg: string;
504
+ /** テキスト色 */
505
+ text: string;
506
+ /** ボーダー色 */
507
+ border: string;
508
+ /** グリッド線色 */
509
+ gridLine: string;
510
+ /** サブグリッド線色(スナップ単位など) */
511
+ subGridLine: string;
512
+ /** 月の区切りの縦罫線色 (オプション) */
513
+ monthGridLine?: string;
514
+ /** 年の区切りの縦罫線色 (オプション) */
515
+ yearGridLine?: string;
516
+ /** 時間単位モードの日付区切り縦罫線色 (オプション)。未指定時は monthGridLine → border にフォールバック */
517
+ showTimeDateLine?: string;
518
+ /** ドラッグ対象の背景色 */
519
+ dragTarget: string;
520
+ /** ツールチップの背景色 */
521
+ tooltipBg: string;
522
+ /** ツールチップのテキスト色 */
523
+ tooltipText: string;
524
+ /** ドラッグオーバーレイの背景色 */
525
+ dragOverlayBg: string;
526
+ /** ドラッグオーバーレイのテキスト色 */
527
+ dragOverlayText: string;
528
+ /** ドラッグオーバーレイのサブテキスト色 */
529
+ dragOverlaySubText: string;
530
+ /** ドラッグオーバーレイの区切り線色 */
531
+ dragOverlayDivider: string;
532
+ /** 依存関係線の色 */
533
+ dependencyLine: string;
534
+ /** カレンダー領域の背景色 */
535
+ calendarBg: string;
536
+ /** 土曜日の背景色 */
537
+ saturday: string;
538
+ /** 日曜日の背景色 */
539
+ sunday: string;
540
+ /** 祝日の背景色 */
541
+ holiday: string;
542
+ /** 行ヘッダーの背景色 */
543
+ rowHeaderBg: string;
544
+ /** 選択された行の背景色 */
545
+ rowSelected: string;
546
+ /** 選択された行のヘッダーの背景色 */
547
+ rowSelectedHeader: string;
548
+ /** 非表示設定されている行の背景色 */
549
+ rowHiddenBg: string;
550
+ /** 現在時刻線の色 */
551
+ currentTimeLine: string;
552
+ /** 現在時刻線のバッジテキスト色 */
553
+ currentTimeLineText: string;
554
+ /** 月曜日の背景色 (オプション) */
555
+ monday?: string;
556
+ /** 火曜日の背景色 (オプション) */
557
+ tuesday?: string;
558
+ /** 水曜日の背景色 (オプション) */
559
+ wednesday?: string;
560
+ /** 木曜日の背景色 (オプション) */
561
+ thursday?: string;
562
+ /** 金曜日の背景色 (オプション) */
563
+ friday?: string;
564
+ }
565
+ /**
566
+ * テーマセット (light/dark)
567
+ */
568
+ export interface ThemeColors {
569
+ light: ThemeColorPalette;
570
+ dark: ThemeColorPalette;
571
+ }
572
+ /**
573
+ * タスクの移動モード
574
+ */
575
+ export type GanttTaskMoveMode = 'copy' | 'move';
576
+ /**
577
+ * 依存関係の接続ポイント(バーのどちら側か)
578
+ */
579
+ export type DependencyEndpoint = 'start' | 'end';
580
+ /**
581
+ * 依存関係作成イベントの詳細データ
582
+ */
583
+ export interface DependencyCreateEventDetail {
584
+ /** 接続元のタスクID */
585
+ sourceTaskId: string;
586
+ /** 接続元のエンドポイント(start=左端, end=右端) */
587
+ sourceEndpoint: DependencyEndpoint;
588
+ /** 接続先のタスクID */
589
+ targetTaskId: string;
590
+ /** 接続先のエンドポイント(start=左端, end=右端) */
591
+ targetEndpoint: DependencyEndpoint;
592
+ }
593
+ /**
594
+ * 依存関係線クリックイベントの詳細データ
595
+ */
596
+ export interface DependencyClickEventDetail {
597
+ /** 接続元のタスクID */
598
+ sourceTaskId: string;
599
+ /** 接続先のタスクID */
600
+ targetTaskId: string;
601
+ /** 元のマウスイベント */
602
+ event: MouseEvent;
603
+ }
604
+ /**
605
+ * タスク削除イベントの詳細データ
606
+ */
607
+ export interface TaskDeleteEventDetail {
608
+ /** 削除対象のタスクID配列 */
609
+ taskIds: string[];
610
+ /** 元のキーボードイベント */
611
+ event: KeyboardEvent;
612
+ }
@@ -0,0 +1,57 @@
1
+ import type { GanttTask, TaskWithLane, ThemeColorPalette } from './types';
2
+ import type { MoguchartLocale } from './i18n';
3
+ /**
4
+ * 指定された日付のチャート上のX座標(ピクセル)を計算します。
5
+ * @param date 対象の日付
6
+ * @param startDate チャートの開始日
7
+ * @param pxPerDay 1日あたりのピクセル幅
8
+ * @returns 開始日からのピクセル距離
9
+ */
10
+ export declare const dateToX: (date: Date, startDate: Date, pxPerDay: number, pxPerMonth?: number) => number;
11
+ /**
12
+ * チャート上のX座標から日付を計算します。
13
+ * @param x チャートのX座標(ピクセル)
14
+ * @param startDate チャートの開始日
15
+ * @param pxPerDay 1日あたりのピクセル幅
16
+ * @param pxPerMonth 月あたりのピクセル幅(指定された場合、月単位の等幅表示になる)
17
+ * @returns 座標に対応する日付
18
+ */
19
+ export declare const xToDate: (x: number, startDate: Date, pxPerDay: number, pxPerMonth?: number) => Date;
20
+ /**
21
+ * タスクの重なりを計算し、各タスクが表示されるべき「レーン(段)」を決定します。
22
+ * @param tasks 同じ行にあるタスクの配列
23
+ * @returns レーン番号が追加されたタスクの配列と、その行で必要なレーンの総数
24
+ */
25
+ export declare function calculateTaskLanes(tasks: GanttTask[]): {
26
+ tasksWithLanes: TaskWithLane[];
27
+ laneCount: number;
28
+ };
29
+ /**
30
+ * 現在のテーマ設定とカスタムテーマをマージして、最終的なカラーパレットを生成します。
31
+ * @param theme ベースとなるテーマ名 ('light' | 'dark')
32
+ * @param customTheme 上書きするカスタムカラー設定
33
+ * @returns マージされたカラーパレット
34
+ */
35
+ export declare const getThemeColors: (theme: "light" | "dark", customTheme?: Partial<ThemeColorPalette>) => ThemeColorPalette;
36
+ /**
37
+ * 指定された日付に対応する背景色(休日、土日など)を取得します。
38
+ * @param date 対象の日付
39
+ * @param colors カラーパレット
40
+ * @param isHoliday 祝日判定関数 (オプション)。指定がない場合は祝日判定を行いません。
41
+ * @returns 背景色のCSSカラー文字列。平日の場合は空文字を返すことがあります。
42
+ */
43
+ export declare const getCalendarColor: (date: Date, colors: ThemeColorPalette, isHoliday?: (date: Date) => boolean) => string;
44
+ /**
45
+ * 開始日と終了日から日数を計算します。
46
+ * @param start 開始日
47
+ * @param end 終了日
48
+ * @returns 日数
49
+ */
50
+ export declare function getTotalDays(start: Date, end: Date): number;
51
+ /**
52
+ * 期間を「◯日◯時間◯分」の形式でフォーマットします。
53
+ * @param start 開始日
54
+ * @param end 終了日
55
+ * @param locale ロケール設定 (デフォルト: 日本語)
56
+ */
57
+ export declare const formatDuration: (start: Date, end: Date, locale?: MoguchartLocale) => string;
Binary file
@@ -0,0 +1,7 @@
1
+ export * from './components/gantt-bar';
2
+ export * from './components/gantt-calendar';
3
+ export * from './components/gantt-chart';
4
+ export * from './components/gantt-row';
5
+ export * from './core/types';
6
+ export * from './core/patterns';
7
+ export * from './core/i18n';