vk-typescript-cli 1.0.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/Jenkinsfile +48 -0
- package/README.md +300 -0
- package/bin/sf.js +438 -0
- package/eslint.config.js +90 -0
- package/gulpfile.js +157 -0
- package/lib/commander.js +3370 -0
- package/lib/inquirer-prompts.js +2038 -0
- package/license +13 -0
- package/package.json +43 -0
- package/smoke-test.mjs +38 -0
- package/src/commands/add.js +276 -0
- package/src/commands/info.js +82 -0
- package/src/commands/interactive.js +493 -0
- package/src/commands/mcp.js +135 -0
- package/src/commands/new.js +264 -0
- package/src/commands/skills.js +42 -0
- package/src/commands/theme.js +200 -0
- package/src/commands/upgrade.js +219 -0
- package/src/constants.js +161 -0
- package/src/generators/angular.js +878 -0
- package/src/generators/nextjs.js +817 -0
- package/src/generators/react.js +769 -0
- package/src/generators/typescript.js +258 -0
- package/src/generators/vue.js +800 -0
- package/src/templates/angular/chart.component.html +23 -0
- package/src/templates/angular/chart.component.ts +172 -0
- package/src/templates/angular/diagram.component.html +13 -0
- package/src/templates/angular/diagram.component.ts +224 -0
- package/src/templates/angular/docx-editor.component.html +18 -0
- package/src/templates/angular/docx-editor.component.ts +37 -0
- package/src/templates/angular/filemanager.component.html +4 -0
- package/src/templates/angular/filemanager.component.ts +47 -0
- package/src/templates/angular/gantt.component.html +32 -0
- package/src/templates/angular/gantt.component.ts +95 -0
- package/src/templates/angular/grid.component.html +12 -0
- package/src/templates/angular/grid.component.ts +58 -0
- package/src/templates/angular/pdf-viewer.component.html +9 -0
- package/src/templates/angular/pdf-viewer.component.ts +48 -0
- package/src/templates/angular/rte.component.html +7 -0
- package/src/templates/angular/rte.component.ts +13 -0
- package/src/templates/angular/scheduler.component.html +17 -0
- package/src/templates/angular/scheduler.component.ts +75 -0
- package/src/templates/angular/spreadsheet-editor.component.html +42 -0
- package/src/templates/angular/spreadsheet-editor.component.ts +61 -0
- package/src/templates/chart-template.js +20 -0
- package/src/templates/diagram-template.js +26 -0
- package/src/templates/docx-template.js +20 -0
- package/src/templates/filemanager-template.js +20 -0
- package/src/templates/gantt-template.js +20 -0
- package/src/templates/grid-template.js +20 -0
- package/src/templates/pdfviewer-template.js +20 -0
- package/src/templates/react/Chart.jsx +81 -0
- package/src/templates/react/Chart.tsx +81 -0
- package/src/templates/react/DOCXEditor.jsx +37 -0
- package/src/templates/react/DOCXEditor.tsx +37 -0
- package/src/templates/react/Diagram.jsx +192 -0
- package/src/templates/react/Diagram.tsx +195 -0
- package/src/templates/react/FileManager.jsx +13 -0
- package/src/templates/react/FileManager.tsx +13 -0
- package/src/templates/react/Gantt.jsx +89 -0
- package/src/templates/react/Gantt.tsx +89 -0
- package/src/templates/react/Grid.jsx +45 -0
- package/src/templates/react/Grid.tsx +45 -0
- package/src/templates/react/PDFViewer.jsx +16 -0
- package/src/templates/react/PDFViewer.tsx +16 -0
- package/src/templates/react/RTE.jsx +14 -0
- package/src/templates/react/RTE.tsx +14 -0
- package/src/templates/react/Scheduler.jsx +55 -0
- package/src/templates/react/Scheduler.tsx +55 -0
- package/src/templates/react/SpreadsheetEditor.jsx +96 -0
- package/src/templates/react/SpreadsheetEditor.tsx +98 -0
- package/src/templates/rte-template.js +26 -0
- package/src/templates/scheduler-template.js +20 -0
- package/src/templates/spreadheet-template.js +20 -0
- package/src/templates/typescript/RTE.ts +33 -0
- package/src/templates/typescript/SpreadsheetEditor.ts +39 -0
- package/src/templates/typescript/chart.ts +37 -0
- package/src/templates/typescript/diagram.ts +30 -0
- package/src/templates/typescript/docxeditor.ts +30 -0
- package/src/templates/typescript/filemanager.ts +41 -0
- package/src/templates/typescript/gantt.ts +88 -0
- package/src/templates/typescript/grid.ts +30 -0
- package/src/templates/typescript/pdfviewer.ts +8 -0
- package/src/templates/typescript/scheduler.ts +39 -0
- package/src/templates/vue/Chart.vue +257 -0
- package/src/templates/vue/ChartView.vue +7 -0
- package/src/templates/vue/DOCXEditor.vue +61 -0
- package/src/templates/vue/DOCXEditorView.vue +7 -0
- package/src/templates/vue/Diagram.vue +245 -0
- package/src/templates/vue/DiagramView.vue +7 -0
- package/src/templates/vue/FileManager.vue +58 -0
- package/src/templates/vue/FileManagerView.vue +7 -0
- package/src/templates/vue/Gantt.vue +129 -0
- package/src/templates/vue/GanttView.vue +7 -0
- package/src/templates/vue/Grid.vue +141 -0
- package/src/templates/vue/GridView.vue +7 -0
- package/src/templates/vue/PDFViewer.vue +58 -0
- package/src/templates/vue/PDFViewerView.vue +7 -0
- package/src/templates/vue/RTE.vue +27 -0
- package/src/templates/vue/RTEView.vue +7 -0
- package/src/templates/vue/Scheduler.vue +94 -0
- package/src/templates/vue/SchedulerView.vue +7 -0
- package/src/templates/vue/SpreadsheetEditor.vue +115 -0
- package/src/templates/vue/SpreadsheetEditorView.vue +7 -0
- package/src/utils/ansi-colors.js +38 -0
- package/src/utils/banner.js +179 -0
- package/src/utils/common.js +64 -0
- package/src/utils/config-generator.js +73 -0
- package/src/utils/folder-structure.js +26 -0
- package/src/utils/logger.js +19 -0
- package/src/utils/mcp-generator.js +122 -0
- package/src/utils/package-manager.js +128 -0
- package/src/utils/project-bootstrap.js +98 -0
- package/src/utils/project-detector.js +195 -0
- package/src/utils/prompt-utils.js +29 -0
- package/src/utils/run-command.js +110 -0
- package/src/utils/skills-installer.js +69 -0
- package/src/utils/template-file.js +35 -0
- package/src/utils/theme-loader.js +47 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Spreadsheet, ColumnModel, RowModel, CellModel } from '@syncfusion/ej2-spreadsheet';
|
|
2
|
+
|
|
3
|
+
// Defines the data to be displayed in the Spreadsheet.
|
|
4
|
+
const data: object[] = [
|
|
5
|
+
{ Item: 'Apple', Qty: 10, Price: 1.50, Total: 15.00 },
|
|
6
|
+
{ Item: 'Banana', Qty: 20, Price: 0.75, Total: 15.00 },
|
|
7
|
+
{ Item: 'Orange', Qty: 15, Price: 2.00, Total: 30.00 },
|
|
8
|
+
{ Item: 'Grapes', Qty: 8, Price: 3.00, Total: 24.00 },
|
|
9
|
+
{ Item: 'Mango', Qty: 5, Price: 4.50, Total: 22.50 }
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
let spreadsheet: Spreadsheet = new Spreadsheet({
|
|
13
|
+
sheets: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Inventory',
|
|
16
|
+
rows: [
|
|
17
|
+
{
|
|
18
|
+
index: 1,
|
|
19
|
+
cells: [
|
|
20
|
+
{ value: 'Item' }, { value: 'Qty' }, { value: 'Price' }, { value: 'Total' }
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
...data.map((row: any) => ({
|
|
24
|
+
cells: [
|
|
25
|
+
{ value: row.Item },
|
|
26
|
+
{ value: row.Qty },
|
|
27
|
+
{ value: row.Price, format: '$#,##0.00' },
|
|
28
|
+
{ formula: `=B${data.indexOf(row) + 2}*C${data.indexOf(row) + 2}`, format: '$#,##0.00' }
|
|
29
|
+
]
|
|
30
|
+
}))
|
|
31
|
+
],
|
|
32
|
+
columns: [
|
|
33
|
+
{ width: 120 }, { width: 80 }, { width: 100 }, { width: 100 }
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
spreadsheet.appendTo('#Spreadsheet');
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Chart, LineSeries, Category, Legend, Tooltip, DataLabel } from '@syncfusion/ej2-charts';
|
|
2
|
+
|
|
3
|
+
// Defines the data to be displayed in the Chart.
|
|
4
|
+
const data: object[] = [
|
|
5
|
+
{ month: 'Jan', sales: 35 }, { month: 'Feb', sales: 28 },
|
|
6
|
+
{ month: 'Mar', sales: 34 }, { month: 'Apr', sales: 32 },
|
|
7
|
+
{ month: 'May', sales: 40 }, { month: 'Jun', sales: 32 },
|
|
8
|
+
{ month: 'Jul', sales: 35 }, { month: 'Aug', sales: 55 },
|
|
9
|
+
{ month: 'Sep', sales: 38 }, { month: 'Oct', sales: 30 },
|
|
10
|
+
{ month: 'Nov', sales: 25 }, { month: 'Dec', sales: 32 }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
let chart: Chart = new Chart({
|
|
14
|
+
primaryXAxis: {
|
|
15
|
+
valueType: 'Category',
|
|
16
|
+
title: 'Months'
|
|
17
|
+
},
|
|
18
|
+
primaryYAxis: {
|
|
19
|
+
title: 'Sales (in percentage)',
|
|
20
|
+
minimum: 0,
|
|
21
|
+
maximum: 100,
|
|
22
|
+
interval: 10
|
|
23
|
+
},
|
|
24
|
+
series: [
|
|
25
|
+
{
|
|
26
|
+
dataSource: data,
|
|
27
|
+
xName: 'month',
|
|
28
|
+
yName: 'sales',
|
|
29
|
+
name: 'Sales',
|
|
30
|
+
type: 'Line',
|
|
31
|
+
marker: { visible: true, width: 10, height: 10 }
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
title: 'Monthly Sales Analysis'
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
chart.appendTo('#Chart');
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Diagram, NodeModel, ConnectorModel, DataBinding, HierarchicalTree, LayoutAnimation } from '@syncfusion/ej2-diagrams';
|
|
2
|
+
|
|
3
|
+
// Defines the nodes to be displayed in the Diagram.
|
|
4
|
+
const nodes: NodeModel[] = [
|
|
5
|
+
{ id: 'node1', width: 100, height: 50, offsetX: 100, offsetY: 100, annotations: [{ content: 'Start' }] },
|
|
6
|
+
{ id: 'node2', width: 100, height: 50, offsetX: 300, offsetY: 100, annotations: [{ content: 'Process' }] },
|
|
7
|
+
{ id: 'node3', width: 100, height: 50, offsetX: 500, offsetY: 100, annotations: [{ content: 'Decision' }] },
|
|
8
|
+
{ id: 'node4', width: 100, height: 50, offsetX: 300, offsetY: 250, annotations: [{ content: 'End' }] }
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// Defines the connectors between the nodes.
|
|
12
|
+
const connectors: ConnectorModel[] = [
|
|
13
|
+
{ id: 'conn1', sourceID: 'node1', targetID: 'node2' },
|
|
14
|
+
{ id: 'conn2', sourceID: 'node2', targetID: 'node3' },
|
|
15
|
+
{ id: 'conn3', sourceID: 'node3', targetID: 'node4' }
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
let diagram: Diagram = new Diagram({
|
|
19
|
+
width: '100%',
|
|
20
|
+
height: '600px',
|
|
21
|
+
nodes: nodes,
|
|
22
|
+
connectors: connectors,
|
|
23
|
+
getNodeDefaults: (node: NodeModel) => {
|
|
24
|
+
node.style = { fill: '#026EEE', strokeColor: '#026EEE', strokeWidth: 2 };
|
|
25
|
+
node.annotations[0].style = { color: 'white', fill: 'transparent' };
|
|
26
|
+
return node;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
diagram.appendTo('#Diagram');
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DocumentEditor, Editor, Selection, EditorHistory, Toc, TableOfContents, Toolbar, SpellChecker, Search } from '@syncfusion/ej2-documenteditor';
|
|
2
|
+
|
|
3
|
+
// Default content for the Document Editor.
|
|
4
|
+
const defaultDocument: object = {
|
|
5
|
+
"sections": [
|
|
6
|
+
{
|
|
7
|
+
"blocks": [
|
|
8
|
+
{
|
|
9
|
+
"paragraphFormat": { "styleName": "Normal" },
|
|
10
|
+
"inlines": [
|
|
11
|
+
{ "text": "Hello, this is the Syncfusion Document Editor in TypeScript!" }
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
let editor: DocumentEditor = new DocumentEditor({
|
|
20
|
+
isReadOnly: false,
|
|
21
|
+
enableSelection: true,
|
|
22
|
+
enableEditorHistory: true,
|
|
23
|
+
enableSfdtTextExport: true,
|
|
24
|
+
enableWordExport: true,
|
|
25
|
+
enableTextExport: true,
|
|
26
|
+
enablePrint: true
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
editor.appendTo('#DocumentEditor');
|
|
30
|
+
editor.open(JSON.stringify(defaultDocument));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FileManager, NavigationPane, Toolbar, DetailsView } from '@syncfusion/ej2-filemanager';
|
|
2
|
+
|
|
3
|
+
// Defines the file system data for the File Manager.
|
|
4
|
+
const fileData: object[] = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Documents',
|
|
7
|
+
type: 'folder',
|
|
8
|
+
size: 0,
|
|
9
|
+
dateCreated: new Date('2025-01-01'),
|
|
10
|
+
dateModified: new Date('2025-01-10'),
|
|
11
|
+
hasChild: true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'Pictures',
|
|
15
|
+
type: 'folder',
|
|
16
|
+
size: 0,
|
|
17
|
+
dateCreated: new Date('2025-01-05'),
|
|
18
|
+
dateModified: new Date('2025-01-08'),
|
|
19
|
+
hasChild: false
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Report.pdf',
|
|
23
|
+
type: '.pdf',
|
|
24
|
+
size: 2048,
|
|
25
|
+
dateCreated: new Date('2025-01-15'),
|
|
26
|
+
dateModified: new Date('2025-01-15'),
|
|
27
|
+
hasChild: false
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
let filemanager: FileManager = new FileManager({
|
|
32
|
+
ajaxSettings: {
|
|
33
|
+
url: 'https://ej2services.syncfusion.com/production/web-services/api/FileManager/FileOperations',
|
|
34
|
+
getImageUrl: 'https://ej2services.syncfusion.com/production/web-services/api/FileManager/GetImage',
|
|
35
|
+
uploadUrl: 'https://ej2services.syncfusion.com/production/web-services/api/FileManager/Upload',
|
|
36
|
+
downloadUrl: 'https://ej2services.syncfusion.com/production/web-services/api/FileManager/Download'
|
|
37
|
+
},
|
|
38
|
+
view: 'Details'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
filemanager.appendTo('#FileManager');
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Gantt, Edit, Selection, Toolbar, Filter, Sort, Resize, Reorder } from '@syncfusion/ej2-gantt';
|
|
2
|
+
|
|
3
|
+
// Defines the data to be displayed in the Gantt chart.
|
|
4
|
+
const data: object[] = [
|
|
5
|
+
{
|
|
6
|
+
TaskID: 1,
|
|
7
|
+
TaskName: 'Project Initiation',
|
|
8
|
+
StartDate: new Date('2025-01-04'),
|
|
9
|
+
Duration: 5,
|
|
10
|
+
Progress: 50,
|
|
11
|
+
ParentID: null
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
TaskID: 2,
|
|
15
|
+
TaskName: 'Identify Stakeholders',
|
|
16
|
+
StartDate: new Date('2025-01-04'),
|
|
17
|
+
Duration: 3,
|
|
18
|
+
Progress: 30,
|
|
19
|
+
ParentID: 1
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
TaskID: 3,
|
|
23
|
+
TaskName: 'Project Planning',
|
|
24
|
+
StartDate: new Date('2025-01-06'),
|
|
25
|
+
Duration: 7,
|
|
26
|
+
Progress: 40,
|
|
27
|
+
ParentID: 1
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
TaskID: 4,
|
|
31
|
+
TaskName: 'Define Scope',
|
|
32
|
+
StartDate: new Date('2025-01-06'),
|
|
33
|
+
Duration: 4,
|
|
34
|
+
Progress: 25,
|
|
35
|
+
ParentID: 3
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
TaskID: 5,
|
|
39
|
+
TaskName: 'Design Phase',
|
|
40
|
+
StartDate: new Date('2025-01-13'),
|
|
41
|
+
Duration: 10,
|
|
42
|
+
Progress: 0,
|
|
43
|
+
ParentID: null
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
TaskID: 6,
|
|
47
|
+
TaskName: 'UI Design',
|
|
48
|
+
StartDate: new Date('2025-01-13'),
|
|
49
|
+
Duration: 5,
|
|
50
|
+
Progress: 0,
|
|
51
|
+
ParentID: 5
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
TaskID: 7,
|
|
55
|
+
TaskName: 'Database Design',
|
|
56
|
+
StartDate: new Date('2025-01-18'),
|
|
57
|
+
Duration: 5,
|
|
58
|
+
Progress: 0,
|
|
59
|
+
ParentID: 5
|
|
60
|
+
}
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
let gantt: Gantt = new Gantt({
|
|
64
|
+
dataSource: data,
|
|
65
|
+
height: '450px',
|
|
66
|
+
taskFields: {
|
|
67
|
+
id: 'TaskID',
|
|
68
|
+
name: 'TaskName',
|
|
69
|
+
startDate: 'StartDate',
|
|
70
|
+
duration: 'Duration',
|
|
71
|
+
progress: 'Progress',
|
|
72
|
+
parentID: 'ParentID'
|
|
73
|
+
},
|
|
74
|
+
columns: [
|
|
75
|
+
{ field: 'TaskID', headerText: 'Task ID', width: 100 },
|
|
76
|
+
{ field: 'TaskName', headerText: 'Task Name', width: 250 },
|
|
77
|
+
{ field: 'StartDate', headerText: 'Start Date', width: 150 },
|
|
78
|
+
{ field: 'Duration', headerText: 'Duration', width: 100 },
|
|
79
|
+
{ field: 'Progress', headerText: 'Progress', width: 100 }
|
|
80
|
+
],
|
|
81
|
+
treeColumnIndex: 1,
|
|
82
|
+
allowSelection: true,
|
|
83
|
+
allowSorting: true,
|
|
84
|
+
allowFiltering: true,
|
|
85
|
+
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel']
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
gantt.appendTo('#Gantt');
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Grid, Page, Sort, Filter, Edit, Toolbar, Inject } from '@syncfusion/ej2-grids';
|
|
2
|
+
|
|
3
|
+
// Defines the data to be displayed in the Data Grid.
|
|
4
|
+
const data: object[] = [
|
|
5
|
+
{ OrderID: 10248, CustomerName: 'Ana Trujillo', OrderDate: new Date(2025, 0, 12), ShipCountry: 'France', Freight: 32.38 },
|
|
6
|
+
{ OrderID: 10249, CustomerName: 'Martin Sommer', OrderDate: new Date(2025, 0, 15), ShipCountry: 'Germany', Freight: 11.61 },
|
|
7
|
+
{ OrderID: 10250, CustomerName: 'Thomas Hardy', OrderDate: new Date(2025, 1, 5), ShipCountry: 'Brazil', Freight: 65.83 },
|
|
8
|
+
{ OrderID: 10251, CustomerName: 'Elizabeth Lincoln', OrderDate: new Date(2025, 1, 18), ShipCountry: 'France', Freight: 41.34 },
|
|
9
|
+
{ OrderID: 10252, CustomerName: 'Victoria Ashworth', OrderDate: new Date(2025, 2, 10), ShipCountry: 'Belgium', Freight: 51.30 },
|
|
10
|
+
{ OrderID: 10253, CustomerName: 'Martine Rance', OrderDate: new Date(2025, 2, 22), ShipCountry: 'Brazil', Freight: 58.17 },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
let grid: Grid = new Grid({
|
|
14
|
+
dataSource: data,
|
|
15
|
+
allowPaging: true,
|
|
16
|
+
allowSorting: true,
|
|
17
|
+
allowFiltering: true,
|
|
18
|
+
pageSettings: { pageSize: 5 },
|
|
19
|
+
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'],
|
|
20
|
+
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true },
|
|
21
|
+
columns: [
|
|
22
|
+
{ field: 'OrderID', headerText: 'Order ID', width: 120, textAlign: 'Right', type: 'number', isPrimaryKey: true },
|
|
23
|
+
{ field: 'CustomerName', headerText: 'Customer Name', width: 140, type: 'string' },
|
|
24
|
+
{ field: 'OrderDate', headerText: 'Order Date', width: 140, format: 'yMd', textAlign: 'Right' },
|
|
25
|
+
{ field: 'Freight', headerText: 'Freight', width: 120, textAlign: 'Right', format: 'C' },
|
|
26
|
+
{ field: 'ShipCountry', headerText: 'Ship Country', width: 140, type: 'string' },
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
grid.appendTo('#Grid');
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner } from '@syncfusion/ej2-pdfviewer';
|
|
2
|
+
|
|
3
|
+
let viewer: PdfViewer = new PdfViewer({
|
|
4
|
+
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
|
|
5
|
+
resourceUrl: 'https://cdn.syncfusion.com/ej2/27.2.4/dist/ej2-pdfviewer-lib'
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
viewer.appendTo('#PdfViewer');
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop } from '@syncfusion/ej2-schedule';
|
|
2
|
+
|
|
3
|
+
// Defines the data to be displayed in the Scheduler.
|
|
4
|
+
const data: object[] = [
|
|
5
|
+
{
|
|
6
|
+
Id: 1,
|
|
7
|
+
Subject: 'Project Planning',
|
|
8
|
+
StartTime: new Date(2025, 0, 6, 9, 0),
|
|
9
|
+
EndTime: new Date(2025, 0, 6, 11, 0),
|
|
10
|
+
Location: 'Conference Room 1',
|
|
11
|
+
Description: 'Initial project planning meeting'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
Id: 2,
|
|
15
|
+
Subject: 'Client Meeting',
|
|
16
|
+
StartTime: new Date(2025, 0, 7, 14, 0),
|
|
17
|
+
EndTime: new Date(2025, 0, 7, 16, 0),
|
|
18
|
+
Location: 'Board Room',
|
|
19
|
+
Description: 'Quarterly review with the client'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
Id: 3,
|
|
23
|
+
Subject: 'Team Standup',
|
|
24
|
+
StartTime: new Date(2025, 0, 8, 10, 0),
|
|
25
|
+
EndTime: new Date(2025, 0, 8, 10, 30),
|
|
26
|
+
Location: 'Virtual',
|
|
27
|
+
Description: 'Daily team sync-up'
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
let schedule: Schedule = new Schedule({
|
|
32
|
+
width: '100%',
|
|
33
|
+
height: '650px',
|
|
34
|
+
views: ['Day', 'Week', 'WorkWeek', 'Month', 'Agenda'],
|
|
35
|
+
selectedDate: new Date(2025, 0, 6),
|
|
36
|
+
eventSettings: { dataSource: data }
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
schedule.appendTo('#Scheduler');
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="control-pane" style="padding: 70px; margin: 0 auto">
|
|
3
|
+
<ejs-chart
|
|
4
|
+
id="charts"
|
|
5
|
+
:title="title"
|
|
6
|
+
:subTitle="subTitle"
|
|
7
|
+
:primaryXAxis="primaryXAxis"
|
|
8
|
+
:primaryYAxis="primaryYAxis"
|
|
9
|
+
:legendSettings="legendSettings"
|
|
10
|
+
:tooltip="tooltip"
|
|
11
|
+
:chartArea="chartArea"
|
|
12
|
+
:width="width"
|
|
13
|
+
:load="load"
|
|
14
|
+
>
|
|
15
|
+
<e-series-collection>
|
|
16
|
+
<e-series
|
|
17
|
+
:dataSource="vietnamData"
|
|
18
|
+
xName="x"
|
|
19
|
+
yName="y"
|
|
20
|
+
name="Vietnam"
|
|
21
|
+
type="Line"
|
|
22
|
+
:width="2"
|
|
23
|
+
:marker="circleMarker"
|
|
24
|
+
:labelSettings="labelSettings"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<e-series
|
|
28
|
+
:dataSource="indonesiaData"
|
|
29
|
+
xName="x"
|
|
30
|
+
yName="y"
|
|
31
|
+
name="Indonesia"
|
|
32
|
+
type="Line"
|
|
33
|
+
:width="2"
|
|
34
|
+
:marker="triangleMarker"
|
|
35
|
+
:labelSettings="labelSettings"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<e-series
|
|
39
|
+
:dataSource="franceData"
|
|
40
|
+
xName="x"
|
|
41
|
+
yName="y"
|
|
42
|
+
name="France"
|
|
43
|
+
type="Line"
|
|
44
|
+
:width="2"
|
|
45
|
+
:marker="diamondMarker"
|
|
46
|
+
:labelSettings="labelSettings"
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<e-series
|
|
50
|
+
:dataSource="polandData"
|
|
51
|
+
xName="x"
|
|
52
|
+
yName="y"
|
|
53
|
+
name="Poland"
|
|
54
|
+
type="Line"
|
|
55
|
+
:width="2"
|
|
56
|
+
:marker="rectangleMarker"
|
|
57
|
+
:labelSettings="labelSettings"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<e-series
|
|
61
|
+
:dataSource="mexicoData"
|
|
62
|
+
xName="x"
|
|
63
|
+
yName="y"
|
|
64
|
+
name="Mexico"
|
|
65
|
+
type="Line"
|
|
66
|
+
:width="2"
|
|
67
|
+
:marker="pentagonMarker"
|
|
68
|
+
:labelSettings="labelSettings"
|
|
69
|
+
/>
|
|
70
|
+
</e-series-collection>
|
|
71
|
+
</ejs-chart>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script lang="ts">
|
|
76
|
+
import { Browser } from '@syncfusion/ej2-base';
|
|
77
|
+
import {
|
|
78
|
+
ChartComponent,
|
|
79
|
+
SeriesCollectionDirective,
|
|
80
|
+
SeriesDirective,
|
|
81
|
+
LineSeries,
|
|
82
|
+
Double,
|
|
83
|
+
Legend,
|
|
84
|
+
Tooltip,
|
|
85
|
+
Highlight,
|
|
86
|
+
SeriesLabel
|
|
87
|
+
} from '@syncfusion/ej2-vue-charts';
|
|
88
|
+
import { defineComponent } from 'vue';
|
|
89
|
+
|
|
90
|
+
interface ChartPoint {
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export default defineComponent({
|
|
96
|
+
name: 'Chart',
|
|
97
|
+
components: {
|
|
98
|
+
'ejs-chart': ChartComponent,
|
|
99
|
+
'e-series-collection': SeriesCollectionDirective,
|
|
100
|
+
'e-series': SeriesDirective
|
|
101
|
+
},
|
|
102
|
+
provide: {
|
|
103
|
+
chart: [LineSeries, Double, Legend, Tooltip, Highlight, SeriesLabel]
|
|
104
|
+
},
|
|
105
|
+
data() {
|
|
106
|
+
return {
|
|
107
|
+
vietnamData: [
|
|
108
|
+
{ x: 2016, y: 7.8 },
|
|
109
|
+
{ x: 2017, y: 10.3 },
|
|
110
|
+
{ x: 2018, y: 15.5 },
|
|
111
|
+
{ x: 2019, y: 17.5 },
|
|
112
|
+
{ x: 2020, y: 19.5 },
|
|
113
|
+
{ x: 2021, y: 23.0 },
|
|
114
|
+
{ x: 2022, y: 20.0 },
|
|
115
|
+
{ x: 2023, y: 19.0 },
|
|
116
|
+
{ x: 2024, y: 22.1 }
|
|
117
|
+
] as ChartPoint[],
|
|
118
|
+
|
|
119
|
+
indonesiaData: [
|
|
120
|
+
{ x: 2016, y: 4.8 },
|
|
121
|
+
{ x: 2017, y: 5.2 },
|
|
122
|
+
{ x: 2018, y: 6.2 },
|
|
123
|
+
{ x: 2019, y: 7.8 },
|
|
124
|
+
{ x: 2020, y: 9.3 },
|
|
125
|
+
{ x: 2021, y: 14.3 },
|
|
126
|
+
{ x: 2022, y: 15.6 },
|
|
127
|
+
{ x: 2023, y: 16.0 },
|
|
128
|
+
{ x: 2024, y: 17.0 }
|
|
129
|
+
] as ChartPoint[],
|
|
130
|
+
|
|
131
|
+
franceData: [
|
|
132
|
+
{ x: 2016, y: 14.6 },
|
|
133
|
+
{ x: 2017, y: 15.5 },
|
|
134
|
+
{ x: 2018, y: 15.4 },
|
|
135
|
+
{ x: 2019, y: 14.4 },
|
|
136
|
+
{ x: 2020, y: 11.6 },
|
|
137
|
+
{ x: 2021, y: 13.9 },
|
|
138
|
+
{ x: 2022, y: 12.1 },
|
|
139
|
+
{ x: 2023, y: 10.0 },
|
|
140
|
+
{ x: 2024, y: 10.8 }
|
|
141
|
+
] as ChartPoint[],
|
|
142
|
+
|
|
143
|
+
polandData: [
|
|
144
|
+
{ x: 2016, y: 8.9 },
|
|
145
|
+
{ x: 2017, y: 10.3 },
|
|
146
|
+
{ x: 2018, y: 10.8 },
|
|
147
|
+
{ x: 2019, y: 9.0 },
|
|
148
|
+
{ x: 2020, y: 7.9 },
|
|
149
|
+
{ x: 2021, y: 8.5 },
|
|
150
|
+
{ x: 2022, y: 7.4 },
|
|
151
|
+
{ x: 2023, y: 6.4 },
|
|
152
|
+
{ x: 2024, y: 7.1 }
|
|
153
|
+
] as ChartPoint[],
|
|
154
|
+
|
|
155
|
+
mexicoData: [
|
|
156
|
+
{ x: 2016, y: 19.0 },
|
|
157
|
+
{ x: 2017, y: 20.0 },
|
|
158
|
+
{ x: 2018, y: 20.2 },
|
|
159
|
+
{ x: 2019, y: 18.4 },
|
|
160
|
+
{ x: 2020, y: 16.8 },
|
|
161
|
+
{ x: 2021, y: 18.5 },
|
|
162
|
+
{ x: 2022, y: 18.4 },
|
|
163
|
+
{ x: 2023, y: 16.3 },
|
|
164
|
+
{ x: 2024, y: 13.7 }
|
|
165
|
+
] as ChartPoint[],
|
|
166
|
+
|
|
167
|
+
title: 'Annual Crude Steel Production by Country (2016–2024)',
|
|
168
|
+
subTitle: 'Source: wikipedia.org',
|
|
169
|
+
|
|
170
|
+
primaryXAxis: {
|
|
171
|
+
valueType: 'Double',
|
|
172
|
+
interval: 1,
|
|
173
|
+
majorGridLines: { width: 0 },
|
|
174
|
+
edgeLabelPlacement: 'Shift'
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
primaryYAxis: {
|
|
178
|
+
title: 'Volume in million metric tons',
|
|
179
|
+
minimum: 0,
|
|
180
|
+
maximum: 25,
|
|
181
|
+
interval: 5,
|
|
182
|
+
lineStyle: { width: 0 },
|
|
183
|
+
majorTickLines: { width: 0 }
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
legendSettings: {
|
|
187
|
+
visible: true,
|
|
188
|
+
enableHighlight: true
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
tooltip: {
|
|
192
|
+
enable: true,
|
|
193
|
+
shared: true
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
chartArea: {
|
|
197
|
+
border: { width: 0 }
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
circleMarker: {
|
|
201
|
+
visible: true,
|
|
202
|
+
width: 7,
|
|
203
|
+
height: 7,
|
|
204
|
+
isFilled: true,
|
|
205
|
+
shape: 'Circle'
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
triangleMarker: {
|
|
209
|
+
visible: true,
|
|
210
|
+
width: 6,
|
|
211
|
+
height: 6,
|
|
212
|
+
isFilled: true,
|
|
213
|
+
shape: 'Triangle'
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
diamondMarker: {
|
|
217
|
+
visible: true,
|
|
218
|
+
width: 7,
|
|
219
|
+
height: 7,
|
|
220
|
+
isFilled: true,
|
|
221
|
+
shape: 'Diamond'
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
rectangleMarker: {
|
|
225
|
+
visible: true,
|
|
226
|
+
width: 5,
|
|
227
|
+
height: 5,
|
|
228
|
+
isFilled: true,
|
|
229
|
+
shape: 'Rectangle'
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
pentagonMarker: {
|
|
233
|
+
visible: true,
|
|
234
|
+
width: 7,
|
|
235
|
+
height: 7,
|
|
236
|
+
isFilled: true,
|
|
237
|
+
shape: 'Pentagon'
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
labelSettings: {
|
|
241
|
+
visible: true
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
width: Browser.isDevice ? '100%' : '75%'
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
methods: {
|
|
248
|
+
load(args: any): void {
|
|
249
|
+
const selectedTheme = location.hash.split('/')[1];
|
|
250
|
+
const theme = selectedTheme ? selectedTheme : 'Material';
|
|
251
|
+
args.chart.theme = (theme.charAt(0).toUpperCase() + theme.slice(1))
|
|
252
|
+
.replace(/-dark/i, 'Dark')
|
|
253
|
+
.replace(/contrast/i, 'Contrast');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
</script>
|