@mogura/moguchart-core 1.0.0 → 1.1.0
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.
- package/dist/components/gantt-chart.d.ts +21 -5
- package/dist/components/gantt-row.d.ts +2 -0
- package/dist/core/plugin.d.ts +60 -0
- package/dist/core/types.d.ts +16 -0
- package/dist/index.d.ts +2 -1
- package/dist/moguchart-core.mjs +196 -229
- package/dist/moguchart-core.umd.js +34 -25
- package/package.json +4 -6
- package/CHANGELOG.ja.md +0 -311
- package/CHANGELOG.md +0 -345
- package/README.ja.md +0 -812
- package/README.md +0 -854
- package/dist/components/gantt-chart-export.d.ts +0 -21
|
@@ -3,7 +3,8 @@ import { LitElement, type PropertyValues } from 'lit';
|
|
|
3
3
|
import './gantt-calendar';
|
|
4
4
|
import './gantt-row';
|
|
5
5
|
import './gantt-minimap';
|
|
6
|
-
import { type
|
|
6
|
+
import { PluginManager, type GanttPlugin } from '../core/plugin';
|
|
7
|
+
import type { ExportImageOptions } from '../core/types';
|
|
7
8
|
export declare class GanttChartElement extends LitElement {
|
|
8
9
|
rows: GanttRow[];
|
|
9
10
|
option: GanttChartOption;
|
|
@@ -39,6 +40,7 @@ export declare class GanttChartElement extends LitElement {
|
|
|
39
40
|
private cursorLineX;
|
|
40
41
|
private connectorDrag;
|
|
41
42
|
private _systemThemeMediaQuery;
|
|
43
|
+
private _pluginManager;
|
|
42
44
|
private isExporting;
|
|
43
45
|
private focusedTaskId;
|
|
44
46
|
private focusedRowId;
|
|
@@ -143,12 +145,26 @@ export declare class GanttChartElement extends LitElement {
|
|
|
143
145
|
bottom: number;
|
|
144
146
|
}[];
|
|
145
147
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
+
* プラグインを登録してインストールする。
|
|
149
|
+
* @param plugin 登録するプラグイン
|
|
150
|
+
* @param config プラグインの設定オプション(任意)
|
|
151
|
+
*/
|
|
152
|
+
use<TConfig = any>(plugin: GanttPlugin<TConfig>, config?: TConfig): this;
|
|
153
|
+
/**
|
|
154
|
+
* 内部のプラグインマネージャーを取得する。
|
|
155
|
+
*/
|
|
156
|
+
get pluginManager(): PluginManager;
|
|
157
|
+
/**
|
|
158
|
+
* ガントチャートを画像またはPDFとしてエクスポートする。
|
|
159
|
+
* ※ エクスポート機能を使用するには、`@mogura/moguchart-plugin-export` プラグインの登録が必要です。
|
|
160
|
+
* 例:
|
|
161
|
+
* import { exportPlugin } from '@mogura/moguchart-plugin-export'
|
|
162
|
+
* chart.use(exportPlugin())
|
|
148
163
|
*
|
|
149
|
-
* @param
|
|
164
|
+
* @param format 'png' または 'pdf'
|
|
165
|
+
* @param options エクスポートオプション
|
|
150
166
|
*/
|
|
151
|
-
exportImage(
|
|
167
|
+
exportImage(_format?: 'png' | 'pdf', _options?: ExportImageOptions): Promise<string | Blob>;
|
|
152
168
|
/**
|
|
153
169
|
* Ctrl/Cmd + マウスホイールによるズーム処理
|
|
154
170
|
*/
|
|
@@ -70,6 +70,8 @@ export declare class GanttRowElement extends LitElement {
|
|
|
70
70
|
private _rowHeaderTooltipTimer;
|
|
71
71
|
private handleHeaderMouseEnter;
|
|
72
72
|
private handleHeaderMouseLeave;
|
|
73
|
+
private handleToggleMouseEnter;
|
|
74
|
+
private handleToggleMouseLeave;
|
|
73
75
|
private handleToggleCollapse;
|
|
74
76
|
private handleToggleDblClick;
|
|
75
77
|
protected updated(changedProperties: PropertyValues): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { GanttChartElement } from '../components/gantt-chart';
|
|
2
|
+
import type { TaskUpdateEventDetail } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* ガントチャート拡張プラグインの共通インターフェース
|
|
5
|
+
*/
|
|
6
|
+
export interface GanttPlugin<TConfig = any, TChart = any> {
|
|
7
|
+
/** プラグインの一意な識別名 (例: 'export', 'auto-schedule') */
|
|
8
|
+
name: string;
|
|
9
|
+
/** プラグインのバージョン (任意) */
|
|
10
|
+
version?: string;
|
|
11
|
+
/** チャートインスタンス初期化時またはuse()呼び出し時のインストール処理 */
|
|
12
|
+
install?: (chart: TChart, config?: TConfig) => void;
|
|
13
|
+
/** チャート破棄時(disconnectedCallback)のクリーンアップ処理 */
|
|
14
|
+
destroy?: (chart: TChart) => void;
|
|
15
|
+
/** ライフサイクルフック */
|
|
16
|
+
hooks?: {
|
|
17
|
+
/** タスク更新直前のフック(false を返すと更新処理をキャンセル) */
|
|
18
|
+
beforeTaskUpdate?: (detail: TaskUpdateEventDetail) => boolean | void | Promise<boolean | void>;
|
|
19
|
+
/** タスク更新直後のフック */
|
|
20
|
+
afterTaskUpdate?: (detail: TaskUpdateEventDetail) => void;
|
|
21
|
+
/** レンダリング後のフック */
|
|
22
|
+
afterRender?: (chart: TChart) => void;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* プラグイン管理マネージャークラス
|
|
27
|
+
*/
|
|
28
|
+
export declare class PluginManager {
|
|
29
|
+
private plugins;
|
|
30
|
+
private chart;
|
|
31
|
+
constructor(chart: GanttChartElement);
|
|
32
|
+
/**
|
|
33
|
+
* プラグインを登録・インストールする
|
|
34
|
+
*/
|
|
35
|
+
use<TConfig = any>(plugin: GanttPlugin<TConfig>, config?: TConfig): void;
|
|
36
|
+
/**
|
|
37
|
+
* 登録済みプラグインの一覧を取得する
|
|
38
|
+
*/
|
|
39
|
+
getPlugin(name: string): GanttPlugin | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* プラグインが登録されているかどうかを確認する
|
|
42
|
+
*/
|
|
43
|
+
hasPlugin(name: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* beforeTaskUpdate フックを一括実行する
|
|
46
|
+
*/
|
|
47
|
+
executeBeforeTaskUpdate(detail: TaskUpdateEventDetail): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* afterTaskUpdate フックを一括実行する
|
|
50
|
+
*/
|
|
51
|
+
executeAfterTaskUpdate(detail: TaskUpdateEventDetail): void;
|
|
52
|
+
/**
|
|
53
|
+
* afterRender フックを一括実行する
|
|
54
|
+
*/
|
|
55
|
+
executeAfterRender(): void;
|
|
56
|
+
/**
|
|
57
|
+
* 全プラグインを破棄・クリーンアップする
|
|
58
|
+
*/
|
|
59
|
+
destroy(): void;
|
|
60
|
+
}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MoguchartLocale } from './i18n';
|
|
2
|
+
import type { GanttPlugin } from './plugin';
|
|
2
3
|
/**
|
|
3
4
|
* ガントチャートのバーに適用できるパターンの種類
|
|
4
5
|
*/
|
|
@@ -415,6 +416,8 @@ export interface GanttChartOption {
|
|
|
415
416
|
selection?: GanttChartOptionSelection;
|
|
416
417
|
/** WBS・階層ツリーに関する設定 */
|
|
417
418
|
tree?: GanttChartOptionTree;
|
|
419
|
+
/** 拡張プラグインの配列 */
|
|
420
|
+
plugins?: GanttPlugin[];
|
|
418
421
|
}
|
|
419
422
|
/**
|
|
420
423
|
* WBS・階層ツリーに関するオプション
|
|
@@ -873,3 +876,16 @@ export interface TaskProgressChangeEventDetail {
|
|
|
873
876
|
/** キャンセルされたかどうか */
|
|
874
877
|
cancelled?: boolean;
|
|
875
878
|
}
|
|
879
|
+
/**
|
|
880
|
+
* 画像・PDFエクスポートのオプション
|
|
881
|
+
*/
|
|
882
|
+
export interface ExportImageOptions {
|
|
883
|
+
/** ダウンロード時のファイル名(拡張子なし)。省略時は 'gantt-chart' */
|
|
884
|
+
filename?: string;
|
|
885
|
+
/** true の場合、自動的にファイルダウンロードを開始する。デフォルト: false */
|
|
886
|
+
download?: boolean;
|
|
887
|
+
/** PNG 出力時のスケール倍率(高解像度化)。デフォルト: 2 */
|
|
888
|
+
scale?: number;
|
|
889
|
+
/** 画像を指定したピクセル数で縦に分割し、分割位置にカレンダー(ヘッダー)を挿入する。未指定時は分割しない */
|
|
890
|
+
splitHeight?: number;
|
|
891
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './components/gantt-minimap';
|
|
|
6
6
|
export * from './core/types';
|
|
7
7
|
export * from './core/patterns';
|
|
8
8
|
export * from './core/i18n';
|
|
9
|
-
export
|
|
9
|
+
export * from './core/plugin';
|
|
10
|
+
export { clampProgress, calculateRowProgress, calculateWeightedRowProgress, calculateProjectProgress, getThemeColors, } from './core/utils';
|
|
10
11
|
export { computeCriticalPath } from './core/critical-path';
|
|
11
12
|
export { computeRowLevels, computeRowWbsCodes, computeChildRowIds, computeVisibleTreeRows, computeSummaryTask, canDropRow, } from './core/wbs';
|