/
PivotGridConfigGenerator.ts
101 lines (93 loc) · 5.39 KB
/
PivotGridConfigGenerator.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable max-len */
import {
Router,
RouterModule
} from '@angular/router';
import {
IgxPivotGridModule,
IgxTooltipModule,
IgxToastModule,
IgxSwitchModule,
IgxExcelExporterService
} from 'igniteui-angular';
import { AppModuleConfig, Config, IConfigGenerator } from 'igniteui-live-editing';
export class PivotGridConfigGenerator implements IConfigGenerator {
public additionalImports = {
IgxPreventDocumentScrollModule: '../../src/app/directives/prevent-scroll.directive',
PivotDataService: '../../src/app/services/pivotRemoteData.service'
};
public generateConfigs(): Config[] {
const configs = new Array<Config>();
configs.push(new Config({
additionalFiles: ['/src/app/directives/prevent-scroll.directive.ts', '/src/app/data/pivot-data.ts'],
appModuleConfig: new AppModuleConfig({
imports: ['IgxPivotGridModule', 'PivotGridBasicSampleComponent', 'IgxPreventDocumentScrollModule'],
ngDeclarations: ['PivotGridBasicSampleComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxPivotGridModule']
}),
component: 'PivotGridBasicSampleComponent'
}));
configs.push(new Config({
additionalFiles: ['/src/app/directives/prevent-scroll.directive.ts', '/src/app/data/dataToAnalyze.ts'],
appModuleConfig: new AppModuleConfig({
imports: ['IgxPivotGridModule', 'PivotExportComponent', 'IgxPreventDocumentScrollModule', 'IgxExcelExporterService'],
ngDeclarations: ['PivotExportComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxPivotGridModule'],
ngProviders: ['IgxExcelExporterService']
}),
component: 'PivotExportComponent'
}));
configs.push(new Config({
additionalFiles: ['/src/app/directives/prevent-scroll.directive.ts', '/src/app/data/dataToAnalyze.ts'],
appModuleConfig: new AppModuleConfig({
imports: ['IgxPivotGridModule', 'PivotFeaturesComponent', 'IgxPreventDocumentScrollModule'],
ngDeclarations: ['PivotFeaturesComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxPivotGridModule']
}),
component: 'PivotFeaturesComponent'
}));
configs.push(new Config({
additionalFiles: ['/src/app/directives/prevent-scroll.directive.ts', '/src/app/data/dataToAnalyze.ts'],
appModuleConfig: new AppModuleConfig({
imports: ['IgxPivotGridModule', 'PivotGridStatePersistenceSampleComponent', 'PivotGridAboutComponent', 'IgxPreventDocumentScrollModule', 'IgxTooltipModule',
'IgxToastModule', 'IgxSwitchModule', 'Router', 'RouterModule'],
ngDeclarations: ['PivotGridStatePersistenceSampleComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxPivotGridModule', 'IgxTooltipModule', 'PivotGridAboutComponent',
'RouterModule.forRoot([\{component: PivotGridAboutComponent, path: \'pivot-grid-about\'},\{component: PivotGridStatePersistenceSampleComponent, path: \'pivot-grid-state-persistance\'},\{ path: \'\', redirectTo: \'/pivot-grid-state-persistance\', pathMatch: \'full\' }])',
'IgxToastModule', 'IgxSwitchModule']
}),
component: 'PivotGridStatePersistenceSampleComponent'
}));
configs.push(new Config({
additionalFiles: ['/src/app/directives/prevent-scroll.directive.ts', '/src/app/data/pivot-data-noop.ts', '/src/app/services/pivotRemoteData.service.ts'],
appModuleConfig: new AppModuleConfig({
imports: ['IgxPivotGridModule', 'PivotGridNoopSampleComponent', 'IgxPreventDocumentScrollModule', 'PivotDataService'],
ngDeclarations: ['PivotGridNoopSampleComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxPivotGridModule'],
ngProviders: ['PivotDataService']
}),
component: 'PivotGridNoopSampleComponent'
}));
configs.push(new Config({
additionalFiles: ['/src/app/directives/prevent-scroll.directive.ts', '/src/app/data/pivot-data-noop.ts', '/src/app/services/pivotRemoteData.service.ts'],
appModuleConfig: new AppModuleConfig({
imports: ['IgxPivotGridModule', 'PivotGridNoopPersistenceSampleComponent', 'IgxPreventDocumentScrollModule', 'PivotDataService'],
ngDeclarations: ['PivotGridNoopPersistenceSampleComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxPivotGridModule'],
ngProviders: ['PivotDataService']
}),
component: 'PivotGridNoopPersistenceSampleComponent'
}));
configs.push(new Config({
additionalFiles: ['/src/app/directives/prevent-scroll.directive.ts', '/src/app/data/salesDataNew.ts'],
appModuleConfig: new AppModuleConfig({
imports: ['IgxPivotGridModule', 'PivotDataSelectorSampleComponent', 'IgxPreventDocumentScrollModule'],
ngDeclarations: ['PivotDataSelectorSampleComponent'],
ngImports: ['IgxPreventDocumentScrollModule', 'IgxPivotGridModule']
}),
component: 'PivotDataSelectorSampleComponent'
}));
return configs;
}
}