@mogura/moguchart-plugin-excel 1.3.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/LICENSE +21 -0
- package/README.ja.md +126 -0
- package/README.md +121 -0
- package/dist/export.d.ts +10 -0
- package/dist/i18n.d.ts +94 -0
- package/dist/index.d.ts +24 -0
- package/dist/moguchart-plugin-excel.mjs +32993 -0
- package/dist/moguchart-plugin-excel.umd.js +28 -0
- package/dist/types.d.ts +110 -0
- package/dist/utils.d.ts +124 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-present Murakami Hiroyuki
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# @mogura/moguchart-plugin-excel
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
ガントチャートライブラリ `@mogura/moguchart-core` 用の Excel (.xlsx) エクスポートプラグインです。
|
|
6
|
+
ExcelJS を使用し、カレンダー日付列にタスク期間が色塗りされた「Excel製ガントチャート(工程表・タイムライン)」を高画質・スタイリング付きで出力します。
|
|
7
|
+
|
|
8
|
+
## 特徴
|
|
9
|
+
|
|
10
|
+
- 📊 **Excelタイムライン(工程表)出力**: 左側にタスク属性(WBS、タスク名、担当者、期間、進捗率等)、右側にカレンダー列を配置し、タスクの開始日〜終了日に対応するセルを美しく着色(サマリータスク、土日・祝日の背景色分け、進捗率パーセント表示対応)。
|
|
11
|
+
- 🌐 **多言語対応 & カスタムロケール**: 日本語(`ja`)、英語(`en`)、中国語簡体字(`zh`)を標準サポート。独自の言語定義(`registerExcelLocale`)も追加可能。
|
|
12
|
+
- 🌳 **WBS階層構造の保持**: 親行・子行の階層関係(WBSコード `1`, `1.1`, `1.2` 等)を維持し、インデントや太字を反映。
|
|
13
|
+
- 🎨 **カラーカスタマイズ**: テーマカラーやタスクごとのカスタムバー色(`progressColor`)がExcel上にも反映。
|
|
14
|
+
- ⏱ **多彩なタイムラインスケール**: 時間(hour)・日(day)・週(week)・月(month)スケール、および半日や30分などの列分割に対応。
|
|
15
|
+
- ⚡ **クライアント完結**: ブラウザ上で直接 `.xlsx` ファイルを生成・自動ダウンロード可能。
|
|
16
|
+
|
|
17
|
+
## インストール
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @mogura/moguchart-plugin-excel
|
|
21
|
+
# または
|
|
22
|
+
npm install @mogura/moguchart-plugin-excel
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 使い方
|
|
26
|
+
|
|
27
|
+
### 1. プラグインとして登録して使う(推奨)
|
|
28
|
+
|
|
29
|
+
チャートインスタンスにプラグインを登録すると、`chart.exportExcel()` メソッドが有効化されます。
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import '@mogura/moguchart-core'
|
|
33
|
+
import { excelPlugin } from '@mogura/moguchart-plugin-excel'
|
|
34
|
+
|
|
35
|
+
const chart = document.querySelector('gantt-chart')
|
|
36
|
+
|
|
37
|
+
// プラグインの登録
|
|
38
|
+
chart.use(excelPlugin({
|
|
39
|
+
defaultFilename: 'プロジェクト工程表.xlsx',
|
|
40
|
+
defaultSheetName: '工程表',
|
|
41
|
+
themeColor: '#3B82F6'
|
|
42
|
+
}))
|
|
43
|
+
|
|
44
|
+
// Excelエクスポート(タイムライン付き工程表)
|
|
45
|
+
await chart.exportExcel()
|
|
46
|
+
|
|
47
|
+
// 英語でエクスポート
|
|
48
|
+
await chart.exportExcel({
|
|
49
|
+
locale: 'en',
|
|
50
|
+
filename: 'project-schedule.xlsx'
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 2. スタンドアロン関数として呼ぶ(必要な時だけ遅延インポート)
|
|
55
|
+
|
|
56
|
+
エクスポートボタンがクリックされた時だけ動的インポート(Dynamic Import)することで、初期バンドルサイズを最小限に抑えられます。
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
async function handleExportExcel(chartElement) {
|
|
60
|
+
const { exportExcel } = await import('@mogura/moguchart-plugin-excel')
|
|
61
|
+
await exportExcel(chartElement, {
|
|
62
|
+
filename: '工程表.xlsx',
|
|
63
|
+
locale: 'ja',
|
|
64
|
+
download: true
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. カスタム言語・ロケールの追加
|
|
70
|
+
|
|
71
|
+
独自の言語定義を追加したい場合、`registerExcelLocale` を使用して新しいロケールを登録できます。
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { registerExcelLocale, exportExcel } from '@mogura/moguchart-plugin-excel'
|
|
75
|
+
|
|
76
|
+
registerExcelLocale('fr', {
|
|
77
|
+
code: 'fr',
|
|
78
|
+
sheetName: 'Planning',
|
|
79
|
+
defaultFilename: 'planning-gantt.xlsx',
|
|
80
|
+
columns: {
|
|
81
|
+
wbs: 'WBS',
|
|
82
|
+
name: 'Nom de tâche',
|
|
83
|
+
assignee: 'Responsable',
|
|
84
|
+
startDate: 'Date de début',
|
|
85
|
+
endDate: 'Date de fin',
|
|
86
|
+
duration: 'Durée',
|
|
87
|
+
progress: 'Progression',
|
|
88
|
+
},
|
|
89
|
+
dateFormat: 'DD/MM/YYYY',
|
|
90
|
+
timeFormat: 'HH:mm',
|
|
91
|
+
monthYearFormat: (year, month) => `${month}/${year}`,
|
|
92
|
+
weekFormat: (year, week) => `Sem ${week}, ${year}`,
|
|
93
|
+
dayHeaderFormat: (date) => `${date.getDate()}`,
|
|
94
|
+
hourHeaderFormat: (hour) => `${hour}h`,
|
|
95
|
+
dayNames: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
|
|
96
|
+
durationUnit: ' j',
|
|
97
|
+
summaryLabel: ' (Récapitulatif)',
|
|
98
|
+
percentLabel: '%',
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
await chart.exportExcel({ locale: 'fr' })
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## オプション (`ExportExcelOptions`)
|
|
105
|
+
|
|
106
|
+
| オプション | 型 | デフォルト値 | 説明 |
|
|
107
|
+
| :--- | :--- | :--- | :--- |
|
|
108
|
+
| `locale` | `'ja' \| 'en' \| 'zh' \| string \| ExcelLocaleDefinition` | 自動判定 / `'ja'` | 言語・ロケール指定(日本語、英語、中国語、または登録済み独自言語定義) |
|
|
109
|
+
| `filename` | `string` | `'gantt-chart.xlsx'` | 出力ファイル名 |
|
|
110
|
+
| `sheetName` | `string` | `'工程表'` | 出力シート名 |
|
|
111
|
+
| `timelineScale` | `'hour' \| 'day' \| 'week' \| 'month'` | 自動判定 (`'day'`) | タイムライン列の刻み単位(時間・日・週・月) |
|
|
112
|
+
| `columnsPerUnit` | `number` | `1` | 1日または1時間あたりの列数・分割数(例: 2で半日単位や30分刻み) |
|
|
113
|
+
| `snapDurationMinutes` | `number` | 自動判定 / `1440` or `60` | スナップ単位(分)。日単位(1440, 720, 360, 180等)や時間単位(60, 30, 15等)から分割列数を自動計算 |
|
|
114
|
+
| `timelineColumnWidth` | `number` | 自動算出 | タイムライン列の幅(文字数単位。指定なし時は画面のpx幅または既定値から自動計算) |
|
|
115
|
+
| `dateFormat` | `string` | `'YYYY/MM/DD'` | 日付の表示形式 |
|
|
116
|
+
| `includeWeekends` | `boolean` | `true` | タイムラインに土日を含めるか(日単位出力時: 土曜は淡いブルー、日曜・祝祭日は淡い赤/ピンク背景) |
|
|
117
|
+
| `highlightToday` | `boolean` | `true` | 今日の日付列をハイライト表示するか |
|
|
118
|
+
| `themeColor` | `string` | `'#3B82F6'` | ヘッダー行やアクセントのテーマカラー(HEX) |
|
|
119
|
+
| `isHoliday` | `(date: Date) => boolean` | 自動判定 | 祝祭日判定関数(指定なし時は `chart.option.calendar.isHoliday` を自動参照) |
|
|
120
|
+
| `holidayColor` | `string` | `'#FEE2E2'` | 祝祭日および日曜日の背景色(日単位出力時のみ適用、淡い赤/ピンク) |
|
|
121
|
+
| `columns` | `ExcelExportColumn[]` | 標準カラム | 出力するテーブル列のカスタム定義配列 |
|
|
122
|
+
| `download` | `boolean` | `true` | ブラウザで自動ダウンロードをトリガーするか |
|
|
123
|
+
|
|
124
|
+
## ライセンス
|
|
125
|
+
|
|
126
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# @mogura/moguchart-plugin-excel
|
|
2
|
+
|
|
3
|
+
[日本語](./README.ja.md)
|
|
4
|
+
|
|
5
|
+
Excel (.xlsx) export plugin for `@mogura/moguchart-core`.
|
|
6
|
+
Using ExcelJS, it generates beautifully styled Excel files with an interactive timeline (cell-shaded Gantt chart / schedule) completely in the browser.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 📊 **Excel Timeline (Visual Gantt)**: Task attributes on the left (WBS, Task Name, Assignee, Dates, Progress) and calendar date columns on the right with colored task duration cells (summary tasks, weekend & holiday shading, progress labels).
|
|
11
|
+
- 🌐 **Multi-Language Support & Custom Locales**: Built-in support for Japanese (`ja`), English (`en`), and Simplified Chinese (`zh`). Easily register custom language packs with `registerExcelLocale`.
|
|
12
|
+
- 🌳 **WBS Hierarchy**: Retains parent-child hierarchy with WBS codes (`1`, `1.1`), indentations, and bold styling.
|
|
13
|
+
- 🎨 **Color Customization**: Reflects theme colors and task-specific colors (`progressColor`) in Excel.
|
|
14
|
+
- ⏱ **Multi-Scale Timelines**: Supports hour, day, week, and month scales, including sub-day and sub-hour column divisions.
|
|
15
|
+
- ⚡ **Client-side Generation**: Generates and downloads `.xlsx` files directly in the browser.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @mogura/moguchart-plugin-excel
|
|
21
|
+
# or
|
|
22
|
+
npm install @mogura/moguchart-plugin-excel
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### 1. Register as a Plugin (Recommended)
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import '@mogura/moguchart-core'
|
|
31
|
+
import { excelPlugin } from '@mogura/moguchart-plugin-excel'
|
|
32
|
+
|
|
33
|
+
const chart = document.querySelector('gantt-chart')
|
|
34
|
+
|
|
35
|
+
chart.use(excelPlugin({
|
|
36
|
+
defaultFilename: 'project-schedule.xlsx',
|
|
37
|
+
defaultSheetName: 'Schedule',
|
|
38
|
+
themeColor: '#3B82F6'
|
|
39
|
+
}))
|
|
40
|
+
|
|
41
|
+
// Export with timeline
|
|
42
|
+
await chart.exportExcel()
|
|
43
|
+
|
|
44
|
+
// Export in English
|
|
45
|
+
await chart.exportExcel({
|
|
46
|
+
locale: 'en',
|
|
47
|
+
filename: 'project-schedule.xlsx'
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Standalone Function (Dynamic Import)
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
async function handleExportExcel(chartElement) {
|
|
55
|
+
const { exportExcel } = await import('@mogura/moguchart-plugin-excel')
|
|
56
|
+
await exportExcel(chartElement, {
|
|
57
|
+
filename: 'schedule.xlsx',
|
|
58
|
+
locale: 'en',
|
|
59
|
+
download: true
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 3. Adding Custom Locales
|
|
65
|
+
|
|
66
|
+
To register and use additional languages:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { registerExcelLocale, exportExcel } from '@mogura/moguchart-plugin-excel'
|
|
70
|
+
|
|
71
|
+
registerExcelLocale('fr', {
|
|
72
|
+
code: 'fr',
|
|
73
|
+
sheetName: 'Planning',
|
|
74
|
+
defaultFilename: 'planning-gantt.xlsx',
|
|
75
|
+
columns: {
|
|
76
|
+
wbs: 'WBS',
|
|
77
|
+
name: 'Nom de tâche',
|
|
78
|
+
assignee: 'Responsable',
|
|
79
|
+
startDate: 'Date de début',
|
|
80
|
+
endDate: 'Date de fin',
|
|
81
|
+
duration: 'Durée',
|
|
82
|
+
progress: 'Progression',
|
|
83
|
+
},
|
|
84
|
+
dateFormat: 'DD/MM/YYYY',
|
|
85
|
+
timeFormat: 'HH:mm',
|
|
86
|
+
monthYearFormat: (year, month) => `${month}/${year}`,
|
|
87
|
+
weekFormat: (year, week) => `Sem ${week}, ${year}`,
|
|
88
|
+
dayHeaderFormat: (date) => `${date.getDate()}`,
|
|
89
|
+
hourHeaderFormat: (hour) => `${hour}h`,
|
|
90
|
+
dayNames: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
|
|
91
|
+
durationUnit: ' d',
|
|
92
|
+
summaryLabel: ' (Summary)',
|
|
93
|
+
percentLabel: '%',
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
await chart.exportExcel({ locale: 'fr' })
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Options (`ExportExcelOptions`)
|
|
100
|
+
|
|
101
|
+
| Option | Type | Default | Description |
|
|
102
|
+
| :--- | :--- | :--- | :--- |
|
|
103
|
+
| `locale` | `'ja' \| 'en' \| 'zh' \| string \| ExcelLocaleDefinition` | Auto-detect / `'ja'` | Language & locale definition |
|
|
104
|
+
| `filename` | `string` | `'gantt-chart.xlsx'` | Output filename |
|
|
105
|
+
| `sheetName` | `string` | `'工程表'` | Output worksheet name |
|
|
106
|
+
| `timelineScale` | `'hour' \| 'day' \| 'week' \| 'month'` | Auto-detect (`'day'`) | Timeline column unit (hour, day, week, month) |
|
|
107
|
+
| `columnsPerUnit` | `number` | `1` | Number of columns per day or hour (e.g. 2 for half-day / 30-min slots) |
|
|
108
|
+
| `snapDurationMinutes` | `number` | Auto-detect / `1440` or `60` | Snap duration in minutes to auto-calculate columns per day/hour (e.g. 720 -> 2 cols/day) |
|
|
109
|
+
| `timelineColumnWidth` | `number` | Auto-computed | Timeline column width (in chars, auto-derived from screen px or defaults) |
|
|
110
|
+
| `dateFormat` | `string` | `'YYYY/MM/DD'` | Date format |
|
|
111
|
+
| `includeWeekends` | `boolean` | `true` | Include weekends in timeline (day scale only: Saturdays in light blue, Sundays & holidays in light red/pink) |
|
|
112
|
+
| `highlightToday` | `boolean` | `true` | Highlight today's date column |
|
|
113
|
+
| `themeColor` | `string` | `'#3B82F6'` | Theme color for header & bars |
|
|
114
|
+
| `isHoliday` | `(date: Date) => boolean` | Auto-detect | Holiday judgment function (auto-detected from `chart.option.calendar.isHoliday`) |
|
|
115
|
+
| `holidayColor` | `string` | `'#FEE2E2'` | Background color for holiday and Sunday columns (applies to day scale only) |
|
|
116
|
+
| `columns` | `ExcelExportColumn[]` | Standard cols | Custom column definitions |
|
|
117
|
+
| `download` | `boolean` | `true` | Auto-trigger file download |
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|
package/dist/export.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GanttChartElement } from '@mogura/moguchart-core';
|
|
2
|
+
import type { ExportExcelOptions, ExcelExportColumn, ExcelTimelineScale, ExcelLocale } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* デフォルトの標準カラム定義(多言語・カスタムロケール対応)
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDefaultColumns(scale?: ExcelTimelineScale, locale?: ExcelLocale): ExcelExportColumn[];
|
|
7
|
+
/**
|
|
8
|
+
* ガントチャートデータをExcel (.xlsx) 形式でエクスポートするメイン関数
|
|
9
|
+
*/
|
|
10
|
+
export declare function exportGanttToExcel(chart: GanttChartElement, options?: ExportExcelOptions): Promise<Blob>;
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { GanttChartElement } from '@mogura/moguchart-core';
|
|
2
|
+
/**
|
|
3
|
+
* Excelエクスポートのロケール定義インターフェース
|
|
4
|
+
*/
|
|
5
|
+
export interface ExcelLocaleDefinition {
|
|
6
|
+
/** ロケール識別名 (例: 'ja', 'en', 'zh', 'ko', 'de' 等) */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** シート名定義 */
|
|
9
|
+
sheets?: {
|
|
10
|
+
/** デフォルトのガントチャートシート名 (例: '工程表', 'Gantt Chart') */
|
|
11
|
+
gantt?: string;
|
|
12
|
+
};
|
|
13
|
+
/** 標準カラムヘッダーおよび数値・日付フォーマット */
|
|
14
|
+
columns?: {
|
|
15
|
+
taskNo?: string;
|
|
16
|
+
wbs?: string;
|
|
17
|
+
rowName?: string;
|
|
18
|
+
taskName?: string;
|
|
19
|
+
start?: {
|
|
20
|
+
day?: string;
|
|
21
|
+
month?: string;
|
|
22
|
+
hour?: string;
|
|
23
|
+
};
|
|
24
|
+
end?: {
|
|
25
|
+
day?: string;
|
|
26
|
+
month?: string;
|
|
27
|
+
hour?: string;
|
|
28
|
+
};
|
|
29
|
+
duration?: {
|
|
30
|
+
header?: string;
|
|
31
|
+
dayNumFmt?: string;
|
|
32
|
+
hourNumFmt?: string;
|
|
33
|
+
};
|
|
34
|
+
progress?: string;
|
|
35
|
+
dependencies?: string;
|
|
36
|
+
dateFormat?: {
|
|
37
|
+
day?: string;
|
|
38
|
+
month?: string;
|
|
39
|
+
hour?: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/** タイムライン(カレンダー)ヘッダーの表示設定 */
|
|
43
|
+
timeline?: {
|
|
44
|
+
/** 曜日表記配列 (0:日曜, 1:月曜, ..., 6:土曜) */
|
|
45
|
+
dayNames?: string[];
|
|
46
|
+
/** 月名表記配列 (0:1月, ..., 11:12月) */
|
|
47
|
+
monthNames?: string[];
|
|
48
|
+
/** 年グループヘッダー (scale === 'month') */
|
|
49
|
+
yearFormat?: (year: number) => string;
|
|
50
|
+
/** 年月グループヘッダー (scale === 'day' | 'week') */
|
|
51
|
+
yearMonthFormat?: (year: number, month: number, monthName: string) => string;
|
|
52
|
+
/** 年月日(+曜日)グループヘッダー (scale === 'hour' や multi-column day) */
|
|
53
|
+
yearMonthDayFormat?: (year: number, month: number, day: number, dayName: string, monthName: string) => string;
|
|
54
|
+
/** 週サブラベル (scale === 'week') */
|
|
55
|
+
weekSubLabel?: (month: number, day: number, weekNumber: number, monthName: string) => string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 日本語ロケール (デフォルト)
|
|
60
|
+
*/
|
|
61
|
+
export declare const jaLocale: ExcelLocaleDefinition;
|
|
62
|
+
/**
|
|
63
|
+
* 英語ロケール
|
|
64
|
+
*/
|
|
65
|
+
export declare const enLocale: ExcelLocaleDefinition;
|
|
66
|
+
/**
|
|
67
|
+
* 中国語(簡体字)ロケール
|
|
68
|
+
*/
|
|
69
|
+
export declare const zhLocale: ExcelLocaleDefinition;
|
|
70
|
+
/**
|
|
71
|
+
* 独自のExcelロケールを登録する
|
|
72
|
+
*
|
|
73
|
+
* @param name ロケール識別名 (例: 'zh', 'ko', 'fr', 'de' 等)
|
|
74
|
+
* @param definition ロケール定義
|
|
75
|
+
*/
|
|
76
|
+
export declare function registerExcelLocale(name: string, definition: ExcelLocaleDefinition): void;
|
|
77
|
+
/**
|
|
78
|
+
* 登録されているExcelロケール定義を取得する
|
|
79
|
+
*
|
|
80
|
+
* @param name ロケール識別名
|
|
81
|
+
*/
|
|
82
|
+
export declare function getExcelLocale(name: string): ExcelLocaleDefinition | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* 登録されているすべてのロケール識別名を取得する
|
|
85
|
+
*/
|
|
86
|
+
export declare function getSupportedExcelLocales(): string[];
|
|
87
|
+
/**
|
|
88
|
+
* 2つのロケール定義をディープマージする
|
|
89
|
+
*/
|
|
90
|
+
export declare function mergeLocaleDefinitions(base: ExcelLocaleDefinition, custom: ExcelLocaleDefinition): ExcelLocaleDefinition;
|
|
91
|
+
/**
|
|
92
|
+
* 指定されたパラメータから最終的なExcelLocaleDefinitionを解決する
|
|
93
|
+
*/
|
|
94
|
+
export declare function resolveExcelLocale(locale?: string | ExcelLocaleDefinition, chart?: GanttChartElement): ExcelLocaleDefinition;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GanttChartElement, GanttPlugin } from '@mogura/moguchart-core';
|
|
2
|
+
import { exportGanttToExcel, getDefaultColumns } from './export';
|
|
3
|
+
import type { ExcelPluginConfig, ExportExcelOptions, ExcelExportColumn, ExcelTimelineScale, ExcelLocale, ExcelLocaleDefinition } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* ガントチャートのExcel (.xlsx) エクスポートプラグイン
|
|
6
|
+
*/
|
|
7
|
+
export declare function excelPlugin(config?: ExcelPluginConfig): GanttPlugin<ExcelPluginConfig>;
|
|
8
|
+
/**
|
|
9
|
+
* クラス形式の ExcelPlugin
|
|
10
|
+
*/
|
|
11
|
+
export declare class ExcelPlugin implements GanttPlugin<ExcelPluginConfig> {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
config?: ExcelPluginConfig;
|
|
15
|
+
constructor(config?: ExcelPluginConfig);
|
|
16
|
+
install(chart: GanttChartElement, options?: ExcelPluginConfig): void | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* スタンドアロン実行関数
|
|
20
|
+
*/
|
|
21
|
+
export declare function exportExcel(chart: GanttChartElement, options?: ExportExcelOptions): Promise<Blob>;
|
|
22
|
+
export { exportGanttToExcel, getDefaultColumns };
|
|
23
|
+
export { registerExcelLocale, getExcelLocale, getSupportedExcelLocales, resolveExcelLocale, jaLocale, enLocale, zhLocale, } from './i18n';
|
|
24
|
+
export type { ExcelPluginConfig, ExportExcelOptions, ExcelExportColumn, ExcelTimelineScale, ExcelLocale, ExcelLocaleDefinition, };
|